Skip to content

Instantly share code, notes, and snippets.

@Classy-Bear
Created December 7, 2019 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Classy-Bear/7d1c3d1379d5d84e44c907aa8c46fed1 to your computer and use it in GitHub Desktop.
Save Classy-Bear/7d1c3d1379d5d84e44c907aa8c46fed1 to your computer and use it in GitHub Desktop.
FutureBuilder(
future: getData(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
if (snapshot.hasError) {
return Center(child: Text('Error'));
}
if (snapshot.connectionState == ConnectionState.done) {
var mydata = snapshot.data;
return Center(child: Text('${mydata['data'][0]['email']}'));
} else {
return Center(child: CircularProgressIndicator());
}
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment