pokeapi_dart 0.0.1+1 pokeapi_dart: ^0.0.1+1 copied to clipboard
All the Pokémon data you'll ever need in one place, easily accessible through a modern RESTful API.
import 'package:pokeapi_dart/pokeapi_dart.dart';
void main() async {
final api = PokeApi();
// with await, be sure to be in an async function (and in a try/catch)
final golduck = await api.pokemon.get(name: 'golduck');
print(golduck);
// with Future
api.pokemon.get(name: 'eevee').then((response) {
print(response);
});
// get pokemon by id
final firstPokemon = api.pokemon.get(id: 1);
print(firstPokemon);
// get pokemon lists
final pokemonList = api.pokemon.getPage(limit: 20, offset: 20);
print(pokemonList);
}