wrapWithPointerPressTracking method
wrapWithPointerPressTracking.
Implementation
@protected
Widget wrapWithPointerPressTracking({
required bool enabled,
required Widget child,
}) {
if (!enabled) {
return child;
}
return Listener(
behavior: HitTestBehavior.translucent,
onPointerDown: (_) {
M3EFocusInteraction.instance.notePointerInteraction();
_setPointerDown(true);
},
onPointerUp: (_) {
if (isPointerDownNotifier.value) {
effectiveFocusNode.requestFocus();
}
_setPointerDown(false);
},
onPointerCancel: (_) => _setPointerDown(false),
child: child,
);
}