xxxxxxxxxx
Future.delayed(Duration(seconds: 5), () {
// 5s over, navigate to a new page
Navigator.pushNamed(context, MaterialPageRoute(builder: (_) => Screen2()));
});
xxxxxxxxxx
Future.delayed(Duration(seconds: 5), () {
// do something after 5 seconds
});