getOffsetForCaret method

  1. @override
Offset getOffsetForCaret(
  1. TextPosition position,
  2. Rect? caretPrototype
)
override

Implementation

@override
Offset getOffsetForCaret(TextPosition position, Rect? caretPrototype) {
  assert(
      position.offset == 1 || position.offset == 0 || position.offset == -1);
  return position.offset <= 0
      ? Offset.zero
      : Offset(
          size.width - (caretPrototype == null ? 0 : caretPrototype.width),
          0);
}