retry method
Retries the last failed fetch operation.
If last failure was fetching the first page, retries first page fetch. If last failure was fetching next page, retries next page fetch. If last failure was fetching a previous page, retries previous page fetch.
Implementation
Future<void> retry() async {
trackOperation('retry');
debugAssertNotDisposed();
_log('Retrying last operation (status: ${value.status})');
if (value.status == PageableStatus.FIRST_PAGE_ERROR) {
await fetchFirstPage();
} else if (value.status == PageableStatus.NEW_PAGE_ERROR) {
await fetchNextPage();
} else if (value.status == PageableStatus.PREVIOUS_PAGE_ERROR) {
await fetchPreviousPage();
}
}