GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - xraph/gameframework: Flutter SDK for embedding Unity & Unreal Engine games in Flutter apps, Bidirectional Dart↔engine messaging, lifecycle control, iOS & Android

BranchesTags
Open more actions menu

Latest commit

 

History

57 Commits
57 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
assets
assets
 
 
engines
engines
 
 
example
example
 
 
packages
packages
 
 
templates
templates
 
 
.fvmrc
.fvmrc
 
 
.gitignore
.gitignore
 
 
.metadata
.metadata
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
STREAMING_ARCHITECTURE.md
STREAMING_ARCHITECTURE.md
 
 
analysis_options.yaml
analysis_options.yaml
 
 
pubspec.yaml
pubspec.yaml
 
 

Repository files navigation

Game Framework

A unified, modular framework for embedding multiple game engines (Unity, Unreal Engine) into Flutter applications with bidirectional communication and lifecycle management.

pub package License: MIT

A Unity 3D scene running inside a Flutter app, with live Flutter controls driving the game   An Unreal Engine 5 scene running inside a Flutter app, with live Flutter controls driving the game
Unity in Flutter   Unreal Engine in Flutter

Overview

Game Framework provides a consistent API for integrating game engines into Flutter applications. Built as a Dart workspace monorepo, it includes:

  • gameframework - Core framework package with unified engine API
  • gameframework_unity - Unity Engine integration plugin
  • gameframework_unreal - Unreal Engine integration plugin
  • example - Demo application showcasing framework capabilities

Features

  • Unified API - Single interface for all game engines
  • Modular Architecture - Use only the engines you need
  • Bidirectional Communication - Flutter ↔ Engine messaging with type safety
  • Lifecycle Management - Automatic pause/resume/destroy handling
  • Multi-Platform - Android, iOS, macOS, Windows, Linux support
  • Production Ready - Comprehensive testing and documentation

Monorepo Structure

gameframework-workspace/
├── pubspec.yaml                        # Workspace configuration
├── Makefile                            # Build automation
├── packages/
│   └── gameframework/                  # Core framework
│       ├── lib/                        # Dart API
│       ├── android/                    # Android platform code
│       ├── ios/                        # iOS platform code
│       └── pubspec.yaml                # v0.0.1
├── engines/
│   ├── unity/
│   │   ├── dart/                       # Unity plugin package
│   │   └── plugin/                     # Unity C# scripts
│   └── unreal/
│       ├── dart/                       # Unreal plugin package
│       └── plugin/                     # Unreal C++ plugin
└── example/                            # Example application
    └── pubspec.yaml

Quick Start

Prerequisites

  • Flutter SDK >= 3.3.0
  • Dart SDK >= 3.6.0
  • Unity 2022.3.x or Unreal Engine 5.x (depending on your needs)

Installation

  1. Clone the repository:
git clone https://github.com/xraph/gameframework.git
cd gameframework
  1. Bootstrap the workspace:
make bootstrap

This single command resolves all dependencies for all packages in the workspace.

Using in Your Project

Add to your pubspec.yaml:

dependencies:
  gameframework: ^0.0.3
  gameframework_unity: ^0.0.4  # If using Unity
  gameframework_stream: ^0.0.3  # If using asset streaming
  # gameframework_unreal: ^0.0.3  # If using Unreal

Basic Usage

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('Message from engine: ${message.data}');
        },
      ),
    );
  }
}

Development

Workspace Commands

The Makefile provides comprehensive workspace management:

Setup & Dependencies

make bootstrap          # Resolve all workspace dependencies
make setup              # Alias for bootstrap

Testing

make test               # Run tests for all packages
make gameframework      # Test core package only
make unity              # Test Unity plugin only
make unreal             # Test Unreal plugin only
make test-package PKG=packages/gameframework  # Test specific package

Code Quality

make analyze            # Static analysis for all packages
make format             # Format all code
make format-check       # Check formatting without changes
make lint               # Run format check + analyze + test

Diagnostics

make doctor             # Check Flutter and dependencies
make list-packages      # List all workspace packages
make version            # Show versions of all packages
make coverage           # Generate coverage reports

Cleanup

make clean              # Clean all build artifacts
make clean-deep         # Deep clean (removes all generated files)

Package-Specific Development

# Work on gameframework package
cd packages/gameframework
flutter test
flutter analyze

