doOnCancel method
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);
}