peckish_animations 0.0.3 copy "peckish_animations: ^0.0.3" to clipboard
peckish_animations: ^0.0.3 copied to clipboard

A animation package that allow developers to add interactive animations

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Peckish Animation',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: HomeScreen(),
    );
  }
}

class HomeScreen extends StatefulWidget {
  @override
  _HomeScreenState createState() => _HomeScreenState();
}

class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
 bool _showBalloons = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text("Peckish Animation"),),
      body: Stack(
        children: [
          // Your other widgets
          Center(
            child: IconButton(
              icon: Icon(
                _showBalloons ? Icons.favorite : Icons.favorite_border,
                color: _showBalloons ? Colors.red : Colors.grey,
                size: 50,
              ),
              onPressed: () {
                setState(() {
                  _showBalloons = !_showBalloons;
                });
              },
            ),
          ),
          // Balloon animation - much simpler now!
          BalloonAnimation(
            balloonCount: 25,
            showBalloons: _showBalloons,
            onComplete: () {
              print('Peckish Animation completed!');
            },
          ),
        ],
      ),
    );
  }
}
1
likes
140
points
22
downloads

Publisher

unverified uploader

Weekly Downloads

A animation package that allow developers to add interactive animations

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on peckish_animations