File tree Expand file tree Collapse file tree 3 files changed +29
-5
lines changed
lib/src/screens/components Expand file tree Collapse file tree 3 files changed +29
-5
lines changed Original file line number Diff line number Diff line change 1
1
import 'package:flutter/material.dart' ;
2
+ import 'package:intl/intl.dart' ;
2
3
import 'clock.dart' ;
3
4
import 'country_card.dart' ;
4
5
import 'time_in_hour_and_minute.dart' ;
5
6
6
7
class Body extends StatelessWidget {
7
8
@override
8
9
Widget build (BuildContext context) {
10
+ DateFormat format = DateFormat ('hh:mm' );
11
+
9
12
return SafeArea (
10
13
child: SizedBox (
11
14
width: double .infinity,
@@ -25,18 +28,38 @@ class Body extends StatelessWidget {
25
28
children: [
26
29
CountryCard (
27
30
country: "New York, USA" ,
28
- timeZone: "+3 HRS | EST" ,
31
+ timeZone: "UTC -5 | EST" ,
29
32
iconSrc: "assets/icons/Liberty.svg" ,
30
- time: "9:20" ,
33
+ time: format.format (
34
+ DateTime .now ().subtract (
35
+ Duration (hours: 11 ),
36
+ ),
37
+ ),
31
38
period: "PM" ,
32
39
),
33
40
CountryCard (
34
41
country: "Sydney, AU" ,
35
- timeZone: "+19 HRS | AEST" ,
42
+ timeZone: "UTC +10 | AEST" ,
43
+ iconSrc: "assets/icons/Sydney.svg" ,
44
+ time: format.format (
45
+ DateTime .now ().add (
46
+ Duration (hours: 3 ),
47
+ ),
48
+ ),
49
+ period: "AM" ,
50
+ ),
51
+ CountryCard (
52
+ country: "HongKong, China" ,
53
+ timeZone: "UTC +8 | EA" ,
36
54
iconSrc: "assets/icons/Sydney.svg" ,
37
- time: "1:20" ,
55
+ time: format.format (
56
+ DateTime .now ().add (
57
+ Duration (hours: 1 ),
58
+ ),
59
+ ),
38
60
period: "AM" ,
39
61
),
62
+ SizedBox (width: 12.0 ),
40
63
],
41
64
),
42
65
),
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ packages:
145
145
source: hosted
146
146
version: "3.1.4"
147
147
intl:
148
- dependency: transitive
148
+ dependency: "direct main"
149
149
description:
150
150
name: intl
151
151
url: "https://pub.dartlang.org"
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ dependencies:
33
33
get : ^3.13.3
34
34
get_storage : ^1.4.0
35
35
flutter_icons :
36
+ intl : ^0.16.0
36
37
37
38
dev_dependencies :
38
39
flutter_test :
You can’t perform that action at this time.
0 commit comments