CQTSThemeStateButton constructor
CQTSThemeStateButton({})
Implementation
CQTSThemeStateButton({
Key? key,
double? width,
double? height,
required CQTSThemeBGType normalBGColorType,
bool needHighlight = false, // 是否需要高亮样式(默认false)
double cornerRadius = 5.0,
required String normalTitle,
String? selectedTitle,
TextStyle? titleStyle,
bool enable = true,
bool selected = false,
required void Function() onPressed,
}) : super(
key: key,
width: width,
height: height,
childBuider: (bSelected) {
String _currentTitle = normalTitle;
if (selected) {
_currentTitle = selectedTitle ?? normalTitle;
}
return Text(
_currentTitle,
style: titleStyle ?? TextStyle(fontSize: 13.0),
);
},
enable: enable,
selected: selected,
onPressed: () {
onPressed();
},
cornerRadius: cornerRadius,
themeColor: themeColor(normalBGColorType),
themeOppositeColor: themeOppositeColor(normalBGColorType),
normalBorderWidth: 0.0,
selectedBorderWidth: 1.0,
// normalBackgroundHighlightColor: Colors.yellow,
// selectedBackgroundHighlightColor: Colors.pink,
highlightOpacity: needHighlight ? 0.7 : 1.0,
);