The primary entry point for flutter_confetti_engine.
Provides a static one-liner API that inserts a full-screen confetti overlay, plays the animation (with optional haptics and sound), and removes itself automatically when all particles have faded.
Minimal usage:
ConfettiEngine.celebrate(context);
With options:
ConfettiEngine.celebrate(
context,
preset: Preset.nova,
enableSound: true,
soundAssetPath: 'assets/sounds/cheer.mp3',
);
Only one overlay can be active at a time. Calling celebrate while an animation is already running will dismiss the previous one first.
For region-constrained animations or manual lifecycle control, use ConfettiWidget and ConfettiController directly.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
celebrate(
BuildContext context, {Preset preset = Preset.nova, CelebrationScene? scene, ConfettiShowcase? showcase, bool enableHaptics = true, bool enableSound = false, String? soundAssetPath, CelebrationFeedback? feedback, List< String> ? emojiPool, ConfettiCustomization? customization, CelebrationMessageOptions? overlayMessage, VoidCallback? onComplete}) → void - Shows a full-screen confetti animation above the current route.
-
celebrateInDialog(
BuildContext context, {Preset preset = Preset.nova, CelebrationScene? scene, ConfettiShowcase? showcase, bool enableHaptics = true, bool enableSound = false, String? soundAssetPath, CelebrationFeedback? feedback, List< String> ? emojiPool, ConfettiCustomization? customization, CelebrationMessageOptions? overlayMessage, VoidCallback? onComplete, bool barrierDismissible = false, Color? barrierColor, bool useSafeArea = true}) → Future<void> - Celebrates inside a transparent, edge-to-edge Dialog (modal full-screen celebration overlay).
-
celebrateWithMessage(
BuildContext context, {required String message, Preset preset = Preset.nova, CelebrationScene? scene, ConfettiShowcase? showcase, bool enableHaptics = true, bool enableSound = false, String? soundAssetPath, CelebrationFeedback? feedback, List< String> ? emojiPool, ConfettiCustomization? customization, TextStyle? messageStyle, Alignment messageAlignment = Alignment.bottomCenter, EdgeInsets messageOuterPadding = const EdgeInsets.fromLTRB(24, 0, 24, 56), TextAlign messageTextAlign = TextAlign.center, BoxDecoration? messageDecoration, EdgeInsets messageInnerPadding = const EdgeInsets.symmetric(horizontal: 16, vertical: 10), int? durationInSeconds, bool showMessage = true, VoidCallback? onComplete}) → void - Full-screen confetti plus an optional styled banner message.
-
dismiss(
) → void - Immediately removes any active confetti overlay.