withStyle static method

Text withStyle(
  1. String text,
  2. TextStyle textStyle, {
  3. FontWeight? fontWeight,
  4. TextAlign textAlign = TextAlign.start,
  5. TextOverflow? overflow,
  6. int? maxLine,
})

"custom" style text

Implementation

static Text withStyle(String text, TextStyle textStyle,
    {FontWeight? fontWeight,
    TextAlign textAlign = TextAlign.start,
    TextOverflow? overflow,
    int? maxLine}) {
  return Text(
    text,
    textAlign: textAlign,
    overflow: (overflow != null
        ? overflow
        : (maxLine != null && maxLine > 0
            ? TextOverflow.ellipsis
            : TextOverflow.visible)),
    maxLines: maxLine,
    style: textStyle,
  );
}