when<R extends Object?> method
R
when<R extends Object?>({
- required R showLoading(),
- required R showContent(
- List<
FormViewModel> viewModels, - bool showNonEditableFields
- List<
Implementation
R when<R extends Object?>({
required R Function() showLoading,
required R Function(
List<FormViewModel> viewModels, bool showNonEditableFields)
showContent,
}) {
final editFormUIState = this;
if (editFormUIState is EditFormUIStateShowLoading) {
return showLoading();
} else if (editFormUIState is EditFormUIStateShowContent) {
return showContent(
editFormUIState.viewModels, editFormUIState.showNonEditableFields);
} else {
throw AssertionError();
}
}