TraktManager constructor
TraktManager({})
Initializes the TraktManager for making API calls. This must be called before making any API calls!
clientId
- The ClientId listed under your Trakt applications
clientSecret
- The Client secret listed under your Trakt applications
redirectURI
- the redirect uri set under your Trakt applications for OAuth.
useStaging
- whether to use the Trakt Staging environment. Default to false.
Implementation
TraktManager(
{required String clientId, required String clientSecret, required String redirectURI, bool useStaging = false})
: client = Client() {
_clientId = clientId;
_clientSecret = clientSecret;
_redirectURI = redirectURI;
_headers = {"trakt-api-version": "2", "trakt-api-key": clientId, "Content-type": "application/json"};
if (useStaging) {
_baseURL = "api-staging.trakt.tv";
}
_oauthURL = "https://trakt.tv/oauth/authorize?response_type=code&client_id=$_clientId&redirect_uri=$_redirectURI";
_authentication = Authentication(this);
_calendar = Calendar(this);
_certifications = Certifications(this);
_checkIn = CheckIn(this);
_comments = Comments(this);
_countries = Countries(this);
_episodes = Episodes(this);
_genres = Genres(this);
_languages = Languages(this);
_lists = Lists(this);
_movies = Movies(this);
_networks = Networks(this);
_people = People(this);
_recommendations = Recommendations(this);
_scrobble = Scrobble(this);
_search = Search(this);
_seasons = Seasons(this);
_shows = Shows(this);
_users = Users(this);
_sync = Sync(this);
}