StacNavigationDestination class

A Stac model representing Flutter's NavigationDestination.

Used as a child of StacNavigationBar to define a single destination (icon, optional selected icon, label and tooltip).

Dart example:

StacNavigationDestination(
  icon: StacIcon(icon: 'home_outlined'),
  selectedIcon: StacIcon(icon: 'home'),
  label: 'Home',
)

JSON example:

{
  "icon": {"type": "icon", "icon": "home_outlined"},
  "selectedIcon": {"type": "icon", "icon": "home"},
  "label": "Home"
}

See also:

  • Flutter's NavigationDestination docs (https://api.flutter.dev/flutter/material/NavigationDestination-class.html)
Inheritance
Annotations
  • @JsonSerializable.new(explicitToJson: true)

Constructors

StacNavigationDestination({required StacWidget icon, required String label, StacWidget? selectedIcon, String? tooltip, bool? enabled})
Creates a StacNavigationDestination.
const
StacNavigationDestination.fromJson(Map<String, dynamic> json)
Creates a StacNavigationDestination from JSON.
factory

Properties

enabled → bool?
Whether this destination is enabled. Defaults to true.
final
hashCode → int
The hash code for this object.
no setterinherited
icon → StacWidget
The icon shown when this destination is unselected.
final
label → String
The text label for this destination.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selectedIcon → StacWidget?
The icon shown when this destination is selected.
final
tooltip → String?
Tooltip text shown on long press.
final

Methods

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

Operators

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