LiZhuoyuan

fix #244

@@ -203,7 +203,7 @@ Column( @@ -203,7 +203,7 @@ Column(
203 style: TextStyle( 203 style: TextStyle(
204 color: Colors.black, 204 color: Colors.black,
205 fontSize: ScreenUtil() 205 fontSize: ScreenUtil()
206 - .setSp(24, allowFontScalingSelf: true))), 206 + .setSp(24))),
207 ], 207 ],
208 ) 208 )
209 ``` 209 ```
@@ -55,7 +55,6 @@ class MyApp extends StatelessWidget { @@ -55,7 +55,6 @@ class MyApp extends StatelessWidget {
55 //填入设计稿中设备的屏幕尺寸,单位dp 55 //填入设计稿中设备的屏幕尺寸,单位dp
56 return ScreenUtilInit( 56 return ScreenUtilInit(
57 designSize: Size(360, 690), 57 designSize: Size(360, 690),
58 - allowFontScaling: false,  
59 builder: () => MaterialApp( 58 builder: () => MaterialApp(
60 debugShowCheckedModeBanner: false, 59 debugShowCheckedModeBanner: false,
61 title: 'Flutter_ScreenUtil', 60 title: 'Flutter_ScreenUtil',
@@ -188,7 +187,7 @@ height:200.h @@ -188,7 +187,7 @@ height:200.h
188 传入设计稿的字体大小: 187 传入设计稿的字体大小:
189 188
190 ```dart 189 ```dart
191 -//传入字体大小(单位和初始化时的单位保持一致),默认不根据系统的“字体大小”辅助选项来进行缩放(可在初始化ScreenUtil时设置allowFontScaling) 190 +//传入字体大小(单位和初始化时的单位保持一致)
192 ScreenUtil().setSp(28) 191 ScreenUtil().setSp(28)
193 192
194 28.sp (dart sdk>=2.6) 193 28.sp (dart sdk>=2.6)
@@ -201,13 +200,12 @@ Column( @@ -201,13 +200,12 @@ Column(
201 Text('我的文字大小在设计稿上是24dp,不会随着系统的文字缩放比例变化', 200 Text('我的文字大小在设计稿上是24dp,不会随着系统的文字缩放比例变化',
202 style: TextStyle( 201 style: TextStyle(
203 color: Colors.black, 202 color: Colors.black,
204 - fontSize: ScreenUtil().setSp(24), 203 + fontSize: 24.sp,
205 )), 204 )),
206 Text('我的文字大小在设计稿上是24dp,会随着系统的文字缩放比例变化', 205 Text('我的文字大小在设计稿上是24dp,会随着系统的文字缩放比例变化',
207 style: TextStyle( 206 style: TextStyle(
208 color: Colors.black, 207 color: Colors.black,
209 - fontSize: ScreenUtil()  
210 - .setSp(24, allowFontScalingSelf: true))), 208 + fontSize: 24.sp)),
211 ], 209 ],
212 ) 210 )
213 ``` 211 ```
@@ -94,7 +94,6 @@ class _HomePageState extends State<HomePage> { @@ -94,7 +94,6 @@ class _HomePageState extends State<HomePage> {
94 maxWidth: MediaQuery.of(context).size.width, 94 maxWidth: MediaQuery.of(context).size.width,
95 maxHeight: MediaQuery.of(context).size.height), 95 maxHeight: MediaQuery.of(context).size.height),
96 designSize: Size(360, 690), 96 designSize: Size(360, 690),
97 - allowFontScaling: false,  
98 orientation: Orientation.portrait); 97 orientation: Orientation.portrait);
99 return Scaffold(); 98 return Scaffold();
100 } 99 }
@@ -203,7 +202,7 @@ Column( @@ -203,7 +202,7 @@ Column(
203 style: TextStyle( 202 style: TextStyle(
204 color: Colors.black, 203 color: Colors.black,
205 fontSize: ScreenUtil() 204 fontSize: ScreenUtil()
206 - .setSp(24, allowFontScalingSelf: true))), 205 + .setSp(24))),
207 ], 206 ],
208 ) 207 )
209 ``` 208 ```
@@ -126,7 +126,6 @@ class _ExampleWidgetState extends State<ExampleWidget> { @@ -126,7 +126,6 @@ class _ExampleWidgetState extends State<ExampleWidget> {
126 onPressed: () { 126 onPressed: () {
127 ScreenUtil.init( 127 ScreenUtil.init(
128 designSize: Size(1500, 1334), 128 designSize: Size(1500, 1334),
129 - allowFontScaling: false,  
130 ); 129 );
131 setState(() {}); 130 setState(() {});
132 }, 131 },