Skip to content

Commit f195b3d

Browse files
committed
fix real timezone card country
1 parent 59f8b84 commit f195b3d

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

lib/src/screens/components/body.dart

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import 'package:flutter/material.dart';
2+
import 'package:intl/intl.dart';
23
import 'clock.dart';
34
import 'country_card.dart';
45
import 'time_in_hour_and_minute.dart';
56

67
class Body extends StatelessWidget {
78
@override
89
Widget build(BuildContext context) {
10+
DateFormat format = DateFormat('hh:mm');
11+
912
return SafeArea(
1013
child: SizedBox(
1114
width: double.infinity,
@@ -25,18 +28,38 @@ class Body extends StatelessWidget {
2528
children: [
2629
CountryCard(
2730
country: "New York, USA",
28-
timeZone: "+3 HRS | EST",
31+
timeZone: "UTC -5 | EST",
2932
iconSrc: "assets/icons/Liberty.svg",
30-
time: "9:20",
33+
time: format.format(
34+
DateTime.now().subtract(
35+
Duration(hours: 11),
36+
),
37+
),
3138
period: "PM",
3239
),
3340
CountryCard(
3441
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",
3654
iconSrc: "assets/icons/Sydney.svg",
37-
time: "1:20",
55+
time: format.format(
56+
DateTime.now().add(
57+
Duration(hours: 1),
58+
),
59+
),
3860
period: "AM",
3961
),
62+
SizedBox(width: 12.0),
4063
],
4164
),
4265
),

pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ packages:
145145
source: hosted
146146
version: "3.1.4"
147147
intl:
148-
dependency: transitive
148+
dependency: "direct main"
149149
description:
150150
name: intl
151151
url: "https://pub.dartlang.org"

pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ dependencies:
3333
get: ^3.13.3
3434
get_storage: ^1.4.0
3535
flutter_icons:
36+
intl: ^0.16.0
3637

3738
dev_dependencies:
3839
flutter_test:

0 commit comments

Comments
 (0)