LabelStyle class final
标签的完整外观: 排版参数 + 内边距 + 装饰。不可变, 按值比较。
- Annotations
Constructors
- LabelStyle({TextStyle text = const TextStyle(), TextAlign textAlign = TextAlign.start, StrutStyle? strutStyle, int? maxLines, double minWidth = 0, double maxWidth = double.infinity, EdgeInsets padding = EdgeInsets.zero, ShapeDecoration? decoration})
-
const
Properties
- decoration → ShapeDecoration?
-
背景与形状; null 不画背景。形状为 AnchoredBorder 时外延参与摆放。
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- maxLines → int?
-
final
- maxWidth → double
-
final
- minWidth → double
-
排版宽度区间, 与 TextPainter.layout 同义; 固定宽度写成 minWidth == maxWidth。
final
- padding → EdgeInsets
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- strutStyle → StrutStyle?
-
final
- text → TextStyle
-
final
- textAlign → TextAlign
-
final
Methods
-
copyWith(
{TextStyle? text, TextAlign? textAlign, StrutStyle? strutStyle, int? maxLines, double? minWidth, double? maxWidth, EdgeInsets? padding, ShapeDecoration? decoration}) → LabelStyle -
派生变体。参数为 null 表示沿用原值, 因此不能借此清除
decoration/strutStyle/maxLines。 -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sameLayout(
LabelStyle other) → bool - 排版相关字段是否相同; 只有它们变化才需要丢弃排版缓存。
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override