标签:caff cas rate default str context ssi tle def
可以传参的,相比于命名路由,可以多做一些相关的拦截
onGenerateRoute: (RouteSettings settings) {
String routeName = settings.name;
print("Open page: $routeName");
// Check permissions
switch (routeName) {
case "/":
return MaterialPageRoute(builder: (context) {
return HomePage(title: "Home");
});
case "settings":
return MaterialPageRoute(builder: (context) {
return SettingsPage(settings.arguments);
});
default:
return MaterialPageRoute(builder: (BuildContext context) {
return Scaffold(
body: Center(
child: Text("Page not found"),
));
});
}
标签:caff cas rate default str context ssi tle def
原文地址:https://www.cnblogs.com/seliote/p/12833475.html