Closed CROSP closed 3 years ago
You can use ControlledWidgetBuilder and refreshUI(). Please refer to the README for examples.
refreshUI will only refresh the widgets that are affected. This is the way this library handles state. It uses the Provider package internally.
Thanks
First of all, thank you for the library and spreading the Clean Architecture concept. It is unclear for me what should I do when I need UI to react to the change of a variable. For example the
isLoading
flag is triggered when a network call is executed, should I call therefreshUI
method every time? Does this approach have any side effects related to performance?I've also tried the following code:
this.getState().setState(()=> {})
But this throws an exception due to an uninitialised variable.
Please clarify what is the right way to update UI state?
Thank you.