This guide covers everything you need to set up a development environment and contribute to the Mapbox Maps SDK for Flutter.
- Flutter SDK 3.44.2 or higher (Dart SDK 3.12.0+)
- Xcode (for iOS development) — iOS deployment target is 14.0+
- Android Studio or the Android SDK (API level 21+, compile SDK 36)
- A modern browser with WebGL 2 support (for web development)
- A Mapbox account with a valid access token
You need two types of tokens:
- Secret token (
sk.*) — required to download Mapbox binary dependencies. - Public token (
pk.*) — used at runtime to authenticate with Mapbox APIs.
Add the following to ~/.netrc (create it if it doesn't exist):
machine api.mapbox.com
login mapbox
password <your-secret-token>
Set the SDK_REGISTRY_TOKEN environment variable, or add it to your gradle.properties:
SDK_REGISTRY_TOKEN=<your-secret-token>-
Clone the repository:
git clone git@github.com:mapbox/mapbox-maps-flutter.git cd mapbox-maps-flutter -
Resolve dependencies. This repo is a Dart pub workspace rooted at
pubspec.yaml, so runningflutter pub getanywhere — the repo root, any package, ormapbox_maps_flutter/example/— resolves every federated package to its in-tree version automatically. No extra wiring is required. -
Verify your environment is ready by analyzing any package:
cd mapbox_maps_flutter && flutter analyze
The example app demonstrates the SDK's features and serves as the host for integration tests.
cd example
# Provide your public access token
flutter run --dart-define=ACCESS_TOKEN=pk.your_token_hereYou can also persist the token in .vscode/launch.json:
{
"configurations": [
{
"args": ["--dart-define", "ACCESS_TOKEN=pk.your_token_here"]
}
]
}