toMap method
Implementation
Map<String, dynamic> toMap() {
final _toMap = {
'created_by': this.createdBy.map((e) => e.toMap()).toList(),
'episodeRunTime': this.episodeRunTime,
'genres': this.genres.map((e) => e.toMap()).toList(),
'homepage': this.homepage,
'inProduction': this.inProduction,
'languages': this.languages,
'last_air_date': this.lastAirDate.toString(),
'last_episode_to_air': this.lastEpisodeToAir?.toMap(),
'networks': this.networks.map((e) => e.toMap()).toList(),
'number_of_episodes': this.numOfEpisodes,
'number_of_seasons': this.numOfSeasons,
'production_companies': this.productionCompanies.map((e) {
return e.toMap();
}).toList(),
'seasons': this.seasons.map((e) => e.toMap()).toList(),
'status': this.status,
'type': this.type,
'images': this.images,
'alternative_titles': this.alternativeTitles.map((e) {
return e.toMap();
}).toList(),
'credits': this.credits?.toMap(),
'externalIds': this.externalIds?.toMap(),
'keywords': this.keywords.map((e) => e.toMap()).toList(),
'videos': this.videos.map((e) => e.toMap()).toList(),
'recommendations': this.recommendations.map((e) => e.toMap()).toList(),
'similar': this.similar.map((e) => e.toMap()).toList(),
'watchProviders': this.watchProviders.map((key, value) {
return MapEntry(key, value.toMap());
}),
};
_toMap.addAll(super.toMap());
return _toMap;
}