chore: major changes
This commit is contained in:
@@ -13,6 +13,7 @@ class PokemonApi {
|
||||
static const String pokemonUrl = 'api/v1/pokemon';
|
||||
|
||||
static Future<Pokemon> getPokemon(int id) async {
|
||||
print('API Call: Fetching Pokémon $id from Tyradex...');
|
||||
// On utilise la méthode get de la classe http pour effectuer une requête GET
|
||||
// On utilise Uri.https pour construire l'URL de la requête
|
||||
var response = await http.get(Uri.https(baseUrl, "$pokemonUrl/$id"));
|
||||
@@ -59,6 +60,7 @@ class PokemonApi {
|
||||
}
|
||||
|
||||
static Future<List<Pokemon>> getAllPokemon() async {
|
||||
print('API Call: Fetching ALL Pokémon from Tyradex...');
|
||||
final response = await http.get(Uri.https(baseUrl, pokemonUrl));
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
Reference in New Issue
Block a user