easy_conffeti 0.1.1
easy_conffeti: ^0.1.1 copied to clipboard
A customizable confetti animation library for Flutter with various particle shapes, animations, and color themes.
example/lib/main.dart
import 'dart:math' as math;
import 'package:easy_conffeti/easy_conffeti.dart';
import 'package:flutter/material.dart';
import 'dart:math' as math;
import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Confetti Example',
home: Scaffold(
body: ConfettiTestPage(),
),
);
}
}
class ConfettiTestPage extends StatelessWidget {
const ConfettiTestPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Confetti Test'),
),
body: Center(
child: ElevatedButton(
onPressed: () async {
await ConfettiHelper.showConfettiDialog(
context: context,
confettiType: ConfettiType.celebration,
confettiStyle: ConfettiStyle.star,
animationStyle: AnimationConfetti.falling,
useController: false,
durationInSeconds: 3,
colorTheme: ConfettiColorTheme.purple,
density: ConfettiDensity.low,
message: "Selamat! 🎉",
isColorMixedFromModel: true);
},
child: const Text('Show Confetti'),
),
),
);
}
}