Skip to content

Flutter

Follow these steps to integrate the Aidlab Flutter SDK.

  1. Install Flutter (see the Flutter Installation Guide).
  2. Create a project:
    bash
    flutter create my_project
    cd my_project
  3. Add dependency:
    bash
    flutter pub add aidlab_sdk
  4. Flutter SDK 2.3.x is a breaking release.
    • AidlabManager.scan(...) is now delegate-driven and reports devices via didDiscover
    • the SDK is FFI-first and expects one transport instance per discovered device
    • Device objects are single-use, so create a fresh instance for each connection attempt
  5. Configure Bluetooth permissions and platform requirements (the SDK does not manage permissions or BT state).
    • iOS: add to ios/Runner/Info.plist:
      xml
      <key>NSBluetoothAlwaysUsageDescription</key>
      <string>Your custom message explaining why your app needs Bluetooth access.</string>
    • Android: in AndroidManifest.xml:
      xml
      <uses-permission android:name="android.permission.BLUETOOTH_SCAN"/>
      <uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
      <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
      <uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>
    • set minSdkVersion to 28 or higher
  6. Run your app on a physical device:
    bash
    flutter run