league_of_api 0.1.6 league_of_api: ^0.1.6 copied to clipboard
A library to facilitate access to the Riot API. Provide easy access to endpoint and dto for an easy access to the response data.
A library to facilitate access to the Riot API.
Usage #
import 'package:league_of_api/api/consts/region_routing_values.dart';
import 'package:league_of_api/api/models/riot_id.dart';
import 'package:league_of_api/api/models/tag_line.dart';
import 'package:league_of_api/league_of_api.dart';
void main() async {
final leagueApi = LeagueOfApi('your_api_key');
var account = await leagueApi.accountV1Service.getAccountByRiotId(
RegionRoutingValue.AMERICAS,
RiotId('Driky', TagLine('5441')),
);
print(account);
}
Riot API key #
Get your key here
Contribution #
I appreciate any contributions to this package. Any not yet implemented endpoints can be added similarly to the other implementations. Feel free to reach out to me to ask any questions.
Model code generation #
The DTOs fromJson
and toJson
methods are generated with json_serializable.
Every time a model class annotated with @JsonSerializable
is modified, you need to run the following command:
pub run build_runner build --delete-conflicting-outputs
Note: You can remove the --delete-conflicting-outputs
if you are the last person who ran this command (faster execution by using a local cache)
Note 2: The plugin AutoJson for Android Studio/IntelliJ provides a handy shortcut for that command.