Created
December 11, 2018 09:54
-
-
Save florent37/a6449d30024a2a21470941f1ad16557d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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