0

I have NestedScrollView(), one of the slivers is a progress bar widget. The problem is that I haven't pulled the data yet as it a firebase stream.

The body has a StreamBuilder() which gets the data and updates the progress variable which controls the progress bar.

The problem is that the progress is declared to be 0 and only when I get the data from my stream do I update it. But when it is updated I need to setState() to update the progress bar but I cannot call setState() during the widget build as that causes errors.

How can I rebuild a parent widget from a child or do something else to achieve what I want? In short, what I want is to rebuild the progress bar or the entire NestedScrollView() when the progress variable changes.

  • Did you see this question? https://stackoverflow.com/questions/48481590/how-to-set-update-state-of-statefulwidget-from-other-statefulwidget-in-flutter – Abbas Jafari Jun 12 '21 at 00:46
  • @abbasjafary yes I did but it would still cause a red screen with errors. –  Jun 12 '21 at 06:59

0 Answers0