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

[Feature Request] Use fixed number of particles and duration instead of emission frequency and particles per emission #100

Open
Ali-Toosi opened this issue Dec 19, 2024 · 0 comments

Comments

@Ali-Toosi
Copy link

Currently, you can only configure the emissionFrequency and numberOfParticles per emission. The problem with it is, it will behave differently on screens with different refresh rates. The same configuration will show many more particles on a 240 fps monitor compared to a 60 fps one.

I tried working around it by setting the emissionFrequency variable based on WidgetsBinding.instance.platformDispatcher.views.first.display.refreshRate to always get the same number of particles, which works fine on Desktop apps but not on Web.

The ConfettiController already has the duration set. It would be good to add a property to the widget like totalNumberOfParticles (mutually exclusive with setting emissionFrequency and numberOfParticles) which uniformly creates particles across the duration. That way, it will always be the same experience for the user, regardless of their display. The higher fps will only make the animation smoother for them, but the same number of particles will appear on the screen.

I am happy to add this and make a PR, but wanted to check the idea first.

Thanks.

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

No branches or pull requests

1 participant