update text extension

null_safety
张萌 4 years ago
parent 1b9f93ac91
commit a2e0d7a022

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

@ -5,7 +5,7 @@ extension TextStyleExtension on TextStyle {
TextStyle get bold => this.copyWith(fontWeight: FontWeight.bold);
///size
TextStyle size(double size) => this.copyWith(fontSize: size.w);
TextStyle size(double size) => this.copyWith(fontSize: size.sp);
///color
TextStyle colorX(Color color) => this.copyWith(color: color);

Loading…
Cancel
Save