moveTo method

void moveTo(
  1. String fragmentId,
  2. int localOffset, {
  3. bool forward = true,
})

Moves the cursor (collapsed) to (fragmentId, localOffset). Resets preferredX: a click or horizontal movement cancels the column.

Implementation

void moveTo(String fragmentId, int localOffset, {bool forward = true}) {
  preferredX = -1.0; // ← explicit reset
  anchorId = fragmentId;
  anchorOffset = localOffset;
  focusId = fragmentId;
  focusOffset = localOffset;
}