Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
flutter_screenutil
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
李卓原
2022-02-17 17:57:41 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
226d6c1a0d569f04101a090017c2cf6531b09558
226d6c1a
1 parent
dd6ec784
5.3.1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
8 deletions
CHANGELOG.md
lib/screen_util.dart
lib/size_extension.dart
CHANGELOG.md
View file @
226d6c1
# 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
...
...
lib/screen_util.dart
View file @
226d6c1
...
...
@@ -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
));
}
...
...
lib/size_extension.dart
View file @
226d6c1
...
...
@@ -26,9 +26,21 @@ extension SizeExtension on num {
///Multiple of screen height
double
get
sh
=>
ScreenUtil
().
screenHeight
*
this
;
///[ScreenUtil.set
Width
]
///[ScreenUtil.set
Height
]
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
);
}
...
...
Please
register
or
login
to post a comment