Card constructor Null safety

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

Creates a material design card.

The elevation must be null or non-negative. The borderOnForeground must not be null.

Implementation

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