李卓原

2.3

@@ -19,17 +19,11 @@ class MyApp extends StatelessWidget { @@ -19,17 +19,11 @@ class MyApp extends StatelessWidget {
19 } 19 }
20 } 20 }
21 21
22 -class MyHomePage extends StatefulWidget {  
23 - @override  
24 - _MyHomePageState createState() => _MyHomePageState();  
25 -}  
26 -  
27 -class _MyHomePageState extends State<MyHomePage> { 22 +class MyHomePage extends StatelessWidget {
28 @override 23 @override
29 Widget build(BuildContext context) { 24 Widget build(BuildContext context) {
30 //Set the fit size (fill in the screen size of the device in the design) If the design is based on the size of the iPhone6 ​​(iPhone6 ​​750*1334) 25 //Set the fit size (fill in the screen size of the device in the design) If the design is based on the size of the iPhone6 ​​(iPhone6 ​​750*1334)
31 ScreenUtil.init(context, width: 750, height: 1334, allowFontScaling: false); 26 ScreenUtil.init(context, width: 750, height: 1334, allowFontScaling: false);
32 -  
33 return ExampleWidget(title: 'FlutterScreenUtil Demo'); 27 return ExampleWidget(title: 'FlutterScreenUtil Demo');
34 } 28 }
35 } 29 }
@@ -46,7 +40,7 @@ class ExampleWidget extends StatefulWidget { @@ -46,7 +40,7 @@ class ExampleWidget extends StatefulWidget {
46 class _ExampleWidgetState extends State<ExampleWidget> { 40 class _ExampleWidgetState extends State<ExampleWidget> {
47 @override 41 @override
48 Widget build(BuildContext context) { 42 Widget build(BuildContext context) {
49 - //printScreenInformation(); 43 + printScreenInformation();
50 return Scaffold( 44 return Scaffold(
51 appBar: AppBar( 45 appBar: AppBar(
52 title: Text(widget.title), 46 title: Text(widget.title),