I'm not sure if I got the snapshot thing in Flutter right. Therefore I would like to ask you guys if you aggree my thoughts about snapshot or not.
Let's say I have the FutureBuilder below:
FutureBuilder(
future: someFutureFunction(),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting)
return Center(child: CircularProgressIndicator());
else
return Text(counter.toString());
}),
For example someFutureFunction()
returns Future<String>
... Is the snapshot
inside the call-back in FutureBuilder(builder: (context, snapshot){}
needed to access the returned value (Future<String>
) of someFutureFunction()
??
I just wand to make sure if I got it right before saving wrong information in my mind :)
Thanks