TextSelection.fromPosition constructor

TextSelection.fromPosition(
  1. TextPosition position
)

Creates a collapsed selection at the given text position.

A collapsed selection starts and ends at the same offset, which means it contains zero characters but instead serves as an insertion point in the text.

Implementation

TextSelection.fromPosition(TextPosition position)
  : baseOffset = position.offset,
    extentOffset = position.offset,
    affinity = position.affinity,
    isDirectional = false,
    super.collapsed(position.offset);