【发布时间】:2021-03-02 02:24:19
【问题描述】:
不确定我是否在考虑这个问题。据我所知,如果用户已从 Firebase 后端删除,则 Streambuilder 应该将您注销。
我现在正在做的步骤-
- 正在加载应用程序
- 登录应用
- 正在加载 firebase 并从后端删除已登录的用户。
我相信这样做也会让我退出应用程序。对吗?
这是我的代码 -
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MaterialApp(
theme: ThemeData(
accentColor: Colors.orange,
primarySwatch: Colors.blue,
),
home: StreamBuilder(
stream: FirebaseAuth.instance.authStateChanges(),
builder: (context, snapshot) {
print(FirebaseAuth.instance.authStateChanges());
if (snapshot.connectionState == ConnectionState.active) {
var user = snapshot.data;
if (user == null) {
return Welcome();
}
return Conversations("Logged in");
}
)
));
}
【问题讨论】:
标签: firebase flutter firebase-authentication