HubbleButton.verbose constructor
HubbleButton.verbose({
- required Widget child,
- required VoidCallback onPressed,
- required HubbleButtonSize size,
- bool isInProgress = false,
- bool isEnabled = true,
- bool isGhost = false,
- bool isOutlined = false,
- bool isExpanded = false,
- ButtonTapEvent? buttonTapEvent,
- Color? background,
- Color? foreground,
Implementation
factory HubbleButton.verbose({
required Widget child,
required VoidCallback onPressed,
required HubbleButtonSize size,
bool isInProgress = false,
bool isEnabled = true,
bool isGhost = false,
bool isOutlined = false,
bool isExpanded = false,
ButtonTapEvent? buttonTapEvent,
Color? background,
Color? foreground,
}) {
if (!isEnabled) {
return HubbleButton(
onPressed: onPressed,
size: size,
isGhost: isGhost,
isOutlined: isOutlined,
state: HubbleButtonState.disabled,
width: isExpanded ? double.infinity : null,
tapEvent: buttonTapEvent,
background: background,
foreground: foreground,
child: child,
);
}
if (isInProgress) {
return HubbleButton(
onPressed: onPressed,
size: size,
isGhost: isGhost,
isOutlined: isOutlined,
state: HubbleButtonState.progress,
tapEvent: buttonTapEvent,
background: background,
foreground: foreground,
child: child,
);
}
return HubbleButton(
onPressed: onPressed,
size: size,
isGhost: isGhost,
isOutlined: isOutlined,
state: HubbleButtonState.enabled,
tapEvent: buttonTapEvent,
background: background,
foreground: foreground,
child: child,
);
}