size_extension.dart
1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
part of flutter_screenutil;
extension SizeExtension on num {
///[ScreenUtil.setWidth]
double get w => ScreenUtil().setWidth(this);
///[ScreenUtil.setHeight]
double get h => ScreenUtil().setHeight(this);
///[ScreenUtil.radius]
double get r => ScreenUtil().radius(this);
///[ScreenUtil.setSp]
double get sp => ScreenUtil().setSp(this);
///[ScreenUtil.setSp]
@Deprecated('please use [sp]')
double get ssp => ScreenUtil().setSp(this);
///[ScreenUtil.setSp]
@Deprecated(
'please use [sp] , and set textScaleFactor: 1.0 , for example: Text("text", textScaleFactor: 1.0)')
double get nsp => ScreenUtil().setSp(this);
///屏幕宽度的倍数
///Multiple of screen width
double get sw => ScreenUtil().screenWidth * this;
///屏幕高度的倍数
///Multiple of screen height
double get sh => ScreenUtil().screenHeight * this;
///[ScreenUtil.setWidth]
Widget get verticalSpace => ScreenUtil().setVerticalSpacing(this);
///[ScreenUtil.setHeight]
Widget get horizontalSpace => ScreenUtil().setHorizontalSpacing(this);
}