First, you shouldn’t return null from FutureBuilder. And to access the data you should use snapshot.data. Something like this:

FutureBuilder<List>(
    future: clusters,
    builder: (BuildContext context, AsyncSnapshot<List> snapshot) {
        if (snapshot.hasData) {
            print("clusters: ${snapshot.data.join(", ")}");
            return Text("Hello");
        }
        return SizedBox();
    },
)

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top