LinearGradient constructor Null safety

const LinearGradient(
  1. {AlignmentGeometry begin = Alignment.centerLeft,
  2. AlignmentGeometry end = Alignment.centerRight,
  3. required List<Color> colors,
  4. List<double>? stops,
  5. TileMode tileMode = TileMode.clamp,
  6. GradientTransform? transform}
)

Creates a linear gradient.

The colors argument must not be null. If stops is non-null, it must have the same length as colors.

Implementation

const LinearGradient({
  this.begin = Alignment.centerLeft,
  this.end = Alignment.centerRight,
  required super.colors,
  super.stops,
  this.tileMode = TileMode.clamp,
  super.transform,
}) : assert(begin != null),
     assert(end != null),
     assert(tileMode != null);