mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 17:47:28 +00:00

- Add method to get token and validate in AuthCubit - Update AuthState with loading, success, and error states for token - Use BlocBuilder in SplashView for token validation and navigation This commit refactors the code in AuthCubit to include a method to get the token and validate it. It also updates the AuthState with loading, success, and error states for token handling. In SplashView, BlocBuilder is now used to handle token validation and navigation based on the token status.
34 lines
640 B
Dart
34 lines
640 B
Dart
part of 'auth_cubit.dart';
|
|
|
|
abstract class AuthState {}
|
|
|
|
class AuthInitial extends AuthState {}
|
|
|
|
class AuthLoading extends AuthState {}
|
|
|
|
class AuthError extends AuthState {
|
|
final String message;
|
|
|
|
AuthError(this.message) {
|
|
debugPrint(message);
|
|
}
|
|
}
|
|
|
|
class AuthSuccess extends AuthState {}
|
|
|
|
class AuthLoggedOut extends AuthState {}
|
|
|
|
class AuthPasswordVisibilityChanged extends AuthState {}
|
|
|
|
class AuthAgreeToTermsChanged extends AuthState {}
|
|
|
|
class AuthTokenLoading extends AuthState {}
|
|
|
|
class AuthTokenSuccess extends AuthState {}
|
|
|
|
class AuthTokenError extends AuthState {
|
|
final String message;
|
|
|
|
AuthTokenError(this.message);
|
|
}
|