kmaterialButtonRRBCheck function

Widget kmaterialButtonRRBCheck(
  1. String text,
  2. bool isCheck, {
  3. TextStyle? textStyle,
  4. TextStyle? textStyleCheck,
  5. int? height,
  6. int? minWidth,
  7. EdgeInsetsGeometry? margin,
  8. EdgeInsetsGeometry? padding,
  9. Color? background,
  10. Color? backgroundCheck,
  11. Color? borderColor,
  12. Color? borderColorCheck,
  13. int? borderWidth,
  14. int? radius,
  15. bool isDisabled = true,
  16. Color? disabledTextColor,
  17. Color? disabledColor,
  18. Color? disableBorderColor,
  19. bool clearElevation = false,
  20. VoidCallback? onClick,
})

MaterialButton RoundedRectangleBorder形状+是否选中样式 text 文案 isCheck 是否选中 textStyle 未选中文案样式 textStyleCheck 选中文案样式 height 高度 minWidth 最小宽度 margin 外边距 padding 内边距 background 未选中背景色 backgroundCheck 选中背景色 borderColor 未选中边框颜色 borderColorCheck 选中边框颜色 borderWidth 边框宽度 radius 边框圆角 isDisabled 是否可点击 disabledTextColor 不可点击的文字颜色 disabledColor 不可点击的背景颜色 disableShape 不可点击的形状 clearElevation 去掉阴影 onClick 点击事件

Implementation

Widget kmaterialButtonRRBCheck(
    String text,
    bool isCheck, {
      TextStyle? textStyle,
      TextStyle? textStyleCheck,
      int? height,
      int? minWidth,
      EdgeInsetsGeometry? margin,
      EdgeInsetsGeometry? padding,
      Color? background,
      Color? backgroundCheck,
      Color? borderColor,
      Color? borderColorCheck,
      int? borderWidth,
      int? radius,
      bool isDisabled = true,
      Color? disabledTextColor,
      Color? disabledColor,
      Color? disableBorderColor,
      bool clearElevation = false,
      VoidCallback? onClick,
    }) {
  return kmaterialButton(text,
      textStyle: isCheck ? (textStyleCheck ?? textStyle) : textStyle,
      height: height,
      minWidth: minWidth,
      margin: margin,
      padding: padding,
      background: isCheck ? (backgroundCheck ?? background) : background,
      shape: RoundedRectangleBorder(
        side: BorderSide(
          color: (isCheck ? (borderColorCheck ?? borderColor) : borderColor) ??
              (background ?? Colors.transparent),
          width: (borderWidth?.w ?? 1.0),
        ),
        borderRadius: BorderRadius.all(
          Radius.circular(radius?.r ?? 0),
        ),
      ),
      onClick: onClick,
      isDisabled: isDisabled,
      disabledColor: disabledColor,
      disabledTextColor: disabledTextColor,
      disableShape: RoundedRectangleBorder(
        side: BorderSide(
          color: disableBorderColor ?? (disabledColor ?? Colors.transparent),
          width: (borderWidth?.w ?? 1.0),
        ),
        borderRadius: BorderRadius.all(
          Radius.circular(radius?.r ?? 0),
        ),
      ),
      clearElevation: clearElevation);
}