keep button down if disabled

pull/1476/head
ggurdin 1 year ago
parent 889dba298c
commit a1675c072c
No known key found for this signature in database
GPG Key ID: A01CB41737CBB478

@ -55,7 +55,7 @@ class PressableButtonState extends State<PressableButton>
} }
Future<void> _onTapUp(TapUpDetails details) async { Future<void> _onTapUp(TapUpDetails details) async {
if (!widget.enabled) return; if (!widget.enabled || widget.depressed) return;
widget.onPressed?.call(); widget.onPressed?.call();
if (_animationCompleter != null) { if (_animationCompleter != null) {
await _animationCompleter!.future; await _animationCompleter!.future;
@ -93,7 +93,11 @@ class PressableButtonState extends State<PressableButton>
animation: _tweenAnimation, animation: _tweenAnimation,
builder: (context, _) { builder: (context, _) {
return Container( return Container(
padding: EdgeInsets.only(bottom: _tweenAnimation.value), padding: EdgeInsets.only(
bottom: widget.enabled && !widget.depressed
? _tweenAnimation.value
: 0,
),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color.alphaBlend( color: Color.alphaBlend(
Colors.black.withOpacity(0.25), Colors.black.withOpacity(0.25),

Loading…
Cancel
Save