twitch 0.2.0 copy "twitch: ^0.2.0" to clipboard
twitch: ^0.2.0 copied to clipboard

outdatedDart 1 only

Unofficial Twitch Client for Dart and Flutter.

twitch #

Unofficial Twitch Client for Dart and Flutter.

pub package Build Status Coverage Status

Warning: This is not an official Google or Dart project.

Installation #

dependencies:
  twitch: ^0.2.0

Usage #

This API is incomplete, and currently only supports raw HTTP requests.

For example, how to get the top played games on Twitch:

import 'dart:async';
import 'dart:io';

import 'package:twitch/twitch.dart';

/// With a pre-authorized client ID, prints the top games on Twitch.
/// 
/// Assumes the environment variable `TWITCH_CLIENT_ID` to be set.
Future<Null> main() async {
  TwitchHttp http;
  try {
    http = new TwitchHttp.fromEnv();
    final twitch = new Twitch(http);
    // GET https://api.twitch.tv/kraken/games/top
    final result = await twitch.getTopGames();
    // Result is a JSON-decoded Dart Map. This will be strongly typed later.
    print(result);
    http.close();
  } catch (e, s) {
    print('Error: $e');
    print('Stack: $s');
    exitCode = 1;
  } finally {
    http?.close();
  }
}

See the official API Overview for a full list of supported API calls and documentation.

1
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Unofficial Twitch Client for Dart and Flutter.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

meta

More

Packages that depend on twitch