Committed by
GitHub
Merge branch 'master' into docs
Showing
2 changed files
with
10 additions
and
10 deletions
@@ -97,7 +97,7 @@ class ScreenUtil { | @@ -97,7 +97,7 @@ class ScreenUtil { | ||
97 | /// Adapted to the device width of the UI Design. | 97 | /// Adapted to the device width of the UI Design. |
98 | /// Height can also be adapted according to this to ensure no deformation , | 98 | /// Height can also be adapted according to this to ensure no deformation , |
99 | /// if you want a square | 99 | /// if you want a square |
100 | - num setWidth(num width) => width * scaleWidth; | 100 | + double setWidth(num width) => width * scaleWidth; |
101 | 101 | ||
102 | /// 根据UI设计的设备高度适配 | 102 | /// 根据UI设计的设备高度适配 |
103 | /// 当发现UI设计中的一屏显示的与当前样式效果不符合时, | 103 | /// 当发现UI设计中的一屏显示的与当前样式效果不符合时, |
@@ -107,14 +107,14 @@ class ScreenUtil { | @@ -107,14 +107,14 @@ class ScreenUtil { | ||
107 | /// It is recommended to use this method to achieve a high degree of adaptation | 107 | /// It is recommended to use this method to achieve a high degree of adaptation |
108 | /// when it is found that one screen in the UI design | 108 | /// when it is found that one screen in the UI design |
109 | /// does not match the current style effect, or if there is a difference in shape. | 109 | /// does not match the current style effect, or if there is a difference in shape. |
110 | - num setHeight(num height) => height * scaleHeight; | 110 | + double setHeight(num height) => height * scaleHeight; |
111 | 111 | ||
112 | ///字体大小适配方法 | 112 | ///字体大小适配方法 |
113 | ///- [fontSize] UI设计上字体的大小,单位px. | 113 | ///- [fontSize] UI设计上字体的大小,单位px. |
114 | ///Font size adaptation method | 114 | ///Font size adaptation method |
115 | ///- [fontSize] The size of the font on the UI design, in px. | 115 | ///- [fontSize] The size of the font on the UI design, in px. |
116 | ///- [allowFontScaling] | 116 | ///- [allowFontScaling] |
117 | - num setSp(num fontSize, {bool allowFontScalingSelf}) => | 117 | + double setSp(num fontSize, {bool allowFontScalingSelf}) => |
118 | allowFontScalingSelf == null | 118 | allowFontScalingSelf == null |
119 | ? (allowFontScaling | 119 | ? (allowFontScaling |
120 | ? (fontSize * scaleText) | 120 | ? (fontSize * scaleText) |
@@ -2,25 +2,25 @@ import 'package:flutter_screenutil/screenutil.dart'; | @@ -2,25 +2,25 @@ import 'package:flutter_screenutil/screenutil.dart'; | ||
2 | 2 | ||
3 | extension SizeExtension on num { | 3 | extension SizeExtension on num { |
4 | ///[ScreenUtil.setWidth] | 4 | ///[ScreenUtil.setWidth] |
5 | - num get w => ScreenUtil().setWidth(this); | 5 | + double get w => ScreenUtil().setWidth(this); |
6 | 6 | ||
7 | ///[ScreenUtil.setHeight] | 7 | ///[ScreenUtil.setHeight] |
8 | - num get h => ScreenUtil().setHeight(this); | 8 | + double get h => ScreenUtil().setHeight(this); |
9 | 9 | ||
10 | ///[ScreenUtil.setSp] | 10 | ///[ScreenUtil.setSp] |
11 | - num get sp => ScreenUtil().setSp(this); | 11 | + double get sp => ScreenUtil().setSp(this); |
12 | 12 | ||
13 | ///[ScreenUtil.setSp] | 13 | ///[ScreenUtil.setSp] |
14 | - num get ssp => ScreenUtil().setSp(this, allowFontScalingSelf: true); | 14 | + double get ssp => ScreenUtil().setSp(this, allowFontScalingSelf: true); |
15 | 15 | ||
16 | ///[ScreenUtil.setSp] | 16 | ///[ScreenUtil.setSp] |
17 | - num get nsp => ScreenUtil().setSp(this, allowFontScalingSelf: false); | 17 | + double get nsp => ScreenUtil().setSp(this, allowFontScalingSelf: false); |
18 | 18 | ||
19 | ///屏幕宽度的倍数 | 19 | ///屏幕宽度的倍数 |
20 | ///Multiple of screen width | 20 | ///Multiple of screen width |
21 | - num get wp => ScreenUtil().screenWidth * this; | 21 | + double get wp => ScreenUtil().screenWidth * this; |
22 | 22 | ||
23 | ///屏幕高度的倍数 | 23 | ///屏幕高度的倍数 |
24 | ///Multiple of screen height | 24 | ///Multiple of screen height |
25 | - num get hp => ScreenUtil().screenHeight * this; | 25 | + double get hp => ScreenUtil().screenHeight * this; |
26 | } | 26 | } |
-
Please register or login to post a comment