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

View file

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