Skip to content

Instantly share code, notes, and snippets.

@ulisseshen
Created June 26, 2022 18:29
Show Gist options
  • Save ulisseshen/5b08bed25d3f0e81081548990003d5f0 to your computer and use it in GitHub Desktop.
Save ulisseshen/5b08bed25d3f0e81081548990003d5f0 to your computer and use it in GitHub Desktop.
FutureBuilder<Album>(
future: futureAlbum,
builder: (context, snapshot) {
if (snapshot.hasData) {
return Text(snapshot.data!.title);
} else if (snapshot.hasError) {
return Text('${snapshot.error}');
}
// By default, show a loading spinner.
return const CircularProgressIndicator();
},
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment