Skip to content

Commit 98f8bd8

Browse files
author
Sergi Martínez
committed
Lesson 3: Planets-Flutter: adding content to the card
1 parent 0f51363 commit 98f8bd8

File tree

13 files changed

+180
-33
lines changed

13 files changed

+180
-33
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ Each lesson will correspond to a single branch with the name of the post where y
77
Remember all the graphical assets and the design is created by Vijay Verma
88

99
* Lesson 1: [Planets-Flutter: From design to app](http://sergiandreplace.com/2017/09/planets-flutter-from-design-to-app/)
10-
* Lesson 2: [Planets-Flutter: creating a Planet card](http://sergiandreplace.com/2017/09/planets-flutter-creating-a-planet-card/)
10+
* Lesson 2: [Planets-Flutter: creating a Planet card](http://sergiandreplace.com/2017/09/planets-flutter-creating-a-planet-card/)
11+
* Lesson 3: [Planets-Flutter: adding content to the card](http://sergiandreplace/2017/10/planets-flutter-adding-content-to-the-card/)

assets/fonts/Poppins-Regular.ttf

142 KB
Binary file not shown.

assets/img/earth.png

17.1 KB
Loading

assets/img/ic_distance.png

18.3 KB
Loading

assets/img/ic_gravity.png

17.9 KB
Loading

assets/img/mercury.png

18.8 KB
Loading

assets/img/moon.png

14.9 KB
Loading

assets/img/neptune.png

16.1 KB
Loading

lib/model/planets.dart

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
class Planet {
2+
final String id;
3+
final String name;
4+
final String location;
5+
final String distance;
6+
final String gravity;
7+
final String description;
8+
final String image;
9+
10+
const Planet({this.id, this.name, this.location, this.distance, this.gravity,
11+
this.description, this.image});
12+
}
13+
14+
List<Planet> planets = [
15+
const Planet(
16+
id: "1",
17+
name: "Mars",
18+
location: "Milkyway Galaxy",
19+
distance: "54.6m Km",
20+
gravity: "3.711 m/s ",
21+
description: "Lorem ipsum...",
22+
image: "assets/img/mars.png",
23+
),
24+
const Planet(
25+
id: "2",
26+
name: "Neptune",
27+
location: "Milkyway Galaxy",
28+
distance: "54.6m Km",
29+
gravity: "3.711 m/s ",
30+
description: "Lorem ipsum...",
31+
image: "assets/img/neptune.png",
32+
),
33+
const Planet(
34+
id: "3",
35+
name: "Moon",
36+
location: "Milkyway Galaxy",
37+
distance: "54.6m Km",
38+
gravity: "3.711 m/s ",
39+
description: "Lorem ipsum...",
40+
image: "assets/img/moon.png",
41+
),
42+
const Planet(
43+
id: "4",
44+
name: "Earth",
45+
location: "Milkyway Galaxy",
46+
distance: "54.6m Km",
47+
gravity: "3.711 m/s ",
48+
description: "Lorem ipsum...",
49+
image: "assets/img/earth.png",
50+
),
51+
const Planet(
52+
id: "5",
53+
name: "Mercury",
54+
location: "Milkyway Galaxy",
55+
distance: "54.6m Km",
56+
gravity: "3.711 m/s ",
57+
description: "Lorem ipsum...",
58+
image: "assets/img/mercury.png",
59+
),
60+
];

lib/ui/home/home_page.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ class HomePage extends StatelessWidget {
1010
children: <Widget>[
1111
new GradientAppBar("treva"),
1212
new HomePageBody(),
13-
new HomePageBody(),
14-
new HomePageBody(),
1513
],
1614
),
1715
);

0 commit comments

Comments
 (0)