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.0 or later with Dart 2.17+
  • Valid API Key from DoorstepAI
  • iOS 15+ deployment target for iOS
  • Android API 24+ 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.0.0

# Permission handling
permission_handler: ^10.0.0

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>UIBackgroundModes</key>
<array>
<string>location</string>
</array>
</dict>

Android Configuration

Update your Android app's AndroidManifest.xml file with the required permissions:

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" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />

<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

<uses-feature android:name="android.hardware.sensor.accelerometer" />
<uses-feature android:name="android.hardware.sensor.gyroscope" />
<uses-feature android:name="android.hardware.sensor.barometer" />
<uses-feature android:name="android.hardware.sensor.compass" />
<uses-feature android:name="android.hardware.sensor.proximity" />

<application>
<!-- Your app components -->
</application>
</manifest>

Permission Requirements

PermissionPurposePlatformRuntime Required
ACCESS_FINE_LOCATIONPrecise location trackingAndroidYes
ACCESS_COARSE_LOCATIONApproximate locationAndroidYes
ACCESS_BACKGROUND_LOCATIONBackground location accessAndroidYes
ACTIVITY_RECOGNITIONMotion and activity detectionAndroidYes
FOREGROUND_SERVICEBackground processingAndroidNo
FOREGROUND_SERVICE_LOCATIONLocation foreground serviceAndroidNo
FOREGROUND_SERVICE_DATA_SYNCData sync 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

* 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. 💡 View Examples - See complete implementation examples
info

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