Closed komputerboy closed 5 years ago
Hi @komputerboy,
I tried on both ios simulator and android emulator but unable to reproduce the issue.
Is this happens for every signups?
Thanks, David
Hello @komputerboy ,
This is my log. Seems there is no auth state listeners in your failed case.
D/FirebaseAuth(15911): Notifying id token listeners about a sign-out event. D/FirebaseAuth(15911): Notifying auth state listeners about a sign-out event. D/FirebaseApp(15911): Notifying auth state listeners. D/FirebaseApp(15911): Notified 1 auth state listeners. I/zygote (15911): Do full code cache collection, code=122KB, data=92KB I/zygote (15911): After code cache collection, code=107KB, data=63KB W/BiChannelGoogleApi(15911): [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzal@2b6a891 D/FirebaseAuth(15911): Notifying id token listeners about user ( 2JLdqctPKAd3em0Ksy7xKVj5nxr2 ). D/FirebaseApp(15911): Notifying auth state listeners. D/FirebaseApp(15911): Notified 1 auth state listeners. D/FirebaseAuth(15911): Notifying auth state listeners about user ( 2JLdqctPKAd3em0Ksy7xKVj5nxr2 ). I/flutter (15911): Signed in: 2JLdqctPKAd3em0Ksy7xKVj5nxr2
Hello @komputerboy ,
Finally I am able to reproduce the issue. Criteria is i have to uninstall the app first.
So this is due to the asynchronous event of the following:
void _onLoggedIn() { widget.auth.getCurrentUser().then((user){ _userId = user.uid.toString(); }); setState(() { authStatus = AuthStatus.LOGGED_IN; }); }
The event will not wait to retrieving uid to be completed, hence the uid is null. And in the build method, when AuthStatus.IS_LOGGED_IN, there is a check whether the uid is empty or not. Hence returning loading screen. When the async event is completed, and the valid uid is retrieve, there is no way the program knows the updated uid as there is not set state. To fix this, we simply wrap it with a setstate.
I have pushed the fix 8ee46f23cbce2f5179fc035af2f32ebf6d6a5883, kindly resync and validate. Thanks for reporting issue.
Regards, David
thanks, i will try it..
okay, now it fixed. I will close it
Hi,
Now i push another issue. I stuck in loading animation after login. But when i close it, then open it again, this app is getting to home page(login succes). This is what i got:
My Environment is:
Try to build it with: Android Studio 3.1.3
I have tried it in three phone, but still get same issue.
Thanks