You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 lines
692 B

import 'package:flutter/material.dart';
import 'package:particles_fly/particles_fly.dart';
class ParticleBackground extends StatelessWidget {
final Widget child;
final double numberOfParticles;
const ParticleBackground({
super.key,
required this.child,
this.numberOfParticles = 100,
});
@override
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
return Stack(
children: [
ParticlesFly(
height: size.height,
width: size.width,
connectDots: true,
numberOfParticles: numberOfParticles,
),
child, // contenu au-dessus des particules
],
);
}
}