diff --git a/lib/src/badge.dart b/lib/src/badge.dart index 7a13e8b..f91a02f 100644 --- a/lib/src/badge.dart +++ b/lib/src/badge.dart @@ -16,8 +16,14 @@ class Badge extends StatefulWidget { this.ignorePointer = false, this.stackFit = StackFit.loose, this.onTap, + this.onCreated, }) : super(key: key); + final void Function( + AnimationController animationController, + AnimationController appearanceController, + )? onCreated; + /// The badge child, e.g. cart icon button. final Widget? child; @@ -79,6 +85,11 @@ class BadgeState extends State with TickerProviderStateMixin { vsync: this, ); + widget.onCreated?.call( + _animationController, + _appearanceController, + ); + _animation = CurvedAnimation( parent: _animationController, curve: widget.badgeAnimation.curve,