textWidget function

Widget textWidget(
  1. dynamic text, {
  2. Color? color = const Color(0XFF222222),
  3. Color? backgroundColor,
  4. double fontSize = 13,
  5. FontWeight fontWeight = FontWeight.normal,
  6. int? maxLines,
  7. TextAlign? textAlign,
  8. TextOverflow overflow = TextOverflow.ellipsis,
  9. bool? softWrap,
})

Implementation

Widget textWidget(
  text, {
  Color? color = const Color(0XFF222222),
  Color? backgroundColor,
  double fontSize = 13,
  FontWeight fontWeight = FontWeight.normal,
  int? maxLines,
  TextAlign? textAlign,
  TextOverflow overflow = TextOverflow.ellipsis,
  bool? softWrap,
}) {
  return Text(
    '${BZObjectUtil.isEmpty(text) ? '' : text}',
    style: TextStyle(
      color: color,
      fontSize: fontSize.sp,
      fontWeight: fontWeight,
      backgroundColor: backgroundColor,
    ),
    maxLines: maxLines,
    overflow: overflow,
    textAlign: textAlign,
    softWrap: softWrap,
  );
}