scale method Null safety

  1. @override
SweepSteps scale(
  1. double factor
)
override

Returns a new SweepSteps with its colors scaled by the given factor. Since the alpha channel is what receives the scale factor, 0.0 or less results in a gradient that is fully transparent.

Implementation

@override
SweepSteps scale(double factor) => copyWith(
      colors: colors
          .map<Color>((Color color) => Color.lerp(null, color, factor)!)
          .toList(),
    );