PhysicalShape constructor Null safety

const PhysicalShape(
  1. {Key? key,
  2. required CustomClipper<Path> clipper,
  3. Clip clipBehavior = Clip.none,
  4. double elevation = 0.0,
  5. required Color color,
  6. Color shadowColor = const Color(0xFF000000),
  7. Widget? child}
)

Creates a physical model with an arbitrary shape clip.

The color is required; physical things have a color.

The clipper, elevation, color, clipBehavior, and shadowColor must not be null. Additionally, the elevation must be non-negative.

Implementation

const PhysicalShape({
  super.key,
  required this.clipper,
  this.clipBehavior = Clip.none,
  this.elevation = 0.0,
  required this.color,
  this.shadowColor = const Color(0xFF000000),
  super.child,
}) : assert(clipper != null),
     assert(clipBehavior != null),
     assert(elevation != null && elevation >= 0.0),
     assert(color != null),
     assert(shadowColor != null);