Selection.single constructor
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);