isLoggedIn property

Future<bool> get isLoggedIn

Implementation

Future<bool> get isLoggedIn async {
  try {
    emit(state.copy(isLoading: true));
    final signedIn = await handler.isSignIn();
    if (signedIn) {
      emit(state.copy(isSuccessful: true));
    } else {
      emit(state.copy(error: "User logged out!"));
    }
    return signedIn;
  } catch (e) {
    emit(state.copy(error: e.toString()));
    return Future.error(e);
  }
}