Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alfianlosari/655bc6d6740a63febb288921f308d576 to your computer and use it in GitHub Desktop.
Save alfianlosari/655bc6d6740a63febb288921f308d576 to your computer and use it in GitHub Desktop.
class Repo {
final String htmlUrl;
final int watchersCount;
final String language;
final String description;
final String name;
final String owner;
Repo(this.htmlUrl, this.watchersCount, this.language, this.description,
this.name, this.owner);
static List<Repo> mapJSONStringToList(List<dynamic> jsonList) {
return jsonList
.map((r) => Repo(r['url'], r['watchers_count'], r['language'],
r['description'], r['name'], r['owner']['login']))
.toList();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment