0

I followed this flutter tutorial in making my forum application when creating a "new thread" page, which returns to a "thread view page". On the thread view page, for now, the list of threads is a local array of thread objects which gets added to when a new thread is submitted.

This functionality works properly, however, the view of all current threads does not automatically refresh, so the user does not see their new submitted post until they interact with something else on the page (click on a different thread). Then, the submitted thread is displayed alongside the others.

Is there a way for me to force refresh the view, so the user sees the submitted thread immediately when Navigator.pop returns to the initial screen?

Winston
  • 61
  • 5
  • 3
    Does this answer your question? [How to go back and refresh the previous page in Flutter?](https://stackoverflow.com/questions/49830553/how-to-go-back-and-refresh-the-previous-page-in-flutter) – Nagual Jul 14 '21 at 07:52
  • Check out [ask] to improve this question – Alex.F Jul 14 '21 at 10:31

1 Answers1

-2

This should do the trick

await Navigator.push(...);
setState((){})
lenz
  • 2,193
  • 17
  • 31