retryLastFailedRequest method
Future<void>
retryLastFailedRequest(
)
Implementation
Future<void> retryLastFailedRequest() async {
String pageProviderKey = _pagingBuilderController.getProviderKey();
ref.read(pagingControllerProvider(pageProviderKey).notifier).onGoing();
final provider = pagingControllerProvider(pageProviderKey);
var nextPageKey = ref.read(provider).nextPageKey;
try {
var data = await widget.pagingDataController.retryLastFailedRequest(nextPageKey);
if (data.error == null) {
ref
.read(pagingControllerProvider(pageProviderKey).notifier)
.appendPage(data.itemList as List<T>, data.nextPageKey);
} else {
ref.read(pagingControllerProvider(pageProviderKey).notifier).loadError(data.error);
}
} catch (e) {
ref.read(pagingControllerProvider(pageProviderKey).notifier).loadError(e);
}
}