SubZeroButton constructor

const SubZeroButton({
  1. Key? key,
  2. String? label,
  3. IconData? leadingIcon,
  4. IconData? trailingIcon,
  5. IconData? icon,
  6. SubZeroButtonVariant variant = SubZeroButtonVariant.primary,
  7. SubZeroButtonSize size = SubZeroButtonSize.medium,
  8. VoidCallback? onPressed,
  9. bool isLoading = false,
  10. bool fullWidth = false,
  11. Color? backgroundColor,
  12. Color? foregroundColor,
  13. 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',
      );