@@ -17,6 +17,42 @@ class MyApp extends StatelessWidget {
17
17
final TextStyle myTextStyle =
18
18
new TextStyle (color: Colors .grey, fontSize: myTextSize);
19
19
20
+ var column = new Column (
21
+ // Makes the cards stretch in horizontal axis
22
+ crossAxisAlignment: CrossAxisAlignment .stretch,
23
+ children: < Widget > [
24
+ // Setup the card
25
+ new MyCard (
26
+ // Setup the text
27
+ title: new Text (
28
+ "Favorite" ,
29
+ style: myTextStyle,
30
+ ),
31
+ // Setup the icon
32
+ icon:
33
+ new Icon (Icons .favorite, size: myIconSize, color: Colors .red)),
34
+ new MyCard (
35
+ title: new Text (
36
+ "Alarm" ,
37
+ style: myTextStyle,
38
+ ),
39
+ icon: new Icon (Icons .alarm, size: myIconSize, color: Colors .blue)),
40
+ new MyCard (
41
+ title: new Text (
42
+ "Airport Shuttle" ,
43
+ style: myTextStyle,
44
+ ),
45
+ icon: new Icon (Icons .airport_shuttle,
46
+ size: myIconSize, color: Colors .amber)),
47
+ new MyCard (
48
+ title: new Text (
49
+ "Done" ,
50
+ style: myTextStyle,
51
+ ),
52
+ icon: new Icon (Icons .done, size: myIconSize, color: Colors .green)),
53
+ ],
54
+ );
55
+
20
56
return new Scaffold (
21
57
appBar: new AppBar (
22
58
title: new Text ("Stateless Widget" ),
@@ -25,46 +61,11 @@ class MyApp extends StatelessWidget {
25
61
// Sets the padding in the main container
26
62
padding: const EdgeInsets .only (bottom: 2.0 ),
27
63
child: new Center (
28
- child: new Column (
29
- // Makes the cards stretch in horizontal axis
30
- crossAxisAlignment: CrossAxisAlignment .stretch,
31
- children: < Widget > [
32
- // Setup the card
33
- new MyCard (
34
- // Setup the text
35
- title: new Text (
36
- "Favorite" ,
37
- style: myTextStyle,
38
- ),
39
- // Setup the icon
40
- icon: new Icon (Icons .favorite,
41
- size: myIconSize, color: Colors .red)),
42
- new MyCard (
43
- title: new Text (
44
- "Alarm" ,
45
- style: myTextStyle,
46
- ),
47
- icon: new Icon (Icons .alarm,
48
- size: myIconSize, color: Colors .blue)),
49
- new MyCard (
50
- title: new Text (
51
- "Airport Shuttle" ,
52
- style: myTextStyle,
53
- ),
54
- icon: new Icon (Icons .airport_shuttle,
55
- size: myIconSize, color: Colors .amber)),
56
- new MyCard (
57
- title: new Text (
58
- "Done" ,
59
- style: myTextStyle,
60
- ),
61
- icon: new Icon (Icons .done,
62
- size: myIconSize, color: Colors .green)),
63
- ],
64
- ),
64
+ child: new SingleChildScrollView (child: column),
65
65
),
66
66
),
67
67
);
68
+ ;
68
69
}
69
70
}
70
71
0 commit comments