SubZeroButton constructor
const
SubZeroButton({
- Key? key,
- String? label,
- IconData? leadingIcon,
- IconData? trailingIcon,
- IconData? icon,
- SubZeroButtonVariant variant = SubZeroButtonVariant.primary,
- SubZeroButtonSize size = SubZeroButtonSize.medium,
- VoidCallback? onPressed,
- bool isLoading = false,
- bool fullWidth = false,
- Color? backgroundColor,
- Color? foregroundColor,
- String? semanticLabel,
Implementation
const SubZeroButton({
super.key,
this.label,
this.leadingIcon,
this.trailingIcon,
this.icon,
this.variant = SubZeroButtonVariant.primary,
this.size = SubZeroButtonSize.medium,
this.onPressed,
this.isLoading = false,
this.fullWidth = false,
this.backgroundColor,
this.foregroundColor,
this.semanticLabel,
}) : assert(
variant == SubZeroButtonVariant.iconOnly
? icon != null
: label != null || icon != null,
'Label is required for non-icon-only buttons',
);