可以使用Future去包含路由跳转:
Future.delayed(Duration.zero,(){
Navigator.of(context).push(MaterialPageRoute(
builder: (BuildContext context) => routes.buildPage(path, params),
));
});
Future.delayed(Duration.zero,(){
Navigator.of(context).push(MaterialPageRoute(
settings: RouteSettings(name: path),
builder: (BuildContext context) => routes.buildPage(path, params),
fullscreenDialog: true,
));
});
Future.delayed(Duration.zero,(){
Navigator.of(context).pop();
});
网友评论