toFailure method

FormBlocState<SuccessResponse, FailureResponse> toFailure (
  1. {FailureResponse failureResponse}

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

It is the state when the form are submitting and fail. The previous state must be FormBlocSubmitting.

It has FailureResponse to indicate more details.


FormBlocState<SuccessResponse, FailureResponse> toFailure({
  FailureResponse failureResponse,
}) =>
      isValidByStep: _isValidByStep,
      isEditing: isEditing,
      failureResponse: failureResponse ??
          (runtimeType ==
                  _typeOf<FormBlocFailure<SuccessResponse, FailureResponse>>()
              ? (this as FormBlocFailure<SuccessResponse, FailureResponse>)
              : null),
      fieldBlocs: _fieldBlocs,
      currentStep: currentStep ?? 0,