advanced library

Advanced public API exports for iwb_canvas_engine.

This entrypoint is currently a strict superset alias of basic.dart.

Classes

ActionCommitted
A committed action with stable actionId and affected nodeIds.
Background
Background visual settings: solid color and optional grid.
BackgroundSnapshot
Immutable background snapshot.
Camera
Viewport state for converting between view and scene coordinates.
CameraSnapshot
Immutable camera state snapshot.
CommonNodePatch
Patch for common node fields shared by all node variants.
EditTextRequested
Request from the engine to edit a TextNode at position.
GridSettings
Grid rendering configuration.
GridSnapshot
Immutable grid settings snapshot.
ImageNode
Raster image node referenced by imageId and drawn at size.
ImageNodePatch
ImageNodeSnapshot
ImageNodeSpec
Layer
A z-ordered collection of nodes.
LayerSnapshot
Immutable layer snapshot.
LineNode
Straight segment node defined by start and end points.
LineNodePatch
LineNodeSnapshot
LineNodeSpec
NodePatch
Partial node update request for v2 write APIs.
NodeSnapshot
Immutable base node snapshot.
NodeSpec
Immutable node creation spec for v2 write APIs.
PatchField<T>
PathNode
SVG-path based vector node.
PathNodePatch
PathNodeSnapshot
PathNodeSpec
PointerInputSettings
Thresholds and timings used by PointerInputTracker.
RectNode
Box node with optional fill and stroke.
RectNodePatch
RectNodeSnapshot
RectNodeSpec
Scene
A mutable scene graph used by the canvas engine.
SceneControllerInteractiveV2
SceneDefaults
Default values used by the engine for palettes and tool settings.
SceneNode
Base class for all nodes stored in a Scene.
ScenePalette
Palette presets for tool colors and background/grid options.
ScenePaletteSnapshot
Immutable palette snapshot.
ScenePathMetricsCacheV2
SceneSnapshot
Immutable scene snapshot exposed by the v2 public API.
SceneStaticLayerCacheV2
SceneStrokePathCacheV2
SceneTextLayoutCacheV2
SceneViewInteractiveV2
StrokeNode
Freehand polyline stroke node.
StrokeNodePatch
StrokeNodeSnapshot
StrokeNodeSpec
TextNode
Text node with a fixed layout box (size) and basic styling.
TextNodePatch
TextNodeSnapshot
TextNodeSpec
Transform2D
A 2D affine transform represented as a 2×3 matrix.

Enums

ActionType
Discrete actions emitted by interactive controllers for app-level undo/redo.
CanvasMode
Public input types for canvas interaction controllers.
DrawTool
Active drawing tool when CanvasMode.draw is enabled.
NodeType
Supported node variants in a Scene.
PatchFieldState
Tri-state wrapper for patch fields in the v2 public API.
PathFillRule
Fill rule for PathNode geometry.
V2PathFillRule
Path fill rule value in the v2 public model.

Constants

schemaVersionsRead → const Set<int>
JSON schema versions accepted by this package.
schemaVersionWrite → const int
JSON schema version written by this package.

Functions

aabbForTransformedRect({required Rect localRect, required Offset position, required double rotationDeg, required double scaleX, required double scaleY}) Rect
Computes an axis-aligned bounding box for a transformed rectangle.
aabbFromPoints(Iterable<Offset> points) Rect
Returns the axis-aligned bounding box for points.
decodeScene(Map<String, dynamic> json) SceneSnapshot
Decodes a SceneSnapshot from a JSON map (already parsed).
decodeSceneFromJson(String json) SceneSnapshot
Decodes a SceneSnapshot from a JSON string.
distancePointToSegment(Offset point, Offset a, Offset b) double
Returns the shortest distance from point to the segment a-b.
distanceSegmentToSegment(Offset a1, Offset a2, Offset b1, Offset b2) double
Returns the shortest distance between two line segments.
distanceSquaredPointToSegment(Offset point, Offset a, Offset b) double
Returns squared shortest distance from point to segment a-b.
distanceSquaredSegmentToSegment(Offset a1, Offset a2, Offset b1, Offset b2) double
Returns squared shortest distance between line segments a1-a2 and b1-b2.
encodeScene(SceneSnapshot snapshot) Map<String, dynamic>
Encodes snapshot into a JSON-serializable map.
encodeSceneToJson(SceneSnapshot snapshot) String
Encodes snapshot to a JSON string.
reflectPointHorizontal(Offset point, double axisY) Offset
Mirrors point across the horizontal axis that passes through axisY.
reflectPointVertical(Offset point, double axisX) Offset
Mirrors point across the vertical axis that passes through axisX.
rotatePoint(Offset point, Offset center, double degrees) Offset
Rotates point around center by degrees.
segmentsIntersect(Offset a1, Offset a2, Offset b1, Offset b2) bool
Returns true if segments a1-a2 and b1-b2 intersect.
toScene(Offset viewPoint, Offset cameraOffset) Offset
Converts a point from view/screen coordinates to scene coordinates.
toView(Offset scenePoint, Offset cameraOffset) Offset
Converts a point from scene coordinates to view/screen coordinates.

Typedefs

ImageResolverV2 = Image? Function(String imageId)
NodeId = String
Stable node identifier used for selection and action events.
SceneController = SceneControllerInteractiveV2
SceneView = SceneViewInteractiveV2

Exceptions / Errors

SceneJsonFormatException
Thrown when scene JSON fails schema validation.