Skip to content

Instantly share code, notes, and snippets.

@florent37
Created Dec 11, 2018
Embed
What would you like to do?
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