partialMap method

  1. @Deprecated('Use `mapOrNull` instead. Will be removed by next release.')
void partialMap({
  1. void showLoading(
    1. EditFormUIStateShowLoading showLoading
    )?,
  2. void showContent(
    1. EditFormUIStateShowContent showContent
    )?,
  3. void orElse(
    1. EditFormUIState editFormUIState
    )?,
})

Implementation

@Deprecated('Use `mapOrNull` instead. Will be removed by next release.')
void partialMap({
  void Function(EditFormUIStateShowLoading showLoading)? showLoading,
  void Function(EditFormUIStateShowContent showContent)? showContent,
  void Function(EditFormUIState editFormUIState)? orElse,
}) {
  final editFormUIState = this;
  if (editFormUIState is EditFormUIStateShowLoading) {
    if (showLoading != null) {
      showLoading(editFormUIState);
    } else if (orElse != null) {
      orElse(editFormUIState);
    }
  } else if (editFormUIState is EditFormUIStateShowContent) {
    if (showContent != null) {
      showContent(editFormUIState);
    } else if (orElse != null) {
      orElse(editFormUIState);
    }
  } else {
    throw AssertionError();
  }
}