Skip to content

Installation

From scratch

The SORI Flutter SDK is distributed as the sorisdk_flutter package on pub.dev.

sorisdk_flutter package

Use the package page to check the latest published version and generated Dart API reference.

We also provide a Flutter example app that demonstrates how to integrate the SDK.

SORI Example Flutter

Check out the example app and test how it works.

Integrate into an existing project

Add the package from pub.dev:

bash
flutter pub add sorisdk_flutter

Or add it to your pubspec.yaml file:

yaml
dependencies:
  sorisdk_flutter: ^0.3.2

Then run:

bash
flutter pub get

Android settings

The package merges the required Android permissions and foreground microphone service declaration from the plugin manifest. These include microphone, network, foreground service, and notification-related permissions.

Your app must keep Android minSdk at 24 or higher:

kotlin
android {
    defaultConfig {
        minSdk = 24
    }
}

On Android, startRecognition() requests runtime microphone permission when needed and continues the same start request after permission is granted.

If your app targets Android 13 or later and should show the foreground-service notification normally, request notification permission from your app flow before starting recognition.

iOS settings

iOS apps must include a microphone usage description in ios/Runner/Info.plist:

xml
<key>NSMicrophoneUsageDescription</key>
<string>Audio recognition requires microphone access.</string>

Add background audio mode only when your app is designed to continue recognition while backgrounded:

xml
<key>UIBackgroundModes</key>
<array>
    <string>audio</string>
</array>

Web settings

Install the build-time bridge in your Flutter application. Version 0.1.2 pins @sorisdk/web-audio 0.6.7:

bash
npm install --save-dev @sorisdk/flutter-web-bridge@0.1.2

Prepare the browser runtime before every Web build:

bash
npx sori-flutter-web prepare
flutter build web

The preparation command writes the required JavaScript, WASM, and model files to web/sorisdk/. Flutter copies those application-owned files to build/web.

Flutter Web requires a secure context (https:// or http://localhost), a modern browser with Web Audio and getUserMedia(), and an application-server endpoint that returns a short-lived ephemeral key. See Ephemeral Key. Never include a long-lived secret_key in a Web build.

Now you are ready to use the SDK. Next step is to Implementation.