File tree Expand file tree Collapse file tree 6 files changed +8
-8
lines changed Expand file tree Collapse file tree 6 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ class MyApp extends StatelessWidget {
50
50
return ScreenUtilInit(
51
51
designSize: Size(360, 690),
52
52
allowFontScaling: false,
53
- child: MaterialApp(
53
+ builder: () => MaterialApp(
54
54
...
55
55
),
56
56
);
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ class MyApp extends StatelessWidget {
58
58
return ScreenUtilInit(
59
59
designSize: Size(360, 690),
60
60
allowFontScaling: false,
61
- child: MaterialApp(
61
+ builder: () => MaterialApp(
62
62
...
63
63
),
64
64
);
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ class MyApp extends StatelessWidget {
54
54
return ScreenUtilInit(
55
55
designSize: Size(360, 690),
56
56
allowFontScaling: false,
57
- child: MaterialApp(
57
+ builder: () => MaterialApp(
58
58
...
59
59
),
60
60
);
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ class MyApp extends StatelessWidget {
10
10
return ScreenUtilInit (
11
11
designSize: Size (360 , 690 ),
12
12
allowFontScaling: false ,
13
- child : MaterialApp (
13
+ builder : () => MaterialApp (
14
14
debugShowCheckedModeBanner: false ,
15
15
title: 'Flutter_ScreenUtil' ,
16
16
theme: ThemeData (
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ class MyApp extends StatelessWidget {
10
10
return ScreenUtilInit (
11
11
designSize: Size (750 , 1334 ),
12
12
allowFontScaling: false ,
13
- child : MaterialApp (
13
+ builder : () => MaterialApp (
14
14
debugShowCheckedModeBanner: false ,
15
15
title: 'Flutter_ScreenUtil' ,
16
16
theme: ThemeData (
Original file line number Diff line number Diff line change @@ -5,13 +5,13 @@ import 'screenutil.dart';
5
5
class ScreenUtilInit extends StatelessWidget {
6
6
/// A helper widget that initializes [ScreenUtil]
7
7
ScreenUtilInit ({
8
- required this .child ,
8
+ required this .builder ,
9
9
this .designSize = ScreenUtil .defaultSize,
10
10
this .allowFontScaling = false ,
11
11
Key ? key,
12
12
}) : super (key: key);
13
13
14
- final Widget child ;
14
+ final Widget Function () builder ;
15
15
16
16
/// The [Size] of the device in the design draft, in dp
17
17
final Size designSize;
@@ -31,7 +31,7 @@ class ScreenUtilInit extends StatelessWidget {
31
31
allowFontScaling: allowFontScaling,
32
32
);
33
33
}
34
- return child ;
34
+ return builder () ;
35
35
},
36
36
);
37
37
}
You can’t perform that action at this time.
0 commit comments