Docs index: /llms.txt · every page as Markdown: add .md

‹ Platforms

Flutter

The Flutter plugin renders Essence 2 and Expression 2 on Android, iOS and macOS.

On the devicePhysical deviceAPI secretFlutter plugin 2.6.38

One Flutter dependency gives your app an avatar widget. Why on the device.

Before you start

On Android the plugin runs the same engines as the Android SDK, so the avatar renders on the phone: your app’s speech audio goes in, and a lip-synced picture comes out as a Flutter Texture.

The plugin runs on Android phones (arm64), and on iPhone, iPad and Mac (Apple silicon) after one bootstrap step that fetches the engines (Platform notes). A native iPhone or iPad app can use the Swift package instead.

You needNotes
Dart 3.11.5 or newer (the Flutter release that ships it), with the Android toolchainJDK 17 and the Android SDK; an older Dart fails flutter pub get
A physical Android phone, arm64, Android 10 (API 29) or neweremulators cannot load the engines; the plugin needs API 29 whichever model you use
An API secretthe Creator plan or higher; usage bills per second while the avatar runs (pricing)

Install

The plugin is published as a tag in the public homebrew-bithuman repository on GitLab. Pin it in pubspec.yaml:

dependencies:
  bithuman:
    git:
      url: https://gitlab.com/bithuman/sdk/homebrew-bithuman.git
      path: packages/flutter-plugin
      ref: flutter-plugin-v2.6.38

Then run flutter pub get. On Android, Gradle resolves ai.bithuman:essence2-android and ai.bithuman:expression2-android from the repository the plugin declares, so you add no repository yourself.

In android/app/build.gradle.kts, set the plugin’s floor and keep the engines’ native libraries as they ship:

android {
    defaultConfig {
        minSdk = 29                         // the plugin's floor, whichever model you use
        ndk { abiFilters += "arm64-v8a" }   // the engines ship arm64-v8a only
    }
    packaging { jniLibs { useLegacyPackaging = true } }   // required
}

Authenticate

The engines check your API secret when an avatar loads: pass it to BithumanAvatar.load(…, apiSecret:). For a local build, the example app asks for it on first launch and keeps it in the Android Keystore, or you pass --dart-define=BITHUMAN_API_SECRET=… when you build. A shipped app fetches the secret from your backend (What a shipped app holds).

Run your first avatar

Build the example app for your phone, with the wise-pup sample avatar:

git clone https://github.com/bithuman-product/bithuman-examples.git
cd bithuman-examples/app/avatar_chat
flutter pub get
flutter run --release --dart-define=AGENT_CODE=A23WJF0199
Expected result

The app installs on the connected phone, asks for your API secret once, downloads the avatar (about 160 MB, first run only) and shows it idling full screen. Speak, or type a line, and it answers with its lips in sync.

Performance

The plugin runs the Android SDK’s own engines (the same native libraries), so the Android rows apply:

ConfigurationEssence 2Expression 2
Samsung Galaxy S25+ Android
2.0× real timeSamsung Galaxy S25+ · essence2-android 0.7.0 · measured 2026-09-25
2.4× real timeSamsung Galaxy S25+ · expression2-android 0.4.10 · measured 2026-09-23
Samsung Galaxy S25+ Android held 10 min
1.4× real timeSamsung Galaxy S25+ · essence2-android 0.8.1 · held 10 min · measured 2026-09-27
2.2× real timeSamsung Galaxy S25+ · expression2-android 0.5.2 · held 10 min · measured 2026-09-27

Times real time: seconds of avatar video rendered per second. At 1.0× or more, an avatar holds a live conversation. Select a figure for its release and date. All configurations and how we measure.

This section moved: docs.bithuman.ai/platforms/flutter#run-your-first-avatar

This section moved: docs.bithuman.ai/platforms/flutter/app#integrate-into-your-app

This section moved: docs.bithuman.ai/platforms/flutter/app#complete-example

This section moved: docs.bithuman.ai/platforms/flutter/app#platform-notes

This section moved: docs.bithuman.ai/platforms/flutter/app#reference

This section moved: docs.bithuman.ai/platforms/flutter/troubleshooting