CustomActionButton.icon constructor
CustomActionButton.icon({
- Key? key,
- required VoidCallback? onPressed,
- required Widget icon,
- required Widget label,
- ButtonType baseType = ButtonType.elevated,
- double iconSpacing = 8.0,
- Color? backgroundColor,
- Color? foregroundColor,
- Color? shadowColor,
- Color? splashColor,
- Color? disabledBackgroundColor,
- Color? disabledBorderColor,
- Color? disabledForegroundColor,
- Color? borderColor,
- double? elevation,
- double? borderRadius,
- double? width,
- double? height,
- double minHeight = 60.0,
- OutlinedBorder? shape,
- EdgeInsetsGeometry? padding,
- EdgeInsetsGeometry? margin,
- Gradient? backgroundGradient,
- Gradient? disabledBackgroundGradient,
- InteractiveInkFeatureFactory? splashFactory,
- MaterialTapTargetSize? tapTargetSize,
Creates a button with an icon and a label.
baseTypecontrols the underlying button style (e.g., elevated, flat).
Implementation
factory CustomActionButton.icon({
Key? key,
required VoidCallback? onPressed,
required Widget icon,
required Widget label,
ButtonType baseType = ButtonType.elevated,
double iconSpacing = 8.0,
Color? backgroundColor,
Color? foregroundColor,
Color? shadowColor,
Color? splashColor,
Color? disabledBackgroundColor,
Color? disabledBorderColor,
Color? disabledForegroundColor,
Color? borderColor,
double? elevation,
double? borderRadius,
double? width,
double? height,
double minHeight = 60.0,
OutlinedBorder? shape,
EdgeInsetsGeometry? padding,
EdgeInsetsGeometry? margin,
Gradient? backgroundGradient,
Gradient? disabledBackgroundGradient,
InteractiveInkFeatureFactory? splashFactory,
MaterialTapTargetSize? tapTargetSize,
}) {
return CustomActionButton(
key: key,
buttonType: baseType,
onPressed: onPressed,
icon: icon,
iconSpacing: iconSpacing,
backgroundColor: backgroundColor,
foregroundColor: foregroundColor,
shadowColor: shadowColor,
splashColor: splashColor,
disabledBackgroundColor: disabledBackgroundColor,
disabledBorderColor: disabledBorderColor,
disabledForegroundColor: disabledForegroundColor,
borderColor: borderColor,
elevation: elevation,
borderRadius: borderRadius,
width: width,
height: height,
minHeight: minHeight,
shape: shape,
padding: padding,
margin: margin,
backgroundGradient: backgroundGradient,
disabledBackgroundGradient: disabledBackgroundGradient,
splashFactory: splashFactory,
tapTargetSize: tapTargetSize,
child: label,
);
}