Files
paperless-mobile/lib/features/login/cubit/authentication_state.dart
2023-07-30 23:51:00 +02:00

20 lines
619 B
Dart

part of 'authentication_cubit.dart';
@freezed
class AuthenticationState with _$AuthenticationState {
const AuthenticationState._();
const factory AuthenticationState.unauthenticated() = _Unauthenticated;
const factory AuthenticationState.requriresLocalAuthentication() =
_RequiresLocalAuthentication;
const factory AuthenticationState.authenticated({
required String localUserId,
}) = _Authenticated;
const factory AuthenticationState.switchingAccounts() = _SwitchingAccounts;
bool get isAuthenticated => maybeWhen(
authenticated: (_) => true,
orElse: () => false,
);
}