StravaClient class

A Flutter client for Strava, which supports most of Strava V3 API operations.

This client contains repositories allowing an easy management of the different operations with Strava's API.

Some usage examples:

// Create the client
StravaClient myStravaClient = StravaClient(
  secret: 'my-strava-secret',
  clientId: 'my-strava-client-id',
  applicationName: 'my-awesome-app',
);

// Authenticate and authorize your app to access your Strava's data
await myStravaClient.authentication.authenticate(
  scopes: [
    AuthenticationScope.activity_read_all,
  ],
  redirectUrl: 'my.cool.app://redirect',
  callBackUrlScheme: 'my.cool.app',
);

// Get some of your activities
var myActivities =
    await myStravaClient.activities.listLoggedInAthleteActivities(
  DateTime.now(),
  DateTime(1999),
  1,
  30,
);

Constructors

StravaClient({required String secret, required String clientId, String applicationName = ''})
Create a new StravaClient from your Client ID and Client Secret.

Properties

activities RepositoryActivity
Repository managing all activities operations.
no setter
athletes RepositoryAthlete
Repository managing all athletes operations such as RepositoryAthlete.getAthleteStats or RepositoryAthlete.updateAthlete.
no setter
authentication RepositoryAuthentication
Repository managing authentication.
no setter
clientId String
Your Strava client ID generated for your API Application.
final
clubs RepositoryClub
Repository managing all clubs operations.
no setter
gears RepositoryGear
Repository managing all gears operations.
no setter
hashCode int
The hash code for this object.
no setterinherited
routes RepositoryRoute
Repository managing all routes operations.
no setter
runningRaces RepositoryRunningRace
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secret String
Your Strava client secret generated for your API Application.
final
segmentEfforts RepositorySegmentEffort
Repository managing all segmentEfforts operations.
no setter
segments RepositorySegment
Repository managing all segments operations.
no setter
streams RepositoryStream
Repository managing all streams operations.
no setter
uploads RepositoryUpload
Repository managing all uploads operations.
no setter

Methods

getStravaAuthToken() Future<TokenResponse?>
Returns stored strava TokenResponse if needed. returns null if there is no logged in user
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