UiButton constructor
UiButton({})
Implementation
factory UiButton({
Key? key,
String? label,
Widget? icon,
required VoidCallback? onPressed,
Color? backgroundColor,
Color? foregroundColor,
double borderRadius = 6,
double elevation = 2,
EdgeInsetsGeometry? padding,
TextStyle? labelStyle,
bool expand = false,
String? tooltip,
Color? borderColor,
Gradient? gradient,
}) {
return UiButton._internal(
key: key,
label: label,
icon: icon,
onPressed: onPressed,
expand: expand,
tooltip: tooltip,
type: _UiButtonType.elevated,
borderColor: borderColor,
gradient: gradient,
style: ElevatedButton.styleFrom(
backgroundColor: gradient == null
? (backgroundColor ?? primary)
: Colors.transparent,
foregroundColor: foregroundColor ?? white,
elevation: elevation,
padding:
padding ?? const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
shape: RoundedRectangleBorder(
side: borderColor != null
? BorderSide(color: borderColor, width: 1.2)
: BorderSide.none,
borderRadius: BorderRadius.circular(borderRadius),
),
textStyle: labelStyle ??
const TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
),
);
}