Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created January 13, 2020 16:13
Show Gist options
  • Save azamsharp/a24594f7e4695e751d3f3b623194c0eb to your computer and use it in GitHub Desktop.
Save azamsharp/a24594f7e4695e751d3f3b623194c0eb to your computer and use it in GitHub Desktop.
class NewsArticle {
final String title;
final String publication;
final String imageURL;
NewsArticle({this.title, this.publication, this.imageURL});
factory NewsArticle.fromJson(Map<String, dynamic> json) {
return NewsArticle(
title: json["title"],
publication: json["publication"],
imageURL: json["imageURL"]
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment