Steps constructor Null safety

const Steps(
  1. {double softness = 0.0,
  2. required List<Color> colors,
  3. List<double>? stops,
  4. TileMode tileMode = TileMode.clamp,
  5. GradientTransform? transform}
)

These Steps work a little bit differently than standard Gradients.

The Gradient.colors & Gradient.stops properties are duplicated to create hard-edge transitions instead of smooth ones.

A larger softness makes this FooSteps more like a standard FooGradient. Default is 0.0. High-resolution displays are well-suited for displaying the non-anti-aliased Steps formed when softness == 0.0.

Implementation

// But while [colors] is a duplicated [Gradient.colors], these [stops], if
// provided manually instead of using implication, are expected to follow
// a simple, but important format:
// - This constructor's `stops` *should* start with a `0.0`, as after
//   list duplication, the second entry in the list will be eliminated.
// - This constructor's `stops` *should not* end with a `1.0`, as that will
//   be added automatically.
///
/// A larger [softness] makes this `FooSteps` more like a standard
/// `FooGradient`. Default is `0.0`. High-resolution displays are
/// well-suited for displaying the non-anti-aliased `Steps` formed when
/// `softness == 0.0`.
const Steps({
  this.softness = 0.0,
  required List<Color> colors,
  List<double>? stops,
  this.tileMode = TileMode.clamp,
  GradientTransform? transform,
}) : super(colors: colors, stops: stops, transform: transform);