coffee_mapbox 0.0.1+1 copy "coffee_mapbox: ^0.0.1+1" to clipboard
coffee_mapbox: ^0.0.1+1 copied to clipboard

Mapbox views + offline tiles + tracking, as a Flutter plugin.

Absolutely — here’s a cleaned-up, professional, and beginner-friendly README for Coffee Mapbox that combines Android and iOS setup, with clear sections and proper formatting. I’ve polished wording, ordering, and emphasized the necessary steps.


Coffee Mapbox — Flutter Plugin Integration Guide #

This guide explains how to integrate the Coffee Mapbox Flutter plugin, including Mapbox access token setup, location permissions, and initial configuration for both Android and iOS platforms.


Table of Contents #

  1. Installation
  2. Android Setup
  3. iOS Setup
  4. Build & Run

1) Installation #

Add coffee_mapbox to your pubspec.yaml dependencies:

dependencies:
  coffee_mapbox: ^1.0.0

Then run:

flutter pub get

2) Android Setup #

2.1) Add Mapbox Access Token #

  1. Open android/app/src/main/res/values/strings.xml.
  2. Add your Mapbox token:
<resources>
    <string name="mapbox_access_token">YOUR_MAPBOX_ACCESS_TOKEN_HERE</string>
</resources>

⚠️ Replace YOUR_MAPBOX_ACCESS_TOKEN_HERE with your actual Mapbox token.


2.2) Configure gradle.properties #

Add your token to gradle.properties for Gradle/Maven access:

MAPBOX_DOWNLOADS_TOKEN=YOUR_MAPBOX_ACCESS_TOKEN_HERE

This ensures Gradle can download Mapbox SDK artifacts securely during the build.


2.3) Configure Project-level Gradle (android/build.gradle) #

Inside the allprojects { repositories { ... } } section, add the Mapbox Maven repository:

allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://storage.googleapis.com/download.flutter.io' }

        // Mapbox SDK repository
        maven {
            url = uri("https://api.mapbox.com/downloads/v2/releases/maven")
            credentials {
                username = "mapbox"
                password = project.findProperty("MAPBOX_DOWNLOADS_TOKEN") ?: ""
            }
            authentication {
                basic(BasicAuthentication)
            }
        }
    }
}

3) iOS Setup #

3.1) Platform Version #

In your ios/Podfile, ensure the platform is at least 13.0:

platform :ios, '13.0'

3.2) Add Mapbox Access Token #

Add your Mapbox token to Info.plist:

<key>MBXAccessToken</key>
<string>YOUR_MAPBOX_ACCESS_TOKEN_HERE</string>

⚠️ Replace the string value with your own Mapbox token.

After updating Info.plist, run:

cd ios
pod install

3.3) Add Location Permissions #

Update Info.plist with these keys:

<key>NSLocationWhenInUseUsageDescription</key>
<string>We need your location to show it on the map</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>We need your location for navigation and tracking even in the background</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>We need your location for background updates</string>

These keys are required for iOS to prompt the user for location permissions.


4) Build & Run #

From the root of your Flutter project:

flutter clean
flutter pub get
cd ios
pod install
cd ..
flutter run -v

Now you are ready to use Coffee Mapbox in your Flutter project!

This README ensures the plugin works for both Android and iOS, handles Mapbox token setup, and provides clear instructions for runtime configuration and permissions.


0
likes
150
points
0
downloads

Publisher

unverified uploader

Weekly Downloads

Mapbox views + offline tiles + tracking, as a Flutter plugin.

Repository (GitHub)

Documentation

API reference

License

unknown (license)

Dependencies

flutter, http, latlong2, path_provider, plugin_platform_interface, uuid

More

Packages that depend on coffee_mapbox

Packages that implement coffee_mapbox