API reference
Choose a reference by the object or operation you are working with. The getting started guide covers your first canvas.
- Session — commands, observation and lifetime
- Configuration — appearance and behavior
- Shapes — definitions, registry and instances
- Connectors — bindings, routing and labels
- Canvas — mounting and optional chrome
- Navigation — camera state, coordinates and immediate positioning
- Animation — viewport transitions, cancellation and path effects
- Grids — snapping and custom patterns
- Text — shared paragraphs and lists
- Undo and redo — transactions and history
- Persistence and imports — serialization and snapshot replacement
- Output — PNG snapshots and limited SVG scenes
- Events and hooks — integration and admission
The object model
| Object | Responsibility |
|---|---|
DiagramDocument | Immutable authored shapes, standalone text, connectors, parent relationships, text stories and styles. |
FramedElement | Shared placement and transform contract for shapes and standalone text. |
TextElement | Standalone rich text with a required story and no shape appearance fields. |
TextElementDefinition | Standalone text bounds, layers, sizes, and interaction capabilities, exposed through ShapeRegistry.text. |
ShapeDefinition | One shape type: outline, layers, text regions, ports, defaults and interaction capabilities. |
ShapeRegistry | Immutable, validated collection of definitions, plus connector capabilities. |
ShapeElement / ConnectorElement | Authored instances with stable IDs. A shape's type selects its definition. |
DrawingSession | Canonical state, resolved scene, commands, history, configuration, subscriptions and lifetime. |
DrawingConfiguration | Canvas policy, background, grouped grid options, rotation increments, paint detail, overlays, effects and integration callbacks. |
DrawingGridConfiguration | Grid visibility, snapping, spacing and pattern; a value inside the drawing configuration. |
DrawingCanvas | The bounded Flutter widget that displays and edits one session. |
A session supports one mounted canvas at a time. Content operations also work without mounting it; camera and visual animation commands need a mounted canvas. Separate sessions are possible for separate editors or agent work, but shared-document synchronization, merging and collaborative history are not provided automatically.