getCursorRectInPosition method

  1. @override
Rect? getCursorRectInPosition(
  1. Position position, {
  2. bool shiftWithBaseOffset = false,
})
override

Returns Rect for the position in current widget.

The return result must be an offset of the local coordinate system.

Implementation

@override
Rect? getCursorRectInPosition(
  Position position, {
  bool shiftWithBaseOffset = false,
}) {
  if (_renderBox == null) {
    return null;
  }
  final size = _renderBox!.size;
  return Rect.fromLTWH(-size.width / 2.0, 0, size.width, size.height);
}