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