BlobButton.bouncing constructor

BlobButton.bouncing({
  1. Key? key,
  2. required GestureTapCallback onTap,
  3. required Icon icon,
  4. Color? backgroundColor,
})

Implementation

factory BlobButton.bouncing({
  Key? key,
  required GestureTapCallback onTap,
  required Icon icon,
  Color? backgroundColor,
}) {
  Size area = const Size(100, 100);
  List<Particle> blobs = [];
  for (int i = 0; i < 8; i++) {
    blobs.add(RotatingParticle.random(area));
  }
  return BlobButton._(
    key: key,
    backgroundColor: backgroundColor,
    onTap: onTap,
    blobs: blobs,
    size: area,
    icon: icon,
  );
}