fix: give pressable buttons constant height (#1335)

This commit is contained in:
ggurdin 2024-12-31 12:43:11 -05:00 committed by GitHub
parent 0fdd8a62b2
commit 59ca59f465
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -144,22 +144,28 @@ class PressableButtonState extends State<PressableButton>
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(