ControlButton class
ControlButton
- A model class to define properties of individual control buttons.
This model allows customization of button icons, colors, text, states, and actions, enabling the creation of flexible and interactive control buttons.
Properties:
name
(String?
): Optional text to display below the button's icon.icon
(IconData?
): Icon to display on the button when inactive.alternateIcon
(IconData?
): Alternate icon to display when the button is active.onPress
(VoidCallback?
): Function callback triggered on button press.color
(Color?
): Color of the button text. Defaults toColors.white
.activeColor
(Color?
): Color of the icon when the button is active. Defaults toColors.blue
.inActiveColor
(Color?
): Color of the icon when the button is inactive. Defaults toColors.grey
.active
(bool
): Indicates whether the button is active. Defaults tofalse
.show
(bool
): Indicates whether the button is visible. Defaults totrue
.customComponent
(Widget?
): Custom widget to display instead of the default icon and text.disabled
(bool
): Indicates whether the button is disabled (non-clickable). Defaults tofalse
.
Example Usage:
ControlButton(
name: "Mute",
icon: Icons.mic,
alternateIcon: Icons.mic_off,
onPress: () => print("Mute button pressed"),
active: false,
color: Colors.black,
);
Constructors
Properties
- active → bool
-
final
- activeColor → Color?
-
final
- alternateIcon → IconData?
-
final
- color → Color?
-
final
- customComponent → Widget?
-
final
- disabled → bool
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData?
-
final
- inActiveColor → Color?
-
final
- name → String?
-
final
- onPress → VoidCallback?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- show → bool
-
final
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