Skip to content

Instantly share code, notes, and snippets.

@agarasul
Created July 31, 2019 14:31
Show Gist options
  • Save agarasul/f280915e40fd7c2d33f8833c8432adda to your computer and use it in GitHub Desktop.
Save agarasul/f280915e40fd7c2d33f8833c8432adda to your computer and use it in GitHub Desktop.
class Article {
Source source;
String author;
Article.fromJson(Map<String, dynamic> articleJson)
: source = Source.fromJson(articleJson['source']),
author = articleJson['author']
}
class Source {
String id;
String name;
Source.fromJson(Map<String, dynamic> sourceJson)
: id = sourceJson['id'],
name = sourceJson['name'];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment