Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating widget value on render?

Tags:

render

flutter

I have a Flutter app, and I want to display a color depending on the current system time in milliseconds since epoch. Of course, I cant refresh the state of the widget several times a second to change the color. But how can I achieve this effect? Is there some kind of render-method I can override?

P.S.: I am using a Material widget to display the color.

like image 240
Ian Rehwinkel Avatar asked Jan 29 '26 15:01

Ian Rehwinkel


1 Answers

Flutter updates the view only when a new frame is due, no matter how often you called setState() since the last frame.

like image 151
Günter Zöchbauer Avatar answered Feb 01 '26 10:02

Günter Zöchbauer



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!