File tree Expand file tree Collapse file tree 4 files changed +7
-12
lines changed Expand file tree Collapse file tree 4 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ class _ChooseLocationState extends State<ChooseLocation> {
4040 flag: 'assets/images/indonesia.png' ),
4141 WorldTime (
4242 url: 'Africa/Johannesburg' ,
43- location: 'Johannesburg ' ,
43+ location: 'Cape Town ' ,
4444 flag: 'assets/images/sa.png' ),
4545 WorldTime (
4646 url: 'Africa/Johannesburg' ,
Original file line number Diff line number Diff line change @@ -59,13 +59,6 @@ class _HomeState extends State<Home> {
5959 Row (
6060 mainAxisAlignment: MainAxisAlignment .center,
6161 children: [
62- Image .asset (
63- (data['flag' ]),
64- height: 15 ,
65- ),
66- SizedBox (
67- width: 10 ,
68- ),
6962 Text (
7063 '${data ['location' ]}' ,
7164 style: TextStyle (
Original file line number Diff line number Diff line change @@ -12,7 +12,9 @@ class _LoadingState extends State<Loading> {
1212
1313 void setupWorldTime () async {
1414 WorldTime current = new WorldTime (
15- location: 'Berlin' , flag: 'germany.png' , url: 'Europe/Berlin' );
15+ url: 'Africa/Johannesburg' ,
16+ location: 'Cape Town' ,
17+ flag: 'assets/images/sa.png' );
1618 await current.getTime ();
1719 Navigator .pushReplacementNamed (context, '/home' , arguments: {
1820 'location' : current.location,
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ class WorldTime {
77 String time;
88 String flag; // url to asset flag icon
99 String url; // endpoint
10- bool isDaytime;
10+ bool isDaytime = true ;
1111
1212 WorldTime ({this .location, this .flag, this .url});
1313
@@ -22,9 +22,9 @@ class WorldTime {
2222 DateTime now = DateTime .parse (dateTime);
2323 now = now.add (new Duration (hours: int .parse (offset)));
2424
25- this . isDaytime = (now.hour > 6 && now.hour < 20 ) ? true : false ;
25+ isDaytime = (now.hour > 6 && now.hour < 20 ) ? true : false ;
2626
27- this . time = DateFormat .jm ().format (now);
27+ time = DateFormat .jm ().format (now);
2828 } catch (e) {
2929 print (e);
3030 this .time = 'Could not get a time value' ;
You can’t perform that action at this time.
0 commit comments