ktext function
Widget
ktext(
- String text, {
- TextStyle? textStyle,
- int? height,
- int? width,
- AlignmentGeometry? alignment,
- EdgeInsetsGeometry? margin,
- EdgeInsetsGeometry? padding,
- Decoration? decoration,
- VoidCallback? onClick,
Text
text
文案
textStyle
文案样式
height
高度
width
宽度
alignment
对其方式
margin
外边距
padding
内边距
decoration
背景装饰
onClick
点击事件
Implementation
Widget ktext(
String text, {
TextStyle? textStyle,
int? height,
int? width,
AlignmentGeometry? alignment,
EdgeInsetsGeometry? margin,
EdgeInsetsGeometry? padding,
Decoration? decoration,
VoidCallback? onClick,
}) {
return Container(
margin: margin,
padding: padding,
decoration: decoration,
alignment: alignment,
height: height?.h,
width: width?.w,
child: Text(text, style: textStyle),
).konClickFast(() {
onClick?.call();
});
}