Skip to content

Instantly share code, notes, and snippets.

@FlutterWiz
Created January 7, 2023 16:28
Show Gist options
  • Save FlutterWiz/5986ba78dbc67ef275ee3ef0e45009b5 to your computer and use it in GitHub Desktop.
Save FlutterWiz/5986ba78dbc67ef275ee3ef0e45009b5 to your computer and use it in GitHub Desktop.
@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