我的带有Firebase的Flutter应用面临注销功能问题

时间:2020-07-21 05:35:10

标签: firebase flutter dart

首次登录和退出都很顺利。但第二次登出无法使用,它会返回登录屏幕,按“登录”按钮后,无需凭据即可登录。 这是我的退出代码:

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

**This is error message**
The following NoSuchMethodError was thrown building Home(dirty, dependencies: [InheritedProvider<User>], state: HomeState#7b3a1):
The getter 'uid' was called on null.
Receiver: null
Tried calling: uid

The relevant error-causing widget was: 
  Home file:///home/nitesh/git-repo/AppOrganizable/nepal_kathbaniya/lib/loginScreen.dart:35:69
When the exception was thrown, this was the stack: 
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1      HomeState.build (package:nepalkathbaniya/homeScreen.dart:109:44)
#2      StatefulElement.build (package:flutter/src/widgets/framework.dart:4628:28)
#3      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4511:15)
#4      StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4684:11)
...

0 个答案:

没有答案