simple_snowfall 1.0.0
simple_snowfall: ^1.0.0 copied to clipboard
Simple widget to render snowfall
import 'package:flutter/material.dart';
import 'package:simple_snowfall/snows/snowfall_widget.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return const MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Simple Snowfall',
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
alignment: Alignment.center,
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [Colors.blue, Colors.lightBlue, Colors.white],
stops: [0, 0.7, 0.95],
),
),
child: Stack(
children: [
SnowfallWidget(
gravity: 0.1,
windIntensity: 1,
size: MediaQuery.of(context).size,
// Change the snowflake size or other properties if needed
),
const Positioned(
bottom: 20,
left: 20,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Simple Snowfall Widget',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 8),
Text(
'Use this widget to bring snowfall effect to your app!',
style: TextStyle(
fontSize: 16,
fontStyle: FontStyle.italic,
),
),
],
),
),
],
),
),
);
}
}