├── .gitignore ├── .vscode └── launch.json ├── License.md ├── README.md ├── client └── helpMe │ ├── .gitignore │ ├── .metadata │ ├── .vscode │ └── settings.json │ ├── README.md │ ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ ├── google-services.json │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── helpMe │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── settings.gradle │ └── settings_aar.gradle │ ├── assets │ ├── fonts │ │ └── Nunito-Regular.ttf │ └── images │ │ └── alarm.flr │ ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h │ ├── lib │ ├── constants.dart │ ├── main.dart │ ├── models │ │ ├── close_contacts.dart │ │ ├── register.dart │ │ └── verify_phone.dart │ ├── pages │ │ ├── auth │ │ │ ├── login │ │ │ │ └── login.dart │ │ │ └── signup │ │ │ │ ├── signup.dart │ │ │ │ └── verify_phone.dart │ │ ├── home │ │ │ └── ui.dart │ │ └── settings │ │ │ ├── add_close_contacts.dart │ │ │ ├── hardware_buttons.dart │ │ │ └── ui.dart │ └── widgets │ │ ├── primary_button.dart │ │ └── text_box.dart │ ├── pubspec.lock │ └── pubspec.yaml ├── index.js ├── middleware └── auth.js ├── mockups ├── 1.jpeg ├── 2.jpeg ├── 3.1.jpeg ├── 3.jpeg ├── 4.jpeg ├── 5.jpeg ├── 6.jpeg ├── 7.jpeg ├── 8.jpeg └── WhatsApp Image 2020-11-08 at 2.04.12 PM.jpeg ├── models └── user.js ├── package.json ├── routes ├── location.js └── user.js ├── services ├── db.js └── firebase_config.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | help-me-firebase-adminsdk.json 10 | 11 | # Diagnostic reports (https://nodejs.org/api/report.html) 12 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 13 | 14 | # Runtime data 15 | pids 16 | *.pid 17 | *.seed 18 | *.pid.lock 19 | 20 | # Directory for instrumented libs generated by jscoverage/JSCover 21 | lib-cov 22 | 23 | # Coverage directory used by tools like istanbul 24 | coverage 25 | *.lcov 26 | 27 | # nyc test coverage 28 | .nyc_output 29 | 30 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 31 | .grunt 32 | 33 | # Bower dependency directory (https://bower.io/) 34 | bower_components 35 | 36 | # node-waf configuration 37 | .lock-wscript 38 | 39 | # Compiled binary addons (https://nodejs.org/api/addons.html) 40 | build/Release 41 | 42 | # Dependency directories 43 | node_modules/ 44 | jspm_packages/ 45 | 46 | # TypeScript v1 declaration files 47 | typings/ 48 | 49 | # TypeScript cache 50 | *.tsbuildinfo 51 | 52 | # Optional npm cache directory 53 | .npm 54 | 55 | # Optional eslint cache 56 | .eslintcache 57 | 58 | # Microbundle cache 59 | .rpt2_cache/ 60 | .rts2_cache_cjs/ 61 | .rts2_cache_es/ 62 | .rts2_cache_umd/ 63 | 64 | # Optional REPL history 65 | .node_repl_history 66 | 67 | # Output of 'npm pack' 68 | *.tgz 69 | 70 | # Yarn Integrity file 71 | .yarn-integrity 72 | 73 | # dotenv environment variables file 74 | .env 75 | .env.test 76 | 77 | # parcel-bundler cache (https://parceljs.org/) 78 | .cache 79 | 80 | # Next.js build output 81 | .next 82 | 83 | # Nuxt.js build / generate output 84 | .nuxt 85 | dist 86 | 87 | # Gatsby files 88 | .cache/ 89 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 90 | # https://nextjs.org/blog/next-9-1#public-directory-support 91 | # public 92 | 93 | # vuepress build output 94 | .vuepress/dist 95 | 96 | # Serverless directories 97 | .serverless/ 98 | 99 | # FuseBox cache 100 | .fusebox/ 101 | 102 | # DynamoDB Local files 103 | .dynamodb/ 104 | 105 | # TernJS port file 106 | .tern-port -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "helpMe", 9 | "cwd": "client\\helpMe", 10 | "request": "launch", 11 | "type": "dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /License.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Ankit Hans 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Help-me 2 | 3 | 4 | 5 | ## 🔗 Links 6 | - [Help-me apk](https://github.com/ankithans/help-me/releases/download/v1.0/app-armeabi-v7a-release.apk) 7 | - [Backend API](https://help-mee.herokuapp.com/) 8 | - [API documentation](https://documenter.getpostman.com/view/11391372/TVYQ2EBd#136607c4-b3cb-4e7f-9c96-82f7950aeee7) 9 | - [Video Explanation](https://vimeo.com/476800666) 10 | 11 | ## ❓ Problem Statement 12 | > Security is a major concern today. As sad this might sound, India or any part of the world for that matter cannot be called completely safe. And as such any cry for help should always get the proper response that the person needs. Thus, we bring forward helpMe. helpMe is our contribution towards a safer world where no one is alone and a step towards a much safer world. 13 | Whenever in distress, press a button and this will automatically notify people nearby of your location and others can respond to your distress call. This creates a social responsibility among users and eliminates any central body ensuring quicker response to any distress calls. 14 | 15 | ## 🤔 Challenges we faced 16 | - Handling location changes in the background 17 | - Finding nearby users (queries in mongodb using geolocation object) 18 | - Configuring Hardware buttons (comming soon) 19 | 20 | ## 💡 features 21 | - send distress messages automatically when you are in trouble 22 | - receive notifications from others when they are in trouble and access their location using google maps 23 | - add close contacts (automatically send them messages when you are in trouble) 24 | - configure hardware buttons (comming soon) 25 | 26 | ## 💻 samples: 27 | 28 |                29 | 30 |                31 | 32 |                33 | 34 | ## 👣 steps to run the project 35 | - clone the repo in your local machine 36 | - do ```yarn``` in root directory 37 | - do ```flutter pub get``` in ```client/helpMe``` 38 | - add firebase to your flutter project and firebaseadminsdk.json in your root directory 39 | - add MONGO_URI, JWT_SECRET, TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN in your .env 40 | - do ```yarn dev``` in the root directory and your backend is up and running 41 | - do ```flutter run``` in ```client/helpMe``` and your app will start with no issues 42 | 43 | ## Tech Stacks & dependencies 44 | ##### 🤖 Backend 45 | - nodejs 46 | - mongodb 47 | - Heroku 48 | - Firebase FCM 49 | - twilio 50 | 51 | ##### 🌟 Frontend 52 | - Flutter for cross-platform application 53 | - [location](https://pub.dev/packages/location) 54 | - [http](https://pub.dev/packages/http) 55 | - [firebase_messaging](https://pub.dev/packages/firebase_messaging) 56 | - [flutter_secure_storage](https://pub.dev/packages/flutter_secure_storage) 57 | - [flutter_local_notifications](https://pub.dev/packages/flutter_local_notifications) 58 | - [workmanager](https://pub.dev/packages/workmanager) 59 | - [maps_launcher](https://pub.dev/packages/maps_launcher) 60 | 61 | ## made with 💕 by: 62 | - [Ankit Hans](https://github.com/ankithans) 63 | - [Sagnik Biswas](https://github.com/sbiswas2209) 64 | - [Harshit Singh](https://github.com/HarshitSingh27) 65 | -------------------------------------------------------------------------------- /client/helpMe/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | -------------------------------------------------------------------------------- /client/helpMe/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: f30b7f4db93ee747cd727df747941a28ead25ff5 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /client/helpMe/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "git.ignoreLimitWarning": true 3 | } -------------------------------------------------------------------------------- /client/helpMe/README.md: -------------------------------------------------------------------------------- 1 | # helpMe 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /client/helpMe/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /client/helpMe/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | apply plugin: 'com.google.gms.google-services' 28 | 29 | android { 30 | compileSdkVersion 29 31 | 32 | sourceSets { 33 | main.java.srcDirs += 'src/main/kotlin' 34 | } 35 | 36 | lintOptions { 37 | disable 'InvalidPackage' 38 | } 39 | 40 | defaultConfig { 41 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 42 | applicationId "com.example.helpMe" 43 | minSdkVersion 18 44 | targetSdkVersion 29 45 | versionCode flutterVersionCode.toInteger() 46 | versionName flutterVersionName 47 | } 48 | 49 | buildTypes { 50 | release { 51 | // TODO: Add your own signing config for the release build. 52 | // Signing with the debug keys for now, so `flutter run --release` works. 53 | signingConfig signingConfigs.debug 54 | } 55 | } 56 | } 57 | 58 | flutter { 59 | source '../..' 60 | } 61 | 62 | dependencies { 63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 64 | implementation platform('com.google.firebase:firebase-bom:26.0.0') 65 | implementation 'com.google.firebase:firebase-analytics' 66 | } 67 | -------------------------------------------------------------------------------- /client/helpMe/android/app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "983209040517", 4 | "firebase_url": "https://help-me-3d306.firebaseio.com", 5 | "project_id": "help-me-3d306", 6 | "storage_bucket": "help-me-3d306.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:983209040517:android:17381a8fb6a246bb46a7ec", 12 | "android_client_info": { 13 | "package_name": "com.example.helpMe" 14 | } 15 | }, 16 | "oauth_client": [ 17 | { 18 | "client_id": "983209040517-3udoi809k25qbaf3uf9t60ofet4usu2n.apps.googleusercontent.com", 19 | "client_type": 1, 20 | "android_info": { 21 | "package_name": "com.example.helpMe", 22 | "certificate_hash": "36188cd1278ca34f2100f37e40c12b20564468f0" 23 | } 24 | }, 25 | { 26 | "client_id": "983209040517-alojsh4th9kn7eod99ut1fekbptlphea.apps.googleusercontent.com", 27 | "client_type": 3 28 | } 29 | ], 30 | "api_key": [ 31 | { 32 | "current_key": "AIzaSyDz0vobNLOqE-NB4CAXPuAf_tkmfp0HFHk" 33 | } 34 | ], 35 | "services": { 36 | "appinvite_service": { 37 | "other_platform_oauth_client": [ 38 | { 39 | "client_id": "983209040517-alojsh4th9kn7eod99ut1fekbptlphea.apps.googleusercontent.com", 40 | "client_type": 3 41 | } 42 | ] 43 | } 44 | } 45 | } 46 | ], 47 | "configuration_version": "1" 48 | } -------------------------------------------------------------------------------- /client/helpMe/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /client/helpMe/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /client/helpMe/android/app/src/main/kotlin/com/example/helpMe/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.helpMe 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /client/helpMe/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /client/helpMe/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /client/helpMe/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /client/helpMe/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /client/helpMe/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /client/helpMe/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /client/helpMe/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /client/helpMe/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /client/helpMe/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | classpath 'com.google.gms:google-services:4.3.4' 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | google() 18 | jcenter() 19 | } 20 | } 21 | 22 | rootProject.buildDir = '../build' 23 | subprojects { 24 | project.buildDir = "${rootProject.buildDir}/${project.name}" 25 | } 26 | subprojects { 27 | project.evaluationDependsOn(':app') 28 | } 29 | 30 | task clean(type: Delete) { 31 | delete rootProject.buildDir 32 | } 33 | -------------------------------------------------------------------------------- /client/helpMe/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | android.enableR8=true 5 | -------------------------------------------------------------------------------- /client/helpMe/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /client/helpMe/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /client/helpMe/android/settings_aar.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /client/helpMe/assets/fonts/Nunito-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/assets/fonts/Nunito-Regular.ttf -------------------------------------------------------------------------------- /client/helpMe/assets/images/alarm.flr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/assets/images/alarm.flr -------------------------------------------------------------------------------- /client/helpMe/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /client/helpMe/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 9.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /client/helpMe/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /client/helpMe/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /client/helpMe/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 97 | ); 98 | path = Runner; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 97C146ED1CF9000F007C117D /* Runner */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 107 | buildPhases = ( 108 | 9740EEB61CF901F6004384FC /* Run Script */, 109 | 97C146EA1CF9000F007C117D /* Sources */, 110 | 97C146EB1CF9000F007C117D /* Frameworks */, 111 | 97C146EC1CF9000F007C117D /* Resources */, 112 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = Runner; 120 | productName = Runner; 121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 97C146E61CF9000F007C117D /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 1020; 131 | ORGANIZATIONNAME = ""; 132 | TargetAttributes = { 133 | 97C146ED1CF9000F007C117D = { 134 | CreatedOnToolsVersion = 7.3.1; 135 | LastSwiftMigration = 1100; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 140 | compatibilityVersion = "Xcode 9.3"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 97C146E51CF9000F007C117D; 148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 97C146ED1CF9000F007C117D /* Runner */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 97C146EC1CF9000F007C117D /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXShellScriptBuildPhase section */ 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 173 | isa = PBXShellScriptBuildPhase; 174 | buildActionMask = 2147483647; 175 | files = ( 176 | ); 177 | inputPaths = ( 178 | ); 179 | name = "Thin Binary"; 180 | outputPaths = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | shellPath = /bin/sh; 184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 185 | }; 186 | 9740EEB61CF901F6004384FC /* Run Script */ = { 187 | isa = PBXShellScriptBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | ); 191 | inputPaths = ( 192 | ); 193 | name = "Run Script"; 194 | outputPaths = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | shellPath = /bin/sh; 198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 199 | }; 200 | /* End PBXShellScriptBuildPhase section */ 201 | 202 | /* Begin PBXSourcesBuildPhase section */ 203 | 97C146EA1CF9000F007C117D /* Sources */ = { 204 | isa = PBXSourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXSourcesBuildPhase section */ 213 | 214 | /* Begin PBXVariantGroup section */ 215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 97C146FB1CF9000F007C117D /* Base */, 219 | ); 220 | name = Main.storyboard; 221 | sourceTree = ""; 222 | }; 223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 97C147001CF9000F007C117D /* Base */, 227 | ); 228 | name = LaunchScreen.storyboard; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXVariantGroup section */ 232 | 233 | /* Begin XCBuildConfiguration section */ 234 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ALWAYS_SEARCH_USER_PATHS = NO; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_COMMA = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 258 | CLANG_WARN_STRICT_PROTOTYPES = YES; 259 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = iphoneos; 278 | SUPPORTED_PLATFORMS = iphoneos; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | VALIDATE_PRODUCT = YES; 281 | }; 282 | name = Profile; 283 | }; 284 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 285 | isa = XCBuildConfiguration; 286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | CLANG_ENABLE_MODULES = YES; 290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 291 | ENABLE_BITCODE = NO; 292 | FRAMEWORK_SEARCH_PATHS = ( 293 | "$(inherited)", 294 | "$(PROJECT_DIR)/Flutter", 295 | ); 296 | INFOPLIST_FILE = Runner/Info.plist; 297 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 298 | LIBRARY_SEARCH_PATHS = ( 299 | "$(inherited)", 300 | "$(PROJECT_DIR)/Flutter", 301 | ); 302 | PRODUCT_BUNDLE_IDENTIFIER = com.example.helpMe; 303 | PRODUCT_NAME = "$(TARGET_NAME)"; 304 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 305 | SWIFT_VERSION = 5.0; 306 | VERSIONING_SYSTEM = "apple-generic"; 307 | }; 308 | name = Profile; 309 | }; 310 | 97C147031CF9000F007C117D /* Debug */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | ALWAYS_SEARCH_USER_PATHS = NO; 314 | CLANG_ANALYZER_NONNULL = YES; 315 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 316 | CLANG_CXX_LIBRARY = "libc++"; 317 | CLANG_ENABLE_MODULES = YES; 318 | CLANG_ENABLE_OBJC_ARC = YES; 319 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 320 | CLANG_WARN_BOOL_CONVERSION = YES; 321 | CLANG_WARN_COMMA = YES; 322 | CLANG_WARN_CONSTANT_CONVERSION = YES; 323 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 324 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 325 | CLANG_WARN_EMPTY_BODY = YES; 326 | CLANG_WARN_ENUM_CONVERSION = YES; 327 | CLANG_WARN_INFINITE_RECURSION = YES; 328 | CLANG_WARN_INT_CONVERSION = YES; 329 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 330 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 331 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 332 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 333 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 334 | CLANG_WARN_STRICT_PROTOTYPES = YES; 335 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 336 | CLANG_WARN_UNREACHABLE_CODE = YES; 337 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 338 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 339 | COPY_PHASE_STRIP = NO; 340 | DEBUG_INFORMATION_FORMAT = dwarf; 341 | ENABLE_STRICT_OBJC_MSGSEND = YES; 342 | ENABLE_TESTABILITY = YES; 343 | GCC_C_LANGUAGE_STANDARD = gnu99; 344 | GCC_DYNAMIC_NO_PIC = NO; 345 | GCC_NO_COMMON_BLOCKS = YES; 346 | GCC_OPTIMIZATION_LEVEL = 0; 347 | GCC_PREPROCESSOR_DEFINITIONS = ( 348 | "DEBUG=1", 349 | "$(inherited)", 350 | ); 351 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 352 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 353 | GCC_WARN_UNDECLARED_SELECTOR = YES; 354 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 355 | GCC_WARN_UNUSED_FUNCTION = YES; 356 | GCC_WARN_UNUSED_VARIABLE = YES; 357 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 358 | MTL_ENABLE_DEBUG_INFO = YES; 359 | ONLY_ACTIVE_ARCH = YES; 360 | SDKROOT = iphoneos; 361 | TARGETED_DEVICE_FAMILY = "1,2"; 362 | }; 363 | name = Debug; 364 | }; 365 | 97C147041CF9000F007C117D /* Release */ = { 366 | isa = XCBuildConfiguration; 367 | buildSettings = { 368 | ALWAYS_SEARCH_USER_PATHS = NO; 369 | CLANG_ANALYZER_NONNULL = YES; 370 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 371 | CLANG_CXX_LIBRARY = "libc++"; 372 | CLANG_ENABLE_MODULES = YES; 373 | CLANG_ENABLE_OBJC_ARC = YES; 374 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 375 | CLANG_WARN_BOOL_CONVERSION = YES; 376 | CLANG_WARN_COMMA = YES; 377 | CLANG_WARN_CONSTANT_CONVERSION = YES; 378 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 379 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 380 | CLANG_WARN_EMPTY_BODY = YES; 381 | CLANG_WARN_ENUM_CONVERSION = YES; 382 | CLANG_WARN_INFINITE_RECURSION = YES; 383 | CLANG_WARN_INT_CONVERSION = YES; 384 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 385 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 386 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 387 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 388 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 389 | CLANG_WARN_STRICT_PROTOTYPES = YES; 390 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 391 | CLANG_WARN_UNREACHABLE_CODE = YES; 392 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 393 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 394 | COPY_PHASE_STRIP = NO; 395 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 396 | ENABLE_NS_ASSERTIONS = NO; 397 | ENABLE_STRICT_OBJC_MSGSEND = YES; 398 | GCC_C_LANGUAGE_STANDARD = gnu99; 399 | GCC_NO_COMMON_BLOCKS = YES; 400 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 401 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 402 | GCC_WARN_UNDECLARED_SELECTOR = YES; 403 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 404 | GCC_WARN_UNUSED_FUNCTION = YES; 405 | GCC_WARN_UNUSED_VARIABLE = YES; 406 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 407 | MTL_ENABLE_DEBUG_INFO = NO; 408 | SDKROOT = iphoneos; 409 | SUPPORTED_PLATFORMS = iphoneos; 410 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 411 | TARGETED_DEVICE_FAMILY = "1,2"; 412 | VALIDATE_PRODUCT = YES; 413 | }; 414 | name = Release; 415 | }; 416 | 97C147061CF9000F007C117D /* Debug */ = { 417 | isa = XCBuildConfiguration; 418 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 419 | buildSettings = { 420 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 421 | CLANG_ENABLE_MODULES = YES; 422 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 423 | ENABLE_BITCODE = NO; 424 | FRAMEWORK_SEARCH_PATHS = ( 425 | "$(inherited)", 426 | "$(PROJECT_DIR)/Flutter", 427 | ); 428 | INFOPLIST_FILE = Runner/Info.plist; 429 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 430 | LIBRARY_SEARCH_PATHS = ( 431 | "$(inherited)", 432 | "$(PROJECT_DIR)/Flutter", 433 | ); 434 | PRODUCT_BUNDLE_IDENTIFIER = com.example.helpMe; 435 | PRODUCT_NAME = "$(TARGET_NAME)"; 436 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 437 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 438 | SWIFT_VERSION = 5.0; 439 | VERSIONING_SYSTEM = "apple-generic"; 440 | }; 441 | name = Debug; 442 | }; 443 | 97C147071CF9000F007C117D /* Release */ = { 444 | isa = XCBuildConfiguration; 445 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 446 | buildSettings = { 447 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 448 | CLANG_ENABLE_MODULES = YES; 449 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 450 | ENABLE_BITCODE = NO; 451 | FRAMEWORK_SEARCH_PATHS = ( 452 | "$(inherited)", 453 | "$(PROJECT_DIR)/Flutter", 454 | ); 455 | INFOPLIST_FILE = Runner/Info.plist; 456 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 457 | LIBRARY_SEARCH_PATHS = ( 458 | "$(inherited)", 459 | "$(PROJECT_DIR)/Flutter", 460 | ); 461 | PRODUCT_BUNDLE_IDENTIFIER = com.example.helpMe; 462 | PRODUCT_NAME = "$(TARGET_NAME)"; 463 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 464 | SWIFT_VERSION = 5.0; 465 | VERSIONING_SYSTEM = "apple-generic"; 466 | }; 467 | name = Release; 468 | }; 469 | /* End XCBuildConfiguration section */ 470 | 471 | /* Begin XCConfigurationList section */ 472 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 473 | isa = XCConfigurationList; 474 | buildConfigurations = ( 475 | 97C147031CF9000F007C117D /* Debug */, 476 | 97C147041CF9000F007C117D /* Release */, 477 | 249021D3217E4FDB00AE95B9 /* Profile */, 478 | ); 479 | defaultConfigurationIsVisible = 0; 480 | defaultConfigurationName = Release; 481 | }; 482 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 483 | isa = XCConfigurationList; 484 | buildConfigurations = ( 485 | 97C147061CF9000F007C117D /* Debug */, 486 | 97C147071CF9000F007C117D /* Release */, 487 | 249021D4217E4FDB00AE95B9 /* Profile */, 488 | ); 489 | defaultConfigurationIsVisible = 0; 490 | defaultConfigurationName = Release; 491 | }; 492 | /* End XCConfigurationList section */ 493 | }; 494 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 495 | } 496 | -------------------------------------------------------------------------------- /client/helpMe/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /client/helpMe/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /client/helpMe/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /client/helpMe/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /client/helpMe/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /client/helpMe/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /client/helpMe/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/client/helpMe/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | 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. -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | helpMe 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /client/helpMe/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /client/helpMe/lib/constants.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | const api = 'https://help-mee.herokuapp.com'; 4 | 5 | const backgroundColor = Color(0XFF212121); 6 | 7 | const primaryColor = Color(0XFF32e0c4); 8 | 9 | const fontColor = Color(0XFFeeeeee); 10 | 11 | AppBar titleAppbar(context, 12 | {@required String title, 13 | List actions, 14 | bool automaticallyImplyLeading = true, 15 | bool centerTitle = false, 16 | Widget leading}) { 17 | return AppBar( 18 | backgroundColor: backgroundColor, 19 | elevation: 0, 20 | centerTitle: centerTitle, 21 | automaticallyImplyLeading: automaticallyImplyLeading, 22 | actions: actions != null ? actions : null, 23 | title: Padding( 24 | padding: const EdgeInsets.all(8.0), 25 | child: Text( 26 | "$title", 27 | overflow: TextOverflow.fade, 28 | style: Theme.of(context).textTheme.headline1, 29 | ), 30 | ), 31 | ); 32 | } 33 | -------------------------------------------------------------------------------- /client/helpMe/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:firebase_messaging/firebase_messaging.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_local_notifications/flutter_local_notifications.dart'; 6 | import 'package:flutter_secure_storage/flutter_secure_storage.dart'; 7 | import 'package:fluttertoast/fluttertoast.dart'; 8 | import 'package:helpMe/constants.dart'; 9 | import 'package:helpMe/pages/auth/login/login.dart'; 10 | import 'package:helpMe/pages/auth/signup/signup.dart'; 11 | import 'package:helpMe/pages/auth/signup/verify_phone.dart'; 12 | import 'package:helpMe/pages/home/ui.dart'; 13 | import 'package:location/location.dart'; 14 | import 'package:maps_launcher/maps_launcher.dart'; 15 | import 'package:workmanager/workmanager.dart'; 16 | import 'package:http/http.dart' as http; 17 | 18 | void main() { 19 | runApp(MyApp()); 20 | } 21 | 22 | callBackDispatcher() async { 23 | Workmanager.executeTask((taskName, inputData) async { 24 | var result = await MyApp().getLocationData(); 25 | 26 | FlutterSecureStorage _secureStorage = FlutterSecureStorage(); 27 | 28 | var token = await _secureStorage.read(key: 'token'); 29 | 30 | if(token != null){ 31 | 32 | result.listen((event) async { 33 | print('Event: $event'); 34 | 35 | var response = await http.put( 36 | '$api/api/v1/location/update', 37 | headers: { 38 | 'Content-Type': 'application/json; charset=UTF-8', 39 | 'x-auth-token': token 40 | }, 41 | body: jsonEncode({ 42 | 'location':{ 43 | 'type': 'Point', 44 | 'coordinates': [event.longitude, event.latitude] 45 | } 46 | }) 47 | ); 48 | 49 | print(response.body.toString()); 50 | print(response.statusCode); 51 | 52 | }); 53 | 54 | } 55 | 56 | return Future.value(true); 57 | 58 | }); 59 | } 60 | 61 | getLocationData() async { 62 | Location _location = Location(); 63 | var _locationData = await _location.getLocation(); 64 | 65 | return _locationData; 66 | 67 | } 68 | 69 | class MyApp extends StatefulWidget { 70 | Future> getLocationData() async { 71 | Location _location = Location(); 72 | 73 | _location.changeSettings( 74 | accuracy: LocationAccuracy.high, 75 | interval: 500, 76 | distanceFilter: 0.0001, 77 | ); 78 | 79 | return _location.onLocationChanged; 80 | 81 | } 82 | 83 | // This widget is the root of your application. 84 | @override 85 | _MyAppState createState() => _MyAppState(); 86 | } 87 | 88 | class _MyAppState extends State { 89 | FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); 90 | 91 | FlutterSecureStorage secureStorage = FlutterSecureStorage(); 92 | 93 | final flutterLocalNotificationsPlugin = new FlutterLocalNotificationsPlugin(); 94 | String token; 95 | 96 | void fcmListener() { 97 | _firebaseMessaging.getToken().then((value) async { 98 | await secureStorage.write(key: 'fcmToken', value: value); 99 | print(value); 100 | }); 101 | 102 | Future showNotification(String title, String body) async { 103 | var androidChannelSpecifics = AndroidNotificationDetails( 104 | 'CHANNEL_ID', 105 | 'CHANNEL_NAME', 106 | "CHANNEL_DESCRIPTION", 107 | importance: Importance.max, 108 | priority: Priority.high, 109 | playSound: true, 110 | timeoutAfter: 5000, 111 | styleInformation: DefaultStyleInformation(true, true), 112 | ); 113 | var iosChannelSpecifics = IOSNotificationDetails(); 114 | var platformChannelSpecifics = NotificationDetails( 115 | android: androidChannelSpecifics, iOS: iosChannelSpecifics); 116 | await flutterLocalNotificationsPlugin.show( 117 | 1, // Notification ID 118 | title, // Notification Title 119 | body, // Notification Body, set as null to remove the body 120 | platformChannelSpecifics, 121 | ); 122 | } 123 | 124 | _firebaseMessaging.configure( 125 | onMessage: (message) async { 126 | print('onMessage: $message'); 127 | Fluttertoast.showToast(msg: "$message"); 128 | //var data = jsonDecode(message.toString()); 129 | 130 | showNotification( 131 | message["notification"]["title"], message["notification"]["body"]); 132 | //print('Message: $data'); 133 | await MapsLauncher.launchCoordinates(double.parse(message['data']['lat']), double.parse(message['data']['long']), 'Distress Here!!'); 134 | //print(result); 135 | }, 136 | onLaunch: (message) async { 137 | var data = jsonDecode(message.toString()); 138 | print('Message: $data'); 139 | await MapsLauncher.launchCoordinates(double.parse(data['data']['lat']), double.parse(data['data']['long']), 'Distress Here!!'); 140 | print('onLaunch: $message'); 141 | }, 142 | onResume: (message) async { 143 | var data = jsonDecode(message.toString()); 144 | print('Message: $data'); 145 | await MapsLauncher.launchCoordinates(double.parse(data['data']['lat']), double.parse(data['data']['long']), 'Distress Here!!'); 146 | print('onResume: $message'); 147 | }, 148 | ); 149 | } 150 | 151 | void getLocation() async { 152 | Location location = new Location(); 153 | 154 | bool _serviceEnabled; 155 | PermissionStatus _permissionGranted; 156 | LocationData _locationData; 157 | 158 | _serviceEnabled = await location.serviceEnabled(); 159 | if (!_serviceEnabled) { 160 | _serviceEnabled = await location.requestService(); 161 | if (!_serviceEnabled) { 162 | return; 163 | } 164 | } 165 | 166 | _permissionGranted = await location.hasPermission(); 167 | if (_permissionGranted == PermissionStatus.denied) { 168 | _permissionGranted = await location.requestPermission(); 169 | if (_permissionGranted != PermissionStatus.granted) { 170 | return; 171 | } 172 | } 173 | 174 | _locationData = await location.getLocation(); 175 | 176 | print(_locationData); 177 | await secureStorage.write( 178 | key: 'longitude', value: _locationData.longitude.toString()); 179 | await secureStorage.write( 180 | key: 'latitude', value: _locationData.latitude.toString()); 181 | } 182 | 183 | void getToken() async { 184 | token = await secureStorage.read(key: "token"); 185 | print(token); 186 | } 187 | 188 | Widget firstScreen() { 189 | if (token == null) { 190 | return VerifyPhone(); 191 | } else { 192 | return HomePage(); 193 | } 194 | } 195 | 196 | 197 | 198 | 199 | 200 | @override 201 | void initState() { 202 | super.initState(); 203 | getToken(); 204 | 205 | // initialise the plugin. app_icon needs to be a added as a drawable resource to the Android head project 206 | var initializationSettingsAndroid = 207 | new AndroidInitializationSettings('@mipmap/ic_launcher'); 208 | var initializationSettingsIOS = new IOSInitializationSettings(); 209 | var initializationSettings = new InitializationSettings( 210 | android: initializationSettingsAndroid, iOS: initializationSettingsIOS); 211 | FlutterLocalNotificationsPlugin().initialize(initializationSettings); 212 | 213 | getLocation(); 214 | fcmListener(); 215 | } 216 | 217 | @override 218 | Widget build(BuildContext context) { 219 | Workmanager.initialize(callBackDispatcher, isInDebugMode: true); 220 | Workmanager.registerPeriodicTask("1", "get location"); 221 | return FutureBuilder( 222 | future: secureStorage.read(key: "token"), 223 | builder: (context, snapshot) { 224 | return MaterialApp( 225 | debugShowCheckedModeBanner: false, 226 | theme: ThemeData( 227 | fontFamily: 'Nunito', 228 | textTheme: TextTheme( 229 | headline1: TextStyle( 230 | fontFamily: 'Nunito', 231 | color: primaryColor, 232 | fontSize: 20.0, 233 | fontWeight: FontWeight.bold, 234 | ), 235 | bodyText1: TextStyle( 236 | fontFamily: 'Nunito', color: fontColor, fontSize: 15.0), 237 | ), 238 | ), 239 | home: firstScreen(), 240 | ); 241 | }, 242 | ); 243 | } 244 | } 245 | -------------------------------------------------------------------------------- /client/helpMe/lib/models/close_contacts.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final closeContacts = closeContactsFromJson(jsonString); 4 | 5 | import 'package:meta/meta.dart'; 6 | import 'dart:convert'; 7 | 8 | CloseContacts closeContactsFromJson(String str) => 9 | CloseContacts.fromJson(json.decode(str)); 10 | 11 | String closeContactsToJson(CloseContacts data) => json.encode(data.toJson()); 12 | 13 | class CloseContacts { 14 | CloseContacts({ 15 | @required this.success, 16 | @required this.phoneNumbers, 17 | }); 18 | 19 | final bool success; 20 | final List phoneNumbers; 21 | 22 | factory CloseContacts.fromJson(Map json) => CloseContacts( 23 | success: json["success"] == null ? null : json["success"], 24 | phoneNumbers: json["phoneNumbers"] == null 25 | ? null 26 | : List.from(json["phoneNumbers"].map((x) => x)), 27 | ); 28 | 29 | Map toJson() => { 30 | "success": success == null ? null : success, 31 | "phoneNumbers": phoneNumbers == null 32 | ? null 33 | : List.from(phoneNumbers.map((x) => x)), 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /client/helpMe/lib/models/register.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final register = registerFromJson(jsonString); 4 | 5 | import 'package:meta/meta.dart'; 6 | import 'dart:convert'; 7 | 8 | Register registerFromJson(String str) => Register.fromJson(json.decode(str)); 9 | 10 | String registerToJson(Register data) => json.encode(data.toJson()); 11 | 12 | class Register { 13 | Register({ 14 | @required this.success, 15 | @required this.token, 16 | @required this.userId, 17 | }); 18 | 19 | final bool success; 20 | final String token; 21 | final String userId; 22 | 23 | factory Register.fromJson(Map json) => Register( 24 | success: json["success"] == null ? null : json["success"], 25 | token: json["token"] == null ? null : json["token"], 26 | userId: json["userId"] == null ? null : json["userId"], 27 | ); 28 | 29 | Map toJson() => { 30 | "success": success == null ? null : success, 31 | "token": token == null ? null : token, 32 | "userId": userId == null ? null : userId, 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /client/helpMe/lib/models/verify_phone.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final verifyMobile = verifyMobileFromJson(jsonString); 4 | 5 | import 'package:meta/meta.dart'; 6 | import 'dart:convert'; 7 | 8 | VerifyMobile verifyMobileFromJson(String str) => 9 | VerifyMobile.fromJson(json.decode(str)); 10 | 11 | String verifyMobileToJson(VerifyMobile data) => json.encode(data.toJson()); 12 | 13 | class VerifyMobile { 14 | VerifyMobile({ 15 | @required this.success, 16 | @required this.message, 17 | @required this.code, 18 | }); 19 | 20 | final bool success; 21 | final String message; 22 | final String code; 23 | 24 | factory VerifyMobile.fromJson(Map json) => VerifyMobile( 25 | success: json["success"] == null ? null : json["success"], 26 | message: json["message"] == null ? null : json["message"], 27 | code: json["code"] == null ? null : json["code"], 28 | ); 29 | 30 | Map toJson() => { 31 | "success": success == null ? null : success, 32 | "message": message == null ? null : message, 33 | "code": code == null ? null : code, 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /client/helpMe/lib/pages/auth/login/login.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_secure_storage/flutter_secure_storage.dart'; 5 | import 'package:fluttertoast/fluttertoast.dart'; 6 | import 'package:helpMe/constants.dart'; 7 | import 'package:helpMe/models/register.dart'; 8 | import 'package:helpMe/models/verify_phone.dart'; 9 | import 'package:helpMe/pages/auth/signup/signup.dart'; 10 | import 'package:helpMe/pages/home/ui.dart'; 11 | import 'package:helpMe/widgets/text_box.dart'; 12 | import 'package:http/http.dart' as http; 13 | 14 | //import 'package:helpMe/pages/auth/signup/services.dart'; 15 | class Login extends StatefulWidget { 16 | final String phone; 17 | 18 | const Login({Key key, this.phone}) : super(key: key); 19 | @override 20 | _LoginState createState() => _LoginState(); 21 | } 22 | 23 | class _LoginState extends State { 24 | final _phoneController = new TextEditingController(); 25 | final _otpController = new TextEditingController(); 26 | bool showOtpTextBox = false; 27 | FlutterSecureStorage secureStorage = FlutterSecureStorage(); 28 | bool loading = false; 29 | Map data = {}; 30 | 31 | Future getData() async { 32 | String longitude = await secureStorage.read(key: "longitude"); 33 | String latitude = await secureStorage.read(key: "latitude"); 34 | String fcmToken = await secureStorage.read(key: "fcmToken"); 35 | 36 | data["phone"] = _phoneController.text; 37 | data["location"] = { 38 | "type": "Point", 39 | "coordinates": [longitude, latitude], 40 | }; 41 | data["fcmToken"] = fcmToken; 42 | print(data); 43 | } 44 | 45 | Future verifyPhone() async { 46 | try { 47 | setState(() { 48 | loading = true; 49 | }); 50 | var response = await http.post( 51 | api + "/api/v1/users/verify", 52 | headers: { 53 | "Content-Type": "application/json; charset=UTF-8", 54 | }, 55 | body: json.encode({"phone": _phoneController.text}), 56 | ); 57 | print(response.body); 58 | Fluttertoast.showToast(msg: json.decode(response.body)["message"]); 59 | setState(() { 60 | showOtpTextBox = true; 61 | loading = false; 62 | }); 63 | return VerifyMobile.fromJson(json.decode(response.body)); 64 | } catch (e) { 65 | setState(() { 66 | showOtpTextBox = false; 67 | loading = false; 68 | }); 69 | print(e); 70 | } 71 | } 72 | 73 | Future login() async { 74 | try { 75 | await getData(); 76 | setState(() { 77 | loading = true; 78 | }); 79 | var response = await http.post( 80 | api + "/api/v1/users/login", 81 | headers: { 82 | "Content-Type": "application/json; charset=UTF-8", 83 | }, 84 | body: json.encode(data), 85 | ); 86 | print(response.body); 87 | if (json.decode(response.body)["success"] == false) { 88 | Fluttertoast.showToast(msg: json.decode(response.body)["error"]); 89 | } 90 | setState(() { 91 | loading = false; 92 | }); 93 | String token = json.decode(response.body)["token"]; 94 | print(token); 95 | await secureStorage.write(key: "token", value: token); 96 | if (json.decode(response.body)["success"] == true) { 97 | Navigator.pop(context); 98 | Navigator.pushReplacement( 99 | context, 100 | MaterialPageRoute( 101 | builder: (context) => HomePage(), 102 | ), 103 | ); 104 | } 105 | return Register.fromJson(json.decode(response.body)); 106 | } catch (e) { 107 | setState(() { 108 | loading = false; 109 | }); 110 | print(e); 111 | } 112 | } 113 | 114 | @override 115 | Widget build(BuildContext context) { 116 | return Scaffold( 117 | backgroundColor: backgroundColor, 118 | appBar: titleAppbar(context, title: 'Login'), 119 | body: Padding( 120 | padding: const EdgeInsets.all(25.0), 121 | child: ListView( 122 | children: [ 123 | TextBoxEmailPhone( 124 | enabled: true, 125 | hintText: "Enter your Phone Number", 126 | labelText: "Phone", 127 | textEditingController: _phoneController, 128 | obscureText: false, 129 | textInputType: TextInputType.phone, 130 | ), 131 | !showOtpTextBox 132 | ? Container() 133 | : SizedBox( 134 | height: 15, 135 | ), 136 | !showOtpTextBox 137 | ? Container() 138 | : TextBoxEmailPhone( 139 | enabled: true, 140 | hintText: "Enter your otp", 141 | labelText: "Name", 142 | textEditingController: _otpController, 143 | obscureText: false, 144 | textInputType: TextInputType.phone, 145 | ), 146 | SizedBox( 147 | height: 5, 148 | ), 149 | loading 150 | ? Center(child: CircularProgressIndicator()) 151 | : Padding( 152 | padding: const EdgeInsets.only( 153 | top: 25.0, 154 | bottom: 15.0, 155 | left: 10, 156 | right: 10, 157 | ), 158 | child: RaisedButton( 159 | child: !showOtpTextBox 160 | ? Text( 161 | 'Send Otp', 162 | style: TextStyle( 163 | color: Colors.black, 164 | fontSize: 15, 165 | fontWeight: FontWeight.w500, 166 | ), 167 | ) 168 | : Text( 169 | 'Login', 170 | style: TextStyle( 171 | color: Colors.black, 172 | fontSize: 15, 173 | fontWeight: FontWeight.w500, 174 | ), 175 | ), 176 | onPressed: () async { 177 | if (showOtpTextBox == false) { 178 | if (_phoneController.text == "" || 179 | _phoneController.text.length < 10) { 180 | Fluttertoast.showToast( 181 | msg: "Please Enter a correct phone number"); 182 | } else { 183 | await verifyPhone(); 184 | } 185 | } else { 186 | if (_otpController.text == "123456") { 187 | await login(); 188 | } else { 189 | Fluttertoast.showToast( 190 | msg: "Your otp is incorrect!", 191 | ); 192 | } 193 | } 194 | }, 195 | shape: RoundedRectangleBorder( 196 | borderRadius: BorderRadius.circular(15.0), 197 | ), 198 | color: primaryColor, 199 | ), 200 | ), 201 | ], 202 | ), 203 | ), 204 | ); 205 | } 206 | } 207 | -------------------------------------------------------------------------------- /client/helpMe/lib/pages/auth/signup/signup.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_secure_storage/flutter_secure_storage.dart'; 5 | import 'package:fluttertoast/fluttertoast.dart'; 6 | import 'package:helpMe/constants.dart'; 7 | import 'package:helpMe/models/register.dart'; 8 | import 'package:helpMe/pages/auth/login/login.dart'; 9 | import 'package:helpMe/pages/home/ui.dart'; 10 | import 'package:helpMe/widgets/text_box.dart'; 11 | import 'package:location/location.dart'; 12 | import 'package:toast/toast.dart'; 13 | import 'package:http/http.dart' as http; 14 | 15 | //import 'package:helpMe/pages/auth/signup/services.dart'; 16 | class SignUpPage extends StatefulWidget { 17 | final String phone; 18 | 19 | const SignUpPage({Key key, this.phone}) : super(key: key); 20 | @override 21 | _SignUpPageState createState() => _SignUpPageState(); 22 | } 23 | 24 | class _SignUpPageState extends State { 25 | final _nameController = new TextEditingController(); 26 | final _addressController = new TextEditingController(); 27 | bool loading = false; 28 | Map data = {}; 29 | FlutterSecureStorage secureStorage = FlutterSecureStorage(); 30 | 31 | Future getData() async { 32 | String longitude = await secureStorage.read(key: "longitude"); 33 | String latitude = await secureStorage.read(key: "latitude"); 34 | String fcmToken = await secureStorage.read(key: "fcmToken"); 35 | 36 | data["name"] = _nameController.text; 37 | data["phone"] = widget.phone; 38 | data["location"] = { 39 | "type": "Point", 40 | "coordinates": [longitude, latitude], 41 | }; 42 | data["address"] = _addressController.text; 43 | data["fcmToken"] = fcmToken; 44 | print(data); 45 | } 46 | 47 | Future register() async { 48 | try { 49 | await getData(); 50 | setState(() { 51 | loading = true; 52 | }); 53 | var response = await http.post( 54 | api + "/api/v1/users/register", 55 | headers: { 56 | "Content-Type": "application/json; charset=UTF-8", 57 | }, 58 | body: json.encode(data), 59 | ); 60 | print(response.body); 61 | if (json.decode(response.body)["success"] == false) { 62 | Fluttertoast.showToast(msg: json.decode(response.body)["error"]); 63 | } 64 | setState(() { 65 | loading = false; 66 | }); 67 | String token = json.decode(response.body)["token"]; 68 | print(token); 69 | await secureStorage.write(key: "token", value: token); 70 | if (json.decode(response.body)["success"] == true) { 71 | Navigator.pop(context); 72 | Navigator.pushReplacement( 73 | context, 74 | MaterialPageRoute( 75 | builder: (context) => HomePage(), 76 | ), 77 | ); 78 | } 79 | return Register.fromJson(json.decode(response.body)); 80 | } catch (e) { 81 | setState(() { 82 | loading = false; 83 | }); 84 | print(e); 85 | } 86 | } 87 | 88 | @override 89 | Widget build(BuildContext context) { 90 | return Scaffold( 91 | backgroundColor: backgroundColor, 92 | appBar: titleAppbar(context, title: 'Sign Up'), 93 | body: Padding( 94 | padding: const EdgeInsets.all(25.0), 95 | child: ListView( 96 | children: [ 97 | TextBoxEmailPhone( 98 | enabled: true, 99 | hintText: "Enter your name", 100 | labelText: "Phone", 101 | textEditingController: _nameController, 102 | obscureText: false, 103 | textInputType: TextInputType.text, 104 | ), 105 | SizedBox( 106 | height: 15, 107 | ), 108 | TextBoxEmailPhone( 109 | enabled: true, 110 | hintText: "Enter your address", 111 | labelText: "Phone", 112 | textEditingController: _addressController, 113 | obscureText: false, 114 | textInputType: TextInputType.text, 115 | ), 116 | SizedBox( 117 | height: 5, 118 | ), 119 | loading 120 | ? Center(child: CircularProgressIndicator()) 121 | : Padding( 122 | padding: const EdgeInsets.all(25.0), 123 | child: RaisedButton( 124 | child: Text('Sign Up'), 125 | onPressed: () async { 126 | if (_nameController.text == "" || 127 | _addressController.text == "") { 128 | Fluttertoast.showToast( 129 | msg: "Please Enter the above details"); 130 | } else { 131 | await register(); 132 | } 133 | }, 134 | shape: RoundedRectangleBorder( 135 | borderRadius: BorderRadius.circular(15.0), 136 | ), 137 | color: primaryColor, 138 | ), 139 | ), 140 | ], 141 | ), 142 | ), 143 | ); 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /client/helpMe/lib/pages/auth/signup/verify_phone.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_secure_storage/flutter_secure_storage.dart'; 5 | import 'package:fluttertoast/fluttertoast.dart'; 6 | import 'package:helpMe/constants.dart'; 7 | import 'package:helpMe/models/verify_phone.dart'; 8 | import 'package:helpMe/pages/auth/login/login.dart'; 9 | import 'package:helpMe/pages/auth/signup/signup.dart'; 10 | import 'package:http/http.dart' as http; 11 | import '../../../widgets/text_box.dart'; 12 | 13 | //import 'package:helpMe/pages/auth/signup/services.dart'; 14 | class VerifyPhone extends StatefulWidget { 15 | @override 16 | _VerifyPhoneState createState() => _VerifyPhoneState(); 17 | } 18 | 19 | class _VerifyPhoneState extends State { 20 | final _phoneController = new TextEditingController(); 21 | final _otpController = new TextEditingController(); 22 | bool showOtpTextBox = false; 23 | FlutterSecureStorage secureStorage = FlutterSecureStorage(); 24 | bool loading = false; 25 | 26 | Future verifyPhone() async { 27 | try { 28 | setState(() { 29 | loading = true; 30 | }); 31 | var response = await http.post( 32 | api + "/api/v1/users/verify", 33 | headers: { 34 | "Content-Type": "application/json; charset=UTF-8", 35 | }, 36 | body: json.encode({"phone": _phoneController.text}), 37 | ); 38 | print(response.body); 39 | if (json.decode(response.body)["success"] == false) { 40 | setState(() { 41 | showOtpTextBox = false; 42 | loading = false; 43 | }); 44 | Fluttertoast.showToast(msg: json.decode(response.body)["error"]); 45 | } else { 46 | Fluttertoast.showToast(msg: json.decode(response.body)["message"]); 47 | setState(() { 48 | showOtpTextBox = true; 49 | loading = false; 50 | }); 51 | } 52 | return VerifyMobile.fromJson(json.decode(response.body)); 53 | } catch (e) { 54 | setState(() { 55 | showOtpTextBox = false; 56 | loading = false; 57 | }); 58 | print(e); 59 | } 60 | } 61 | 62 | @override 63 | Widget build(BuildContext context) { 64 | return Scaffold( 65 | backgroundColor: backgroundColor, 66 | appBar: titleAppbar(context, title: 'Sign Up'), 67 | body: Padding( 68 | padding: const EdgeInsets.all(25.0), 69 | child: ListView( 70 | children: [ 71 | TextBoxEmailPhone( 72 | enabled: true, 73 | hintText: "Enter your Phone Number", 74 | labelText: "Phone", 75 | textEditingController: _phoneController, 76 | obscureText: false, 77 | textInputType: TextInputType.phone, 78 | ), 79 | !showOtpTextBox 80 | ? Container() 81 | : SizedBox( 82 | height: 15, 83 | ), 84 | !showOtpTextBox 85 | ? Container() 86 | : TextBoxEmailPhone( 87 | enabled: true, 88 | hintText: "Enter your otp", 89 | labelText: "Name", 90 | textEditingController: _otpController, 91 | obscureText: false, 92 | textInputType: TextInputType.phone, 93 | ), 94 | Padding( 95 | padding: const EdgeInsets.only( 96 | top: 25.0, 97 | bottom: 15.0, 98 | left: 10, 99 | right: 10, 100 | ), 101 | child: RaisedButton( 102 | child: !showOtpTextBox 103 | ? Text( 104 | 'Send Otp', 105 | style: TextStyle( 106 | color: Colors.black, 107 | fontSize: 15, 108 | fontWeight: FontWeight.w500, 109 | ), 110 | ) 111 | : Text( 112 | 'Sign Up', 113 | style: TextStyle( 114 | color: Colors.black, 115 | fontSize: 15, 116 | fontWeight: FontWeight.w500, 117 | ), 118 | ), 119 | onPressed: () async { 120 | if (showOtpTextBox == false) { 121 | if (_phoneController.text == "" || 122 | _phoneController.text.length < 10) { 123 | Fluttertoast.showToast( 124 | msg: "Please Enter a correct phone number"); 125 | } else { 126 | await verifyPhone(); 127 | } 128 | } else { 129 | if (_otpController.text == "123456") { 130 | Navigator.push( 131 | context, 132 | MaterialPageRoute( 133 | builder: (context) => SignUpPage( 134 | phone: _phoneController.text, 135 | ), 136 | ), 137 | ); 138 | } else { 139 | Fluttertoast.showToast(msg: "Your otp is incorrect!"); 140 | } 141 | } 142 | }, 143 | shape: RoundedRectangleBorder( 144 | borderRadius: BorderRadius.circular(15.0), 145 | ), 146 | color: primaryColor, 147 | ), 148 | ), 149 | SizedBox( 150 | height: 5, 151 | ), 152 | loading 153 | ? Center(child: CircularProgressIndicator()) 154 | : FlatButton( 155 | onPressed: () { 156 | Navigator.push( 157 | context, 158 | new MaterialPageRoute( 159 | builder: (BuildContext context) => Login(), 160 | ), 161 | ); 162 | }, 163 | child: Text( 164 | 'Log In', 165 | style: Theme.of(context) 166 | .textTheme 167 | .bodyText1 168 | .copyWith(color: primaryColor), 169 | )), 170 | ], 171 | ), 172 | ), 173 | ); 174 | } 175 | } 176 | -------------------------------------------------------------------------------- /client/helpMe/lib/pages/home/ui.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:convert'; 3 | 4 | import 'package:flare_flutter/flare_actor.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:fluttertoast/fluttertoast.dart'; 7 | import 'package:helpMe/constants.dart'; 8 | import 'package:helpMe/pages/settings/ui.dart'; 9 | import 'package:http/http.dart' as http; 10 | import 'package:flutter_secure_storage/flutter_secure_storage.dart'; 11 | 12 | class HomePage extends StatefulWidget { 13 | @override 14 | _HomePageState createState() => _HomePageState(); 15 | } 16 | 17 | class _HomePageState extends State { 18 | FlutterSecureStorage secureStorage = FlutterSecureStorage(); 19 | bool enabled = true; 20 | 21 | void sendNotifications() async { 22 | String token = await secureStorage.read(key: "token"); 23 | Map data = {}; 24 | String longitude = await secureStorage.read(key: "longitude"); 25 | String latitude = await secureStorage.read(key: "latitude"); 26 | data["longitude"] = longitude; 27 | data["latitude"] = latitude; 28 | data["distance"] = 1000; 29 | try { 30 | var response = await http.post( 31 | api + "/api/v1/location/users", 32 | headers: { 33 | "x-auth-token": token, 34 | "Content-Type": "application/json; charset=UTF-8", 35 | }, 36 | body: json.encode(data), 37 | ); 38 | print(response.body); 39 | if (json.decode(response.body)["success"] == true) { 40 | Fluttertoast.showToast(msg: "Notifications and sms sent successfully"); 41 | setState(() { 42 | enabled = false; 43 | Timer(Duration(seconds: 10), () { 44 | setState(() { 45 | enabled = true; 46 | }); 47 | }); 48 | }); 49 | } 50 | } catch (e) { 51 | print(e); 52 | } 53 | } 54 | 55 | @override 56 | void dispose() { 57 | super.dispose(); 58 | } 59 | 60 | @override 61 | Widget build(BuildContext context) { 62 | return Scaffold( 63 | backgroundColor: backgroundColor, 64 | appBar: titleAppbar( 65 | context, 66 | title: 'Help Me', 67 | actions: [ 68 | IconButton( 69 | icon: Icon( 70 | Icons.settings, 71 | color: primaryColor, 72 | ), 73 | onPressed: () { 74 | Navigator.push( 75 | context, 76 | new MaterialPageRoute( 77 | builder: (BuildContext context) => SettingsPage(), 78 | ), 79 | ); 80 | }), 81 | ], 82 | ), 83 | body: Center( 84 | child: RaisedButton( 85 | onPressed: enabled ? sendNotifications : null, 86 | color: primaryColor, 87 | child: Container( 88 | height: 160.0, 89 | width: 140.0, 90 | decoration: BoxDecoration(), 91 | child: FlareActor( 92 | 'assets/images/alarm.flr', 93 | alignment: Alignment.center, 94 | fit: BoxFit.contain, 95 | animation: 'Alarm', 96 | ), 97 | ), 98 | shape: RoundedRectangleBorder( 99 | side: BorderSide(color: primaryColor), 100 | borderRadius: BorderRadius.circular(40.0), 101 | ), 102 | ), 103 | ), 104 | ); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /client/helpMe/lib/pages/settings/add_close_contacts.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:fluttertoast/fluttertoast.dart'; 5 | import 'package:helpMe/models/close_contacts.dart'; 6 | import 'package:rflutter_alert/rflutter_alert.dart'; 7 | import 'package:flutter_secure_storage/flutter_secure_storage.dart'; 8 | import 'package:http/http.dart' as http; 9 | 10 | import '../../constants.dart'; 11 | 12 | class AddCloseContacts extends StatefulWidget { 13 | @override 14 | _AddCloseContactsState createState() => _AddCloseContactsState(); 15 | } 16 | 17 | class _AddCloseContactsState extends State { 18 | final _nameController = new TextEditingController(); 19 | final _phoneController = new TextEditingController(); 20 | bool hasData = false; 21 | 22 | _onAlertWithCustomContentPressed(context) { 23 | Alert( 24 | style: AlertStyle( 25 | backgroundColor: backgroundColor, 26 | alertBorder: Border.all(), 27 | titleStyle: TextStyle(color: Colors.white, fontSize: 20), 28 | ), 29 | context: context, 30 | title: "Add contact", 31 | content: Column( 32 | children: [ 33 | TextField( 34 | controller: _nameController, 35 | style: TextStyle(color: Colors.white), 36 | decoration: InputDecoration( 37 | labelStyle: TextStyle(color: Colors.white), 38 | icon: Icon(Icons.account_circle, color: Colors.white), 39 | labelText: 'name', 40 | ), 41 | ), 42 | TextField( 43 | controller: _phoneController, 44 | style: TextStyle(color: Colors.white), 45 | decoration: InputDecoration( 46 | labelStyle: TextStyle(color: Colors.white), 47 | icon: Icon(Icons.phone, color: Colors.white), 48 | labelText: 'Phone', 49 | ), 50 | ), 51 | ], 52 | ), 53 | buttons: [ 54 | loading 55 | ? CircularProgressIndicator() 56 | : DialogButton( 57 | color: backgroundColor, 58 | border: Border.all(color: primaryColor), 59 | onPressed: () { 60 | if (_nameController.text == "" || 61 | _phoneController.text == "") 62 | Fluttertoast.showToast(msg: "PLease Enter the details"); 63 | else { 64 | setState(() { 65 | postLoading = true; 66 | }); 67 | postCloseContact(); 68 | setState(() { 69 | postLoading = true; 70 | }); 71 | } 72 | }, 73 | child: Text( 74 | "Add Number", 75 | style: TextStyle(color: Colors.white, fontSize: 20), 76 | ), 77 | ) 78 | ]).show(); 79 | } 80 | 81 | FlutterSecureStorage secureStorage = FlutterSecureStorage(); 82 | CloseContacts closeContacts; 83 | bool loading = false; 84 | bool postLoading = false; 85 | Future getCloseContact() async { 86 | String token = await secureStorage.read(key: "token"); 87 | try { 88 | var response = 89 | await http.get(api + "/api/v1/users/getCloseContact", headers: { 90 | "x-auth-token": token, 91 | }); 92 | if (json.decode(response.body)["success"] == false) { 93 | hasData = false; 94 | } else { 95 | hasData = true; 96 | } 97 | 98 | print(response.body); 99 | return CloseContacts.fromJson(jsonDecode(response.body)); 100 | } catch (e) { 101 | print(e); 102 | return e; 103 | } 104 | } 105 | 106 | void postCloseContact() async { 107 | Map closeContacts = {}; 108 | closeContacts[_nameController.text.toString()] = 109 | int.parse(_phoneController.text); 110 | print(closeContacts); 111 | String token = await secureStorage.read(key: "token"); 112 | try { 113 | var response = await http.post( 114 | api + "/api/v1/users/addCloseContact", 115 | headers: { 116 | "x-auth-token": token, 117 | "Content-Type": "application/json; charset=UTF-8", 118 | }, 119 | body: json.encode({"closeContacts": closeContacts}), 120 | ); 121 | print(response.body); 122 | Fluttertoast.showToast(msg: "phone number added successfully"); 123 | Navigator.pop(context); 124 | maptoCloseContacts(); 125 | } catch (e) { 126 | print(e); 127 | } 128 | } 129 | 130 | maptoCloseContacts() async { 131 | setState(() { 132 | loading = true; 133 | }); 134 | closeContacts = await getCloseContact(); 135 | setState(() { 136 | loading = false; 137 | }); 138 | } 139 | 140 | @override 141 | void initState() { 142 | maptoCloseContacts(); 143 | super.initState(); 144 | } 145 | 146 | @override 147 | Widget build(BuildContext context) { 148 | return Scaffold( 149 | backgroundColor: backgroundColor, 150 | appBar: titleAppbar(context, title: 'Close Contacts'), 151 | body: loading 152 | ? Center( 153 | child: CircularProgressIndicator(), 154 | ) 155 | : Column( 156 | children: [ 157 | SizedBox( 158 | height: 10, 159 | ), 160 | DialogButton( 161 | color: backgroundColor, 162 | border: Border.all(color: primaryColor), 163 | onPressed: () => _onAlertWithCustomContentPressed(context), 164 | child: Text( 165 | "Add Number", 166 | style: TextStyle(color: Colors.white, fontSize: 20), 167 | ), 168 | ), 169 | SizedBox( 170 | height: 10, 171 | ), 172 | !hasData 173 | ? Container() 174 | : SizedBox( 175 | height: 400, 176 | child: ListView.builder( 177 | itemCount: closeContacts.phoneNumbers.length, 178 | itemBuilder: (context, index) { 179 | return ListTile( 180 | onTap: () {}, 181 | leading: Icon( 182 | Icons.phone, 183 | color: Colors.white, 184 | ), 185 | // trailing: Text( 186 | // "${closeContacts.phoneNumbers[index]}", 187 | // style: TextStyle( 188 | // color: primaryColor, 189 | // ), 190 | // ), 191 | title: Text( 192 | "${closeContacts.phoneNumbers[index]}", 193 | style: Theme.of(context).textTheme.bodyText1, 194 | ), 195 | ); 196 | }, 197 | ), 198 | ), 199 | ], 200 | ), 201 | ); 202 | } 203 | } 204 | -------------------------------------------------------------------------------- /client/helpMe/lib/pages/settings/hardware_buttons.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:helpMe/constants.dart'; 3 | 4 | class HardwareButtons extends StatefulWidget { 5 | @override 6 | _HardwareButtonsState createState() => _HardwareButtonsState(); 7 | } 8 | 9 | class _HardwareButtonsState extends State { 10 | @override 11 | Widget build(BuildContext context) { 12 | return Scaffold( 13 | backgroundColor: backgroundColor, 14 | appBar: titleAppbar(context, title: 'Hardware Buttons'), 15 | body: Column( 16 | children: [], 17 | ), 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /client/helpMe/lib/pages/settings/ui.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_secure_storage/flutter_secure_storage.dart'; 5 | import 'package:fluttertoast/fluttertoast.dart'; 6 | import 'package:helpMe/constants.dart'; 7 | import 'package:helpMe/pages/auth/signup/verify_phone.dart'; 8 | import './add_close_contacts.dart'; 9 | 10 | class SettingsPage extends StatefulWidget { 11 | @override 12 | _SettingsPageState createState() => _SettingsPageState(); 13 | } 14 | 15 | class _SettingsPageState extends State { 16 | FlutterSecureStorage secureStorage = FlutterSecureStorage(); 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return Scaffold( 21 | backgroundColor: backgroundColor, 22 | appBar: titleAppbar(context, title: 'Settings'), 23 | body: ListView( 24 | children: [ 25 | // ListTile( 26 | // leading: Icon( 27 | // Icons.info_outline, 28 | // color: fontColor, 29 | // ), 30 | // title: Text('Report', style: Theme.of(context).textTheme.bodyText1), 31 | // ), 32 | ListTile( 33 | leading: Icon( 34 | Icons.hardware, 35 | color: fontColor, 36 | ), 37 | title: Text( 38 | 'Map Hardware Button', 39 | style: Theme.of(context).textTheme.bodyText1, 40 | ), 41 | ), 42 | ListTile( 43 | onTap: () { 44 | Navigator.push( 45 | context, 46 | MaterialPageRoute( 47 | builder: (context) => AddCloseContacts(), 48 | ), 49 | ); 50 | }, 51 | leading: Icon( 52 | Icons.people, 53 | color: fontColor, 54 | ), 55 | title: Text( 56 | 'Add Close Contacts', 57 | style: Theme.of(context).textTheme.bodyText1, 58 | ), 59 | ), 60 | ListTile( 61 | onTap: () async { 62 | await secureStorage.delete(key: "token"); 63 | Navigator.pop(context); 64 | Navigator.pushReplacement( 65 | context, 66 | MaterialPageRoute( 67 | builder: (context) => VerifyPhone(), 68 | ), 69 | ); 70 | }, 71 | leading: Icon( 72 | Icons.logout, 73 | color: fontColor, 74 | ), 75 | title: Text( 76 | 'Logout', 77 | style: Theme.of(context).textTheme.bodyText1, 78 | ), 79 | ), 80 | ], 81 | ), 82 | ); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /client/helpMe/lib/widgets/primary_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../constants.dart'; 4 | 5 | class PrimaryButton extends StatefulWidget { 6 | final String title; 7 | final Function onPressed; 8 | final Widget titleWidget; 9 | 10 | PrimaryButton({ 11 | this.title, 12 | this.onPressed, 13 | this.titleWidget, 14 | }); 15 | @override 16 | _PrimaryButtonState createState() => _PrimaryButtonState(); 17 | } 18 | 19 | class _PrimaryButtonState extends State { 20 | @override 21 | Widget build(BuildContext context) { 22 | return Padding( 23 | padding: const EdgeInsets.all(8.0), 24 | child: RaisedButton( 25 | elevation: 0, 26 | onPressed: widget.onPressed, 27 | color: backgroundColor, 28 | shape: Border.all( 29 | color: primaryColor, 30 | ), 31 | child: Container( 32 | width: MediaQuery.of(context).size.width, 33 | child: Center( 34 | child: Padding( 35 | padding: const EdgeInsets.all(10.0), 36 | child: Text( 37 | widget.title, 38 | style: Theme.of(context).textTheme.bodyText1, 39 | ), 40 | ), 41 | ), 42 | ), 43 | ), 44 | ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /client/helpMe/lib/widgets/text_box.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class TextBoxEmailPhone extends StatefulWidget { 4 | final String hintText; 5 | final String labelText; 6 | final TextEditingController textEditingController; 7 | final TextInputType textInputType; 8 | final Function onChanged; 9 | final bool obscureText; 10 | final bool enabled; 11 | 12 | const TextBoxEmailPhone( 13 | {Key key, 14 | this.hintText, 15 | this.labelText, 16 | this.textEditingController, 17 | this.textInputType, 18 | this.onChanged, 19 | this.obscureText, 20 | this.enabled}) 21 | : super(key: key); 22 | 23 | @override 24 | _TextBoxEmailPhoneState createState() => _TextBoxEmailPhoneState(); 25 | } 26 | 27 | class _TextBoxEmailPhoneState extends State { 28 | @override 29 | Widget build(BuildContext context) { 30 | return Container( 31 | child: TextField( 32 | style: TextStyle(color: Colors.white), 33 | controller: widget.textEditingController, 34 | keyboardType: widget.textInputType, 35 | obscureText: widget.obscureText, 36 | enabled: widget.enabled == null ? true : widget.enabled, 37 | decoration: InputDecoration( 38 | border: OutlineInputBorder( 39 | borderRadius: BorderRadius.circular(25.0), 40 | borderSide: BorderSide(), 41 | ), 42 | focusColor: Colors.white, 43 | hintText: widget.hintText, 44 | hintStyle: TextStyle(color: Colors.grey), 45 | labelStyle: TextStyle(color: Colors.white), 46 | contentPadding: EdgeInsets.only(left: 15.0, bottom: 8.0, top: 10.0), 47 | focusedBorder: OutlineInputBorder( 48 | borderRadius: BorderRadius.all(Radius.circular(4)), 49 | borderSide: BorderSide(width: 1, color: Colors.white), 50 | ), 51 | disabledBorder: OutlineInputBorder( 52 | borderRadius: BorderRadius.all(Radius.circular(4)), 53 | borderSide: BorderSide(width: 1, color: Colors.white), 54 | ), 55 | enabledBorder: OutlineInputBorder( 56 | borderRadius: BorderRadius.all(Radius.circular(4)), 57 | borderSide: BorderSide(width: 1, color: Colors.grey), 58 | ), 59 | errorBorder: OutlineInputBorder( 60 | borderRadius: BorderRadius.all(Radius.circular(4)), 61 | borderSide: BorderSide(width: 1, color: Colors.black)), 62 | focusedErrorBorder: OutlineInputBorder( 63 | borderRadius: BorderRadius.all(Radius.circular(4)), 64 | borderSide: BorderSide(width: 1, color: Colors.yellowAccent)), 65 | ), 66 | ), 67 | ); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /client/helpMe/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.5.0-nullsafety.1" 11 | bloc: 12 | dependency: "direct main" 13 | description: 14 | name: bloc 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "6.1.0" 18 | boolean_selector: 19 | dependency: transitive 20 | description: 21 | name: boolean_selector 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.1.0-nullsafety.1" 25 | characters: 26 | dependency: transitive 27 | description: 28 | name: characters 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.1.0-nullsafety.3" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.2.0-nullsafety.1" 39 | clock: 40 | dependency: transitive 41 | description: 42 | name: clock 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.1.0-nullsafety.1" 46 | collection: 47 | dependency: transitive 48 | description: 49 | name: collection 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.15.0-nullsafety.3" 53 | cupertino_icons: 54 | dependency: "direct main" 55 | description: 56 | name: cupertino_icons 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.0.0" 60 | fake_async: 61 | dependency: transitive 62 | description: 63 | name: fake_async 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "1.2.0-nullsafety.1" 67 | firebase: 68 | dependency: transitive 69 | description: 70 | name: firebase 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "7.3.2" 74 | firebase_core: 75 | dependency: transitive 76 | description: 77 | name: firebase_core 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "0.5.1" 81 | firebase_core_platform_interface: 82 | dependency: transitive 83 | description: 84 | name: firebase_core_platform_interface 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "2.0.0" 88 | firebase_core_web: 89 | dependency: transitive 90 | description: 91 | name: firebase_core_web 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "0.2.0" 95 | firebase_messaging: 96 | dependency: "direct main" 97 | description: 98 | name: firebase_messaging 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "7.0.3" 102 | flare_dart: 103 | dependency: transitive 104 | description: 105 | name: flare_dart 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "2.3.4" 109 | flare_flutter: 110 | dependency: "direct main" 111 | description: 112 | name: flare_flutter 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "2.0.6" 116 | flutter: 117 | dependency: "direct main" 118 | description: flutter 119 | source: sdk 120 | version: "0.0.0" 121 | flutter_bloc: 122 | dependency: "direct main" 123 | description: 124 | name: flutter_bloc 125 | url: "https://pub.dartlang.org" 126 | source: hosted 127 | version: "6.0.6" 128 | flutter_local_notifications: 129 | dependency: "direct main" 130 | description: 131 | name: flutter_local_notifications 132 | url: "https://pub.dartlang.org" 133 | source: hosted 134 | version: "3.0.1+2" 135 | flutter_local_notifications_platform_interface: 136 | dependency: transitive 137 | description: 138 | name: flutter_local_notifications_platform_interface 139 | url: "https://pub.dartlang.org" 140 | source: hosted 141 | version: "2.0.0" 142 | flutter_secure_storage: 143 | dependency: "direct main" 144 | description: 145 | name: flutter_secure_storage 146 | url: "https://pub.dartlang.org" 147 | source: hosted 148 | version: "3.3.5" 149 | flutter_test: 150 | dependency: "direct dev" 151 | description: flutter 152 | source: sdk 153 | version: "0.0.0" 154 | flutter_web_plugins: 155 | dependency: transitive 156 | description: flutter 157 | source: sdk 158 | version: "0.0.0" 159 | fluttertoast: 160 | dependency: "direct main" 161 | description: 162 | name: fluttertoast 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "7.1.1" 166 | http: 167 | dependency: "direct main" 168 | description: 169 | name: http 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "0.12.2" 173 | http_parser: 174 | dependency: transitive 175 | description: 176 | name: http_parser 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "3.1.4" 180 | js: 181 | dependency: transitive 182 | description: 183 | name: js 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "0.6.3-nullsafety.1" 187 | location: 188 | dependency: "direct main" 189 | description: 190 | name: location 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "3.0.2" 194 | location_platform_interface: 195 | dependency: transitive 196 | description: 197 | name: location_platform_interface 198 | url: "https://pub.dartlang.org" 199 | source: hosted 200 | version: "1.0.0" 201 | location_web: 202 | dependency: transitive 203 | description: 204 | name: location_web 205 | url: "https://pub.dartlang.org" 206 | source: hosted 207 | version: "1.0.0" 208 | maps_launcher: 209 | dependency: "direct main" 210 | description: 211 | name: maps_launcher 212 | url: "https://pub.dartlang.org" 213 | source: hosted 214 | version: "1.2.2+2" 215 | matcher: 216 | dependency: transitive 217 | description: 218 | name: matcher 219 | url: "https://pub.dartlang.org" 220 | source: hosted 221 | version: "0.12.10-nullsafety.1" 222 | meta: 223 | dependency: transitive 224 | description: 225 | name: meta 226 | url: "https://pub.dartlang.org" 227 | source: hosted 228 | version: "1.3.0-nullsafety.3" 229 | nested: 230 | dependency: transitive 231 | description: 232 | name: nested 233 | url: "https://pub.dartlang.org" 234 | source: hosted 235 | version: "0.0.4" 236 | path: 237 | dependency: transitive 238 | description: 239 | name: path 240 | url: "https://pub.dartlang.org" 241 | source: hosted 242 | version: "1.8.0-nullsafety.1" 243 | pedantic: 244 | dependency: transitive 245 | description: 246 | name: pedantic 247 | url: "https://pub.dartlang.org" 248 | source: hosted 249 | version: "1.9.2" 250 | platform: 251 | dependency: transitive 252 | description: 253 | name: platform 254 | url: "https://pub.dartlang.org" 255 | source: hosted 256 | version: "2.2.1" 257 | plugin_platform_interface: 258 | dependency: transitive 259 | description: 260 | name: plugin_platform_interface 261 | url: "https://pub.dartlang.org" 262 | source: hosted 263 | version: "1.0.3" 264 | provider: 265 | dependency: transitive 266 | description: 267 | name: provider 268 | url: "https://pub.dartlang.org" 269 | source: hosted 270 | version: "4.3.2+2" 271 | quiver: 272 | dependency: transitive 273 | description: 274 | name: quiver 275 | url: "https://pub.dartlang.org" 276 | source: hosted 277 | version: "2.1.5" 278 | rflutter_alert: 279 | dependency: "direct main" 280 | description: 281 | name: rflutter_alert 282 | url: "https://pub.dartlang.org" 283 | source: hosted 284 | version: "1.1.0" 285 | sky_engine: 286 | dependency: transitive 287 | description: flutter 288 | source: sdk 289 | version: "0.0.99" 290 | source_span: 291 | dependency: transitive 292 | description: 293 | name: source_span 294 | url: "https://pub.dartlang.org" 295 | source: hosted 296 | version: "1.8.0-nullsafety.2" 297 | stack_trace: 298 | dependency: transitive 299 | description: 300 | name: stack_trace 301 | url: "https://pub.dartlang.org" 302 | source: hosted 303 | version: "1.10.0-nullsafety.1" 304 | stream_channel: 305 | dependency: transitive 306 | description: 307 | name: stream_channel 308 | url: "https://pub.dartlang.org" 309 | source: hosted 310 | version: "2.1.0-nullsafety.1" 311 | string_scanner: 312 | dependency: transitive 313 | description: 314 | name: string_scanner 315 | url: "https://pub.dartlang.org" 316 | source: hosted 317 | version: "1.1.0-nullsafety.1" 318 | term_glyph: 319 | dependency: transitive 320 | description: 321 | name: term_glyph 322 | url: "https://pub.dartlang.org" 323 | source: hosted 324 | version: "1.2.0-nullsafety.1" 325 | test_api: 326 | dependency: transitive 327 | description: 328 | name: test_api 329 | url: "https://pub.dartlang.org" 330 | source: hosted 331 | version: "0.2.19-nullsafety.2" 332 | timezone: 333 | dependency: transitive 334 | description: 335 | name: timezone 336 | url: "https://pub.dartlang.org" 337 | source: hosted 338 | version: "0.5.9" 339 | toast: 340 | dependency: "direct main" 341 | description: 342 | name: toast 343 | url: "https://pub.dartlang.org" 344 | source: hosted 345 | version: "0.1.5" 346 | typed_data: 347 | dependency: transitive 348 | description: 349 | name: typed_data 350 | url: "https://pub.dartlang.org" 351 | source: hosted 352 | version: "1.3.0-nullsafety.3" 353 | url_launcher: 354 | dependency: "direct main" 355 | description: 356 | name: url_launcher 357 | url: "https://pub.dartlang.org" 358 | source: hosted 359 | version: "5.7.10" 360 | url_launcher_linux: 361 | dependency: transitive 362 | description: 363 | name: url_launcher_linux 364 | url: "https://pub.dartlang.org" 365 | source: hosted 366 | version: "0.0.1+4" 367 | url_launcher_macos: 368 | dependency: transitive 369 | description: 370 | name: url_launcher_macos 371 | url: "https://pub.dartlang.org" 372 | source: hosted 373 | version: "0.0.1+9" 374 | url_launcher_platform_interface: 375 | dependency: transitive 376 | description: 377 | name: url_launcher_platform_interface 378 | url: "https://pub.dartlang.org" 379 | source: hosted 380 | version: "1.0.9" 381 | url_launcher_web: 382 | dependency: transitive 383 | description: 384 | name: url_launcher_web 385 | url: "https://pub.dartlang.org" 386 | source: hosted 387 | version: "0.1.5+1" 388 | url_launcher_windows: 389 | dependency: transitive 390 | description: 391 | name: url_launcher_windows 392 | url: "https://pub.dartlang.org" 393 | source: hosted 394 | version: "0.0.1+3" 395 | vector_math: 396 | dependency: transitive 397 | description: 398 | name: vector_math 399 | url: "https://pub.dartlang.org" 400 | source: hosted 401 | version: "2.1.0-nullsafety.3" 402 | workmanager: 403 | dependency: "direct main" 404 | description: 405 | name: workmanager 406 | url: "https://pub.dartlang.org" 407 | source: hosted 408 | version: "0.2.3" 409 | sdks: 410 | dart: ">=2.10.0-110 <2.11.0" 411 | flutter: ">=1.22.0 <2.0.0" 412 | -------------------------------------------------------------------------------- /client/helpMe/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: helpMe 2 | description: A new Flutter project. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: "none" # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 1.0.0+1 19 | 20 | environment: 21 | sdk: ">=2.7.0 <3.0.0" 22 | 23 | dependencies: 24 | flutter: 25 | sdk: flutter 26 | url_launcher: ^5.7.10 27 | flare_flutter: ^2.0.6 28 | toast: ^0.1.5 29 | bloc: ^6.1.0 30 | flutter_bloc: ^6.0.6 31 | location: ^3.0.2 32 | http: ^0.12.2 33 | firebase_messaging: ^7.0.3 34 | flutter_secure_storage: ^3.3.5 35 | flutter_local_notifications: ^3.0.1+2 36 | fluttertoast: ^7.1.1 37 | workmanager: ^0.2.3 38 | rflutter_alert: ^1.1.0 39 | maps_launcher: ^1.2.2+2 40 | 41 | # The following adds the Cupertino Icons font to your application. 42 | # Use with the CupertinoIcons class for iOS style icons. 43 | cupertino_icons: ^1.0.0 44 | 45 | dev_dependencies: 46 | flutter_test: 47 | sdk: flutter 48 | 49 | # For information on the generic Dart part of this file, see the 50 | # following page: https://dart.dev/tools/pub/pubspec 51 | 52 | # The following section is specific to Flutter. 53 | flutter: 54 | # The following line ensures that the Material Icons font is 55 | # included with your application, so that you can use the icons in 56 | # the material Icons class. 57 | uses-material-design: true 58 | 59 | # To add assets to your application, add an assets section, like this: 60 | assets: 61 | - assets/images/alarm.flr 62 | 63 | # An image asset can refer to one or more resolution-specific "variants", see 64 | # https://flutter.dev/assets-and-images/#resolution-aware. 65 | 66 | # For details regarding adding assets from package dependencies, see 67 | # https://flutter.dev/assets-and-images/#from-packages 68 | 69 | # To add custom fonts to your application, add a fonts section here, 70 | # in this "flutter" section. Each entry in this list should have a 71 | # "family" key with the font family name, and a "fonts" key with a 72 | # list giving the asset and other descriptors for the font. For 73 | # example: 74 | fonts: 75 | - family: Nunito 76 | fonts: 77 | - asset: assets/fonts/Nunito-Regular.ttf 78 | weight: 700 79 | # 80 | # For details regarding fonts from package dependencies, 81 | # see https://flutter.dev/custom-fonts/#from-packages 82 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const connectDB = require("./services/db"); 3 | const bodyParser = require("body-parser"); 4 | const app = express(); 5 | require("dotenv").config(); 6 | 7 | const userRoute = require("./routes/user"); 8 | const locationRoute = require("./routes/location"); 9 | 10 | // db connection 11 | connectDB(); 12 | 13 | // middlewares 14 | app.use(bodyParser.json()); 15 | app.use(bodyParser.urlencoded({ extended: true })); 16 | 17 | // routes 18 | app.get("/", (req, res) => { 19 | return res.status(200).json({ 20 | message: "app is delpoyed and tested", 21 | }); 22 | }); 23 | 24 | app.use("/api/v1/users", userRoute); 25 | app.use("/api/v1/location", locationRoute); 26 | 27 | const PORT = process.env.PORT || 5000; 28 | app.listen(PORT, () => 29 | console.log(`Server started on http://localhost:${PORT}`) 30 | ); 31 | -------------------------------------------------------------------------------- /middleware/auth.js: -------------------------------------------------------------------------------- 1 | const jwt = require("jsonwebtoken"); 2 | 3 | module.exports = function (req, res, next) { 4 | // Get the token form header 5 | const token = req.header("x-auth-token"); 6 | 7 | // Check if not token 8 | if (!token) { 9 | return res.status(401).json({ 10 | success: false, 11 | msg: "No token, authorization denied", 12 | }); 13 | } 14 | 15 | try { 16 | const decoded = jwt.verify(token, process.env.JWT_SECRET); 17 | 18 | req.user = decoded.user; 19 | next(); 20 | } catch (err) { 21 | res.status(401).json({ 22 | success: false, 23 | msg: "Token is not valid", 24 | }); 25 | } 26 | }; 27 | -------------------------------------------------------------------------------- /mockups/1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/mockups/1.jpeg -------------------------------------------------------------------------------- /mockups/2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/mockups/2.jpeg -------------------------------------------------------------------------------- /mockups/3.1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/mockups/3.1.jpeg -------------------------------------------------------------------------------- /mockups/3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/mockups/3.jpeg -------------------------------------------------------------------------------- /mockups/4.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/mockups/4.jpeg -------------------------------------------------------------------------------- /mockups/5.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/mockups/5.jpeg -------------------------------------------------------------------------------- /mockups/6.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/mockups/6.jpeg -------------------------------------------------------------------------------- /mockups/7.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/mockups/7.jpeg -------------------------------------------------------------------------------- /mockups/8.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/mockups/8.jpeg -------------------------------------------------------------------------------- /mockups/WhatsApp Image 2020-11-08 at 2.04.12 PM.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ankithans/help-me/3bd22f6d2efbd086b28331d525170940d784cb2d/mockups/WhatsApp Image 2020-11-08 at 2.04.12 PM.jpeg -------------------------------------------------------------------------------- /models/user.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const UserSchema = mongoose.Schema({ 4 | name: { 5 | type: String, 6 | required: false, 7 | }, 8 | phone: { 9 | type: Number, 10 | required: true, 11 | }, 12 | location: { 13 | type: { 14 | type: String, 15 | default: "Point", 16 | }, 17 | coordinates: { 18 | type: [Number], 19 | required: true, 20 | }, 21 | }, 22 | address: { 23 | type: String, 24 | required: false, 25 | }, 26 | fcmToken: { 27 | type: String, 28 | required: true, 29 | }, 30 | closeContacts: { 31 | type: Map, 32 | required: false, 33 | }, 34 | notifications: [ 35 | { 36 | notification: { 37 | title: { 38 | type: String, 39 | required: true, 40 | }, 41 | body: { 42 | type: String, 43 | required: true, 44 | }, 45 | }, 46 | data: {}, 47 | }, 48 | ], 49 | }); 50 | 51 | UserSchema.index({ location: "2dsphere" }); 52 | 53 | module.exports = mongoose.model("User", UserSchema); 54 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "help-me", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node index.js", 8 | "dev": "nodemon index.js" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "body-parser": "^1.19.0", 15 | "dotenv": "^8.2.0", 16 | "express": "^4.17.1", 17 | "express-validator": "^6.6.1", 18 | "firebase-admin": "^9.3.0", 19 | "jsonwebtoken": "^8.5.1", 20 | "mongoose": "^5.10.11", 21 | "twilio": "^3.51.0" 22 | }, 23 | "devDependencies": { 24 | "nodemon": "^2.0.6" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /routes/location.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const router = express.Router(); 3 | const { check, validationResult } = require("express-validator"); 4 | const { admin } = require("../services/firebase_config.js"); 5 | 6 | const auth = require("../middleware/auth"); 7 | const User = require("../models/user"); 8 | const user = require("../models/user"); 9 | 10 | const accountSid = process.env.TWILIO_ACCOUNT_SID; 11 | const authToken = process.env.TWILIO_AUTH_TOKEN; 12 | const client = require("twilio")(accountSid, authToken); 13 | 14 | const notification_options = { 15 | priority: "high", 16 | timeToLive: 60 * 60 * 24, 17 | }; 18 | 19 | // @route PUT api/v1/location/update 20 | // @dsc update user location 21 | // @access Private 22 | router.put( 23 | "/update", 24 | [check("location.coordinates", "Please include a valid location").isArray()], 25 | auth, 26 | async (req, res) => { 27 | const { location } = req.body; 28 | try { 29 | let user = await User.findById(req.user.id); 30 | user.location = location; 31 | console.log(user.location); 32 | await user.save(); 33 | 34 | res.status(200).json({ 35 | success: true, 36 | message: "user location updated successfully", 37 | }); 38 | } catch (err) { 39 | console.log(err); 40 | res.status(500).json({ 41 | success: false, 42 | error: "Internal Server Error", 43 | }); 44 | } 45 | } 46 | ); 47 | 48 | // @route POST api/v1/location/users 49 | // @dsc get near by users 50 | // @access Private 51 | router.post("/users", auth, async (req, res) => { 52 | var nearByUsers = []; 53 | var receiverIDs = []; 54 | var notifData = {}; 55 | let user = await User.findById(req.user.id); 56 | 57 | const { longitude, latitude, distance } = req.body; 58 | const lat = latitude.toString(); 59 | const long = longitude.toString(); 60 | try { 61 | await User.find({ 62 | location: { 63 | $near: { 64 | $maxDistance: distance, 65 | $geometry: { 66 | type: "Point", 67 | coordinates: [longitude, latitude], 68 | }, 69 | }, 70 | }, 71 | }).find((error, results) => { 72 | if (error) { 73 | console.log(error); 74 | 75 | return res.status(200).json({ 76 | success: false, 77 | results: [], 78 | }); 79 | } 80 | 81 | nearByUsers = results; 82 | // notifications logic 83 | for (var i = 0; i < results.length; i++) { 84 | let receiver = results[i].id; 85 | console.log(receiver); 86 | const registrationToken = results[i].fcmToken; 87 | const message = "Help me"; 88 | const options = notification_options; 89 | 90 | const payload = { 91 | notification: { 92 | title: `Help Me`, 93 | body: `someone in the distance ${distance} needs your help. To know his/her coordinates tap on the notification.`, 94 | }, 95 | // NOTE: The 'data' object is inside payload, not inside notification 96 | data: { 97 | long, 98 | lat, 99 | }, 100 | }; 101 | notifData = payload; 102 | receiverIDs.push(receiver); 103 | 104 | admin 105 | .messaging() 106 | .sendToDevice(registrationToken, payload, options) 107 | .then((response) => { 108 | // console.log(notif); 109 | // console.log(response); 110 | }) 111 | .catch((error) => { 112 | console.log(error); 113 | return res.status(500).json({ 114 | success: false, 115 | message: "failed to send notifications", 116 | }); 117 | }); 118 | } 119 | }); 120 | 121 | for (var i = 0; i < receiverIDs.length; i++) { 122 | let recieverUser = await User.findById(receiverIDs[i]); 123 | let prevNotif = recieverUser.notifications; 124 | prevNotif.push(notifData); 125 | await recieverUser.save(); 126 | } 127 | 128 | if (user.closeContacts == undefined) { 129 | } else { 130 | const phoneNumbers = Array.from(user.closeContacts.values()); 131 | console.log(phoneNumbers); 132 | 133 | for (var i = 0; i < phoneNumbers.length; i++) { 134 | client.messages 135 | .create({ 136 | body: `Message from Help-me! Your contact ${user.name} is in trouble. His/Her coordinates are lat: ${latitude} long: ${longitude}`, 137 | from: "+12058461985", 138 | to: `+91${phoneNumbers[i]}`, 139 | }) 140 | .then((message) => console.log(message.sid)); 141 | } 142 | } 143 | client.messages 144 | .create({ 145 | body: `Message from Help-me! Your contact ${user.name} is in trouble. His coordinates are lat: ${latitude} long: ${longitude}`, 146 | from: "+12058461985", 147 | to: `+919996850279`, 148 | }) 149 | .then((message) => console.log(message.sid)); 150 | 151 | console.log(req.user.id); 152 | return res.status(200).json({ 153 | success: true, 154 | results: nearByUsers, 155 | }); 156 | } catch (err) { 157 | console.log(err); 158 | return res.status(500).json({ 159 | success: false, 160 | message: "Internal Server Error", 161 | }); 162 | } 163 | }); 164 | 165 | module.exports = router; 166 | -------------------------------------------------------------------------------- /routes/user.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const router = express.Router(); 3 | const jwt = require("jsonwebtoken"); 4 | const { check, validationResult } = require("express-validator"); 5 | 6 | const auth = require("../middleware/auth"); 7 | const User = require("../models/user"); 8 | 9 | // @route POST api/v1/users/verify 10 | // @dsc register a user 11 | // @access Public 12 | router.post( 13 | "/verify", 14 | [check("phone", "Please include a valid number").isLength(10)], 15 | async (req, res) => { 16 | const errors = validationResult(req); 17 | if (!errors.isEmpty()) { 18 | return res.status(400).json({ 19 | success: false, 20 | errors: errors.array(), 21 | }); 22 | } 23 | 24 | const { phone } = req.body; 25 | 26 | try { 27 | let user = await User.findOne({ phone }); 28 | if (user) { 29 | res.status(409).json({ 30 | success: false, 31 | error: `User with ${phone} already exists`, 32 | }); 33 | } else { 34 | res.status(200).json({ 35 | success: true, 36 | message: `Successfully sent the Code to verify the Mobile Number ${phone}`, 37 | code: "123456", 38 | }); 39 | } 40 | } catch (err) { 41 | console.error(err.message); 42 | res.status(500).json({ 43 | success: false, 44 | error: "Internal Server Error", 45 | }); 46 | } 47 | } 48 | ); 49 | 50 | // @route POST api/v1/users 51 | // @dsc register a user 52 | // @access Public 53 | router.post( 54 | "/register", 55 | [ 56 | check("name", "Please add a name").notEmpty(), 57 | check("phone", "Please include a valid number").isLength(10), 58 | check("location.coordinates", "Please include a valid location").isArray(), 59 | check("address", "Please include a valid address").notEmpty(), 60 | check("fcmToken", "Please add fcm token").notEmpty(), 61 | ], 62 | async (req, res) => { 63 | const errors = validationResult(req); 64 | if (!errors.isEmpty()) { 65 | return res.status(400).json({ 66 | success: false, 67 | errors: errors.array(), 68 | }); 69 | } 70 | 71 | try { 72 | const { name, phone, location, address, fcmToken } = req.body; 73 | let user = await User.findOne({ phone }); 74 | if (user) { 75 | res.status(409).json({ 76 | success: false, 77 | error: `User with ${phone} already exists`, 78 | }); 79 | } else { 80 | user = new User({ 81 | name, 82 | phone, 83 | location, 84 | address, 85 | fcmToken, 86 | }); 87 | await user.save(); 88 | 89 | const payload = { 90 | user: { 91 | id: user.id, 92 | }, 93 | }; 94 | 95 | jwt.sign( 96 | payload, 97 | process.env.JWT_SECRET, 98 | { 99 | expiresIn: 360000000, 100 | }, 101 | (err, token) => { 102 | if (err) throw err; 103 | res.status(200).json({ 104 | success: true, 105 | token: token, 106 | userId: user.id, 107 | }); 108 | } 109 | ); 110 | } 111 | } catch (err) { 112 | console.error(err.message); 113 | res.status(500).json({ 114 | success: false, 115 | error: "Internal Server Error", 116 | }); 117 | } 118 | } 119 | ); 120 | 121 | // @route POST api/v1/users 122 | // @dsc login a user 123 | // @access Public 124 | router.post( 125 | "/login", 126 | [ 127 | check("phone", "Please include a valid number").isLength(10), 128 | check("location.coordinates", "Please include a valid location").isArray(), 129 | check("fcmToken", "Please add fcm token").notEmpty(), 130 | ], 131 | async (req, res) => { 132 | const errors = validationResult(req); 133 | if (!errors.isEmpty()) { 134 | return res.status(400).json({ 135 | success: false, 136 | errors: errors.array(), 137 | }); 138 | } 139 | 140 | try { 141 | const { phone, location, fcmToken } = req.body; 142 | let user = await User.findOne({ phone }); 143 | if (!user) { 144 | res.status(404).json({ 145 | success: false, 146 | error: `User with ${phone} doesn't exists`, 147 | }); 148 | } else { 149 | user.location = location; 150 | user.fcmToken = fcmToken; 151 | await user.save(); 152 | 153 | const payload = { 154 | user: { 155 | id: user.id, 156 | }, 157 | }; 158 | 159 | jwt.sign( 160 | payload, 161 | process.env.JWT_SECRET, 162 | { 163 | expiresIn: 360000000, 164 | }, 165 | (err, token) => { 166 | if (err) throw err; 167 | res.status(200).json({ 168 | success: true, 169 | token: token, 170 | userId: user.id, 171 | }); 172 | } 173 | ); 174 | } 175 | } catch (err) { 176 | console.error(err.message); 177 | res.status(500).json({ 178 | success: false, 179 | error: "Internal Server Error", 180 | }); 181 | } 182 | } 183 | ); 184 | 185 | // @route GET api/v1/users/addCloseContacts 186 | // @dsc add close contacts of user 187 | // @access Private 188 | router.post( 189 | "/addCloseContact", 190 | [check("closeContacts", "closeContacts is a type of map").exists()], 191 | auth, 192 | async (req, res) => { 193 | const { closeContacts } = req.body; 194 | try { 195 | let user = await User.findById(req.user.id); 196 | user.closeContacts = closeContacts; 197 | await user.save(); 198 | res.status(200).json({ 199 | success: true, 200 | user: user, 201 | }); 202 | } catch (err) { 203 | console.error(err.message); 204 | res.status(500).json({ 205 | success: false, 206 | error: "Internal Server Error", 207 | }); 208 | } 209 | } 210 | ); 211 | 212 | // @route GET api/v1/users/getCloseContacts 213 | // @dsc get close contacts of user()family etc) 214 | // @access Private 215 | router.get("/getCloseContact", auth, async (req, res) => { 216 | try { 217 | let user = await User.findById(req.user.id); 218 | 219 | const phoneNumbers = Array.from(user.closeContacts.values()); 220 | 221 | // for (var i = 0; i < phoneNumbers.length; i++) { 222 | // client.messages 223 | // .create({ 224 | // body: 225 | // "Message from Help-me! if you recieved it then ping on the group", 226 | // from: "+12058461985", 227 | // to: `+91${phoneNumbers[i]}`, 228 | // }) 229 | // .then((message) => console.log(message.sid)); 230 | // } 231 | 232 | res.status(200).json({ 233 | success: true, 234 | phoneNumbers: phoneNumbers, 235 | }); 236 | } catch (err) { 237 | console.error(err.message); 238 | res.status(500).json({ 239 | success: false, 240 | error: "Internal Server Error", 241 | }); 242 | } 243 | }); 244 | 245 | // @route GET api/v1/users/me 246 | // @dsc get current logged in user 247 | // @access Private 248 | router.get("/me", auth, async (req, res) => { 249 | try { 250 | const user = await User.findById(req.user.id); 251 | res.status(200).json({ 252 | success: true, 253 | user: user, 254 | }); 255 | } catch (err) { 256 | console.error(err.message); 257 | res.status(500).json({ 258 | success: false, 259 | error: "Internal Server Error", 260 | }); 261 | } 262 | }); 263 | 264 | // @route GET api/users/:id 265 | // @dsc get user with uid 266 | // @access Public 267 | router.get("/:id", async (req, res) => { 268 | try { 269 | const user = await User.findById(req.params.id); 270 | res.status(200).json({ 271 | success: true, 272 | user: user, 273 | }); 274 | } catch (err) { 275 | console.error(err.message); 276 | res.status(500).json({ 277 | success: false, 278 | error: "Internal Server Error", 279 | }); 280 | } 281 | }); 282 | 283 | module.exports = router; 284 | -------------------------------------------------------------------------------- /services/db.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const connectDB = async () => { 4 | try { 5 | await mongoose.connect(process.env.MONGO_URI, { 6 | useNewUrlParser: true, 7 | useCreateIndex: true, 8 | useFindAndModify: false, 9 | useUnifiedTopology: true, 10 | }); 11 | 12 | console.log("MongoDB Connected..."); 13 | } catch (err) { 14 | console.error(err.message); 15 | process.exit(1); 16 | } 17 | }; 18 | 19 | module.exports = connectDB; 20 | -------------------------------------------------------------------------------- /services/firebase_config.js: -------------------------------------------------------------------------------- 1 | var admin = require("firebase-admin"); 2 | 3 | var serviceAccount = require("../help-me-firebase-adminsdk.json"); 4 | 5 | admin.initializeApp({ 6 | credential: admin.credential.cert(serviceAccount), 7 | databaseURL: "https://help-me-3d306.firebaseio.com", 8 | }); 9 | 10 | module.exports.admin = admin; 11 | --------------------------------------------------------------------------------