Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firebase_auth 0.18.0+1 (Current Lastest) Breaks on Firebase Auth Facade "getSignedInUser()" Method #9

Closed
A1000carZ opened this issue Aug 22, 2020 · 1 comment

Comments

@A1000carZ
Copy link

A1000carZ commented Aug 22, 2020

  • Hello, Thanks for this video series of a clean arquitecture in flutter, I have an issue on

@override Future<Option<User>> getSignedInUser() => ...

  • When update to firebase 0.18.0+1 this method breaks

_firebaseAuth.currentUser().then((firebaseUser) => optionOf(firebaseUser?.toDomain()));

  • Because access to current user via currentUser () is now synchronous via currentUser in the new update.
@A1000carZ A1000carZ changed the title firebase_auth 0.18.0+1 (Current Lastest) Breaks on Firebase Auth Facade "getSignedInUser()" firebase_auth 0.18.0+1 (Current Lastest) Breaks on Firebase Auth Facade "getSignedInUser()" Method Aug 22, 2020
@A1000carZ
Copy link
Author

A1000carZ commented Aug 25, 2020

  • My solution to migrate to firebase 0.18.0+1 was change:

@override
Future<Option<User>> getSignedUser() => _firebaseAuth .currentUser() .then((firebaseUser)=> optionOf(firebaseUser?.toDomain()))

  • To:

@override
Future<Option<AppUser>> getSignedInUser() => Future.sync(() => optionOf(_firebaseAuth.currentUser?.toDomain()));

Hopefully this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant