whatever you define as a route animation it would be reverse and use as pop navigation .
in your case you can use different animations for pushing each one .
you can create your custom one and define the animation and use it instead of material page router
import 'package:flutter/material.dart';
class MyCustomRoute extends PageRouteBuilder {
final Widget widget;
MyCustomRoute({this.widget})
: super(
pageBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) {
return widget;
},
transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
return new ScaleTransition(
scale: new Tween<double>(
begin: 0.0,
end: 1.0,
).animate(
CurvedAnimation(
parent: animation,
curve: Interval(
0.00,
0.50,
curve: Curves.bounceIn,
),
),
),
child: ScaleTransition(
scale: Tween<double>(
begin: 1.5,
end: 1.0,
).animate(
CurvedAnimation(
parent: animation,
curve: Interval(
0.50,
1.00,
curve: Curves.easeIn,
),
),
),
child: child,
),
);
}
);
}
to implement
onPressed: () {
Navigator.push(context,
new MyCustomRoute (widget: Secondpage()));
},
to pop
onPressed: () {
Navigator.pop();// will reverse the animation
},