Skip to content

Instantly share code, notes, and snippets.

@florent37
Created December 11, 2018 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save florent37/a6449d30024a2a21470941f1ad16557d to your computer and use it in GitHub Desktop.
Save florent37/a6449d30024a2a21470941f1ad16557d to your computer and use it in GitHub Desktop.
part 'Movie.g.dart';
@JsonSerializable()
class Movie {
@JsonKey(name: "Title")
final String title;
@JsonKey(name: "Year")
final String year;
@JsonKey(name: "ImdbID")
final String imdbID;
@JsonKey(name: "Type")
final String type;
@JsonKey(name: "Poster")
final String poster;
//default constructor
Movie({this.title, this.year, this.imdbID, this.type, this.poster});
factory Movie.fromJson(Map<String, dynamic> json) => _$MovieFromJson(json);
Map<String, dynamic> toJson() => _$MovieToJson(this);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment