flutter - 当我从主页退出并重新启动应用程序时,它会返回主页(使用颤振)
问题描述
Future signOut() async {
try {
return await _auth.signOut();
} catch (e) {
print(e.toString());
return null;
}
}
}
在 auth.dart authservice 类中使用这个函数
解决方案
You should save bool value (about user is log in or log out) in Shared Preferences. So, when you open app you should check this value, if the user log out show welcome page, otherwise home page.
推荐阅读
- google-apps-script - 如何使用 Apps 脚本更改每页上打印的幻灯片数量
- php - PHP 多个要求,相同的功能
- kendo-grid - 如何在 Kendo Angular 6 Grid 中隐藏选定的组列,
- java - 如何用 firemonkey 更改字体 JPaint?
- go - 在编写可能最终被传递任何类型的结构的函数时,我可以使用接口作为参数吗?
- shortest-path - 沿多个点的最短路线
- javascript - 无法将事件侦听器添加到嵌套的 SVG 元素
- activemq-artemis - 重新启动 ActiveMQ Artemis 时删除的转移
- javascript - 如何使用 reduce 正确链接 promise
- azure - 在 web api 2 azure 网站中将 https www 重定向到 https 非 www