add text.light

null_safety
张萌 4 years ago
parent e866a2b12c
commit 8640d8db6f

@ -29,20 +29,25 @@ extension TextExtension on Text {
Text get black65 => Text get black65 =>
Text(this.data, style: this.style?.black65 ?? TextStyle().black65); Text(this.data, style: this.style?.black65 ?? TextStyle().black65);
Text lines(int maxLines){ Text lines(int maxLines) {
return Text( return Text(
this.data, this.data,
maxLines: maxLines, maxLines: maxLines,
); );
} }
Text over(TextOverflow textOverflow){ Text over(TextOverflow textOverflow) {
return Text( return Text(
this.data, this.data,
overflow:textOverflow, overflow: textOverflow,
); );
} }
Text get light => Text(
this.data,
style: this.style?.light ?? TextStyle().light,
);
Text copyWith({ Text copyWith({
FontWeight fontWeight, FontWeight fontWeight,
Color color, Color color,

@ -16,4 +16,7 @@ extension TextStyleExtension on TextStyle {
TextStyle get black => this.copyWith(color: kTextColor); TextStyle get black => this.copyWith(color: kTextColor);
TextStyle get black65 => this.copyWith(color: kTextSubColor); TextStyle get black65 => this.copyWith(color: kTextSubColor);
///FontWeight:w300
TextStyle get light => this.copyWith(fontWeight: FontWeight.w300);
} }

Loading…
Cancel
Save