mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-11 08:08:00 -06:00
feat: Restructure providers and repositories (WIP, not compiling)
This commit is contained in:
@@ -1,48 +1,11 @@
|
||||
part of 'authentication_cubit.dart';
|
||||
|
||||
class AuthenticationState with EquatableMixin {
|
||||
final bool showBiometricAuthenticationScreen;
|
||||
final bool isAuthenticated;
|
||||
final String? username;
|
||||
final String? fullName;
|
||||
final String? localUserId;
|
||||
final int? apiVersion;
|
||||
|
||||
const AuthenticationState({
|
||||
this.isAuthenticated = false,
|
||||
this.showBiometricAuthenticationScreen = false,
|
||||
this.username,
|
||||
this.fullName,
|
||||
this.localUserId,
|
||||
this.apiVersion,
|
||||
});
|
||||
|
||||
AuthenticationState copyWith({
|
||||
bool? isAuthenticated,
|
||||
bool? showBiometricAuthenticationScreen,
|
||||
String? username,
|
||||
String? fullName,
|
||||
String? localUserId,
|
||||
int? apiVersion,
|
||||
}) {
|
||||
return AuthenticationState(
|
||||
isAuthenticated: isAuthenticated ?? this.isAuthenticated,
|
||||
showBiometricAuthenticationScreen:
|
||||
showBiometricAuthenticationScreen ?? this.showBiometricAuthenticationScreen,
|
||||
username: username ?? this.username,
|
||||
fullName: fullName ?? this.fullName,
|
||||
localUserId: localUserId ?? this.localUserId,
|
||||
apiVersion: apiVersion ?? this.apiVersion,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
localUserId,
|
||||
username,
|
||||
fullName,
|
||||
isAuthenticated,
|
||||
showBiometricAuthenticationScreen,
|
||||
apiVersion,
|
||||
];
|
||||
@freezed
|
||||
class AuthenticationState with _$AuthenticationState {
|
||||
const factory AuthenticationState.unauthenticated() = _Unauthenticated;
|
||||
const factory AuthenticationState.requriresLocalAuthentication() = _RequiresLocalAuthentication;
|
||||
const factory AuthenticationState.authenticated({
|
||||
required String localUserId,
|
||||
required int apiVersion,
|
||||
}) = _Authenticated;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user