无法使用 Firebase Web Flutter 进行身份验证

时间:2021-04-06 07:06:49

标签: firebase flutter firebase-authentication

使用 adroid 应用程序进行身份验证工作正常。但是当我在我的应用程序的网络版本上进行身份验证时,我在终端中遇到了以下错误:

TypeError: Cannot read property 'findAncestorStateOfType' of null
    at Function.of (http://localhost:61698/packages/flutter/src/widgets/widget_span.dart.lib.js:22875:63)
    at Function.pop (http://localhost:61698/packages/flutter/src/widgets/widget_span.dart.lib.js:22846:28)
    at body._BodyState.new._validateRegisterInput (http://localhost:61698/packages/mn/Screens/Signup/components/body.dart.lib.js:1279:31)
    at _validateRegisterInput.throw (<anonymous>)
    at http://localhost:61698/dart_sdk.js:39038:38
    at _RootZone.runBinary (http://localhost:61698/dart_sdk.js:38894:58)
    at _FutureListener.thenAwait.handleError (http://localhost:61698/dart_sdk.js:33887:48)
    at handleError (http://localhost:61698/dart_sdk.js:34451:51)
    at Function._propagateToListeners (http://localhost:61698/dart_sdk.js:34477:17)
    at _Future.new.[_completeError] (http://localhost:61698/dart_sdk.js:34323:23)
    at async._AsyncCallbackEntry.new.callback (http://localhost:61698/dart_sdk.js:34362:31)
    at Object._microtaskLoop (http://localhost:61698/dart_sdk.js:39176:13)
    at _startMicrotaskLoop (http://localhost:61698/dart_sdk.js:39182:13)
    at http://localhost:61698/dart_sdk.js:34689:9

这个错误发生在这一行:

UserCredential result = await auth.createUserWithEmailAndPassword(email: email, password: password);

我的 Pubspec.yaml 文件库:

  cupertino_icons: ^1.0.2
  firebase_auth: ^1.0.1
  firebase_storage: ^8.0.1
  cloud_firestore: ^1.0.3
  device_info: ^2.0.0
  package_info: ^2.0.0
  shared_preferences: ^2.0.5
  fluttertoast: ^8.0.3
  another_flushbar: ^1.10.17
  flutter_svg: ^0.19.3
  image_picker: ^0.7.4
  firebase_auth_web: ^1.0.3

想不通..

0 个答案:

没有答案