cancel method

void cancel({
  1. bool silent = false,
  2. bool revert = true,
})

Cancels the query with the selected notification behavior.

Implementation

void cancel({bool silent = false, bool revert = true}) {
  if (!token._cancelled.isCompleted) {
    final reason = QueryCancelledException(silent: silent, revert: revert);
    token._reason = reason;
    token._cancelled.complete(reason);
  }
}