getListItems method

Future<List<ListItem>> getListItems(
  1. int id,
  2. String listId, {
  3. bool useOAuth = false,
  4. ListType? listType,
  5. RequestPagination? pagination,
  6. bool extendedFull = false,
})

Get all items on a custom list.

Items can be a movie, show, season, episode, or person. You can optionally specify the type parameter with a single value or comma delimited string for multiple item types.

All list items are sorted by ascending rank. We also send X-Sort-By and X-Sort-How headers which can be used to custom sort the list in your app based on the user's preference. Values for X-Sort-By include rank, added, title, released, runtime, popularity, percentage, votes, my_rating, random, watched, and collected. Values for X-Sort-How include asc and desc.

id - User slug listId - Trakt ID or Trakt slug listType - Filter for a specific item type useOAuth - whether to make the request using OAuth header

🔓 OAuth Optional 📄 Pagination Optional ✨ Extended Info 😁 Emojis

Implementation

Future<List<ListItem>> getListItems(
  int id,
  String listId, {
  bool useOAuth = false,
  ListType? listType,
  RequestPagination? pagination,
  bool extendedFull = false,
}) async {
  var request = "users/$id/lists/$listId";
  if (listType != null) {
    request = "$request/${listType.value}";
  }

  if (useOAuth) {
    return await _manager._authenticatedGetList<ListItem>(request, pagination: pagination);
  }

  return await _manager._getList<ListItem>(request, pagination: pagination);
}