Skip to content

Instantly share code, notes, and snippets.

@Classy-Bear
Created December 8, 2019 21:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Classy-Bear/cb884a26e4dc2b43db46167fceb72998 to your computer and use it in GitHub Desktop.
Save Classy-Bear/cb884a26e4dc2b43db46167fceb72998 to your computer and use it in GitHub Desktop.
//https://stackoverflow.com/questions/50360443/parsing-json-that-has-a-nested-array-of-objects-in-dart
genres = (jsonMap['genres'] as List).map((i) => Genre.fromJson(i)).toList()
///JSON Data
//{
// "adult": false,
// "backdrop_path": "/wrqUiMXttHE4UBFMhLHlN601MZh.jpg",
// "belongs_to_collection": null,
// "budget": 120000000,
// "genres": [
// {
// "id": 28,
// "name": "Action"
// },
// {
// "id": 12,
// "name": "Adventure"
// },
// {
// "id": 878,
// "name": "Science Fiction"
// }
// ],
// "homepage": "http://www.rampagethemovie.com",
// "id": 427641,
// "imdb_id": "tt2231461",
// "original_language": "en",
// "original_title": "Rampage",
//...
//}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment