fix: ловим pointer события через Listener вместо onLongPressMoveUpdate (route глотал events)
This commit is contained in:
@@ -1734,6 +1734,7 @@ class _LongPressBubbleState extends State<_LongPressBubble> {
|
||||
Haptics.medium();
|
||||
|
||||
final controller = MessageActionsController();
|
||||
controller.updatePointer(details.globalPosition);
|
||||
_controller = controller;
|
||||
|
||||
Navigator.of(ctx)
|
||||
@@ -1755,24 +1756,26 @@ class _LongPressBubbleState extends State<_LongPressBubble> {
|
||||
});
|
||||
}
|
||||
|
||||
void _onLongPressMoveUpdate(LongPressMoveUpdateDetails details) {
|
||||
_controller?.updatePointer(details.globalPosition);
|
||||
}
|
||||
|
||||
void _onLongPressEnd(LongPressEndDetails details) {
|
||||
_controller?.commit();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
return Listener(
|
||||
behavior: HitTestBehavior.deferToChild,
|
||||
onLongPressStart: _onLongPressStart,
|
||||
onLongPressMoveUpdate: _onLongPressMoveUpdate,
|
||||
onLongPressEnd: _onLongPressEnd,
|
||||
child: RepaintBoundary(
|
||||
key: _boundaryKey,
|
||||
child: widget.child,
|
||||
onPointerMove: (event) {
|
||||
_controller?.updatePointer(event.position);
|
||||
},
|
||||
onPointerUp: (event) {
|
||||
_controller?.commit();
|
||||
},
|
||||
onPointerCancel: (event) {
|
||||
_controller?.commit();
|
||||
},
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.deferToChild,
|
||||
onLongPressStart: _onLongPressStart,
|
||||
child: RepaintBoundary(
|
||||
key: _boundaryKey,
|
||||
child: widget.child,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -115,6 +115,9 @@ class _MessageActionsLayerState extends State<_MessageActionsLayer> {
|
||||
: Offset(widget.tapPoint.dx, widget.originRect.top - 16);
|
||||
_buttonCenters = _computeButtonCenters(screenSize);
|
||||
widget.controller.addListener(_onControllerUpdate);
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted) _onControllerUpdate();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user