NavNode<T> class
One node in the navigation tree, generic over a strongly-typed host
value (a route, a screen enum, …) so callers read node.value with no
casting. Immutable; compose List<NavNode<T>> (each with children) to
describe the whole sidebar.
- Annotations
Constructors
-
const
Properties
- badge → NavBadge?
-
Optional trailing badge (count / status / shortcut hint).
final
-
children
→ List<
NavNode< T> > -
Child nodes. Empty for a leaf.
final
- enabled → bool
-
When false the row is shown but can't be activated.
final
- hasChildren → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- icon → IconData?
-
Leading icon. Optional for NavNodeRole.group headers (they show a
bullet), required-in-spirit for everything else.
final
- id → String
-
Unique, stable id across the whole sidebar (the host's screen key).
final
- isLeaf → bool
-
no setter
- label → String
-
Display label (also what the optional search filter matches against).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
shortcut
→ List<
String> ? -
Two-key "g d"-style shortcut shown on hover (purely presentational here;
wiring the keystroke is the host's job).
final
- value → T?
-
Strongly-typed payload travelling with the node (
nullfor structural nodes).final
Methods
-
copyWith(
{NavNodeId? id, String? label, IconData? icon, List< NavNode< ? children, NavBadge? badge, List<T> >String> ? shortcut, T? value, bool? enabled}) → NavNode<T> -
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.
override