unofficial_twitch_open_api 0.0.4 copy "unofficial_twitch_open_api: ^0.0.4" to clipboard
unofficial_twitch_open_api: ^0.0.4 copied to clipboard

Wrapper for the newest Twitch API. It returns informations about channels, media, search and game

📦 unofficial_twitch_open_api #

This package allows to retrieve all the data by the newest Twitch APIs.

Getting started #

To make the APIs works, you need to configure your application on Twitch Dev Console. If you don't how to do, please follow the steps here .

To access to the Twitch's data, was implemented the class TwitchManagerOpenApi. This utility create an instance of the available subclass of BaseTwitchOpenApi.

/// You can create the instance of [TwitchManagerOpenApi] via provider or get_it
/// An example below:
List<SingleChildWidget> _initProvider() {
  String clientId = 'your_secret_client_id';

  return [
    Provider<TwitchManagerOpenApi>(
      create: (ctx) =>
          TwitchManagerOpenApi(
            clientId: clientId,
          ),
    ),
  ];
}

/// Then, you can use the instance created previously to retrieve the subclass needed
T getInstance<T extends BaseTwitchOpenApi>() {
  final manager = Provider.of<TwitchManagerOpenApi>();

  return manager.of<T>(bearerToken: 'your_secret_token');
}

/// Finally, use the instance. An example below:
final channelInfo = getInstance<TwitchChannelInformation>(
  bearerToken: 'your_secret_token',
).getChannelInformation(broadcasterId: broadcasterId);
6
likes
140
points
26
downloads

Publisher

verified publisherfedericoviceconti.com

Weekly Downloads

Wrapper for the newest Twitch API. It returns informations about channels, media, search and game

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, http, unofficial_twitch_http

More

Packages that depend on unofficial_twitch_open_api