flutter路由的使用

2018-11-20  本文已影响0人  王保全_1098
  runApp(new MaterialApp(
    title: 'ad',
    home: new SplashScreen(),
    routes: <String, WidgetBuilder>{
      '/main': (BuildContext context) => new MainScreen(),
      '/login': (BuildContext context) => new LoginScreen()
    },
  ));
 Navigator.pushNamed<String>(context, "nameRoute").then( (String value){
   //处理代码
});
Navigator.push<String>(context, new MaterialPageRoute(builder: (BuildContext context){
    return new ThirdPage(title:"请输入昵称");
  })).then( (String result){
       //处理代码
});
上一篇下一篇

猜你喜欢

热点阅读