TwitchInterface class
This is the main object you will use to communicate with the Twitch API
Constructors
- TwitchInterface({required String clientId, required String? redirectionURL, String? accessToken = ''})
Properties
- accessToken ↔ String?
-
Token retrieved from redirect url after user logged in
getter/setter pair
- analytics → AnalyticsRepository
-
no setter
- bits → BitsInterface
-
no setter
- channel → ChannelInterface
-
no setter
- channelPoints → ChannelPointsRepository
-
no setter
- chat → ChatInterface
-
no setter
- clientId → String
-
User the clientID you got from the Twitch developper console
final
- clip → ClipRepository
-
no setter
- event → EventSubInterface
-
no setter
- games → GamesRepository
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- moderation → ModerationInterface
-
no setter
- polls → PollsRepository
-
no setter
- prediction → PredictionRepository
-
no setter
- raid → RaidRepository
-
no setter
- redirectionURL → String?
-
User any URL you need, be sure to whitelist it on dev console
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- streamsRepository → StreamsRepository
-
no setter
- subscription → SubscriptionRepository
-
no setter
- token → TokenInterface
-
no setter
- tokenResponse ↔ ValidateTokenResponse?
-
User token data
getter/setter pair
- twitchRepositories ↔ TwitchRepositories
-
Access all requests
getter/setter pair
- user → UserInterface
-
no setter
- userId → String
-
no setter
- video → VideoRepository
-
no setter
Methods
-
getConnectionUrl(
{required List< String> scopes}) → Uri - Create a URL with the given scopes First, call this method and use the Uri in webview or open in browser
-
init(
{String url = ''}) → Future< bool> - Init all repos with data retrieved from givenUrl Call this after getConnectionURL Give the url the user was redirected to after loggin in After this, user is considered logged in and repos can be called You can save the redirected url and use this method when user comes back to the app returns false if there was an issue parsing the URL
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parseUrl(
{required String url}) → String - Parses the URL and returns the access token if it exists in the URL fragment.
-
toString(
) → String -
A string representation of this object.
inherited
-
validateToken(
) → Future< TokenStatus> - Verify the validity of the token, must be used hourly based on the Twitch api documentation TokenStatus.invalid you must make the user reconnect to get a valid token TokenStatus.error the api sent an error back but it's not related to the token validity TokenStatus.unknown other exception without context
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited