We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在home_page.dart中,我想在判断用户未登录后,直接跳转到login路由,修改代码如下: //注释掉原代码中的return,添加 Navigator.of(context).pushNamed("login"); if (!userModel.isLogin) { Navigator.of(context).pushNamed("login"); // return Center( // child: RaisedButton( // child: Text(GmLocalizations.of(context).login), // onPressed: () => Navigator.of(context).pushNamed("login"), // ), // ); } 但由于body部分必须要return一个widget,所以上述代码报错。 请问如果要实现上述意图,代码如何操作,谢谢?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
在home_page.dart中,我想在判断用户未登录后,直接跳转到login路由,修改代码如下:
//注释掉原代码中的return,添加 Navigator.of(context).pushNamed("login");
if (!userModel.isLogin) {
Navigator.of(context).pushNamed("login");
// return Center(
// child: RaisedButton(
// child: Text(GmLocalizations.of(context).login),
// onPressed: () => Navigator.of(context).pushNamed("login"),
// ),
// );
}
但由于body部分必须要return一个widget,所以上述代码报错。
请问如果要实现上述意图,代码如何操作,谢谢?
The text was updated successfully, but these errors were encountered: