Node<T > class
Inheritance
Mixed in types
Annotations
@KeyOrNullConverter()
@ColorOrNullConverter()
@IconDataOrNullConverter()
@JsonSerializable()
@GenericConverter()
Constructors
Node ({required Key key , required String label , IconData ? icon , Color ? iconColor , Color ? selectedIconColor , bool expanded = false , List <Node <T > > ? children , T? data })
Node.fromJson (Map <String , dynamic > json )
A necessary factory constructor for creating a new Node instance
from a map. Pass the map to the generated _$NodeFromJson()
constructor.
The constructor is named after the source class, in this case, Node.
factory
Node.fromLabel (String label , {Key ? key , T? data , IconData ? icon , List <Node <T > > ? children })
Creates a Node from a string value.
By default, if key is not provided, it will generates a unique key.
factory
Methods
addChild (Node <T > child , [InsertMode mode = InsertMode.append ])
→ void
Adds a single child to this node and sets its parent property to this
.
addChildren (Iterable <Node <T > > children )
→ void
Adds a list of children to this node.
addListener (VoidCallback listener )
→ void
Register a closure to be called when the object changes.
inherited
compareTo (Node <T > other )
→ int
Set this Node to sortable
override
copyWith ({Key ? key , String ? label , IconData ? icon , Color ? iconColor , Color ? selectedIconColor , bool ? expanded , List <Node <T > > ? children , T? data })
→ Node <T >
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
findChild (Key key )
→ Node <T > ?
Search the node that has a key value equal to the specified key.
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners ()
→ void
Call all the registered listeners.
inherited
removeChild (Key key , {bool recursive = false })
→ void
Removes a single child from this node and set its parent to null
.
removeListener (VoidCallback listener )
→ void
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
toggleExpand ([bool ? value ])
→ void
toggleSelect ([bool ? value ])
→ void
toJson ()
→ Map <String , dynamic >
toJson
is the convention for a class to declare support for serialization
to JSON. The implementation simply calls the private, generated
helper method _$NodeToJson
.
toString ()
→ String
A string representation of this object.
override