EZ Flutter provides a customizable loading screen to switch between to screens after some work is done.
Use the EzTransition to switch from Screen A to B after some work is done. The "work" is defined by the toProcess argument.
Create a method that does the work and use the Navigator to switch to the EzTransition Screen. Add a "loading" widget and the method as an argument.
void toProcess() async {
await new Future.delayed(const Duration(seconds: 3));
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MyNewScreen(),
));
}
FlatButton(
child: Text("Start transition"),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => EzTransition(EzPulse(), toProcess,backgroundColor: Colors.white)),
);
},
)
EZ Flutter offers some loading animations that can be used for the EzTransition.