toSuccess method
Returns a FormBlocSuccess state with the properties of the current state.
It is the state when the form is submitted successfully. The previous state must be FormBlocSubmitting.
It has SuccessResponse
to indicate more details.
Implementation
FormBlocState<SuccessResponse, FailureResponse> toSuccess({
SuccessResponse? successResponse,
bool? canSubmitAgain,
bool? isEditing,
}) {
return FormBlocSuccess(
isValidByStep: _isValidByStep,
isEditing: isEditing ?? this.isEditing,
successResponse: successResponse,
canSubmitAgain: currentStep < (numberOfSteps - 1) ? true : (canSubmitAgain ?? false),
fieldBlocs: _fieldBlocs,
currentStep: currentStep < (numberOfSteps - 1) ? currentStep + 1 : currentStep,
stepCompleted: currentStep,
);
}