simple_snowfall 1.0.0 copy "simple_snowfall: ^1.0.0" to clipboard
simple_snowfall: ^1.0.0 copied to clipboard

Simple widget to render snowfall

example/lib/main.dart

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,
                    ),
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
7
likes
120
points
50
downloads

Publisher

verified publishersarthakparajuli.com.np

Weekly Downloads

Simple widget to render snowfall

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on simple_snowfall