feat: add TvFocusableCard widget for interactive focus and hover effects.

This commit is contained in:
Michael committed 2026-01-01 18:37:42 +01:00
1 parent 2d418e4e0c
commit 30218cb1d0
1 file changed
+38 -35
+38 -35
View File
@@ -93,42 +93,45 @@ class _TvFocusableCardState extends State<TvFocusableCard>
child: child, child: child,
); );
}, },
child: InkWell( child: Material(
onTap: widget.onTap, color: Colors.transparent,
onFocusChange: _handleFocusChange, child: InkWell(
autofocus: widget.autofocus, onTap: widget.onTap,
borderRadius: BorderRadius.circular(widget.borderRadius), onFocusChange: _handleFocusChange,
focusColor: Colors.transparent, autofocus: widget.autofocus,
hoverColor: Colors.transparent, borderRadius: BorderRadius.circular(widget.borderRadius),
highlightColor: Colors.transparent, focusColor: Colors.transparent,
splashColor: Colors.transparent, hoverColor: Colors.transparent,
child: Container( highlightColor: Colors.transparent,
decoration: BoxDecoration( splashColor: Colors.transparent,
borderRadius: BorderRadius.circular(widget.borderRadius), child: Container(
border: isActive decoration: BoxDecoration(
? Border.all( borderRadius: BorderRadius.circular(widget.borderRadius),
color: widget.focusColor ?? AppColors.focusBorder, border: isActive
width: 2, // Slightly thinner for cleaner look ? Border.all(
) color: widget.focusColor ?? AppColors.focusBorder,
: Border.all(color: Colors.transparent, width: 2), width: 2, // Slightly thinner for cleaner look
boxShadow: isActive )
? [ : Border.all(color: Colors.transparent, width: 2),
BoxShadow( boxShadow: isActive
color: Colors.black.withOpacity(0.5), ? [
blurRadius: 25, BoxShadow(
offset: const Offset(0, 10), color: Colors.black.withOpacity(0.5),
spreadRadius: 2, blurRadius: 25,
), offset: const Offset(0, 10),
BoxShadow( spreadRadius: 2,
color: (widget.focusColor ?? AppColors.focusBorder) ),
.withOpacity(0.3), BoxShadow(
blurRadius: 15, color: (widget.focusColor ?? AppColors.focusBorder)
spreadRadius: 1, .withOpacity(0.3),
), blurRadius: 15,
] spreadRadius: 1,
: [], ),
]
: [],
),
child: widget.child,
), ),
child: widget.child,
), ),
), ),
), ),