fluttercanvas_core library

Design model, JSON format and code generator for FlutterCanvas.

This library is pure Dart: it has no Flutter dependency, so it can run on servers, in CLIs, or anywhere else you want to read and write designs.

Classes

BarKeys
Keys of CanvasDocument.bars.
Breakpoints
Screen-width breakpoints shared by the renderer and the code generator.
CanvasDocument
One screen of a design: page settings plus the widget tree.
CanvasProject
A whole app design: several screens and the one the app starts on.
CanvasTemplates
Ready-made projects to start from.
ChatReply
What the AI said, and the updated design if it made changes.
DesignPrompt
Builds prompts that let an AI model create or change a FlutterCanvas design, and reads its reply back.
FlutterCodeGenerator
Turns designs into Flutter code that reads like a person wrote it.
GeneratedFile
A file produced by FlutterCodeGenerator.generateProject.
NodeIds
Generates unique ids for widget nodes.
PropOptions
Allowed values for choice properties.
PropSpec
Describes one editable property of a widget type.
WidgetCatalog
Registry of every widget type FlutterCanvas supports.
WidgetNode
One widget in a design: its type, its properties and its children.
WidgetSpec
Describes a widget type that can be placed on the canvas.
WidgetTypes
Identifiers of the built-in widget types.

Enums

ChildMode
How many children a widget type accepts.
PropKind
The kind of editor used for a property.
ScreenSize
The broad screen classes FlutterCanvas designs adapt to.

Extensions

WidgetTree on WidgetNode
Immutable tree operations. Every method returns a new tree and leaves the original untouched, which makes undo and redo trivial.

Functions

formatHexColor(int argb) → String
Formats an ARGB integer as #AARRGGBB.
parseHexColor(String? value) → int?
Parses #RGB, #RRGGBB or #AARRGGBB into an ARGB integer.