advstory icon indicating copy to clipboard operation
advstory copied to clipboard

AdvStory with Provider

Open pabloposada09 opened this issue 2 years ago • 3 comments

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 ?

pabloposada09 avatar Oct 06 '22 20:10 pabloposada09

Same problem here.

emiliodallatorre avatar Nov 09 '23 12:11 emiliodallatorre

@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

pabloposada09 avatar Nov 10 '23 21:11 pabloposada09

@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.

emiliodallatorre avatar Nov 21 '23 10:11 emiliodallatorre