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
李卓原
2021-03-11 11:42:32 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f9908fb2ec58c591e1d2481a36e572186a913eef
f9908fb2
1 parent
df0c80c4
5.0.0-nullsafety.8
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
5 deletions
CHANGELOG.md
lib/screen_util.dart
lib/screenutil_init.dart
pubspec.yaml
CHANGELOG.md
View file @
f9908fb
# 5.0.0-nullsafety.8
-
merge v4
-
Add a method to get the screen orientation
# 5.0.0-nullsafety.7
-
fix #221
...
...
lib/screen_util.dart
View file @
f9908fb
...
...
@@ -125,7 +125,12 @@ class ScreenUtil {
///Font size adaptation method
///- [fontSize] The size of the font on the UI design, in dp.
///- [allowFontScaling]
double
setSp
(
num
fontSize
,
{
bool
?
allowFontScalingSelf
})
=>
allowFontScalingSelf
==
null
?
(
allowFontScaling
?
(
fontSize
*
scaleText
)
*
_textScaleFactor
:
(
fontSize
*
scaleText
))
:
(
allowFontScalingSelf
?
(
fontSize
*
scaleText
)
*
_textScaleFactor
:
(
fontSize
*
scaleText
));
double
setSp
(
num
fontSize
,
{
bool
?
allowFontScalingSelf
})
=>
allowFontScalingSelf
==
null
?
(
allowFontScaling
?
(
fontSize
*
scaleText
)
*
_textScaleFactor
:
(
fontSize
*
scaleText
))
:
(
allowFontScalingSelf
?
(
fontSize
*
scaleText
)
*
_textScaleFactor
:
(
fontSize
*
scaleText
));
}
...
...
lib/screenutil_init.dart
View file @
f9908fb
import
'package:flutter/material.dart'
;
import
'package:flutter_screenutil/screen_util.dart'
;
class
ScreenUtilInit
extends
StatelessWidget
{
/// A helper widget that initializes [ScreenUtil]
ScreenUtilInit
({
...
...
pubspec.yaml
View file @
f9908fb
name
:
flutter_screenutil
description
:
A flutter plugin for adapting screen and font size.Guaranteed to look good on different models
version
:
5.0.0-nullsafety.
7
version
:
5.0.0-nullsafety.
8
homepage
:
https://github.com/OpenFlutter/flutter_screenutil
environment
:
...
...
Please
register
or
login
to post a comment