Skip to content
Back home

Documentation

v0.2

Everything you need to author multi-surface desktop apps in Dart. This is an overview — the full reference lives in the repository.

Get running

Quickstart

Add Morphic to a Flutter desktop project, initialize the native runner, and run. Three commands and you have a multi-surface app.

terminal
flutter pub add morphicdart run morphic:initflutter run -d windows

Then wrap your app with the runtime. A single entrypoint spawns and orchestrates every sovereign surface:

lib/main.dart
import class="tok-str">'package:morphic/morphic.dart'; void main() {  class=class="tok-str">"tok-cmt">// One entrypoint. The runtime spawns and  class=class="tok-str">"tok-cmt">// orchestrates every sovereign surface.  runMorphicApp(app: MyApp());}
Mental model

Concepts

Morphic introduces a small set of primitives that compose into a full runtime:

Surface
A real native window backed by its own Flutter engine.
Kind
The role of a surface — workspace, inspector, palette, overlay — which drives native shell behavior.
Ownership
Owner chains keep panels raising, minimizing and traveling with their host.
Group / Dock
Surfaces that converge form a group; rigid co-movement follows.
Extraction
A grouped surface can detach mid-interaction into its own session.
Orchestration
A deterministic semantic runtime governs z-order and activation.
Authoring API

SDK

The authoring surface is intentionally small. You declare what surfaces exist and what they render; the runtime handles the rest.

lib/main.dart
class=class="tok-str">"tok-cmt">// Declare a surface with a kind + content.runMorphicApp(  app: MyApp(),  surfaces: [    SurfaceSpec(      kind: SurfaceKind.workspace,      content: () => EditorScreen(),    ),    SurfaceSpec(      kind: SurfaceKind.inspector,      content: () => InspectorPanel(),    ),  ],);

Surfaces communicate through a shared app bus, so panels stay in sync while remaining isolated, independently-rendered windows.

Existing apps

Integration

Morphic wraps your existing Flutter app — it doesn't replace it. Add the dependency, run the initializer, and adopt surfaces incrementally.

pubspec.yaml
dependencies:  morphic: ^0.2.0

dart run morphic:init wires the native multi-surface runner into your windows/ directory. Your widget tree is untouched.

Native & spatial

Runtime Modes

Native · default

Real OS windows with native shell semantics — taskbar, Alt-Tab, owner chains, deterministic z-order. Available today.

Spatial · experimental

GPU-composited surfaces on a shared plane with materials, blur and scene zoom. Available for experimentation.

Under the hood

Architecture

The runtime is layered as a series of clean, swappable boundaries — each stage transforms intent into pixels on screen:

01
Semantic

The source of truth: what surfaces exist and how they relate.

02
Interaction

Drag, dock, group and extract gestures resolved deterministically.

03
Presentation

Smoothing and coherence between semantic truth and native windows.

04
Projection

Geometry and z-order projected onto real OS windows.

05
Native

The platform shell — Win32 today, more to come.