int getOffsetForPosition(Offset localPosition) { final textPosition = _painter.getPositionForOffset(localPosition); return textPosition.offset; }