LuckyText class final
文字项;未设置的可选字段由玩法的文字默认值补足。
例如 const LuckyText('一等奖', wordWrap: false) 显式禁用自动换行。
- Annotations
Constructors
-
LuckyText(String text, {LuckyLength? top, LuckyLength? left, Color? color, double? fontSize, String? fontFamily, List<
String> ? fontFamilyFallback, FontWeight? fontWeight, double? lineHeight, bool? wordWrap, LuckyLength? lengthLimit, int? lineClamp}) -
创建配置,未指定的可选字段使用声明的默认值。
const
Properties
- color → Color?
-
文字颜色;null 使用默认颜色。
final
- fontFamily → String?
-
字体族;null 使用默认字体。
final
-
fontFamilyFallback
→ List<
String> ? -
后备字体族列表;调用方须保持列表不可变。
final
- fontSize → double?
-
字号(逻辑像素),测量和绘制时向零截断。
final
- fontWeight → FontWeight?
-
字重;null 使用默认字重。
final
- hashCode → int
-
与字段值相等性一致的哈希值。
no setteroverride
- left → LuckyLength?
-
水平偏移;解析基准由所在玩法约定。
final
- lengthLimit → LuckyLength?
-
每行宽度限制;null 使用默认限制。
final
- lineClamp → int?
-
最大行数;null 使用默认值,非正数表示无限。
final
- lineHeight → double?
-
行高(逻辑像素);null 按默认行高和字号回退。
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- text → String
-
要显示的文本。
final
- top → LuckyLength?
-
顶部偏移;null 按零处理。
final
- wordWrap → bool?
-
是否换行;null 使用默认值,false 显式禁用。
final
Methods
-
copyWith(
{String? text, LuckyLength? top, LuckyLength? left, Color? color, double? fontSize, String? fontFamily, List< String> ? fontFamilyFallback, FontWeight? fontWeight, double? lineHeight, bool? wordWrap, LuckyLength? lengthLimit, int? lineClamp}) → LuckyText - 返回只替换指定字段的副本;参数为 null 时保留原值。
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
按字段值比较配置,列表按内容比较。
override