Card constructor

const Card({
  1. Key? key,
  2. Color? color,
  3. Color? shadowColor,
  4. Color? surfaceTintColor,
  5. double? elevation,
  6. ShapeBorder? shape,
  7. bool borderOnForeground = true,
  8. EdgeInsetsGeometry? margin,
  9. Clip? clipBehavior,
  10. Widget? child,
  11. bool semanticContainer = true,
})

Creates a Material Design card.

The elevation must be null or non-negative.

Implementation

const Card({
  super.key,
  this.color,
  this.shadowColor,
  this.surfaceTintColor,
  this.elevation,
  this.shape,
  this.borderOnForeground = true,
  this.margin,
  this.clipBehavior,
  this.child,
  this.semanticContainer = true,
}) : assert(elevation == null || elevation >= 0.0),
     _variant = _CardVariant.elevated;