whenOrNull<R extends Object?> method

R? whenOrNull<R extends Object?>({
  1. R doNothing()?,
  2. R orElse(
    1. EditFormUIAction editFormUIAction
    )?,
})

Implementation

R? whenOrNull<R extends Object?>({
  R Function()? doNothing,
  R Function(EditFormUIAction editFormUIAction)? orElse,
}) {
  final editFormUIAction = this;
  if (editFormUIAction is EditFormUIActionDoNothing) {
    return doNothing != null ? doNothing() : orElse?.call(editFormUIAction);
  } else {
    throw AssertionError();
  }
}