Created
February 16, 2020 06:10
-
-
Save ghozay19/e4fd1db88a3abc2a07f8b78bd4a0bc0a to your computer and use it in GitHub Desktop.
movie_resp
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
import 'package:json_annotation/json_annotation.dart'; | |
import 'package:movie_db/core/model/movie_item.dart'; | |
part'movie_resp.g.dart'; | |
@JsonSerializable() | |
class MovieResp { | |
List<MovieItem> results; | |
//samakan tulisan results ini dengan response json yang terdapat di apinya. | |
//kode diatas akan me-list movie item yang sudah kita buat. | |
MovieResp(this.results); | |
factory MovieResp.fromJson(Map<String, dynamic> json) => _$MovieRespFromJson(json); | |
Map<String, dynamic> toJson() => _$MovieRespToJson(this); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment