map<R extends Object?> method

R map<R extends Object?>({
  1. required R showLoading(
    1. EditFormUIStateShowLoading showLoading
    ),
  2. required R showContent(
    1. EditFormUIStateShowContent showContent
    ),
})

Implementation

R map<R extends Object?>({
  required R Function(EditFormUIStateShowLoading showLoading) showLoading,
  required R Function(EditFormUIStateShowContent showContent) showContent,
}) {
  final editFormUIState = this;
  if (editFormUIState is EditFormUIStateShowLoading) {
    return showLoading(editFormUIState);
  } else if (editFormUIState is EditFormUIStateShowContent) {
    return showContent(editFormUIState);
  } else {
    throw AssertionError();
  }
}