toLoading method
Returns a FormBlocLoading state with the properties of the current state.
It is the state when you need to pre/fill the
fieldBlocs
usually with asynchronous data.
The previous state must be FormBlocLoading.
Implementation
FormBlocState<SuccessResponse, FailureResponse> toLoading({
double? progress,
}) {
final state = this;
return FormBlocLoading(
isValidByStep: _isValidByStep,
isEditing: isEditing,
fieldBlocs: _fieldBlocs,
currentStep: currentStep,
progress: progress ??
(state is FormBlocLoading<SuccessResponse, FailureResponse> ? state.progress : 0.0),
);
}