@@ -13,39 +13,63 @@ class _HomeState extends State<Home> {
1313 data = ModalRoute .of (context).settings.arguments;
1414
1515 print (data);
16+
17+ String bgImage = (data['isDaytime' ])
18+ ? 'assets/images/day.png'
19+ : 'assets/images/night.png' ;
20+
21+ Color bgCol = (data['isDaytime' ]) ? Colors .blue : Colors .indigo[700 ];
1622 return Scaffold (
23+ backgroundColor: bgCol,
1724 body: SafeArea (
18- child: Padding (
19- padding: EdgeInsets .fromLTRB (0 , 120 , 0 , 0 ),
20- child: Column (
21- children: [
22- FlatButton .icon (
23- onPressed: () {
24- Navigator .pushNamed (context, '/location' );
25- },
26- icon: Icon (Icons .edit_location),
27- label: Text ('Edit Location' )),
28- SizedBox (height: 20 ),
29- Row (
30- mainAxisAlignment: MainAxisAlignment .center,
31- children: [
32- Text (
33- '${data ['location' ]}' ,
34- style: TextStyle (
35- fontSize: 28.0 ,
36- letterSpacing: 2.0 ,
25+ child: Container (
26+ decoration: BoxDecoration (
27+ image: DecorationImage (
28+ image: AssetImage (bgImage),
29+ fit: BoxFit .cover,
30+ )),
31+ child: Padding (
32+ padding: EdgeInsets .fromLTRB (0 , 120 , 0 , 0 ),
33+ child: Column (
34+ children: [
35+ FlatButton .icon (
36+ onPressed: () {
37+ Navigator .pushNamed (context, '/location' );
38+ },
39+ icon: Icon (
40+ Icons .edit_location,
41+ color: Colors .grey[300 ],
3742 ),
38- ),
39- ],
40- ),
41- SizedBox (height: 20 ),
42- Text (
43- data['time' ],
44- style: TextStyle (
45- fontSize: 66 ,
43+ label: Text (
44+ 'Edit Location' ,
45+ style: TextStyle (
46+ color: Colors .grey[300 ],
47+ ),
48+ )),
49+ SizedBox (height: 20 ),
50+ Row (
51+ mainAxisAlignment: MainAxisAlignment .center,
52+ children: [
53+ Text (
54+ '${data ['location' ]}' ,
55+ style: TextStyle (
56+ fontSize: 28.0 ,
57+ letterSpacing: 2.0 ,
58+ color: Colors .white,
59+ ),
60+ ),
61+ ],
4662 ),
47- )
48- ],
63+ SizedBox (height: 20 ),
64+ Text (
65+ data['time' ],
66+ style: TextStyle (
67+ fontSize: 66 ,
68+ color: Colors .white,
69+ ),
70+ )
71+ ],
72+ ),
4973 ),
5074 )),
5175 );
0 commit comments