LinearGradientPainter constructor

const LinearGradientPainter({
  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,
  7. ColorSpace? colorSpace,
  8. bool invert = false,
  9. double density = 0.075,
})

A 2D linear gradient.

See: LinearGradient

Implementation

const LinearGradientPainter({
  AlignmentGeometry begin = Alignment.centerLeft,
  AlignmentGeometry end = Alignment.centerRight,
  required List<Color> colors,
  List<double>? stops,
  TileMode tileMode = TileMode.clamp,
  GradientTransform? transform,
  this.colorSpace,
  this.invert = false,
  this.density = 0.075,
})  : assert(density > 0.0 && density <= 1.0),
      assert(stops == null || stops.length == colors.length),
      super(
        begin: begin,
        end: end,
        colors: colors,
        stops: stops,
        tileMode: tileMode,
        transform: transform,
      );