getMovieCredits method

Future<Credits> getMovieCredits({
  1. required int movieId,
})

Get movie credits.

Get the cast and crew for a movie.

For more details on the API go here.

Throws FilmGyaanException on an error.

Implementation

Future<Credits> getMovieCredits({
  required int movieId,
}) async {
  Ensure(movieId > 0).isTrue('Movie Id should be > 0');

  var params = CreditsParams(
    movieId: movieId,
  );

  _logger.info('Getting credits for $movieId movie');

  return defaultFlow<CreditsParams, Credits>(
    core: this,
    params: params,
    serializer: (dynamic json) => Credits.fromMap(
      json as Map<String, dynamic>,
    ),
  );
}