Skip to content

Commit 714c83f

Browse files
authored
Merge branch 'master' into docs
2 parents c35e4b9 + c0b3318 commit 714c83f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

lib/screenutil.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class ScreenUtil {
9797
/// Adapted to the device width of the UI Design.
9898
/// Height can also be adapted according to this to ensure no deformation ,
9999
/// if you want a square
100-
num setWidth(num width) => width * scaleWidth;
100+
double setWidth(num width) => width * scaleWidth;
101101

102102
/// 根据UI设计的设备高度适配
103103
/// 当发现UI设计中的一屏显示的与当前样式效果不符合时,
@@ -107,14 +107,14 @@ class ScreenUtil {
107107
/// It is recommended to use this method to achieve a high degree of adaptation
108108
/// when it is found that one screen in the UI design
109109
/// 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;
111111

112112
///字体大小适配方法
113113
///- [fontSize] UI设计上字体的大小,单位px.
114114
///Font size adaptation method
115115
///- [fontSize] The size of the font on the UI design, in px.
116116
///- [allowFontScaling]
117-
num setSp(num fontSize, {bool allowFontScalingSelf}) =>
117+
double setSp(num fontSize, {bool allowFontScalingSelf}) =>
118118
allowFontScalingSelf == null
119119
? (allowFontScaling
120120
? (fontSize * scaleText)

lib/size_extension.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@ import 'package:flutter_screenutil/screenutil.dart';
22

33
extension SizeExtension on num {
44
///[ScreenUtil.setWidth]
5-
num get w => ScreenUtil().setWidth(this);
5+
double get w => ScreenUtil().setWidth(this);
66

77
///[ScreenUtil.setHeight]
8-
num get h => ScreenUtil().setHeight(this);
8+
double get h => ScreenUtil().setHeight(this);
99

1010
///[ScreenUtil.setSp]
11-
num get sp => ScreenUtil().setSp(this);
11+
double get sp => ScreenUtil().setSp(this);
1212

1313
///[ScreenUtil.setSp]
14-
num get ssp => ScreenUtil().setSp(this, allowFontScalingSelf: true);
14+
double get ssp => ScreenUtil().setSp(this, allowFontScalingSelf: true);
1515

1616
///[ScreenUtil.setSp]
17-
num get nsp => ScreenUtil().setSp(this, allowFontScalingSelf: false);
17+
double get nsp => ScreenUtil().setSp(this, allowFontScalingSelf: false);
1818

1919
///屏幕宽度的倍数
2020
///Multiple of screen width
21-
num get wp => ScreenUtil().screenWidth * this;
21+
double get wp => ScreenUtil().screenWidth * this;
2222

2323
///屏幕高度的倍数
2424
///Multiple of screen height
25-
num get hp => ScreenUtil().screenHeight * this;
25+
double get hp => ScreenUtil().screenHeight * this;
2626
}

0 commit comments

Comments
 (0)