Watch
1
0
Fork
You've already forked nexus
0
forked from Nexus/nexus
nexus/lib/widgets/highlight_wrapper.dart
2026-10-16 10:56:55 -04:00

20 lines
606 B
Dart

import "package:material_ui/material_ui.dart";
final class const HighlightWrapper(
final Widget child, {
final bool isHighlighted = false,
super.key,
}) extends StatelessWidget {
@override
Widget build(BuildContext context) => ClipRRect(
borderRadius: .all(.circular(12)),
child: AnimatedContainer(
padding: isHighlighted ? .all(8) : .all(0),
color: isHighlighted
? Theme.of(context).colorScheme.onSurface.withAlpha(50)
: Colors.transparent,
duration: Durations.medium1,
child: Material(color: Colors.transparent, child: child),
),
);
}