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 to Colors.white.
  • activeColor (Color?): Color of the icon when the button is active. Defaults to Colors.blue.
  • inActiveColor (Color?): Color of the icon when the button is inactive. Defaults to Colors.grey.
  • active (bool): Indicates whether the button is active. Defaults to false.
  • show (bool): Indicates whether the button is visible. Defaults to true.
  • customComponent (Widget?): Custom widget to display instead of the default icon and text.
  • disabled (bool): Indicates whether the button is disabled (non-clickable). Defaults to false.

Example Usage:

ControlButton(
  name: "Mute",
  icon: Icons.mic,
  alternateIcon: Icons.mic_off,
  onPress: () => print("Mute button pressed"),
  active: false,
  color: Colors.black,
);

Constructors

ControlButton({String? name, IconData? icon, IconData? alternateIcon, VoidCallback? onPress, Color? color = Colors.white, Color? activeColor = Colors.blue, Color? inActiveColor = Colors.grey, bool active = false, bool show = true, Widget? customComponent, bool disabled = false})

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