Skip to content

Commit 4cd2d05

Browse files
committed
fix: issue nisrulz#1
1 parent c98848f commit 4cd2d05

File tree

1 file changed

+38
-37
lines changed

1 file changed

+38
-37
lines changed

stateless_widgets/lib/main.dart

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,42 @@ class MyApp extends StatelessWidget {
1717
final TextStyle myTextStyle =
1818
new TextStyle(color: Colors.grey, fontSize: myTextSize);
1919

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+
2056
return new Scaffold(
2157
appBar: new AppBar(
2258
title: new Text("Stateless Widget"),
@@ -25,46 +61,11 @@ class MyApp extends StatelessWidget {
2561
// Sets the padding in the main container
2662
padding: const EdgeInsets.only(bottom: 2.0),
2763
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),
6565
),
6666
),
6767
);
68+
;
6869
}
6970
}
7071

0 commit comments

Comments
 (0)