partialWhen method

  1. @Deprecated('Use `whenOrNull` instead. Will be removed by next release.')
void partialWhen({
  1. void doNothing()?,
  2. void orElse(
    1. EditFormUIAction editFormUIAction
    )?,
})

Implementation

@Deprecated('Use `whenOrNull` instead. Will be removed by next release.')
void partialWhen({
  void Function()? doNothing,
  void Function(EditFormUIAction editFormUIAction)? orElse,
}) {
  final editFormUIAction = this;
  if (editFormUIAction is EditFormUIActionDoNothing) {
    if (doNothing != null) {
      doNothing();
    } else if (orElse != null) {
      orElse(editFormUIAction);
    }
  } else {
    throw AssertionError();
  }
}