定义路由
// 在Scaffold中定义路由,如下
routes: <String, WidgetBuilder>{
// less 路由名称 ,StatelessGroupPage() 要跳转的实例page
'less': (BuildContext context) => StatelessGroupPage(),
'full': (BuildContext context) => StateFullGroupPage(),
}
路由跳转
// 根据路由名称跳转 routerName:'less' 'full'
Navigator.pushNamed(context, routerName);
导航跳转
// 导航直接跳转 page实例: StatelessGroupPage() StateFullGroupPage()
Navigator.push(context, MaterialPageRoute(builder:(context)=>page))