champions 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • new50

Dart CI

A Dart library for the League of Legends static data or Data Dragon database.

Usage #

A simple usage example:

import 'package:champions/champions.dart';

void main() {
  var champions = Champions();

  // Print the name and tittle of all champions
  champions.all.then((list) {
    list.values.forEach((Champion champ) {
      print('${champ.name} - ${champ.title}');
    });
  });

  // List of Marksman champions
  champions.withRole(Role.marksman);

  // List of champions that filtered by name
  champions.search('ann');
  
  // Filter the champion list by custom criteria
  // For example filter the list by champions with at least 600 base HP
  champions.filter((champ) => champ.stat.hp >= 600);
}

Roadmap #

This library is still under development below are the items that still need to be implemented:

  1. List of champion spells, and their corresponding assets like images and videos.
  2. Information about champion passive including icon.
  3. Add the extended version of the lore.
  4. Include tips for allies and enemies.
  5. Add champion skins.
  6. Add champion splash arts assets.
  7. Add loading screen assets.
  8. Add items library.
  9. Add library for summoner spells.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0.1.0 #

  • Abstract the public facing API to interfaces to is easier to keep track the public api changes
  • Added partial support for extra champion information like skins, lore and tips

1.0.0-dev.1 #

  • Improves and brings more clarity to the public API

1.0.0-dev #

  • Initial version including the basic champion information and stats.

example/champions_example.dart

import 'package:champions/champions.dart';

void main() async {
  // Creates the champions for reference for NA with the latest patch version
  // and default language
  var champions = await Champions.forRegion(Region.na);

  // Get the list of all champions
  var list = (await champions.all).values;

  // Or only of Marksman champions
  list = await champions.withRole(Role.marksman);

  // Or only list of champions filtered by name
  list = await champions.search('ann');

  // Or only list of champions filtered by custom criteria
  // For example filter the list by champions with at least 600 base HP
  list = await champions.filter((champ) => champ.stats.hp >= 600);

  // Print the name and title for each champion in the list
  list.forEach((Champion champ) {
    print('${champ.name} - ${champ.title}');
  });
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  champions: ^0.1.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:champions/champions.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

We analyzed this package on Jul 9, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14

Health suggestions

Format lib/src/asset_api.dart.

Run dartfmt to format lib/src/asset_api.dart.

Format lib/src/champions_base.dart.

Run dartfmt to format lib/src/champions_base.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.8.1 <3.0.0
enum_to_string ^1.0.9 1.0.9
http ^0.12.1 0.12.1
Transitive dependencies
charcode 1.1.3
collection 1.14.13 1.15.0-nullsafety
http_parser 3.1.4
meta 1.2.2 1.3.0-nullsafety
path 1.7.0
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.2.0 1.3.0-nullsafety
Dev dependencies
build_runner >=1.6.2 <2.0.0
build_web_compilers >=2.6.1 <3.0.0
pedantic ^1.9.0 1.9.2
test ^1.14.4