toJson method

Map<String, dynamic> toJson()

Converts the Movie instance to a JSON map.

Implementation

Map<String, dynamic> toJson() {
  return {
    'id': id,
    'title': title,
    'overview': overview,
    'poster_path': TmdbImageUtil.extractPath(
      posterUrl,
    ).replaceAll('/p/w500/', ''),
    'backdrop_path': TmdbImageUtil.extractPath(
      backdropUrl,
    ).replaceAll('/original/', ''),
    'vote_average': voteAverage,
    'release_date': releaseDate.toIso8601String(),
    'genre_ids': genreIds,
  };
}