ThemeBGButton constructor

ThemeBGButton({
  1. Key? key,
  2. double? width,
  3. double? height,
  4. required ThemeBGType bgColorType,
  5. bool needHighlight = false,
  6. required String title,
  7. TextStyle? titleStyle,
  8. Image? imageWidget,
  9. double imageTitleGap = 5.0,
  10. double cornerRadius = 5.0,
  11. bool enable = true,
  12. required VoidCallback onPressed,
})

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,
      );