textActionButtonWidget function
Widget
textActionButtonWidget({
- required String text,
- required VoidCallback? onPressed,
- Color? backgroundColor,
- Color? disabledBackgroundColor,
- Color? textColor = Colors.white,
- Color? disabledTextColor,
- BorderRadius? borderRadius,
- EdgeInsets padding = const EdgeInsets.symmetric(horizontal: 0, vertical: 0),
- EdgeInsets margin = const EdgeInsets.symmetric(horizontal: 13, vertical: 15),
- double fontSize = 11,
- Size? minimumSize,
- Size? fixedSize,
- Size? maximumSize,
- FontWeight? fontWeight,
Implementation
Widget textActionButtonWidget({
required String text,
required VoidCallback? onPressed,
Color? backgroundColor,
Color? disabledBackgroundColor,
Color? textColor = Colors.white,
Color? disabledTextColor,
BorderRadius? borderRadius,
EdgeInsets padding = const EdgeInsets.symmetric(horizontal: 0, vertical: 0),
EdgeInsets margin = const EdgeInsets.symmetric(horizontal: 13, vertical: 15),
double fontSize = 11,
Size? minimumSize,
Size? fixedSize,
Size? maximumSize,
FontWeight? fontWeight,
}) {
//disable 0.3不透明度
disabledTextColor ??= textColor?.withOpacity(0.3);
return textButtonWidget(
text: text,
onPressed: onPressed,
backgroundColor: backgroundColor,
disabledBackgroundColor: disabledBackgroundColor,
textColor: textColor,
disabledTextColor: disabledTextColor,
borderRadius: borderRadius,
padding: padding,
margin: margin,
fontSize: fontSize,
minimumSize: minimumSize,
fixedSize: fixedSize,
maximumSize: maximumSize,
fontWeight: fontWeight,
);
}