cursorToList function
Future<List<CursorRow> >
cursorToList(
- Stream<
CursorWithValue> stream, [ - int? offset,
- int? limit,
- IdbCursorWithValueMatcherFunction? matcher,
Convert an autoAdvance openCursor stream to a list
Implementation
Future<List<CursorRow>> cursorToList(
Stream<CursorWithValue> stream, [
int? offset,
int? limit,
IdbCursorWithValueMatcherFunction? matcher,
]) {
CursorRow? getRow(CursorWithValue cwv) {
if (matcher != null) {
if (!matcher(cwv)) {
return null;
}
}
final row = CursorRow(cwv.key, cwv.primaryKey, cloneValue(cwv.value));
return row;
}
return _autoCursorStreamToList(stream, (cwv) => getRow(cwv), offset, limit);
}