PQText class
文本框的封装
- Inheritance
Constructors
- PQText(String? title, {Key? key, TextDecoration? decoration, TextAlign textAlign = TextAlign.start, int? maxLines, Color? color = const Color(0xff000000), double? fontSize, String? fontFamily, FontWeight? fontWeight = FontWeight.normal, double? wordSpacing, double? letterSpacing, StrutStyle? strutStyle, TextOverflow? overflow = TextOverflow.ellipsis, double? textScaleFactor = 1, double? lineHeight})
- 创建Text Widget,默认是显示一行,如果要多行请使用PQText.lines,在超出text小部件的宽度的时候会用...结束
- PQText.lines(String? title, {Key? key, TextDecoration? decoration, TextAlign textAlign = TextAlign.start, int? maxLines, Color? color = const Color(0xff000000), double? fontSize, String? fontFamily, FontWeight? fontWeight = FontWeight.normal, double? wordSpacing, double? letterSpacing, StrutStyle? strutStyle, TextOverflow? overflow, double? textScaleFactor = 1, double? lineHeight})
- 创建Text Widget,默认是显示多行,如果要一行请使用PQText
- PQText.regexRich(String text, RegExp regExp, TextStyle regExpStyle, {Key? key, TextDecoration? decoration, TextAlign textAlign = TextAlign.start, int? maxLines, Color? color = const Color(0xff000000), double fontSize = 17, String? fontFamily, FontWeight? fontWeight = FontWeight.normal, double? wordSpacing, double? letterSpacing, StrutStyle? strutStyle, TextOverflow? overflow = TextOverflow.ellipsis, double? textScaleFactor = 1, double? lineHeight})
- 通过正则去匹配文字,修改匹配成功的文本样式
-
PQText.rich(String? title, {Key? key, List<
InlineSpan> ? children, TextDecoration? decoration, TextAlign textAlign = TextAlign.start, int? maxLines, Color? color = const Color(0xff000000), double? fontSize, String? fontFamily, FontWeight? fontWeight = FontWeight.normal, double? wordSpacing, double? letterSpacing, StrutStyle? strutStyle, TextOverflow? overflow = TextOverflow.ellipsis, double? textScaleFactor = 1, double? lineHeight}) - 创建Text Widget,默认是显示一行,如果要多行请使用PQText.richLines
-
PQText.richLines(String? title, {Key? key, List<
InlineSpan> ? children, TextDecoration? decoration, TextAlign textAlign = TextAlign.start, int? maxLines, Color? color = const Color(0xff000000), double? fontSize, String? fontFamily, FontWeight? fontWeight = FontWeight.normal, double? wordSpacing, double? letterSpacing, StrutStyle? strutStyle, TextOverflow? overflow, double? textScaleFactor = 1, double? lineHeight}) - 创建Text Widget,默认是显示多行,如果要一行请使用PQText.rich
Properties
-
children
↔ List<
InlineSpan> ? -
富文本数据
getter/setter pair
- color ↔ Color?
-
文本颜色
getter/setter pair
- decoration ↔ TextDecoration?
-
文本装饰
getter/setter pair
- fontFamily ↔ String?
-
默认是
defaultFamily
getter/setter pair - fontSize ↔ double
-
字体大小,默认是 defaultFontSize
getter/setter pair
- fontWeight ↔ FontWeight?
-
fontWeight
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- height ↔ double?
-
getter/setter pair
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- letterSpacing ↔ double?
-
默认使用系统的
getter/setter pair
- maxLines ↔ int?
-
最大行数,默认是null
getter/setter pair
- overflow ↔ TextOverflow?
-
截断方式
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- strutStyle ↔ StrutStyle?
-
段落样式
getter/setter pair
- textAlign ↔ TextAlign
-
对齐方式,default is TextAlign.start
getter/setter pair
- textScaleFactor ↔ double?
-
default is 1
getter/setter pair
- title ↔ String?
-
text
getter/setter pair
- wordSpacing ↔ double?
-
默认使用系统的
getter/setter pair
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of
DiagnosticsNode
objects describing this node's children.inherited -
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- defaultFontFamily ↔ String?
-
默认的字体样式
getter/setter pair
- defaultFontSize ↔ double
-
默认的文本大小
getter/setter pair