peckish_animations 0.0.3 peckish_animations: ^0.0.3 copied to clipboard
A animation package that allow developers to add interactive animations
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!');
},
),
],
),
);
}
}