SPAvatarKit Flutter Plugin

A Flutter plugin for displaying digital characters using the SPAvatarKit SDK.

Features

  • Display digital characters with real-time rendering
  • Load characters with specific IDs
  • Connect to network services for character interaction
  • Play audio files to drive character animations
  • Real-time state monitoring and control
  • Support for iOS, Android, and Web platforms

Requirements

  • iOS 18.0+ / Android API 21+
  • Flutter 3.3.0+
  • Dart SDK ^3.8.1
  • SPAvatarKit SDK license

Note: This plugin only supports iOS physical devices. iOS Simulator is not supported due to package size optimization for pub.dev publishing.

Installation

Add this dependency to your pubspec.yaml:

dependencies:
  sp_character_plugin: ^0.0.1

Usage

import 'package:sp_character_plugin/character_widget.dart';

// Create a character widget
CharacterWidget.createWithController(
  sessionToken: "your_session_token",
  setUpStateChanged: (state) {
    // Handle setup state changes
  },
  loadStateChanged: (state, progress) {
    // Handle load state changes
  },
  connectionStateChanged: (state) {
    // Handle connection state changes
  },
  // ... other callbacks
)

Example App

The plugin includes a comprehensive example app in the example/ directory that demonstrates:

  • Character loading and display
  • Network connection management
  • Audio playback for character animation
  • Real-time state monitoring

To run the example (iOS only):

cd example
flutter pub get
flutter run

iOS Configuration

This plugin requires iOS 18.0 or higher. The configuration is already set up in the example app.

Platform Support

  • iOS: Full support for physical devices (iOS 18.0+)
  • iOS Simulator: Not supported due to package size optimization
  • Android: Coming soon
  • Web: Coming soon

License

This plugin is licensed under the MIT License. See the LICENSE file for details.