Selection.single constructor

Selection.single({
  1. required Path path,
  2. required int startOffset,
  3. int? endOffset,
})

Create a selection with Path, startOffset and endOffset.

The endOffset is optional.

This constructor will return a collapsed Selection if endOffset is null.

Implementation

Selection.single({
  required Path path,
  required int startOffset,
  int? endOffset,
})  : start = Position(path: path, offset: startOffset),
      end = Position(path: path, offset: endOffset ?? startOffset);