updateCustomList function Null safety

Future<CustomListResponse> updateCustomList(
  1. String sessionToken,
  2. String listId,
  3. String listName,
  4. Visibility visibility,
  5. List<String> mangaIds,
  6. int version
)

Updates an existing custom list identified by its listId or UUID only if the user identified by the sessionToken has permission to update the list and returns the updated data in a CustomListResponse class instance.

Implementation

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