ThemeBorderButton constructor

ThemeBorderButton({
  1. Key? key,
  2. double? width,
  3. double? height,
  4. BoxConstraints? constraints,
  5. required ThemeStateBGType borderColorType,
  6. bool needHighlight = false,
  7. required String title,
  8. TextStyle? titleStyle,
  9. Image? imageWidget,
  10. double imageTitleGap = 5,
  11. double cornerRadius = 5.0,
  12. bool enable = true,
  13. 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,
      );