Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/src/badge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -79,6 +85,11 @@ class BadgeState extends State<Badge> with TickerProviderStateMixin {
vsync: this,
);

widget.onCreated?.call(
_animationController,
_appearanceController,
);

_animation = CurvedAnimation(
parent: _animationController,
curve: widget.badgeAnimation.curve,
Expand Down