PQText.rich constructor

PQText.rich(
  1. String? title, {
  2. Key? key,
  3. List<InlineSpan>? children,
  4. TextDecoration? decoration,
  5. TextAlign textAlign = TextAlign.start,
  6. int? maxLines,
  7. Color? color = const Color(0xff000000),
  8. double? fontSize,
  9. String? fontFamily,
  10. FontWeight? fontWeight = FontWeight.normal,
  11. double? wordSpacing,
  12. double? letterSpacing,
  13. StrutStyle? strutStyle,
  14. TextOverflow? overflow = TextOverflow.ellipsis,
  15. double? textScaleFactor = 1,
  16. double? lineHeight,
})

创建Text Widget,默认是显示一行,如果要多行请使用PQText.richLines

Implementation

PQText.rich(
  this.title, {
  Key? key,
  this.children,
  this.decoration,
  this.textAlign = TextAlign.start,
  this.maxLines,
  this.color = const Color(0xff000000),
  double? fontSize,
  this.fontFamily,
  this.fontWeight = FontWeight.normal,
  this.wordSpacing,
  this.letterSpacing,
  this.strutStyle,
  this.overflow = TextOverflow.ellipsis,
  this.textScaleFactor = 1,
  double? lineHeight,
})  : fontSize = fontSize ?? defaultFontSize,
      super(key: key) {
  if (lineHeight != null) {
    height = lineHeight / this.fontSize;
  }
}