Skip to main content

Flutter SDK Installation

Get started with the DoorstepAI Flutter SDK to add intelligent delivery tracking to your Flutter application.

Prerequisites

Before you begin, ensure you have:

  • Flutter 3.3 or later with Dart 3.5.3+
  • Valid API Key from DoorstepAI
  • iOS 15+ deployment target for iOS
  • Android API 21+ for Android

Installation

1. Add Dependencies

Add the DoorstepAI Flutter SDK to your pubspec.yaml:

pubspec.yaml
dependencies:
flutter:
sdk: flutter

# DoorstepAI SDK
doorstepai_dropoff_sdk: ^2.2.2

The SDK owns its runtime permission flow; a separate permission_handler dependency is not required.

2. Install Dependencies

Run the following command to install the dependencies:

flutter pub get

3. Platform-Specific Setup

iOS Setup

For iOS, run the following command to install CocoaPods dependencies:

cd ios && pod install && cd ..

Android Setup

For Android, the SDK will be automatically linked via autolinking. No additional manual steps are required.

Platform-Specific Configuration

iOS Configuration

Update your iOS app's Info.plist file with the required permissions:

ios/Runner/Info.plist
<dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app requires access to your location for enhanced delivery intelligence</string>

<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This app requires access to your location for enhanced delivery intelligence</string>

<key>NSMotionUsageDescription</key>
<string>This app requires access to motion data for enhanced delivery intelligence</string>

<key>NSBluetoothAlwaysUsageDescription</key>
<string>This app requires access to Bluetooth for enhanced delivery intelligence</string>

<key>UIBackgroundModes</key>
<array>
<string>location</string>
</array>
</dict>

Android Configuration

The Android SDK library contributes its tracking components and permission declarations through manifest merge. Add INTERNET, which the library does not declare, to your app manifest:

android/app/src/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yourapp.package">

<uses-permission android:name="android.permission.INTERNET" />
<application>
<!-- Your app components -->
</application>
</manifest>

The merged SDK manifest supplies the runtime rows in the table below plus foreground-service, wake-lock, network/Wi-Fi-state, boot, and legacy Bluetooth compatibility declarations. Inspect the Merged Manifest view for the exact result. Do not add neverForLocation to BLUETOOTH_SCAN or NEARBY_WIFI_DEVICES: the SDK uses nearby radio observations for positioning. The SDK does not require specific sensor hardware at install time.

Permission Requirements

PermissionPurposePlatformRuntime Required
ACCESS_FINE_LOCATIONPrecise location trackingAndroidYes
ACCESS_COARSE_LOCATIONApproximate locationAndroidYes
ACCESS_BACKGROUND_LOCATIONBackground location accessAndroidYes
ACTIVITY_RECOGNITIONMotion and activity detectionAndroidYes
BLUETOOTH_SCANNearby BLE scanning on Android 12+AndroidYes
NEARBY_WIFI_DEVICESNearby Wi-Fi access on Android 13+AndroidYes
FOREGROUND_SERVICEBackground processingAndroidNo
FOREGROUND_SERVICE_LOCATIONLocation foreground serviceAndroidNo
POST_NOTIFICATIONSDelivery notificationsAndroidYes (API 33+)
WAKE_LOCKKeep device awake during trackingAndroidNo
ACCESS_WIFI_STATEWiFi state accessAndroidNo
ACCESS_NETWORK_STATENetwork state accessAndroidNo
INTERNETNetwork communicationAndroidNo
NSLocationWhenInUseUsageDescriptionLocation access during app usageiOSYes
NSLocationAlwaysAndWhenInUseUsageDescriptionBackground location accessiOSYes
NSMotionUsageDescriptionMotion and sensor dataiOSYes
NSBluetoothAlwaysUsageDescriptionNearby BLE scanningiOSYes

* Starting with Android 13 (API level 33), apps must request POST_NOTIFICATIONS at runtime.

Verification

To verify the installation was successful:

Build your project:

# iOS
flutter build ios

# Android
flutter build apk

Import Test

import 'package:doorstepai_dropoff_sdk/doorstepai_dropoff_sdk.dart';
import 'package:doorstepai_dropoff_sdk/doorstep_ai_view.dart';

void main() {
runApp(MyApp());
}

Next Steps

Now that you have the SDK installed and configured:

  1. 📚 Learn SDK Usage - Initialize and use the SDK
  2. 🔐 Review Permissions - Implement staged, cross-platform prompts
  3. 💡 View Examples - See complete implementation examples
info

For support and questions, contact us at support@doorstep.ai