Button constructor
const
Button({
- Key? key,
- required ButtonVariant variant,
- String? label,
- Widget? icon,
- Widget? trailingIcon,
- Color? color,
- String? tooltip,
- bool enable = true,
- bool enableHover = true,
- ButtonTitleExpand titleExpand = ButtonTitleExpand.none,
- Function? onPressed,
- Widget? child,
- String? semanticLabel,
- double? width,
- double? height,
- double? borderWidth,
- double? radius,
- EdgeInsets? padding,
- MainAxisSize? mainAxisSize,
- MainAxisAlignment? mainAxisAlignment,
- TextAlign? labelTextAlign,
Implementation
const Button({
super.key,
required this.variant,
this.label,
this.icon,
this.trailingIcon,
this.color,
this.tooltip,
this.enable = true,
this.enableHover = true,
this.titleExpand = ButtonTitleExpand.none,
this.onPressed,
this.child,
this.semanticLabel,
this.width,
this.height,
this.borderWidth,
this.radius,
this.padding,
this.mainAxisSize,
this.mainAxisAlignment,
this.labelTextAlign,
}) : assert(
(label != null && child == null) || (label == null && child != null),
'Either label or child must be provided',
);