globalToLocalPosition method
Returns the position relative to the node
content
The position
must be within the node
content
Implementation
@override
TextPosition globalToLocalPosition(TextPosition position) {
assert(getContainer().containsOffset(position.offset),
'The provided text position is not in the current node');
return TextPosition(
offset: position.offset - getContainer().documentOffset,
affinity: position.affinity,
);
}