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
kageeker
2021-11-21 18:11:24 -0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d7d40b0e7ba45f57ad85d32f6697e7953858dbe1
d7d40b0e
1 parent
4d393855
added Vertical and horizontal spacing for lists
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
example/ios/Flutter/flutter_export_environment.sh
lib/screen_util.dart
lib/size_extension.dart
example/ios/Flutter/flutter_export_environment.sh
View file @
d7d40b0
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export
"FLUTTER_ROOT=/Users/lizhuoyuan/Development/flutter"
export
"FLUTTER_APPLICATION_PATH=/Users/lizhuoyuan/Development/Project/flutter_screenutil/example"
export
"FLUTTER_ROOT=C:
\d
ev
\f
lutter"
export
"FLUTTER_APPLICATION_PATH=C:
\U
sers
\k
agee
\D
ocuments
\f
lutter_screenutil
\e
xample"
export
"COCOAPODS_PARALLEL_CODE_SIGN=true"
export
"FLUTTER_TARGET=lib
/
main.dart"
export
"FLUTTER_TARGET=lib
\
m
ain.dart"
export
"FLUTTER_BUILD_DIR=build"
export
"SYMROOT=
${
SOURCE_ROOT
}
/../build/ios"
export
"FLUTTER_BUILD_NAME=1.0.0"
export
"FLUTTER_BUILD_NUMBER=1"
export
"DART_OBFUSCATION=false"
...
...
lib/screen_util.dart
View file @
d7d40b0
...
...
@@ -109,4 +109,12 @@ class ScreenUtil {
///Font size adaptation method
///- [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
setHorizontalSpacing
(
num
width
)
=>
SizedBox
(
height:
width
*
scaleHeight
,
);
}
...
...
lib/size_extension.dart
View file @
d7d40b0
...
...
@@ -29,4 +29,10 @@ extension SizeExtension on num {
///屏幕高度的倍数
///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
);
}
...
...
Please
register
or
login
to post a comment