Skip to content

Instantly share code, notes, and snippets.

@red-star25
Created January 8, 2022 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save red-star25/378729c86c38efcefade2560ce5b14cb to your computer and use it in GitHub Desktop.
Save red-star25/378729c86c38efcefade2560ce5b14cb to your computer and use it in GitHub Desktop.
part of 'auth_bloc.dart';
@immutable
abstract class AuthState extends Equatable {}
// When the user presses the signin or signup button the state is changed to loading first and then to Authenticated.
class Loading extends AuthState {
@override
List<Object?> get props => [];
}
// When the user is authenticated the state is changed to Authenticated.
class Authenticated extends AuthState {
@override
List<Object?> get props => [];
}
// This is the initial state of the bloc. When the user is not authenticated the state is changed to Unauthenticated.
class UnAuthenticated extends AuthState {
@override
List<Object?> get props => [];
}
// If any error occurs the state is changed to AuthError.
class AuthError extends AuthState {
final String error;
AuthError(this.error);
@override
List<Object?> get props => [error];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment