LinearGradient constructor Null safety
- {AlignmentGeometry begin = Alignment.centerLeft,
- AlignmentGeometry end = Alignment.centerRight,
- required List<
Color> colors, - List<
double> ? stops, - TileMode tileMode = TileMode.clamp,
- 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);