onCancel property

VoidCallback? onCancel
inherited

"Cancel" callback. If the exception has a cause, will return a merged callback.

Implementation

VoidCallback? get onCancel {
  VoidCallback? onCancelCause =
      (cause is UserException) ? (cause as UserException).onCancel : null;

  if (onCancelCause == null)
    return _onCancel;
  else if (_onCancel == null)
    return onCancelCause;
  else
    return () {
      _onCancel!();
      onCancelCause();
    };
}