PQText constructor

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

创建Text Widget,默认是显示一行,如果要多行请使用PQText.lines,在超出text小部件的宽度的时候会用...结束

Implementation

PQText(
  this.title, {
  Key? key,
  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;
  }
}