ThemeBGButton constructor
ThemeBGButton({})
Implementation
ThemeBGButton({
Key? key,
double? width,
double? height,
required ThemeBGType bgColorType,
bool needHighlight = false, // 是否需要高亮样式(默认false)
required String title,
TextStyle? titleStyle,
Image? imageWidget, // 图片
double imageTitleGap = 5.0, // 图片和文字之间的距离(imageWidget存在的时候才有效)
double cornerRadius = 5.0,
bool enable = true,
required VoidCallback onPressed,
}) : super(
key: key,
width: width,
height: height,
childBuider: (bSelected) {
return ButtonChildWidget(
title: title,
titleStyle: titleStyle,
imageWidget: imageWidget,
imageTitleGap: imageTitleGap,
);
},
enable: enable,
selected: false,
onPressed: onPressed,
cornerRadius: cornerRadius,
normalBGColor: themeColor(bgColorType),
normalTextColor: themeOppositeColor(bgColorType),
normalBorderWidth: 0.0,
normalBorderColor: themeOppositeColor(bgColorType),
// normalHighlightColor: Colors.yellow,
highlightOpacity: needHighlight ? 0.7 : 1.0,
);