On a complex widget like a parent screen (formed by various elements and some of them depending on state management widgets using riverpod/bloc) how do you handle internal states of other small widget in order to update specific-parts only and not all the widget (statefull widget rebuild the whole widget). I found that ValueNotifier make the work but want to see how other ppl handle it?
Hi,
This section of the docs is relatively new and may help answer some of your questions.
By not using state managements (which are a JS thing) and using ViewModel (which is a simple variable it can be passed through arguments or InheritedWidget
to whomever wants to use them).
I do this a lot in complex widgets, breaking them in tiny private widgets using part
and part of
, passing the viewModel to all of them.
It makes things sooooo much simpler.
Thx, will give it a read
Sounds like what I was looking for. Can you share me an example of how do you use it?