A Flutter widget for creating particles.
Add the dependencies needed to your pubspec.yaml
file.
Import the file
import 'package:flutter_particles/particles.dart';
Calling the widget
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return new Scaffold(
backgroundColor: Colors.orange[50],
body: new Particles(
30, // Number of Particles
Colors.blue, // Color of Particles
),
);
}
}
Personalize particles in depth
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return new Scaffold(
backgroundColor: Colors.orange[50],
body: new Particles(
30, // Number of Particles
Colors.blue, // Color of Particles
particleSize: 5.0, //Size of Particles
strokeSize: 4.0, //Size of stroke between particles
connectDistance: 50.0, //Distance between particles to connect
minSpeed: 2, //Minimum speed of a particle
maxSpeed: 5, //Maximum speed of a particle
),
);
}
}