From a1675c072c47c2147e90ca652d9b5e366027e4db Mon Sep 17 00:00:00 2001 From: ggurdin Date: Wed, 6 Nov 2024 15:31:25 -0500 Subject: [PATCH] keep button down if disabled --- lib/pangea/widgets/pressable_button.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/pangea/widgets/pressable_button.dart b/lib/pangea/widgets/pressable_button.dart index 5c4a32a7d..54734254c 100644 --- a/lib/pangea/widgets/pressable_button.dart +++ b/lib/pangea/widgets/pressable_button.dart @@ -55,7 +55,7 @@ class PressableButtonState extends State } Future _onTapUp(TapUpDetails details) async { - if (!widget.enabled) return; + if (!widget.enabled || widget.depressed) return; widget.onPressed?.call(); if (_animationCompleter != null) { await _animationCompleter!.future; @@ -93,7 +93,11 @@ class PressableButtonState extends State animation: _tweenAnimation, builder: (context, _) { return Container( - padding: EdgeInsets.only(bottom: _tweenAnimation.value), + padding: EdgeInsets.only( + bottom: widget.enabled && !widget.depressed + ? _tweenAnimation.value + : 0, + ), decoration: BoxDecoration( color: Color.alphaBlend( Colors.black.withOpacity(0.25),