getHandleAnchor method
Gets anchor for material-style text selection handles.
Implementation
@override
Offset getHandleAnchor(TextSelectionHandleType type, double textLineHeight) {
if (customHandleWidget == null) {
return Offset.zero;
}
if (Platform.isAndroid) {
switch (type) {
case TextSelectionHandleType.left:
return const Offset(_kHandleSize * 0.8, _kHandleSize * 0.2);
case TextSelectionHandleType.right:
return const Offset(_kHandleSize * 0.2, _kHandleSize * 0.2);
case TextSelectionHandleType.collapsed:
return const Offset(_kHandleSize / 2, 0);
}
} else {
switch (type) {
case TextSelectionHandleType.left:
return const Offset(_kHandleSize, 0);
case TextSelectionHandleType.right:
return Offset.zero;
case TextSelectionHandleType.collapsed:
return const Offset(_kHandleSize / 2, -4);
}
}
}