strava_client
2.4.0, released 3 months ago by an unverified publisher
An unofficial Flutter client for the Strava V3 API with OAuth2 and repository-based endpoints.
What it does
Provides a client for the Strava V3 API, handling OAuth2 authentication with automatic token refresh, structured error handling, and typed request/response models for activities, athletes, segments, and more.
AI-written summary of version 2.4.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to integrate Strava data into your Flutter application.
- You want built-in OAuth2 flow with automatic token refreshing and storage.
Skip it when
- You are building a web application (web platform is not supported).
- You only need generic HTTP networking without Strava-specific models.
Strengths
- Handles complex OAuth2 flows and automatic token refresh out of the box.
- Provides repository-per-domain API structure covering athletes, activities, segments, etc.
- Typed models generated with json_serializable and structured error handling via Fault.
Weaknesses
- Web platform is not supported.
- It is an unofficial third-party API client.
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- Yes (build_runner)
- Direct dependencies
- 7
Requires adding custom redirect URL scheme configuration in AndroidManifest.xml and Info.plist, and setting up an API client in Strava settings.
final stravaClient = StravaClient(
clientId: "YOUR_CLIENT_ID",
secret: "YOUR_CLIENT_SECRET",
);
final token = await stravaClient.authentication.authenticate(
scopes: [AuthenticationScope.activity_read_all],
redirectUrl: "stravaflutter://redirect",
callbackUrlScheme: "stravaflutter",
);
final athlete = await stravaClient.athletes.getAuthenticatedAthlete();Alternatives
Packages that do the same job and could replace strava_client.
- cronet_http
An Android Flutter plugin providing access to the Cronet HTTP client.
87Compare - vmodal_sdk_flutter
Typed VModal API client for Flutter to upload videos and search moments by meaning.
67Compare - http2
An HTTP/2 implementation in Dart for low-level transport and pooled HTTP/2 requests.
91Compare - fresh_dio
A dio interceptor for automatic token refresh and authentication management.
82Compare
Works with
Packages commonly used together with strava_client: ones it builds on, ones built on it, and its own family.
- json_annotationstrava_client depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- url_launcherstrava_client depends on itFlutter plugin for launching URLs across mobile, desktop, and web platforms.
- shared_preferencesstrava_client depends on itFlutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android.
- diostrava_client depends on itA powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.
- app_linksstrava_client depends on itHandler for Android App Links, iOS Universal Links, and custom URL schemes across mobile and desktop.
- get_itstrava_client depends on itA fast, type-safe service locator for Dart and Flutter without BuildContext or code generation.
- flutter_web_auth_2strava_client depends on itFlutter plugin for authenticating a user with a web service.