You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Timer with tickCount stays finished after start() or reset() #4240
A Timer (or TimerComponent) with tickCount never resets its tick counter. start(), stop() and reset() only set current back to 0, so once the timer has ticked tickCount times:
finished is still true right after start(), even though the timer is running again. A TimerComponent with removeOnFinish: true is removed on its next update.
The restarted timer ticks once and stops, instead of ticking tickCount times again.
reset() part way through has the same problem: the ticks counted before the reset still count towards the limit.
What do you expect?
start() starts the timer from 0, as its docs say, so it should tick tickCount times again and not be finished until it has. reset() should also reset the ticks.
Reset _currentTick in Timer.reset() (which start() and stop() call). When the tick limit is reached, _callTicker calls stop() today; it would need to set _current to 0 and pause instead, so that the timer still reports finished afterwards.
Affected platforms
All
Other information
Flame main at a004408 (flame 2.0.0-dev.1), Flutter 3.47.9 stable. tickCount was added in #3552.
Activity
matthewalberto commentedon Nov 20, 2026
Fix in #4241