修复游客登录到 home 页时没有传入 router 的 name的问题

修改「widget_demo」中 「Home」IconButton 的点击事件为返回到 '/home'
This commit is contained in:
王璐
2019-08-30 20:24:06 +08:00
parent b79dc14ddc
commit ab7eed4e50
2 changed files with 2 additions and 6 deletions

View File

@ -185,7 +185,7 @@ class _WidgetDemoState extends State<WidgetDemo> {
new IconButton(
tooltip: 'goBack home',
onPressed: () {
Navigator.popUntil(context, ModalRoute.withName('/'));
Navigator.popUntil(context, ModalRoute.withName(Routes.home));
},
icon: Icon(Icons.home),
),

View File

@ -388,11 +388,7 @@ class _LoginPageState extends State<LoginPage> {
decoration: TextDecoration.underline),
),
onPressed: () {
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(
builder: (context) =>
AppPage(UserInformation(id: 0))),
(route) => route == null);
Application.router.navigateTo(context, Routes.home, clearStack: true);
},
)
],