Skip to content

Instantly share code, notes, and snippets.

@ghozay19
Created February 16, 2020 06:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghozay19/0049a0fa92c035948977bce9c4f06bfe to your computer and use it in GitHub Desktop.
Save ghozay19/0049a0fa92c035948977bce9c4f06bfe to your computer and use it in GitHub Desktop.
movie_item.dart
import 'package:json_annotation/json_annotation.dart';
part'movie_item.g.dart';
@JsonSerializable()
class MovieItem {
@JsonKey(name: 'poster_path')
String posterPath;
@JsonKey(name: 'backdrop_path')
String backdropPath;
@JsonKey(name: 'original_title')
String originalTitle;
String title;
String overview;
@JsonKey(name: "release_date")
String releaseDate;
MovieItem({this.posterPath, this.backdropPath, this.originalTitle,
this.title, this.overview, this.releaseDate});
factory MovieItem.fromJson(Map<String, dynamic> json) => _$MovieItemFromJson(json);
Map<String, dynamic> toJson() => _$MovieItemToJson(this);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment