If you want to use other animation, you can use transitionBuilder
, in your PageRoute
. How you can use this represented for you below:
import 'package:flutter/material.dart';
main() {
runApp(MaterialApp(
home: Page1(),
));
}
class Page1 extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Center(
child: RaisedButton(
child: Text('Go!'),
onPressed: () {
Navigator.of(context).push(_createRoute());
},
),
),
);
}
}
Route _createRoute() {
return PageRouteBuilder(
pageBuilder: (context, animation, secondaryAnimation) => Page2(),
transitionsBuilder: (context, animation, secondaryAnimation, child) {
return child;
},
);
}
And if you want to transition instantly, you can do this:
transitionDuration: Duration(seconds: 0)
This will decrease down the transition time to 0 second, which will eventually results to quick transition speed.
To know more about Page Animation Transition
follow these articles:
- Page Route Animation
- Everything you need for Flutter Page Transition
You need to define something for your transition, if you don't want the default one, and this answer will help you achieve this.