withOpacity method

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

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

Implementation

@override
LinearGradient withOpacity(double opacity) {
  return LinearGradient(
    begin: begin,
    end: end,
    colors: <Color>[
      for (final Color color in colors) color.withOpacity(opacity)
    ],
    stops: stops,
    tileMode: tileMode,
    transform: transform,
  );
}