flutter_badges icon indicating copy to clipboard operation
flutter_badges copied to clipboard

Should we customize AnimationController in Badge class to give better control over animating the badges?

Open wamynobe opened this issue 2 years ago • 2 comments

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,
        );
     ...
  }
}

wamynobe avatar Dec 22 '23 07:12 wamynobe

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.

wamynobe avatar Dec 22 '23 08:12 wamynobe

This approach will cause some issues with logic inside mixin tickerprovider. Added another approach to access these controller.

wamynobe avatar Dec 22 '23 09:12 wamynobe