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