refactor(ui): Use flutter's card implementations

This commit is contained in:
Inex Code 2024-11-01 20:54:13 +03:00
parent 3dce7c8f49
commit c0de078dbb
2 changed files with 3 additions and 7 deletions

View file

@ -18,11 +18,7 @@ class FilledCard extends StatelessWidget {
final bool secondary; final bool secondary;
final bool mergeSemantics; final bool mergeSemantics;
@override @override
Widget build(final BuildContext context) => Card( Widget build(final BuildContext context) => Card.filled(
elevation: 0.0,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(12)),
),
clipBehavior: clipped ? Clip.antiAlias : Clip.none, clipBehavior: clipped ? Clip.antiAlias : Clip.none,
color: error color: error
? Theme.of(context).colorScheme.errorContainer ? Theme.of(context).colorScheme.errorContainer
@ -30,7 +26,7 @@ class FilledCard extends StatelessWidget {
? Theme.of(context).colorScheme.secondaryContainer ? Theme.of(context).colorScheme.secondaryContainer
: tertiary : tertiary
? Theme.of(context).colorScheme.tertiaryContainer ? Theme.of(context).colorScheme.tertiaryContainer
: Theme.of(context).colorScheme.surfaceContainerHigh, : Theme.of(context).colorScheme.surfaceContainerHighest,
semanticContainer: mergeSemantics, semanticContainer: mergeSemantics,
child: child, child: child,
); );

View file

@ -12,7 +12,7 @@ class OutlinedCard extends StatelessWidget {
final Color? borderColor; final Color? borderColor;
final double? borderWidth; final double? borderWidth;
@override @override
Widget build(final BuildContext context) => Card( Widget build(final BuildContext context) => Card.outlined(
elevation: 0.0, elevation: 0.0,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: const BorderRadius.all(Radius.circular(12)), borderRadius: const BorderRadius.all(Radius.circular(12)),