fix: FocusButton layering

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

View file

@ -150,40 +150,41 @@ class FocusButtonState extends State<FocusButton> {
}, },
onKeyEvent: _handleKey, onKeyEvent: _handleKey,
child: ExcludeFocus( child: ExcludeFocus(
child: FlatButton( child: Stack(
onTap: widget.onTap, children: [
onSecondaryTapDown: widget.onSecondaryTapDown, FlatButton(
onLongPress: widget.onLongPress, onTap: widget.onTap,
child: Stack( onSecondaryTapDown: widget.onSecondaryTapDown,
children: [ onLongPress: widget.onLongPress,
ClipRRect( child: widget.child,
borderRadius: FladderTheme.smallShape.borderRadius, ),
child: widget.child, Positioned.fill(
), child: ValueListenableBuilder(
Positioned.fill( valueListenable: onHover,
child: ValueListenableBuilder( builder: (context, value, child) => AnimatedOpacity(
valueListenable: onHover, opacity: value ? 1 : 0,
builder: (context, value, child) => AnimatedOpacity( duration: const Duration(milliseconds: 125),
opacity: value ? 1 : 0, child: Stack(
duration: const Duration(milliseconds: 125), children: [
child: Container( IgnorePointer(
decoration: BoxDecoration( child: Container(
color: Theme.of(context) decoration: BoxDecoration(
.colorScheme color: Theme.of(context)
.primaryContainer .colorScheme
.withValues(alpha: widget.darkOverlay ? 0.1 : 0), .primaryContainer
border: Border.all(width: 4, color: Theme.of(context).colorScheme.onPrimaryContainer), .withValues(alpha: widget.darkOverlay ? 0.1 : 0),
borderRadius: FladderTheme.smallShape.borderRadius, border: Border.all(width: 4, color: Theme.of(context).colorScheme.onPrimaryContainer),
borderRadius: FladderTheme.smallShape.borderRadius,
),
),
), ),
child: Stack( ...widget.overlays,
children: widget.overlays, ],
),
),
), ),
), ),
), ),
], ),
), ],
), ),
), ),
), ),