ktextCheck function
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,
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();
});
}