CardTheme constructor

const CardTheme({
  1. Key? key,
  2. Clip? clipBehavior,
  3. Color? color,
  4. Color? surfaceTintColor,
  5. Color? shadowColor,
  6. double? elevation,
  7. EdgeInsetsGeometry? margin,
  8. ShapeBorder? shape,
  9. CardThemeData? data,
  10. Widget? child,
})

Creates a theme that can be used for ThemeData.cardTheme.

The elevation must be null or non-negative.

Implementation

const CardTheme({
  super.key,
  Clip? clipBehavior,
  Color? color,
  Color? surfaceTintColor,
  Color? shadowColor,
  double? elevation,
  EdgeInsetsGeometry? margin,
  ShapeBorder? shape,
  CardThemeData? data,
  Widget? child,
}) : assert(
       data == null ||
           (clipBehavior ??
                   color ??
                   surfaceTintColor ??
                   shadowColor ??
                   elevation ??
                   margin ??
                   shape) ==
               null,
     ),
     assert(elevation == null || elevation >= 0.0),
     _data = data,
     _clipBehavior = clipBehavior,
     _color = color,
     _surfaceTintColor = surfaceTintColor,
     _shadowColor = shadowColor,
     _elevation = elevation,
     _margin = margin,
     _shape = shape,
     super(child: child ?? const SizedBox());