Last updated:
0 purchases
route animation helper
screen_transitions #
Animate routes easily with AnimatedRoute Helper class.
Getting Started #
Flutter allows you to use pre-defined global transitions for example:
MaterialApp(
theme: ThemeData(
pageTransitionsTheme: PageTransitionsTheme(builders: {
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
TargetPlatform.android: CupertinoPageTransitionsBuilder(),
}),
...
)
copied to clipboard
You can customize transitions by supplying your own route, I have implemented a simple helper with pre-defined routes to make your life a bit easier.
Navigator.of(context).push(RouteAnimationHelper.createRoute(buildContext : context, destination : Screen2(), animType: AnimType.slideStart);
copied to clipboard
You choose one of the following types:
enum AnimType{
slideStart, slideBottom, scale, size, fade, rotate, cubic
}
copied to clipboard
Note that for cubic you must supply currentPage param.
Navigator.of(context).push(RouteAnimationHelper.createRoute(buildContext : context, currentPage: Screen1(), destination : Screen2(), animType: AnimType.cubic);
copied to clipboard
You can also supply a curve although Curves.ease - which is the default - is the best IMHO
Comments/Questions? contact me
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.