ButtonText class
A text-based button adhering to Alter Design System tokens.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ButtonText
Constructors
- ButtonText({Key? key, required String label, ButtonType type = ButtonType.gray, ButtonSize size = ButtonSize.normal, bool isSelected = false, bool? isHovered, bool? hasIcon, IconData? icon, Widget? iconWidget, VoidCallback? onTap})
-
Creates a ButtonText instance.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasIcon → bool?
-
Whether the leading icon should be rendered.
If
null, icon visibility is automatically inferred fromiconoriconWidget.final - icon → IconData?
-
Optional icon data for the leading icon (24x24px).
final
- iconWidget → Widget?
-
Optional custom widget for the icon slot.
final
- isHovered → bool?
-
Optional manual override for the hovered state.
final
- isSelected → bool
-
Whether the button is rendered in an active selected state.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → String
-
The text displayed inside the button.
final
- onTap → VoidCallback?
-
Callback executed when the button is tapped.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → ButtonSize
-
The size variation determining the button's padding.
final
- type → ButtonType
-
The visual style type of the button.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< ButtonText> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- version → const String
- Component version for reference. v1.3.2: Refined hasIcon visibility logic to honor explicit false overrides and dynamically infer icon rendering per Figma Node 130:8382. v1.3.1: Enhanced hover state tracking using explicit MouseRegion and resilient boolean override check. v1.3.0: Added interactive and explicit Hover state handling along with Selected state, ensuring baseWhite default background for ButtonType.white. v1.2.0: Aligned padding (Normal: 16x12, Large: 16x20), border tokens (baseBorder, interactivePrimaryBorder), added isSelected state and leading icon slot per Figma Node 130:8382. v1.1.1: Replaced baseBlack token reference with AlterColors.colorsGray800 swatch. v1.1.0: Added ButtonType.red destructive variant using AlterSemanticTokens.statusDanger.