diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1ba9c33 --- /dev/null +++ b/.gitignore @@ -0,0 +1,43 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Exceptions to above rules. +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/.metadata b/.metadata new file mode 100644 index 0000000..366c3fa --- /dev/null +++ b/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 2294d75bfa8d067ba90230c0fc2268f3636d7584 + channel: beta + +project_type: app diff --git a/README.md b/README.md new file mode 100644 index 0000000..4ed5de9 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# CoviData India + +A data visualisation app for covid-19 cases in India + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) + +For help getting started with Flutter, view our +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 0000000..bc2100d --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,7 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java diff --git a/android/app/build.gradle b/android/app/build.gradle new file mode 100644 index 0000000..8a452a3 --- /dev/null +++ b/android/app/build.gradle @@ -0,0 +1,88 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply plugin: 'com.google.gms.google-services' +apply plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +def keystoreProperties = new Properties() +def keystorePropertiesFile = rootProject.file('key.properties') +if (keystorePropertiesFile.exists()) { + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) +} + +android { + compileSdkVersion 28 + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + lintOptions { + disable 'InvalidPackage' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "cheeseball.covidata" + minSdkVersion 16 + targetSdkVersion 28 + multiDexEnabled true + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + signingConfigs { + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null + storePassword keystoreProperties['storePassword'] + } + } + buildTypes { + release { + signingConfig signingConfigs.release + } + } + + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.release + } + } +} + +flutter { + source '../..' +} + +dependencies { + implementation 'com.google.firebase:firebase-analytics:17.2.2' + implementation 'com.google.firebase:firebase-auth:19.3.0' + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} diff --git a/android/app/google-services.json b/android/app/google-services.json new file mode 100644 index 0000000..8c78b69 --- /dev/null +++ b/android/app/google-services.json @@ -0,0 +1,77 @@ +{ + "project_info": { + "project_number": "203342229567", + "firebase_url": "https://chainbreaker-ad894.firebaseio.com", + "project_id": "chainbreaker-ad894", + "storage_bucket": "chainbreaker-ad894.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:203342229567:android:3d818ce8f6ea490e91888a", + "android_client_info": { + "package_name": "cheeseball.covidata" + } + }, + "oauth_client": [ + { + "client_id": "203342229567-utujfkdgm9k433kbtaquerqkpt8e0bdj.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "cheeseball.covidata", + "certificate_hash": "7e71874e2d0f5e9dddf798c61c8d83f272e34c8b" + } + }, + { + "client_id": "203342229567-j7qrqrt0p6gpj66knpc8csdb0lk4lh2b.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyBG5vVvQW5Ks-2CfW2ngfU0TMOETiGJ6Lk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "203342229567-j7qrqrt0p6gpj66knpc8csdb0lk4lh2b.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:203342229567:android:45da39a38af7d48091888a", + "android_client_info": { + "package_name": "cheeseball.covidata" + } + }, + "oauth_client": [ + { + "client_id": "203342229567-j7qrqrt0p6gpj66knpc8csdb0lk4lh2b.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyBG5vVvQW5Ks-2CfW2ngfU0TMOETiGJ6Lk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "203342229567-j7qrqrt0p6gpj66knpc8csdb0lk4lh2b.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..6d75025 --- /dev/null +++ b/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..be888d0 --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/kotlin/cheeseball/covidata/MainActivity.kt b/android/app/src/main/kotlin/cheeseball/covidata/MainActivity.kt new file mode 100644 index 0000000..0ba5dbd --- /dev/null +++ b/android/app/src/main/kotlin/cheeseball/covidata/MainActivity.kt @@ -0,0 +1,6 @@ +package cheeseball.covidata + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000..304732f --- /dev/null +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..8ea7d28 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.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 new file mode 100644 index 0000000..862f593 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.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 new file mode 100644 index 0000000..cb1fda6 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.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 new file mode 100644 index 0000000..4e3ef87 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.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 new file mode 100644 index 0000000..b34c053 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..1f83a33 --- /dev/null +++ b/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..6d75025 --- /dev/null +++ b/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/build.gradle b/android/build.gradle new file mode 100644 index 0000000..daaa821 --- /dev/null +++ b/android/build.gradle @@ -0,0 +1,32 @@ +buildscript { + ext.kotlin_version = '1.3.50' + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.google.gms:google-services:4.3.3' + classpath 'com.android.tools.build:gradle:3.5.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..38c8d45 --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,4 @@ +org.gradle.jvmargs=-Xmx1536M +android.enableR8=true +android.useAndroidX=true +android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..296b146 --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip diff --git a/android/key.properties b/android/key.properties new file mode 100644 index 0000000..15271b7 --- /dev/null +++ b/android/key.properties @@ -0,0 +1,4 @@ +storePassword=Mysterio-619 +keyPassword=Mysterio-619 +keyAlias=key +storeFile=../../../key.jks diff --git a/android/settings.gradle b/android/settings.gradle new file mode 100644 index 0000000..5a2f14f --- /dev/null +++ b/android/settings.gradle @@ -0,0 +1,15 @@ +include ':app' + +def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() + +def plugins = new Properties() +def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') +if (pluginsFile.exists()) { + pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } +} + +plugins.each { name, path -> + def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() + include ":$name" + project(":$name").projectDir = pluginDirectory +} diff --git a/assets/images/flutter-logo.png b/assets/images/flutter-logo.png new file mode 100644 index 0000000..8c0d456 Binary files /dev/null and b/assets/images/flutter-logo.png differ diff --git a/assets/images/github-logo.png b/assets/images/github-logo.png new file mode 100644 index 0000000..25ba1d6 Binary files /dev/null and b/assets/images/github-logo.png differ diff --git a/assets/launcher/background.png b/assets/launcher/background.png new file mode 100644 index 0000000..aabda04 Binary files /dev/null and b/assets/launcher/background.png differ diff --git a/assets/launcher/foreground.png b/assets/launcher/foreground.png new file mode 100644 index 0000000..c8d1df1 Binary files /dev/null and b/assets/launcher/foreground.png differ diff --git a/fonts/DarkerGrotesque-Black.ttf b/fonts/DarkerGrotesque-Black.ttf new file mode 100644 index 0000000..1745a7c Binary files /dev/null and b/fonts/DarkerGrotesque-Black.ttf differ diff --git a/fonts/DarkerGrotesque-Bold.ttf b/fonts/DarkerGrotesque-Bold.ttf new file mode 100644 index 0000000..995ddf9 Binary files /dev/null and b/fonts/DarkerGrotesque-Bold.ttf differ diff --git a/fonts/DarkerGrotesque-ExtraBold.ttf b/fonts/DarkerGrotesque-ExtraBold.ttf new file mode 100644 index 0000000..a96541e Binary files /dev/null and b/fonts/DarkerGrotesque-ExtraBold.ttf differ diff --git a/fonts/DarkerGrotesque-Light.ttf b/fonts/DarkerGrotesque-Light.ttf new file mode 100644 index 0000000..aeeed57 Binary files /dev/null and b/fonts/DarkerGrotesque-Light.ttf differ diff --git a/fonts/DarkerGrotesque-Medium.ttf b/fonts/DarkerGrotesque-Medium.ttf new file mode 100644 index 0000000..4102196 Binary files /dev/null and b/fonts/DarkerGrotesque-Medium.ttf differ diff --git a/fonts/DarkerGrotesque-Regular.ttf b/fonts/DarkerGrotesque-Regular.ttf new file mode 100644 index 0000000..2102ac7 Binary files /dev/null and b/fonts/DarkerGrotesque-Regular.ttf differ diff --git a/fonts/DarkerGrotesque-SemiBold.ttf b/fonts/DarkerGrotesque-SemiBold.ttf new file mode 100644 index 0000000..89a0fd9 Binary files /dev/null and b/fonts/DarkerGrotesque-SemiBold.ttf differ diff --git a/fonts/Megrim-Regular.ttf b/fonts/Megrim-Regular.ttf new file mode 100644 index 0000000..a9887d4 Binary files /dev/null and b/fonts/Megrim-Regular.ttf differ diff --git a/ios/.gitignore b/ios/.gitignore new file mode 100644 index 0000000..e96ef60 --- /dev/null +++ b/ios/.gitignore @@ -0,0 +1,32 @@ +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000..6b4c0f7 --- /dev/null +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 8.0 + + diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..592ceee --- /dev/null +++ b/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000..592ceee --- /dev/null +++ b/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..735f901 --- /dev/null +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,506 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 97C146F11CF9000F007C117D /* Supporting Files */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; + 97C146F11CF9000F007C117D /* Supporting Files */ = { + isa = PBXGroup; + children = ( + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1020; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = cheeseball.chainbreaker; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = cheeseball.chainbreaker; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = cheeseball.chainbreaker; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1d526a1 --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..a28140c --- /dev/null +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1d526a1 --- /dev/null +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..70693e4 --- /dev/null +++ b/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d36b1fa --- /dev/null +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "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", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} 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 new file mode 100644 index 0000000..dc9ada4 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png 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 new file mode 100644 index 0000000..28c6bf0 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png 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 new file mode 100644 index 0000000..2ccbfd9 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png 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 new file mode 100644 index 0000000..f091b6b Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png 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 new file mode 100644 index 0000000..4cde121 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png 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 new file mode 100644 index 0000000..d0ef06e Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png 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 new file mode 100644 index 0000000..dcdc230 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png 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 new file mode 100644 index 0000000..2ccbfd9 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png 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 new file mode 100644 index 0000000..c8f9ed8 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png 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 new file mode 100644 index 0000000..a6d6b86 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png 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 new file mode 100644 index 0000000..a6d6b86 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png 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 new file mode 100644 index 0000000..75b2d16 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png 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 new file mode 100644 index 0000000..c4df70d Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png 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 new file mode 100644 index 0000000..6a84f41 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png 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 new file mode 100644 index 0000000..d0e1f58 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000..0bedcf2 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000..89c2725 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f2e259c --- /dev/null +++ b/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f3c2851 --- /dev/null +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist new file mode 100644 index 0000000..5f0ca32 --- /dev/null +++ b/ios/Runner/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + chainbreaker + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..308a2a5 --- /dev/null +++ b/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/lib/main.dart b/lib/main.dart new file mode 100644 index 0000000..c9cf04e --- /dev/null +++ b/lib/main.dart @@ -0,0 +1,23 @@ +import 'package:covidata/pages/about.dart'; +import 'package:covidata/pages/splash.dart'; +import 'package:flutter/material.dart'; +import 'package:covidata/utils/theme.dart'; +import 'package:covidata/utils/theme_notifier.dart'; +import 'package:provider/provider.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +void main() { + runApp(ChangeNotifierProvider(create: (_) => ThemeNotifier(lightTheme), + child: MyApp())); +} + +class MyApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + final themeNotifier = Provider.of(context); + return MaterialApp( + theme: themeNotifier.getTheme(), + home: Splash(), + ); + } +} \ No newline at end of file diff --git a/lib/pages/about.dart b/lib/pages/about.dart new file mode 100644 index 0000000..bcc7c25 --- /dev/null +++ b/lib/pages/about.dart @@ -0,0 +1,239 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:covidata/pages/home.dart'; +import 'package:covidata/utils/data.dart'; +import 'package:share/share.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class About extends StatefulWidget { + final Data data; + About(this.data); + + @override + _AboutState createState() => _AboutState(); +} + +class _AboutState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Theme.of(context).backgroundColor, + appBar: AppBar( + elevation: 0.0, + centerTitle: true, + title: Hero( + tag: 'covidata', + child: Text('CoviData', + style: TextStyle( + color: + Theme.of(context).appBarTheme.textTheme.headline6.color, + fontFamily: 'Megrim', + fontSize: 28.0))), + iconTheme: IconThemeData(color: Colors.black54), + actions: [ + IconButton( + icon: Icon(Icons.share, color: Colors.black54), + onPressed: () => Share.share('This will be the share feature')) + ], + ), + drawer: Drawer( + child: ListView( + children: [ + DrawerHeader( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text('CoviData', + style: TextStyle( + color: Theme.of(context) + .appBarTheme + .textTheme + .headline6 + .color, + fontFamily: 'Megrim', + fontSize: 38.0)), + Text('India', style: TextStyle(fontSize: 18.0)) + ], + )), + ListTile( + leading: Icon(Icons.home), + title: Text('Home'), + onTap: () => Navigator.of(context).pushReplacement( + MaterialPageRoute( + builder: (BuildContext context) => Home(widget.data)))), + ListTile( + leading: Icon(Icons.call), + title: Text('Helpline'), + onTap: () => launch('tel:+91 11 23978046')), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Container( + color: Colors.blueGrey, + height: 0.25, + ), + ), + ListTile( + leading: Icon(Icons.info), title: Text('About'), onTap: () => Navigator.of(context).pop()) + ], + ), + ), + body: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text('About', + style: TextStyle( + fontWeight: FontWeight.w600, + color: Colors.black54, + fontFamily: 'Darker Grotesque', + fontSize: MediaQuery.of(context).size.width / 16)), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + 'CoviData India visualises COVID-19 data in India. ' + 'It provides live statistics, along with daily count of ' + 'confirmed, active, recovered and deceased patients. ' + 'CoviData covers nation level, state level and district level cases.', + style: TextStyle( + color: Colors.black87, + fontFamily: 'Darker Grotesque', + fontSize: MediaQuery.of(context).size.width / 24)), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text('API', + style: TextStyle( + fontWeight: FontWeight.w500, + color: Colors.black87, + fontFamily: 'Darker Grotesque', + fontSize: MediaQuery.of(context).size.width / 24)), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Text( + 'CoviData India uses COVID19-India API for sourcing it\'s data.', + textAlign: TextAlign.justify, + style: TextStyle( + color: Colors.black87, + fontFamily: 'Darker Grotesque', + fontSize: MediaQuery.of(context).size.width / 24)), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: GestureDetector( + onTap: () => launch('https://api.covid19india.org'), + child: Text('https://api.covid19india.org', + textAlign: TextAlign.justify, + style: TextStyle( + color: Colors.blue, + fontFamily: 'Darker Grotesque', + fontSize: MediaQuery.of(context).size.width / 24)), + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text('Disclaimer', + style: TextStyle( + fontWeight: FontWeight.w500, + color: Colors.black87, + fontFamily: 'Darker Grotesque', + fontSize: MediaQuery.of(context).size.width / 24)), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Text( + 'CoviData India does not collect any personal data, nor ' + 'does it require access to Bluetooth, and is in no way ' + 'meant to be an alternative to Aarogya Setu launched by ' + 'Govt. of India. Aarogya Setu provides government ' + 'guidelines to fight the pandemic and makes it easier to ' + 'backtrack potential COVID-19 cases. It is strongly ' + 'recommended that you download Aarogya Setu too.', + textAlign: TextAlign.justify, + style: TextStyle( + color: Colors.black87, + fontFamily: 'Darker Grotesque', + fontSize: MediaQuery.of(context).size.width / 24)), + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + DecoratedBox( + decoration: BoxDecoration( + border: Border.all(color: Colors.blue), + borderRadius: BorderRadius.all(Radius.circular(5.0))), + child: Column( + children: [ + Text( + 'Developed On', + style: TextStyle( + fontFamily: 'Darker Grotesque', + fontWeight: FontWeight.w600, + fontSize: MediaQuery.of(context).size.width / 24, + color: Colors.blue), + textAlign: TextAlign.center, + ), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(5.0)), + color: Colors.blue), + height: MediaQuery.of(context).size.width / 10, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Image.asset('assets/images/flutter-logo.png', + color: Colors.white), + ), + ) + ], + ), + ), + GestureDetector( + onTap: () => launch( + 'https://github.com/abhishekUpmanyu/covidata_india'), + child: DecoratedBox( + decoration: BoxDecoration( + border: Border.all(color: Colors.black), + borderRadius: BorderRadius.all(Radius.circular(5.0))), + child: Column( + children: [ + Text( + 'Open Source', + style: TextStyle( + fontFamily: 'Darker Grotesque', + fontWeight: FontWeight.w600, + fontSize: MediaQuery.of(context).size.width / 24), + textAlign: TextAlign.center, + ), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(5.0)), + color: Colors.black), + height: MediaQuery.of(context).size.width / 10, + child: Padding( + padding: const EdgeInsets.all(10.0), + child: Image.asset('assets/images/github-logo.png', + color: Colors.white), + ), + ) + ], + ), + ), + ), + ], + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/district_page.dart b/lib/pages/district_page.dart new file mode 100644 index 0000000..b06d419 --- /dev/null +++ b/lib/pages/district_page.dart @@ -0,0 +1,141 @@ +import 'package:flutter/material.dart'; +import 'package:covidata/utils/data.dart'; +import 'package:covidata/utils/data_containers.dart'; +import 'package:charts_flutter/flutter.dart' as charts; + +class DistrictPage extends StatefulWidget { + final DistrictData data; + + DistrictPage(this.data); + + @override + _DistrictPageState createState() => _DistrictPageState(); +} + +class _DistrictPageState extends State { + bool _animateCharts = true; + + @override + void initState() { + Future.delayed(Duration(milliseconds: 500), () => _animateCharts = false); + super.initState(); + } + + List> _seriesPieData() { + var pieData = [ + CADRPie('Active', widget.data.active, Color(0xff0099cf)), + CADRPie('Recovered', widget.data.recovered, Color(0xff61dd74)), + CADRPie('Deceased', widget.data.deceased, Color(0xffe75f5f)) + ]; + return [ + charts.Series( + data: pieData, + domainFn: (CADRPie cadr, _) => cadr.label, + measureFn: (CADRPie cadr, _) => cadr.value, + colorFn: (CADRPie cadr, _) => + charts.ColorUtil.fromDartColor(cadr.color), + id: 'Cases Pie Chart', + labelAccessorFn: (CADRPie cadr, _) => '${cadr.value}') + ]; + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: AppBar( + title: Text(widget.data.name, style: TextStyle(color: Colors.black54)), + centerTitle: true, + leading: IconButton( + icon: Icon(Icons.arrow_back_ios, color: Colors.black54), + onPressed: () => Navigator.of(context).pop(), + ), + ), + body: Column( + children: [ + Text('Total Cases (${widget.data.confirmed} Confirmed)', + style: TextStyle( + fontFamily: 'Darker Grotesque', + fontSize: MediaQuery.of(context).size.width / 24, + fontWeight: FontWeight.w500)), + Padding( + padding: EdgeInsets.symmetric( + horizontal: MediaQuery.of(context).size.width / 20), + child: SizedBox( + height: MediaQuery.of(context).size.height / 3, + child: Row( + children: [ + Flexible( + flex: 2, + child: charts.PieChart( + _seriesPieData(), + animate: _animateCharts, + animationDuration: Duration(milliseconds: 300), + defaultRenderer: charts.ArcRendererConfig( + arcWidth: MediaQuery.of(context).size.width ~/ 6, + arcRendererDecorators: [ + charts.ArcLabelDecorator( + labelPosition: charts.ArcLabelPosition.auto) + ]), + ), + ), + Flexible( + flex: 1, + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Icon(Icons.lens, color: Color(0xff0099cf)), + Padding( + padding: const EdgeInsets.all(8.0), + child: Hero( + tag: 'activetext', + child: Text('Active', + style: Theme.of(context) + .textTheme + .bodyText1)), + ) + ], + ), + Row( + children: [ + Icon(Icons.lens, color: Color(0xff61dd74)), + Padding( + padding: const EdgeInsets.all(8.0), + child: Hero( + tag: 'recoveredtext', + child: Text('Recovered', + style: Theme.of(context) + .textTheme + .bodyText1)), + ) + ], + ), + Row( + children: [ + Icon(Icons.lens, color: Color(0xffe75f5f)), + Padding( + padding: const EdgeInsets.all(8.0), + child: Hero( + tag: 'deceasedtext', + child: Text('Deceased', + style: Theme.of(context) + .textTheme + .bodyText1)), + ) + ], + ) + ], + ), + ) + ], + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/district_wise.dart b/lib/pages/district_wise.dart new file mode 100644 index 0000000..3bf3c86 --- /dev/null +++ b/lib/pages/district_wise.dart @@ -0,0 +1,293 @@ +import 'package:flutter/material.dart'; +import 'package:covidata/pages/district_page.dart'; +import 'package:covidata/utils/data.dart'; +import 'package:covidata/utils/sort.dart'; + +class DistrictWise extends StatefulWidget { + final StateData data; + + DistrictWise(this.data); + + @override + _DistrictWiseState createState() => _DistrictWiseState(); +} + +class _DistrictWiseState extends State { + Sort _sort = Sort.ascending; + SortParameter _parameter = SortParameter.name; + + @override + void initState() { + super.initState(); + } + + Widget _stateListTile(int index) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: Material( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + color: Colors.white, + elevation: 16.0, + child: InkWell( + onTap: () => Navigator.of(context).push(MaterialPageRoute( + builder: (BuildContext context) => + DistrictPage(widget.data.districts[index]))), + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Text(widget.data.districts[index].name, + overflow: TextOverflow.fade, + style: TextStyle( + fontSize: MediaQuery.of(context).size.width / 24, + fontFamily: 'Darker Grotesque', + fontWeight: FontWeight.w500)), + ), + Text(widget.data.districts[index].confirmed.toString(), + style: TextStyle( + fontFamily: 'Darker Grotesque', + fontSize: MediaQuery.of(context).size.width / 24, + fontWeight: FontWeight.w500)) + ], + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Flexible( + flex: widget.data.districts[index].active, + child: Container( + height: 5, + color: Color(0xff0099cf), + ), + ), + Flexible( + flex: widget.data.districts[index].deceased, + child: Container(height: 5, color: Color(0xffe75f5f)), + ), + Flexible( + flex: widget.data.districts[index].deceased, + child: Container( + height: 5, + color: Color(0xff61dd74), + ), + ) + ], + ), + Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('Active', + style: TextStyle( + fontFamily: 'Darker Grotesque', + color: Color(0xff0099cf), + fontWeight: FontWeight.w500)), + Text(widget.data.districts[index].active.toString(), + style: TextStyle( + fontFamily: 'Darker Grotesque', + color: Color(0xff0099cf), + fontWeight: FontWeight.w600)) + ], + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('Recovered', + style: TextStyle( + fontFamily: 'Darker Grotesque', + color: Color(0xff61dd74), + fontWeight: FontWeight.w500)), + Text(widget.data.districts[index].recovered.toString(), + style: TextStyle( + fontFamily: 'Darker Grotesque', + color: Color(0xff61dd74), + fontWeight: FontWeight.w600)) + ], + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('Deceased', + style: TextStyle( + fontFamily: 'Darker Grotesque', + color: Color(0xffe75f5f), + fontWeight: FontWeight.w500)), + Text(widget.data.districts[index].deceased.toString(), + style: TextStyle( + fontFamily: 'Darker Grotesque', + color: Color(0xffe75f5f), + fontWeight: FontWeight.w600)) + ], + ), + ) + ], + ) + ], + ), + ), + ), + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Theme.of(context).backgroundColor, + appBar: AppBar( + title: Text('Districts', style: TextStyle(color: Colors.black54)), + centerTitle: true, + leading: IconButton( + icon: Icon(Icons.arrow_back_ios, color: Colors.black54), + onPressed: () => Navigator.of(context).pop(), + ), + ), + body: Column( + children: [ + /*Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Container( + decoration: BoxDecoration( + color: _parameter == SortParameter.name + ? Theme.of(context).accentColor + : Theme.of(context).backgroundColor, + borderRadius: BorderRadius.all(Radius.circular(100.0))), + child: GestureDetector( + onTap: () => + setState(() => _parameter = SortParameter.name), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text('Name', + textAlign: TextAlign.center, + style: _parameter == SortParameter.name + ? Theme.of(context).accentTextTheme.button + : Theme.of(context).textTheme.button), + ), + )), + Container( + decoration: BoxDecoration( + color: _parameter == SortParameter.confirmed + ? Theme.of(context).accentColor + : Theme.of(context).backgroundColor, + borderRadius: BorderRadius.all(Radius.circular(100.0))), + child: GestureDetector( + onTap: () => + setState(() => _parameter = SortParameter.confirmed), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text('Confirmed', + textAlign: TextAlign.center, + style: _parameter == SortParameter.confirmed + ? Theme.of(context).accentTextTheme.button + : Theme.of(context).textTheme.button), + ), + )), + Container( + decoration: BoxDecoration( + color: _parameter == SortParameter.active + ? Theme.of(context).accentColor + : Theme.of(context).backgroundColor, + borderRadius: BorderRadius.all(Radius.circular(100.0))), + child: GestureDetector( + onTap: () => + setState(() => _parameter = SortParameter.active), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text('Active', + textAlign: TextAlign.center, + style: _parameter == SortParameter.active + ? Theme.of(context).accentTextTheme.button + : Theme.of(context).textTheme.button), + ), + )), + Container( + decoration: BoxDecoration( + color: _parameter == SortParameter.recovered + ? Theme.of(context).accentColor + : Theme.of(context).backgroundColor, + borderRadius: BorderRadius.all(Radius.circular(100.0))), + child: GestureDetector( + onTap: () => + setState(() => _parameter = SortParameter.recovered), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text('Recovered', + textAlign: TextAlign.center, + style: _parameter == SortParameter.recovered + ? Theme.of(context).accentTextTheme.button + : Theme.of(context).textTheme.button), + ), + )), + Container( + decoration: BoxDecoration( + color: _parameter == SortParameter.deceased + ? Theme.of(context).accentColor + : Theme.of(context).backgroundColor, + borderRadius: BorderRadius.all(Radius.circular(100.0))), + child: GestureDetector( + onTap: () => + setState(() => _parameter = SortParameter.deceased), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text('Deceased', + textAlign: TextAlign.center, + style: _parameter == SortParameter.deceased + ? Theme.of(context).accentTextTheme.button + : Theme.of(context).textTheme.button), + ), + )), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(100.0))), + child: GestureDetector( + onTap: () => setState(() => _sort = _sort == Sort.ascending + ? Sort.descending + : Sort.ascending), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Row( + children: [ + Icon( + Icons.keyboard_arrow_down, + color: _sort == Sort.ascending + ? Colors.black12 + : Colors.black87, + ), + Icon( + Icons.keyboard_arrow_up, + color: _sort == Sort.descending + ? Colors.black12 + : Colors.black87, + ) + ], + ), + ), + )) + ], + ),*/ + Expanded( + child: GridView.builder( + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2), + itemCount: widget.data.districts.length, + itemBuilder: (context, index) => _stateListTile(index)), + ), + ], + ), + ); + } +} diff --git a/lib/pages/home.dart b/lib/pages/home.dart new file mode 100644 index 0000000..ede971f --- /dev/null +++ b/lib/pages/home.dart @@ -0,0 +1,467 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:covidata/pages/about.dart'; +import 'package:covidata/pages/live_stats.dart'; +import 'package:covidata/pages/news.dart'; +import 'package:covidata/pages/search.dart'; +import 'package:covidata/utils/data.dart'; +import 'package:share/share.dart'; +import 'package:swipe_up/swipe_up.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class Home extends StatefulWidget { + final Data data; + + Home(this.data); + + @override + _HomeState createState() => _HomeState(); +} + +class _HomeState extends State { + Daily _yesterday; + Daily _today; + + @override + void initState() { + _setYTData(); + super.initState(); + } + + void _setYTData() { + if (DateTime.now().day == widget.data.caseData.daily.last.date.day) { + _today = widget.data.caseData.daily.last; + _yesterday = + widget.data.caseData.daily[widget.data.caseData.daily.length - 2]; + } else { + _yesterday = widget.data.caseData.daily.last; + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Theme.of(context).backgroundColor, + appBar: AppBar( + elevation: 0.0, + centerTitle: true, + title: Hero( + tag: 'covidata', + child: Text('CoviData', + style: TextStyle( + color: + Theme.of(context).appBarTheme.textTheme.headline6.color, + fontFamily: 'Megrim', + fontSize: 28.0))), + iconTheme: IconThemeData(color: Colors.black54), + actions: [ + IconButton( + icon: Icon(Icons.share, color: Colors.black54), + onPressed: () => Share.share( + 'Download this amazing app that provides visualised COVID-19 ' + 'data in India. https://play.google.com/store/apps/details?id=abhishekupmanyu.asciiemojis')) + ], + ), + drawer: Drawer( + child: ListView( + children: [ + DrawerHeader( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text('CoviData', + style: TextStyle( + color: Theme.of(context) + .appBarTheme + .textTheme + .headline6 + .color, + fontFamily: 'Megrim', + fontSize: 38.0)), + Text('India', style: TextStyle(fontSize: 18.0)) + ], + )), + ListTile( + leading: Icon(Icons.home), + title: Text('Home'), + onTap: () => Navigator.of(context).pop()), + ListTile( + leading: Icon(Icons.call), + title: Text('Helpline'), + onTap: () => launch('tel:+91 11 23978046')), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Container( + color: Colors.blueGrey, + height: 0.25, + ), + ), + ListTile( + leading: Icon(Icons.info), + title: Text('About'), + onTap: () => Navigator.of(context).pushReplacement( + MaterialPageRoute( + builder: (BuildContext context) => About(widget.data)))) + ], + ), + ), + body: SwipeUp( + onSwipe: () => Navigator.of(context).push(MaterialPageRoute( + builder: (BuildContext context) => News( + 'https://www.google.com/search?tbm=nws&q=covid+19+india&oq=covid', + ))), + child: Text('News on COVID-19', + style: TextStyle( + fontFamily: 'Darker Grotesque', + fontSize: MediaQuery.of(context).size.width / 24)), + color: Theme.of(context).textTheme.bodyText1.color, + body: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Hero( + tag: 'searchbar', + child: Padding( + padding: EdgeInsets.all(MediaQuery.of(context).size.width / 24), + child: Material( + color: Theme.of(context).cardColor, + borderRadius: BorderRadius.all(Radius.circular(5.0)), + elevation: 16.0, + child: GestureDetector( + onTap: () { + Navigator.of(context).push(MaterialPageRoute( + builder: (BuildContext context) => + Search(widget.data))); + }, + child: Row( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Icon(Icons.search), + ), + Expanded( + child: Text( + 'Search for District or State', + style: TextStyle( + fontFamily: 'Darker Grotesque', + fontSize: + MediaQuery.of(context).size.width / 24, + color: Colors.black54), + ), + ), + ], + ), + ), + ), + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text(widget.data.caseData.confirmed.toString(), + style: TextStyle( + fontFamily: 'Darker Grotesque', + fontWeight: FontWeight.w500, + fontSize: MediaQuery.of(context).size.width / 10), + textAlign: TextAlign.center), + Text('Cases Confirmed', + style: TextStyle( + fontFamily: 'Darker Grotesque', + fontSize: MediaQuery.of(context).size.width / 24), + textAlign: TextAlign.center), + Padding( + padding: EdgeInsets.only( + bottom: MediaQuery.of(context).size.height / 40)), + Material( + elevation: 8.0, + child: Padding( + padding: EdgeInsets.symmetric( + vertical: MediaQuery.of(context).size.height / 40), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Column( + children: [ + Text(widget.data.caseData.active.toString(), + style: TextStyle( + fontFamily: 'Darker Grotesque', + color: Color(0xff0099cf), + fontSize: + MediaQuery.of(context).size.width / + 20, + fontWeight: FontWeight.bold)), + Padding( + padding: const EdgeInsets.all(4.0), + child: Hero( + tag: 'activetext', + child: Text('Active', + style: TextStyle( + fontFamily: 'Darker Grotesque', + decoration: TextDecoration.none, + color: Color(0xff0099cf), + fontSize: MediaQuery.of(context) + .size + .width / + 28)), + ), + ), + ], + ), + Container( + color: Colors.blueGrey, + width: 1, + height: MediaQuery.of(context).size.height / 20, + ), + Column( + children: [ + Text(widget.data.caseData.recovered.toString(), + style: TextStyle( + fontFamily: 'Darker Grotesque', + color: Color(0xff61dd74), + fontSize: + MediaQuery.of(context).size.width / + 20, + fontWeight: FontWeight.bold)), + Padding( + padding: const EdgeInsets.all(4.0), + child: Hero( + tag: 'recoveredtext', + child: Text('Recovered', + style: TextStyle( + fontFamily: 'Darker Grotesque', + decoration: TextDecoration.none, + color: Color(0xff61dd74), + fontSize: MediaQuery.of(context) + .size + .width / + 28)), + ), + ), + ], + ), + Container( + color: Colors.blueGrey, + width: 1, + height: MediaQuery.of(context).size.height / 20, + ), + Column( + children: [ + Text(widget.data.caseData.deceased.toString(), + style: TextStyle( + fontFamily: 'Darker Grotesque', + color: Color(0xffe75f5f), + fontSize: + MediaQuery.of(context).size.width / + 20, + fontWeight: FontWeight.bold)), + Padding( + padding: const EdgeInsets.all(4.0), + child: Hero( + tag: 'deceasedtext', + child: Text('Deceased', + style: TextStyle( + fontFamily: 'Darker Grotesque', + decoration: TextDecoration.none, + color: Color(0xffe75f5f), + fontSize: MediaQuery.of(context) + .size + .width / + 28)), + ), + ), + ], + ), + ], + ), + ), + ), + Material( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(5.0), + bottomRight: Radius.circular(5.0)), + elevation: 16.0, + color: Colors.blue, + child: InkWell( + onTap: () => Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) => + LiveStats(widget.data))), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('View Data', + style: TextStyle( + color: Colors.white, + fontSize: + MediaQuery.of(context).size.width / + 24, + fontFamily: 'Darker Grotesque', + fontWeight: FontWeight.w600)), + Icon(Icons.navigate_next, color: Colors.white) + ], + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only( + bottom: MediaQuery.of(context).size.height / 40)), + Row( + children: [ + Expanded( + child: Material( + borderRadius: + BorderRadius.all(Radius.circular(5.0)), + color: Theme.of(context).cardColor, + elevation: 16.0, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text('Yesterday', + style: TextStyle( + fontFamily: 'Darker Grotesque', + fontSize: MediaQuery.of(context) + .size + .width / + 18)), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text('Confirmed', + style: TextStyle( + fontFamily: + 'Darker Grotesque')), + Text(_yesterday.confirmed.toString(), + style: TextStyle( + fontFamily: 'Darker Grotesque', + fontWeight: FontWeight.w600)) + ], + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text('Recovered', + style: TextStyle( + fontFamily: 'Darker Grotesque', + color: Color(0xff61dd74))), + Text(_yesterday.recovered.toString(), + style: TextStyle( + fontFamily: 'Darker Grotesque', + color: Color(0xff61dd74), + fontWeight: FontWeight.w600)) + ], + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text('Deceased', + style: TextStyle( + fontFamily: 'Darker Grotesque', + color: Color(0xffe75f5f))), + Text(_yesterday.deceased.toString(), + style: TextStyle( + fontFamily: 'Darker Grotesque', + color: Color(0xffe75f5f), + fontWeight: FontWeight.w600)) + ], + ), + ) + ], + ), + ), + ), + ), + Padding(padding: EdgeInsets.only(right: 8.0)), + Expanded( + child: Material( + borderRadius: + BorderRadius.all(Radius.circular(5.0)), + color: Theme.of(context).cardColor, + elevation: 16.0, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text('Today So Far', + style: TextStyle( + fontFamily: 'Darker Grotesque', + fontSize: MediaQuery.of(context) + .size + .width / + 18)), + ), + Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text('Confirmed', + style: TextStyle( + fontFamily: + 'Darker Grotesque')), + Text( + _today == null + ? (widget.data.caseData + .confirmed - + widget.data.caseData + .daily + .reduce((a, b) => Daily( + confirmed: a + .confirmed + + b + .confirmed)) + .confirmed) + .toString() + : _today.confirmed + .toString(), + style: TextStyle( + fontFamily: + 'Darker Grotesque', + fontWeight: + FontWeight.w600)) + ], + ), + ) + ], + ) + ], + ), + ), + ), + ) + ], + ) + ], + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/live_stats.dart b/lib/pages/live_stats.dart new file mode 100644 index 0000000..4aa3d77 --- /dev/null +++ b/lib/pages/live_stats.dart @@ -0,0 +1,385 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:covidata/pages/state_wise.dart'; +import 'package:covidata/utils/data.dart'; +import 'package:covidata/utils/data_containers.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:covidata/utils/graph_duration.dart'; + +class LiveStats extends StatefulWidget { + final Data data; + + LiveStats(this.data); + + @override + _LiveStatsState createState() => _LiveStatsState(); +} + +class _LiveStatsState extends State { + SwiperController _swiperController = SwiperController(); + bool _animateCharts = true; + + GraphDuration _graphDuration = GraphDuration.lifetime; + + final List _lineGraphTitle = [ + 'Daily Data', + 'Daily Confirmed', + 'Daily Recovered', + 'Daily Deceased' + ]; + + List> _seriesPieData = + List>(); + + @override + void initState() { + Future.delayed(Duration(milliseconds: 500), () => _animateCharts = false); + _generatePieData(); + super.initState(); + } + + _generatePieData() { + var pieData = [ + CADRPie('Active', widget.data.caseData.active, Color(0xff0099cf)), + CADRPie('Recovered', widget.data.caseData.recovered, Color(0xff61dd74)), + CADRPie('Deceased', widget.data.caseData.deceased, Color(0xffe75f5f)) + ]; + _seriesPieData.add(charts.Series( + data: pieData, + domainFn: (CADRPie cadr, _) => cadr.label, + measureFn: (CADRPie cadr, _) => cadr.value, + colorFn: (CADRPie cadr, _) => + charts.ColorUtil.fromDartColor(cadr.color), + id: 'Cases Pie Chart', + labelAccessorFn: (CADRPie cadr, _) => '${cadr.value}')); + } + + List> _dailyConfirmedData() { + int maxIndex = _graphDuration == GraphDuration.week + ? 7 + : _graphDuration == GraphDuration.month + ? 30 + : widget.data.caseData.daily.length; + var confirmedData = List.generate( + maxIndex, + (index) => DateVsValue( + widget + .data + .caseData + .daily[widget.data.caseData.daily.length - maxIndex + index] + .date, + widget + .data + .caseData + .daily[widget.data.caseData.daily.length - maxIndex + index] + .confirmed + .toDouble())); + return [ + charts.Series( + id: 'ID', + data: confirmedData, + colorFn: (__, _) => charts.ColorUtil.fromDartColor(Color(0xff0099cf)), + domainFn: (DateVsValue dvv, _) => dvv.date, + measureFn: (DateVsValue dvv, _) => dvv.value) + ]; + } + + List> _dailyRecoveredData() { + int maxIndex = _graphDuration == GraphDuration.week + ? 7 + : _graphDuration == GraphDuration.month + ? 30 + : widget.data.caseData.daily.length; + var recoveredData = List.generate( + maxIndex, + (index) => DateVsValue( + widget + .data + .caseData + .daily[widget.data.caseData.daily.length - maxIndex + index] + .date, + widget + .data + .caseData + .daily[widget.data.caseData.daily.length - maxIndex + index] + .recovered + .toDouble())); + return [ + charts.Series( + id: 'ID', + data: recoveredData, + colorFn: (__, _) => charts.ColorUtil.fromDartColor(Color(0xff61dd74)), + domainFn: (DateVsValue dvv, _) => dvv.date, + measureFn: (DateVsValue dvv, _) => dvv.value) + ]; + } + + List> _dailyDeceasedData() { + int maxIndex = _graphDuration == GraphDuration.week + ? 7 + : _graphDuration == GraphDuration.month + ? 30 + : widget.data.caseData.daily.length; + var deceasedData = List.generate( + maxIndex, + (index) => DateVsValue( + widget + .data + .caseData + .daily[widget.data.caseData.daily.length - maxIndex + index] + .date, + widget + .data + .caseData + .daily[widget.data.caseData.daily.length - maxIndex + index] + .deceased + .toDouble())); + return [ + charts.Series( + id: 'ID', + data: deceasedData, + colorFn: (__, _) => charts.ColorUtil.fromDartColor(Color(0xffe75f5f)), + domainFn: (DateVsValue dvv, _) => dvv.date, + measureFn: (DateVsValue dvv, _) => dvv.value) + ]; + } + + Widget _swiperGraph(int index) { + var data = [ + _dailyConfirmedData(), + _dailyRecoveredData(), + _dailyDeceasedData() + ]; + if (index == 0) { + return charts.TimeSeriesChart([data[0][0], data[1][0], data[2][0]], + defaultRenderer: charts.LineRendererConfig(includeArea: true), + behaviors: [charts.PanAndZoomBehavior()], + animate: _animateCharts); + } + return charts.TimeSeriesChart(data[index - 1], + defaultRenderer: charts.LineRendererConfig(includeArea: true), + behaviors: [ + charts.PanAndZoomBehavior(), + ], + animate: _animateCharts); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: AppBar( + title: Text('India', style: TextStyle(color: Colors.black54)), + centerTitle: true, + leading: IconButton( + icon: Icon(Icons.arrow_back_ios, color: Colors.black54), + onPressed: () => Navigator.of(context).pop(), + ), + ), + body: Column( + children: [ + Text('Total Cases (${widget.data.caseData.confirmed} Confirmed)', + style: TextStyle( + fontFamily: 'Darker Grotesque', + fontSize: MediaQuery.of(context).size.width / 24, + fontWeight: FontWeight.w500)), + Padding( + padding: EdgeInsets.symmetric( + horizontal: MediaQuery.of(context).size.width / 20), + child: SizedBox( + height: MediaQuery.of(context).size.height / 3, + child: Row( + children: [ + Flexible( + flex: 2, + child: charts.PieChart( + _seriesPieData, + animate: _animateCharts, + animationDuration: Duration(milliseconds: 300), + defaultRenderer: charts.ArcRendererConfig( + arcWidth: MediaQuery.of(context).size.width ~/ 6, + arcRendererDecorators: [ + charts.ArcLabelDecorator( + labelPosition: charts.ArcLabelPosition.auto) + ]), + ), + ), + Flexible( + flex: 1, + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Icon(Icons.lens, color: Color(0xff0099cf)), + Padding( + padding: const EdgeInsets.all(8.0), + child: Hero( + tag: 'activetext', + child: Text('Active', + style: Theme.of(context) + .textTheme + .bodyText1)), + ) + ], + ), + Row( + children: [ + Icon(Icons.lens, color: Color(0xff61dd74)), + Padding( + padding: const EdgeInsets.all(8.0), + child: Hero( + tag: 'recoveredtext', + child: Text('Recovered', + style: Theme.of(context) + .textTheme + .bodyText1)), + ) + ], + ), + Row( + children: [ + Icon(Icons.lens, color: Color(0xffe75f5f)), + Padding( + padding: const EdgeInsets.all(8.0), + child: Hero( + tag: 'deceasedtext', + child: Text('Deceased', + style: Theme.of(context) + .textTheme + .bodyText1)), + ) + ], + ) + ], + ), + ) + ], + ), + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + _swiperController.index == null + ? _lineGraphTitle[0] + : _lineGraphTitle[_swiperController.index], + style: TextStyle( + fontFamily: 'Darker Grotesque', + fontSize: MediaQuery.of(context).size.width / 24, + fontWeight: FontWeight.w500)), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Container( + width: MediaQuery.of(context).size.width / 6, + decoration: BoxDecoration( + color: _graphDuration == GraphDuration.week + ? Theme.of(context).accentColor + : Theme.of(context).backgroundColor, + borderRadius: BorderRadius.all(Radius.circular(100))), + child: GestureDetector( + onTap: () => setState(() { + _graphDuration = GraphDuration.week; + }), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text('Week', + textAlign: TextAlign.center, + style: _graphDuration == GraphDuration.week + ? Theme.of(context).accentTextTheme.button + : Theme.of(context).textTheme.button), + ), + )), + Container( + width: MediaQuery.of(context).size.width / 6, + decoration: BoxDecoration( + color: _graphDuration == GraphDuration.month + ? Theme.of(context).accentColor + : Theme.of(context).backgroundColor, + borderRadius: BorderRadius.all(Radius.circular(100))), + child: GestureDetector( + onTap: () => setState(() { + _graphDuration = GraphDuration.month; + }), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text('Month', + textAlign: TextAlign.center, + style: _graphDuration == GraphDuration.month + ? Theme.of(context).accentTextTheme.button + : Theme.of(context).textTheme.button), + ), + )), + Container( + width: MediaQuery.of(context).size.width / 6, + decoration: BoxDecoration( + color: _graphDuration == GraphDuration.lifetime + ? Theme.of(context).accentColor + : Theme.of(context).backgroundColor, + borderRadius: BorderRadius.all(Radius.circular(100))), + child: GestureDetector( + onTap: () => setState(() { + _graphDuration = GraphDuration.lifetime; + }), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text('Lifetime', + textAlign: TextAlign.center, + style: _graphDuration == GraphDuration.lifetime + ? Theme.of(context).accentTextTheme.button + : Theme.of(context).textTheme.button), + ), + )), + ], + ), + Expanded( + child: Swiper( + itemCount: 4, + itemBuilder: (context, index) => Padding( + padding: const EdgeInsets.all(16.0), + child: _swiperGraph(index), + ), + pagination: SwiperPagination(), + controller: _swiperController, + onIndexChanged: (index) => setState(() { + _swiperController.index = index; + }), + )), + Padding( + padding: const EdgeInsets.all(8.0), + child: Material( + elevation: 16.0, + borderRadius: BorderRadius.all(Radius.circular((5.0))), + color: Colors.blue, + child: InkWell( + onTap: () => Navigator.of(context).push(MaterialPageRoute( + builder: (BuildContext context) => + StateWise(widget.data))), + child: Row(children: [ + Padding( + padding: const EdgeInsets.all(12.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('View Statewise Data', + style: TextStyle( + color: Colors.white, + fontSize: + MediaQuery.of(context).size.width / 24, + fontFamily: 'Darker Grotesque', + fontWeight: FontWeight.w600)), + Icon(Icons.navigate_next, color: Colors.white) + ], + )) + ]), + ), + )) + ], + ), + ); + } +} diff --git a/lib/pages/news.dart b/lib/pages/news.dart new file mode 100644 index 0000000..1b60e15 --- /dev/null +++ b/lib/pages/news.dart @@ -0,0 +1,22 @@ +import 'package:flutter/material.dart'; +import 'package:webview_flutter/webview_flutter.dart'; + +class News extends StatelessWidget { + final String url; + News(this.url); + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + backgroundColor: Colors.white, + elevation: 0.0, + leading: IconButton(icon: Icon(Icons.clear, color: Colors.black54), onPressed: () => Navigator.of(context).pop()), + title: Text('COVID-19 News', style: TextStyle(color: Colors.black54)), + centerTitle: true, + ), + body: WebView( + initialUrl: url, + ), + ); + } +} diff --git a/lib/pages/search.dart b/lib/pages/search.dart new file mode 100644 index 0000000..541aa28 --- /dev/null +++ b/lib/pages/search.dart @@ -0,0 +1,216 @@ +import 'package:flutter/material.dart'; +import 'package:covidata/pages/district_page.dart'; +import 'package:covidata/pages/state_page.dart'; +import 'package:covidata/utils/data.dart'; + +class Search extends StatefulWidget { + final Data data; + + Search(this.data); + + @override + _SearchState createState() => _SearchState(); +} + +class _SearchState extends State { + TextEditingController _controller = TextEditingController(); + + List _states = List(); + List _districts = List(); + + @override + void initState() { + _controller.addListener(() { + _states = List(); + _districts = List(); + widget.data.caseData.states.forEach((state) { + if (state.name.toLowerCase().contains(_controller.text.toLowerCase())) { + _states.add(state); + } + state.districts.forEach((district) { + if (district.name + .toLowerCase() + .contains(_controller.text.toLowerCase())) { + _districts.add(district); + } + }); + }); + setState(() {}); + }); + super.initState(); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + Widget _searchListItem(int index) { + return Material( + elevation: 16.0, + color: Theme.of(context).cardColor, + child: InkWell( + onTap: () { + Navigator.of(context).pushReplacement(MaterialPageRoute( + builder: (BuildContext context) => index < _states.length + ? StatePage(_states[index]) + : DistrictPage(_districts[index - _states.length])));}, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + index < _states.length + ? _states[index].name + : _districts[index - _states.length].name, + style: TextStyle( + color: Theme.of(context).textTheme.bodyText1.color, + fontFamily: 'Darker Grotesque', + fontWeight: FontWeight.w400, + fontSize: MediaQuery.of(context).size.width / 20)), + Container( + width: MediaQuery.of(context).size.width / 8, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(2.0)), + color: + index < _states.length ? Colors.orange : Colors.green, + ), + child: Text(index < _states.length ? 'State' : 'District', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontFamily: 'Darker Grotesque', + fontWeight: FontWeight.w700)), + ) + ], + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Expanded( + child: Text( + index < _states.length + ? _states[index].confirmed.toString() + : _districts[index - _states.length] + .confirmed + .toString(), + textAlign: TextAlign.center), + ), + Container( + width: 1, + height: 16.0, + color: Colors.blueGrey, + ), + Expanded( + child: Text( + index < _states.length + ? _states[index].active.toString() + : _districts[index - _states.length] + .active + .toString(), + textAlign: TextAlign.center, + style: TextStyle(color: Color(0xff0099cf)), + ), + ), + Container( + width: 1, + height: 16.0, + color: Colors.blueGrey, + ), + Expanded( + child: Text( + index < _states.length + ? _states[index].recovered.toString() + : _districts[index - _states.length] + .recovered + .toString(), + textAlign: TextAlign.center, + style: TextStyle(color: Color(0xff61dd74))), + ), + Container( + width: 1, + height: 16.0, + color: Colors.blueGrey, + ), + Expanded( + child: Text( + index < _states.length + ? _states[index].deceased.toString() + : _districts[index - _states.length] + .deceased + .toString(), + textAlign: TextAlign.center, + style: TextStyle(color: Color(0xffe75f5f)), + ), + ) + ], + ), + ) + ], + ), + ), + ), + ); + } + + @override + Widget build(BuildContext context) { + return SafeArea( + child: Container( + color: Colors.white, + child: Column( + children: [ + Hero( + tag: 'searchbar', + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Material( + color: Theme.of(context).cardColor, + borderRadius: BorderRadius.all(Radius.circular(5.0)), + elevation: 16.0, + child: Row( + children: [ + GestureDetector( + onTap: () => Navigator.of(context).pop(), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Icon(Icons.navigate_before), + ), + ), + Expanded( + child: TextField( + controller: _controller, + autofocus: true, + decoration: InputDecoration( + border: InputBorder.none, + hintText: 'Search for District or State', hintStyle: TextStyle( + fontFamily: 'Darker Grotesque', + fontSize: + MediaQuery.of(context).size.width / 24, + color: Colors.black54)), + ), + ), + ], + ), + ), + ), + ), + _controller.text.isEmpty + ? Container() + : Expanded( + child: ListView.builder( + itemCount: _states.length + _districts.length, + itemBuilder: (context, index) => + _searchListItem(index))) + ], + ), + ), + ); + } +} diff --git a/lib/pages/splash.dart b/lib/pages/splash.dart new file mode 100644 index 0000000..6dc9123 --- /dev/null +++ b/lib/pages/splash.dart @@ -0,0 +1,51 @@ +import 'package:covidata/pages/home.dart'; +import 'package:flutter/material.dart'; +import 'package:covidata/utils/data.dart'; + +class Splash extends StatefulWidget { + @override + _SplashState createState() => _SplashState(); +} + +class _SplashState extends State { + Data data = Data(); + + final List _widgets = [ + Hero( + tag: 'covidata', + child: Text('CoviData', + style: TextStyle(fontFamily: 'Megrim', fontSize: 42.0))) + ]; + + @override + void initState() { + Future.delayed( + Duration(milliseconds: 1500), + () => setState(() => _widgets.add(Text('India', + style: TextStyle( + fontFamily: 'Darker Grotesque', + fontSize: MediaQuery.of(context).size.width / 18))))); + Future.delayed( + Duration(milliseconds: 3000), + () => setState(() => _widgets.add(Padding( + padding: const EdgeInsets.all(16.0), + child: CircularProgressIndicator(), + )))); + Future.delayed( + Duration(milliseconds: 3000), + () => data.getData().whenComplete(() => Navigator.of(context) + .pushReplacement(MaterialPageRoute( + builder: (BuildContext context) => Home(data))))); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Material( + color: Theme.of(context).backgroundColor, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: _widgets, + )); + } +} diff --git a/lib/pages/state_page.dart b/lib/pages/state_page.dart new file mode 100644 index 0000000..841f16f --- /dev/null +++ b/lib/pages/state_page.dart @@ -0,0 +1,358 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:covidata/pages/district_wise.dart'; +import 'package:covidata/utils/data.dart'; +import 'package:covidata/utils/data_containers.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:covidata/utils/graph_duration.dart'; + +class StatePage extends StatefulWidget { + final StateData data; + + StatePage(this.data); + + @override + _StatePageState createState() => _StatePageState(); +} + +class _StatePageState extends State { + SwiperController _swiperController = SwiperController(); + bool _animateCharts = true; + + GraphDuration _graphDuration = GraphDuration.lifetime; + + final List _lineGraphTitle = [ + 'Daily Data', + 'Daily Confirmed', + 'Daily Recovered', + 'Daily Deceased' + ]; + + @override + void initState() { + Future.delayed(Duration(milliseconds: 500), () => _animateCharts = false); + super.initState(); + } + + List> _seriesPieData() { + var pieData = [ + CADRPie('Active', widget.data.active, Color(0xff0099cf)), + CADRPie('Recovered', widget.data.recovered, Color(0xff61dd74)), + CADRPie('Deceased', widget.data.deceased, Color(0xffe75f5f)) + ]; + return [ + charts.Series( + data: pieData, + domainFn: (CADRPie cadr, _) => cadr.label, + measureFn: (CADRPie cadr, _) => cadr.value, + colorFn: (CADRPie cadr, _) => + charts.ColorUtil.fromDartColor(cadr.color), + id: 'Cases Pie Chart', + labelAccessorFn: (CADRPie cadr, _) => '${cadr.value}') + ]; + } + + List> _dailyConfirmedData() { + int maxIndex = _graphDuration == GraphDuration.week + ? 7 + : _graphDuration == GraphDuration.month ? 30 : widget.data.daily.length; + var confirmedData = List.generate( + maxIndex, + (index) => DateVsValue( + widget.data.daily[widget.data.daily.length - maxIndex + index].date, + widget.data.daily[widget.data.daily.length - maxIndex + index] + .confirmed + .toDouble())); + return [ + charts.Series( + id: 'ID', + data: confirmedData, + colorFn: (__, _) => charts.ColorUtil.fromDartColor(Color(0xff0099cf)), + domainFn: (DateVsValue dvv, _) => dvv.date, + measureFn: (DateVsValue dvv, _) => dvv.value) + ]; + } + + List> _dailyRecoveredData() { + int maxIndex = _graphDuration == GraphDuration.week + ? 7 + : _graphDuration == GraphDuration.month ? 30 : widget.data.daily.length; + var recoveredData = List.generate( + maxIndex, + (index) => DateVsValue( + widget.data.daily[widget.data.daily.length - maxIndex + index].date, + widget.data.daily[widget.data.daily.length - maxIndex + index] + .recovered + .toDouble())); + return [ + charts.Series( + id: 'ID', + data: recoveredData, + colorFn: (__, _) => charts.ColorUtil.fromDartColor(Color(0xff61dd74)), + domainFn: (DateVsValue dvv, _) => dvv.date, + measureFn: (DateVsValue dvv, _) => dvv.value) + ]; + } + + List> _dailyDeceasedData() { + int maxIndex = _graphDuration == GraphDuration.week + ? 7 + : _graphDuration == GraphDuration.month ? 30 : widget.data.daily.length; + var deceasedData = List.generate( + maxIndex, + (index) => DateVsValue( + widget.data.daily[widget.data.daily.length - maxIndex + index].date, + widget.data.daily[widget.data.daily.length - maxIndex + index] + .deceased + .toDouble())); + return [ + charts.Series( + id: 'ID', + data: deceasedData, + colorFn: (__, _) => charts.ColorUtil.fromDartColor(Color(0xffe75f5f)), + domainFn: (DateVsValue dvv, _) => dvv.date, + measureFn: (DateVsValue dvv, _) => dvv.value) + ]; + } + + Widget _swiperGraph(int index) { + var data = [ + _dailyConfirmedData(), + _dailyRecoveredData(), + _dailyDeceasedData() + ]; + if (index == 0) { + return charts.TimeSeriesChart([data[0][0], data[1][0], data[2][0]], + defaultRenderer: charts.LineRendererConfig(includeArea: true), + behaviors: [ + charts.PanAndZoomBehavior(), + ], + animate: _animateCharts); + } + return charts.TimeSeriesChart(data[index - 1], + defaultRenderer: charts.LineRendererConfig(includeArea: true), + behaviors: [ + charts.PanAndZoomBehavior(), + ], + animate: _animateCharts); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: AppBar( + title: Text(widget.data.name, style: TextStyle(color: Colors.black54)), + centerTitle: true, + leading: IconButton( + icon: Icon(Icons.arrow_back_ios, color: Colors.black54), + onPressed: () => Navigator.of(context).pop(), + ), + ), + body: Column( + children: [ + Text('Total Cases (${widget.data.confirmed} Confirmed)', + style: TextStyle( + fontFamily: 'Darker Grotesque', + fontSize: MediaQuery.of(context).size.width / 24, + fontWeight: FontWeight.w500)), + Padding( + padding: EdgeInsets.symmetric( + horizontal: MediaQuery.of(context).size.width / 20), + child: SizedBox( + height: MediaQuery.of(context).size.height / 3, + child: Row( + children: [ + Flexible( + flex: 2, + child: charts.PieChart( + _seriesPieData(), + animate: _animateCharts, + animationDuration: Duration(milliseconds: 300), + defaultRenderer: charts.ArcRendererConfig( + arcWidth: MediaQuery.of(context).size.width ~/ 6, + arcRendererDecorators: [ + charts.ArcLabelDecorator( + labelPosition: charts.ArcLabelPosition.auto) + ]), + ), + ), + Flexible( + flex: 1, + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Icon(Icons.lens, color: Color(0xff0099cf)), + Padding( + padding: const EdgeInsets.all(8.0), + child: Hero( + tag: 'activetext', + child: Text('Active', + style: Theme.of(context) + .textTheme + .bodyText1)), + ) + ], + ), + Row( + children: [ + Icon(Icons.lens, color: Color(0xff61dd74)), + Padding( + padding: const EdgeInsets.all(8.0), + child: Hero( + tag: 'recoveredtext', + child: Text('Recovered', + style: Theme.of(context) + .textTheme + .bodyText1)), + ) + ], + ), + Row( + children: [ + Icon(Icons.lens, color: Color(0xffe75f5f)), + Padding( + padding: const EdgeInsets.all(8.0), + child: Hero( + tag: 'deceasedtext', + child: Text('Deceased', + style: Theme.of(context) + .textTheme + .bodyText1)), + ) + ], + ) + ], + ), + ) + ], + ), + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + _swiperController.index == null + ? _lineGraphTitle[0] + : _lineGraphTitle[_swiperController.index], + style: TextStyle( + fontFamily: 'Darker Grotesque', + fontSize: MediaQuery.of(context).size.width / 24, + fontWeight: FontWeight.w500)), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Container( + width: MediaQuery.of(context).size.width / 6, + decoration: BoxDecoration( + color: _graphDuration == GraphDuration.week + ? Theme.of(context).accentColor + : Theme.of(context).backgroundColor, + borderRadius: BorderRadius.all(Radius.circular(100))), + child: GestureDetector( + onTap: () => setState(() { + _graphDuration = GraphDuration.week; + }), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text('Week', + textAlign: TextAlign.center, + style: _graphDuration == GraphDuration.week + ? Theme.of(context).accentTextTheme.button + : Theme.of(context).textTheme.button), + ), + )), + Container( + width: MediaQuery.of(context).size.width / 6, + decoration: BoxDecoration( + color: _graphDuration == GraphDuration.month + ? Theme.of(context).accentColor + : Theme.of(context).backgroundColor, + borderRadius: BorderRadius.all(Radius.circular(100))), + child: GestureDetector( + onTap: () => setState(() { + _graphDuration = GraphDuration.month; + }), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text('Month', + textAlign: TextAlign.center, + style: _graphDuration == GraphDuration.month + ? Theme.of(context).accentTextTheme.button + : Theme.of(context).textTheme.button), + ), + )), + Container( + width: MediaQuery.of(context).size.width / 6, + decoration: BoxDecoration( + color: _graphDuration == GraphDuration.lifetime + ? Theme.of(context).accentColor + : Theme.of(context).backgroundColor, + borderRadius: BorderRadius.all(Radius.circular(100))), + child: GestureDetector( + onTap: () => setState(() { + _graphDuration = GraphDuration.lifetime; + }), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text('Lifetime', + textAlign: TextAlign.center, + style: _graphDuration == GraphDuration.lifetime + ? Theme.of(context).accentTextTheme.button + : Theme.of(context).textTheme.button), + ), + )), + ], + ), + Expanded( + child: Swiper( + itemCount: 4, + itemBuilder: (context, index) => Padding( + padding: const EdgeInsets.all(16.0), + child: _swiperGraph(index), + ), + pagination: SwiperPagination(), + controller: _swiperController, + onIndexChanged: (index) => setState(() { + _swiperController.index = index; + }), + )), + Padding( + padding: const EdgeInsets.all(8.0), + child: Material( + elevation: 16.0, + borderRadius: BorderRadius.all(Radius.circular((5.0))), + color: Colors.blue, + child: InkWell( + onTap: () => Navigator.of(context).push(MaterialPageRoute( + builder: (BuildContext context) => + DistrictWise(widget.data))), + child: Row(children: [ + Padding( + padding: const EdgeInsets.all(12.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('View Districtwise Data', + style: TextStyle( + color: Colors.white, + fontSize: + MediaQuery.of(context).size.width / 24, + fontFamily: 'Darker Grotesque', + fontWeight: FontWeight.w600)), + Icon(Icons.navigate_next, color: Colors.white) + ], + )) + ]), + ), + )) + ], + ), + ); + } +} diff --git a/lib/pages/state_wise.dart b/lib/pages/state_wise.dart new file mode 100644 index 0000000..6e710c2 --- /dev/null +++ b/lib/pages/state_wise.dart @@ -0,0 +1,295 @@ +import 'package:flutter/material.dart'; +import 'package:covidata/pages/state_page.dart'; +import 'package:covidata/utils/data.dart'; +import 'package:covidata/utils/sort.dart'; + +class StateWise extends StatefulWidget { + final Data data; + + StateWise(this.data); + + @override + _StateWiseState createState() => _StateWiseState(); +} + +class _StateWiseState extends State { + Sort _sort = Sort.ascending; + SortParameter _parameter = SortParameter.name; + + Widget _stateListTile(int index) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: Material( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + color: Colors.white, + elevation: 16.0, + child: InkWell( + onTap: () => Navigator.of(context).push(MaterialPageRoute( + builder: (BuildContext context) => + StatePage(widget.data.caseData.states[index]))), + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Text(widget.data.caseData.states[index].name, + overflow: TextOverflow.fade, + style: TextStyle( + fontSize: MediaQuery.of(context).size.width / 24, + fontFamily: 'Darker Grotesque', + fontWeight: FontWeight.w500)), + ), + Text( + widget.data.caseData.states[index].confirmed.toString(), + style: TextStyle( + fontFamily: 'Darker Grotesque', + fontSize: MediaQuery.of(context).size.width / 24, + fontWeight: FontWeight.w500)) + ], + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Flexible( + flex: widget.data.caseData.states[index].active, + child: Container( + height: 5, + color: Color(0xff0099cf), + ), + ), + Flexible( + flex: widget.data.caseData.states[index].deceased, + child: Container(height: 5, color: Color(0xffe75f5f)), + ), + Flexible( + flex: widget.data.caseData.states[index].deceased, + child: Container( + height: 5, + color: Color(0xff61dd74), + ), + ) + ], + ), + Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('Active', + style: TextStyle( + fontFamily: 'Darker Grotesque', + color: Color(0xff0099cf), + fontWeight: FontWeight.w500)), + Text( + widget.data.caseData.states[index].active + .toString(), + style: TextStyle( + fontFamily: 'Darker Grotesque', + color: Color(0xff0099cf), + fontWeight: FontWeight.w600)) + ], + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('Recovered', + style: TextStyle( + fontFamily: 'Darker Grotesque', + color: Color(0xff61dd74), + fontWeight: FontWeight.w500)), + Text( + widget.data.caseData.states[index].recovered + .toString(), + style: TextStyle( + fontFamily: 'Darker Grotesque', + color: Color(0xff61dd74), + fontWeight: FontWeight.w600)) + ], + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('Deceased', + style: TextStyle( + fontFamily: 'Darker Grotesque', + color: Color(0xffe75f5f), + fontWeight: FontWeight.w500)), + Text( + widget.data.caseData.states[index].deceased + .toString(), + style: TextStyle( + fontFamily: 'Darker Grotesque', + color: Color(0xffe75f5f), + fontWeight: FontWeight.w600)) + ], + ), + ) + ], + ) + ], + ), + ), + ), + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Theme.of(context).backgroundColor, + appBar: AppBar( + title: Text('States', style: TextStyle(color: Colors.black54)), + centerTitle: true, + leading: IconButton( + icon: Icon(Icons.arrow_back_ios, color: Colors.black54), + onPressed: () => Navigator.of(context).pop(), + ), + ), + body: Column( + children: [ + /*Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Container( + decoration: BoxDecoration( + color: _parameter == SortParameter.name + ? Theme.of(context).accentColor + : Theme.of(context).backgroundColor, + borderRadius: BorderRadius.all(Radius.circular(100.0))), + child: GestureDetector( + onTap: () => + setState(() => _parameter = SortParameter.name), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text('Name', + textAlign: TextAlign.center, + style: _parameter == SortParameter.name + ? Theme.of(context).accentTextTheme.button + : Theme.of(context).textTheme.button), + ), + )), + Container( + decoration: BoxDecoration( + color: _parameter == SortParameter.confirmed + ? Theme.of(context).accentColor + : Theme.of(context).backgroundColor, + borderRadius: BorderRadius.all(Radius.circular(100.0))), + child: GestureDetector( + onTap: () => + setState(() => _parameter = SortParameter.confirmed), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text('Confirmed', + textAlign: TextAlign.center, + style: _parameter == SortParameter.confirmed + ? Theme.of(context).accentTextTheme.button + : Theme.of(context).textTheme.button), + ), + )), + Container( + decoration: BoxDecoration( + color: _parameter == SortParameter.active + ? Theme.of(context).accentColor + : Theme.of(context).backgroundColor, + borderRadius: BorderRadius.all(Radius.circular(100.0))), + child: GestureDetector( + onTap: () => + setState(() => _parameter = SortParameter.active), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text('Active', + textAlign: TextAlign.center, + style: _parameter == SortParameter.active + ? Theme.of(context).accentTextTheme.button + : Theme.of(context).textTheme.button), + ), + )), + Container( + decoration: BoxDecoration( + color: _parameter == SortParameter.recovered + ? Theme.of(context).accentColor + : Theme.of(context).backgroundColor, + borderRadius: BorderRadius.all(Radius.circular(100.0))), + child: GestureDetector( + onTap: () => + setState(() => _parameter = SortParameter.recovered), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text('Recovered', + textAlign: TextAlign.center, + style: _parameter == SortParameter.recovered + ? Theme.of(context).accentTextTheme.button + : Theme.of(context).textTheme.button), + ), + )), + Container( + decoration: BoxDecoration( + color: _parameter == SortParameter.deceased + ? Theme.of(context).accentColor + : Theme.of(context).backgroundColor, + borderRadius: BorderRadius.all(Radius.circular(100.0))), + child: GestureDetector( + onTap: () => + setState(() => _parameter = SortParameter.deceased), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text('Deceased', + textAlign: TextAlign.center, + style: _parameter == SortParameter.deceased + ? Theme.of(context).accentTextTheme.button + : Theme.of(context).textTheme.button), + ), + )), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(100.0))), + child: GestureDetector( + onTap: () => setState(() => _sort = _sort == Sort.ascending + ? Sort.descending + : Sort.ascending), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Row( + children: [ + Icon( + Icons.keyboard_arrow_down, + color: _sort == Sort.ascending + ? Colors.black12 + : Colors.black87, + ), + Icon( + Icons.keyboard_arrow_up, + color: _sort == Sort.descending + ? Colors.black12 + : Colors.black87, + ) + ], + ), + ), + )) + ], + ),*/ + Expanded( + child: GridView.builder( + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2), + itemCount: widget.data.caseData.states.length, + itemBuilder: (context, index) => _stateListTile(index)), + ), + ], + ), + ); + } +} diff --git a/lib/ui/my_overlay.dart b/lib/ui/my_overlay.dart new file mode 100644 index 0000000..4900b4a --- /dev/null +++ b/lib/ui/my_overlay.dart @@ -0,0 +1,28 @@ +import 'package:flutter/material.dart'; + +class MyOverlay extends StatefulWidget { + final bool toggle; + final Widget child; + MyOverlay(this.toggle, {this.child}); + @override + _MyOverlayState createState() => _MyOverlayState(); +} + +class _MyOverlayState extends State with SingleTickerProviderStateMixin{ + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return widget.toggle?Container( + color: Colors.black38, + height: MediaQuery.of(context).size.height, + width: MediaQuery.of(context).size.width, + child: widget.child, + ):Container(); + } +} + diff --git a/lib/utils/data.dart b/lib/utils/data.dart new file mode 100644 index 0000000..6222e16 --- /dev/null +++ b/lib/utils/data.dart @@ -0,0 +1,223 @@ +import 'dart:convert'; + +import 'package:http/http.dart' as http; + +class Data { + Cases caseData; + + Map _months = { + 'Jan': DateTime.january, + 'Feb': DateTime.february, + 'Mar': DateTime.march, + 'Apr': DateTime.april, + 'May': DateTime.may, + 'Jun': DateTime.june, + 'Jul': DateTime.july, + 'Aug': DateTime.august, + 'Sep': DateTime.september, + 'Oct': DateTime.october, + 'Nov': DateTime.november, + 'Dec': DateTime.december + }; + + Future getData() async { + await _getCaseData(); + await _getDailyData(); + } + + Future _getCaseData() async { + var data = + await http.get('https://api.covid19india.org/state_district_wise.json'); + var jsonData = await json.decode(data.body); + var states = List(); + var totalConfirmed = 0; + var totalActive = 0; + var totalDeceased = 0; + var totalRecovered = 0; + var dailyData = await _getDailyData(); + List indiaDaily = dailyData[0]; + List daily = dailyData[1]; + int stateIndex = -1; + jsonData.forEach((sk, sv) { + ++stateIndex; + var districts = List(); + var confirmed = 0; + var active = 0; + var deceased = 0; + var recovered = 0; + sv['districtData'].forEach((dk, dv) { + confirmed += dv['confirmed']; + active += dv['active']; + deceased += dv['deceased']; + recovered += dv['recovered']; + districts.add(DistrictData( + name: dk, + confirmed: dv['confirmed'], + active: dv['active'], + deceased: dv['deceased'], + recovered: dv['recovered'])); + }); + states.add(StateData( + name: sk, + stateCode: sv['statecode'], + districts: districts, + confirmed: confirmed, + active: active, + deceased: deceased, + recovered: recovered, + daily: daily + .sublist(stateIndex) + .firstWhere((daily) => + daily.stateCode.toLowerCase() == + sv['statecode'].toString().toLowerCase()) + .daily)); + totalConfirmed += confirmed; + totalActive += active; + totalDeceased += deceased; + totalRecovered += recovered; + }); + caseData = Cases( + daily: indiaDaily, + states: states, + confirmed: totalConfirmed, + active: totalActive, + deceased: totalDeceased, + recovered: totalRecovered); + } + + Future _getDailyData() async { + var data = await http.get('https://api.covid19india.org/states_daily.json'); + var jsonData = await json.decode(data.body); + var unformattedDate; + var date; + List indiaDaily = List(); + List daily; + int dayIndex = -1; + jsonData.forEach((k, v) { + if (daily == null) { + daily = + List.generate(v.length - 2, (index) => StateDaily()); + } + var confirmed; + var recovered; + var deceased; + for (var i = 0; i < v.length; ++i) { + switch (i % 3) { + case 0: + confirmed = int.parse(v[i]['tt']); + ++dayIndex; + unformattedDate = v[i]['date']; + date = DateTime( + int.parse('20' + unformattedDate.substring(7)), + _months[unformattedDate.substring(3, 6)], + int.parse(unformattedDate.substring(0, 2))); + var index = -1; + v[i].forEach((dk, dv) { + if (!['date', 'status'].contains(dk)) { + ++index; + if (i == 0) { + daily[index].stateCode = dk; + } + daily[index].daily.add(Daily( + date: date, confirmed: int.parse(dv == "" ? "0" : dv))); + } + }); + break; + case 1: + recovered = int.parse(v[i]['tt']); + var index = -1; + v[i].forEach((dk, dv) { + if (!['date', 'status'].contains(dk)) { + ++index; + daily[index].daily[dayIndex].recovered = + int.parse(dv == "" ? "0" : dv); + } + }); + break; + case 2: + deceased = int.parse(v[i]['tt']); + var index = -1; + v[i].forEach((dk, dv) { + if (!['date', 'status'].contains(dk)) { + ++index; + daily[index].daily[dayIndex].deceased = + int.parse(dv == "" ? "0" : dv); + } + }); + indiaDaily.add(Daily( + confirmed: confirmed, + recovered: recovered, + deceased: deceased, + date: date)); + break; + default: + continue; + } + } + }); + return [indiaDaily, daily]; + } +} + +class Cases { + List states; + int confirmed; + int active; + int deceased; + int recovered; + List daily; + + Cases( + {this.states, + this.confirmed, + this.active, + this.deceased, + this.recovered, + this.daily}); +} + +class StateData { + List districts; + String name; + String stateCode; + int confirmed; + int active; + int deceased; + int recovered; + List daily; + + StateData( + {this.name, + this.stateCode, + this.districts, + this.confirmed, + this.active, + this.deceased, + this.recovered, + this.daily = const []}); +} + +class DistrictData { + String name; + int confirmed; + int active; + int deceased; + int recovered; + + DistrictData( + {this.name, this.confirmed, this.active, this.deceased, this.recovered}); +} + +class StateDaily { + String stateCode; + List daily = List(); +} + +class Daily { + DateTime date; + int confirmed; + int deceased; + int recovered; + + Daily({this.date, this.confirmed, this.deceased, this.recovered}); +} diff --git a/lib/utils/data_containers.dart b/lib/utils/data_containers.dart new file mode 100644 index 0000000..932c4a3 --- /dev/null +++ b/lib/utils/data_containers.dart @@ -0,0 +1,14 @@ +import 'dart:ui'; + +class CADRPie { + String label; + int value; + Color color; + CADRPie(this.label, this.value, this.color); +} + +class DateVsValue { + DateTime date; + double value; + DateVsValue(this.date, this.value); +} \ No newline at end of file diff --git a/lib/utils/graph_duration.dart b/lib/utils/graph_duration.dart new file mode 100644 index 0000000..5b0c164 --- /dev/null +++ b/lib/utils/graph_duration.dart @@ -0,0 +1,5 @@ +enum GraphDuration { + week, + month, + lifetime +} \ No newline at end of file diff --git a/lib/utils/sort.dart b/lib/utils/sort.dart new file mode 100644 index 0000000..67f2150 --- /dev/null +++ b/lib/utils/sort.dart @@ -0,0 +1,12 @@ +enum Sort { + ascending, + descending +} + +enum SortParameter { + name, + confirmed, + active, + recovered, + deceased +} \ No newline at end of file diff --git a/lib/utils/theme.dart b/lib/utils/theme.dart new file mode 100644 index 0000000..e6797c5 --- /dev/null +++ b/lib/utils/theme.dart @@ -0,0 +1,46 @@ +import 'package:flutter/material.dart'; + +final darkTheme = ThemeData( + brightness: Brightness.dark, + backgroundColor: Colors.black, + appBarTheme: AppBarTheme( + color: Colors.black, + textTheme: TextTheme( + headline6: TextStyle( + decoration: TextDecoration.none, + color: Color(0xFF9E9E9E), + fontFamily: 'Lovelo', + fontWeight: FontWeight.w600, + fontSize: 28.0)), + iconTheme: IconThemeData(color: Color(0xFF9E9E9E))), + bottomAppBarColor: Colors.black, + cardColor: Color(0xFF2A2A2A), + textTheme: TextTheme( + bodyText1: TextStyle(fontFamily: 'Darker Grotesque', fontSize: 16.0)), + accentColor: Colors.teal); + +final lightTheme = ThemeData( + brightness: Brightness.light, + backgroundColor: Colors.white, + appBarTheme: AppBarTheme( + elevation: 0.0, + color: Colors.white, + textTheme: TextTheme( + headline6: TextStyle( + decoration: TextDecoration.none, + color: Colors.black54, + fontFamily: 'Darker Grotesque', + fontWeight: FontWeight.w600, + fontSize: 28.0)), + iconTheme: IconThemeData(color: Color(0xFF9E9E9E))), + bottomAppBarColor: Colors.white, + cardColor: Colors.white, + textTheme: TextTheme( + bodyText1: TextStyle(fontFamily: 'Darker Grotesque', fontSize: 16.0), + button: TextStyle(fontFamily: 'Darker Grotesque', fontSize: 12.0, color: Colors.black)), + accentTextTheme: TextTheme( + button: TextStyle( + fontFamily: 'Darker Grotesque', + fontSize: 12.0, + color: Colors.white)), + accentColor: Colors.blue); diff --git a/lib/utils/theme_notifier.dart b/lib/utils/theme_notifier.dart new file mode 100644 index 0000000..2e144a3 --- /dev/null +++ b/lib/utils/theme_notifier.dart @@ -0,0 +1,14 @@ +import 'package:flutter/material.dart'; + +class ThemeNotifier with ChangeNotifier { + ThemeData _themeData; + + ThemeNotifier(this._themeData); + + getTheme() => _themeData; + + setTheme(ThemeData themeData) async { + _themeData = themeData; + notifyListeners(); + } +} \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..e70cb70 --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,425 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + archive: + dependency: transitive + description: + name: archive + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.13" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.0" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.3" + charts_common: + dependency: transitive + description: + name: charts_common + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.0" + charts_flutter: + dependency: "direct main" + description: + name: charts_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.0" + cloud_firestore: + dependency: "direct main" + description: + name: cloud_firestore + url: "https://pub.dartlang.org" + source: hosted + version: "0.13.5" + cloud_firestore_platform_interface: + dependency: transitive + description: + name: cloud_firestore_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + cloud_firestore_web: + dependency: transitive + description: + name: cloud_firestore_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1+2" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.14.12" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.4" + firebase: + dependency: transitive + description: + name: firebase + url: "https://pub.dartlang.org" + source: hosted + version: "7.3.0" + firebase_core: + dependency: transitive + description: + name: firebase_core + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.4+3" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1+2" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_launcher_icons: + dependency: "direct main" + description: + name: flutter_launcher_icons + url: "https://pub.dartlang.org" + source: hosted + version: "0.7.5" + flutter_page_indicator: + dependency: transitive + description: + name: flutter_page_indicator + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.3" + flutter_swiper: + dependency: "direct main" + description: + name: flutter_swiper + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.6" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + http: + dependency: transitive + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.0+4" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.4" + image: + dependency: transitive + description: + name: image + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.12" + intl: + dependency: transitive + description: + name: intl + url: "https://pub.dartlang.org" + source: hosted + version: "0.16.1" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.1+1" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "0.11.4" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.6" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.8" + nested: + dependency: transitive + description: + name: nested + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.4" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.4" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.0" + petitparser: + dependency: transitive + description: + name: petitparser + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + provider: + dependency: "direct main" + description: + name: provider + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.5" + quiver: + dependency: transitive + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.3" + share: + dependency: "direct main" + description: + name: share + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3+6" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.7" + shared_preferences_macos: + dependency: transitive + description: + name: shared_preferences_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+7" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.2+4" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.3" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.5" + swipe_up: + dependency: "direct main" + description: + name: swipe_up + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.15" + transformer_page_view: + dependency: transitive + description: + name: transformer_page_view + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.6" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.6" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "5.4.5" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+5" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.6" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1+2" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.8" + webview_flutter: + dependency: "direct main" + description: + name: webview_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.19+9" + xml: + dependency: transitive + description: + name: xml + url: "https://pub.dartlang.org" + source: hosted + version: "3.6.1" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" +sdks: + dart: ">=2.7.0 <3.0.0" + flutter: ">=1.12.13+hotfix.5 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..301511a --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,102 @@ +name: covidata +description: Let's kill Corona + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +version: 1.0.0+1 + +environment: + sdk: ">=2.1.0 <3.0.0" + +dependencies: + flutter: + sdk: flutter + cloud_firestore: + share: + swipe_up: + webview_flutter: + flutter_swiper: + charts_flutter: + provider: + shared_preferences: + url_launcher: + flutter_launcher_icons: + +flutter_icons: + android: true + image_path: "assets/launcher/foreground.png" + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^0.1.3 + +dev_dependencies: + flutter_test: + sdk: flutter + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + assets: + - assets/images/github-logo.png + - assets/images/flutter-logo.png + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + fonts: + - family: Darker Grotesque + fonts: + - asset: fonts/DarkerGrotesque-Light.ttf + weight: 200 + - asset: fonts/DarkerGrotesque-Regular.ttf + weight: 300 + - asset: fonts/DarkerGrotesque-Medium.ttf + weight: 400 + - asset: fonts/DarkerGrotesque-SemiBold.ttf + weight: 500 + - asset: fonts/DarkerGrotesque-Bold.ttf + weight: 600 + - asset: fonts/DarkerGrotesque-ExtraBold.ttf + weight: 700 + - asset: fonts/DarkerGrotesque-Black.ttf + weight: 800 + - family: Megrim + fonts: + - asset: fonts/Megrim-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/test/widget_test.dart b/test/widget_test.dart new file mode 100644 index 0000000..0bafe11 --- /dev/null +++ b/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility that Flutter provides. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:chainbreaker/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +}