Flutter onAuthStateChanged在网络上不起作用

时间:2020-01-13 23:14:37

标签: firebase flutter firebase-authentication flutter-web

我正在尝试将Flutter应用迁移到网络中。 这段代码适用于应用程序。

FirebaseAuth.instance.onAuthStateChanged.listen((firebaseUser) {
  setState(() {
      user = firebaseUser;
  });
});

但是当我flutter run -d chrome时。在webview上运行它,出现错误:

══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following JSNoSuchMethodError was thrown building Builder:
NoSuchMethodError: invalid member on null: 'onAuthStateChanged'

The relevant error-causing widget was:
MaterialApp org-dartlang-app:///packages/app/home_app.dart:66:16

我当前正在使用firebase_auth: 0.15.3+1并使用此配置 firebase_auth_web tutorial

我想知道onAuthStateChange本身是否有问题?

0 个答案:

没有答案