character method

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

Implementation

Future<Map<String, dynamic>> character(int id) async {
  // https://api.jikan.moe/v4/characters/32/full
  try {
    final res = await _dio.get("characters/$id/full");
    return res.data["data"];
  } on DioException catch (e) {
    if (e.response!.statusCode == 404) {
      throw NotFoundException();
    } else {
      throw BadResponseException();
    }
  }
}