Created
January 7, 2023 16:28
-
-
Save FlutterWiz/5986ba78dbc67ef275ee3ef0e45009b5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
Future<void> disconnectUser() async { | |
await streamChatClient.disconnectUser(); | |
} | |
@override | |
Future<void> connectTheCurrentUser() async { | |
final signedInUserOption = await _firebaseAuth.getSignedInUser(); | |
final signedInUser = signedInUserOption.fold( | |
() => throw Exception("Not authanticated"), | |
(user) => user, | |
); | |
await streamChatClient.connectUser( | |
User( | |
id: signedInUser.id, | |
name: signedInUser.userName, | |
image: signedInUser.photoUrl, | |
), | |
devToken, | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment