diff --git a/lib/extension/text_extension.dart b/lib/extension/text_extension.dart index bec90a1..4e9828f 100644 --- a/lib/extension/text_extension.dart +++ b/lib/extension/text_extension.dart @@ -29,6 +29,20 @@ extension TextExtension on Text { Text get black65 => Text(this.data, style: this.style?.black65 ?? TextStyle().black65); + Text lines(int maxLines){ + return Text( + this.data, + maxLines: maxLines, + ); + } + + Text over(TextOverflow textOverflow){ + return Text( + this.data, + overflow:textOverflow, + ); + } + Text copyWith({ FontWeight fontWeight, Color color, diff --git a/lib/extension/text_style_extension.dart b/lib/extension/text_style_extension.dart index 0aad543..be12406 100644 --- a/lib/extension/text_style_extension.dart +++ b/lib/extension/text_style_extension.dart @@ -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);