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
李卓原
2023-08-21 16:08:27 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5e6d317f23b91ea45a4a9e623d735d5af48e2962
5e6d317f
1 parent
7c8d2cc5
v5.9.0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
4 deletions
CHANGELOG.md
example/ios/Flutter/flutter_export_environment.sh
lib/src/screen_util.dart
pubspec.yaml
CHANGELOG.md
View file @
5e6d317
# 5.9.0
-beta
# 5.9.0
-
ScreenUtilInit won't rebuild the whole widget tree
-
Add
`fontSizeResolver`
to specify how font size should be scaled
-
Add
`diameter` & `diagonal`
factors
-
`useInheritedMediaQuery`
has not effect, and will be removed in next release
-
Fix
`ensureScreenSize`
in web platform
-
add deviceType
# 5.8.4
-
bug fix
...
...
example/ios/Flutter/flutter_export_environment.sh
View file @
5e6d317
...
...
@@ -3,11 +3,12 @@
export
"FLUTTER_ROOT=/Users/lizhuoyuan/fvm/versions/stable"
export
"FLUTTER_APPLICATION_PATH=/Users/lizhuoyuan/Development/Project/flutter_screenutil/example"
export
"COCOAPODS_PARALLEL_CODE_SIGN=true"
export
"FLUTTER_TARGET=lib/main.dart"
export
"FLUTTER_TARGET=
/Users/lizhuoyuan/Development/Project/flutter_screenutil/example/
lib/main.dart"
export
"FLUTTER_BUILD_DIR=build"
export
"FLUTTER_BUILD_NAME=1.0.0"
export
"FLUTTER_BUILD_NUMBER=1"
export
"DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==,RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC9jZGJlZGE3ODhhMjkzZmEyOTY2NWRjM2ZhM2Q2ZTYzYmQyMjFjYjBkLw=="
export
"DART_OBFUSCATION=false"
export
"TRACK_WIDGET_CREATION=true"
export
"TREE_SHAKE_ICONS=false"
export
"PACKAGE_CONFIG=.dart_tool/package_config.json"
export
"PACKAGE_CONFIG=
/Users/lizhuoyuan/Development/Project/flutter_screenutil/example/
.dart_tool/package_config.json"
...
...
lib/src/screen_util.dart
View file @
5e6d317
...
...
@@ -3,6 +3,7 @@
* email: zhuoyuan93@gmail.com
*/
import
'dart:io'
;
import
'dart:math'
show
min
,
max
;
import
'dart:ui'
as
ui
show
FlutterView
;
...
...
@@ -240,6 +241,37 @@ class ScreenUtil {
double
setSp
(
num
fontSize
)
=>
fontSizeResolver
?.
call
(
fontSize
,
_instance
)
??
fontSize
*
scaleText
;
DeviceType
deviceType
()
{
DeviceType
deviceType
;
switch
(
Platform
.
operatingSystem
)
{
case
'android'
:
case
'ios'
:
deviceType
=
DeviceType
.
mobile
;
if
((
orientation
==
Orientation
.
portrait
&&
screenWidth
<
600
)
||
(
orientation
==
Orientation
.
landscape
&&
screenHeight
<
600
))
{
deviceType
=
DeviceType
.
mobile
;
}
else
{
deviceType
=
DeviceType
.
tablet
;
}
break
;
case
'linux'
:
deviceType
=
DeviceType
.
linux
;
break
;
case
'macos'
:
deviceType
=
DeviceType
.
mac
;
break
;
case
'windows'
:
deviceType
=
DeviceType
.
windows
;
break
;
case
'fuchsia'
:
deviceType
=
DeviceType
.
fuchsia
;
break
;
default
:
deviceType
=
DeviceType
.
web
;
}
return
deviceType
;
}
SizedBox
setVerticalSpacing
(
num
height
)
=>
SizedBox
(
height:
setHeight
(
height
));
...
...
@@ -275,3 +307,5 @@ extension on MediaQueryData? {
return
this
;
}
}
enum
DeviceType
{
mobile
,
tablet
,
web
,
mac
,
windows
,
linux
,
fuchsia
}
...
...
pubspec.yaml
View file @
5e6d317
name
:
flutter_screenutil
description
:
A flutter plugin for adapting screen and font size.Guaranteed to look good on different models
version
:
5.9.0
-beta
version
:
5.9.0
homepage
:
https://github.com/OpenFlutter/flutter_screenutil
environment
:
...
...
Please
register
or
login
to post a comment