In my State class I have declared a future:
Future _testFuture;
and assign it in the initState like this:
initState