ClipRRect constructor Null safety

const ClipRRect(
  1. {Key? key,
  2. BorderRadius? borderRadius,
  3. CustomClipper<RRect>? clipper,
  4. Clip clipBehavior,
  5. Widget? child}

Creates a rounded-rectangular clip.

The borderRadius defaults to, i.e. a rectangle with right-angled corners.

If clipper is non-null, then borderRadius is ignored.

The clipBehavior argument must not be null or Clip.none.


const ClipRRect({
  Key? key,
  this.borderRadius =,
  this.clipBehavior = Clip.antiAlias,
  Widget? child,
}) : assert(borderRadius != null || clipper != null),
     assert(clipBehavior != null),
     super(key: key, child: child);