2022-09-15 16:57:26 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class FilledCard extends StatelessWidget {
|
|
|
|
const FilledCard({
|
|
|
|
required this.child,
|
|
|
|
this.secondary = false,
|
|
|
|
this.tertiary = false,
|
|
|
|
this.error = false,
|
|
|
|
this.clipped = true,
|
2024-08-06 19:04:34 +00:00
|
|
|
this.mergeSemantics = true,
|
2022-10-26 16:26:09 +00:00
|
|
|
super.key,
|
2022-09-15 16:57:26 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
final Widget child;
|
|
|
|
final bool tertiary;
|
|
|
|
final bool error;
|
|
|
|
final bool clipped;
|
|
|
|
final bool secondary;
|
2024-08-06 19:04:34 +00:00
|
|
|
final bool mergeSemantics;
|
2022-09-15 16:57:26 +00:00
|
|
|
@override
|
|
|
|
Widget build(final BuildContext context) => Card(
|
2022-09-15 21:08:32 +00:00
|
|
|
elevation: 0.0,
|
|
|
|
shape: const RoundedRectangleBorder(
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(12)),
|
|
|
|
),
|
|
|
|
clipBehavior: clipped ? Clip.antiAlias : Clip.none,
|
|
|
|
color: error
|
|
|
|
? Theme.of(context).colorScheme.errorContainer
|
|
|
|
: secondary
|
|
|
|
? Theme.of(context).colorScheme.secondaryContainer
|
|
|
|
: tertiary
|
|
|
|
? Theme.of(context).colorScheme.tertiaryContainer
|
|
|
|
: Theme.of(context).colorScheme.surfaceVariant,
|
2024-08-06 19:04:34 +00:00
|
|
|
semanticContainer: mergeSemantics,
|
2022-09-15 21:08:32 +00:00
|
|
|
child: child,
|
|
|
|
);
|
2022-09-15 16:57:26 +00:00
|
|
|
}
|