FitbitConnector class
FitbitConnector is a class that is in charge of managing the connection authorization between the app and Fitbit APIs. In details, it can authorize the app thus retaining the access and refresh tokens (see FitbitConnector.authorize for more details), refresh the access token if needed (see FitbitConnector.refreshToken for more details), unauthorize the app (see FitbitConnector.unauthorize for more details), and check for the access token status (see FitbitConnector.isTokenValid for more details).
Constructors
- FitbitConnector()
-
Public factory constructor of FitbitConnector.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
- Method that implements the OAuth 2.0 protocol and gets the access and refresh tokens from Fitbit APIs.
-
isTokenValid(
{required FitbitCredentials fitbitCredentials}) → FutureOr< bool> - Method that checks if the current token is still valid to be used by the Fitbit APIs OAuth or it is expired.
-
refreshToken(
{required String clientID, required String clientSecret, required FitbitCredentials fitbitCredentials}) → Future< FitbitCredentials> -
Method that refreshes the Fitbit access token and returns the new, refreshed
FitbitCredentials
. - Method that revokes the current access tokens.