TextSelection.collapsed constructor

const TextSelection.collapsed({
  1. required int offset,
  2. TextAffinity affinity = TextAffinity.downstream,
})

Creates a collapsed selection at the given offset.

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

const TextSelection.collapsed({
  required int offset,
  this.affinity = TextAffinity.downstream,
}) : baseOffset = offset,
     extentOffset = offset,
     isDirectional = false,
     super.collapsed(offset);