ertgrulll / advstory

An advanced, complete story viewer for Flutter. Has support for images, videos, custom widget contents, gestures, interceptors, listeners, manipulators and much more.
https://advstory.sourcekod.com
MIT License
41 stars 33 forks source link

AdvStory with Provider #24

Open pabloposada09 opened 1 year ago

pabloposada09 commented 1 year ago

This plugin is really awesome, but it only has a little problem when you try to make the stories dynamics with Provider plugin, because when you want to watch the changes of the stories array with provider the AdvStory plugin doesn't redraw and when you click on a story it throw the following error, because it didn't update the list in the widget. ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════ The following RangeError was thrown building: RangeError (index): Invalid value: Only valid value is 0: 7

Is there any way to make this plugin work listening to a provider variable ?

emiliodallatorre commented 10 months ago

Same problem here.

pabloposada09 commented 10 months ago

@emiliodallatorre I forgot to put here a provisional solution that I found. if I remember correctly I could solve this updating the data with provider but then using setState((){}); to make the page reload and with that you have the stories updated successfully. It is not the best solution, but could help. Hope it helps you too

emiliodallatorre commented 9 months ago

@emiliodallatorre I forgot to put here a provisional solution that I found. if I remember correctly I could solve this updating the data with provider but then using setState((){}); to make the page reload and with that you have the stories updated successfully. It is not the best solution, but could help. Hope it helps you too

Thanks! I'd be very thankful if you could give me more infos. I suspect that keeping the controller referenced may prevent the update even with a setState.