ComponentData class
- Mixed-in types
Constructors
- ComponentData({String? id, Offset position = Offset.zero, Size size = const Size(80, 80), Size minSize = const Size(4, 4), String? type, dynamic data})
- Represents data of a component in the model.
-
ComponentData.fromJson(Map<
String, dynamic> json, {dynamic decodeCustomComponentData(Map<String, dynamic> json)?})
Properties
-
childrenIds
→ List<
String> -
List of children of this component.
final
-
connections
→ List<
Connection> -
Defines to which components is this components connected and what is the
connectionId
.final - data → dynamic
-
Dynamic data for you to define your own data for this component.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- id → String
-
Unique id of this component.
final
- minSize → Size
-
Minimal size of a component.
final
- parentId ↔ String?
-
Assigned parent to this component.
getter/setter pair
- position ↔ Offset
-
Position on the canvas.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size ↔ Size
-
Size of the component.
getter/setter pair
- type → String?
-
Component type to distinguish components.
final
- zOrder ↔ int
-
This value determines if this component will be above or under other components.
Higher value means on the top.
getter/setter pair
Methods
-
addChild(
String childId) → void - Sets the component's parent.
-
addConnection(
Connection connection) → void - Adds new connection to this component.
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
getPointOnComponent(
Alignment alignment) → Offset -
Returns Offset position on this component from
alignment
. -
move(
Offset offset) → void -
Translates the component by
offset
value. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeChild(
String childId) → void - Removes child's id from children.
-
removeConnection(
String connectionId) → void - Removes existing connection.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
removeParent(
) → void - Removes parent's id from this component data.
-
resizeDelta(
Offset deltaSize) → void -
Changes the component's size by
deltaSize
. -
setParent(
String parentId) → void - Sets the component's parent.
-
setPosition(
Offset position) → void -
Sets the position of the component to
position
value. -
setSize(
Size size) → void -
Sets the component's to
size
. -
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
override
-
updateComponent(
) → void - Updates this component on the canvas.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited