getHandleAnchor method Null safety

  1. @override
Offset getHandleAnchor(
  1. TextSelectionHandleType type,
  2. double textLineHeight,
  3. [double? startGlyphHeight,
  4. double? endGlyphHeight]
)
override

Gets anchor for material-style text selection handles.

See TextSelectionControls.getHandleAnchor.

Implementation

@override
Offset getHandleAnchor(TextSelectionHandleType type, double textLineHeight, [double? startGlyphHeight, double? endGlyphHeight]) {
  switch (type) {
    case TextSelectionHandleType.left:
      return const Offset(_kHandleSize, 0);
    case TextSelectionHandleType.right:
      return Offset.zero;
    default:
      return const Offset(_kHandleSize / 2, -4);
  }
}