Showing
1 changed file
with
13 additions
and
13 deletions
@@ -39,15 +39,16 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | @@ -39,15 +39,16 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
39 | 39 | ||
40 | ### Property | 40 | ### Property |
41 | 41 | ||
42 | -| Property | Type | Default Value | Description | | ||
43 | -| --------------- | ------------- | -------------- | ---------------------------------------------------------------------- | | ||
44 | -| deviceSize | Size | null | The size of the physical device | | ||
45 | -| designSize | Size | Size(360, 690) | The size of the device screen in the design draft, in dp | | ||
46 | -| builder | WidgetBuilder | (*required*) | Generally returning a Function of MaterialApp type | | ||
47 | -| orientation | Orientation | portrait | screen orientation | | ||
48 | -| splitScreenMode | bool | false | support for split screen | | ||
49 | -| minTextAdapt | bool | false | Whether to adapt the text according to the minimum of width and height | | ||
50 | -| context | BuildContext | null | Get physical device data if not provided, by MediaQuery.of(context) | | 42 | +| Property | Type | Default Value | Description | |
43 | +| --------------- | ------------ | ------------- | ---------------------------------------------------------------------- | | ||
44 | +| deviceSize | Size | null | The size of the physical device | | ||
45 | +| designSize | Size | Size(360,690) | The size of the device screen in the design draft, in dp | | ||
46 | +| builder | Function | null | Generally returning a Function of MaterialApp type | | ||
47 | +| child | Widget | null | A part of builder that never being rebuilt | | ||
48 | +| orientation | Orientation | portrait | screen orientation | | ||
49 | +| splitScreenMode | bool | false | support for split screen | | ||
50 | +| minTextAdapt | bool | false | Whether to adapt the text according to the minimum of width and height | | ||
51 | +| context | BuildContext | null | Get physical device data if not provided, by MediaQuery.of(context) | | ||
51 | 52 | ||
52 | ### Initialize and set the fit size and font size to scale according to the system's "font size" accessibility option | 53 | ### Initialize and set the fit size and font size to scale according to the system's "font size" accessibility option |
53 | 54 | ||
@@ -66,20 +67,19 @@ class MyApp extends StatelessWidget { | @@ -66,20 +67,19 @@ class MyApp extends StatelessWidget { | ||
66 | designSize: Size(360, 690), | 67 | designSize: Size(360, 690), |
67 | minTextAdapt: true, | 68 | minTextAdapt: true, |
68 | splitScreenMode: true, | 69 | splitScreenMode: true, |
69 | - builder: (_) { | 70 | + builder: (child) { |
70 | return MaterialApp( | 71 | return MaterialApp( |
71 | debugShowCheckedModeBanner: false, | 72 | debugShowCheckedModeBanner: false, |
72 | - // Use this line to prevent extra rebuilds | ||
73 | - useInheritedMediaQuery: true, | ||
74 | title: 'First Method', | 73 | title: 'First Method', |
75 | // You can use the library anywhere in the app even in theme | 74 | // You can use the library anywhere in the app even in theme |
76 | theme: ThemeData( | 75 | theme: ThemeData( |
77 | primarySwatch: Colors.blue, | 76 | primarySwatch: Colors.blue, |
78 | textTheme: TextTheme(bodyText2: TextStyle(fontSize: 30.sp)), | 77 | textTheme: TextTheme(bodyText2: TextStyle(fontSize: 30.sp)), |
79 | ), | 78 | ), |
80 | - home: HomePage(title: 'First Method'), | 79 | + home: child, |
81 | ); | 80 | ); |
82 | }, | 81 | }, |
82 | + child: HomePage(title: 'First Method'), | ||
83 | ); | 83 | ); |
84 | } | 84 | } |
85 | } | 85 | } |
-
Please register or login to post a comment