flutter_badges
flutter_badges copied to clipboard
Should we customize AnimationController in Badge class to give better control over animating the badges?
Environment
master
Describe your question
I'm wondering if adding two variables animationController and appearanceController would give better control over animating the badges?
class Badge extends StatefulWidget {
const Badge({
...
this.animationController,
}) : super(key: key);
final AnimationController? animationController;
...
@override
void initState() {
super.initState();
_animationController = widget.animationController ??
AnimationController(
duration: widget.badgeAnimation.animationDuration,
reverseDuration: widget.badgeAnimation.animationDuration,
vsync: this,
);
...
}
}
There are some cases where the content of the badge changes or doesn't change, but I still want the badge to animate every time an event is caught.
This approach will cause some issues with logic inside mixin tickerprovider. Added another approach to access these controller.