DecorationImage constructor Null safety

const DecorationImage(
  1. {required ImageProvider<Object> image,
  2. ImageErrorListener? onError,
  3. ColorFilter? colorFilter,
  4. BoxFit? fit,
  5. AlignmentGeometry alignment,
  6. Rect? centerSlice,
  7. ImageRepeat repeat,
  8. bool matchTextDirection,
  9. double scale}
)

Creates an image to show in a BoxDecoration.

The image, alignment, repeat, and matchTextDirection arguments must not be null.

Implementation

const DecorationImage({
  required this.image,
  this.onError,
  this.colorFilter,
  this.fit,
  this.alignment = Alignment.center,
  this.centerSlice,
  this.repeat = ImageRepeat.noRepeat,
  this.matchTextDirection = false,
  this.scale = 1.0,
}) : assert(image != null),
     assert(alignment != null),
     assert(repeat != null),
     assert(matchTextDirection != null),
     assert(scale != null);