From 59ca59f4654a3c4e61f42e12a5ae9bcbfc6ed4fd Mon Sep 17 00:00:00 2001 From: ggurdin <46800240+ggurdin@users.noreply.github.com> Date: Tue, 31 Dec 2024 12:43:11 -0500 Subject: [PATCH] fix: give pressable buttons constant height (#1335) --- lib/pangea/widgets/pressable_button.dart | 36 ++++++++++++++---------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/lib/pangea/widgets/pressable_button.dart b/lib/pangea/widgets/pressable_button.dart index 9e86b69f3..acf99be02 100644 --- a/lib/pangea/widgets/pressable_button.dart +++ b/lib/pangea/widgets/pressable_button.dart @@ -144,22 +144,28 @@ class PressableButtonState extends State child: AnimatedBuilder( animation: _tweenAnimation, builder: (context, child) { - return Container( - decoration: BoxDecoration( - color: Color.alphaBlend( - _isShadow - ? Colors.black.withOpacity(0.25) - : Colors.white.withOpacity(0.25), - widget.color, + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox(height: _tweenAnimation.value), + Container( + decoration: BoxDecoration( + color: Color.alphaBlend( + _isShadow + ? Colors.black.withOpacity(0.25) + : Colors.white.withOpacity(0.25), + widget.color, + ), + borderRadius: widget.borderRadius, + ), + padding: EdgeInsets.only( + bottom: !_depressed + ? widget.buttonHeight - _tweenAnimation.value + : 0, + ), + child: child, ), - borderRadius: widget.borderRadius, - ), - padding: EdgeInsets.only( - bottom: !_depressed - ? widget.buttonHeight - _tweenAnimation.value - : 0, - ), - child: child, + ], ); }, child: Container(