Skip to content

Commit a656943

Browse files
committed
Somewhat working in debug
1 parent 07237d2 commit a656943

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

lib/screens/choose_location.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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',

lib/screens/home.dart

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff 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(

lib/screens/loading.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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,

lib/services/world_time.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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';

0 commit comments

Comments
 (0)