QsLabel class

用于显示普通文本或自动缩放文本的标签组件。

Inheritance

Constructors

QsLabel({Key? key, required String text, bool isAutoSize = false, Color textColor = Colors.black, TextAlign textAlign = TextAlign.center, int? maxLines = 1, TextOverflow? overflow = TextOverflow.ellipsis, bool? softWrap, String? fontFamily, double fontSize = 14, FontWeight fontWeight = FontWeight.normal, double? lineHeight, List<Shadow>? shadows, TextDecoration? decoration, Color? decorationColor, double? decorationThickness})
创建一个文本标签。
const

Properties

decoration TextDecoration?
文字装饰线类型。
final
decorationColor Color?
文字装饰线颜色。
final
decorationThickness double?
文字装饰线粗细。
final
fontFamily String?
文字使用的字体族名称。
final
fontSize double
文字大小。
final
fontWeight FontWeight
文字粗细。
final
hashCode int
The hash code for this object.
no setterinherited
isAutoSize bool
是否根据可用空间自动调整文字大小。
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
lineHeight double?
行高倍数。
final
maxLines int?
最大显示行数。
final
overflow TextOverflow?
文字超出可用空间时的处理方式。
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shadows List<Shadow>?
文字阴影列表。
final
softWrap bool?
是否允许文字自动换行。
final
text String
需要显示的文本。
final
textAlign TextAlign
文字的水平对齐方式。
final
textColor Color
文字颜色。
final

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, int wrapWidth = 65}) 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