Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter: Best way to rebuild state when the day changes?

The title says it all. I want my state to automatically rebuild when the clock changes from 23:59:59 to 12:00:00 (the next day). Are there packages that will help me do this? I couldn't find any.

like image 958
wolfeweeks Avatar asked Jan 30 '26 05:01

wolfeweeks


1 Answers

Almost any of the provider families can notify listeners on a particular condition. Have one of those listen to a Timer.periodic(Duration(minutes: 1)) and compare old to new day. If changed, send out a notify.

like image 158
Randal Schwartz Avatar answered Feb 02 '26 05:02

Randal Schwartz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!