I have a Future function that returns a List and I had the problem that kept duplicating... I solved it by setting an initState() as described here: Flutter FutureBuilder gets constantly called flutter-futurebuilder-gets-constantly-called
Now I need the Future function to be executed when I press a button, to do this I have created a list to which I add the FutureBuilder when I press the button, but I have removed the initState().
So now the duplication problem is back...
Does anyone know how I can make FutureBuilder run only once when I press the button?
I cannot attach the code because it is too long and complicated, I hope I was clear enough and that someone can help me. Thanks :)