cursorOffset property

int get cursorOffset

Cursor offset in graphemes from the document start.

Exposes the caret for overlay positioning and inline-element hit-testing (image chips, file refs) without reaching into document internals.

Implementation

int get cursorOffset => _document.offsetForPosition(_currentCursorPosition());