Node class

The idea is every node must have a parent, so we can reduce the null check And we only supported attached nodes.

Annotations
  • @freezed

Constructors

Node({required String id, @Default.new([]) List<Node> children, required String parentId})
const
factory
Node.fromJson(Map<String, dynamic> json)
factory

Properties

children List<Node>
no setterinherited
copyWith → $NodeCopyWith<Node>
Create a copy of Node with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
id String
no setterinherited
isLeaf bool
no setter
parentId String
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
span int
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this Node to a JSON map.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited