ParticlesFly constructor

const ParticlesFly({
  1. Key? key,
  2. required double height,
  3. required double width,
  4. double lineStrokeWidth = 0.5,
  5. bool onTapAnimation = true,
  6. double numberOfParticles = 400,
  7. double speedOfParticles = 2,
  8. double awayRadius = 200,
  9. bool isRandomColor = false,
  10. Color particleColor = Colors.purple,
  11. Duration awayAnimationDuration = const Duration(milliseconds: 100),
  12. double maxParticleSize = 4,
  13. bool isRandSize = false,
  14. List<Color> randColorList = const [Colors.orange, Colors.blue, Colors.teal, Colors.red, Colors.purple],
  15. Curve awayAnimationCurve = Curves.easeIn,
  16. bool enableHover = false,
  17. Color hoverColor = Colors.orangeAccent,
  18. double hoverRadius = 80,
  19. bool connectDots = false,
  20. Color lineColor = const Color.fromARGB(90, 155, 39, 176),
})

A Flutter package to create a particle animation like the one on the website https://vincentgarreau.com/particles.js/

Implementation

const ParticlesFly({
  super.key,
  required this.height,
  required this.width,
  this.lineStrokeWidth = 0.5,
  this.onTapAnimation = true,
  this.numberOfParticles = 400,
  this.speedOfParticles = 2,
  this.awayRadius = 200,
  this.isRandomColor = false,
  this.particleColor = Colors.purple,
  this.awayAnimationDuration = const Duration(milliseconds: 100),
  this.maxParticleSize = 4,
  this.isRandSize = false,
  this.randColorList = const [
    Colors.orange,
    Colors.blue,
    Colors.teal,
    Colors.red,
    Colors.purple,
  ],
  this.awayAnimationCurve = Curves.easeIn,
  this.enableHover = false,
  this.hoverColor = Colors.orangeAccent,
  this.hoverRadius = 80,
  this.connectDots = false,
  this.lineColor = const Color.fromARGB(90, 155, 39, 176),
});