CNNavigationBarAction class

Action item for navigation bar trailing/leading positions.

Constructors

CNNavigationBarAction({CNSymbol? icon, String? label, VoidCallback? onPressed, double? padding, double? labelSize, double? iconSize, Color? tint, String? badgeValue, Color? badgeColor})
Creates a navigation bar action item.
const
CNNavigationBarAction.fixedSpace(double width)
Creates a fixed space item with specific width.
const
CNNavigationBarAction.flexibleSpace()
Creates a flexible space that expands to fill available space.
const
CNNavigationBarAction.popupMenu({CNSymbol? icon, String? label, required List<CNPopupMenuEntry>? popupMenuItems, required ValueChanged<int>? onPopupMenuSelected, double? padding, double? labelSize, double? iconSize, Color? tint, String? badgeValue, Color? badgeColor})
Creates a navigation bar action with a popup menu.
const
CNNavigationBarAction.popupMenuButton({CNSymbol? icon, String? label, required List<CNPopupMenuEntry>? popupMenuItems, required ValueChanged<int>? onPopupMenuSelected, double? padding, double? labelSize, double? iconSize, Color? tint, String? badgeValue, Color? badgeColor})
Creates a navigation bar action with a CNPopupMenuButton. This provides a more native-looking popup menu button with built-in styling.
const
CNNavigationBarAction.pullDownButton({CNSymbol? icon, String? label, required List<CNPopupMenuEntry>? popupMenuItems, required ValueChanged<int>? onPopupMenuSelected, double? padding, double? labelSize, double? iconSize, Color? tint, String? badgeValue, Color? badgeColor})
Creates a navigation bar action with a CNPullDownButton. This provides a native pull-down button that shows a menu below the button.
const
CNNavigationBarAction.segmentedControl({required List<String>? segmentedControlLabels, required int? segmentedControlSelectedIndex, required ValueChanged<int>? onSegmentedControlValueChanged, double? segmentedControlHeight, double? segmentedControlWidth, Color? tint, double? padding})
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