withOpacity method
Returns a new Gradient with each color set to the given opacity.
Implementation
@override
Gradient withOpacity(double opacity) => copyWith(
colors: colors
.map<Color>((Color color) => Color.lerp(null, color, opacity)!)
.toList(),
);