首页 > 解决方案 > 为什么 Flutter Streambuilder 小部件 ( onAuthStateChanged ) 对象给出红色下划线?

问题描述

我已经在我的颤振应用程序中从 firebase 导入了所有依赖项和包:

截屏

标签: firebaseflutterdartfirebase-authentication

解决方案


该方法onAuthStateChanged现在是您正在使用的版本中的authStateChanges

您需要从以下位置更改代码:

FirebaseAuth.instance.onAuthStateChanged

至:

FirebaseAuth.instance.authStateChanges

推荐阅读