@@ -7,12 +7,14 @@ import 'package:flutter/cupertino.dart';
7
7
import 'package:flutter/material.dart' ;
8
8
9
9
void main () {
10
- runApp (Demo ());
10
+ runApp (const Demo ());
11
11
}
12
12
13
13
// The same content is shown for both the main app target and in the App
14
14
// Clip.
15
15
class Demo extends StatefulWidget {
16
+ const Demo ({Key key}) : super (key: key);
17
+
16
18
@override
17
19
State <StatefulWidget > createState () => _DemoState ();
18
20
}
@@ -22,7 +24,7 @@ class _DemoState extends State<Demo> {
22
24
23
25
@override
24
26
void initState () {
25
- DeviceInfoPlugin ().iosInfo.then ((IosDeviceInfo info) {
27
+ DeviceInfoPlugin ().iosInfo.then ((info) {
26
28
setState (() {
27
29
deviceInfo = '${info .name } on ${info .systemName } version '
28
30
'${info .systemVersion }' ;
@@ -35,16 +37,16 @@ class _DemoState extends State<Demo> {
35
37
Widget build (BuildContext context) {
36
38
return CupertinoApp (
37
39
home: CupertinoPageScaffold (
38
- navigationBar: CupertinoNavigationBar (
40
+ navigationBar: const CupertinoNavigationBar (
39
41
middle: Text ('App Clip' ),
40
42
),
41
43
child: Center (
42
44
child: Column (
43
45
mainAxisAlignment: MainAxisAlignment .center,
44
46
children: < Widget > [
45
47
Text (deviceInfo),
46
- Padding (padding: EdgeInsets .only (top: 18 )),
47
- FlutterLogo (size: 128 ),
48
+ const Padding (padding: EdgeInsets .only (top: 18 )),
49
+ const FlutterLogo (size: 128 ),
48
50
],
49
51
),
50
52
),
0 commit comments