buildHandle method
Widget
buildHandle(
- BuildContext context,
- TextSelectionHandleType type,
- double textHeight, [
- VoidCallback? onTap,
override
Builds a selection handle of the given type.
The top left corner of this widget is positioned at the bottom of the selection position.
The supplied onTap should be invoked when the handle is tapped, if such
interaction is allowed. As a counterexample, the default selection handle
on iOS cupertinoTextSelectionControls does not call onTap at all,
since its handles are not meant to be tapped.
Implementation
@override
Widget buildHandle(
BuildContext context, TextSelectionHandleType type, double textHeight,
[VoidCallback? onTap]) {
debugPrint('type: $type');
final ThemeData theme = Theme.of(context);
final Color handleColor =
TextSelectionTheme.of(context).selectionHandleColor ??
theme.colorScheme.primary;
final Widget handle = SizedBox(
width: _kHandleSize,
height: _kHandleSize,
child: Container(
decoration: BoxDecoration(
color: handleColor,
shape: BoxShape.circle,
),
),
);
return handle;
}