mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-08-26 07:59:39 +00:00
Refactor code for consistency and readability
- Removed unused imports and commented-out code - Updated class inheritance for AuthState subclasses - Reorganized code structure for better readability - Cleaned up debug print statements and replaced with dart:developer logs
This commit is contained in:
@ -4,30 +4,44 @@ abstract class AuthState {}
|
||||
|
||||
class AuthInitial extends AuthState {}
|
||||
|
||||
//base states
|
||||
class AuthLoading extends AuthState {}
|
||||
|
||||
class AuthError extends AuthState {
|
||||
final String message;
|
||||
|
||||
AuthError(this.message) {
|
||||
debugPrint(message);
|
||||
}
|
||||
String? code;
|
||||
AuthError({required this.message, this.code});
|
||||
}
|
||||
|
||||
class AuthSuccess extends AuthState {}
|
||||
|
||||
class AuthLoggedOut extends AuthState {}
|
||||
//user log states
|
||||
class AuthLoginLoading extends AuthLoading {}
|
||||
|
||||
class AuthLoginSuccess extends AuthSuccess {}
|
||||
|
||||
class AuthLoginError extends AuthError {
|
||||
AuthLoginError({required super.message, super.code});
|
||||
}
|
||||
|
||||
class AuthLogoutLoading extends AuthLoading {}
|
||||
|
||||
class AuthLogoutSuccess extends AuthSuccess {}
|
||||
|
||||
class AuthLogoutError extends AuthError {
|
||||
AuthLogoutError({required super.message, super.code});
|
||||
}
|
||||
|
||||
// UI states
|
||||
class AuthPasswordVisibilityChanged extends AuthState {}
|
||||
|
||||
class AuthAgreeToTermsChanged extends AuthState {}
|
||||
|
||||
class AuthTokenLoading extends AuthState {}
|
||||
//token states
|
||||
class AuthTokenLoading extends AuthLoading {}
|
||||
|
||||
class AuthTokenSuccess extends AuthState {}
|
||||
class AuthTokenSuccess extends AuthSuccess {}
|
||||
|
||||
class AuthTokenError extends AuthState {
|
||||
final String message;
|
||||
|
||||
AuthTokenError(this.message);
|
||||
class AuthTokenError extends AuthError {
|
||||
AuthTokenError({required super.message, super.code});
|
||||
}
|
||||
|
Reference in New Issue
Block a user