getMigrations method
GET /migrations
Returns a PaginableList
of all Migrations on Scryfall.
Implementation
Future<PaginableList<Migration>> getMigrations() async {
final url = Uri.https(_baseUrl, '/migrations');
final response = await _httpClient.get(url);
final json = jsonDecode(response.body) as Map<String, dynamic>;
if (response.statusCode != 200) {
throw ScryfallException.fromJson(json);
}
return PaginableList<Migration>.fromJson(
json,
(migration) => Migration.fromJson(migration as Map<String, dynamic>),
);
}