ktextItem function
Widget
ktextItem(
- String title, {
- String? text,
- TextStyle? titleStyle,
- TextStyle? textStyle,
- Widget? leftWidget,
- Widget? rightWidget,
- int? height,
- EdgeInsetsGeometry? padding,
- EdgeInsetsGeometry? margin,
- Decoration? decoration,
- Function? onTap,
左侧Widget+标题+提示+右侧Widget 标题整行延伸
Implementation
Widget ktextItem(
String title, {
String? text,
TextStyle? titleStyle,
TextStyle? textStyle,
Widget? leftWidget,
Widget? rightWidget,
int? height,
EdgeInsetsGeometry? padding,
EdgeInsetsGeometry? margin,
Decoration? decoration,
Function? onTap,
}) {
return GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () => {onTap?.call()},
child: Container(
padding: padding,
margin: margin,
height: height?.h,
decoration: decoration,
alignment: Alignment.center,
child: Row(
children: [
leftWidget ?? Container(),
kWidth(10).kshow(leftWidget != null),
Expanded(
flex: 1,
child: Text(
title,
style: titleStyle,
)),
Text(
text ?? "",
style: textStyle,
).kshow(text.kisNotBlank()),
rightWidget ?? Container(),
],
),
),
);
}