WidgetbookNode class abstract
A base class for all nodes in the navigation tree. The nodes have the following hierarchy:
Constructors
-
WidgetbookNode({required String name, required List<
WidgetbookNode> ? children, bool isInitiallyExpanded = true})
Properties
-
children
→ List<
WidgetbookNode> ? -
final
- count → int
-
no setter
- depth → int
-
Gets the depth of the node within the tree.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isInitiallyExpanded → bool
-
final
- isLeaf → bool
-
no setter
- isRoot → bool
-
no setter
-
leaves
→ List<
WidgetbookNode> -
Gets all leaf nodes of this node.
no setter
- name → String
-
final
-
nodesPath
→ List<
WidgetbookNode> -
Gets the nodes path from root to this node.
no setter
- parent ↔ WidgetbookNode?
-
getter/setter pair
- path → String
-
Gets the path from root to this node without leading slash
Example: root/child/grandchild
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{String? name, List< WidgetbookNode> ? children}) → WidgetbookNode - Creates a copy of this node with the given properties. Used in filter to create a copy of the sub-tree.
-
filter(
bool predicate(WidgetbookNode node)) → WidgetbookNode? -
Filters the sub-tree of this node for any node that matches
predicate
. If a node matches the predicate, it will be included, along with all its descendants, in the result. -
find(
bool predicate(WidgetbookNode node)) → WidgetbookNode? -
Searches for a node that matches
predicate
in the sub-tree of this node. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited