Installation
Add the Flutter package:pubspec.yaml
Import
Initialize
Initialize AvatarKit once before loading avatars or creating an avatar view.DrivingServiceMode.direct for Direct Mode. Use DrivingServiceMode.backend when your Flutter app receives encoded audio payloads and motion data payloads from a Backend Mode.
initialize fails fast when appID is missing, rather than returning silently. Get an App ID from app.spatius.ai.
Configuration
AudioFormat
Audio that does not match the declared
inputAudioFormat is reported through AvatarController.onError as AvatarError.invalidAudioInput.
Load an avatar
Render and control playback
The Flutter view creates anAvatarController when the platform view is ready. Keep that controller and use it for lifecycle, state, and audio operations.
Render over an Avatar Background
Download the optional 16:9 background from Spatius Studio, add it to your Flutter assets, and declare it inpubspec.yaml.
AvatarWidget in the same Stack, with the image first.
The per-call
audioFormat parameter of yieldAudioData is deprecated and ignored. The format comes from Configuration.audioFormat passed to initialize. Drop the argument if you still pass it; it will be removed in a future release. The iOS and Android SDKs have already removed theirs.Demos
Flutter Direct Mode demo
Direct Mode sample with bundled PCM files.
Flutter Backend Mode demo
Flutter client that talks to the Backend Mode reference server.

