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-04-20 13:50:21 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
16c059fe0f5960aab1d93daf2497546782b5448a
16c059fe
1 parent
736727c0
update readme
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
10 deletions
README.md
README_CN.md
README_PT.md
example/ios/Flutter/flutter_export_environment.sh
example/ios/Runner.xcodeproj/project.pbxproj
example/lib/main.dart
README.md
View file @
16c059f
...
...
@@ -49,15 +49,36 @@ class MyApp extends StatelessWidget {
//Set the fit size (fill in the screen size of the device in the design,in dp)
return
ScreenUtilInit
(
designSize:
Size
(
360
,
690
),
allowFontScaling:
false
,
builder:
()
=>
MaterialApp
(
...
theme:
ThemeData
(
primarySwatch:
Colors
.
blue
,
textTheme:
TextTheme
(
//To support the following, you need to use the first initialization method
button:
TextStyle
(
fontSize:
45
.
sp
)
),
),
),
);
}
}
```
The second way:Does not support the use of font adaptation in the App
The second way:Does not support font adaptation in the textTheme of MaterialApp's theme.
not support this:
```
dart
MaterialApp
(
...
theme:
ThemeData
(
textTheme:
TextTheme
(
//To support the following, you need to use the first initialization method
button:
TextStyle
(
fontSize:
45
.
sp
)
),
),
)
```
```
dart
class
MyApp
extends
StatelessWidget
{
@override
...
...
README_CN.md
View file @
16c059f
...
...
@@ -55,20 +55,24 @@ class MyApp extends StatelessWidget {
//填入设计稿中设备的屏幕尺寸,单位dp
return
ScreenUtilInit
(
designSize:
Size
(
360
,
690
),
allowFontScaling:
false
,
builder:
()
=>
MaterialApp
(
debugShowCheckedModeBanner:
false
,
title:
'Flutter_ScreenUtil'
,
theme:
ThemeData
(
primarySwatch:
Colors
.
blue
,
),
primarySwatch:
Colors
.
blue
,
//要支持下面这个需要使用第一种初始化方式
textTheme:
TextTheme
(
button:
TextStyle
(
fontSize:
45
.
sp
)
),
),
home:
HomePage
(
title:
'FlutterScreenUtil Demo'
),
),
);
}
}
```
方式二: 不支持在App中使用字体适配
方式二: 不支持在MaterialApp的theme的textTheme中使用字体适配
```
class MyApp extends StatelessWidget {
@override
...
...
README_PT.md
View file @
16c059f
...
...
@@ -55,12 +55,20 @@ class MyApp extends StatelessWidget {
designSize:
Size
(
360
,
690
),
builder:
()
=>
MaterialApp
(
...
theme:
ThemeData
(
primarySwatch:
Colors
.
blue
,
//To support the following, you need to use the first initialization method
textTheme:
TextTheme
(
button:
TextStyle
(
fontSize:
45
.
sp
)
),
),
),
);
}
}
```
The second way:Does not support the use of font adaptation in the App
The second way:Does not support font adaptation in the textTheme of MaterialApp's theme.
```
class MyApp extends StatelessWidget {
@override
...
...
example/ios/Flutter/flutter_export_environment.sh
View file @
16c059f
...
...
@@ -5,9 +5,11 @@ export "FLUTTER_APPLICATION_PATH=/Users/lizhuoyuan/Development/Project/flutter_s
export
"FLUTTER_TARGET=lib/main.dart"
export
"FLUTTER_BUILD_DIR=build"
export
"SYMROOT=
${
SOURCE_ROOT
}
/../build/ios"
export
"OTHER_LDFLAGS=
$(
inherited
)
-framework Flutter"
export
"FLUTTER_FRAMEWORK_DIR=/Users/lizhuoyuan/Development/flutter/bin/cache/artifacts/engine/ios-release"
export
"FLUTTER_BUILD_NAME=1.0.0"
export
"FLUTTER_BUILD_NUMBER=1"
export
"DART_OBFUSCATION=false"
export
"TRACK_WIDGET_CREATION=false"
export
"TREE_SHAKE_ICONS=
fals
e"
export
"TREE_SHAKE_ICONS=
tru
e"
export
"PACKAGE_CONFIG=.packages"
...
...
example/ios/Runner.xcodeproj/project.pbxproj
View file @
16c059f
...
...
@@ -144,6 +144,8 @@
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = HW92UC978N;
ProvisioningStyle = Automatic;
};
};
};
...
...
@@ -350,8 +352,10 @@
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM =
""
;
DEVELOPMENT_TEAM =
HW92UC978N
;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
...
...
@@ -365,6 +369,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = li.zhuoyuan.example;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
...
...
@@ -375,7 +380,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM =
E4T4EJGC8Z
;
DEVELOPMENT_TEAM =
HW92UC978N
;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
...
...
example/lib/main.dart
View file @
16c059f
...
...
@@ -14,6 +14,9 @@ class MyApp extends StatelessWidget {
title:
'Flutter_ScreenUtil'
,
theme:
ThemeData
(
primarySwatch:
Colors
.
blue
,
textTheme:
TextTheme
(
button:
TextStyle
(
fontSize:
45
.
sp
)
),
),
builder:
(
context
,
widget
)
{
return
MediaQuery
(
...
...
Please
register
or
login
to post a comment