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: InkWell(
onTap: widget.onTap,
onFocusChange: _handleFocusChange,
autofocus: widget.autofocus,
borderRadius: BorderRadius.circular(widget.borderRadius),
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(widget.borderRadius),
border: isActive
? Border.all(
color: widget.focusColor ?? AppColors.focusBorder,
width: 2, // Slightly thinner for cleaner look
)
: Border.all(color: Colors.transparent, width: 2),
boxShadow: isActive
? [
BoxShadow(
color: Colors.black.withOpacity(0.5),
blurRadius: 25,
offset: const Offset(0, 10),
spreadRadius: 2,
),
BoxShadow(
color: (widget.focusColor ?? AppColors.focusBorder)
.withOpacity(0.3),
blurRadius: 15,
spreadRadius: 1,
),
]
: [],
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: widget.onTap,
onFocusChange: _handleFocusChange,
autofocus: widget.autofocus,
borderRadius: BorderRadius.circular(widget.borderRadius),
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(widget.borderRadius),
border: isActive
? Border.all(
color: widget.focusColor ?? AppColors.focusBorder,
width: 2, // Slightly thinner for cleaner look
)
: Border.all(color: Colors.transparent, width: 2),
boxShadow: isActive
? [
BoxShadow(
color: Colors.black.withOpacity(0.5),
blurRadius: 25,
offset: const Offset(0, 10),
spreadRadius: 2,
),
BoxShadow(
color: (widget.focusColor ?? AppColors.focusBorder)
.withOpacity(0.3),
blurRadius: 15,
spreadRadius: 1,
),
]
: [],
),
child: widget.child,
),
child: widget.child,
),
),
),