toLoadFailed method

FormBlocState<SuccessResponse, FailureResponse> toLoadFailed(
  1. {FailureResponse? failureResponse}
)

Returns a FormBlocLoadFailed state with the properties of the current state.

It is the state when you failed to pre/fill the fieldBlocs. The previous state must be FormBlocLoading.

It has failureResponse to indicate more details.

Implementation

FormBlocState<SuccessResponse, FailureResponse> toLoadFailed(
    {FailureResponse? failureResponse}) {
  final state = this;
  return FormBlocLoadFailed(
    isValidByStep: _isValidByStep,
    isEditing: isEditing,
    failureResponse: failureResponse ??
        (state is FormBlocLoadFailed<SuccessResponse, FailureResponse>
            ? state.failureResponse
            : null),
    fieldBlocs: _fieldBlocs,
    currentStep: currentStep,
  );
}