fix: RadialMenuOverlay gesture-eating bug IgnorePointer when not visible + status listener to trigger rebuild on dismiss
This commit is contained in:
parent
d6204db5c4
commit
ea692da571
|
|
@ -37,6 +37,13 @@ class _RadialMenuOverlayState extends State<RadialMenuOverlay>
|
||||||
vsync: this,
|
vsync: this,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Rebuild when animation dismisses so the SizedBox.shrink check fires
|
||||||
|
_controller.addStatusListener((status) {
|
||||||
|
if (status == AnimationStatus.dismissed && mounted) {
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
_scaleAnimation = CurvedAnimation(
|
_scaleAnimation = CurvedAnimation(
|
||||||
parent: _controller,
|
parent: _controller,
|
||||||
curve: Curves.easeOutBack,
|
curve: Curves.easeOutBack,
|
||||||
|
|
@ -72,9 +79,11 @@ class _RadialMenuOverlayState extends State<RadialMenuOverlay>
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
|
|
||||||
return GestureDetector(
|
return IgnorePointer(
|
||||||
onTap: widget.onDismiss,
|
ignoring: !widget.isVisible,
|
||||||
child: AnimatedBuilder(
|
child: GestureDetector(
|
||||||
|
onTap: widget.onDismiss,
|
||||||
|
child: AnimatedBuilder(
|
||||||
animation: _controller,
|
animation: _controller,
|
||||||
builder: (context, child) {
|
builder: (context, child) {
|
||||||
return Stack(
|
return Stack(
|
||||||
|
|
@ -102,6 +111,7 @@ class _RadialMenuOverlayState extends State<RadialMenuOverlay>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue