getCaretPrototype method

  1. @override
Rect getCaretPrototype(
  1. TextPosition position
)
override

Returns the Rect of the caret prototype at the given text position. Rect starts at origin.

Implementation

@override
Rect getCaretPrototype(TextPosition position) {
  final child = childAtPosition(position);
  final localPosition = TextPosition(
    offset: position.offset - child.container.offset,
    affinity: position.affinity,
  );
  return child.getCaretPrototype(localPosition);
}