hi everyone i'm following reso coder serie about DDD and i get error at part eight this is my code:
return BlocConsumer<SignInFormBloc, SignInFormState>(
builder: (context, state) {},
listener: (context, state) {});
and this is error :
The following NoSuchMethodError was thrown building BlocConsumer<SignInFormBloc, SignInFormState>:
The getter 'state' was called on null.
Receiver: null
Tried calling: state
and this is sign_in_form_state code :
part of 'sign_in_form_bloc.dart';
@freezed
abstract class SignInFormState with _$SignInFormState {
const factory SignInFormState({
@required EmailAddress emailAddress,
@required Password password,
@required bool showErrorMessages,
@required bool isSubmitting,
@required Option<Either<AuthFailure, Unit>> authFailureOrSuccessOption,
}) = _SignInFormState;
factory SignInFormState.initial() => SignInFormState(
emailAddress: EmailAddress(' '),
password: Password(' '),
showErrorMessages: false,
isSubmitting: false,
authFailureOrSuccessOption: none(),
);
}
thanks in advance.