AuthenticationBloc constructor

AuthenticationBloc({
  1. required AuthenticationRepository authenticationRepository,
  2. required GetUserUseCase getUserUseCase,
  3. required LogOutUseCase logOutUseCase,
})

Implementation

AuthenticationBloc({
  required this.authenticationRepository,
  required this.getUserUseCase,
  required this.logOutUseCase,
}) : super(AuthenticationState()) {
  on<_Started>(_onStarted);
  on<_AuthenticationStatusChanged>(_onAuthenticationStatusChanged);
  on<_LogoutButtonPressed>(_onLogoutButtonPressed);
  _authenticationStatusSubscription = authenticationRepository.status.listen(
    (AuthenticationStatus status) => add(
      _AuthenticationStatusChanged(status: status),
    ),
  );
}