李卓原

5.3.1

# 5.3.1
- add num.verticalSpacingRadius
num.horizontalSpaceRadius
num.setVerticalSpacingFromWidth
- update num.horizontalSpace
# 5.3.0
- For the size, use the context to get it first, which needs to provide the Context
More rigorous context checking
... ...
... ... @@ -122,11 +122,16 @@ class ScreenUtil {
///- [fontSize] The size of the font on the UI design, in dp.
double setSp(num fontSize) => fontSize * scaleText;
Widget setVerticalSpacing(num height) => SizedBox(
height: height * scaleHeight,
);
Widget setVerticalSpacing(num height) => SizedBox(height: setHeight(height));
Widget setHorizontalSpacing(num width) => SizedBox(
width: width * scaleHeight,
);
Widget setVerticalSpacingFromWidth(num height) =>
SizedBox(height: setWidth(height));
Widget setHorizontalSpacing(num width) => SizedBox(width: setWidth(width));
Widget setHorizontalSpacingRadius(num width) =>
SizedBox(width: radius(width));
Widget setVerticalSpacingRadius(num height) =>
SizedBox(height: radius(height));
}
... ...
... ... @@ -26,9 +26,21 @@ extension SizeExtension on num {
///Multiple of screen height
double get sh => ScreenUtil().screenHeight * this;
///[ScreenUtil.setWidth]
///[ScreenUtil.setHeight]
Widget get verticalSpace => ScreenUtil().setVerticalSpacing(this);
///[ScreenUtil.setHeight]
///[ScreenUtil.setVerticalSpacingFromWidth]
Widget get verticalSpaceFromWidth =>
ScreenUtil().setVerticalSpacingFromWidth(this);
///[ScreenUtil.setWidth]
Widget get horizontalSpace => ScreenUtil().setHorizontalSpacing(this);
///[ScreenUtil.radius]
Widget get horizontalSpaceRadius =>
ScreenUtil().setHorizontalSpacingRadius(this);
///[ScreenUtil.radius]
Widget get verticalSpacingRadius =>
ScreenUtil().setVerticalSpacingRadius(this);
}
... ...