particles_flutter 0.1.4 particles_flutter: ^0.1.4 copied to clipboard
A flutter package for particle animation. You can control the animation speed, number of Particles on the screen, dimension and shape of particle via connecting lines,etc.
import 'package:flutter/material.dart';
import 'package:particles_flutter/particles_flutter.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(primarySwatch: Colors.blue),
home: Scaffold(
backgroundColor: Colors.black,
body: CircularParticleScreen(),
),
);
}
}
class CircularParticleScreen extends StatelessWidget {
const CircularParticleScreen({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
double screenHeight = MediaQuery.of(context).size.height;
double screenWidth = MediaQuery.of(context).size.width;
return Center(
child: Container(
key: UniqueKey(),
child: Center(
child: CircularParticle(
// key: UniqueKey(),
awayRadius: 80,
numberOfParticles: 200,
speedOfParticles: 1,
height: screenHeight,
width: screenWidth,
onTapAnimation: true,
particleColor: Colors.white.withAlpha(150),
awayAnimationDuration: Duration(milliseconds: 600),
maxParticleSize: 8,
isRandSize: true,
isRandomColor: true,
randColorList: [
Colors.red.withAlpha(210),
Colors.white.withAlpha(210),
Colors.yellow.withAlpha(210),
Colors.green.withAlpha(210)
],
awayAnimationCurve: Curves.easeInOutBack,
enableHover: true,
hoverColor: Colors.white,
hoverRadius: 90,
connectDots: true, //not recommended
),
),
),
);
}
}