简体   繁体   中英

Flutter FutureBuilder not continuing / working

In my code you can see I am trying to return a List for a ListView. The FutureBuilder should check if it is connected and then add the Items into the list, but it does not seem to work. As I debug I wrote print("starting") and print("startingfuture") but I only get the first one outputted so I think the code is not continuing after FutureBuilder(...

Thank you very much in advance!

If you don't get any error that could be because of your function, need to see it's code.

Also could you try below structure and tell me what's printing?

if (snapshot.connectionState != ConnectionState.done)
            return print("waiting");
            if (snapshot.connectionState == ConnectionState.done && snapshot.hasData) 
              if (snapshot.hasError) {return ("error");}
            return print("everything is ok")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM