flutterfx_meteors 1.0.0
flutterfx_meteors: ^1.0.0 copied to clipboard
A Flutter widget that creates an animated meteor shower effect with customizable meteors falling across your UI. Part of the FlutterFX collection of animated widgets.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:flutterfx_meteors/flutterfx_meteors.dart';
void main() {
runApp(MeteorShowerExample());
}
class MeteorShowerExample extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
backgroundColor: Colors.black,
body: Center(
child: SizedBox(
width: 350,
height: 250,
child: MeteorShower(
numberOfMeteors: 10,
duration: Duration(seconds: 5),
child: Container(
width: double.infinity,
height: 200,
decoration: BoxDecoration(
border: Border.all(
color: Color.fromARGB(255, 96, 96, 96),
width: 2,
),
borderRadius: BorderRadius.circular(10),
),
child: Center(
child: FittedBox(
fit: BoxFit.scaleDown,
child: ShaderMask(
shaderCallback: (bounds) => LinearGradient(
colors: [
Colors.white,
Colors.white.withOpacity(0.2),
],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
).createShader(bounds),
child: Text(
'Meteor shower',
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.w600,
color: Colors.white,
),
),
),
),
),
),
),
),
),
),
);
}
}