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
李卓原
2019-01-03 18:17:55 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
013e862a05d3656c9e769ab7333707a329b5eafb
013e862a
1 parent
5ed62dc9
字体随系统变化:默认为false
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
14 additions
and
8 deletions
.packages
CHANGELOG.md
README.md
README_CN.md
example/pubspec.lock
lib/flutter_screenutil.dart
pubspec.yaml
.packages
View file @
013e862
# Generated by pub on 201
8-11-19 10:56:16.589695
.
# Generated by pub on 201
9-01-03 18:12:49.974343
.
async:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.0.8/lib/
boolean_selector:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-1.0.4/lib/
charcode:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.1.2/lib/
...
...
CHANGELOG.md
View file @
013e862
...
...
@@ -23,3 +23,9 @@ Height is enlarged relative to the design draft => The ratio of height width to
///Current device height dp
<br/>
///当前设备高度 dp
<br/>
ScreenUtil.screenHeightDp
## [0.4.2] - Modify the font to change with the system zoom mode. The default value is false.
setSp(int fontSize,
[
allowFontScaling = false
]
) => allowFontScaling
? setWidth(fontSize)
*
_textScaleFactor
: setWidth(fontSize);
\ No newline at end of file
...
...
README.md
View file @
013e862
...
...
@@ -72,8 +72,8 @@ Container(
#### Adapter font:
```
ScreenUtil().setSp(28) //Incoming font size,the unit is pixel, fonts will scale to respect Text Size accessibility settings
ScreenUtil().setSp(28,false) //Incoming font size,the unit is pixel,fonts will not scale to respect Text Size accessibility settings
ScreenUtil().setSp(28) //Incoming font size,the unit is pixel, fonts will not scale to respect Text Size accessibility settings
ScreenUtil().setSp(28,true) //Incoming font size,the unit is pixel,fonts will scale to respect Text Size accessibility settings
for example:
Text(
...
...
README_CN.md
View file @
013e862
...
...
@@ -78,8 +78,8 @@ Container(
传入设计稿的px尺寸:
```
ScreenUtil().setSp(28) //传入字体大小,根据系统的“字体大小”辅助选项来进行缩放
ScreenUtil().setSp(28,false) //传入字体大小,不会根据系统的“字体大小”辅助选项来进行缩放
ScreenUtil().setSp(28) //传入字体大小,不根据系统的“字体大小”辅助选项来进行缩放
ScreenUtil().setSp(28,true) //传入字体大小,会根据系统的“字体大小”辅助选项来进行缩放
for example:
Text(
...
...
example/pubspec.lock
View file @
013e862
...
...
@@ -47,7 +47,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.4.
1
"
version: "0.4.
2
"
flutter_test:
dependency: "direct dev"
description: flutter
...
...
lib/flutter_screenutil.dart
View file @
013e862
...
...
@@ -87,7 +87,7 @@ class ScreenUtil {
///@param fontSize 传入设计稿上字体的px ,
///@param allowFontScaling 控制字体是否要根据系统的“字体大小”辅助选项来进行缩放。默认值为true。
///@param allowFontScaling Specifies whether fonts should scale to respect Text Size accessibility settings. The default is true.
setSp
(
int
fontSize
,
[
allowFontScaling
=
tru
e
])
=>
allowFontScaling
setSp
(
int
fontSize
,
[
allowFontScaling
=
fals
e
])
=>
allowFontScaling
?
setWidth
(
fontSize
)
*
_textScaleFactor
:
setWidth
(
fontSize
);
}
...
...
pubspec.yaml
View file @
013e862
name
:
flutter_screenutil
description
:
A flutter plugin for adapting screen and font size.Guaranteed to look good on different models
version
:
0.4.
2
version
:
0.4.
3
author
:
LiZhuoyuan <zhuoyuan93@gmail.com>
homepage
:
https://github.com/OpenFlutter/flutter_ScreenUtil
...
...
Please
register
or
login
to post a comment