ktextCheck function

Widget ktextCheck(
  1. String text,
  2. bool isCheck, {
  3. TextStyle? textStyle,
  4. TextStyle? textStyleCheck,
  5. int? height,
  6. int? width,
  7. AlignmentGeometry? alignment,
  8. EdgeInsetsGeometry? margin,
  9. EdgeInsetsGeometry? padding,
  10. Decoration? decoration,
  11. Decoration? decorationCheck,
  12. VoidCallback? onClick,
})

Text 选中和未选中样式 text 文案 isCheck 是否选中 textStyle 未选中文案样式 textStyleCheck 选中文案样式 height 高度 width 宽度 alignment 对其方式 margin 外边距 padding 内边距 decoration 未选中背景装饰 decorationCheck 选中背景装饰 onClick 点击事件

Implementation

Widget ktextCheck(
  String text,
  bool isCheck, {
  TextStyle? textStyle,
  TextStyle? textStyleCheck,
  int? height,
  int? width,
  AlignmentGeometry? alignment,
  EdgeInsetsGeometry? margin,
  EdgeInsetsGeometry? padding,
  Decoration? decoration,
  Decoration? decorationCheck,
  VoidCallback? onClick,
}) {
  return Container(
    margin: margin,
    padding: padding,
    decoration: isCheck ? decorationCheck : decoration,
    alignment: alignment,
    height: height?.h,
    width: width?.w,
    child: Text(text, style: isCheck ? textStyleCheck : textStyle),
  ).konClickFast(() {
    onClick?.call();
  });
}