CNToolbarAction class
Action item for toolbar trailing/leading positions.
Constructors
- CNToolbarAction({CNSymbol? icon, String? label, VoidCallback? onPressed, double? padding, double? labelSize, double? iconSize, Color? tint, String? badgeValue, Color? badgeColor})
-
Creates a toolbar action item.
const
- CNToolbarAction.fixedSpace(double width)
-
Creates a fixed space item with specific width.
const
- CNToolbarAction.flexibleSpace()
-
Creates a flexible space that expands to fill available space.
const
-
CNToolbarAction.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 toolbar action with a popup menu.
const
-
CNToolbarAction.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 toolbar action with a CNPopupMenuButton.
This provides a more native-looking popup menu button with built-in styling.
const
-
CNToolbarAction.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 toolbar action with a CNPullDownButton.
This provides Apple Design Guidelines compliant pull-down menus that appear below the button.
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
- 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
- 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
- tint → Color?
-
Tint color for this action's icon or label.
If null, uses the toolbar'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