maybeMap<R extends Object?> method
R
maybeMap<R extends Object?>({
- R showLoading(
- EditFormUIStateShowLoading showLoading
- R showContent(
- EditFormUIStateShowContent showContent
- required R orElse(
- EditFormUIState editFormUIState
Implementation
R maybeMap<R extends Object?>({
R Function(EditFormUIStateShowLoading showLoading)? showLoading,
R Function(EditFormUIStateShowContent showContent)? showContent,
required R Function(EditFormUIState editFormUIState) orElse,
}) {
final editFormUIState = this;
if (editFormUIState is EditFormUIStateShowLoading) {
return showLoading != null
? showLoading(editFormUIState)
: orElse(editFormUIState);
} else if (editFormUIState is EditFormUIStateShowContent) {
return showContent != null
? showContent(editFormUIState)
: orElse(editFormUIState);
} else {
throw AssertionError();
}
}