Committed by
GitHub
Update size_extension.dart
//smart size : it check your value if it is bigger than your value set your value //for example you have setted 16.sm() , if for your screen 16.sp() bigger than 16 it will set 16 not 16.sp() //I think that it is good for save size balance on big sizes of screen
Showing
1 changed file
with
6 additions
and
0 deletions
| @@ -12,6 +12,12 @@ extension SizeExtension on num { | @@ -12,6 +12,12 @@ extension SizeExtension on num { | ||
| 12 | 12 | ||
| 13 | ///[ScreenUtil.setSp] | 13 | ///[ScreenUtil.setSp] |
| 14 | double get sp => ScreenUtil().setSp(this); | 14 | double get sp => ScreenUtil().setSp(this); |
| 15 | + | ||
| 16 | + | ||
| 17 | + //smart size : it check your value if it is bigger than your value set your value | ||
| 18 | + //for example you have setted 16.sm() , if for your screen 16.sp() bigger than 16 it will set 16 not 16.sp() | ||
| 19 | + //I think that it is good for save size balance on big sizes of screen | ||
| 20 | + double get sm => (this.sp.toDouble()>toDouble())?toDouble():sp; | ||
| 15 | 21 | ||
| 16 | ///[ScreenUtil.setSp] | 22 | ///[ScreenUtil.setSp] |
| 17 | @Deprecated('please use [sp]') | 23 | @Deprecated('please use [sp]') |
-
Please register or login to post a comment