titleThemes method

Future<Map<String, dynamic>?> titleThemes(
  1. int id
)

Implementation

Future<Map<String, dynamic>?> titleThemes(int id) async {
  // nyan
  try {
    final res = await _dio.get(
        "/anime?filter[has]=resources&filter[site]=MyAnimeList&filter[external_id]=$id&include=animethemes.animethemeentries.videos,animethemes.song.artists,studios,animethemes.animethemeentries.videos.audio");
    List animes = res.data["anime"];
    if (animes.length == 1) {
      return animes[0];
    } else {
      throw NotFoundException();
    }
  } on DioException catch (e) {
    if (e.response!.statusCode == 404) {
      throw NotFoundException();
    } else {
      throw BadResponseException();
    }
  }
}