ComponentDefinition class final

A component in a project's library: its nodes as a layout document with one root, its design size, and where it was made from.

JSON: {"schema": 2, "id", "name", "version", "size": [w, h], "document": {LayoutDocument}, "preview": {"url", "blurhash"}, "source": {"project", "page", "node"}, "createdAt": ms}.

Annotations
  • @immutable

Constructors

ComponentDefinition({required String id, String name = '', int version = 1, required LayoutDocument document, double width = 0, double height = 0, String? previewUrl, String blurhash = '', String projectId = '', String pageId = '', String sourceNodeId = '', int? createdAt, Json extra = const {}})
const

Properties

blurhash → String
final
createdAt → int?
Milliseconds since the epoch, UTC.
final
document → LayoutDocument
The component's nodes, its root first in roots, with its variables and conditions.
final
extra → Json
final
hashCode → int
The hash code for this object.
no setteroverride
height → double
The design size of the root.
final
id → String
final
name → String
final
pageId → String
Where it was made: project, page and the node it was made from.
final
previewUrl → String?
final
projectId → String
Where it was made: project, page and the node it was made from.
final
rootId → String?
The root node's id.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
settings → List<ComponentSetting>
What an instance can customize: the root's settings.
no setter
sourceNodeId → String
Where it was made: project, page and the node it was made from.
final
version → int
Bumped on every update; instances below it have an update.
final
width → double
The design size of the root.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Json
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromJson(Object? json) → ComponentDefinition?
Null without an id.