WJG

fix #196, #209

... ... @@ -50,7 +50,7 @@ class MyApp extends StatelessWidget {
return ScreenUtilInit(
designSize: Size(360, 690),
allowFontScaling: false,
child: MaterialApp(
builder: () => MaterialApp(
...
),
);
... ...
... ... @@ -58,7 +58,7 @@ class MyApp extends StatelessWidget {
return ScreenUtilInit(
designSize: Size(360, 690),
allowFontScaling: false,
child: MaterialApp(
builder: () => MaterialApp(
...
),
);
... ...
... ... @@ -54,7 +54,7 @@ class MyApp extends StatelessWidget {
return ScreenUtilInit(
designSize: Size(360, 690),
allowFontScaling: false,
child: MaterialApp(
builder: () => MaterialApp(
...
),
);
... ...
... ... @@ -10,7 +10,7 @@ class MyApp extends StatelessWidget {
return ScreenUtilInit(
designSize: Size(360, 690),
allowFontScaling: false,
child: MaterialApp(
builder: () => MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter_ScreenUtil',
theme: ThemeData(
... ...
... ... @@ -10,7 +10,7 @@ class MyApp extends StatelessWidget {
return ScreenUtilInit(
designSize: Size(750, 1334),
allowFontScaling: false,
child: MaterialApp(
builder: () => MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter_ScreenUtil',
theme: ThemeData(
... ...
... ... @@ -5,13 +5,13 @@ import 'screenutil.dart';
class ScreenUtilInit extends StatelessWidget {
/// A helper widget that initializes [ScreenUtil]
ScreenUtilInit({
required this.child,
required this.builder,
this.designSize = ScreenUtil.defaultSize,
this.allowFontScaling = false,
Key? key,
}) : super(key: key);
final Widget child;
final Widget Function() builder;
/// The [Size] of the device in the design draft, in dp
final Size designSize;
... ... @@ -31,7 +31,7 @@ class ScreenUtilInit extends StatelessWidget {
allowFontScaling: allowFontScaling,
);
}
return child;
return builder();
},
);
}
... ...