首页 > 解决方案 > 当我从主页退出并重新启动应用程序时,它会返回主页(使用颤振)

问题描述

Future signOut() async {
    try {
      return await _auth.signOut();
    } catch (e) {
      print(e.toString());
      return null;
    }
  }
}

在 auth.dart authservice 类中使用这个函数

标签: flutterdart

解决方案


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.


推荐阅读