0 purchases
easy push
Easy Push Package #
This package gives you easy navigation with beautiful transitions
Demo #
Usage #
It is really easy to use!
You should ensure that you add the easy_push as a dependency in your flutter project.
dependencies:
easy_push: ^0.0.3
Than you can use it with below examples.
Push.to(Home(), context);
Push.to(Home(), context, transitionType: Transition.fadeIn);
copied to clipboard
Usage for predefined routes #
First, define the onGenerateRoute property in the MaterialApp widget like below and in switch cases you can transition to your new routes:
onGenerateRoute: (settings) {
switch (settings.name) {
case '/second':
return PageTransition(child: SecondPage(), type: PageTransitionType.scale);
break;
default:
return null;
}
},
copied to clipboard
After that you can use your new route like this:
Push.toNamed( '/second',context);
copied to clipboard
Usage predefined routes with RouteSettings #
First, define the onGenerateRoute property in the MaterialApp widget like below and in switch cases you can transition to your new routes:
onGenerateRoute: (settings) {
switch (settings.name) {
case '/second':
return PageTransition(
child: SecondPage(),
type: PageTransitionType.scale,
settings: settings,
);
break;
default:
return null;
}
},
copied to clipboard
After that you can use your new route like this:
Push.toNamed( '/second', context,arguments: "arguments data");
copied to clipboard
for more detail you can look example project.
Types of transitions #
fade
rightToLeft
leftToRight
topToBottom
bottomToTop
scale (with alignment)
rotate (with alignment)
size (with alignment)
rightToLeftWithFade,
leftToRightWithFade,
leftToRightJoined,
rightToLeftJoined,
Curves #
You can use any type of CurvedAnimation curves.
Alignments #
You can use size, scale and rotate transform alignment
Contributing #
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License #
BSD 2-Clause
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.