Skip to content

Instantly share code, notes, and snippets.

@FlutterWiz
Created January 8, 2023 12:46
Show Gist options
  • Save FlutterWiz/b5fbb4452a207a6c1523dc09351089d2 to your computer and use it in GitHub Desktop.
Save FlutterWiz/b5fbb4452a207a6c1523dc09351089d2 to your computer and use it in GitHub Desktop.
Future<void> signOut() async {
await _authService.signOut();
await _chatService.disconnectUser();
}
Future<void> _listenAuthStateChangesStream(AuthUserModel authUser) async {
emit(
state.copyWith(
isInProgress: true,
authUser: authUser,
isUserCheckedFromAuthService: true,
),
);
if (state.isLoggedIn) {
await _chatService.connectTheCurrentUser();
emit(state.copyWith(authUser: authUser, isInProgress: false));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment