SDK Reference
Flutter / WebView

Flutter / WebView

Avatarium does not require a native Flutter SDK. Load the hosted avatar URL in a Flutter WebView and Avatarium handles the 3D avatar, voice, lip sync, and conversation UI.

Install WebView

Add webview_flutter to pubspec.yaml:

dependencies:
  webview_flutter: ^4.0.0

Then run:

flutter pub get

Basic embed

import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
 
class AvatariumAvatar extends StatefulWidget {
  const AvatariumAvatar({super.key});
 
  @override
  State<AvatariumAvatar> createState() => _AvatariumAvatarState();
}
 
class _AvatariumAvatarState extends State<AvatariumAvatar> {
  late final WebViewController controller;
 
  @override
  void initState() {
    super.initState();
    controller = WebViewController()
      ..setJavaScriptMode(JavaScriptMode.unrestricted)
      ..setMediaPlaybackRequiresUserGesture(false)
      ..loadRequest(Uri.parse('https://avatarium.ai/a/YOUR_AVATAR_ID/voice'));
  }
 
  @override
  Widget build(BuildContext context) {
    return WebViewWidget(controller: controller);
  }
}

Microphone permissions

Voice mode needs microphone access.

iOS

Add this to ios/Runner/Info.plist:

<key>NSMicrophoneUsageDescription</key>
<string>This app uses your microphone so you can speak with the avatar.</string>

Android

Add this to android/app/src/main/AndroidManifest.xml:

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

If your Android WebView integration prompts for permissions, ensure your app grants WebView microphone requests through the Android WebView permission callback.

URL format

Use the public avatar short ID from your Avatarium dashboard:

https://avatarium.ai/a/YOUR_AVATAR_ID/voice

For a text-first embed, remove /voice:

https://avatarium.ai/a/YOUR_AVATAR_ID

Flutter support is currently WebView-based. This gives mobile teams a stable integration path without waiting for a separate native Flutter package.

Next steps