Last active
March 25, 2020 07:46
-
-
Save xsahil03x/48fbfab22167be072f1fc3bdd102a59f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class MovieResponse { | |
int totalResults; | |
List<Movie> results; | |
MovieResponse.fromJson(Map<String, dynamic> json) { | |
totalResults = json['total_results']; | |
if (json['results'] != null) { | |
results = new List<Movie>(); | |
json['results'].forEach((v) { | |
results.add(new Movie.fromJson(v)); | |
}); | |
} | |
} | |
} | |
class Movie { | |
int id; | |
var voteAverage; | |
String title; | |
String posterPath; | |
String overview; | |
String releaseDate; | |
Movie.fromJson(Map<String, dynamic> json) { | |
id = json['id']; | |
voteAverage = json['vote_average']; | |
title = json['title']; | |
posterPath = json['poster_path']; | |
overview = json['overview']; | |
releaseDate = json['release_date']; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment