TreeViewController<T> class
The controller for TreeView.
- Inheritance
-
- Object
- ChangeNotifier
- TreeViewController
- Annotations
-
- @KeyOrNullConverter()
- @JsonSerializable()
Constructors
-
TreeViewController({Set<
Key> ? selectedValues, SelectionMode selectionMode = SelectionMode.single, List<Node< ? children})T> > -
TreeViewController.fromJson(Map<
String, dynamic> json) -
A necessary factory constructor for creating a new Node instance
from a map. Pass the map to the generated
_$TreeViewControllerFromJson()
constructor. The constructor is named after the source class, in this case, Node.factory
Properties
-
children
→ List<
Node< T> > -
The nodes for the TreeView.
no setter
-
descendants
→ Iterable<
Node< T> > -
Returns an Iterable of every
Node
under this.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
-
root
→ Node<
T> -
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
selectedValues
→ Set<
Key> -
no setter
- selectionMode ↔ SelectionMode
-
getter/setter pair
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
addNode(
Node< T> newNode, {Key? parent, InsertMode mode = InsertMode.append}) → void - Adds a new node to an existing node identified by specified key. It optionally accepts an InsertMode and index. If no InsertMode is specified, it appends the new node as a child at the end. This method returns a new list with the added node.
-
addNodes(
List< Node< newNodes, {Key? parent}) → voidT> > - Adds a new nodes to an existing node identified by specified key.
-
collapseAll(
{Key? parent}) → void - Collapses all node that are children of the parent node parameter. If no parent is passed, uses the root node as the parent.
-
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
-
expandAll(
{Key? parent}) → void - Deletes an existing node identified by specified key. This method returns a new list with the specified node removed. Expands all node that are children of the parent node parameter. If no parent is passed, uses the root node as the parent.
-
findNode(
Key key) → Node< T> ? - Loads this controller with data from a JSON String This method expects the user to properly update the state
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
removeNode(
Key key, {bool recursive = false}) → void -
resetSelection(
) → void -
selectNode(
Key key, {bool ancestorExpanded = false}) → void -
toggleNode(
Key key) → void - Toggles an existing node identified by specified key. This method returns a new list with the specified Node toggled.
-
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_$TreeViewControllerToJson
. -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited