paint method

  1. @override
void paint(
  1. Canvas canvas,
  2. Size size,
  3. double progress,
  4. int seed
)
override

Implementation

@override
void paint(Canvas canvas, Size size, progress, seed) {
  Random random = Random(seed);
  int randomMirrorOffset = random.nextInt(8) + 1;
  CompositeParticle(children: [
    Firework(),
    RectangleMirror.builder(
        numberOfParticles: 6,
        particleBuilder: (int) {
          return AnimatedPositionedParticle(
            begin: Offset(0.0, -10.0),
            end: Offset(0.0, -60.0),
            child: FadingRect(width: 5.0, height: 15.0, color: intToColor(int)),
          );
        },
        initialDistance: -pi / randomMirrorOffset),
  ]).paint(canvas, size, progress, seed);
}