doOnCancel method

void doOnCancel(
  1. CancelCallback callback
)

Adds a callback callback that will be invoked when cancel is called.

Implementation

void doOnCancel(CancelCallback callback) {
  assert(
    !isCanceled,
    'This subscription was already canceled.',
  );

  _onCancelCallbacks.add(callback);
}