BaseToolbarAction class
Cross-platform toolbar action
Represents an action button in the toolbar with icon and/or label. Also supports spacing actions for layout control.
Automatically converts to platform-specific formats:
- iOS: Uses CNToolbarAction with SF Symbols
- Material: Uses IconButton/TextButton with Material icons
Constructors
- BaseToolbarAction({CNSymbol? icon, String? label, VoidCallback? onPressed, Color? tint, double? padding, double? labelSize = 15, double? iconSize = 16, String? badgeValue, Color? badgeColor})
-
const
- BaseToolbarAction.fixedSpace(double width)
-
Creates a fixed space action
factory
- BaseToolbarAction.flexibleSpace()
-
Creates a flexible space action
factory
-
BaseToolbarAction.popupMenu({CNSymbol? icon, String? label, required List<
BasePopupMenuItem> popupMenuItems, required ValueChanged<int> onPopupMenuSelected, Color? tint, double? padding, double? labelSize = 15, double? iconSize = 16, String? badgeValue, Color? badgeColor}) -
Creates a toolbar action with a popup menu
factory
-
BaseToolbarAction.popupMenuButton({CNSymbol? icon, String? label, required List<
BasePopupMenuItem> popupMenuItems, required ValueChanged<int> onPopupMenuSelected, Color? tint, double? padding, double? labelSize = 15, double? iconSize = 16, String? badgeValue, Color? badgeColor}) -
Creates a toolbar action with a CNPopupMenuButton
factory
Properties
- badgeColor → Color?
-
Badge background color (iOS only)
final
- badgeValue → String?
-
Badge value to display on the action (iOS only)
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → CNSymbol?
-
Icon for the action (CNSymbol on iOS, Material icon elsewhere)
final
- iconSize → double?
-
Icon size (iOS only)
final
- isFixedSpace → bool
-
Check if this is a fixed space action
no setter
- isFlexibleSpace → bool
-
Check if this is a flexible space action
no setter
- label → String?
-
Optional text label
final
- labelSize → double?
-
Label text size (iOS only)
final
-
onPopupMenuSelected
→ ValueChanged<
int> ? -
Called when a popup menu item is selected
final
- onPressed → VoidCallback?
-
Callback when action is pressed
final
- padding → double?
-
Padding around the action (iOS only)
final
-
popupMenuItems
→ List<
BasePopupMenuItem> ? -
Popup menu items to display when the action is pressed
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spaceWidth → double?
-
Get the space width (for fixed space actions)
no setter
- tint → Color?
-
Custom tint color for the action
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toCNToolbarAction(
) → CNToolbarAction - Convert to CNToolbarAction for iOS implementation
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited