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:
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:
<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:
<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
| Permission | Purpose | Platform | Runtime Required |
|---|---|---|---|
ACCESS_FINE_LOCATION | Precise location tracking | Android | Yes |
ACCESS_COARSE_LOCATION | Approximate location | Android | Yes |
ACCESS_BACKGROUND_LOCATION | Background location access | Android | Yes |
ACTIVITY_RECOGNITION | Motion and activity detection | Android | Yes |
BLUETOOTH_SCAN | Nearby BLE scanning on Android 12+ | Android | Yes |
NEARBY_WIFI_DEVICES | Nearby Wi-Fi access on Android 13+ | Android | Yes |
FOREGROUND_SERVICE | Background processing | Android | No |
FOREGROUND_SERVICE_LOCATION | Location foreground service | Android | No |
POST_NOTIFICATIONS | Delivery notifications | Android | Yes (API 33+) |
WAKE_LOCK | Keep device awake during tracking | Android | No |
ACCESS_WIFI_STATE | WiFi state access | Android | No |
ACCESS_NETWORK_STATE | Network state access | Android | No |
INTERNET | Network communication | Android | No |
NSLocationWhenInUseUsageDescription | Location access during app usage | iOS | Yes |
NSLocationAlwaysAndWhenInUseUsageDescription | Background location access | iOS | Yes |
NSMotionUsageDescription | Motion and sensor data | iOS | Yes |
NSBluetoothAlwaysUsageDescription | Nearby BLE scanning | iOS | Yes |
* Starting with Android 13 (API level 33), apps must request
POST_NOTIFICATIONSat 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:
- 📚 Learn SDK Usage - Initialize and use the SDK
- 🔐 Review Permissions - Implement staged, cross-platform prompts
- 💡 View Examples - See complete implementation examples
For support and questions, contact us at support@doorstep.ai