getPersonDetails method

Future<PeopleDetails> getPersonDetails({
  1. required int personId,
})

Get person details.

Get the primary person details by id.

Details like combined_credits, external_ids, images and tagged_images will also be added.

For more details on the API go here.

Throws FilmGyaanException on an error.

Implementation

Future<PeopleDetails> getPersonDetails({
  required int personId,
}) async {
  Ensure(personId > 0).isTrue('Person Id should be > 0');

  var params = PeopleDetailsParams(
    personId: personId,
  );

  _logger.info('Getting details for $personId person');

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