How to use FutureBuilder with setState in flutter

Posted by Editorial Staff | Updated on

Want to use FutureBuilder with setState in flutter? It’s even dangerous to call setState from a future, because the future might complete after the disposal of the state, and it will throw an error.

Here is some update code that takes into account all of these things:

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@] Your question and answer will appear on and help other developers.

Related Questions & Answers