igdb_client 0.0.5

igdb_client #

A Dart library for using the IGDB.com API v3 https://api-docs.igdb.com/

It is highly recommended to read through the IGDB documentation to understand what exactly you can do with the API.

Limitations #

Premium features (including IGDB user authentication) are not supported and I don't currently have plans to add support for them as I don't have access to these.

Usage #

To start using this, just add it to your pubspec:

pub package

See example/igdb_client_example.dart for a more in depth example of some of the things you can do with this client. Otherwise a simple example can be found below.

import 'package:igdb_client/igdb_client.dart';

var client = new IGDBClient(

var gamesResponse = await client.games(new IGDBRequestParameters(
  limit: 3


if (gamesResponse.isSuccess()) {
  // do something with gamesResponse.data
else {
  // do something depending on gamesResponse.error

Changelog #

0.0.5 #

  • Updating for breaking change in http dependency
  • add support for alpha channel fo rimages

0.0.4 #

  • Added more endpoints and client methods for each
  • Added more platforms enums
  • Added IGDBHelper class for miscellaneous helper methods

0.0.3 #

  • Change IGDBRequestParameters.ids to a List

0.0.2 #

  • Update pubspec to appear as a Dart package instead of just a Flutter package

0.0.1 #

  • Initial version


import 'api_key.dart';

import 'package:igdb_client/igdb_client.dart';

var client = new IGDBClient(

main() async {

  // Find games with 'infamous' in their name and return
  // the results' name and expand their release_dates and platforms.
  var gamesResponse = await client.games(new IGDBRequestParameters(
    search: 'infamous',
    fields: ['name', 'release_dates.*', 'platforms.*']

  // Find games that are not yet released but are releasing soon in the
  // North American, Worlwide, or Unspecified regions, then sort by 
  // release date.
  int msecSinceEpoch = DateTime.now().millisecondsSinceEpoch;
  int secsSinceEpoch = msecSinceEpoch~/1000;
  String timeNow = secsSinceEpoch.toString();
  var releaseResponse = await client.releaseDates(new IGDBRequestParameters(
    filters: 'date > $timeNow & (region = ${IGDBRegions.NORTH_AMERICA.id} | region = ${IGDBRegions.NONE.id} | region = ${IGDBRegions.WORLDWIDE.id})',
    order: 'date asc'

  var gameIdResponse = await client.games(new IGDBRequestParameters(
    ids: [43378],

printResponse(IGDBResponse resp) {

Use this package as a library

1. Depend on it

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

  igdb_client: ^0.0.5

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:igdb_client/igdb_client.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.5

Health suggestions

Fix lib/src/enums/endpoint.dart. (-23.71 points)

Analysis of lib/src/enums/endpoint.dart reported 54 hints, including:

line 2 col 44: Avoid const keyword.

line 3 col 64: Avoid const keyword.

line 4 col 50: Avoid const keyword.

line 5 col 41: Avoid const keyword.

line 6 col 43: Avoid const keyword.

Fix lib/src/enums/platform.dart. (-19.79 points)

Analysis of lib/src/enums/platform.dart reported 44 hints, including:

line 50 col 38: Avoid const keyword.

line 51 col 36: Avoid const keyword.

line 52 col 36: Avoid const keyword.

line 53 col 43: Avoid const keyword.

line 54 col 44: Avoid const keyword.

Fix lib/src/enums/genre.dart. (-10.89 points)

Analysis of lib/src/enums/genre.dart reported 23 hints, including:

line 28 col 45: Avoid const keyword.

line 29 col 38: Avoid const keyword.

line 30 col 37: Avoid const keyword.

line 31 col 35: Avoid const keyword.

line 32 col 38: Avoid const keyword.

Fix additional 9 files with analysis or formatting issues. (-19.66 points)

Additional issues in the following files:

  • lib/src/enums/image_sizes.dart (10 hints)
  • lib/src/enums/region.dart (10 hints)
  • lib/src/igdb_client.dart (9 hints)
  • lib/src/request_parameters.dart (4 hints)
  • lib/src/igdb_helpers.dart (3 hints)
  • lib/src/igdb_response.dart (3 hints)
  • lib/src/igdb_logger.dart (1 hint)
  • lib/igdb_client.dart (Run dartfmt to format lib/igdb_client.dart.)
  • lib/src/enums/enums.dart (Run dartfmt to format lib/src/enums/enums.dart.)

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
http ^0.12.0 0.12.0+4
Transitive dependencies
async 2.4.0
charcode 1.1.3
collection 1.14.12
http_parser 3.1.3
meta 1.1.8
path 1.6.4
pedantic 1.9.0
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6