# Work on Unity plugin
cd engines/unity/dart
flutter test

Running the Example

make example            # Run example app
make build-android      # Build Android APK
make build-ios          # Build iOS (macOS only)

Publishing

Check Publish Readiness

make publish-check      # Validate all packages

Publish Packages

Packages must be published in dependency order:

# Publish core framework first
make publish-gameframework

# Then publish engine plugins
make publish-unity
make publish-unreal

# Or publish all in order
make publish-all

Architecture

Core Package (gameframework)

The core package provides:

  • GameWidget - Universal widget for all engines
  • GameEngineController - Engine lifecycle and communication
  • GameEngineRegistry - Engine plugin registration
  • Platform-specific implementations for Android, iOS, macOS, Windows, Linux

Engine Plugins

Each engine plugin (Unity, Unreal) implements:

  • Engine-specific controller
  • Platform view integration
  • Bidirectional messaging
  • Lifecycle management

Communication Flow

Flutter App
    ↕ (MethodChannel)
GameWidget (gameframework)
    ↕ (Platform Interface)
Engine Plugin (gameframework_unity/unreal)
    ↕ (Native Bridge)
Game Engine (Unity/Unreal)

📊 Project Status & Roadmap

Current Version: 0.0.3

✅ Production Ready

  • Unity: Android, iOS
  • Core Framework: All platforms

🟢 Working (Beta)

  • Unreal: Android, iOS

🚧 Work in Progress

  • Unity: Web, macOS, Windows, Linux

📋 Roadmap

  • Harden Unreal Engine mobile integration
  • Complete Unity desktop & web support
  • Unreal desktop & web support
  • Advanced streaming features
  • Performance optimization tools
  • v1.0 Production release

Platform Support

Platform gameframework Unity Unreal Status
Android ✅ Ready ✅ Ready 🟢 Beta Stable
iOS ✅ Ready ✅ Ready 🟢 Beta Stable
Web ✅ Ready ✅ Ready ⏳ Planned Stable
macOS ✅ Ready 🚧 WIP ⏳ Planned Beta
Windows ✅ Ready 🚧 WIP ⏳ Planned Beta
Linux ✅ Ready 🚧 WIP ⏳ Planned Beta

Continuous Integration

The Makefile includes CI-optimized commands:

make ci                 # Run all CI checks (format, analyze, test)
make check              # Run quality checks with coverage

Example GitHub Actions workflow:

name: CI

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: subosito/flutter-action@v2
      - run: make bootstrap
      - run: make ci

Documentation

  • MONOREPO_MAKEFILE.md - Comprehensive Makefile guide
  • QUICK_START.md - Detailed quick start guide
  • packages/gameframework/README.md - Core package documentation
  • engines/unity/dart/README.md - Unity plugin documentation
  • engines/unreal/dart/README.md - Unreal plugin documentation

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

Development Workflow

  1. Fork and clone the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Make changes and add tests
  4. Run quality checks: make lint
  5. Commit changes: git commit -m "Add my feature"
  6. Push to your fork: git push origin feature/my-feature
  7. Open a Pull Request

Code Standards

  • Follow Dart style guide
  • Maintain test coverage above 80%
  • Add documentation for public APIs
  • Run make lint before committing

Versioning

All packages use semantic versioning (semver). Current versions:

  • gameframework: 0.0.3
  • gameframework_stream: 0.0.3
  • gameframework_unity: 0.0.4
  • gameframework_unreal: 0.0.3

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

  • Issues: GitHub Issues
  • Discussions: GitHub Discussions
  • Documentation: docs.gameframework.dev

Acknowledgments

  • Flutter team for the excellent framework
  • Unity Technologies and Epic Games for their game engines
  • Contributors and community members

Note: This is a monorepo managed with Dart workspaces. All packages share dependencies and can be developed together. Use the provided Makefile commands for workspace operations.

About

Flutter SDK for embedding Unity & Unreal Engine games in Flutter apps, Bidirectional Dart↔engine messaging, lifecycle control, iOS & Android

gameframework.dev

Topics

flutterflutter-unity-view-widgetflutter-unity-widgetfuwgamegame-enginepub-devunity-packageunity3dunreal-engine

Resources

Readme
MIT license

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

21 stars

Watchers

2 watching

Forks

5 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.