Created
December 7, 2019 21:29
-
-
Save Classy-Bear/7d1c3d1379d5d84e44c907aa8c46fed1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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