i have a simple question. how can i refresh part of screen with bloc? for example you suppose we have weather sample as you put in github,
in that we suppose we have a listview below of city name, and thats get some other cities list to show temperatures. when we scrolling down and we want to reload again this list, can be doable with Bloc pattern?
i guess i can introduce StateRebuild pattern which we can refresh simple part of our UI
You should use BlocBuilder's as deeply as possible in your widget tree as well as utilize it's condition parameter. In your example you would probably have a single bloc where you would handle all cities. ListView would handle lazy loading of items from your bloc state.
Hi @MahdiPishguy 馃憢
Thanks for opening an issue!
As @RollyPeres mentioned you can just wrap the part of your ui that you want to change in BlocBuilder and add a condition to optionally have more control over how often it rebuilds. You can check out the timer tutorial for an example.
Hope that helps! 馃憤
@felangel Thanks a lot, but i'm not sure to understand how can i do that, could you help me more please?
@MahdiPishguy can you share a sample app or something concrete that you鈥檙e having issues with? It鈥檚 hard to help without having any context.
@MahdiPishguy can you share a sample app or something concrete that you鈥檙e having issues with? It鈥檚 hard to help without having any context.
yes. sure, i'll made a simple product for this issue and let me notify you to describe more about that, Thanks
Most helpful comment
You should use
BlocBuilder's as deeply as possible in your widget tree as well as utilize it'sconditionparameter. In your example you would probably have a single bloc where you would handle all cities.ListViewwould handle lazy loading of items from your bloc state.