funwithflutter / flutter_confetti

A Flutter widget that shoots confetti all over the screen.
https://pub.dev/packages/confetti
MIT License
439 stars 79 forks source link

Is there a way to control the speed and amount of confetti based on seconds instead of framerate? #68

Closed edwardcahyadi closed 1 year ago

edwardcahyadi commented 2 years ago

I recently changed my phone display settings from 60hz to 120hz. I noticed that this caused more confetti to be produced and caused them to fall faster.

This is an issue because different users with different devices will have a different user experience.

Is there an easy way to base the speeds on actual time (seconds) instead on the device's framerate?

acoutts commented 2 years ago

I'm having the same issue - iphone 13 with promotion display.

Eerey commented 2 years ago

As documented, it is strongly tied to drawing a frame. Yes, you'd need to multiply it with the fps rate.

If I think about it I'd really like to see some dependency on Duration instead of Frames.

image

HayesGordon commented 2 years ago

Hi, @edwardcahyadi, thanks for opening this issue, I'll look into this soon. It will likely be breaking changes and a rewrite of the underlying logic - I'll keep you updated here. It'll be something similar to this: https://en.wikipedia.org/wiki/Delta_timing

HayesGordon commented 1 year ago

Sorry that this took so long, but I have implemented a fix, and will release a new release after some additional changes. Please feel free to test out the develop branch in the meantime.