getCardById method
GET /cards/:id
Returns a single card with the given id
on Scryfall.
Implementation
Future<MtgCard> getCardById(String id) async {
final url = Uri.https(_baseUrl, '/cards/$id');
final response = await _httpClient.get(url);
final json = jsonDecode(response.body) as Map<String, dynamic>;
if (response.statusCode != 200) {
throw ScryfallException.fromJson(json);
}
return MtgCard.fromJson(json);
}