LokioButton constructor

const LokioButton({
  1. Key? key,
  2. required VoidCallback? onPressed,
  3. ButtonVariant variant = ButtonVariant.primary,
  4. ButtonSize size = ButtonSize.medium,
  5. Widget? child,
  6. Widget? leadingIcon,
  7. Widget? trailingIcon,
  8. bool isLoading = false,
  9. bool isExpanded = false,
  10. LokioTheme? theme,
})

Implementation

const LokioButton({
  super.key,
  required this.onPressed,
  this.variant = ButtonVariant.primary,
  this.size = ButtonSize.medium,
  this.child,
  this.leadingIcon,
  this.trailingIcon,
  this.isLoading = false,
  this.isExpanded = false,
  this.theme,
}) : assert(
        variant == ButtonVariant.icon
            ? (leadingIcon != null || trailingIcon != null)
            : (child != null || leadingIcon != null || trailingIcon != null),
        'For icon variant, provide leadingIcon or trailingIcon. For other variants, provide child, leadingIcon, or trailingIcon.',
      );