@Alinw

Как пофиксить ошибку в коде Flutter?

class SignInBloc extends Bloc<SignInEvent, SignInState> {
  final UserRepository userRepository;
  final AuthenticationBloc authenticationBloc;

  SignInBloc({
    required this.userRepository,
    required this.authenticationBloc,
  })  : assert(userRepository != null),
        assert(authenticationBloc != null),
        super(SignInInitialState());
  @override
  Stream<SignInState> mapEventToState(
    SignInEvent event,
  ) async* {
    // normal sign in
    if (event is SignInPressed) {
      yield SignInProcessingState();
      try {
        var token = await userRepository.signIn(
          email: event.email,
          password: event.password,
        );
        authenticationBloc.add(LoggedIn(token));
        yield SignInFinishedState();
      } catch (error) {
        yield SignInErrorState(error); // ОШИБКА ЗДЕСЬ
      }
    }
  • Вопрос задан
  • 27 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы