sakura_blizzard 2.0.1 copy "sakura_blizzard: ^2.0.1" to clipboard
sakura_blizzard: ^2.0.1 copied to clipboard

This is a 3D effect related to flower petals in Flutter. Cherry blossom petals are included as standard.

example/main.dart

import 'package:flutter/material.dart';
import 'package:sakura_blizzard/sakura_blizzard.dart';

void main() async {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<StatefulWidget> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  int _selectedIndex = 0;

  Widget _getView(double w, double h) {
    if (_selectedIndex == 0) {
      return SakuraBlizzardView(
          viewSize: Size(w, h),
          fps: 60,
          child: const Center(
              child: Text(
            "Sakura",
            style: TextStyle(fontSize: 72),
          )));
    } else {
      return ColorfulCubeView(
          viewSize: Size(w, h),
          fps: 60,
          child: const Center(
              child: Text(
            "Cube",
            style: TextStyle(fontSize: 72),
          )));
    }
  }

  void _bottomBarCallback(int index) {
    setState(() {
      _selectedIndex = index;
    });
  }

  @override
  Widget build(BuildContext context) {
    final double w = MediaQuery.of(context).size.width;
    final double h = MediaQuery.of(context).size.height -
        MediaQuery.of(context).padding.top -
        kBottomNavigationBarHeight -
        kToolbarHeight;
    return MaterialApp(
        title: 'SakuraBlizzard',
        home: Scaffold(
            appBar: AppBar(
              title: const Text(
                'SakuraBlizzard',
                style: TextStyle(color: Colors.black),
              ),
              backgroundColor: Colors.white,
            ),
            backgroundColor: Colors.white,
            body: _getView(w, h),
            bottomNavigationBar: BottomNavigationBar(
              currentIndex: _selectedIndex,
              onTap: _bottomBarCallback,
              items: const <BottomNavigationBarItem>[
                BottomNavigationBarItem(
                    icon: Icon(Icons.yard), label: "Sakura"),
                BottomNavigationBarItem(
                    icon: Icon(Icons.widgets), label: "Cube"),
              ],
              type: BottomNavigationBarType.fixed,
            )));
  }
}
16
likes
0
pub points
48%
popularity

Publisher

unverified uploader

This is a 3D effect related to flower petals in Flutter. Cherry blossom petals are included as standard.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, simple_3d, simple_3d_renderer, util_simple_3d

More

Packages that depend on sakura_blizzard