onCancel property

set onCancel (void value())

Sets the cancellation callback. Can only be set once.

Implementation

set onCancel(void Function() value) {
  if (_onCancel != null) {
    throw Exception("Cannot set onCancel twice");
  }
  _onCancel = value;
}