fetchWithoutPaging method
This function is for fetch data without paging feature
If return list data is empty, indicator 'hasNextPage' will set false
Implementation
Future<void> fetchWithoutPaging({
/// This function is for passing data from response fetch data to list
required Future<List<T>> Function() fetchApi,
/// This function for check if data already selected before
bool Function(T)? checkDataIsSelected,
}) async {
reset();
_setInLoading();
try {
final list = await fetchApi();
addItemList(list, checkDataIsSelected: checkDataIsSelected);
setCurrentPageAsLastPage();
} catch (e) {
errorText = e.toString();
isLoading = false;
if (!_disposed) {
notifyListeners();
refreshStateParentWidget();
}
}
}