createCustomList method

Future<SingleCustomListResponse> createCustomList(
  1. String sessionToken,
  2. String listName,
  3. Visibility visibility,
  4. List<String> mangaIds,
  5. int version,
)
inherited

Endpoint used: POST /list

Creates a custom list with the name listName and sets visibility to either Visibility.private or Visibility.public and adds all mangas IDs / UUIDs in the mangaIds list and returns a SingleCustomListResponse class instance containing data of the list created.

Implementation

Future<SingleCustomListResponse> createCustomList(
    String sessionToken,
    String listName,
    Visibility visibility,
    List<String> mangaIds,
    int version) async {
  var response = await createCustomListResponse(
      sessionToken, listName, visibility, mangaIds, version);
  try {
    return SingleCustomListResponse.fromJson(jsonDecode(response.body));
  } on Exception {
    throw MangadexServerException(jsonDecode(response.body));
  }
}