limitOffsetStream method

Stream<CursorRow> limitOffsetStream({
  1. int? limit,
  2. int? offset,
  3. IdbCursorWithValueMatcherFunction? matcher,
})

filter out.

Implementation

Stream<CursorRow> limitOffsetStream({
  int? limit,
  int? offset,
  IdbCursorWithValueMatcherFunction? matcher,
}) {
  if (matcher == null) {
    return _cursorApplyLimitOffset(
      this,
      offset: offset,
      limit: limit,
    ).map(_cwvToRow);
  }
  CursorRow? checkAndConvertRow(CursorWithValue cwv) {
    if (!matcher(cwv)) {
      return null;
    }
    return _cwvToRow(cwv);
  }

  return _cursorApplyFilterLimitOffset(
    this,
    checkAndConvertRow,
    offset: offset,
    limit: limit,
  );
}