createRadialGradient function

Widget createRadialGradient(
  1. List<Color> colors,
  2. AlignmentGeometry center,
  3. double radius,
  4. List<double> stops,
  5. List<double> opacities,
  6. TileMode tileMode,
  7. AlignmentGeometry focal,
  8. double focalRadius,
  9. GradientTransform transform
)

Implementation

Widget createRadialGradient(
    List<Color> colors,
    AlignmentGeometry center,
    double radius,
    List<double> stops,
    List<double> opacities,
    TileMode tileMode,
    AlignmentGeometry focal,
    double focalRadius,
    GradientTransform transform
) {
  return Container(
    decoration: BoxDecoration(
      gradient: RadialGradient(
          colors: _applyOpacitiesToColors(colors, opacities),
          center: center != null ? center : Alignment.center,
          radius: radius != null ? radius : 0.5,
          stops: stops,
          tileMode: tileMode != null ? tileMode : TileMode.clamp,
          focal: focal,
          focalRadius: focalRadius != null ? focalRadius : 0.0,
          transform: transform
      ),
    ),
  );
}