diff --git a/README.md b/README.md
index 291d6ec..15972e1 100644
--- a/README.md
+++ b/README.md
@@ -1,18 +1,28 @@
-# COVID 19
+# Fight Covid-19
-
-
-
+
+
+
+
+
+
+
+
+
+
## About
-- The application provides users with relevant data from across the globe and about each specific country.
-- Provides Prevent Do's and Don'ts information to the user
+- Provides user with relevant data from across the globe and about each specific country.
+- Prevention with Do's and Don'ts information
+- A list of all Covid-19 Symptoms
+- Myth busters to always segregate the facts from the myths
+- Frequently Asked Questions to be get all your answers
### Follow the roadmap
-##### You can follow the roadmap from [here](ROADMAP.md), and (let me know your suggestions)
+##### You can follow the roadmap from [here](ROADMAP.md) (let us know your suggestions)
### Contributing
@@ -20,8 +30,23 @@ Check out [CONTRIBUTING.md](CONTRIBUTING.md), which contains a guide for those w
### Data Source
+**API**
This Application gets data from [Covid19API](https://covid19api.com/) created by [Kyle Redelinghuys](https://twitter.com/ksredelinghuys)
+**Prevention Infographic**
+Data sourced from [Visme](https://visme.co/blog/coronavirus-prevention) authored by [Chloe West](http://www.chloesocial.com) with permission from the Author
+
+**COVID-19 Infographic**
+Data sourced from [Visme](https://visme.co/blog/what-is-coronavirus) authored by [Mahnoor Sheikh](www.mahnoorsheikh.com) with permission from the Author
+
+**Symptom Icons**
+Data sourced from [Freepik](https://www.freepik.com/free-photos-vectors/health)
+
+**Myth Busters**
+Data sourced from [WHO](https://www.who.int/emergencies/diseases/novel-coronavirus-2019/advice-for-public/myth-busters) and [MyGovIndia](https://twitter.com/mygovindia/status/1248645463110062080)
+
### Design
-This Application uses [this](https://dribbble.com/shots/10828411-COVID-19) as design reference created by [Samad Sam](https://dribbble.com/Samadsam)
\ No newline at end of file
+This Application uses [this](https://dribbble.com/shots/10828411-COVID-19) as design reference created by [Samad Sam](https://dribbble.com/Samadsam)
+
+The Design is tweakwed to add more functionality to the application which can be found [here](https://www.figma.com/file/d63yhEbhKvthDvYKfLtM21/Boilerplate-COVID19)
\ No newline at end of file
diff --git a/ROADMAP.md b/ROADMAP.md
index b3622ad..92a64ad 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -5,15 +5,19 @@
- [x] Daily and Weekly Statistics
-- [ ] Do the Five Information Section - [Check Here](https://www.who.int/news-room/detail/23-03-2020-pass-the-message-five-steps-to-kicking-out-coronavirus)
+- [x] Daily Growth
-- [ ] Symptom Checker
+- [x] Do the Five Information Section - [Check Here](https://www.who.int/news-room/detail/23-03-2020-pass-the-message-five-steps-to-kicking-out-coronavirus)
-- [ ] Offline Support to display the last queried information
+- [ ] Symptom Checker
+
+- [x] Symptoms Information
+
+- [x] Offline Support to display the last queried information
- [ ] Detailed Information about each country
-- [ ] Myth Buster
+- [x] Myth Buster
- [ ] Donation links for the government funds (Country Sepcific)
diff --git a/android/app/build.gradle b/android/app/build.gradle
index 52bef79..d96808d 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -38,7 +38,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
- applicationId "com.example.covid19"
+ applicationId "in.boilerplate.covid19"
minSdkVersion 18
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 3669157..a546792 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -8,7 +8,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..7353dbd
--- /dev/null
+++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..7353dbd
--- /dev/null
+++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
index db77bb4..515c48e 100644
Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..c69e539
Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
index 17987b7..48752f3 100644
Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..2e19525
Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
index 09d4391..8f8098e 100644
Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..e7e36cb
Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
index d5f1c8d..4e5950e 100644
Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..003bf38
Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
index 4d6372e..78f8d0c 100644
Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..723ebc0
Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/android/app/src/main/res/values/ic_launcher_background.xml b/android/app/src/main/res/values/ic_launcher_background.xml
new file mode 100644
index 0000000..362e4f7
--- /dev/null
+++ b/android/app/src/main/res/values/ic_launcher_background.xml
@@ -0,0 +1,4 @@
+
+
+ #1C1D3C
+
\ No newline at end of file
diff --git a/assets/animations/splash.gif b/assets/animations/splash.gif
deleted file mode 100644
index 558135f..0000000
Binary files a/assets/animations/splash.gif and /dev/null differ
diff --git a/assets/images/fact.png b/assets/images/fact.png
new file mode 100644
index 0000000..cc0ab28
Binary files /dev/null and b/assets/images/fact.png differ
diff --git a/assets/images/faq.png b/assets/images/faq.png
new file mode 100644
index 0000000..b2b705f
Binary files /dev/null and b/assets/images/faq.png differ
diff --git a/assets/images/latest-numbers.png b/assets/images/latest-numbers.png
deleted file mode 100644
index 0cd4d43..0000000
Binary files a/assets/images/latest-numbers.png and /dev/null differ
diff --git a/assets/images/myth.png b/assets/images/myth.png
new file mode 100644
index 0000000..04d67e8
Binary files /dev/null and b/assets/images/myth.png differ
diff --git a/assets/images/splash.jpg b/assets/images/splash.jpg
new file mode 100644
index 0000000..9c02815
Binary files /dev/null and b/assets/images/splash.jpg differ
diff --git a/assets/images/statistics.png b/assets/images/statistics.png
new file mode 100644
index 0000000..8d58693
Binary files /dev/null and b/assets/images/statistics.png differ
diff --git a/assets/images/virus.png b/assets/images/virus.png
index 69f8d61..a37e018 100644
Binary files a/assets/images/virus.png and b/assets/images/virus.png differ
diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id
new file mode 100644
index 0000000..c4b65e3
--- /dev/null
+++ b/ios/Flutter/.last_build_id
@@ -0,0 +1 @@
+8fbbdbe09471cf6b84240d355bc28488
\ No newline at end of file
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
index c32843e..c376f15 100644
--- a/ios/Runner.xcodeproj/project.pbxproj
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -307,7 +307,6 @@
/* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
@@ -375,17 +374,17 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
- PRODUCT_BUNDLE_IDENTIFIER = in.boilerplate.dev.covid19;
+ PRODUCT_BUNDLE_IDENTIFIER = in.boilerplate.covid19;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = 1;
VERSIONING_SYSTEM = "apple-generic";
};
name = Profile;
};
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
@@ -441,7 +440,6 @@
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
@@ -510,11 +508,12 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
- PRODUCT_BUNDLE_IDENTIFIER = in.boilerplate.dev.covid19;
+ PRODUCT_BUNDLE_IDENTIFIER = in.boilerplate.covid19;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = 1;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
@@ -538,10 +537,11 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
- PRODUCT_BUNDLE_IDENTIFIER = in.boilerplate.dev.covid19;
+ PRODUCT_BUNDLE_IDENTIFIER = in.boilerplate.covid19;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = 1;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
index d36b1fa..ebccd94 100644
--- a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
+++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -1,122 +1,68 @@
{
"images" : [
{
- "size" : "20x20",
+ "filename" : "icon-ios-20@2x.png",
"idiom" : "iphone",
- "filename" : "Icon-App-20x20@2x.png",
- "scale" : "2x"
+ "scale" : "2x",
+ "size" : "20x20"
},
{
- "size" : "20x20",
+ "filename" : "icon-ios-20@3x.png",
"idiom" : "iphone",
- "filename" : "Icon-App-20x20@3x.png",
- "scale" : "3x"
+ "scale" : "3x",
+ "size" : "20x20"
},
{
- "size" : "29x29",
+ "filename" : "icon-ios-29@1x.png",
"idiom" : "iphone",
- "filename" : "Icon-App-29x29@1x.png",
- "scale" : "1x"
+ "scale" : "1x",
+ "size" : "29x29"
},
{
- "size" : "29x29",
+ "filename" : "icon-ios-29@2x.png",
"idiom" : "iphone",
- "filename" : "Icon-App-29x29@2x.png",
- "scale" : "2x"
+ "scale" : "2x",
+ "size" : "29x29"
},
{
- "size" : "29x29",
+ "filename" : "icon-ios-29@3x.png",
"idiom" : "iphone",
- "filename" : "Icon-App-29x29@3x.png",
- "scale" : "3x"
+ "scale" : "3x",
+ "size" : "29x29"
},
{
- "size" : "40x40",
+ "filename" : "icon-ios-40@2x.png",
"idiom" : "iphone",
- "filename" : "Icon-App-40x40@2x.png",
- "scale" : "2x"
+ "scale" : "2x",
+ "size" : "40x40"
},
{
- "size" : "40x40",
+ "filename" : "icon-ios-40@3x.png",
"idiom" : "iphone",
- "filename" : "Icon-App-40x40@3x.png",
- "scale" : "3x"
+ "scale" : "3x",
+ "size" : "40x40"
},
{
- "size" : "60x60",
+ "filename" : "icon-ios-60@2x.png",
"idiom" : "iphone",
- "filename" : "Icon-App-60x60@2x.png",
- "scale" : "2x"
+ "scale" : "2x",
+ "size" : "60x60"
},
{
- "size" : "60x60",
+ "filename" : "icon-ios-60@3x.png",
"idiom" : "iphone",
- "filename" : "Icon-App-60x60@3x.png",
- "scale" : "3x"
+ "scale" : "3x",
+ "size" : "60x60"
},
{
- "size" : "20x20",
- "idiom" : "ipad",
- "filename" : "Icon-App-20x20@1x.png",
- "scale" : "1x"
- },
- {
- "size" : "20x20",
- "idiom" : "ipad",
- "filename" : "Icon-App-20x20@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "29x29",
- "idiom" : "ipad",
- "filename" : "Icon-App-29x29@1x.png",
- "scale" : "1x"
- },
- {
- "size" : "29x29",
- "idiom" : "ipad",
- "filename" : "Icon-App-29x29@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "40x40",
- "idiom" : "ipad",
- "filename" : "Icon-App-40x40@1x.png",
- "scale" : "1x"
- },
- {
- "size" : "40x40",
- "idiom" : "ipad",
- "filename" : "Icon-App-40x40@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "76x76",
- "idiom" : "ipad",
- "filename" : "Icon-App-76x76@1x.png",
- "scale" : "1x"
- },
- {
- "size" : "76x76",
- "idiom" : "ipad",
- "filename" : "Icon-App-76x76@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "83.5x83.5",
- "idiom" : "ipad",
- "filename" : "Icon-App-83.5x83.5@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "1024x1024",
+ "filename" : "icon-ios-1024@1x.png",
"idiom" : "ios-marketing",
- "filename" : "Icon-App-1024x1024@1x.png",
- "scale" : "1x"
+ "scale" : "1x",
+ "size" : "1024x1024"
}
],
"info" : {
- "version" : 1,
- "author" : "xcode"
+ "author" : "xcode",
+ "version" : 1
}
}
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
deleted file mode 100644
index dc9ada4..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
deleted file mode 100644
index 28c6bf0..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
deleted file mode 100644
index 2ccbfd9..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
deleted file mode 100644
index f091b6b..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
deleted file mode 100644
index 4cde121..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
deleted file mode 100644
index d0ef06e..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
deleted file mode 100644
index dcdc230..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
deleted file mode 100644
index 2ccbfd9..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
deleted file mode 100644
index c8f9ed8..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
deleted file mode 100644
index a6d6b86..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
deleted file mode 100644
index a6d6b86..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
deleted file mode 100644
index 75b2d16..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
deleted file mode 100644
index c4df70d..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
deleted file mode 100644
index 6a84f41..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
deleted file mode 100644
index d0e1f58..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-1024@1x.png
new file mode 100644
index 0000000..59fcfc8
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-1024@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-20@2x.png
new file mode 100644
index 0000000..ccf3d7d
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-20@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-20@3x.png
new file mode 100644
index 0000000..15a9a4e
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-20@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-29@1x.png
new file mode 100644
index 0000000..d960bf0
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-29@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-29@2x.png
new file mode 100644
index 0000000..900fc87
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-29@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-29@3x.png
new file mode 100644
index 0000000..2c82bc0
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-29@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-40@2x.png
new file mode 100644
index 0000000..efc16ef
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-40@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-40@3x.png
new file mode 100644
index 0000000..bef12b3
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-40@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-60@2x.png
new file mode 100644
index 0000000..bef12b3
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-60@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-60@3x.png
new file mode 100644
index 0000000..cd5fb36
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-ios-60@3x.png differ
diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard
index f3c2851..a89818a 100644
--- a/ios/Runner/Base.lproj/Main.storyboard
+++ b/ios/Runner/Base.lproj/Main.storyboard
@@ -1,8 +1,10 @@
-
-
+
+
+
-
+
+
@@ -14,13 +16,14 @@
-
+
-
+
+
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index bfe5e2c..5db35d9 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -11,7 +11,7 @@
CFBundleInfoDictionaryVersion
6.0
CFBundleName
- covid19
+ Fight Covid-19
CFBundlePackageType
APPL
CFBundleShortVersionString
@@ -31,8 +31,6 @@
UISupportedInterfaceOrientations
UIInterfaceOrientationPortrait
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
UISupportedInterfaceOrientations~ipad
diff --git a/lib/constants/colors.dart b/lib/constants/colors.dart
index 8390b43..b9fa9d6 100644
--- a/lib/constants/colors.dart
+++ b/lib/constants/colors.dart
@@ -9,6 +9,8 @@ class AppColors {
static const Color accentColor = Color(0xFFDC1D7D);
static const Color secondaryAccentColor = Color(0xFF8D5FC2);
+ static const Color splashColor = Color(0xFF1C1D3C);
+
static const Color transparentColor = Color(0x00000000);
static const Color whiteColor = Color(0xFFFFFFFF);
@@ -27,11 +29,15 @@ class AppColors {
static const Color accentBlueColor = Color(0xFF8ECFFF);
- static const Color orangeColor = Color(0xFFFF9800);
+ static const Color confirmedColor = Color(0xFFFF9800);
+
+ static const Color recoveredColor = Color(0xFF4CAF50);
+
+ static const Color deadColor = Color(0xFFF44336);
- static const Color greenColor = Color(0xFF4CAF50);
+ static const Color mythColor = Color(0xFFD95F6C);
- static const Color redColor = Color(0xFFF44336);
+ static const Color factColor = Color(0xFF6FCF97);
static const Color preventionBackgroundColor = Color(0xFF337CE3);
}
diff --git a/lib/constants/strings.dart b/lib/constants/strings.dart
index 713a8d9..542d63c 100644
--- a/lib/constants/strings.dart
+++ b/lib/constants/strings.dart
@@ -1,8 +1,9 @@
class Strings {
Strings._(); // this basically makes it so you can instantiate this class
- // TODO :- Please think of a better name as the application will be expanded to be more than a tracker
- static const appName = 'Covid-19';
+ static const appName = 'Fight Covid-19';
+
+ static const appSlogan = 'Together, we can \nFight Covid-19';
static const noInternetErrorTitle = 'No Internet Connection';
@@ -21,10 +22,10 @@ class Strings {
static const countryDialogSearch = 'Search for Country';
/// ------------------------------------------------------
- /// Font Styles for Statistics and StatisticsLoadingWidget
- /// used in (ui/statistics) and (ui/statistics/widgets)
+ /// Strings for Home
+ /// used in (ui/home/home_screen.dart) and (ui/home/widgets)
///
- static const latestNumbersTitle = 'Latest Numbers';
+ static const statisticsTitle = 'Statistics';
static const preventionTitle = 'Prevention';
@@ -32,8 +33,12 @@ class Strings {
static const mythBusterTitle = 'Myth Busters';
+ static const faqTitle = 'FAQ';
+
+ static const covidInformationTitle = 'What is Covid-19';
+
/// ------------------------------------------------------
- /// Font Styles for Statistics and StatisticsLoadingWidget
+ /// Strings for Statistics and StatisticsLoadingWidget
/// used in (ui/statistics) and (ui/statistics/widgets)
///
static const outbreakTitle = 'Current Outbreak';
@@ -55,8 +60,14 @@ class Strings {
static const symptomCheckerDesc =
'Contains several list of questions to check whetehr your physical condition';
+ static const dailyStatiscsLable = 'Daily';
+
+ static const weeklyStatiscsLable = 'Weekly';
+
+ static const dailyGrowthStatiscsLable = 'Daily Growth';
+
/// ------------------------------------------------------
- /// Font Styles for SymptomChecker
+ /// Strings for SymptomChecker
/// used in (ui/symptomChecker) and (ui/symptomChecker/widgets)
///
static const questiionsTitle = 'Questions';
@@ -65,7 +76,7 @@ class Strings {
'This test is not endorsed by any medical professional and is only a means to be aware of your symptoms and get timely help';
/// ------------------------------------------------------
- /// Font Styles for PreventionScreen
+ /// Strings for PreventionScreen
/// used in (ui/preventionScreen)
///
static const dataSource = 'Data Source';
@@ -77,5 +88,12 @@ class Strings {
static const writtenBy = ' written By ';
- static const author = 'Chloe West';
+ static const authorPrevetnionGraphic = 'Chloe West';
+
+ /// ------------------------------------------------------
+ /// Strings for InformationScreen
+ /// used in (ui/preventionScreen)
+ //
+
+ static const authorInformationGraphic = 'Mahnoor Sheikh';
}
diff --git a/lib/constants/text_styles.dart b/lib/constants/text_styles.dart
index e68d9fd..348731e 100644
--- a/lib/constants/text_styles.dart
+++ b/lib/constants/text_styles.dart
@@ -80,7 +80,7 @@ class TextStyles {
///
static const homeCardTitle = TextStyle(
fontWeight: FontWeight.w700,
- color: AppColors.whiteColor,
+ color: AppColors.blackColor,
);
/// ------------------------------------------------------
@@ -96,4 +96,18 @@ class TextStyles {
fontWeight: FontWeight.w500,
color: AppColors.offWhiteColor,
);
+
+ /// ------------------------------------------------------
+ /// Font Styles for FAQ
+ /// used in (ui/faq/faq_screen.darr) and (ui/faq/widgets)
+ ///
+ static const faqHeadingTextStyle = TextStyle(
+ fontWeight: FontWeight.w700,
+ color: AppColors.accentBlackColor,
+ );
+
+ static const faqBodyTextStyle = TextStyle(
+ fontWeight: FontWeight.w400,
+ color: AppColors.accentBlackColor,
+ );
}
diff --git a/lib/data/faq_data.dart b/lib/data/faq_data.dart
new file mode 100644
index 0000000..9977dd2
--- /dev/null
+++ b/lib/data/faq_data.dart
@@ -0,0 +1,121 @@
+import 'package:covid19/models/faq/faq_model.dart';
+
+List faqData = [
+ FAQModel(
+ title: 'What is a coronavirus?',
+ description:
+ 'Coronaviruses are a large family of viruses which may cause illness in animals or humans. In humans, several coronaviruses are known to cause respiratory infections ranging from the common cold to more severe diseases such as Middle East Respiratory Syndrome (MERS) and Severe Acute Respiratory Syndrome (SARS). The most recently discovered coronavirus causes coronavirus disease COVID-19.',
+ ),
+ FAQModel(
+ title: 'What is COVID-19?',
+ description:
+ 'COVID-19 is the infectious disease caused by the most recently discovered coronavirus. This new virus and disease were unknown before the outbreak began in Wuhan, China, in December 2019.',
+ ),
+ FAQModel(
+ title: 'What are the symptoms of COVID-19?',
+ description:
+ 'The most common symptoms of COVID-19 are fever, tiredness, and dry cough. Some patients may have aches and pains, nasal congestion, runny nose, sore throat or diarrhea. These symptoms are usually mild and begin gradually. Some people become infected but don’t develop any symptoms and don\'t feel unwell. Most people (about 80%) recover from the disease without needing special treatment. Around 1 out of every 6 people who gets COVID-19 becomes seriously ill and develops difficulty breathing. Older people, and those with underlying medical problems like high blood pressure, heart problems or diabetes, are more likely to develop serious illness. People with fever, cough and difficulty breathing should seek medical attention.',
+ ),
+ FAQModel(
+ title: 'How does COVID-19 spread?',
+ description:
+ 'People can catch COVID-19 from others who have the virus. The disease can spread from person to person through small droplets from the nose or mouth which are spread when a person with COVID-19 coughs or exhales. These droplets land on objects and surfaces around the person. Other people then catch COVID-19 by touching these objects or surfaces, then touching their eyes, nose or mouth. People can also catch COVID-19 if they breathe in droplets from a person with COVID-19 who coughs out or exhales droplets. This is why it is important to stay more than 1 meter (3 feet) away from a person who is sick.',
+ ),
+ FAQModel(
+ title: 'Can COVID-19 be transmitted through air?',
+ description:
+ 'Studies to date suggest that the virus that causes COVID-19 is mainly transmitted through contact with respiratory droplets rather than through the air. See previous answer on “How does COVID-19 spread?”',
+ ),
+ FAQModel(
+ title: 'Can COVID-19 be caught from a person who has no symptoms?',
+ description:
+ 'The main way the disease spreads is through respiratory droplets expelled by someone who is coughing. The risk of catching COVID-19 from someone with no symptoms at all is very low. However, many people with COVID-19 experience only mild symptoms. This is particularly true at the early stages of the disease. It is therefore possible to catch COVID-19 from someone who has, for example, just a mild cough and does not feel ill.',
+ ),
+ FAQModel(
+ title: 'Can I catch COVID-19 from the feces of someone with the disease?',
+ description:
+ 'The risk of catching COVID-19 from the feces of an infected person appears to be low. While initial investigations suggest the virus may be present in feces in some cases, spread through this route is not a main feature of the outbreak. WHO is assessing ongoing research on the ways COVID-19 is spread and will continue to share new findings. Because this is a risk, however, it is another reason to clean hands regularly, after using the bathroom and before eating.',
+ ),
+ FAQModel(
+ title: 'What can I do to protect myself and prevent the spread of disease?',
+ description:
+ 'Stay aware of the latest information on the COVID-19 outbreak, available on the WHO website and through your national and local public health authority. Many countries around the world have seen cases of COVID-19 and several have seen outbreaks. Authorities in China and some other countries have succeeded in slowing or stopping their outbreaks. However, the situation is unpredictable so check regularly for the latest news. Check "Prevention" tab on Home for more Information',
+ ),
+ FAQModel(
+ title: 'How likely am I to catch COVID-19?',
+ description:
+ 'The risk depends on where you are - and more specifically, whether there is a COVID-19 outbreak unfolding there.\nFor most people in most locations the risk of catching COVID-19 is still low. However, there are now places around the world (cities or areas) where the disease is spreading. For people living in, or visiting, these areas the risk of catching COVID-19 is higher. Governments and health authorities are taking vigorous action every time a new case of COVID-19 is identified. Be sure to comply with any local restrictions on travel, movement or large gatherings. Cooperating with disease control efforts will reduce your risk of catching or spreading COVID-19.',
+ ),
+ FAQModel(
+ title: 'Should I worry about COVID-19?',
+ description:
+ 'Illness due to COVID-19 infection is generally mild, especially for children and young adults. However, it can cause serious illness: about 1 in every 5 people who catch it need hospital care. It is therefore quite normal for people to worry about how the COVID-19 outbreak will affect them and their loved ones.\nWe can channel our concerns into actions to protect ourselves, our loved ones and our communities. First and foremost among these actions is regular and thorough hand-washing and good respiratory hygiene. Secondly, keep informed and follow the advice of the local health authorities including any restrictions put in place on travel, movement and gatherings.',
+ ),
+ FAQModel(
+ title: 'Who is at risk of developing severe illness?',
+ description:
+ 'While we are still learning about how COVID-2019 affects people, older persons and persons with pre-existing medical conditions (such as high blood pressure, heart disease, lung disease, cancer or diabetes) appear to develop serious illness more often than others.',
+ ),
+ FAQModel(
+ title: 'Are antibiotics effective in preventing or treating the COVID-19?',
+ description:
+ 'No. Antibiotics do not work against viruses, they only work on bacterial infections. COVID-19 is caused by a virus, so antibiotics do not work. Antibiotics should not be used as a means of prevention or treatment of COVID-19. They should only be used as directed by a physician to treat a bacterial infection.',
+ ),
+ FAQModel(
+ title:
+ 'Are there any medicines or therapies that can prevent or cure COVID-19?',
+ description:
+ 'While some western, traditional or home remedies may provide comfort and alleviate symptoms of COVID-19, there is no evidence that current medicine can prevent or cure the disease. WHO does not recommend self-medication with any medicines, including antibiotics, as a prevention or cure for COVID-19. However, there are several ongoing clinical trials that include both western and traditional medicines.',
+ ),
+ FAQModel(
+ title: 'Is there a vaccine, drug or treatment for COVID-19?',
+ description:
+ 'Not yet. To date, there is no vaccine and no specific antiviral medicine to prevent or treat COVID-2019. However, those affected should receive care to relieve symptoms. People with serious illness should be hospitalized. Most patients recover thanks to supportive care.',
+ ),
+ FAQModel(
+ title: 'Is COVID-19 the same as SARS?',
+ description:
+ 'No. The virus that causes COVID-19 and the one that caused the outbreak of Severe Acute Respiratory Syndrome (SARS) in 2003 are related to each other genetically, but the diseases they cause are quite different.\nSARS was more deadly but much less infectious than COVID-19. There have been no outbreaks of SARS anywhere in the world since 2003.',
+ ),
+ FAQModel(
+ title: 'Should I wear a mask to protect myself?',
+ description:
+ 'Only wear a mask if you are ill with COVID-19 symptoms (especially coughing) or looking after someone who may have COVID-19. Disposable face mask can only be used once. If you are not ill or looking after someone who is ill then you are wasting a mask. There is a world-wide shortage of masks, so WHO urges people to use masks wisely.',
+ ),
+ FAQModel(
+ title: 'How long is the incubation period for COVID-19?',
+ description:
+ 'The “incubation period” means the time between catching the virus and beginning to have symptoms of the disease. Most estimates of the incubation period for COVID-19 range from 1-14 days, most commonly around five days. These estimates will be updated as more data become available.',
+ ),
+ FAQModel(
+ title: 'Can I catch COVID-19 from my pet?',
+ description:
+ 'There is a possibility for some animals to become infected through close contact with infected humans. Further evidence is needed to understand if animals and pets can spread the disease.\nBased on current evidence, human to human transmission remains the main driver.',
+ ),
+ FAQModel(
+ title: 'How long does the virus survive on surfaces?',
+ description:
+ 'It is not certain how long the virus that causes COVID-19 survives on surfaces, but it seems to behave like other coronaviruses. Studies suggest that coronaviruses (including preliminary information on the COVID-19 virus) may persist on surfaces for a few hours or up to several days. This may vary under different conditions (e.g. type of surface, temperature or humidity of the environment).',
+ ),
+ FAQModel(
+ title:
+ 'Is it safe to receive a package from any area where COVID-19 has been reported?',
+ description:
+ 'Yes. The likelihood of an infected person contaminating commercial goods is low and the risk of catching the virus that causes COVID-19 from a package that has been moved, travelled, and exposed to different conditions and temperature is also low.',
+ ),
+ FAQModel(
+ title: 'Can COVID-19 be spread through coins and banknotes?',
+ description:
+ 'There is currently no evidence to confirm or disprove that COVID-19 virus can be transmitted through coins or banknotes. However, respiratory droplets expelled from an infected person can contaminate and persist on surfaces. Wash your hands regularly and thoroughly after touching any frequently-touched surface or object, including coins or banknotes. Avoid touching your eyes, mouth and nose, if your hands are not cleaned.',
+ ),
+ FAQModel(
+ title: 'How can I grocery shop safely in the time of COVID-19?',
+ description:
+ 'When grocery shopping, keep at least 1-metre distance from others and avoid touching your eyes, mouth and nose. If possible, sanitize the handles of shopping trolleys or baskets before shopping. Once home, wash your hands thoroughly and also after handling and storing your purchased products. There is currently no confirmed case of COVID-19 transmitted through food or food packaging.',
+ ),
+ FAQModel(
+ title: 'How to wash fruits and vegetables in the time of COVID-19?',
+ description:
+ 'Fruits and vegetables are essential components of a healthy diet. Wash them the same way you would in any other circumstance. Before handling them, wash your hands with soap and water. Then, wash fruits and vegetables thoroughly with clean water, especially if you eat them raw.',
+ ),
+];
diff --git a/lib/data/myth_buster_data.dart b/lib/data/myth_buster_data.dart
new file mode 100644
index 0000000..a9f7746
--- /dev/null
+++ b/lib/data/myth_buster_data.dart
@@ -0,0 +1,118 @@
+import 'package:covid19/models/mythBuster/myth_buster_model.dart';
+
+List mythBusterData = [
+ MythBusterModel(
+ myth:
+ 'Antibiotics are effective in treating and preventing the new coronavirus?',
+ fact:
+ 'No, antibiotics do not work against viruses, only bacteria. The new coronavirus (2019-nCOV) is a virus, therefore, antibiotics should not be used. However, if you are hospitalised for the 2019-nCOV, you may recieve antibiotics since bacterial co-infection is possible',
+ ),
+ MythBusterModel(
+ myth: 'The Incubation preiod is up to 5 days',
+ fact:
+ 'The "Incubation period" means the time between catching the virus and beginning to have symptoms of the disease. Most estimates of the incubation period for COVID-19 range from 1-14 days',
+ ),
+ MythBusterModel(
+ myth:
+ 'If you can hold your breath for 10 seconds without discomfort, you don\'t have COVID-19',
+ fact:
+ 'Holding your breath for more than 10 seconds without discomfort doeos not prove whether you are infected or not',
+ ),
+ MythBusterModel(
+ myth: 'I can catch COVID-19 from my pet',
+ fact:
+ 'While there has been instances of some animals, there is no evidence that dog, cat or any pet can transmit COVID-19',
+ ),
+ MythBusterModel(
+ myth: 'Heavy intake of Vitamin-C can help in curing corona infection',
+ fact:
+ 'Regular intake of Vitamin-C boosts immunity. However, excessive intake is not recommended',
+ ),
+ MythBusterModel(
+ myth: 'The new coronavirus affect older people',
+ fact:
+ 'People of all ages can be infected by the new coronavirus (nCov-2019). Older people, and people with pre-existing medical conditions (such as asthma, diabetes, heart disease) appear to be more vulnerable',
+ ),
+ MythBusterModel(
+ myth:
+ 'A viral post on social media claims that bitter groud juice can treat coronavirus',
+ fact: 'There is no such treatment',
+ ),
+ MythBusterModel(
+ myth: 'A moist throat can ensure protection from corona infection',
+ fact: 'There is no scientific evidence to support this claim',
+ ),
+ MythBusterModel(
+ myth: 'Sunlight can kill the new coronavirus',
+ fact:
+ 'According to WHO, there is no evidence to prove that sunlight kills the new coronavirus',
+ ),
+ MythBusterModel(
+ myth: 'Inhaling steam from hot water kills the coronavirus',
+ fact:
+ 'No, inhaling steam doesn\'t kill the coronavirus. Repsiratory hygiene, social distancing and washing hands are the effective measures to prevent COVID-19.',
+ ),
+ MythBusterModel(
+ myth: 'Coronavirus gets automatically destoryed in High temperature',
+ fact:
+ 'Given its novelty, it hasn\'t been proven yet if it gets destroyed in high temperature or not. Preventive measures must be followed until any further information is confirmed',
+ ),
+ MythBusterModel(
+ myth: 'Drinking alcohol protects one against COVID-19!',
+ fact:
+ 'Drinking alcohol doesn\'t protect one from COVID-19 and can be dangerous for one\'s health',
+ ),
+ MythBusterModel(
+ myth: 'Mosquito bites get one infected with COVID-19',
+ fact:
+ 'COVID-19 doesn\'t spread from mosquite bite but through droplets spread when an infected person sneezes',
+ ),
+ MythBusterModel(
+ myth: 'Getting the pneumonia vaccine, protects one against the virus',
+ fact:
+ 'It helps against pneumonia but doesn\'t have a protective effective against coronavirus',
+ ),
+ MythBusterModel(
+ myth: 'Having bath with hot water kills the virus',
+ fact:
+ 'The virus lives inside the body where the temperature is maintained at 37° & is not affected by the hot water bath',
+ ),
+ MythBusterModel(
+ myth:
+ 'WHO has advised against eating bakery items as they get infected with virus easily',
+ fact: 'WHO hasn\'t released any advisory regarding the same',
+ ),
+ MythBusterModel(
+ myth:
+ 'Regularly rinsing the nose with saline help prevent infection with the coronavirus',
+ fact:
+ 'There is no evidence that regularly rinsing the nose with saline has protected people from infection with the coronavirus',
+ ),
+ MythBusterModel(
+ myth: 'Cold weather and snow can kill the coronavirus',
+ fact:
+ 'There is no reason to believe that cold weather can kill the coronavirus',
+ ),
+ MythBusterModel(
+ myth:
+ 'Eating food cooked in mustard oil will protect you against coronavirus',
+ fact:
+ 'There\'s no such evidence that eating food cooked from mustard oil will protect you against coronavirus',
+ ),
+ MythBusterModel(
+ myth:
+ 'Spraying alcohol or chlorine all over your body can kill coronavirus',
+ fact:
+ 'No. Spraying alcohol or chlorine all over your body will not kill viruses that have already entered your body',
+ ),
+ MythBusterModel(
+ myth: 'An ultraviolent disinfection lamp can kill coronavirus',
+ fact:
+ 'UV lamps should not be used to steralize hands or other areas of skin as UV radiation can cause skin irritation',
+ ),
+ MythBusterModel(
+ myth: '5G Mobile networks spread COVID-19',
+ fact:
+ 'Viruses cannot travel on radio/mobile networks. COVID-19 is spreading in many countries that do not have 5G mobile networks.',
+ ),
+];
diff --git a/lib/data/network/constants/endpoints.dart b/lib/data/network/constants/endpoints.dart
index 7069499..fa7d017 100644
--- a/lib/data/network/constants/endpoints.dart
+++ b/lib/data/network/constants/endpoints.dart
@@ -7,14 +7,18 @@ class Endpoints {
// base url to retreieve user's country ISO2 code
static const baseUrlIPLookup = "https://ip.rootnet.in/lookup";
- // base url for Covid-19 prevention Infographic
- static const baseUrlPreventionInfographic =
- 'http://boilerplate.in/covid19/COVID-19-Prevention-Dos-and-Donts.jpg';
+ // base url for Home Screen Graphic
+ static const baseUrlGraphics = 'http://boilerplate.in/covid19';
- static const dataSourceReferenceURL =
+ static const preventionDataSourceReferenceURL =
'https://visme.co/blog/coronavirus-prevention';
- static const dataSourceAuthorURL = 'http://www.chloesocial.com/';
+ static const preventionDataSourceAuthorURL = 'http://www.chloesocial.com';
+
+ static const informationDataSourceReferenceURL =
+ 'https://visme.co/blog/what-is-coronavirus';
+
+ static const informationSourceAuthorURL = 'https://www.mahnoorsheikh.com';
// receiveTimeout
static const receiveTimeout = 5000;
@@ -28,9 +32,29 @@ class Endpoints {
// fetch Statistics about a particulr country
static const _fetchCountryStatistics = '/total/country/';
+ // fetch Covid-19 prevention Infographic
+ static const _fetchPreventionGraphic =
+ '/COVID-19-Prevention-Dos-and-Donts.jpg';
+
+ // fetch Covid-19 information Infographic
+ static const _fetchInformationGraphic =
+ '/COVID-19-A-Global-Health-Crisis.jpg';
+
+ // fetch Home graphic
+ static const _fetchHomeGraphic = '/home.png';
+
static String get fetchHomeData => baseUrlStatistics + _fetchHomeData;
static String get fetchCountryStatistics =>
baseUrlStatistics + _fetchCountryStatistics;
+
static String get fetchCurrentCountry => baseUrlIPLookup;
+
+ static String get fetchHomeGraphic => baseUrlGraphics + _fetchHomeGraphic;
+
+ static String get fetchPreventionGraphic =>
+ baseUrlGraphics + _fetchPreventionGraphic;
+
+ static String get fetchInformatiionGraphic =>
+ baseUrlGraphics + _fetchInformationGraphic;
}
diff --git a/lib/data/repository/base_repository.dart b/lib/data/repository/base_repository.dart
index c618095..951637e 100644
--- a/lib/data/repository/base_repository.dart
+++ b/lib/data/repository/base_repository.dart
@@ -18,7 +18,11 @@ abstract class BaseRepository {
/// Fetch Global Information and country specific information
Future fetchHomeData({@required String iso2});
- /// Fetch Statistics about the required country
- Future> fetchCountryStatistics(
+ /// Fetch Statistics about the required country - Confirmed Cases
+ Future> fetchCountryStatisticsConfirmed(
+ {@required String iso2});
+
+ /// Fetch Statistics about the required country - Confirmed Cases
+ Future> fetchCountryStatisticsRecovered(
{@required String iso2});
}
diff --git a/lib/data/repository/test_repository.dart b/lib/data/repository/test_repository.dart
index e15c2d2..6ac2033 100644
--- a/lib/data/repository/test_repository.dart
+++ b/lib/data/repository/test_repository.dart
@@ -70,7 +70,24 @@ class TestRepository implements BaseRepository {
}
@override
- Future> fetchCountryStatistics({String iso2}) async {
+ Future> fetchCountryStatisticsConfirmed(
+ {String iso2}) async {
+ return [
+ CountryStatistics(
+ country: "India",
+ countryCode: "IN",
+ lat: "20.59",
+ lon: "78.96",
+ cases: 0,
+ status: "confirmed",
+ date: "2020-01-22T00:00:00Z",
+ )
+ ];
+ }
+
+ @override
+ Future> fetchCountryStatisticsRecovered(
+ {String iso2}) async {
return [
CountryStatistics(
country: "India",
diff --git a/lib/data/repository/user_repository.dart b/lib/data/repository/user_repository.dart
index 20fe855..7e1631b 100644
--- a/lib/data/repository/user_repository.dart
+++ b/lib/data/repository/user_repository.dart
@@ -52,8 +52,9 @@ class UserRepository implements BaseRepository {
}
@override
- Future> fetchCountryStatistics({String iso2}) async {
- final List countryStatisticsList = [];
+ Future> fetchCountryStatisticsConfirmed(
+ {String iso2}) async {
+ final List countryStatisticsConfirmedList = [];
CountryStatistics countryStatistics;
final responseMap = await HttpRequestUtil.getRequest(
@@ -63,7 +64,7 @@ class UserRepository implements BaseRepository {
for (int i = 0; i < responseMap.length; i++) {
countryStatistics = CountryStatistics.fromJson(responseMap[i]);
- countryStatisticsList.add(
+ countryStatisticsConfirmedList.add(
CountryStatistics(
cases: countryStatistics.cases,
date: countryStatistics.date,
@@ -71,6 +72,30 @@ class UserRepository implements BaseRepository {
);
}
- return countryStatisticsList;
+ return countryStatisticsConfirmedList;
+ }
+
+ @override
+ Future> fetchCountryStatisticsRecovered(
+ {String iso2}) async {
+ final List countryStatisticsRecoveredList = [];
+ CountryStatistics countryStatistics;
+
+ final responseMap = await HttpRequestUtil.getRequest(
+ url: '${Endpoints.fetchCountryStatistics}$iso2/status/recovered',
+ shouldCache: true,
+ );
+
+ for (int i = 0; i < responseMap.length; i++) {
+ countryStatistics = CountryStatistics.fromJson(responseMap[i]);
+ countryStatisticsRecoveredList.add(
+ CountryStatistics(
+ cases: countryStatistics.cases,
+ date: countryStatistics.date,
+ ),
+ );
+ }
+
+ return countryStatisticsRecoveredList;
}
}
diff --git a/lib/data/symptoms_data.dart b/lib/data/symptoms_data.dart
new file mode 100644
index 0000000..3c417e9
--- /dev/null
+++ b/lib/data/symptoms_data.dart
@@ -0,0 +1,58 @@
+import 'package:covid19/models/symptoms/symptoms_model.dart';
+
+List symptomsData = [
+ SymptomsModel(
+ title: 'Dry Cough',
+ description:
+ 'Early studies have found that at least 60% of people with COVID-19 have a dry cough. About a third have a cough with mucus, called a “wet” or “productive” cough.',
+ imageURL: 'https://boilerplate.in/covid19/cough.png',
+ ),
+ SymptomsModel(
+ title: 'Fever',
+ description:
+ 'Your regular body temperature may be higher or lower than someone else’s. It also changes throughout the day. Doctors generally consider a fever in an adult to be anything over 100.4 F',
+ imageURL: 'https://boilerplate.in/covid19/fever.png',
+ ),
+ SymptomsModel(
+ title: 'Nasal Congestion',
+ description:
+ 'If you find yourself having to work harder than usual to breathe or need to breathe in before you’re done breathing out.',
+ imageURL: 'https://boilerplate.in/covid19/nasal-congestion.png',
+ ),
+ SymptomsModel(
+ title: 'Runny Nose',
+ description:
+ 'If you don’t have problems breathing, it might be the flu. You should still isolate yourself just in case.',
+ imageURL: 'https://boilerplate.in/covid19/runny-nose.png',
+ ),
+ SymptomsModel(
+ title: 'Sore Throat',
+ description:
+ 'Has been reported in rare cases, might not be important if lung-related symptoms or fever is not observed.',
+ imageURL: 'https://boilerplate.in/covid19/sore-throat.png',
+ ),
+ SymptomsModel(
+ title: 'Fatigue',
+ description:
+ 'Joint Pain and Exhuastion has also been noted in rare cases of COVID-19.',
+ imageURL: 'https://boilerplate.in/covid19/fatigue.png',
+ ),
+ SymptomsModel(
+ title: 'Tierdness',
+ description:
+ 'You might find yourself feeling dehydrated. Muscle soreness has also been noted in some cases.',
+ imageURL: 'https://boilerplate.in/covid19/tierdness.png',
+ ),
+ SymptomsModel(
+ title: 'Difficulty Breathing',
+ description:
+ 'You may find that you are nasally congested or worse, that you are always short of breath and finding it tougher to breathe in than to breathe out.',
+ imageURL: 'https://boilerplate.in/covid19/difficulty-breathing.png',
+ ),
+ SymptomsModel(
+ title: 'Headache',
+ description:
+ 'In rare cases, sharp headaches that persist for a short duration has been noted. These headaches are similar to migraine headaches.',
+ imageURL: 'https://boilerplate.in/covid19/headache.png',
+ ),
+];
diff --git a/lib/main.dart b/lib/main.dart
index 177e286..deddd58 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -139,7 +139,7 @@ class MyApp extends StatelessWidget {
AppStarted(context: context),
);
},
- image: AssetImage(AssetImages.noInternet),
+ image: const AssetImage(AssetImages.noInternet),
title: Strings.noInternetErrorDesc,
desc: Strings.noInternetErrorDesc,
actionText: Strings.retryButton,
@@ -168,7 +168,7 @@ class MyApp extends StatelessWidget {
AppStarted(context: context),
);
},
- image: AssetImage(AssetImages.genericError),
+ image: const AssetImage(AssetImages.genericError),
title: Strings.genericErrorTitle,
desc: Strings.genericErrorDesc,
actionText: Strings.retryButton,
diff --git a/lib/models/faq/faq_model.dart b/lib/models/faq/faq_model.dart
new file mode 100644
index 0000000..be6020e
--- /dev/null
+++ b/lib/models/faq/faq_model.dart
@@ -0,0 +1,13 @@
+import 'package:flutter/material.dart';
+
+class FAQModel {
+ final String title;
+ final String description;
+ bool isExpanded;
+
+ FAQModel({
+ @required this.title,
+ @required this.description,
+ this.isExpanded = false,
+ });
+}
diff --git a/lib/models/mythBuster/myth_buster_model.dart b/lib/models/mythBuster/myth_buster_model.dart
new file mode 100644
index 0000000..814785c
--- /dev/null
+++ b/lib/models/mythBuster/myth_buster_model.dart
@@ -0,0 +1,11 @@
+import 'package:flutter/material.dart';
+
+class MythBusterModel {
+ final String myth;
+ final String fact;
+
+ MythBusterModel({
+ @required this.myth,
+ @required this.fact,
+ });
+}
diff --git a/lib/models/symptoms/symptoms_model.dart b/lib/models/symptoms/symptoms_model.dart
new file mode 100644
index 0000000..e7a591a
--- /dev/null
+++ b/lib/models/symptoms/symptoms_model.dart
@@ -0,0 +1,13 @@
+import 'package:flutter/material.dart';
+
+class SymptomsModel {
+ final String title;
+ final String description;
+ final String imageURL;
+
+ SymptomsModel({
+ @required this.title,
+ @required this.description,
+ @required this.imageURL,
+ });
+}
diff --git a/lib/res/asset_animations.dart b/lib/res/asset_animations.dart
index d30eb3b..ec8655c 100644
--- a/lib/res/asset_animations.dart
+++ b/lib/res/asset_animations.dart
@@ -1,5 +1,3 @@
-//// Generated by spider on 2020-04-20 10:43:00.182784
+//// Generated by spider on 2020-04-23 23:00:37.073163
-class AssetAnimations {
- static const String splash = 'assets/animations/splash.gif';
-}
+class AssetAnimations {}
diff --git a/lib/res/asset_images.dart b/lib/res/asset_images.dart
index 6645cbb..c8a9f65 100644
--- a/lib/res/asset_images.dart
+++ b/lib/res/asset_images.dart
@@ -1,11 +1,15 @@
-//// Generated by spider on 2020-04-20 11:45:57.777930
+//// Generated by spider on 2020-04-24 02:55:22.224023
class AssetImages {
static const String noInternet = 'assets/images/no-internet.png';
+ static const String fact = 'assets/images/fact.png';
static const String mythBusters = 'assets/images/myth-busters.png';
static const String virus = 'assets/images/virus.png';
static const String prevention = 'assets/images/prevention.png';
+ static const String splash = 'assets/images/splash.jpg';
+ static const String statistics = 'assets/images/statistics.png';
static const String genericError = 'assets/images/generic-error.png';
- static const String latestNumbers = 'assets/images/latest-numbers.png';
+ static const String faq = 'assets/images/faq.png';
+ static const String myth = 'assets/images/myth.png';
static const String symptoms = 'assets/images/symptoms.png';
}
diff --git a/lib/stores/statistics/statistics_notifier.dart b/lib/stores/statistics/statistics_notifier.dart
index 517288c..92e432e 100644
--- a/lib/stores/statistics/statistics_notifier.dart
+++ b/lib/stores/statistics/statistics_notifier.dart
@@ -15,10 +15,12 @@ enum StatisticsState { loading, hasData, hasError, hasNetworkError, unInit }
/// 2. Country Statistics
class StatisticseData {
final StatisticsResponseModel statisticsInformationData;
- final List countryStatisticsList;
+ final List countryStatisticsConfirmedList;
+ final List countryStatisticsRecoveredList;
StatisticseData({
@required this.statisticsInformationData,
- @required this.countryStatisticsList,
+ @required this.countryStatisticsConfirmedList,
+ @required this.countryStatisticsRecoveredList,
});
}
@@ -50,12 +52,16 @@ class StatisticsChangeNotifier with ChangeNotifier {
final StatisticsResponseModel countryInformation =
await userRepository.fetchHomeData(iso2: iso2);
- final List countryStatisticsList =
- await userRepository.fetchCountryStatistics(iso2: iso2);
+ final List countryStatisticsConfirmedList =
+ await userRepository.fetchCountryStatisticsConfirmed(iso2: iso2);
+
+ final List countryStatisticsRecoveredList =
+ await userRepository.fetchCountryStatisticsRecovered(iso2: iso2);
data = StatisticseData(
statisticsInformationData: countryInformation,
- countryStatisticsList: countryStatisticsList,
+ countryStatisticsConfirmedList: countryStatisticsConfirmedList,
+ countryStatisticsRecoveredList: countryStatisticsRecoveredList,
);
// Setting the state as `StatisticsState.hasData` indicating an API request has been completed
diff --git a/lib/ui/faq/faq_screen.dart b/lib/ui/faq/faq_screen.dart
new file mode 100644
index 0000000..1d9b647
--- /dev/null
+++ b/lib/ui/faq/faq_screen.dart
@@ -0,0 +1,142 @@
+import 'package:flutter/material.dart';
+import 'package:covid19/constants/colors.dart';
+import 'package:covid19/constants/dimens.dart';
+import 'package:covid19/constants/strings.dart';
+import 'package:covid19/constants/text_styles.dart';
+import 'package:covid19/data/faq_data.dart';
+import 'package:covid19/icons/covid19_icons.dart';
+import 'package:covid19/models/faq/faq_model.dart';
+import 'package:covid19/utils/custom_scroll_behaviour.dart';
+import 'package:covid19/utils/device/device_utils.dart';
+import 'package:covid19/widgets/sized_box_height_widget.dart';
+
+class FAQScreen extends StatefulWidget {
+ @override
+ _FAQScreenState createState() => _FAQScreenState();
+}
+
+class _FAQScreenState extends State {
+ // final List- _data = generateItems(8);
+ int _previousItemIndex = -1;
+
+ Widget _buildPanel({
+ double screenWidth,
+ double screenHeight,
+ }) {
+ return ExpansionPanelList(
+ expansionCallback: (int index, bool isExpanded) {
+ if (_previousItemIndex == -1) {
+ setState(() {
+ _previousItemIndex = index;
+ faqData[index].isExpanded = !isExpanded;
+ });
+ } else {
+ setState(() {
+ faqData[_previousItemIndex].isExpanded = false;
+ faqData[index].isExpanded = !isExpanded;
+ _previousItemIndex = index;
+ });
+ }
+ },
+ children: faqData.map((FAQModel item) {
+ return ExpansionPanel(
+ canTapOnHeader: true,
+ headerBuilder: (BuildContext context, bool isExpanded) {
+ return ListTile(
+ title: Text(
+ item.title,
+ style: TextStyles.faqHeadingTextStyle.copyWith(
+ fontSize: screenWidth / 25,
+ ),
+ ),
+ );
+ },
+ body: ListTile(
+ title: Padding(
+ padding: EdgeInsets.only(
+ bottom: screenHeight / 30,
+ ),
+ child: Text(
+ item.description,
+ style: TextStyles.faqBodyTextStyle.copyWith(
+ fontSize: screenWidth / 25,
+ ),
+ ),
+ ),
+ ),
+ isExpanded: item.isExpanded,
+ );
+ }).toList(),
+ );
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final screenWidth = DeviceUtils.getScaledWidth(context, 1);
+ final screenHeight = DeviceUtils.getScaledHeight(context, 1);
+ return Scaffold(
+ backgroundColor: AppColors.whiteColor,
+ // [AppBar] with 0 size used to set the statusbar background color and
+ // statusbat text/icon color
+ appBar: PreferredSize(
+ preferredSize: const Size.fromHeight(0.0),
+ child: AppBar(
+ backgroundColor: AppColors.transparentColor,
+ brightness: Brightness.light,
+ elevation: 0.0,
+ ),
+ ),
+ body: SafeArea(
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(
+ Dimens.horizontalPadding,
+ Dimens.verticalPadding / 0.75,
+ Dimens.horizontalPadding,
+ 0,
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ // Back Icon
+ GestureDetector(
+ onTap: () => Navigator.of(context).pop(),
+ child: Icon(
+ Covid19Icons.keyboardArrowLeft,
+ size: screenWidth / 12,
+ color: AppColors.blackColor,
+ ),
+ ),
+
+ // Vertical Spacing
+ SizedBoxHeightWidget(screenHeight / 50),
+
+ // Page Title
+ Text(
+ Strings.faqTitle,
+ style: TextStyles.statisticsHeadingTextStlye.copyWith(
+ fontSize: screenWidth / 15,
+ ),
+ ),
+ // Symptom Items
+ // Wrapping the contents in a [Flexible] to make sure that the remaining space
+ // in the screen is filled (Removing this causes the overflow error to occur as
+ // a column does not allow scrolling inherently)
+ Flexible(
+ // Defining a [SingleChildScrollView] to scroll only the Symptom Items and not the header
+ child: ScrollConfiguration(
+ behavior: const CustomScrollBehaviour(),
+ child: SingleChildScrollView(
+ child: _buildPanel(
+ screenWidth: screenWidth,
+ screenHeight: screenHeight,
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/ui/home/home_navigator.dart b/lib/ui/home/home_navigator.dart
index 56277be..4a78801 100644
--- a/lib/ui/home/home_navigator.dart
+++ b/lib/ui/home/home_navigator.dart
@@ -1,12 +1,25 @@
-import 'package:covid19/constants/colors.dart';
import 'package:flutter/material.dart';
+import 'package:covid19/constants/colors.dart';
import 'package:covid19/ui/home/home_screen.dart';
import 'package:covid19/ui/statistics/statistics_screen.dart';
import 'package:covid19/ui/prevention/prevention_screen.dart';
import 'package:covid19/ui/symptomChecker/symptom_checker_screen.dart';
+import 'package:covid19/ui/symptoms/symptoms_screen.dart';
+import 'package:covid19/ui/mythBusters/myth_busters_screen.dart';
+import 'package:covid19/ui/faq/faq_screen.dart';
+import 'package:covid19/ui/information/information_screen.dart';
/// States for [HomeRoutes]
-enum HomeRoutes { home, latestNumbers, prevention, symptomChecker }
+enum HomeRoutes {
+ home,
+ latestNumbers,
+ prevention,
+ symptomChecker,
+ symptoms,
+ mythBusters,
+ faq,
+ information,
+}
/// [HomeRoutesDefinitions] to map the appropriate states of [HomeRoutes]
/// to paths
@@ -21,6 +34,14 @@ extension HomeRouteDefinitions on HomeRoutes {
return '/prevention';
case HomeRoutes.symptomChecker:
return '/symptom-checker';
+ case HomeRoutes.symptoms:
+ return '/symptoms';
+ case HomeRoutes.mythBusters:
+ return '/myth-busters';
+ case HomeRoutes.faq:
+ return '/faq';
+ case HomeRoutes.information:
+ return '/information';
default:
return '/';
}
@@ -37,6 +58,14 @@ extension HomeRouteDefinitions on HomeRoutes {
return HomeRoutes.prevention;
case '/symptom-checker':
return HomeRoutes.symptomChecker;
+ case '/symptoms':
+ return HomeRoutes.symptoms;
+ case '/myth-busters':
+ return HomeRoutes.mythBusters;
+ case '/faq':
+ return HomeRoutes.faq;
+ case '/information':
+ return HomeRoutes.information;
default:
return HomeRoutes.home;
}
@@ -54,18 +83,24 @@ class HomeRouter {
routesStack.add(settings.name);
switch (HomeRouteDefinitions.fromString(settings.name)) {
case HomeRoutes.home:
- return MaterialPageRoute(builder: (_) => HomeScreen());
+ return CustomPageRoute(HomeScreen());
case HomeRoutes.latestNumbers:
return MaterialPageRoute(builder: (_) => StatisticsScreen());
case HomeRoutes.prevention:
return MaterialPageRoute(builder: (_) => PreventionScreen());
case HomeRoutes.symptomChecker:
- // return MaterialPageRoute(builder: (_) => SymptomCheckerScreen());
- return CustomPageRoute(SymptomCheckerScreen());
- // return FadePageRoute(builder: (_) => SymptomCheckerScreen());
+ return MaterialPageRoute(builder: (_) => SymptomCheckerScreen());
+ case HomeRoutes.symptoms:
+ return MaterialPageRoute(builder: (_) => SymptomsScreen());
+ case HomeRoutes.mythBusters:
+ return MaterialPageRoute(builder: (_) => MythBustersScreen());
+ case HomeRoutes.faq:
+ return MaterialPageRoute(builder: (_) => FAQScreen());
+ case HomeRoutes.information:
+ return MaterialPageRoute(builder: (_) => InformationScreen());
default:
- return MaterialPageRoute(builder: (_) => HomeScreen());
+ return CustomPageRoute(HomeScreen());
}
}
}
@@ -80,6 +115,9 @@ class HomeRouter {
/// 2. [latestNumbers] - To lead the user to the [StatisticsScreen]
/// 3. [prevention] - To lead the user to the [PreventionScreen]
/// 4. [symptomChecker] - To lead the user to the [SymptomCheckerScreen]
+/// 5. [symptoms] - To lead the user to the [SymptomsScreen]
+/// 6. [faq] - To lead the user to the [FAQScreen]
+/// 7. [information] - TO lead the user to the [InformationScreen]
class HomeNavigator extends StatelessWidget {
static final GlobalKey navigatorKey =
GlobalKey();
diff --git a/lib/ui/home/home_screen.dart b/lib/ui/home/home_screen.dart
index 9071831..2d0e626 100644
--- a/lib/ui/home/home_screen.dart
+++ b/lib/ui/home/home_screen.dart
@@ -1,12 +1,15 @@
import 'package:flutter/material.dart';
+import 'package:cached_network_image/cached_network_image.dart';
import 'package:covid19/constants/colors.dart';
import 'package:covid19/constants/dimens.dart';
import 'package:covid19/constants/strings.dart';
import 'package:covid19/constants/text_styles.dart';
+import 'package:covid19/data/network/constants/endpoints.dart';
import 'package:covid19/res/asset_images.dart';
import 'package:covid19/ui/home/home_navigator.dart';
import 'package:covid19/ui/home/widgets/home_card_widget.dart';
-import 'package:covid19/ui/home/widgets/symptom_checker_card_widget.dart';
+import 'package:covid19/utils/cache_manager.dart';
+import 'package:covid19/utils/custom_scroll_behaviour.dart';
import 'package:covid19/utils/device/device_utils.dart';
import 'package:covid19/widgets/sized_box_height_widget.dart';
@@ -29,98 +32,142 @@ class HomeScreen extends StatelessWidget {
elevation: 0.0,
),
),
- body: Container(
- padding: EdgeInsets.fromLTRB(
- Dimens.horizontalPadding,
- Dimens.verticalPadding / 0.75,
- 0,
- 0,
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- // Page Title
- Text(
- Strings.appName,
- style: TextStyles.statisticsHeadingTextStlye.copyWith(
- fontSize: screenWidth / 12,
- ),
+ body: ScrollConfiguration(
+ behavior: const CustomScrollBehaviour(),
+ child: SingleChildScrollView(
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(
+ Dimens.horizontalPadding,
+ Dimens.verticalPadding / 0.75,
+ Dimens.horizontalPadding,
+ 0,
),
-
- // Verical Spacing
- SizedBoxHeightWidget(screenHeight / 30),
-
- // Latest Numbers and Prevention Cards
- Row(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
children: [
- // Latest Numbers Card
- Expanded(
- flex: 1,
- child: HomeCardWidget(
- backgroundColor: AppColors.primaryColor,
- title: Strings.latestNumbersTitle,
- imagePath: AssetImages.latestNumbers,
- backgroundImage: true,
- route: HomeRoutes.latestNumbers.name,
+ // Page Title
+ Text(
+ Strings.appSlogan,
+ style: TextStyles.statisticsHeadingTextStlye.copyWith(
+ fontSize: screenWidth / 12,
),
),
- // Prevention Numbers Card
- Expanded(
- flex: 1,
- child: HomeCardWidget(
- backgroundColor: AppColors.primaryColor,
- title: Strings.preventionTitle,
- imagePath: AssetImages.prevention,
- route: HomeRoutes.prevention.name,
+ // Vertical Spacing
+ SizedBoxHeightWidget(screenHeight / 30),
+
+ Container(
+ height: screenHeight / 3,
+ decoration: BoxDecoration(
+ image: DecorationImage(
+ fit: BoxFit.scaleDown,
+ image: CachedNetworkImageProvider(
+ Endpoints.fetchHomeGraphic,
+ cacheManager: CacheManager(),
+ ),
+ ),
+ borderRadius: BorderRadius.all(
+ Radius.circular(
+ screenHeight * 0.075,
+ ),
+ ),
+ color: Colors.transparent,
),
),
- ],
- ),
- // Verical Spacing
- SizedBoxHeightWidget(screenHeight / 50),
+ // Vertical Spacing
+ SizedBoxHeightWidget(screenHeight / 30),
- // Sympton Checker Card
- GestureDetector(
- onTap: () => HomeNavigator.navigatorKey.currentState
- .pushNamed(HomeRoutes.symptomChecker.name),
- child: Hero(
- tag: 'symptomChecker',
- child: SymptomCheckerCardWidget(),
- ),
- ),
+ Row(
+ children: [
+ // Statistics Card
+ Expanded(
+ flex: 1,
+ child: HomeCardWidget(
+ backgroundColor: AppColors.primaryColor,
+ title: Strings.statisticsTitle,
+ imagePath: AssetImages.statistics,
+ backgroundImage: true,
+ route: HomeRoutes.latestNumbers.name,
+ ),
+ ),
- // Verical Spacing
- SizedBoxHeightWidget(screenHeight / 50),
+ // Prevention Numbers Card
+ Expanded(
+ flex: 1,
+ child: HomeCardWidget(
+ backgroundColor: AppColors.primaryColor,
+ title: Strings.preventionTitle,
+ imagePath: AssetImages.prevention,
+ route: HomeRoutes.prevention.name,
+ ),
+ ),
- // Symptoms and Myth Busters
- Row(
- children: [
- // Symptoms Card
- Expanded(
- flex: 1,
- child: HomeCardWidget(
- backgroundColor: AppColors.primaryColor,
- title: Strings.symptomsTitle,
- imagePath: AssetImages.symptoms,
- route: HomeRoutes.latestNumbers.name,
- ),
+ // Symptoms Card
+ Expanded(
+ flex: 1,
+ child: HomeCardWidget(
+ backgroundColor: AppColors.primaryColor,
+ title: Strings.symptomsTitle,
+ imagePath: AssetImages.symptoms,
+ route: HomeRoutes.symptoms.name,
+ ),
+ ),
+ ],
),
- // Myth Busters Card
- Expanded(
- flex: 1,
- child: HomeCardWidget(
- backgroundColor: AppColors.primaryColor,
- title: Strings.mythBusterTitle,
- imagePath: AssetImages.mythBusters,
- route: HomeRoutes.prevention.name,
- ),
+ // Vertical Spacing
+ SizedBoxHeightWidget(screenHeight / 30),
+
+ Row(
+ children: [
+ // Myth Busters Card
+ Expanded(
+ flex: 1,
+ child: HomeCardWidget(
+ backgroundColor: AppColors.primaryColor,
+ title: Strings.mythBusterTitle,
+ imagePath: AssetImages.mythBusters,
+ route: HomeRoutes.mythBusters.name,
+ ),
+ ),
+
+ // FAQ Card
+ Expanded(
+ flex: 1,
+ child: HomeCardWidget(
+ backgroundColor: AppColors.primaryColor,
+ title: Strings.faqTitle,
+ imagePath: AssetImages.faq,
+ route: HomeRoutes.faq.name,
+ ),
+ ),
+
+ // Coronavirus information Card
+ Expanded(
+ flex: 1,
+ child: HomeCardWidget(
+ backgroundColor: AppColors.primaryColor,
+ title: Strings.covidInformationTitle,
+ imagePath: AssetImages.virus,
+ route: HomeRoutes.information.name,
+ ),
+ ),
+ ],
),
+
+ // Sympton Checker Card
+ // GestureDetector(
+ // onTap: () => HomeNavigator.navigatorKey.currentState
+ // .pushNamed(HomeRoutes.symptomChecker.name),
+ // child: Hero(
+ // tag: 'symptomChecker',
+ // child: SymptomCheckerCardWidget(),
+ // ),
+ // ),
],
),
- ],
+ ),
),
),
),
diff --git a/lib/ui/home/widgets/home_card_widget.dart b/lib/ui/home/widgets/home_card_widget.dart
index 5d8b7a8..223c81e 100644
--- a/lib/ui/home/widgets/home_card_widget.dart
+++ b/lib/ui/home/widgets/home_card_widget.dart
@@ -1,7 +1,8 @@
-import 'package:flutter/material.dart';
import 'package:covid19/constants/colors.dart';
import 'package:covid19/constants/dimens.dart';
import 'package:covid19/constants/text_styles.dart';
+import 'package:covid19/widgets/sized_box_height_widget.dart';
+import 'package:flutter/material.dart';
import 'package:covid19/ui/home/home_navigator.dart';
import 'package:covid19/utils/device/device_utils.dart';
@@ -27,61 +28,63 @@ class HomeCardWidget extends StatelessWidget {
this.imagePath,
this.backgroundImage = false,
this.route,
- }) : super(key: key);
+ }) : super(
+ key: key,
+ );
@override
Widget build(BuildContext context) {
final screenWidth = DeviceUtils.getScaledWidth(context, 1);
final screenHeight = DeviceUtils.getScaledHeight(context, 1);
return GestureDetector(
onTap: () => HomeNavigator.navigatorKey.currentState.pushNamed(route),
- // Rounded Card
- child: Container(
- height: screenHeight / 8,
- margin: const EdgeInsets.symmetric(
- horizontal: Dimens.horizontalPadding / 2,
- ),
- decoration: BoxDecoration(
- image: DecorationImage(
- image: AssetImage(imagePath),
- // Setting the property to fill the complete card
- // and centering it inside the card at the bottom
- // if the backgroundImage property is set to true
- // or else centering it to the bottom right of the card
- // and scaling it
- fit: backgroundImage ? BoxFit.contain : BoxFit.scaleDown,
- alignment: backgroundImage
- ? Alignment.bottomCenter
- : Alignment.bottomRight,
- ),
- boxShadow: const [
- BoxShadow(
- offset: Offset(0, 0),
- blurRadius: 1,
- color: AppColors.boxShadowColor,
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Container(
+ height: screenHeight / 8,
+ margin: const EdgeInsets.symmetric(
+ horizontal: Dimens.horizontalPadding / 2,
+ ),
+ decoration: BoxDecoration(
+ image: DecorationImage(
+ image: AssetImage(imagePath),
+ // Setting the property to fill the complete card
+ // and centering it inside the card at the bottom
+ // if the backgroundImage property is set to true
+ // or else centering it to the bottom right of the card
+ // and scaling it
+ fit: backgroundImage ? BoxFit.fitWidth : BoxFit.scaleDown,
+ alignment:
+ backgroundImage ? Alignment.bottomCenter : Alignment.center,
+ ),
+ boxShadow: const [
+ BoxShadow(
+ offset: Offset(0, 0),
+ blurRadius: 1,
+ color: AppColors.boxShadowColor,
+ ),
+ ],
+ borderRadius: const BorderRadius.all(
+ Radius.circular(10),
+ ),
+ color: backgroundColor,
),
- ],
- borderRadius: const BorderRadius.all(
- Radius.circular(10),
),
- color: backgroundColor,
- ),
- // Text Label
- child: Container(
- padding: EdgeInsets.symmetric(
- vertical: screenHeight / 55,
- horizontal: screenWidth / 25,
- ),
- child: SizedBox(
+ SizedBoxHeightWidget(screenHeight / 75),
+
+ // Text Label
+ SizedBox(
width: screenWidth / 1.5,
child: Text(
title,
style: TextStyles.homeCardTitle.copyWith(
- fontSize: screenWidth / 20,
+ fontSize: screenWidth / 25,
),
+ textAlign: TextAlign.center,
),
),
- ),
+ ],
),
);
}
diff --git a/lib/ui/information/information_screen.dart b/lib/ui/information/information_screen.dart
new file mode 100644
index 0000000..1399e8c
--- /dev/null
+++ b/lib/ui/information/information_screen.dart
@@ -0,0 +1,207 @@
+import 'package:flutter/material.dart';
+import 'package:flutter/gestures.dart';
+import 'package:cached_network_image/cached_network_image.dart';
+import 'package:url_launcher/url_launcher.dart';
+import 'package:covid19/constants/dimens.dart';
+import 'package:covid19/constants/strings.dart';
+import 'package:covid19/constants/colors.dart';
+import 'package:covid19/constants/text_styles.dart';
+import 'package:covid19/icons/covid19_icons.dart';
+import 'package:covid19/data/network/constants/endpoints.dart';
+import 'package:covid19/utils/custom_scroll_behaviour.dart';
+import 'package:covid19/utils/cache_manager.dart';
+import 'package:covid19/utils/device/device_utils.dart';
+import 'package:covid19/widgets/custom_alert_dialog.dart';
+
+/// Displays the information in regards to Coronavirus
+/// and reference to where the data is taken from
+class InformationScreen extends StatelessWidget {
+ @override
+ Widget build(BuildContext context) {
+ final screenWidth = DeviceUtils.getScaledWidth(context, 1);
+ final screenHeight = DeviceUtils.getScaledHeight(context, 1);
+ return Scaffold(
+ // To make sure that the top of the body is aligned with top
+ // of the AppBar and we do not have any unwanted background colors
+ extendBodyBehindAppBar: true,
+ appBar: PreferredSize(
+ preferredSize: Size.fromHeight(
+ screenHeight / 20,
+ ),
+ child: AppBar(
+ // Leading set to empty container to remove the back button
+ leading: Container(),
+ // Setting the background color to transparent so that the
+ // image can be full screen without any froeground colors
+ backgroundColor: AppColors.transparentColor,
+ elevation: 0,
+ actions: [
+ // Adding padding to the action info button so it doesn't stick
+ // to the side of the screen
+ Padding(
+ padding: EdgeInsets.only(
+ right: screenWidth / 50,
+ ),
+ child: GestureDetector(
+ // Displaying the dialog to reference the source of the
+ // image
+ onTap: () => showDialog(
+ context: context,
+ builder: (BuildContext context) {
+ return CustomAlertDialog(
+ title: RichText(
+ softWrap: true,
+ text: TextSpan(children: [
+ // Dialog Title - Data Source
+ TextSpan(
+ text: '${Strings.dataSource}\n\n\n',
+ style: TextStyles.hightlightText.copyWith(
+ fontSize: screenWidth / 20,
+ ),
+ ),
+
+ // Dialoog description referncing and linking the blog post
+ // and the Author
+ TextSpan(
+ style: TextStyles.statisticsSubHeadingTextStlye
+ .copyWith(
+ fontSize: screenWidth / 25,
+ ),
+ children: [
+ const TextSpan(
+ text: Strings.informationSourceDescription,
+ ),
+ TextSpan(
+ text: Strings.blog,
+ style: const TextStyle(
+ decoration: TextDecoration.underline,
+ color: AppColors.accentBlueColor,
+ ),
+ // Launcing the URL of the blog post
+ // throwing an error if the user doesn't have any browswer to open the link (Shouldn't ever happen)
+ recognizer: TapGestureRecognizer()
+ ..onTap = () async => await canLaunch(Endpoints
+ .informationDataSourceReferenceURL)
+ ? launch(Endpoints
+ .informationDataSourceReferenceURL)
+ : throw 'Could not launch Refernce URL',
+ ),
+ const TextSpan(
+ text: Strings.writtenBy,
+ ),
+ // Launcing the URL of the Author's Website
+ // throwing an error if the user doesn't have any browswer to open the link (Shouldn't ever happen)
+ TextSpan(
+ text: Strings.authorInformationGraphic,
+ style: const TextStyle(
+ decoration: TextDecoration.underline,
+ color: AppColors.accentBlueColor,
+ ),
+ recognizer: TapGestureRecognizer()
+ ..onTap = () async => await canLaunch(
+ Endpoints.informationSourceAuthorURL)
+ ? launch(
+ Endpoints.informationSourceAuthorURL)
+ : throw 'Could not launch Refernce URL',
+ ),
+ ],
+ ),
+ ]),
+ ),
+
+ // Defining the Action item [Close] for the Dialog
+ actions: [
+ GestureDetector(
+ onTap: () => Navigator.of(context).pop(),
+ child: Container(
+ padding: EdgeInsets.symmetric(
+ horizontal: screenWidth / 25,
+ vertical: screenHeight / 75,
+ ),
+ decoration: BoxDecoration(
+ boxShadow: const [
+ BoxShadow(
+ offset: Offset(-2, 4),
+ blurRadius: 2,
+ color: AppColors.boxShadowColor,
+ ),
+ ],
+ borderRadius: BorderRadius.all(
+ Radius.circular(screenWidth / 25),
+ ),
+ color: AppColors.accentBlueColor,
+ ),
+ child: Text(
+ 'Close',
+ style: TextStyles.statisticsHeadingTextStlye
+ .copyWith(
+ fontSize: screenWidth / 25,
+ ),
+ ),
+ ),
+ ),
+ ],
+ );
+ },
+ ),
+
+ // Adding the information Icon to the [AppBar]
+ child: Container(
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.all(
+ Radius.circular(screenWidth / 15),
+ ),
+ ),
+ child: Icon(
+ Covid19Icons.error,
+ size: screenWidth / 12,
+ color: AppColors.blackColor,
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ body: ScrollConfiguration(
+ behavior: const CustomScrollBehaviour(),
+ child: SingleChildScrollView(
+ // Padding been added to keep the VISME logo visible at the bottom
+ child: Container(
+ padding: const EdgeInsets.only(
+ bottom: Dimens.verticalPadding / 0.15,
+ ),
+ color: AppColors.preventionBackgroundColor,
+ child: CachedNetworkImage(
+ imageUrl: Endpoints.fetchInformatiionGraphic,
+ cacheManager: CacheManager(),
+ ),
+ ),
+ ),
+ ),
+ // Back button to lead back to the [HomeScreen]
+ // Floating Action Button used so that the item remains fixed when the image is scolled
+ floatingActionButton: Padding(
+ padding: EdgeInsets.only(
+ bottom: screenHeight / 75,
+ ),
+ child: FloatingActionButton.extended(
+ onPressed: () => Navigator.of(context).pop(),
+ backgroundColor: AppColors.blackColor,
+ isExtended: true,
+ materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
+ icon: Icon(
+ Covid19Icons.keyboardArrowLeft,
+ size: screenWidth / 20,
+ color: AppColors.whiteColor,
+ ),
+ label: const Text(
+ 'Go Back',
+ style: TextStyles.infoLabelTextStyle,
+ ),
+ ),
+ ),
+ floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
+ );
+ }
+}
diff --git a/lib/ui/mythBusters/myth_busters_screen.dart b/lib/ui/mythBusters/myth_busters_screen.dart
new file mode 100644
index 0000000..01e3aac
--- /dev/null
+++ b/lib/ui/mythBusters/myth_busters_screen.dart
@@ -0,0 +1,135 @@
+import 'package:flutter/material.dart';
+import 'package:covid19/constants/colors.dart';
+import 'package:covid19/constants/dimens.dart';
+import 'package:covid19/constants/strings.dart';
+import 'package:covid19/constants/text_styles.dart';
+import 'package:covid19/icons/covid19_icons.dart';
+import 'package:covid19/data/myth_buster_data.dart';
+import 'package:covid19/res/asset_images.dart';
+import 'package:covid19/ui/mythBusters/widgets/myth_card_widget.dart';
+import 'package:covid19/utils/custom_scroll_behaviour.dart';
+import 'package:covid19/utils/device/device_utils.dart';
+import 'package:covid19/widgets/sized_box_height_widget.dart';
+import 'package:covid19/widgets/sized_box_width_widget.dart';
+
+/// Displays the list of Symptoms for Covid-19
+class MythBustersScreen extends StatelessWidget {
+ @override
+ Widget build(BuildContext context) {
+ final screenWidth = DeviceUtils.getScaledWidth(context, 1);
+ final screenHeight = DeviceUtils.getScaledHeight(context, 1);
+ return Scaffold(
+ backgroundColor: AppColors.whiteColor,
+ // [AppBar] with 0 size used to set the statusbar background color and
+ // statusbat text/icon color
+ appBar: PreferredSize(
+ preferredSize: const Size.fromHeight(0.0),
+ child: AppBar(
+ backgroundColor: AppColors.transparentColor,
+ brightness: Brightness.light,
+ elevation: 0.0,
+ ),
+ ),
+ body: SafeArea(
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(
+ Dimens.horizontalPadding,
+ Dimens.verticalPadding / 0.75,
+ Dimens.horizontalPadding,
+ 0,
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ // Back Icon
+ GestureDetector(
+ onTap: () => Navigator.of(context).pop(),
+ child: Icon(
+ Covid19Icons.keyboardArrowLeft,
+ size: screenWidth / 12,
+ color: AppColors.blackColor,
+ ),
+ ),
+
+ // Vertical Spacing
+ SizedBoxHeightWidget(screenHeight / 50),
+
+ Row(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ // Page Title
+ Text(
+ Strings.mythBusterTitle,
+ style: TextStyles.statisticsHeadingTextStlye.copyWith(
+ fontSize: screenWidth / 15,
+ ),
+ ),
+
+ // Horizontal Spacing
+ SizedBoxWidthWidget(screenWidth / 25),
+
+ // Myth Busters Icon
+ Container(
+ width: screenWidth / 8,
+ height: screenWidth / 8,
+ decoration: BoxDecoration(
+ boxShadow: const [
+ BoxShadow(
+ offset: Offset(0, 0),
+ blurRadius: 29,
+ color: AppColors.boxShadowColor,
+ ),
+ ],
+ borderRadius: BorderRadius.all(
+ Radius.circular(screenWidth / 10),
+ ),
+ color: AppColors.mythColor,
+ ),
+ child: Center(
+ child: Image.asset(
+ AssetImages.myth,
+ height: screenWidth / 8,
+ ),
+ ),
+ )
+ ],
+ ),
+
+ // Vertical Spacing
+ SizedBoxHeightWidget(screenHeight / 50),
+
+ // Symptom Items
+ // Wrapping the contents in a [Flexible] to make sure that the remaining space
+ // in the screen is filled (Removing this causes the overflow error to occur as
+ // a column does not allow scrolling inherently)
+ Flexible(
+ // Defining a [SingleChildScrollView] to scroll only the Symptom Items and not the header
+ child: ScrollConfiguration(
+ behavior: const CustomScrollBehaviour(),
+ child: SingleChildScrollView(
+ child: Padding(
+ padding: EdgeInsets.only(
+ top: screenHeight / 50,
+ ),
+ child: Column(
+ children: [
+ // Adding all the symptoms from [mythBusterData] to the Column
+ for (final item in mythBusterData)
+ MythCardWidget(
+ myth: item.myth,
+ fact: item.fact,
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/ui/mythBusters/widgets/myth_card_widget.dart b/lib/ui/mythBusters/widgets/myth_card_widget.dart
new file mode 100644
index 0000000..0fc5633
--- /dev/null
+++ b/lib/ui/mythBusters/widgets/myth_card_widget.dart
@@ -0,0 +1,106 @@
+import 'package:flutter/material.dart';
+import 'package:covid19/constants/colors.dart';
+import 'package:covid19/res/asset_images.dart';
+import 'package:covid19/ui/mythBusters/widgets/myth_fact_item_widget.dart';
+import 'package:covid19/utils/device/device_utils.dart';
+import 'package:covid19/widgets/sized_box_height_widget.dart';
+
+/// To Build the widget to display the card for each Myth/Fact
+///
+/// **Requires**
+/// 1. [myth] - To display the myth on the Cards on the [MythBustersScreen]
+/// 2. [fact] - To display the fact on click of the card
+class MythCardWidget extends StatelessWidget {
+ final String myth, fact;
+
+ const MythCardWidget({
+ Key key,
+ @required this.myth,
+ @required this.fact,
+ }) : super(key: key);
+ @override
+ Widget build(BuildContext context) {
+ final screenWidth = DeviceUtils.getScaledWidth(context, 1);
+ final screenHeight = DeviceUtils.getScaledHeight(context, 1);
+ return Column(
+ children: [
+ GestureDetector(
+ // Opening [Dialog] with the fact on click of each Myth
+ onTap: () {
+ showDialog(
+ context: context,
+ builder: (BuildContext context) {
+ // Using Animated padding to add the animation of the dialog appearing in
+ // to the screen
+ return AnimatedPadding(
+ padding: EdgeInsets.symmetric(
+ horizontal: 0,
+ vertical: screenHeight / 12,
+ ),
+ duration: const Duration(milliseconds: 100),
+ curve: Curves.decelerate,
+ child: Container(
+ // Defining the width to be taken by the children as the entire width of the screen
+ width: screenWidth,
+ // using a column to lay out the icon and the Fact Item
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ children: [
+ // Fact Icon
+ Container(
+ width: screenWidth / 8,
+ height: screenWidth / 8,
+ decoration: BoxDecoration(
+ boxShadow: const [
+ BoxShadow(
+ offset: Offset(0, 0),
+ blurRadius: 29,
+ color: AppColors.boxShadowColor,
+ ),
+ ],
+ borderRadius: BorderRadius.all(
+ Radius.circular(screenWidth / 10),
+ ),
+ color: AppColors.factColor,
+ ),
+ child: Center(
+ child: Image.asset(
+ AssetImages.fact,
+ height: screenWidth / 8,
+ ),
+ ),
+ ),
+
+ // Vertical Spacing
+ SizedBoxHeightWidget(screenHeight / 10),
+
+ // Displaying the Fact item
+ MythFactItemWidget(
+ screenWidth: screenWidth,
+ screenHeight: screenHeight,
+ shadowColor: AppColors.factColor,
+ text: fact,
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ },
+
+ // Adding the Myth Item with a spacing b/w each item using [SizedBoxHeightWidget]
+ child: MythFactItemWidget(
+ screenWidth: screenWidth,
+ screenHeight: screenHeight,
+ shadowColor: AppColors.mythColor,
+ text: myth,
+ ),
+ ),
+
+ // Vertical Spacing
+ SizedBoxHeightWidget(screenHeight / 75),
+ ],
+ );
+ }
+}
diff --git a/lib/ui/mythBusters/widgets/myth_fact_item_widget.dart b/lib/ui/mythBusters/widgets/myth_fact_item_widget.dart
new file mode 100644
index 0000000..b380d5c
--- /dev/null
+++ b/lib/ui/mythBusters/widgets/myth_fact_item_widget.dart
@@ -0,0 +1,121 @@
+import 'package:flutter/material.dart';
+import 'package:covid19/constants/colors.dart';
+import 'package:covid19/constants/text_styles.dart';
+
+/// To display each Myth/Fact item with the relevant shadow
+///
+/// **Requires**
+/// 1. [screenWidth] - Used to position the shadow and size the elements
+/// 2. [screenHeight] - Used to position the shadow and size the elements
+/// 3. [shadowColor] - For the shadow for each item - Myth/Fact (Red/Green)
+/// 4. [text] - For the text to be displayed in the each item (Myth/Fact)
+class MythFactItemWidget extends StatelessWidget {
+ final double screenWidth, screenHeight;
+ final Color shadowColor;
+ final String text;
+
+ const MythFactItemWidget({
+ Key key,
+ @required this.screenWidth,
+ @required this.screenHeight,
+ @required this.shadowColor,
+ @required this.text,
+ }) : super(key: key);
+ @override
+ Widget build(BuildContext context) {
+ return Stack(
+ children: [
+ // Laying out the stack as the bottom most element of the [Stack]
+ // to give the affect of the shadow
+ // Using [PositionedDirectional] to position the shadow besides the
+ // main card to provide the required affect
+ PositionedDirectional(
+ bottom: -screenHeight / 80,
+ start: screenWidth / 13,
+ child: Container(
+ width: screenWidth / 1.2,
+ margin: EdgeInsets.only(
+ bottom: screenHeight / 45,
+ ),
+ padding: EdgeInsets.only(
+ left: screenWidth / 10,
+ top: screenHeight / 50,
+ right: screenWidth / 25,
+ bottom: screenHeight / 30,
+ ),
+ decoration: BoxDecoration(
+ borderRadius: const BorderRadius.all(
+ Radius.circular(20),
+ ),
+ color: shadowColor,
+ ),
+ // Adding the same text as in the Myth/Fact so that size of the item
+ // remains the same
+ // Setting the opacity to 0 so that it's not visible
+ child: Opacity(
+ opacity: 0,
+ child: Text(
+ text,
+ style: TextStyles.statisticsHeadingTextStlye.copyWith(
+ fontSize: screenWidth / 20,
+ ),
+ ),
+ ),
+ ),
+ ),
+
+ // Using [Align] to centre the item with the text (Myth/Fact)
+ Align(
+ alignment: Alignment.center,
+ child: Container(
+ width: screenWidth / 1.2,
+ margin: EdgeInsets.only(
+ bottom: screenHeight / 45,
+ ),
+ padding: EdgeInsets.only(
+ left: screenWidth / 10,
+ top: screenHeight / 50,
+ right: screenWidth / 25,
+ bottom: screenHeight / 30,
+ ),
+ decoration: const BoxDecoration(
+ boxShadow: [
+ BoxShadow(
+ offset: Offset(-1, 1),
+ blurRadius: 1,
+ color: AppColors.boxShadowColor,
+ ),
+ BoxShadow(
+ offset: Offset(1, -1),
+ blurRadius: 1,
+ color: AppColors.boxShadowColor,
+ ),
+ ],
+ borderRadius: BorderRadius.all(
+ Radius.circular(20),
+ ),
+ color: AppColors.whiteColor,
+ ),
+
+ // Using [IntrinsicHeight] so that the Height of the widget is
+ // based upon the data provided
+ // Using [Material] so that the text has a theme and doesn't have a
+ // yellow underlined of text - caused due to absence of a theme
+ // Occurs because this widget is used to populate a Dialog where the theme isn't provided
+ child: IntrinsicHeight(
+ child: Material(
+ color: AppColors.transparentColor,
+ child: Text(
+ text,
+ style: TextStyles.statisticsHeadingTextStlye.copyWith(
+ fontSize: screenWidth / 20,
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ ],
+ );
+ }
+}
diff --git a/lib/ui/prevention/prevention_screen.dart b/lib/ui/prevention/prevention_screen.dart
index 22642b6..3c05b79 100644
--- a/lib/ui/prevention/prevention_screen.dart
+++ b/lib/ui/prevention/prevention_screen.dart
@@ -1,5 +1,3 @@
-import 'dart:convert';
-import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/gestures.dart';
import 'package:cached_network_image/cached_network_image.dart';
@@ -10,7 +8,6 @@ import 'package:covid19/constants/colors.dart';
import 'package:covid19/constants/text_styles.dart';
import 'package:covid19/icons/covid19_icons.dart';
import 'package:covid19/data/network/constants/endpoints.dart';
-import 'package:covid19/models/statistics/statistics_response_model.dart';
import 'package:covid19/utils/custom_scroll_behaviour.dart';
import 'package:covid19/utils/cache_manager.dart';
import 'package:covid19/utils/device/device_utils.dart';
@@ -18,32 +15,7 @@ import 'package:covid19/widgets/custom_alert_dialog.dart';
/// Displays the information in regards to prevention of Coronavirus
/// and reference to where the data is taken from
-class PreventionScreen extends StatefulWidget {
- @override
- _PreventionScreenState createState() => _PreventionScreenState();
-}
-
-class _PreventionScreenState extends State {
- File preventionImage;
- @override
- void initState() {
- super.initState();
- getStatisticsFile();
- }
-
- Future getStatisticsFile() async {
- final cachedImage =
- await CacheManager().getSingleFile(Endpoints.fetchHomeData);
-
- final contents = await cachedImage.readAsString();
-
- final jsonResponse = jsonDecode(contents);
-
- final countryInformation = StatisticsResponseModel.fromJson(jsonResponse);
-
- debugPrint('${countryInformation.global.newConfirmed}');
- }
-
+class PreventionScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
final screenWidth = DeviceUtils.getScaledWidth(context, 1);
@@ -96,12 +68,12 @@ class _PreventionScreenState extends State {
fontSize: screenWidth / 25,
),
children: [
- TextSpan(
+ const TextSpan(
text: Strings.informationSourceDescription,
),
TextSpan(
text: Strings.blog,
- style: TextStyle(
+ style: const TextStyle(
decoration: TextDecoration.underline,
color: AppColors.accentBlueColor,
),
@@ -109,25 +81,29 @@ class _PreventionScreenState extends State {
// throwing an error if the user doesn't have any browswer to open the link (Shouldn't ever happen)
recognizer: TapGestureRecognizer()
..onTap = () async => await canLaunch(
- Endpoints.dataSourceReferenceURL)
- ? launch(Endpoints.dataSourceReferenceURL)
+ Endpoints
+ .preventionDataSourceReferenceURL)
+ ? launch(Endpoints
+ .preventionDataSourceReferenceURL)
: throw 'Could not launch Refernce URL',
),
- TextSpan(
+ const TextSpan(
text: Strings.writtenBy,
),
// Launcing the URL of the Author's Website
// throwing an error if the user doesn't have any browswer to open the link (Shouldn't ever happen)
TextSpan(
- text: Strings.author,
- style: TextStyle(
+ text: Strings.authorPrevetnionGraphic,
+ style: const TextStyle(
decoration: TextDecoration.underline,
color: AppColors.accentBlueColor,
),
recognizer: TapGestureRecognizer()
..onTap = () async => await canLaunch(
- Endpoints.dataSourceAuthorURL)
- ? launch(Endpoints.dataSourceAuthorURL)
+ Endpoints
+ .preventionDataSourceAuthorURL)
+ ? launch(Endpoints
+ .preventionDataSourceAuthorURL)
: throw 'Could not launch Refernce URL',
),
],
@@ -194,13 +170,13 @@ class _PreventionScreenState extends State {
child: SingleChildScrollView(
// Padding been added to keep the VISME logo visible at the bottom
child: Container(
- padding: EdgeInsets.only(
+ padding: const EdgeInsets.only(
top: Dimens.verticalPadding / 0.2,
bottom: Dimens.verticalPadding / 0.15,
),
color: AppColors.preventionBackgroundColor,
child: CachedNetworkImage(
- imageUrl: Endpoints.baseUrlPreventionInfographic,
+ imageUrl: Endpoints.fetchPreventionGraphic,
cacheManager: CacheManager(),
),
),
@@ -222,7 +198,7 @@ class _PreventionScreenState extends State {
size: screenWidth / 20,
color: AppColors.whiteColor,
),
- label: Text(
+ label: const Text(
'Go Back',
style: TextStyles.infoLabelTextStyle,
),
diff --git a/lib/ui/splash/splash_screen.dart b/lib/ui/splash/splash_screen.dart
index 0df306d..c424cdf 100644
--- a/lib/ui/splash/splash_screen.dart
+++ b/lib/ui/splash/splash_screen.dart
@@ -5,7 +5,7 @@ import 'package:covid19/utils/cache_manager.dart';
import 'package:covid19/constants/colors.dart';
import 'package:covid19/constants/strings.dart';
import 'package:covid19/constants/text_styles.dart';
-import 'package:covid19/res/asset_animations.dart';
+import 'package:covid19/res/asset_images.dart';
import 'package:covid19/widgets/sized_box_height_widget.dart';
import 'package:covid19/utils/device/device_utils.dart';
@@ -18,7 +18,7 @@ class SplashScreen extends StatelessWidget {
final screenHeight = DeviceUtils.getScaledHeight(context, 1);
return Scaffold(
- backgroundColor: AppColors.primaryColor.withAlpha(200),
+ backgroundColor: AppColors.splashColor,
body: Stack(
children: [
// Preload prevention Image to avoid the very short spanning white screen
@@ -26,7 +26,17 @@ class SplashScreen extends StatelessWidget {
Opacity(
opacity: 0,
child: CachedNetworkImage(
- imageUrl: Endpoints.baseUrlPreventionInfographic,
+ imageUrl: Endpoints.fetchPreventionGraphic,
+ cacheManager: CacheManager(),
+ ),
+ ),
+
+ // Preload Information Image to avoid the very short spanning white screen
+ // before the Image is loaded
+ Opacity(
+ opacity: 0,
+ child: CachedNetworkImage(
+ imageUrl: Endpoints.fetchInformatiionGraphic,
cacheManager: CacheManager(),
),
),
@@ -40,8 +50,8 @@ class SplashScreen extends StatelessWidget {
Center(
child: Image(
width: screenWidth / 0.75,
- image: AssetImage(
- AssetAnimations.splash,
+ image: const AssetImage(
+ AssetImages.splash,
),
),
),
diff --git a/lib/ui/static/static_error_screen.dart b/lib/ui/static/static_error_screen.dart
index ad249d4..aaa6788 100644
--- a/lib/ui/static/static_error_screen.dart
+++ b/lib/ui/static/static_error_screen.dart
@@ -1,9 +1,9 @@
-import 'package:flutter/material.dart';
-import 'package:covid19/constants/dimens.dart';
import 'package:covid19/constants/colors.dart';
+import 'package:covid19/constants/dimens.dart';
import 'package:covid19/constants/text_styles.dart';
-import 'package:covid19/widgets/sized_box_height_widget.dart';
import 'package:covid19/utils/device/device_utils.dart';
+import 'package:covid19/widgets/sized_box_height_widget.dart';
+import 'package:flutter/material.dart';
/// The screen that's shown when a [Exception] occurs
/// Handles the context of the screen to support the retry operation
@@ -44,7 +44,7 @@ class StaticErrorScreen extends StatelessWidget {
),
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 20),
// Adds the title to the Column if provided
@@ -60,7 +60,7 @@ class StaticErrorScreen extends StatelessWidget {
),
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 250),
// Adds the desctiption to the Column if provided
@@ -76,7 +76,7 @@ class StaticErrorScreen extends StatelessWidget {
),
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 50),
// Adds the Button to the Column if provided and attaches
diff --git a/lib/ui/statistics/statistics_screen.dart b/lib/ui/statistics/statistics_screen.dart
index a6d88b1..75107b1 100644
--- a/lib/ui/statistics/statistics_screen.dart
+++ b/lib/ui/statistics/statistics_screen.dart
@@ -8,9 +8,9 @@ import 'package:covid19/constants/colors.dart';
import 'package:covid19/constants/dimens.dart';
import 'package:covid19/constants/strings.dart';
import 'package:covid19/constants/text_styles.dart';
+import 'package:covid19/icons/covid19_icons.dart';
import 'package:covid19/models/statistics/countries_list_model.dart';
import 'package:covid19/res/asset_images.dart';
-import 'package:covid19/icons/covid19_icons.dart';
import 'package:covid19/stores/statistics/statistics_notifier.dart';
import 'package:covid19/ui/static/static_error_screen.dart';
import 'package:covid19/ui/statistics//widgets/statistics_loading_widget.dart';
@@ -158,10 +158,11 @@ class _StatisticsScreenState extends State {
@override
Widget build(BuildContext context) {
- // timeDilation = 15.0;
final screenWidth = DeviceUtils.getScaledWidth(context, 1);
final screenHeight = DeviceUtils.getScaledHeight(context, 1);
- debugPrint('Todays Date : $today');
+
+ // Wrapping the contents in [SafeArea] to avoid the Notch (When avaiable) and the bottom
+ // navigation bar (Mostly comes in use for iOS Devices)
return SafeArea(
child: Scaffold(
backgroundColor: AppColors.whiteColor,
@@ -190,10 +191,15 @@ class _StatisticsScreenState extends State {
final StatisticseData data = notifier.data;
// Fetching the index of the selected country
// TODO :- Change this post summary API being available country-wise
- final int currentCountryIndex =
+ int currentCountryIndex =
data.statisticsInformationData.countries.indexWhere(
(item) => item.countryCode == selectedCountryISO2,
);
+ // Adding negative checker clause (Not Found) if the data is not initialised yet
+ if (currentCountryIndex < 0) {
+ currentCountryIndex = 0;
+ }
+
return RefreshIndicator(
onRefresh: () => _fetchHomeData(
iso2: selectedCountryISO2,
@@ -203,7 +209,7 @@ class _StatisticsScreenState extends State {
behavior: const CustomScrollBehaviour(),
child: SingleChildScrollView(
child: Padding(
- padding: EdgeInsets.fromLTRB(
+ padding: const EdgeInsets.fromLTRB(
Dimens.horizontalPadding,
Dimens.verticalPadding / 0.75,
0,
@@ -222,7 +228,7 @@ class _StatisticsScreenState extends State {
),
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 50),
// Page Title
@@ -243,7 +249,7 @@ class _StatisticsScreenState extends State {
),
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 100),
// Global Title
@@ -270,7 +276,7 @@ class _StatisticsScreenState extends State {
],
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 100),
// Last Updated On Information
@@ -304,7 +310,7 @@ class _StatisticsScreenState extends State {
],
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 50),
// Details Button
@@ -328,7 +334,7 @@ class _StatisticsScreenState extends State {
],
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 75),
// Information Cards
@@ -342,7 +348,7 @@ class _StatisticsScreenState extends State {
Expanded(
flex: 1,
child: InfoCard(
- infoColor: AppColors.orangeColor,
+ infoColor: AppColors.confirmedColor,
infoIcon: Covid19Icons.add,
infoValueNew: data
.statisticsInformationData
@@ -356,7 +362,7 @@ class _StatisticsScreenState extends State {
Expanded(
flex: 1,
child: InfoCard(
- infoColor: AppColors.greenColor,
+ infoColor: AppColors.recoveredColor,
infoIcon: Covid19Icons.favorite,
infoValueNew: data
.statisticsInformationData
@@ -370,7 +376,7 @@ class _StatisticsScreenState extends State {
Expanded(
flex: 1,
child: InfoCard(
- infoColor: AppColors.redColor,
+ infoColor: AppColors.deadColor,
infoIcon: Covid19Icons.close,
infoValueNew: data
.statisticsInformationData
@@ -385,7 +391,7 @@ class _StatisticsScreenState extends State {
),
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 35),
const Padding(
@@ -398,7 +404,7 @@ class _StatisticsScreenState extends State {
),
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 75),
// Country Title
@@ -429,9 +435,12 @@ class _StatisticsScreenState extends State {
Flexible(
flex: 1,
child: Text(
- Emoji.byISOCode(
- 'flag_${selectedCountryISO2.toLowerCase()}')
- .char,
+ // Adding null checker clause if the data is not initialised yet
+ selectedCountryISO2 != ''
+ ? Emoji.byISOCode(
+ 'flag_${selectedCountryISO2.toLowerCase()}')
+ .char
+ : '',
style: const TextStyle(
fontSize: 30,
),
@@ -449,7 +458,7 @@ class _StatisticsScreenState extends State {
),
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 200),
// Details Button
@@ -473,7 +482,7 @@ class _StatisticsScreenState extends State {
],
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 75),
// Information Cards
@@ -487,7 +496,7 @@ class _StatisticsScreenState extends State {
Expanded(
flex: 1,
child: InfoCard(
- infoColor: AppColors.orangeColor,
+ infoColor: AppColors.confirmedColor,
infoIcon: Covid19Icons.add,
infoValueNew: data
.statisticsInformationData
@@ -503,7 +512,7 @@ class _StatisticsScreenState extends State {
Expanded(
flex: 1,
child: InfoCard(
- infoColor: AppColors.greenColor,
+ infoColor: AppColors.recoveredColor,
infoIcon: Covid19Icons.favorite,
infoValueNew: data
.statisticsInformationData
@@ -519,7 +528,7 @@ class _StatisticsScreenState extends State {
Expanded(
flex: 1,
child: InfoCard(
- infoColor: AppColors.redColor,
+ infoColor: AppColors.deadColor,
infoIcon: Covid19Icons.close,
infoValueNew: data
.statisticsInformationData
@@ -536,7 +545,7 @@ class _StatisticsScreenState extends State {
),
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 25),
// Confirmed Cases Label
@@ -555,12 +564,15 @@ class _StatisticsScreenState extends State {
],
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 75),
// Information Tab
InfoGraphWidget(
- countryStatisticsList: data.countryStatisticsList,
+ countryStatisticsConfirmedList:
+ data.countryStatisticsConfirmedList,
+ countryStatisticsRecoveredList:
+ data.countryStatisticsRecoveredList,
),
],
),
@@ -574,7 +586,7 @@ class _StatisticsScreenState extends State {
return Scaffold(
body: Center(
child: StaticErrorScreen(
- image: AssetImage(AssetImages.genericError),
+ image: const AssetImage(AssetImages.genericError),
title: error,
desc: Strings.genericErrorDesc,
actionText: Strings.retryButton,
@@ -590,7 +602,7 @@ class _StatisticsScreenState extends State {
return Scaffold(
body: Center(
child: StaticErrorScreen(
- image: AssetImage(AssetImages.noInternet),
+ image: const AssetImage(AssetImages.noInternet),
title: error,
desc: Strings.noInternetErrorDesc,
actionText: Strings.retryButton,
diff --git a/lib/ui/statistics/widgets/info_graph_widgert.dart b/lib/ui/statistics/widgets/info_graph_widgert.dart
index c623b6b..e757001 100644
--- a/lib/ui/statistics/widgets/info_graph_widgert.dart
+++ b/lib/ui/statistics/widgets/info_graph_widgert.dart
@@ -10,20 +10,30 @@ import 'package:covid19/models/statistics/country_statistics_day_model.dart';
import 'package:covid19/utils/device/device_utils.dart';
import 'package:covid19/widgets/sized_box_width_widget.dart';
+/// Displays the current statistics about the selected country
+///
+/// **Requires**
+/// 1. [countryStatisticsConfirmedList] - List of Confirmed Cases since case 0 for the selected country
+/// 2. [countryStatisticsRecoveredList] - List of Recovered Cases since case 0 for the selected country
class InfoGraphWidget extends StatefulWidget {
- final List countryStatisticsList;
+ final List countryStatisticsConfirmedList;
+ final List countryStatisticsRecoveredList;
- const InfoGraphWidget({Key key, @required this.countryStatisticsList})
- : super(key: key);
+ const InfoGraphWidget({
+ Key key,
+ @required this.countryStatisticsConfirmedList,
+ @required this.countryStatisticsRecoveredList,
+ }) : super(key: key);
@override
_InfoGraphWidgetState createState() => _InfoGraphWidgetState();
}
class _InfoGraphWidgetState extends State {
- bool dailySelected = true, weeklyselected = false;
+ bool dailySelected = true,
+ weeklyselected = false,
+ dailyChangeSelected = false;
- // Page Controller to control change between Daily and Weekly
- // TODO : Figure out visualisation of Monthly Data
+ // Page Controller to control change between Daily, Weekly and Daily Growth
PageController pageController = PageController(
initialPage: 0,
keepPage: true,
@@ -42,6 +52,7 @@ class _InfoGraphWidgetState extends State {
if (pageController.page != 0.0) {
dailySelected = true;
weeklyselected = false;
+ dailyChangeSelected = false;
pageController.animateToPage(
0,
duration: const Duration(
@@ -55,6 +66,7 @@ class _InfoGraphWidgetState extends State {
if (pageController.page != 1.0) {
dailySelected = false;
weeklyselected = true;
+ dailyChangeSelected = false;
pageController.animateToPage(
1,
duration: const Duration(
@@ -64,6 +76,20 @@ class _InfoGraphWidgetState extends State {
);
}
break;
+ case 2:
+ if (pageController.page != 2.0) {
+ dailySelected = false;
+ weeklyselected = false;
+ dailyChangeSelected = true;
+ pageController.animateToPage(
+ 2,
+ duration: const Duration(
+ milliseconds: 250,
+ ),
+ curve: Curves.bounceOut,
+ );
+ }
+ break;
}
}
@@ -73,6 +99,9 @@ class _InfoGraphWidgetState extends State {
final screenHeight = DeviceUtils.getScaledHeight(context, 1);
// Adding the Respective Charts to the list of page [_pages]
+ // 1. Bar Chart for daily data
+ // 2. Area (Line) Chart for weekly data
+ // 3. Dual Bar Chart for daily growth data
final List _pages = [
Padding(
padding: const EdgeInsets.fromLTRB(
@@ -83,12 +112,13 @@ class _InfoGraphWidgetState extends State {
),
// Checking if the list has any elemnts i.e the API provided
// data for the queried country
- child: (widget.countryStatisticsList.isNotEmpty)
+ child: (widget.countryStatisticsConfirmedList.isNotEmpty)
? BarChart(
- mainBarData(
- countryStatisticsList: widget.countryStatisticsList.sublist(
- (widget.countryStatisticsList.length) - 7,
- (widget.countryStatisticsList.length) - 0,
+ dailyBarChartData(
+ countryStatisticsConfirmedList:
+ widget.countryStatisticsConfirmedList.sublist(
+ (widget.countryStatisticsConfirmedList.length) - 7,
+ (widget.countryStatisticsConfirmedList.length) - 0,
),
screenWidth: screenWidth,
screenHeight: screenHeight,
@@ -109,13 +139,14 @@ class _InfoGraphWidgetState extends State {
),
// Checking if the list has any elemnts i.e the API provided
// data for the queried country
- child: (widget.countryStatisticsList.isNotEmpty)
+ child: (widget.countryStatisticsConfirmedList.isNotEmpty)
? LineChart(
// Using the latest 15 days days for the Weekly Information
- areaChartData(
- countryStatisticsList: widget.countryStatisticsList.sublist(
- (widget.countryStatisticsList.length) - 15,
- (widget.countryStatisticsList.length) - 0,
+ weeklyAreaGraphData(
+ countryStatisticsConfirmedList:
+ widget.countryStatisticsConfirmedList.sublist(
+ (widget.countryStatisticsConfirmedList.length) - 15,
+ (widget.countryStatisticsConfirmedList.length) - 0,
),
screenWidth: screenWidth,
screenHeight: screenHeight,
@@ -134,6 +165,39 @@ class _InfoGraphWidgetState extends State {
),
),
),
+ Padding(
+ padding: const EdgeInsets.fromLTRB(
+ Dimens.horizontalPadding,
+ Dimens.verticalPadding / 0.75,
+ Dimens.horizontalPadding,
+ Dimens.verticalPadding / 50,
+ ),
+ // Checking if the list has any elemnts i.e the API provided
+ // data for the queried country
+ child: (widget.countryStatisticsConfirmedList.isNotEmpty)
+ ? BarChart(
+ dailyChangeBarChartData(
+ countryStatisticsConfirmedList:
+ widget.countryStatisticsConfirmedList.sublist(
+ (widget.countryStatisticsConfirmedList.length) - 8,
+ (widget.countryStatisticsConfirmedList.length) - 0,
+ ),
+ countryStatisticsRecoveredList:
+ widget.countryStatisticsRecoveredList.sublist(
+ (widget.countryStatisticsRecoveredList.length) - 8,
+ (widget.countryStatisticsRecoveredList.length) - 0,
+ ),
+ screenWidth: screenWidth,
+ screenHeight: screenHeight,
+ ),
+ )
+ : Text(
+ Strings.emptyData,
+ style: TextStyles.errorHeadingTextStlye.copyWith(
+ fontSize: screenWidth / 25,
+ ),
+ ),
+ ),
];
// Houses the the Tabs and the Graphs
@@ -181,7 +245,7 @@ class _InfoGraphWidgetState extends State {
)
: const BoxDecoration(),
child: Text(
- 'Daily',
+ Strings.dailyStatiscsLable,
style: dailySelected
? TextStyles.hightlightText.copyWith(
fontSize: screenWidth / 20,
@@ -194,7 +258,7 @@ class _InfoGraphWidgetState extends State {
),
// Horizontal Spacing
- SizedBoxWidthWidget(screenWidth / 15),
+ SizedBoxWidthWidget(screenWidth / 20),
// Tab 2
// Gesture Detector used to avoid the Ripple Effect caused in InkWell
@@ -220,7 +284,7 @@ class _InfoGraphWidgetState extends State {
)
: const BoxDecoration(),
child: Text(
- 'Weekly',
+ Strings.weeklyStatiscsLable,
style: weeklyselected
? TextStyles.hightlightText.copyWith(
fontSize: screenWidth / 20,
@@ -231,11 +295,50 @@ class _InfoGraphWidgetState extends State {
),
),
),
+
+ // Horizontal Spacing
+ SizedBoxWidthWidget(screenWidth / 20),
+
+ // Tab 3
+ // Gesture Detector used to avoid the Ripple Effect caused in InkWell
+ GestureDetector(
+ onTap: () {
+ setState(
+ () {
+ toggleSelection(2);
+ },
+ );
+ },
+ child: AnimatedContainer(
+ duration: const Duration(milliseconds: 250),
+ padding: const EdgeInsets.all(10),
+ decoration: dailyChangeSelected
+ ? const BoxDecoration(
+ border: Border(
+ bottom: BorderSide(
+ color: AppColors.blackColor,
+ width: 2,
+ ),
+ ),
+ )
+ : const BoxDecoration(),
+ child: Text(
+ Strings.dailyGrowthStatiscsLable,
+ style: dailyChangeSelected
+ ? TextStyles.hightlightText.copyWith(
+ fontSize: screenWidth / 20,
+ )
+ : TextStyles.titleTextStyle.copyWith(
+ fontSize: screenWidth / 20,
+ ),
+ ),
+ ),
+ ),
],
),
),
- // Non-Scrollable PageView builder used to display the Charts
+ // Non-Scrollable PageView builder used to display the Statistics Charts
Container(
width: screenWidth,
height: screenHeight / 3.5,
@@ -257,12 +360,12 @@ class _InfoGraphWidgetState extends State {
}
// Bar Chart Visualisation for the Daily Data
-BarChartData mainBarData({
- @required List countryStatisticsList,
+BarChartData dailyBarChartData({
+ @required List countryStatisticsConfirmedList,
@required double screenWidth,
@required double screenHeight,
}) {
- final int countryStatisticsListLength = countryStatisticsList.length;
+ const int countryStatisticsConfirmedListLength = 7;
// Empty [BarChartGroupData] List. Intialised with [] to avoid error when trying to
// add items using the .add method
final List barChartData = [];
@@ -270,22 +373,30 @@ BarChartData mainBarData({
// Calculating the max value in the array to be passed onto the normalization function
// [normalizedValue]
final dailyStatisticsMax =
- countryStatisticsList[countryStatisticsListLength - 1].cases.toDouble();
+ countryStatisticsConfirmedList[countryStatisticsConfirmedListLength - 1]
+ .cases
+ .toDouble();
// Calculating the min value in the array to be passed onto the normalization function
// [normalizedValue]
final dailyStatisticsMin =
- countryStatisticsList[countryStatisticsListLength - 7].cases.toDouble();
+ countryStatisticsConfirmedList[countryStatisticsConfirmedListLength - 7]
+ .cases
+ .toDouble();
// Creating a buffer value to display the the top-most title on the left side bar
// for the [BarChartData]
- final leftTitleTopBuffer =
- countryStatisticsList[countryStatisticsListLength - 1].cases.toDouble() +
- countryStatisticsList[countryStatisticsListLength - 2].cases / 7.5;
+ final leftTitleTopBuffer = countryStatisticsConfirmedList[
+ countryStatisticsConfirmedListLength - 1]
+ .cases
+ .toDouble() +
+ countryStatisticsConfirmedList[countryStatisticsConfirmedListLength - 2]
+ .cases /
+ 7.5;
// Looping through the list to add each individual item with the normalized values
// to the [BarChartGroupData] which is used to plot the points on the graph
- countryStatisticsList.asMap().forEach(
+ countryStatisticsConfirmedList.asMap().forEach(
(index, item) {
barChartData.add(
BarChartGroupData(
@@ -298,7 +409,7 @@ BarChartData mainBarData({
oldMax: dailyStatisticsMax,
newMin: 4,
),
- color: AppColors.blueColor,
+ color: AppColors.confirmedColor,
width: screenWidth / 20,
backDrawRodData: BackgroundBarChartRodData(
show: true,
@@ -306,7 +417,7 @@ BarChartData mainBarData({
// so that the graph is not painted outside the container
y: 11,
// Background colour of the Bar Chart - Lighter Version than the filled lines
- color: AppColors.accentBlueColor,
+ color: AppColors.confirmedColor.withOpacity(0.3),
),
),
],
@@ -329,55 +440,62 @@ BarChartData mainBarData({
fitInsideVertically: true,
tooltipBgColor: Colors.blueAccent,
getTooltipItem: (group, groupIndex, rod, rodIndex) {
- // Iterating through the 7 items with the index of the [countryStatisticsListLength]
+ // Iterating through the 7 items with the index of the [countryStatisticsConfirmedListLength]
// to obtain the weekday of the particular day for the [BarTooltipItem]
String weekDay;
switch (group.x.toInt()) {
case 0:
weekDay = dailyWeekDay(
- date:
- countryStatisticsList[countryStatisticsListLength - 7].date,
+ date: countryStatisticsConfirmedList[
+ countryStatisticsConfirmedListLength - 7]
+ .date,
);
break;
case 1:
weekDay = dailyWeekDay(
- date:
- countryStatisticsList[countryStatisticsListLength - 6].date,
+ date: countryStatisticsConfirmedList[
+ countryStatisticsConfirmedListLength - 6]
+ .date,
);
break;
case 2:
weekDay = dailyWeekDay(
- date:
- countryStatisticsList[countryStatisticsListLength - 5].date,
+ date: countryStatisticsConfirmedList[
+ countryStatisticsConfirmedListLength - 5]
+ .date,
);
break;
case 3:
weekDay = dailyWeekDay(
- date:
- countryStatisticsList[countryStatisticsListLength - 4].date,
+ date: countryStatisticsConfirmedList[
+ countryStatisticsConfirmedListLength - 4]
+ .date,
);
break;
case 4:
weekDay = dailyWeekDay(
- date:
- countryStatisticsList[countryStatisticsListLength - 3].date,
+ date: countryStatisticsConfirmedList[
+ countryStatisticsConfirmedListLength - 3]
+ .date,
);
break;
case 5:
weekDay = dailyWeekDay(
- date:
- countryStatisticsList[countryStatisticsListLength - 2].date,
+ date: countryStatisticsConfirmedList[
+ countryStatisticsConfirmedListLength - 2]
+ .date,
);
break;
case 6:
weekDay = dailyWeekDay(
- date:
- countryStatisticsList[countryStatisticsListLength - 1].date,
+ date: countryStatisticsConfirmedList[
+ countryStatisticsConfirmedListLength - 1]
+ .date,
);
break;
}
return BarTooltipItem(
- '$weekDay \n ${countryStatisticsList[group.x].cases}',
+ '$weekDay \n ${countryStatisticsConfirmedList[group.x].cases}',
TextStyles.statisticsToopTipTextStyle.copyWith(
fontSize: screenWidth / 30,
),
@@ -399,9 +517,9 @@ BarChartData mainBarData({
reservedSize: screenWidth / 15,
getTitles: (value) {
if (value == 2) {
- return '${getUnitValue(countryStatisticsList[2].cases.toDouble())}';
+ return '${getUnitValue(countryStatisticsConfirmedList[2].cases.toDouble())}';
} else if (value == 6) {
- return '${getUnitValue(countryStatisticsList[3].cases.toDouble())}';
+ return '${getUnitValue(countryStatisticsConfirmedList[3].cases.toDouble())}';
} else if (value == 10) {
return '${getUnitValue(leftTitleTopBuffer)}';
} else {
@@ -419,43 +537,50 @@ BarChartData mainBarData({
reservedSize: screenWidth / 20,
margin: screenHeight / 175,
getTitles: (double value) {
- // Iterating through the 7 items with the index of the [countryStatisticsListLength]
+ // Iterating through the 7 items with the index of the [countryStatisticsConfirmedListLength]
// to obtain the Month
switch (value.toInt()) {
case 0:
return dailyMonthData(
- date:
- countryStatisticsList[countryStatisticsListLength - 7].date,
+ date: countryStatisticsConfirmedList[
+ countryStatisticsConfirmedListLength - 7]
+ .date,
);
case 1:
return dailyMonthData(
- date:
- countryStatisticsList[countryStatisticsListLength - 6].date,
+ date: countryStatisticsConfirmedList[
+ countryStatisticsConfirmedListLength - 6]
+ .date,
);
case 2:
return dailyMonthData(
- date:
- countryStatisticsList[countryStatisticsListLength - 5].date,
+ date: countryStatisticsConfirmedList[
+ countryStatisticsConfirmedListLength - 5]
+ .date,
);
case 3:
return dailyMonthData(
- date:
- countryStatisticsList[countryStatisticsListLength - 4].date,
+ date: countryStatisticsConfirmedList[
+ countryStatisticsConfirmedListLength - 4]
+ .date,
);
case 4:
return dailyMonthData(
- date:
- countryStatisticsList[countryStatisticsListLength - 3].date,
+ date: countryStatisticsConfirmedList[
+ countryStatisticsConfirmedListLength - 3]
+ .date,
);
case 5:
return dailyMonthData(
- date:
- countryStatisticsList[countryStatisticsListLength - 2].date,
+ date: countryStatisticsConfirmedList[
+ countryStatisticsConfirmedListLength - 2]
+ .date,
);
case 6:
return dailyMonthData(
- date:
- countryStatisticsList[countryStatisticsListLength - 1].date,
+ date: countryStatisticsConfirmedList[
+ countryStatisticsConfirmedListLength - 1]
+ .date,
);
default:
return '';
@@ -473,15 +598,15 @@ BarChartData mainBarData({
}
// Smooth Area Graph Visualisation for Weekly Data
-LineChartData areaChartData({
- @required List countryStatisticsList,
+LineChartData weeklyAreaGraphData({
+ @required List countryStatisticsConfirmedList,
@required double screenWidth,
@required double screenHeight,
}) {
- final int countryStatisticsListLength = countryStatisticsList.length;
+ const int countryStatisticsConfirmedListLength = 15;
final List gradientColors = [
- AppColors.blueColor,
- AppColors.accentBlueColor,
+ AppColors.confirmedColor,
+ AppColors.confirmedColor.withOpacity(0.3),
];
// Empty [FlSpot] List. Intialised with [] to avoid error when trying to
// add items using the .add method
@@ -490,22 +615,30 @@ LineChartData areaChartData({
// Calculating the max value in the array to be passed onto the normalization function
// [normalizedValue]
final weeklyStatisticsMax =
- countryStatisticsList[countryStatisticsListLength - 1].cases.toDouble();
+ countryStatisticsConfirmedList[countryStatisticsConfirmedListLength - 1]
+ .cases
+ .toDouble();
// Calculating the min value in the array to be passed onto the normalization function
// [normalizedValue]
final weeklyStatisticsMin =
- countryStatisticsList[countryStatisticsListLength - 15].cases.toDouble();
+ countryStatisticsConfirmedList[countryStatisticsConfirmedListLength - 15]
+ .cases
+ .toDouble();
// Creating a buffer value to display the the top-most title on the left side bar
// for the [LineChartData]
- final leftTitleTopBuffer =
- countryStatisticsList[countryStatisticsListLength - 1].cases.toDouble() +
- countryStatisticsList[countryStatisticsListLength - 2].cases / 5;
+ final leftTitleTopBuffer = countryStatisticsConfirmedList[
+ countryStatisticsConfirmedListLength - 1]
+ .cases
+ .toDouble() +
+ countryStatisticsConfirmedList[countryStatisticsConfirmedListLength - 2]
+ .cases /
+ 5;
// Looping through the list to add each individual item with the normalized values
// to [flSpotData] which is used to plot the points on the graph
- countryStatisticsList.asMap().forEach(
+ countryStatisticsConfirmedList.asMap().forEach(
(index, item) {
// Adding the indexes and the value to [flSpotData]
flSpotData.add(
@@ -539,10 +672,10 @@ LineChartData areaChartData({
getTitles: (value) {
switch (value.toInt()) {
case 1:
- return '${getUnitValue(countryStatisticsList[1].cases.toDouble())}';
+ return '${getUnitValue(countryStatisticsConfirmedList[1].cases.toDouble())}';
break;
case 7:
- return '${getUnitValue(countryStatisticsList[9].cases.toDouble())}';
+ return '${getUnitValue(countryStatisticsConfirmedList[9].cases.toDouble())}';
break;
case 13:
return '${getUnitValue(leftTitleTopBuffer)}';
@@ -565,11 +698,11 @@ LineChartData areaChartData({
getTitles: (value) {
switch (value.toInt()) {
case 2:
- return '${dailyMonthData(date: countryStatisticsList[2].date)}';
+ return '${dailyMonthData(date: countryStatisticsConfirmedList[2].date)}';
case 7:
- return '${dailyMonthData(date: countryStatisticsList[7].date)}';
+ return '${dailyMonthData(date: countryStatisticsConfirmedList[7].date)}';
case 12:
- return '${dailyMonthData(date: countryStatisticsList[12].date)}';
+ return '${dailyMonthData(date: countryStatisticsConfirmedList[12].date)}';
}
return '';
},
@@ -598,11 +731,11 @@ LineChartData areaChartData({
// Adding the dot and the line (on click of the dot) with relevant styling
return TouchedSpotIndicatorData(
FlLine(
- color: AppColors.accentBlueColor.withOpacity(0.5),
+ color: AppColors.confirmedColor.withOpacity(0.5),
),
FlDotData(
dotSize: screenWidth / 50,
- dotColor: AppColors.blueColor,
+ dotColor: AppColors.confirmedColor,
),
);
},
@@ -623,7 +756,7 @@ LineChartData areaChartData({
return touchedBarSpots.map((barSpot) {
final flSpot = barSpot;
return LineTooltipItem(
- '${dailyMonthData(date: countryStatisticsList[flSpot.x.toInt()].date)}\n${countryStatisticsList[flSpot.x.toInt()].cases}\nConfirmed',
+ '${dailyMonthData(date: countryStatisticsConfirmedList[flSpot.x.toInt()].date)}\n${countryStatisticsConfirmedList[flSpot.x.toInt()].cases}\nConfirmed',
TextStyles.statisticsToopTipTextStyle.copyWith(
fontSize: screenWidth / 30,
),
@@ -646,7 +779,7 @@ LineChartData areaChartData({
isStrokeCapRound: true,
dotData: FlDotData(
show: true,
- dotColor: AppColors.blueColor,
+ dotColor: AppColors.confirmedColor,
dotSize: screenWidth / 75,
),
belowBarData: BarAreaData(
@@ -665,6 +798,282 @@ LineChartData areaChartData({
);
}
+// Bar Chart Visualisation for the Daily Data
+BarChartData dailyChangeBarChartData({
+ @required List countryStatisticsConfirmedList,
+ @required List countryStatisticsRecoveredList,
+ @required double screenWidth,
+ @required double screenHeight,
+}) {
+ final double width = screenWidth / 65;
+
+ /// Method to group the 2 [BarChartRodData] with the given values
+ BarChartGroupData makeGroupData({
+ int x,
+ double y1,
+ double y2,
+ }) {
+ return BarChartGroupData(
+ barsSpace: screenWidth / 45,
+ x: x,
+ barRods: [
+ BarChartRodData(
+ y: y1,
+ color: AppColors.confirmedColor,
+ width: width,
+ ),
+ BarChartRodData(
+ y: y2,
+ color: AppColors.recoveredColor,
+ width: width,
+ ),
+ ],
+ );
+ }
+
+ const int countryStatisticsListLength = 8;
+ // Empty [BarChartGroupData] List. Intialised with [] to avoid error when trying to
+ // add items using the .add method
+ final List barChartData = [];
+
+ final List confirmedList = [];
+ final List recoveredList = [];
+
+ // Calcuating the daily change in confirmed cases
+ for (int index = 0; index < countryStatisticsListLength - 1; index++) {
+ confirmedList.add(countryStatisticsConfirmedList[index + 1].cases -
+ countryStatisticsConfirmedList[index].cases);
+ }
+
+ // Calcuating the daily change in recovered cases
+ for (int index = 0; index < countryStatisticsListLength - 1; index++) {
+ recoveredList.add(countryStatisticsRecoveredList[index + 1].cases -
+ countryStatisticsRecoveredList[index].cases);
+ }
+
+ // Calculating the max value (Between the [confirmedList] and [recoveredList]) in the array to be passed onto the normalization function
+ // [normalizedValue]
+ final dailyChangeMax =
+ math.max(confirmedList.reduce(math.max), recoveredList.reduce(math.max));
+
+ // Calculating the min value (Between the [confirmedList] and [recoveredList]) in the array to be passed onto the normalization function
+ // [normalizedValue]
+ final dailyChangeMin =
+ math.min(confirmedList.reduce(math.min), recoveredList.reduce(math.min));
+
+ // Creating a buffer value to display the the top-most title on the left side bar
+ // for the [BarChartData]
+ final leftTitleTopBuffer = dailyChangeMax + dailyChangeMax / 5;
+
+ // Looping through the list to add each individual item with the normalized values
+ // to the [BarChartGroupData] which is used to plot the points on the graph
+ for (int index = 0; index < countryStatisticsListLength - 1; index++) {
+ barChartData.add(
+ makeGroupData(
+ x: index,
+ y1: normalizedValue(
+ oldValue: confirmedList[index],
+ oldMax: dailyChangeMax.toDouble(),
+ oldMin: dailyChangeMin.toDouble(),
+ newMin: 2,
+ newMax: 9,
+ ),
+ y2: normalizedValue(
+ oldValue: recoveredList[index],
+ oldMax: dailyChangeMax.toDouble(),
+ oldMin: dailyChangeMin.toDouble(),
+ newMin: 2,
+ newMax: 9,
+ ),
+ ),
+ );
+ }
+
+ return BarChartData(
+ // Setting the max value of the Bar Chart (Y Axis) with a buffer
+ // so that the graph is not painted outside the container
+ maxY: 12,
+ groupsSpace: screenWidth / 16,
+ alignment: BarChartAlignment.center,
+
+ // Define the properties for the Bar Chart when touched over a plot
+ barTouchData: BarTouchData(
+ // Defining the properties of the ToolTip which occurs when touched/hovered over a plotted item
+ // [fitInsideHorizontally] and [fitInsideVertically] are set to true to fit the tooltip in the
+ // view of the Widget
+ touchTooltipData: BarTouchTooltipData(
+ fitInsideHorizontally: true,
+ fitInsideVertically: true,
+ tooltipBgColor: Colors.blueAccent,
+ getTooltipItem: (group, groupIndex, rod, rodIndex) {
+ // Iterating through the 7 items with the index of the [countryStatisticsConfirmedListLength]
+ // to obtain the weekday of the particular day for the [BarTooltipItem]
+ String weekDay;
+ switch (group.x.toInt()) {
+ case 0:
+ weekDay = dailyWeekDay(
+ date: countryStatisticsConfirmedList[
+ countryStatisticsListLength - 7]
+ .date,
+ );
+ break;
+ case 1:
+ weekDay = dailyWeekDay(
+ date: countryStatisticsConfirmedList[
+ countryStatisticsListLength - 6]
+ .date,
+ );
+ break;
+ case 2:
+ weekDay = dailyWeekDay(
+ date: countryStatisticsConfirmedList[
+ countryStatisticsListLength - 5]
+ .date,
+ );
+ break;
+ case 3:
+ weekDay = dailyWeekDay(
+ date: countryStatisticsConfirmedList[
+ countryStatisticsListLength - 4]
+ .date,
+ );
+ break;
+ case 4:
+ weekDay = dailyWeekDay(
+ date: countryStatisticsConfirmedList[
+ countryStatisticsListLength - 3]
+ .date,
+ );
+ break;
+ case 5:
+ weekDay = dailyWeekDay(
+ date: countryStatisticsConfirmedList[
+ countryStatisticsListLength - 2]
+ .date,
+ );
+ break;
+ case 6:
+ weekDay = dailyWeekDay(
+ date: countryStatisticsConfirmedList[
+ countryStatisticsListLength - 1]
+ .date,
+ );
+ break;
+ }
+ // Showing the confirmed cases if the first [BarChartRodData] of the [BarChartGroupData]
+ if (rodIndex == 0) {
+ return BarTooltipItem(
+ '$weekDay \n ${confirmedList[group.x]} \n Confirmed',
+ TextStyles.statisticsToopTipTextStyle.copyWith(
+ fontSize: screenWidth / 30,
+ ),
+ );
+ }
+
+ // Showing the confirmed cases if the second [BarChartRodData] of the [BarChartGroupData]
+ else {
+ return BarTooltipItem(
+ '$weekDay \n ${recoveredList[group.x]} \n Recovered',
+ TextStyles.statisticsToopTipTextStyle.copyWith(
+ fontSize: screenWidth / 30,
+ ),
+ );
+ }
+ },
+ ),
+ ),
+
+ // Side and Bottom Tiles
+ titlesData: FlTitlesData(
+ show: true,
+ // Side Titles
+ leftTitles: SideTitles(
+ showTitles: true,
+ textStyle: TextStyles.statisticsLabelTextStyle.copyWith(
+ fontSize: screenWidth / 33,
+ ),
+ margin: screenWidth / 22,
+ reservedSize: screenWidth / 15,
+ getTitles: (value) {
+ if (value == 2) {
+ return '${getUnitValue(math.min(confirmedList[0].toDouble(), recoveredList[0].toDouble()))}';
+ } else if (value == 11) {
+ return '${getUnitValue(leftTitleTopBuffer)}';
+ } else {
+ return '';
+ }
+ },
+ ),
+
+ // Bottom Titles
+ bottomTitles: SideTitles(
+ showTitles: true,
+ textStyle: TextStyles.statisticsLabelTextStyle.copyWith(
+ fontSize: screenWidth / 30,
+ ),
+ reservedSize: screenWidth / 20,
+ margin: screenHeight / 175,
+ getTitles: (double value) {
+ // Iterating through the 7 items with the index of the [countryStatisticsListLength]
+ // to obtain the Month
+ switch (value.toInt()) {
+ case 0:
+ return dailyMonthData(
+ date: countryStatisticsConfirmedList[
+ countryStatisticsListLength - 7]
+ .date,
+ );
+ case 1:
+ return dailyMonthData(
+ date: countryStatisticsConfirmedList[
+ countryStatisticsListLength - 6]
+ .date,
+ );
+ case 2:
+ return dailyMonthData(
+ date: countryStatisticsConfirmedList[
+ countryStatisticsListLength - 5]
+ .date,
+ );
+ case 3:
+ return dailyMonthData(
+ date: countryStatisticsConfirmedList[
+ countryStatisticsListLength - 4]
+ .date,
+ );
+ case 4:
+ return dailyMonthData(
+ date: countryStatisticsConfirmedList[
+ countryStatisticsListLength - 3]
+ .date,
+ );
+ case 5:
+ return dailyMonthData(
+ date: countryStatisticsConfirmedList[
+ countryStatisticsListLength - 2]
+ .date,
+ );
+ case 6:
+ return dailyMonthData(
+ date: countryStatisticsConfirmedList[
+ countryStatisticsListLength - 1]
+ .date,
+ );
+ default:
+ return '';
+ }
+ },
+ ),
+ ),
+
+ // Hiding the Box plotted around the Bar Chart
+ borderData: FlBorderData(
+ show: false,
+ ),
+ barGroups: barChartData,
+ );
+}
+
/// Method to return the Month from a given String of date of the `Zulu time` (UTC) format
String dailyMonthData({String date}) {
const monthData =
@@ -686,9 +1095,13 @@ String dailyWeekDay({String date}) {
}
/// Used to normalize the value of number of cases to a smaller quantity
-double normalizedValue(
- {int oldValue, double oldMax, double oldMin, int newMin}) {
- const int newMax = 10;
+double normalizedValue({
+ int oldValue,
+ double oldMax,
+ double oldMin,
+ int newMin = 0,
+ int newMax = 10,
+}) {
final double newValue =
(((oldValue - oldMin) * (newMax - newMin)) / (oldMax - oldMin)) + newMin;
return double.parse(newValue.toStringAsExponential(3));
diff --git a/lib/ui/statistics/widgets/info_widget.dart b/lib/ui/statistics/widgets/info_widget.dart
index 316f4e9..68fb01e 100644
--- a/lib/ui/statistics/widgets/info_widget.dart
+++ b/lib/ui/statistics/widgets/info_widget.dart
@@ -5,8 +5,7 @@ import 'package:covid19/constants/text_styles.dart';
import 'package:covid19/utils/device/device_utils.dart';
import 'package:covid19/widgets/sized_box_height_widget.dart';
-/// Displays the current summary information about the selected
-/// country
+/// Displays the current summary information about the selected country
///
/// **Requires**
/// 1. [infoColor] - For the iconColor and the title text
diff --git a/lib/ui/statistics/widgets/statistics_loading_widget.dart b/lib/ui/statistics/widgets/statistics_loading_widget.dart
index 7595c07..a2e8619 100644
--- a/lib/ui/statistics/widgets/statistics_loading_widget.dart
+++ b/lib/ui/statistics/widgets/statistics_loading_widget.dart
@@ -16,9 +16,9 @@ import 'package:covid19/widgets/sized_box_width_widget.dart';
/// is loading
/// **Requires**
/// 1. [selectedCountry] - to display the name of the country
-/// 3. [selectedCountryISO2] - to fetch the flag of the selected country (From
+/// 2. [selectedCountryISO2] - to fetch the flag of the selected country (From
/// the cache if already cached)
-/// 4. [today] - to display the current date of the user in EEEE, d MMMM y format
+/// 3. [today] - to display the current date of the user in EEEE, d MMMM y format
class HomeLoadingWidget extends StatelessWidget {
final String selectedCountry, selectedCountryISO2;
final DateTime today;
@@ -53,7 +53,7 @@ class HomeLoadingWidget extends StatelessWidget {
color: AppColors.blackColor,
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 50),
// Page Title
Text(
@@ -71,7 +71,7 @@ class HomeLoadingWidget extends StatelessWidget {
),
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 100),
// Global Title
@@ -98,7 +98,7 @@ class HomeLoadingWidget extends StatelessWidget {
],
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 100),
// Last Updated On Information
@@ -109,7 +109,7 @@ class HomeLoadingWidget extends StatelessWidget {
gradient: Shimmer.defaultGradient,
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 50),
// Details Button
@@ -132,7 +132,7 @@ class HomeLoadingWidget extends StatelessWidget {
],
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 75),
// Information Cards
@@ -204,7 +204,7 @@ class HomeLoadingWidget extends StatelessWidget {
),
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 35),
const Padding(
@@ -217,7 +217,7 @@ class HomeLoadingWidget extends StatelessWidget {
),
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 75),
// Country Title
@@ -262,7 +262,7 @@ class HomeLoadingWidget extends StatelessWidget {
],
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 200),
// Details Button
@@ -285,7 +285,7 @@ class HomeLoadingWidget extends StatelessWidget {
],
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 75),
// Information Cards
@@ -357,7 +357,7 @@ class HomeLoadingWidget extends StatelessWidget {
),
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 25),
// Confirmed Cases Label
@@ -375,7 +375,7 @@ class HomeLoadingWidget extends StatelessWidget {
],
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 75),
// Information Tab
@@ -383,7 +383,6 @@ class HomeLoadingWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
children: [
// Tab 1
- // Gesture Detector used to avoid the Ripple Effect caused in InkWell
Container(
padding: const EdgeInsets.all(10),
decoration: const BoxDecoration(
@@ -395,7 +394,7 @@ class HomeLoadingWidget extends StatelessWidget {
),
),
child: Text(
- 'Daily',
+ Strings.dailyStatiscsLable,
style: TextStyles.hightlightText.copyWith(
fontSize: screenWidth / 20,
),
@@ -403,15 +402,29 @@ class HomeLoadingWidget extends StatelessWidget {
),
// Horizontal Spacing
- SizedBoxWidthWidget(screenWidth / 15),
+ SizedBoxWidthWidget(screenWidth / 20),
// Tab 2
- // Gesture Detector used to avoid the Ripple Effect caused in InkWell
Container(
padding: const EdgeInsets.all(10),
decoration: const BoxDecoration(),
child: Text(
- 'Weekly',
+ Strings.weeklyStatiscsLable,
+ style: TextStyles.titleTextStyle.copyWith(
+ fontSize: screenWidth / 20,
+ ),
+ ),
+ ),
+
+ // Horizontal Spacing
+ SizedBoxWidthWidget(screenWidth / 20),
+
+ // Tab 3
+ Container(
+ padding: const EdgeInsets.all(10),
+ decoration: const BoxDecoration(),
+ child: Text(
+ Strings.dailyGrowthStatiscsLable,
style: TextStyles.titleTextStyle.copyWith(
fontSize: screenWidth / 20,
),
diff --git a/lib/ui/symptomChecker/symptom_checker_screen.dart b/lib/ui/symptomChecker/symptom_checker_screen.dart
index 506b51e..61bddce 100644
--- a/lib/ui/symptomChecker/symptom_checker_screen.dart
+++ b/lib/ui/symptomChecker/symptom_checker_screen.dart
@@ -49,6 +49,8 @@ class _SymptomCheckerScreenState extends State {
BuildContext fromHeroContext,
BuildContext toHeroContext,
) {
+ // Using a container with the same colour and radius as the [SymotomCheckerCardWidget] to ensure
+ // a smooth Hero animation
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
@@ -60,6 +62,9 @@ class _SymptomCheckerScreenState extends State {
},
child: Container(
color: AppColors.primaryColor,
+
+ // Wrapping the contents in [SafeArea] to avoid the Notch (When avaiable) and the bottom
+ // navigation bar (Mostly comes in use for iOS Devices)
child: SafeArea(
child: Scaffold(
backgroundColor: AppColors.primaryColor,
@@ -80,7 +85,7 @@ class _SymptomCheckerScreenState extends State {
// Back Icon
IconButton(
// padding: const EdgeInsets.all(0),
- icon: Icon(
+ icon: const Icon(
Covid19Icons.keyboardArrowLeft,
),
iconSize: screenWidth / 12,
@@ -88,7 +93,7 @@ class _SymptomCheckerScreenState extends State {
onPressed: () => Navigator.of(context).pop(),
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 50),
// Wrapping other items inside a container to add extra padding
@@ -110,7 +115,7 @@ class _SymptomCheckerScreenState extends State {
),
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 100),
// Symptom Checker Disclaimer
@@ -122,7 +127,7 @@ class _SymptomCheckerScreenState extends State {
),
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 35),
],
),
@@ -134,7 +139,7 @@ class _SymptomCheckerScreenState extends State {
child: const SymptomCheckerCards(),
),
- // Verical Spacing
+ // Vertical Spacing
SizedBoxHeightWidget(screenHeight / 35),
// Question Progress and Count
@@ -255,7 +260,7 @@ class _SymptomCheckerCardsState extends State
List data = [
const SymptomQuestionCard(
index: 0,
- color: AppColors.redColor,
+ color: AppColors.deadColor,
),
const SymptomQuestionCard(
index: 1,
@@ -271,7 +276,7 @@ class _SymptomCheckerCardsState extends State
),
const SymptomQuestionCard(
index: 4,
- color: AppColors.redColor,
+ color: AppColors.deadColor,
),
const SymptomQuestionCard(
index: 5,
@@ -389,7 +394,7 @@ class _SymptomCheckerCardsState extends State
}
},
).toList())
- : Center(
+ : const Center(
child: Text(
"Your Result",
style: TextStyle(
diff --git a/lib/ui/symptoms/symptoms_screen.dart b/lib/ui/symptoms/symptoms_screen.dart
new file mode 100644
index 0000000..e0ed2e1
--- /dev/null
+++ b/lib/ui/symptoms/symptoms_screen.dart
@@ -0,0 +1,98 @@
+import 'package:flutter/material.dart';
+import 'package:covid19/constants/colors.dart';
+import 'package:covid19/constants/dimens.dart';
+import 'package:covid19/constants/strings.dart';
+import 'package:covid19/constants/text_styles.dart';
+import 'package:covid19/icons/covid19_icons.dart';
+import 'package:covid19/data/symptoms_data.dart';
+import 'package:covid19/ui/symptoms/widgets/symptom_card_widget.dart';
+import 'package:covid19/utils/custom_scroll_behaviour.dart';
+import 'package:covid19/utils/device/device_utils.dart';
+import 'package:covid19/widgets/sized_box_height_widget.dart';
+
+/// Displays the list of Symptoms for Covid-19
+class SymptomsScreen extends StatelessWidget {
+ @override
+ Widget build(BuildContext context) {
+ final screenWidth = DeviceUtils.getScaledWidth(context, 1);
+ final screenHeight = DeviceUtils.getScaledHeight(context, 1);
+ return Scaffold(
+ // [AppBar] with 0 size used to set the statusbar background color and
+ // statusbat text/icon color
+ appBar: PreferredSize(
+ preferredSize: const Size.fromHeight(0.0),
+ child: AppBar(
+ backgroundColor: AppColors.whiteColor,
+ brightness: Brightness.light,
+ elevation: 0.0,
+ ),
+ ),
+
+ // Wrapping the contents in [SafeArea] to avoid the Notch (When avaiable) and the bottom
+ // navigation bar (Mostly comes in use for iOS Devices)
+ body: SafeArea(
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(
+ Dimens.horizontalPadding,
+ Dimens.verticalPadding / 0.75,
+ Dimens.horizontalPadding,
+ 0,
+ ),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ // Back Icon
+ GestureDetector(
+ onTap: () => Navigator.of(context).pop(),
+ child: Icon(
+ Covid19Icons.keyboardArrowLeft,
+ size: screenWidth / 12,
+ color: AppColors.blackColor,
+ ),
+ ),
+
+ // Vertical Spacing
+ SizedBoxHeightWidget(screenHeight / 50),
+
+ // Page Title
+ Text(
+ Strings.symptomsTitle,
+ style: TextStyles.statisticsHeadingTextStlye.copyWith(
+ fontSize: screenWidth / 15,
+ ),
+ ),
+
+ // Vertical Spacing
+ SizedBoxHeightWidget(screenHeight / 25),
+
+ // Symptom Items
+ // Wrapping the contents in a [Flexible] to make sure that the remaining space
+ // in the screen is filled (Removing this causes the overflow error to occur as
+ // a column does not allow scrolling inherently)
+ Flexible(
+ // Defining a [SingleChildScrollView] to scroll only the Symptom Items and not the header
+ child: ScrollConfiguration(
+ behavior: const CustomScrollBehaviour(),
+ child: SingleChildScrollView(
+ child: Column(
+ children: [
+ // Adding all the symptoms from [symptomsData] to the Column
+ for (final item in symptomsData)
+ SymptomCardWidget(
+ title: item.title,
+ description: item.description,
+ imageURL: item.imageURL,
+ )
+ ],
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/ui/symptoms/widgets/symptom_card_widget.dart b/lib/ui/symptoms/widgets/symptom_card_widget.dart
new file mode 100644
index 0000000..8724838
--- /dev/null
+++ b/lib/ui/symptoms/widgets/symptom_card_widget.dart
@@ -0,0 +1,94 @@
+import 'package:cached_network_image/cached_network_image.dart';
+import 'package:covid19/constants/colors.dart';
+import 'package:covid19/constants/text_styles.dart';
+import 'package:covid19/utils/cache_manager.dart';
+import 'package:covid19/utils/device/device_utils.dart';
+import 'package:covid19/widgets/sized_box_height_widget.dart';
+import 'package:flutter/material.dart';
+
+/// To Build the widget to display the card for each Symptom
+/// **Requires**
+/// 1. [title] - title of the Symptom
+/// 2. [description] - Description about the symptom
+/// 3. [imageURL] - URL for the image specific to the symptom
+class SymptomCardWidget extends StatelessWidget {
+ final String title, description, imageURL;
+
+ const SymptomCardWidget({
+ Key key,
+ @required this.title,
+ @required this.description,
+ @required this.imageURL,
+ }) : super(key: key);
+ @override
+ Widget build(BuildContext context) {
+ final screenWidth = DeviceUtils.getScaledWidth(context, 1);
+ final screenHeight = DeviceUtils.getScaledHeight(context, 1);
+ return Stack(
+ children: [
+ Align(
+ alignment: Alignment.centerRight,
+ child: Container(
+ width: screenWidth / 1.25,
+ margin: EdgeInsets.only(
+ bottom: screenHeight / 45,
+ ),
+ padding: EdgeInsets.only(
+ left: screenWidth / 10,
+ top: screenHeight / 50,
+ right: screenWidth / 25,
+ bottom: screenHeight / 30,
+ ),
+ decoration: const BoxDecoration(
+ boxShadow: [
+ BoxShadow(
+ offset: Offset(0, 0),
+ blurRadius: 1,
+ color: AppColors.boxShadowColor,
+ ),
+ ],
+ borderRadius: BorderRadius.all(
+ Radius.circular(20),
+ ),
+ color: AppColors.whiteColor,
+ ),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ title,
+ style: TextStyles.statisticsHeadingTextStlye.copyWith(
+ fontSize: screenWidth / 20,
+ ),
+ ),
+
+ // Vertical Spacing
+ SizedBoxHeightWidget(screenHeight / 75),
+
+ Text(
+ description,
+ style: TextStyles.statisticsSubHeadingTextStlye.copyWith(
+ fontSize: screenWidth / 25,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ Align(
+ alignment: Alignment.centerLeft,
+ child: Padding(
+ padding: EdgeInsets.only(
+ top: screenHeight / 50,
+ ),
+ child: CachedNetworkImage(
+ imageUrl: imageURL,
+ cacheManager: CacheManager(),
+ ),
+ ),
+ )
+ ],
+ );
+ }
+}
diff --git a/lib/utils/bloc/application_bloc.dart b/lib/utils/bloc/application_bloc.dart
index 029eb8c..7715d1c 100644
--- a/lib/utils/bloc/application_bloc.dart
+++ b/lib/utils/bloc/application_bloc.dart
@@ -1,3 +1,4 @@
+import 'package:covid19/data/symptoms_data.dart';
import 'package:flutter/material.dart';
import 'package:bloc/bloc.dart';
import 'package:covid19/data/network/constants/endpoints.dart';
@@ -50,7 +51,20 @@ class ApplicationBloc extends Bloc {
final CacheManager cacheManager = CacheManager();
// Caching the Covid-19 Prevention Do's and Don'ts
- await cacheManager.downloadFile(Endpoints.baseUrlPreventionInfographic);
+ await cacheManager.downloadFile(Endpoints.fetchPreventionGraphic);
+
+ // Caching the Home Graphi
+ await cacheManager.downloadFile(Endpoints.fetchHomeGraphic);
+
+ // Caching the Symptom Images
+ for (final item in symptomsData) {
+ try {
+ await cacheManager.downloadFile(item.imageURL);
+ } catch (e) {
+ debugPrint("Error while pre-caching: ${item.imageURL} due to: $e");
+ yield ApplicationNetworkException();
+ }
+ }
// Yielding the value to the output stream by passing all the data fetched
yield ApplicationInitialized(
@@ -66,7 +80,7 @@ class ApplicationBloc extends Bloc {
// Yielding Generic Exception - to be handled by main.dart to display error screen
catch (e) {
- debugPrint('Error in Authentical Blooc :- ${e.toString()}');
+ debugPrint('Error in Application Blooc :- ${e.toString()}');
yield ApplicationGenericException();
}
}
diff --git a/lib/utils/emoji_flags.dart b/lib/utils/emoji_flags.dart
index 196a523..e9b7f13 100644
--- a/lib/utils/emoji_flags.dart
+++ b/lib/utils/emoji_flags.dart
@@ -1312,7 +1312,9 @@ class Emoji {
/// Returns the Emoji Flag from the given ISO2 Code of the Country
factory Emoji.byISOCode(String isoCode) {
- return Emoji.all().firstWhere((Emoji emoji) => emoji.iso2Code == isoCode);
+ return Emoji.all().firstWhere(
+ (Emoji emoji) => emoji.iso2Code == isoCode,
+ );
}
@override
diff --git a/lib/widgets/country_picker/country_picker_dialog.dart b/lib/widgets/country_picker/country_picker_dialog.dart
index 02382e5..57fe477 100644
--- a/lib/widgets/country_picker/country_picker_dialog.dart
+++ b/lib/widgets/country_picker/country_picker_dialog.dart
@@ -212,11 +212,11 @@ class SingleChoiceDialogState extends State {
Widget _buildSearchField() {
return TextField(
cursorColor: widget.searchCursorColor,
- decoration: InputDecoration(
+ decoration: const InputDecoration(
prefixIcon: Icon(Icons.search),
hintText: Strings.countryDialogSearch,
- contentPadding: const EdgeInsets.all(1),
- border: const OutlineInputBorder(
+ contentPadding: EdgeInsets.all(1),
+ border: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(20),
),
diff --git a/lib/widgets/custom_alert_dialog.dart b/lib/widgets/custom_alert_dialog.dart
index f0696b4..9a4c4dd 100644
--- a/lib/widgets/custom_alert_dialog.dart
+++ b/lib/widgets/custom_alert_dialog.dart
@@ -113,10 +113,10 @@ class Dialog extends StatelessWidget {
children: [
Column(
mainAxisSize: MainAxisSize.min,
- children: [
- const CircularProgressIndicator(),
+ children: const [
+ CircularProgressIndicator(),
Padding(
- padding: const EdgeInsets.all(16.0),
+ padding: EdgeInsets.all(16.0),
child: Text(
"Fetching Data",
style: TextStyle(fontSize: 20, color: Colors.black54),
diff --git a/pubspec.lock b/pubspec.lock
index 873b5d0..8c766e0 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -21,21 +21,21 @@ packages:
name: archive
url: "https://pub.dartlang.org"
source: hosted
- version: "2.0.11"
+ version: "2.0.13"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
- version: "1.5.2"
+ version: "1.6.0"
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
- version: "2.4.0"
+ version: "2.4.1"
bloc:
dependency: "direct main"
description:
@@ -49,7 +49,7 @@ packages:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
- version: "1.0.5"
+ version: "2.0.0"
cached_network_image:
dependency: "direct main"
description:
@@ -63,7 +63,7 @@ packages:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
- version: "1.1.2"
+ version: "1.1.3"
clock:
dependency: transitive
description:
@@ -77,7 +77,7 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
- version: "1.14.11"
+ version: "1.14.12"
connectivity:
dependency: "direct main"
description:
@@ -119,7 +119,7 @@ packages:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
- version: "2.1.3"
+ version: "2.1.4"
csslib:
dependency: transitive
description:
@@ -211,7 +211,7 @@ packages:
name: image
url: "https://pub.dartlang.org"
source: hosted
- version: "2.1.4"
+ version: "2.1.12"
intl:
dependency: transitive
description:
@@ -407,7 +407,7 @@ packages:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
- version: "2.0.5"
+ version: "2.1.3"
rxdart:
dependency: transitive
description:
@@ -468,7 +468,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
- version: "1.5.5"
+ version: "1.7.0"
sqflite:
dependency: transitive
description:
@@ -622,7 +622,7 @@ packages:
name: xml
url: "https://pub.dartlang.org"
source: hosted
- version: "3.5.0"
+ version: "3.6.1"
yaml:
dependency: transitive
description:
diff --git a/test/asset_animations_test.dart b/test/asset_animations_test.dart
index 0d7e4d2..2960ca7 100644
--- a/test/asset_animations_test.dart
+++ b/test/asset_animations_test.dart
@@ -1,12 +1,7 @@
-//// Generated by spider on 2020-04-20 10:43:00.185277
+//// Generated by spider on 2020-04-23 23:00:37.074703
-import 'dart:io';
-
-import 'package:covid19/res/asset_animations.dart';
import 'package:test/test.dart';
void main() {
- test('asset_animations assets test', () {
- expect(true, File(AssetAnimations.splash).existsSync());
- });
+ test('asset_animations assets test', () {});
}
diff --git a/test/asset_images_test.dart b/test/asset_images_test.dart
index e111eaf..676a28f 100644
--- a/test/asset_images_test.dart
+++ b/test/asset_images_test.dart
@@ -1,4 +1,4 @@
-//// Generated by spider on 2020-04-20 11:45:57.780939
+//// Generated by spider on 2020-04-24 02:55:22.240050
import 'dart:io';
@@ -8,11 +8,15 @@ import 'package:test/test.dart';
void main() {
test('asset_images assets test', () {
expect(true, File(AssetImages.noInternet).existsSync());
+ expect(true, File(AssetImages.fact).existsSync());
expect(true, File(AssetImages.mythBusters).existsSync());
expect(true, File(AssetImages.virus).existsSync());
expect(true, File(AssetImages.prevention).existsSync());
+ expect(true, File(AssetImages.splash).existsSync());
+ expect(true, File(AssetImages.statistics).existsSync());
expect(true, File(AssetImages.genericError).existsSync());
- expect(true, File(AssetImages.latestNumbers).existsSync());
+ expect(true, File(AssetImages.faq).existsSync());
+ expect(true, File(AssetImages.myth).existsSync());
expect(true, File(AssetImages.symptoms).existsSync());
});
}