setListResult method
Implementation
void setListResult(
String queryKey,
List<String> ids, {
String? entityType,
int? total,
String? nextCursor,
String? prevCursor,
bool hasNextPage = false,
bool hasPrevPage = false,
}) {
_write(() {
if (entityType != null) _listTypes[queryKey] = entityType;
final prev = _lists[queryKey] ?? ListState.empty;
_lists[queryKey] = prev.copyWith(
ids: List.unmodifiable(ids),
total: total,
nextCursor: nextCursor,
prevCursor: prevCursor,
hasNextPage: hasNextPage,
hasPrevPage: hasPrevPage,
isFetching: false,
isFetchingMore: false,
lastFetched: DateTime.now(),
stale: false,
clearError: true,
clearTotal: total == null,
clearNextCursor: nextCursor == null,
clearPrevCursor: prevCursor == null,
);
_notifyList(queryKey);
});
}