delete games
This commit is contained in:
@@ -34,4 +34,24 @@ class IgdbApi {
|
||||
}
|
||||
throw Exception('IGDB search: unerwartetes Antwortformat');
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> getGameDetails(int igdbId, {String lang = 'de'}) async {
|
||||
final res = await _dio.get(
|
||||
'',
|
||||
queryParameters: {
|
||||
'action': 'details',
|
||||
'id': igdbId,
|
||||
'lang': lang,
|
||||
'check_external': 1,
|
||||
},
|
||||
);
|
||||
if (res.statusCode != 200) {
|
||||
throw Exception('IGDB details HTTP ${res.statusCode}');
|
||||
}
|
||||
final data = res.data;
|
||||
if (data is Map && data['game'] is Map) {
|
||||
return (data['game'] as Map).cast<String, dynamic>();
|
||||
}
|
||||
throw Exception('IGDB details: unerwartetes Antwortformat');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user