定义路由
// 在 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))