withOpacity method

  1. @override
SweepGradient withOpacity(
  1. double opacity
)
override

Returns a new Gradient with each color set to the given opacity.

Implementation

@override
SweepGradient withOpacity(double opacity) {
  return SweepGradient(
    center: center,
    startAngle: startAngle,
    endAngle: endAngle,
    colors: <Color>[
      for (final Color color in colors) color.withOpacity(opacity)
    ],
    stops: stops,
    tileMode: tileMode,
    transform: transform,
  );
}