ButtonComponent class

UI button component data.

Inheritance

Constructors

ButtonComponent({required String text, required Size size, TextStyle textStyle = const TextStyle(color: Colors.white, fontSize: 13, fontWeight: FontWeight.w700), Color backgroundColor = const Color(0xFF3A5070), Color pressedColor = const Color(0xFF4E6A96), Color? borderColor, double borderRadius = 8, VoidCallback? onPressed, bool isPressed = false, bool visible = true, bool enabled = true, int layer = 0})
Create a UI button component.

Properties

backgroundColor ↔ Color
Base fill color.
getter/setter pair
borderColor ↔ Color?
Optional border color.
getter/setter pair
borderRadius ↔ double
Corner radius.
getter/setter pair
componentType → Type
Type identifier for this component
no setterinherited
currentColor → Color
Effective fill color based on pressed state.
no setter
enabled ↔ bool
Whether this UI element can receive input.
getter/setter pairinherited
hashCode → int
The hash code for this object.
no setterinherited
isPressed ↔ bool
Runtime pressed state.
getter/setter pair
layer ↔ int
Optional local layer hint for UI ordering.
getter/setter pairinherited
onPressed ↔ VoidCallback?
Callback invoked when the button is pressed.
getter/setter pair
pressedColor ↔ Color
Fill color while pressed.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
size ↔ Size
UI element size in logical pixels.
getter/setter pairinherited
text ↔ String
Button label.
getter/setter pair
textStyle ↔ TextStyle
Label style.
getter/setter pair
visible ↔ bool
Whether this UI element is visible.
getter/setter pairinherited

Methods

boundsAt(Offset position) → Rect
World-space bounds helper for hit testing.
inherited
containsPoint(Offset point, Offset position) → bool
True if point is inside this element when centered at position.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onAttach(EntityId entityId) → void
Called when this component is added to an entity.
inherited
onDetach(EntityId entityId) → void
Called when this component is removed from an entity.
inherited
toString() → String
A string representation of this object.
override
trigger() → void
Attempt to trigger button action.

Operators

operator ==(Object other) → bool
The equality operator.
inherited