openCursor 方法

Stream<CursorWithValue> openCursor(
  1. {dynamic key,
  2. KeyRange? range,
  3. String? direction,
  4. bool? autoAdvance}
)

创建一个流,流中包含本对象存储中的记录的光标。

另请参阅

实现

Stream<CursorWithValue> openCursor(
    {key, KeyRange? range, String? direction, bool? autoAdvance}) {
  var key_OR_range = null;
  if (key != null) {
    if (range != null) {
      throw new ArgumentError('Cannot specify both key and range.');
    }
    key_OR_range = key;
  } else {
    key_OR_range = range;
  }
  var request;
  if (direction == null) {
    // FIXME: Passing in "next" should be unnecessary.
    request = _openCursor(key_OR_range, "next");
  } else {
    request = _openCursor(key_OR_range, direction);
  }
  return ObjectStore._cursorStreamFromResult(request, autoAdvance);
}