context, MaterialPageRoute(builder: (context) => LayoutPage()));
二、路由信息注册
----
注册路由 : 在 MaterialApp 根节点组件中的...routes 字段注册路由 , 路由信息存储在 Map 集合中 , 键是路由名称 , 值是页面 Widget 组件 ;
代码示例 :
class MyApp...MaterialPageRoute(builder: (context) => LayoutPage()));
},
child: Text("通过导航跳转到页面1"),
),
五、退出界面
----
在 AppBar 组件中设置回退按钮点击事件...Navigator.pop(context);
},
child: Icon(Icons.arrow_back_ios),
),...Navigator.pop(context);
},
child: Icon(Icons.arrow_back_ios),
),