drawGlowingCircle method

dynamic drawGlowingCircle(
  1. Offset c,
  2. double radius,
  3. Paint paint, {
  4. int shadowSpread = 6,
  5. int spreadValue = 10,
})

Implementation

drawGlowingCircle(Offset c, double radius, Paint paint,
    {int shadowSpread = 6, int spreadValue = 10}) {
  List shadows = [];
  for (var i = 1; i <= shadowSpread; i++) {
    var shadow = Paint()
      ..color = paint.color
      ..strokeWidth = paint.strokeWidth
      ..style = paint.style
      ..maskFilter = MaskFilter.blur(
          BlurStyle.outer,
          ((i * spreadValue).toDouble()) * 0.57735 +
              0.5) //convertRadiusToSigma
      ..strokeCap = paint.strokeCap;
    shadows.add(shadow);
  }

  shadows.forEach((element) {
    drawCircle(c, radius, element);
  });

  drawCircle(c, radius, paint);
}