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.new({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, Map<String, Color>? backgroundColor, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, BoxDecoration? decoration, BoxConstraints? constraints, EdgeInsetsGeometry? contentPadding, MainAxisAlignment? contentMainAxisAlignment, CrossAxisAlignment? contentCrossAxisAlignment, double? contentGap, double? iconSize, TextStyle? textStyle, EdgeInsetsGeometry? labelPadding, EdgeInsetsGeometry? iconPadding, Widget? iconWidget, Widget? alternateIconWidget, ControlButtonsButtonContentBuilder? contentBuilder, ControlButtonsButtonBuilder? buttonBuilder, ControlButtonsButtonIconBuilder? iconBuilder, ControlButtonsButtonLabelBuilder? labelBuilder, String? semanticsLabel})

Properties

active → bool
final
activeColor → Color?
final
alternateIcon → IconData?
final
alternateIconWidget → Widget?
final
backgroundColor → Map<String, Color>?
final
buttonBuilder → ControlButtonsButtonBuilder?
final
color → Color?
final
constraints → BoxConstraints?
final
contentBuilder → ControlButtonsButtonContentBuilder?
final
contentCrossAxisAlignment → CrossAxisAlignment?
final
contentGap → double?
final
contentMainAxisAlignment → MainAxisAlignment?
final
contentPadding → EdgeInsetsGeometry?
final
customComponent → Widget?
final
decoration → BoxDecoration?
final
disabled → bool
final
hashCode → int
The hash code for this object.
no setterinherited
icon → IconData?
final
iconBuilder → ControlButtonsButtonIconBuilder?
final
iconPadding → EdgeInsetsGeometry?
final
iconSize → double?
final
iconWidget → Widget?
final
inActiveColor → Color?
final
labelBuilder → ControlButtonsButtonLabelBuilder?
final
labelPadding → EdgeInsetsGeometry?
final
margin → EdgeInsetsGeometry?
final
name → String?
final
onPress → VoidCallback?
final
padding → EdgeInsetsGeometry?
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
semanticsLabel → String?
final
show → bool
final
textStyle → TextStyle?
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