Created
July 1, 2018 14:27
-
-
Save aaronoe/6edb18121d6ca3b4e70f62cf3906156e 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
@override | |
Widget build(BuildContext context) { | |
return new FutureBuilder<Repositories>( | |
future: apiClient.getUserRepositoriesFuture(username), | |
builder: (BuildContext context, | |
AsyncSnapshot<Repositories> snapshot) { | |
if (snapshot.hasError) | |
return new Center(child: new Text("Network error")); | |
if (!snapshot.hasData) | |
return new Center( | |
child: new CircularProgressIndicator(), | |
); | |
return new ListView.builder( | |
itemCount: snapshot.data.nodes.length, | |
itemBuilder: (BuildContext context, int index) => | |
new RepoPreviewTile( | |
repository: snapshot.data.nodes[index], | |
), | |
); | |
}, | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment