Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
李卓原 committed Apr 20, 2021
1 parent 736727c commit 16c059f
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 10 deletions.
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion README_PT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion example/ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=false"
export "TREE_SHAKE_ICONS=true"
export "PACKAGE_CONFIG=.packages"
9 changes: 7 additions & 2 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = HW92UC978N;
ProvisioningStyle = Automatic;
};
};
};
Expand Down Expand Up @@ -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)",
Expand All @@ -365,6 +369,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = li.zhuoyuan.example;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
Expand All @@ -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)",
Expand Down
3 changes: 3 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 16c059f

Please sign in to comment.