find method

List<Position>? find()

Returns a {from, to} object (both holding document positions), indicating the current position of the marked range, or null if the marker is no longer in the document. For a bookmark, this list will be length 1.

Implementation

List<Position>? find() {
  final result = call('find');
  if (result is! JsObject) return null;

  try {
    if (result.hasProperty('from')) {
      return [
        Position.fromProxy(result['from']),
        Position.fromProxy(result['to'])
      ];
    } else {
      return [Position.fromProxy(result)];
    }
  } catch (e) {
    return null;
  }
}