SDK Overview
The Game Framework SDK is a Flutter package that provides a unified API for embedding Unity and Unreal Engine games into Flutter applications.
Core Packages
gameframework
The core package provides:
GameWidget- Universal widget for all enginesGameEngineController- Unified controller interfaceGameEngineRegistry- Plugin registration system- Platform interfaces for Android, iOS, desktop
flutter pub add gameframeworkgameframework_unity
Unity Engine integration plugin:
- Unity-specific controller implementation
- Platform view integration
- Message protocol adapters
- Native bridge for all platforms
flutter pub add gameframework_unitygameframework_unreal
Unreal Engine integration plugin:
- Unreal-specific controller implementation
- Platform view integration
- Blueprint communication support
- Native bridge for all platforms
flutter pub add gameframework_unrealQuick Example
import 'package:flutter/material.dart';
import 'package:gameframework/gameframework.dart';
import 'package:gameframework_unity/gameframework_unity.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
UnityEnginePlugin.initialize();
runApp(MyApp());
}
class GameScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: GameWidget(
engineType: GameEngineType.unity,
config: GameEngineConfig(
runImmediately: true,
),
onEngineCreated: (controller) {
controller.sendMessage('GameManager', 'Start', 'level1');
},
onMessage: (message) {
print('From engine: ${message.data}');
},
),
);
}
}Key Features
Unified API
Single interface works with all game engines - write once, support multiple engines
Bidirectional Communication
Type-safe messaging between Flutter and game engines with high performance
Lifecycle Management
Automatic handling of pause, resume, and dispose events
Multi-Platform
Android, iOS, macOS, Windows, Linux support with platform-optimized implementations
Architecture
graph TB
subgraph FlutterApp[Flutter Application]
GameWidget[GameWidget]
Controller[GameEngineController]
end
subgraph CoreSDK[gameframework]
Registry[GameEngineRegistry]
Platform[Platform Interface]
end
subgraph Plugins[Engine Plugins]
UnityPlugin[gameframework_unity]
UnrealPlugin[gameframework_unreal]
end
subgraph Native[Native Bridges]
UnityNative[Unity Native]
UnrealNative[Unreal Native]
end
GameWidget --> Controller
Controller --> Registry
Registry --> Platform
Platform --> UnityPlugin
Platform --> UnrealPlugin
UnityPlugin --> UnityNative
UnrealPlugin --> UnrealNativeCore Concepts
GameWidget
The main UI component for displaying game engines:
GameWidget(
engineType: GameEngineType.unity,
config: GameEngineConfig(
runImmediately: true,
fullscreen: false,
),
onEngineCreated: (controller) {},
onMessage: (message) {},
)GameEngineController
Controls the engine lifecycle and communication:
// Send messages
controller.sendMessage('Target', 'Method', 'Data');
// Lifecycle
controller.pause();
controller.resume();
controller.dispose();Communication
Multiple message formats supported:
- String messages - Simple text
- JSON messages - Structured data
- Binary protocol - High performance
Platform Support
| Platform | Status | Notes |
|---|---|---|
| Android | Stable | API 22+, ARM64 recommended |
| iOS | Stable | iOS 12.0+ |
| macOS | Beta | macOS 10.14+ |
| Windows | Beta | Windows 10+ |
| Linux | Beta | Ubuntu 20.04+ |
Documentation
Quick Start
Get started with a simple example
API Reference
Complete API documentation
Unity Integration
Unity-specific integration guide
Architecture
Understanding the SDK architecture
Installation
See the Installation Guide for complete setup instructions.
Ready to start? Check out the Quick Start Guide!