resume method
void
resume()
Resume this query
Resuming a query will:
- Restart background refetch timers (if configured)
- Refetch data if stale (if refetchOnResume is enabled)
This is called automatically when the app returns to foreground.
Implementation
void resume() {
if (!_isPaused) return;
_isPaused = false;
// Restart background refetch if configured
_setupBackgroundRefetch();
// Refetch if data is stale and refetchOnResume is enabled
if ((config.refetchOnResume) && isStale && enabled.value && !_isDisposed) {
fetch().then(
(_) {},
onError: (error, stackTrace) {
ZenLogger.logWarning(
'ZenQuery resume refetch failed for query: $queryKey',
);
},
);
}
ZenLogger.logDebug('Query resumed: $queryKey');
}