A library to facilitate access to the Riot API.

Build codecov

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.