Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wamynobe opened this issue Dec 22, 2023 · 2 comments
Labels
question Further information is requested

Comments

@wamynobe
Copy link

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 wamynobe added the question Further information is requested label Dec 22, 2023
@wamynobe wamynobe changed the title Should we customize AnimationController? Should we customize AnimationController in Badge class to give better control over animating the badges? Dec 22, 2023
@wamynobe
Copy link
Author

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant