loadMoreElements method
dynamic
loadMoreElements(
{ - bool isIncluded(
- T1 element
)?,
})
override
Implementation
@override
loadMoreElements({bool Function(T1 element)? isIncluded}) async {
isLoading = true;
try {
if (isFetchNext) {
await request.fetchNext(
onSuccess: (List<T1> fetchedList) {
_onSuccess(fetchedList, isIncluded);
},
onError: onError ?? _onError);
} else {
await request.fetchPrevious(
onSuccess: (List<T1> fetchedList) {
_onSuccess(fetchedList, isIncluded);
},
onError: onError ?? _onError);
}
} catch (e, s) {
if (kDebugMode) {
print("Error in Catch$e}");
}
error = CometChatException("ERR", s.toString(), "Error");
hasError = true;
isLoading = false;
hasMoreItems = false;
update();
}
}