CNNavigationBarAction class
Action item for navigation bar trailing/leading positions.
Constructors
-
Creates a navigation bar action item.
const
-
Creates a fixed space item with specific width.
const
-
Creates a flexible space that expands to fill available space.
const
-
Creates a navigation bar action with a popup menu.
const
-
Creates a navigation bar action with a CNPopupMenuButton.
This provides a more native-looking popup menu button with built-in styling.
const
-
Creates a navigation bar action with a CNPullDownButton.
This provides a native pull-down button that shows a menu below the button.
const
-
Creates a navigation bar action with a segmented control.
This embeds a native UISegmentedControl/NSSegmentedControl in the navigation bar.
const
Properties
- badgeColor → Color?
-
Background color for the badge.
If null, uses the platform default badge color (typically red).
final
- badgeValue → String?
-
Badge value to display on the action (e.g., notification count, status text).
If null, no badge is shown.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasPopupMenu → bool
-
Returns true if this action has a popup menu.
no setter
- icon → CNSymbol?
-
SF Symbol icon for the action.
final
- iconSize → double?
-
Size for the icon in points.
If null, uses the icon's intrinsic size or platform default.
This overrides the size specified in the CNSymbol.
final
- isFixedSpace → bool
-
Returns true if this is a fixed space item.
no setter
- isFlexibleSpace → bool
-
Returns true if this is a flexible space item.
no setter
- isSegmentedControl → bool
-
Returns true if this action is a segmented control.
no setter
- isSpacer → bool
-
Returns true if this is a spacer (fixed or flexible).
no setter
- label → String?
-
Text label for the action (used if icon is null).
final
- labelSize → double?
-
Font size for the label text in points.
If null, uses the platform default size.
final
-
onPopupMenuSelected
→ ValueChanged<
int> ? -
Called when a popup menu item is selected.
The index corresponds to the position in the popupMenuItems list.
final
- onPressed → VoidCallback?
-
Callback when the action is tapped.
final
-
onSegmentedControlValueChanged
→ ValueChanged<
int> ? -
Called when a segment is selected in the segmented control.
final
- padding → double?
-
Custom padding for this action. If null, uses default platform padding.
Specified in logical pixels. For fixed space, this is the width of the space.
final
-
popupMenuItems
→ List<
CNPopupMenuEntry> ? -
Popup menu items to display when the action is pressed.
If provided, this action will show a popup menu instead of calling onPressed.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- segmentedControlHeight → double?
-
Height of the segmented control in logical pixels.
If null, uses platform default height (typically 28-32 points).
final
-
segmentedControlLabels
→ List<
String> ? -
Segment labels for segmented control (only for segmentedControl constructor).
final
- segmentedControlSelectedIndex → int?
-
Selected index for segmented control (only for segmentedControl constructor).
final
- segmentedControlWidth → double?
-
Width of the segmented control in logical pixels.
If null, the control sizes itself based on content.
final
- tint → Color?
-
Tint color for this action's icon or label.
If null, uses the navigation bar's global tint color.
final
- usePopupMenuButton → bool
-
Returns true if this action uses CNPopupMenuButton.
no setter
- usePullDownButton → bool
-
Returns true if this action uses CNPullDownButton.
no setter
Methods
-
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