cancel method

void cancel([
  1. String reason = 'Query cancelled'
])

Cancel any pending or in-flight fetch request for this query.

Cancelling a query will:

Implementation

void cancel([String reason = 'Query cancelled']) {
  _cancelPendingRequest();
  // coverage:ignore-start
  if (fetchStatus.value != ZenQueryFetchStatus.idle) {
    fetchStatus.value = ZenQueryFetchStatus.idle;
  }
  // coverage:ignore-end
  if (_isLoadingNotifier?.value == true) {
    _isLoadingNotifier?.value = false;
  }
  ZenLogger.logDebug('Query cancelled: $queryKey ($reason)');
  update();
}