Onboarding completato, ora super rapido e top Reviewed-on: http://catelliub.zapto.org:3000/brontomark/flux/pulls/7 Co-authored-by: Mark M2 Macbook <marco@catelli.it> Co-committed-by: Mark M2 Macbook <marco@catelli.it>
36 lines
875 B
Dart
36 lines
875 B
Dart
part of 'auth_cubit.dart';
|
|
|
|
enum AuthStatus { initial, loading, failure }
|
|
|
|
class AuthState extends Equatable {
|
|
final AuthStatus status;
|
|
final bool isLoginMode;
|
|
final String? errorMessage;
|
|
final String? infoMessage;
|
|
|
|
const AuthState({
|
|
this.status = AuthStatus.initial,
|
|
this.isLoginMode = true,
|
|
this.errorMessage,
|
|
this.infoMessage,
|
|
});
|
|
|
|
AuthState copyWith({
|
|
AuthStatus? status,
|
|
bool? isLoginMode,
|
|
String? errorMessage,
|
|
String? infoMessage,
|
|
}) {
|
|
return AuthState(
|
|
status: status ?? this.status,
|
|
isLoginMode: isLoginMode ?? this.isLoginMode,
|
|
// Se non passo esplicitamente un errore, lo resetto per evitare che rimanga bloccato a schermo
|
|
errorMessage: errorMessage,
|
|
infoMessage: infoMessage,
|
|
);
|
|
}
|
|
|
|
@override
|
|
List<Object?> get props => [status, isLoginMode, errorMessage, infoMessage];
|
|
}
|