fix: FocusButton layering

This commit is contained in:
PartyDonut 2025-10-03 14:44:05 +02:00
parent 5174bb3a6c
commit 1205b23a1b

View file

@ -150,14 +150,12 @@ class FocusButtonState extends State<FocusButton> {
}, },
onKeyEvent: _handleKey, onKeyEvent: _handleKey,
child: ExcludeFocus( child: ExcludeFocus(
child: FlatButton( child: Stack(
children: [
FlatButton(
onTap: widget.onTap, onTap: widget.onTap,
onSecondaryTapDown: widget.onSecondaryTapDown, onSecondaryTapDown: widget.onSecondaryTapDown,
onLongPress: widget.onLongPress, onLongPress: widget.onLongPress,
child: Stack(
children: [
ClipRRect(
borderRadius: FladderTheme.smallShape.borderRadius,
child: widget.child, child: widget.child,
), ),
Positioned.fill( Positioned.fill(
@ -166,6 +164,9 @@ class FocusButtonState extends State<FocusButton> {
builder: (context, value, child) => AnimatedOpacity( builder: (context, value, child) => AnimatedOpacity(
opacity: value ? 1 : 0, opacity: value ? 1 : 0,
duration: const Duration(milliseconds: 125), duration: const Duration(milliseconds: 125),
child: Stack(
children: [
IgnorePointer(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context) color: Theme.of(context)
@ -175,10 +176,11 @@ class FocusButtonState extends State<FocusButton> {
border: Border.all(width: 4, color: Theme.of(context).colorScheme.onPrimaryContainer), border: Border.all(width: 4, color: Theme.of(context).colorScheme.onPrimaryContainer),
borderRadius: FladderTheme.smallShape.borderRadius, borderRadius: FladderTheme.smallShape.borderRadius,
), ),
child: Stack(
children: widget.overlays,
), ),
), ),
...widget.overlays,
],
),
), ),
), ),
), ),
@ -186,7 +188,6 @@ class FocusButtonState extends State<FocusButton> {
), ),
), ),
), ),
),
); );
} }
} }