ktext function

Widget ktext(
  1. String text, {
  2. TextStyle? textStyle,
  3. int? height,
  4. int? width,
  5. AlignmentGeometry? alignment,
  6. EdgeInsetsGeometry? margin,
  7. EdgeInsetsGeometry? padding,
  8. Decoration? decoration,
  9. 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();
  });
}