Skip to content

Instantly share code, notes, and snippets.

@Sumit-Ghosh
Last active February 20, 2022 06:49
Show Gist options
  • Save Sumit-Ghosh/da9ae032c13cddf44d5f1e49c84e10b6 to your computer and use it in GitHub Desktop.
Save Sumit-Ghosh/da9ae032c13cddf44d5f1e49c84e10b6 to your computer and use it in GitHub Desktop.
part of 'login_bloc.dart';
// This is also an abstract class
// which can be again extended by other classes
/*
* The reason for having a one base class is because,
* We can refer it for all other child class,
* throughout other files where it is used.
* */
abstract class LoginState {
const LoginState();
}
/*
* If you are wondering Why Event is a abstract class
* and State is of concrete type, because,
* we have already created a instance of State,
* to pass it to the super class in the bloc
* but, we are not using the event yet.
* once we start using, we will create a concrete class
* in order to instantiate and use it.
* */
class LoginInitial extends LoginState {}
/*
Will be used later
class UpdateTextState extends LoginState {
final String text;
UpdateTextState({required this.text});
}
class ShowSnackbarState extends LoginState {}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment