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