---
title: "GameFramework"
tagline: "Flutter × engines"
language: "C#"
license: "MIT"
since: "2026"
canonical: "https://xraph.com/work/gameframework"
---

# GameFramework

The rewrite of Flutter Unity Widget, as a Dart workspace with one API and a plugin per engine. Unity works today; Unreal is in progress. Typed messaging in both directions, automatic pause, resume and destroy on Flutter lifecycle events, and builds for Android, iOS, macOS, Windows and Linux.

## Install

```bash
flutter pub add gameframework
```

## What it is

GameFramework embeds game engines in Flutter applications with one API. Unity works today; Unreal is in progress. It is the rewrite of Flutter Unity Widget, with six years of accreted compatibility dropped and three things changed on purpose.

## What changed from the original

1. **The engine is a plugin, not a dependency.** gameframework is the core with the unified API; gameframework\_unity and gameframework\_unreal are separate packages. Adding an engine is a package rather than a fork.
2. **Messaging is typed.** The original passed strings both directions and every integration invented its own encoding. Type safety at the boundary removed an entire category of issue report.
3. **Lifecycle lives in the core.** Pause, resume and destroy on Flutter lifecycle events are handled once, rather than being something each integrator rediscovers when their app is backgrounded during a level load.

## Structure

A Dart workspace monorepo: the core package with Dart API plus Android and iOS platform code, an engines directory holding the Unity Dart plugin and its C\# scripts alongside the Unreal Dart plugin and its C\+\+ plugin, and a runnable example app. Platform support covers Android, iOS, macOS, Windows and Linux.

## Game CLI

Reading six years of the original's issue tracker, roughly 60% of reports were export and build configuration. The fix for that is not better documentation of a twenty-step process. Game CLI scaffolds, exports, syncs, builds and publishes in one command.

---

*Unpublished draft. Not peer reviewed and not submitted to a venue.*


## Anatomy

- **Engine plugin**: The engine is a plugin, not a hard dependency.
- **Messaging**: Typed both ways instead of stringly.
- **Core lifecycle**: Lives in the core rather than being rediscovered per integrator.
- **Targets**: Android, iOS, macOS, Windows and Linux.

## Constraints and trade-offs

- (decision) The rewrite of Flutter Unity Widget with the accretion dropped. Unity works today; Unreal is in progress.
- (trade-off) One API for several engines means the per-engine escape hatch has to be explicit.
