Commit 80e4ac20 authored by Pasindu-Vimukthi's avatar Pasindu-Vimukthi

Front end

parent 26949ed5
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
# Web related
lib/generated_plugin_registrant.dart
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: b22742018b3edf16c6cadd7b76d9db5e7f9064b5
channel: stable
project_type: app
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "detector - code",
"request": "launch",
"type": "dart"
},
{
"name": "detector - code (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
}
]
}
\ No newline at end of file
# detector
A new Flutter project.
## Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 30
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.detector"
minSdkVersion 17
targetSdkVersion 30
multiDexEnabled true
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:28.2.0')
implementation 'com.google.firebase:firebase-analytics-ktx'
}
{
"project_info": {
"project_number": "580815325809",
"project_id": "depress-detector",
"storage_bucket": "depress-detector.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:580815325809:android:2343346ff73719be6ba9d0",
"android_client_info": {
"package_name": "com.example.detector"
}
},
"oauth_client": [
{
"client_id": "580815325809-ujsg21tpl9u68ir1jp1c0f5l5ppch1ak.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDsOo8GqzJnO-T1v83Nfizg5znRnpnJ0R4"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "580815325809-ujsg21tpl9u68ir1jp1c0f5l5ppch1ak.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
\ No newline at end of file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.detector">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.detector">
<application
android:label="Depression Detector"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
package com.example.detector
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.detector">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.8'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
include ':app'
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
This diff is collapsed.
<svg id="a7136578-9e51-4be6-bab0-c6e74466be7a" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="738.222" height="702" viewBox="0 0 738.222 702"><path d="M758.55088,219.89949c17.44419-9.6681,35.16328-20.02823,47.4895-35.70738,12.87285-16.37451,18.368-40.86546,6.43806-57.93923-10.02108-14.342-29.97635-19.38477-46.97457-15.24s-31.22857,15.95342-42.28074,29.5169c3.61653-16.6709-13.96556-32.76764-30.96017-31.29126s-30.63042,16.33039-35.16813,32.77447-1.58523,34.042,3.28386,50.391a222.94611,222.94611,0,0,0,39.46458,75.339,72.701,72.701,0,0,1,9.86546-13.78376C723.12591,239.20284,741.10669,229.56759,758.55088,219.89949Z" transform="translate(-230.889 -99)" fill="#00bfa6"/><path d="M698.25158,268.54117a221.09652,221.09652,0,0,1-48.85992-87.93968c-4.7863-16.97507-7.59014-36.27518-.41724-53.02277,5.5478-12.95321,17.372-24.673,32.02947-25.758,15.4683-1.145,32.64,13.17894,29.32651,29.55816-.24745,1.22319,1.36363,2.51362,2.31766,1.34915,12.38131-15.11231,29.40057-29.03287,49.68223-30.39748,18.06468-1.21544,37.04075,7.81173,42.30257,26.16256,5.48057,19.11373-3.97525,39.33492-17.218,52.85076-14.69014,14.99308-33.813,24.34561-51.86189,34.5568-17.75857,10.047-35.8208,21.64869-46.7436,39.40822a62.62584,62.62584,0,0,0-9.36719,27.191c-.85776,9.97862,1.63856,19.41363,6.46933,28.11517,5.131,9.24245,11.47624,17.6681,16.10983,27.21132a137.73765,137.73765,0,0,1,10.3316,29.57021,139.58522,139.58522,0,0,1,.09,61.90038c-8.51461,37.14271-33.35829,69.83329-66.4219,88.6395a136.70534,136.70534,0,0,1-12.30515,6.18643c-1.62887.72035-.21936,3.11074,1.39976,2.39469a142.44754,142.44754,0,0,0,75.82-82.042c13.98849-39.71,8.62571-85.46407-13.7517-121.06166-5.85657-9.31653-12.622-18.35133-14.55048-29.45077-1.76721-10.17116.40921-20.78141,4.70378-30.06,9.19736-19.87128,27.42718-32.78844,45.841-43.44911,18.40924-10.658,38.07484-19.88843,53.67589-34.67141,13.8882-13.15995,24.13389-31.9373,21.729-51.60868a37.7757,37.7757,0,0,0-11.79435-23.49049,44.44331,44.44331,0,0,0-23.75827-10.71605c-19.66005-2.77173-38.08885,6.556-52.10146,19.74134A116.53478,116.53478,0,0,0,710.687,130.767l2.31766,1.34916c2.99085-14.78423-8.76148-28.36658-22.52258-32.10574-14.96514-4.06631-29.80007,4.6823-38.42342,16.54267-10.77139,14.81475-11.65246,33.81344-8.50384,51.2813,3.26625,18.12042,10.028,35.86081,18.241,52.289a225.10309,225.10309,0,0,0,34.49467,50.3788c1.20071,1.32572,3.15722-.64033,1.96105-1.961Z" transform="translate(-230.889 -99)" fill="#3f3d56"/><polygon points="457.71 668.672 444.623 672.386 393.202 508.636 430.934 502.131 457.71 668.672" fill="#9f616a"/><polygon points="304.107 669.612 291.165 666.839 324.644 499.036 361.049 510.896 304.107 669.612" fill="#9f616a"/><path d="M672.82791,799.48c3.58348,1.63547,6.58511-8.50078,9.60783-5.5303,8.455,8.30884,28.73788,6.44635,28.73788,6.44635a5.28525,5.28525,0,0,0,3.33135-6.88748h0a5.28526,5.28526,0,0,0-3.66688-3.27168l-8.99186-2.248-14.1185-24.82908-15.38667-1.94738-.38863.63555a39.67271,39.67271,0,0,0-4.25142,32.44019C668.98061,798.38818,670.72236,798.519,672.82791,799.48Z" transform="translate(-230.889 -99)" fill="#2f2e41"/><path d="M516.19731,792.25648c3.22425,2.26282,8.02776-7.15417,10.45671-3.6813,6.79412,9.71408,27.07582,11.58971,27.07582,11.58971a5.28526,5.28526,0,0,0,4.534-6.16268h0a5.28527,5.28527,0,0,0-3.00722-3.88672L546.827,786.2621,537.48382,759.271l-14.77165-4.72653-.49824.55383a39.67268,39.67268,0,0,0-10.10836,31.1169C512.61434,790.48,514.30284,790.92691,516.19731,792.25648Z" transform="translate(-230.889 -99)" fill="#2f2e41"/><path d="M644.98943,482.90421c6.89129,10.59782,13.57129,21.30108,16.52671,33.48194A673.85293,673.85293,0,0,1,676.788,606.98193c-23.9432,13.73726-44.71549,21.62282-65.0071,22.98173-.94358.06286-1.88563.10732-2.82712.14207l-7.39726-41.76062-5.9008,41.30038c-2.92185-.31062-5.84821-.75315-8.78867-1.34582-12.7204-2.55149-25.67185-7.76532-39.51085-15.77106a211.18781,211.18781,0,0,1-6.18455-60.41257c1.13705-27.188,7.28465-50.46557,13.23809-69.15786Z" transform="translate(-230.889 -99)" fill="#2f2e41"/><path d="M594.16609,359.77648l-32.52753-11.05935c11.76729-11.51951,16.5732-24.16737,11.70991-38.38248l36.43083,6.5055C601.13485,333.50084,589.81648,343.533,594.16609,359.77648Z" transform="translate(-230.889 -99)" fill="#9f616a"/><path d="M644.98944,482.90421c-29.58893,23.53735-59.71295,26.25045-90.57971.054,12.44311-39.06714-12.94223-75.80464-9.24444-103.538,2.307-17.30249,9.50334-38.73434,26.2358-43.71712l17.97125,5.49121a38.06906,38.06906,0,0,1,25.74582,26.88293l2.12621,8.27381c10.2891,10.94542,13.71882,25.32981,11.04715,42.79262,2.25565,4.955,1.22028,11.20429.1849,17.46281-.97991,5.95344-1.95982,11.91613-.11093,16.76948,3.97873,10.43428,10.38785,19.93812,16.62394,29.52832" transform="translate(-230.889 -99)" fill="#3f3d56"/><path d="M392.336,777H370.33585c-11.50787,0-21.78808.81433-28.57415,5.17487A36.98691,36.98691,0,0,0,309.336,763H287.33585a36.99993,36.99993,0,0,0-36.99994,36.99994V800h179v-.00006C429.33591,779.56543,412.77048,777,392.336,777Z" transform="translate(-230.889 -99)" fill="#e6e6e6"/><path d="M848.34959,801h93.97265c-.47461-17.53223-13.60547-21-35.98633-21h-22C861.95505,780,848.8242,783.46777,848.34959,801Z" transform="translate(-230.889 -99)" fill="#e6e6e6"/><rect y="699.60954" width="738.222" height="2" fill="#3f3d56"/><circle cx="369.78259" cy="203.52804" r="29.27477" fill="#9f616a"/><path d="M701.19682,469.21193l-20.50752-6.71251,1.496-16.45613,22.51748-.50034A12.13706,12.13706,0,0,1,716.961,459.57v0A12.13708,12.13708,0,0,1,701.19682,469.21193Z" transform="translate(-230.889 -99)" fill="#9f616a"/><path d="M661.51614,516.38615C653.039,512.411,633.74578,502.39,605.87369,482.08c-38.383-27.97377-28.62084-96.28115-28.62084-96.28115l51.22357,50.80761c-.97991,5.95344-1.95982,11.91613-.11093,16.76948C636.741,475.34075,655.88629,493.18256,661.51614,516.38615Z" transform="translate(-230.889 -99)" opacity="0.2"/><path d="M684.5926,467.76786c-27.7718,6.15307-50.49211,9.84222-68.95835-3.25275-29.28611-34.06043-45.93044-68.254-39.70066-102.68833A16.69548,16.69548,0,0,1,588.052,348.752h0a16.79411,16.79411,0,0,1,20.03636,10.1317l22.126,74.15437,57.31569,11.09336Z" transform="translate(-230.889 -99)" fill="#2f2e41"/><path d="M641.0667,541.27687a14.35368,14.35368,0,0,1-13.98631-11.22246l-1.704-7.67183,27.97625-6.21473,1.70354,7.67092a14.32981,14.32981,0,0,1-10.8803,17.09594h0A14.349,14.349,0,0,1,641.0667,541.27687Zm-13.48482-17.48956,1.30316,5.86626a12.47991,12.47991,0,0,0,24.36558-5.414l-1.30271-5.86536Z" transform="translate(-230.889 -99)" fill="#3f3d56"/><path d="M629.83993,290.29234s4.6996-36.57437-33.646-24.58078c0,0-27.38666-5.02505-36.36782,29.23146l-9.094,35.90928,4.432-2.41229,2.0662,4.5165,7.18186,1.8188,3.07329-6.09991,1.48672,7.40758,58.82332,5.86419s-26.34579-15.58072-26.76356-43.50509l5.01832,5.30305Z" transform="translate(-230.889 -99)" fill="#2f2e41"/><path d="M281.389,780.5s18-196,0-227c0,0,76,121,33,233Z" transform="translate(-230.889 -99)" fill="#e6e6e6"/><path d="M296.09468,779.50009s57.73937-102.72795,55.4644-124.075c0,0,12.02164,84.727-38.87318,135.42654Z" transform="translate(-230.889 -99)" fill="#e6e6e6"/><path d="M876.389,788.53087s12.72974-138.61274,0-160.53619c0,0,53.7478,85.57216,23.33786,164.77944Z" transform="translate(-230.889 -99)" fill="#e6e6e6"/><path d="M886.789,787.82372s40.83374-72.65,39.22486-87.74683c0,0,8.5018,59.91958-27.49142,95.77472Z" transform="translate(-230.889 -99)" fill="#e6e6e6"/></svg>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
*.mode1v3
*.mode2v3
*.moved-aside
*.pbxuser
*.perspectivev3
**/*sync/
.sconsign.dblite
.tags*
**/.vagrant/
**/DerivedData/
Icon?
**/Pods/
**/.symlinks/
profile
xcuserdata
**/.generated/
Flutter/App.framework
Flutter/Flutter.framework
Flutter/Flutter.podspec
Flutter/Generated.xcconfig
Flutter/ephemeral/
Flutter/app.flx
Flutter/app.zip
Flutter/flutter_assets/
Flutter/flutter_export_environment.sh
ServiceDefinitions.json
Runner/GeneratedPluginRegistrant.*
# Exceptions to above rules.
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>App</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
</dict>
</plist>
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
import UIKit
import Flutter
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
{
"images" : [
{
"idiom" : "universal",
"filename" : "LaunchImage.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
# Launch Screen Assets
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="LaunchImage" width="168" height="185"/>
</resources>
</document>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--Flutter View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>detector</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
#import "GeneratedPluginRegistrant.h"
import 'package:detector/presentation/themes/color_theme.dart';
import 'package:flutter/material.dart';
class BackClipper extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
Paint paint_0 = new Paint()
..color = ColorTheme.accentColor2
..style = PaintingStyle.fill
..strokeWidth = 1.0;
Path path_0 = Path();
path_0.moveTo(0, 0);
path_0.lineTo(0, size.height * 0.6000000);
path_0.quadraticBezierTo(size.width * 0.2781250, size.height * 0.8325200,
size.width * 0.5250000, size.height * 0.8400000);
path_0.quadraticBezierTo(size.width * 0.7734500, size.height * 0.8300000,
size.width, size.height * 0.6400000);
path_0.lineTo(size.width, 0);
canvas.drawPath(path_0, paint_0);
}
@override
bool shouldRepaint(covariant CustomPainter oldDelegate) {
return true;
}
}
import 'package:detector/presentation/themes/color_theme.dart';
import 'package:flutter/material.dart';
class FrontClipper extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
Paint paint_0 = new Paint()
..color = ColorTheme.secondaryColor
..style = PaintingStyle.fill
..strokeWidth = 1.0;
Path path_0 = Path();
path_0.moveTo(0, 0);
path_0.lineTo(0, size.height * 0.6000000);
path_0.quadraticBezierTo(size.width * 0.2515750, size.height * 0.8025200,
size.width * 0.5000000, size.height * 0.8000000);
path_0.quadraticBezierTo(size.width * 0.7468750, size.height * 0.8000000,
size.width, size.height * 0.6000000);
path_0.lineTo(size.width, 0);
canvas.drawPath(path_0, paint_0);
}
@override
bool shouldRepaint(covariant CustomPainter oldDelegate) {
return true;
}
}
class FirebaseConstants {
//collections
static const CLIENTS = 'clients';
static const QUESTIONS = 'questions';
}
import 'package:flutter_screenutil/flutter_screenutil.dart';
class Sizes {
//font sizes
static double appBarTitleText = 32.sp;
static double titleText = 18.sp;
static double contentText = 18.sp;
static double buttonText = 22.sp;
static double menuText = 20.sp;
static double badgeText = 12.sp;
//spaces
static double defaultSpace = 20.w;
static double halfSpace = 10.w;
//padding
static double defaultPadding = 20.w;
static double defaultButtonPadding = 25.w;
static double horizontalPadding = 20.w;
static double verticalPadding = 20.w;
static double itemBottomPadding = 20.w;
static double contentHorizontal = 20.w;
static double contentVertical = 15.w;
//radius
static double buttonTextFieldRadius = 12.w;
}
class Converter {
String questionNumber(int number) {
return number >= 10 ? "$number" : "0$number";
}
}
import 'package:bot_toast/bot_toast.dart';
import 'package:detector/common/constants/size_constants.dart';
import 'package:detector/presentation/themes/color_theme.dart';
import 'package:flutter/material.dart';
class ToastHelper {
static void errorToast(String message) {
BotToast.showText(
text: message,
duration: Duration(seconds: 4),
onlyOne: true,
clickClose: true,
crossPage: true,
backButtonBehavior: BackButtonBehavior.none,
align: Alignment(0, 0.9),
animationDuration: Duration(milliseconds: 200),
animationReverseDuration: Duration(milliseconds: 200),
textStyle: TextStyle(
color: ColorTheme.whiteColorText, fontSize: Sizes.contentText),
borderRadius: BorderRadius.circular(Sizes.buttonTextFieldRadius),
backgroundColor: Colors.transparent,
contentColor: Colors.redAccent);
}
static void successToast(String message) {
BotToast.showText(
text: message,
duration: Duration(seconds: 3),
onlyOne: true,
clickClose: true,
crossPage: true,
backButtonBehavior: BackButtonBehavior.none,
align: Alignment(0, 0.9),
animationDuration: Duration(milliseconds: 200),
animationReverseDuration: Duration(milliseconds: 200),
textStyle: TextStyle(
color: ColorTheme.primaryColor, fontSize: Sizes.contentText),
borderRadius: BorderRadius.circular(Sizes.buttonTextFieldRadius),
backgroundColor: Colors.transparent,
contentColor: Colors.greenAccent);
}
}
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:detector/common/constants/firebase_constants.dart';
import 'package:detector/data/models/client_model.dart';
import 'package:detector/data/models/question_model.dart';
class FirebaseDatabase {
static final FirebaseDatabase _singleton = FirebaseDatabase._internal();
factory FirebaseDatabase() {
return _singleton;
}
FirebaseDatabase._internal();
final FirebaseFirestore _db = FirebaseFirestore.instance;
//create client account
Future<bool> createClient(ClientModel client) async {
try {
await _db
.collection(FirebaseConstants.CLIENTS)
.doc(client.id)
.set(client.toMap());
return true;
} catch (e) {
print(e.toString());
}
return false;
}
//get all questions
Future<List<QuestionModel>> getQuestions() async {
print("Getting questions...");
var _data = await _db
.collection(FirebaseConstants.QUESTIONS)
.orderBy("number")
.get();
return _data.docs.map((e) => QuestionModel.fromMap(e.data())).toList();
}
}
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:detector/common/constants/firebase_constants.dart';
import 'package:detector/data/core/firebase_database.dart';
import 'package:detector/data/models/client_model.dart';
import 'package:firebase_auth/firebase_auth.dart';
class UserAuth {
static final UserAuth _singleton = UserAuth._internal();
factory UserAuth() {
return _singleton;
}
UserAuth._internal();
final FirebaseAuth auth = FirebaseAuth.instance;
final FirebaseFirestore db = FirebaseFirestore.instance;
Future<String> createClient(ClientModel client) async {
try {
final UserCredential user = await auth.createUserWithEmailAndPassword(
email: client.email,
password: client.password,
);
client.id = user.user!.uid;
var result = await FirebaseDatabase().createClient(client);
if (result) {
return "Success||${user.user!.uid}";
} else {
return "Failed to create account";
}
} on FirebaseAuthException catch (authEx) {
print(authEx.code);
switch (authEx.code) {
case "email-already-in-use":
return "Email already registered. Please use SignIn";
case "invalid-email":
return "Email address not valid";
case "operation-not-allowed":
return "Server error, please try again later";
case "weak-password":
return "Poor password, Please enter strong one";
case "too-many-requests":
return "Too many requests. Please try again later";
default:
return "Please check your connection and try again later";
}
} catch (e) {
return e.toString();
}
}
Future<String> signIn(String email, String password) async {
try {
await auth.signInWithEmailAndPassword(
email: email,
password: password,
);
return "Success";
} on FirebaseAuthException catch (authEx) {
print(authEx.code);
switch (authEx.code) {
case "user-disabled":
return "Account disabled. Please contact customer service";
case "invalid-email":
return "Email address not valid";
case "operation-not-allowed":
return "Server error, please try again later";
case "user-not-found":
return "No user found with this email";
case "wrong-password":
return "Wrong email/password combination";
case "too-many-requests":
return "Too many requests. Please try again later";
default:
return "Please check your connection and try again later";
}
} catch (e) {
return e.toString();
}
}
Future<ClientModel?> getUser() async {
if (auth.currentUser?.uid != null) {
var userData = await db
.collection(FirebaseConstants.CLIENTS)
.doc(auth.currentUser?.uid)
.get();
ClientModel currentUser = ClientModel.fromMap(userData.data()!);
return currentUser;
}
return null;
}
Future<String> requestResetPassword(String email) async {
try {
await auth.sendPasswordResetEmail(email: email);
return "Email sent";
} catch (e) {
if (e.toString().contains("user-not-found")) {
return "No user found with the email";
} else if (e.toString().contains("An internal error has occurred")) {
return "An internal error has occurred";
} else {
return "Something went wrong, try again later";
}
}
}
Future<bool> updatePassword(String password) async {
try {
if (auth.currentUser?.uid != null) {
await auth.currentUser!.updatePassword(password);
return true;
}
} catch (e) {
return false;
}
return false;
}
Future<bool> updateEmail(String email) async {
try {
if (auth.currentUser?.uid != null) {
await auth.currentUser!.updateEmail(email);
return true;
}
} catch (e) {
return false;
}
return false;
}
User? getProfile() {
return auth.currentUser;
}
Future<String?> getUserId() async {
final currentUser = auth.currentUser;
if (currentUser != null) {
return currentUser.uid;
}
return null;
}
Future<bool> isSignedIn() async {
final currentUser = auth.currentUser;
return currentUser != null;
}
Future<List<void>> signOut() async {
return Future.wait([auth.signOut()]);
}
}
import 'package:cloud_firestore/cloud_firestore.dart';
class ClientModel {
String? id;
final String fullName;
final String email;
final String phone;
final String password;
final Timestamp timestamp;
ClientModel({
this.id,
required this.fullName,
required this.email,
required this.phone,
required this.password,
required this.timestamp,
});
Map<String, dynamic> toMap() {
return {
'id': id,
'fullName': fullName,
'email': email,
'phone': phone,
'password': password,
'timestamp': timestamp,
};
}
static ClientModel fromMap(Map<String, dynamic> map) {
return ClientModel(
id: map['id'],
fullName: map['fullName'],
email: map['email'],
phone: map['phone'],
password: map['password'],
timestamp: map['timestamp'],
);
}
}
class Person{
final String name;
final String url;
final int score;
Person({required this.name, required this.url, required this.score});
}
\ No newline at end of file
import 'package:cloud_firestore/cloud_firestore.dart';
class QuestionModel {
String? id;
final String question;
final int number;
final Timestamp timestamp;
QuestionModel({
this.id,
required this.question,
required this.number,
required this.timestamp,
});
Map<String, dynamic> toMap() {
return {
'id': id,
'question': question,
'number': number,
'timestamp': timestamp,
};
}
static QuestionModel fromMap(Map<String, dynamic> map) {
return QuestionModel(
id: map['id'],
question: map['question'],
number: map['number'],
timestamp: map['timestamp'],
);
}
}
import 'package:detector/data/models/client_model.dart';
import 'package:detector/data/models/question_model.dart';
import 'package:flutter/foundation.dart';
class DataProvider extends ChangeNotifier {
late ClientModel _client;
List<QuestionModel> _questions = [];
void setClient(ClientModel client) {
_client = client;
}
void setQuestions(List<QuestionModel> questions) {
_questions = questions;
}
ClientModel get currentClient => _client;
List<QuestionModel> get questions => _questions;
}
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
class UiSupportProvider extends ChangeNotifier {
int _questionIndex = 0;
late PageController _controller;
void setQuestionIndex(int index) {
_questionIndex = index;
showPage(_questionIndex);
notifyListeners();
}
void nextQuestion() {
_questionIndex = _questionIndex + 1;
showPage(_questionIndex);
notifyListeners();
}
void setController() {
_questionIndex = 0;
final controller = PageController(initialPage: _questionIndex);
_controller = controller;
}
void showPage(int index) {
_controller.animateToPage(index,
curve: Curves.easeInOut, duration: Duration(milliseconds: 500));
}
int get selectedMenuIndex => _questionIndex;
PageController get pageController => _controller;
}
import 'package:bot_toast/bot_toast.dart';
import 'package:detector/presentation/screens/login/login_screen.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:pedantic/pedantic.dart';
import 'package:provider/provider.dart';
import 'data/provider/data_provider.dart';
import 'data/provider/ui_support_provider.dart';
import 'presentation/themes/color_theme.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
unawaited(
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]));
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ScreenUtilInit(
designSize: Size(414, 896),
builder: () {
return MultiProvider(
providers: [
ChangeNotifierProvider<DataProvider>(
create: (_) => DataProvider(),
),
ChangeNotifierProvider<UiSupportProvider>(
create: (_) => UiSupportProvider(),
),
],
child: MaterialApp(
debugShowCheckedModeBanner: false,
title: "Depression Detector",
theme: ThemeData(
textTheme: GoogleFonts.firaSansTextTheme(
Theme.of(context).textTheme,
),
scaffoldBackgroundColor: ColorTheme.backgroundColor,
primaryColor: ColorTheme.accentColor1,
),
builder: BotToastInit(),
navigatorObservers: [BotToastNavigatorObserver()],
home: LoginScreen(),
),
);
},
);
}
}
import 'package:detector/common/constants/size_constants.dart';
import 'package:detector/data/core/user_auth.dart';
import 'package:detector/data/provider/ui_support_provider.dart';
import 'package:detector/presentation/screens/login/login_screen.dart';
import 'package:detector/presentation/screens/text/text_answers_screen.dart';
import 'package:detector/presentation/screens/voice/voice_answers_screen.dart';
import 'package:detector/presentation/themes/color_theme.dart';
import 'package:detector/presentation/widgets/big_button.dart';
import 'package:detector/presentation/widgets/custom_app_bar.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class HomeScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Column(
children: [
CustomAppBar(
backButton: false,
title: "HOME",
),
SizedBox(height: Sizes.defaultSpace),
Expanded(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: Sizes.defaultPadding),
child: Column(
children: [
BigButton(
image: "assets/icons/microphone.png",
title: "Voice Depression Measurement",
function: () {
Provider.of<UiSupportProvider>(context, listen: false)
.setController();
Navigator.push(context, MaterialPageRoute(
builder: (context) {
return VoiceAnswersScreen();
},
));
},
),
SizedBox(height: Sizes.defaultSpace),
BigButton(
image: "assets/icons/keyboard.png",
title: "Type Text Depression Measurement",
function: () {
Provider.of<UiSupportProvider>(context, listen: false)
.setController();
Navigator.push(context, MaterialPageRoute(
builder: (context) {
return TextAnswersScreen();
},
));
},
),
SizedBox(height: Sizes.defaultSpace),
BigButton(
image: "assets/icons/image.png",
title: "Image & MCQ Depression Measurement",
function: () {},
),
SizedBox(height: Sizes.defaultSpace),
Padding(
padding: EdgeInsets.symmetric(
horizontal: Sizes.defaultPadding * 1.5),
child: Divider(
height: 2,
color: ColorTheme.accentColor1,
thickness: 2,
),
),
SizedBox(height: Sizes.defaultSpace),
Row(
children: [
BigButton(
image: "assets/icons/profile.png",
title: "My Profile",
halfButton: true,
function: () {},
),
SizedBox(width: Sizes.defaultSpace),
BigButton(
image: "assets/icons/sign-out.png",
title: "Logout",
halfButton: true,
function: () async {
await UserAuth().signOut();
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (context) => LoginScreen()),
(Route<dynamic> route) => false);
},
),
],
),
],
),
),
),
),
],
),
),
);
}
}
This diff is collapsed.
import 'dart:io';
import 'package:detector/common/clippers/back_clipper.dart';
import 'package:detector/common/clippers/front_clipper.dart';
import 'package:detector/common/constants/size_constants.dart';
import 'package:detector/common/utils/toast_helper.dart';
import 'package:detector/data/core/user_auth.dart';
import 'package:detector/presentation/screens/login/login_screen.dart';
import 'package:detector/presentation/themes/color_theme.dart';
import 'package:detector/presentation/widgets/form_text_box.dart';
import 'package:detector/presentation/widgets/primary_button.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:google_fonts/google_fonts.dart';
class ResetRequestScreen extends StatefulWidget {
@override
_ResetRequestScreenState createState() => _ResetRequestScreenState();
}
class _ResetRequestScreenState extends State<ResetRequestScreen> {
final formKey = GlobalKey<FormState>();
final emailController = TextEditingController();
bool _loading = false;
@override
Widget build(BuildContext context) {
var width = MediaQuery.of(context).size.width;
return GestureDetector(
onTap: () {
final FocusScopeNode currentScope = FocusScope.of(context);
if (!currentScope.hasPrimaryFocus && currentScope.hasFocus) {
FocusManager.instance.primaryFocus!.unfocus();
}
},
child: Scaffold(
backgroundColor: Colors.transparent,
body: Container(
height: MediaQuery.of(context).size.height,
width: width,
color: ColorTheme.backgroundColor,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
color: ColorTheme.backgroundColor,
height: 250.w,
child: Stack(
children: [
CustomPaint(
size: Size(
width,
(width * 0.625).toDouble(),
),
painter: BackClipper(),
),
CustomPaint(
size: Size(
width,
(width * 0.625).toDouble(),
),
painter: FrontClipper(),
),
Positioned.fill(
child: Align(
alignment: Alignment.center,
child: Text(
"FORGOT PASSWORD?",
style: GoogleFonts.bebasNeue(
textStyle: TextStyle(
fontSize: Sizes.appBarTitleText,
color: ColorTheme.backgroundColor,
fontWeight: FontWeight.w900,
letterSpacing: 3,
wordSpacing: 5,
),
),
),
),
),
],
),
),
Expanded(
child: Container(
padding: EdgeInsets.symmetric(
horizontal: Sizes.defaultPadding,
vertical: Sizes.defaultPadding,
),
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: Sizes.defaultSpace * 2),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Form(
key: formKey,
child: Column(
children: [
FormTextBox(
hintText: "Email",
textController: emailController,
keyboard: TextInputType.emailAddress,
),
],
),
),
SizedBox(height: Sizes.defaultSpace),
PrimaryButton(
loading: _loading,
text: "RESET PASSWORD",
function: () async {
FocusScope.of(context).unfocus();
var form = formKey.currentState;
if (form!.validate() && !_loading) {
form.save();
final emailRegX = RegExp(
r'^([\w-\.]+)+@[a-zA-Z0-9]{2,}\.[a-zA-Z]{2,}');
if (emailController.text.isEmpty) {
ToastHelper.errorToast(
"Email address required");
} else if (!emailRegX
.hasMatch(emailController.text)) {
ToastHelper.errorToast("Email not valid");
} else {
setState(() {
_loading = true;
});
var result = await UserAuth()
.requestResetPassword(
emailController.text);
if (result
.toLowerCase()
.contains("email sent")) {
ToastHelper.successToast(
"Email sent successfully. Follow the email to reset your password");
setState(() {
_loading = false;
});
sleep(Duration(seconds: 1));
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => LoginScreen(),
));
} else {
setState(() {
_loading = false;
});
ToastHelper.errorToast(result);
}
}
}
},
),
SizedBox(height: Sizes.halfSpace),
Container(
child: RichText(
textAlign: TextAlign.right,
text: TextSpan(
text: "Back to",
style: TextStyle(
color: ColorTheme.fadedTextColor,
fontSize: Sizes.contentText,
),
children: [
TextSpan(
recognizer: TapGestureRecognizer()
..onTap = () {
Navigator.pushReplacement(context,
MaterialPageRoute(
builder: (context) {
return LoginScreen();
},
));
},
text: " Login",
style: TextStyle(
color: ColorTheme.primaryColor,
fontSize: Sizes.contentText,
),
),
]),
),
),
SizedBox(height: Sizes.defaultSpace),
],
),
],
),
),
),
),
],
),
),
),
);
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment