Infinite loop on using FutureBuilder with API call

Posted by Editorial Staff | Updated on

Infinite loop on using FutureBuilder with API call. To solve this problem you have to keep a reference to the Future object. And use that reference for the FutureBuilder then it can understand that it is the previously used one.

Here is a quick example:

And in your widget tree use it like that:


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

Related Questions & Answers