diff --git a/.gitignore b/.gitignore index 4b016310..fd4aca5a 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,4 @@ app.*.map.json # Exceptions to above rules. !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages +health_calculators.dart diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..3287bb67 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,13 @@ +{ + // 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": "Flutter", + "request": "launch", + "type": "dart" + } + ] +} \ No newline at end of file diff --git a/Certs/APNSDevPushCert.p12 b/Certs/APNSDevPushCert.p12 new file mode 100644 index 00000000..dba27aec Binary files /dev/null and b/Certs/APNSDevPushCert.p12 differ diff --git a/Certs/APNSProdCert.certSigningRequest b/Certs/APNSProdCert.certSigningRequest new file mode 100644 index 00000000..3f13a387 --- /dev/null +++ b/Certs/APNSProdCert.certSigningRequest @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICkDCCAXgCAQAwSzEjMCEGCSqGSIb3DQEJARYUaGFyb29uNjEzOEBnbWFpbC5j +b20xFzAVBgNVBAMMDk1vaGFtZWQgTWVrYXd5MQswCQYDVQQGEwJBRTCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBALcPrk09MmhQhRNe8LYdaeN4mYtoKJg3 +SndMLgpxnaRqP7a6f4sp118wCFZsTXnwhPVP4DzmXWc2AzZtsusmhdw1tzNFtme0 +PtEjDXIPI2lHU3Zhi2zukZdAVxF+uNi3pcp0axina60ZQciIfb/7Fx6hNbqpk90E +O8a2Ob17Wq/ZTYIP4H7ZGydUe2ra9QyDtjmGj9vpEv+xXYWX685sgEylTG14DSOP +ozGsQmaf+QCMbCT3osq7idWc1IQ+3Oed0kUTx1jmRtZwPzQkJJ1Bx3vYSXN/EOlb +u+ei1Nqtc14aVCYvmcuvGDtMyRtw6w+syCw2CpJCPGNkxNz+EH9h+EUCAwEAAaAA +MA0GCSqGSIb3DQEBCwUAA4IBAQBYdu2AaZY6kReuT1Xp8ktlyPfjBRKhPPChuaeR +tFnYMsJtG0aIA/xOu4/RYDgmL92seimULXd9DIPvkJ2DuaB+bdfGTw0qXUlihkm8 +ui5O0L2F9OZbQxJogvTmrMsKnkoR27O5vyfCn9VMOLk3x1nyEzAXIj/5GHWw9T6t +r65jPUOfm6ikiZtICBzSaTPBtyfZB8mrbwG2dpOvVNSa1dj3xip4L8CL6TxH+qM3 ++N90QFYjvjphJkpn2Kt0ow9IyIyeqJbIYJmsWoV9pXddOHCjKdTWUjq7D2Jn3eUA +DAKjKgVqF4/dU10k7EtSfrw01aHLXjj5FxsD5YhVrgTA5xSq +-----END CERTIFICATE REQUEST----- diff --git a/Certs/APNSProdCert.p12 b/Certs/APNSProdCert.p12 new file mode 100644 index 00000000..b0ada453 Binary files /dev/null and b/Certs/APNSProdCert.p12 differ diff --git a/Certs/ApplePushCert.p12 b/Certs/ApplePushCert.p12 new file mode 100644 index 00000000..3a1d15c8 Binary files /dev/null and b/Certs/ApplePushCert.p12 differ diff --git a/Certs/ApplePushServices.certSigningRequest b/Certs/ApplePushServices.certSigningRequest new file mode 100644 index 00000000..7d509a0a --- /dev/null +++ b/Certs/ApplePushServices.certSigningRequest @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICkDCCAXgCAQAwSzEjMCEGCSqGSIb3DQEJARYUaGFyb29uNjEzOEBnbWFpbC5j +b20xFzAVBgNVBAMMDk1vaGFtZWQgTWVrYXd5MQswCQYDVQQGEwJBRTCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnHqsyE7WfiVcE1Lpa4t4OVO6qlll2q +1djs0XG06R/dlDtIqv4940/XLj+hU93mzAcVvFW4DSIEdD3InM3+T6oMTjPu6meU +69h9ryaVkluQRrT/tdGI1EKO4MWGMe4MDIt7DqMhMfAcxTwekwdxdKaCEhaw3qnA +l/64AelY6URW1pHHJMA0VV7j+pE3jVNai+muMXPrhQ1VrOrV8FftpY3bEeRJR2Cl +T0tv0LhEMu4SfLnVWCzGQQC82hilDw3rH3ZDs8DFxF9agNVdwKlYamarh1dQXwRq +Yx2+sjY1/51r9L4VS+GAh9ECxz0e+43NpzfZ/N+mTeDYKDepaBwPQ6kCAwEAAaAA +MA0GCSqGSIb3DQEBCwUAA4IBAQB89OyLfywKT7ftmpEqCmgsmaJexb580q9w8wOk +1JhJkNV5ec+p1dnge2NZeJ4LGII/5wmPj1vANNW0GZdmJDgnC+2gg9toq1QLCAsF +rW7/LMpgAoEH+P5bhrHV9RRv6BQi0ZmN0apBHjp/pqZfm2Cl5jQPEWjUEf2tIF4l +LSKdok6IPO9n4Fgyk0XdUNSEhgVhsLtZkGiXnkI1YovKDnupTFYPXMLp103bc9zP +xDxwscvOysNDijlzZAkJPg2z8NrJIRDrKvLRHzxQwZ/1LHVB/51bp/1iyks3vOjh +qw5XVsrtGAjCjU9md7q3XkPSyKzhK9UqPdOxdvl1OY0KKIIY +-----END CERTIFICATE REQUEST----- diff --git a/Certs/ApplePushServicesSandbox.certSigningRequest b/Certs/ApplePushServicesSandbox.certSigningRequest new file mode 100644 index 00000000..7d509a0a --- /dev/null +++ b/Certs/ApplePushServicesSandbox.certSigningRequest @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICkDCCAXgCAQAwSzEjMCEGCSqGSIb3DQEJARYUaGFyb29uNjEzOEBnbWFpbC5j +b20xFzAVBgNVBAMMDk1vaGFtZWQgTWVrYXd5MQswCQYDVQQGEwJBRTCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnHqsyE7WfiVcE1Lpa4t4OVO6qlll2q +1djs0XG06R/dlDtIqv4940/XLj+hU93mzAcVvFW4DSIEdD3InM3+T6oMTjPu6meU +69h9ryaVkluQRrT/tdGI1EKO4MWGMe4MDIt7DqMhMfAcxTwekwdxdKaCEhaw3qnA +l/64AelY6URW1pHHJMA0VV7j+pE3jVNai+muMXPrhQ1VrOrV8FftpY3bEeRJR2Cl +T0tv0LhEMu4SfLnVWCzGQQC82hilDw3rH3ZDs8DFxF9agNVdwKlYamarh1dQXwRq +Yx2+sjY1/51r9L4VS+GAh9ECxz0e+43NpzfZ/N+mTeDYKDepaBwPQ6kCAwEAAaAA +MA0GCSqGSIb3DQEBCwUAA4IBAQB89OyLfywKT7ftmpEqCmgsmaJexb580q9w8wOk +1JhJkNV5ec+p1dnge2NZeJ4LGII/5wmPj1vANNW0GZdmJDgnC+2gg9toq1QLCAsF +rW7/LMpgAoEH+P5bhrHV9RRv6BQi0ZmN0apBHjp/pqZfm2Cl5jQPEWjUEf2tIF4l +LSKdok6IPO9n4Fgyk0XdUNSEhgVhsLtZkGiXnkI1YovKDnupTFYPXMLp103bc9zP +xDxwscvOysNDijlzZAkJPg2z8NrJIRDrKvLRHzxQwZ/1LHVB/51bp/1iyks3vOjh +qw5XVsrtGAjCjU9md7q3XkPSyKzhK9UqPdOxdvl1OY0KKIIY +-----END CERTIFICATE REQUEST----- diff --git a/Certs/Pass.rtf b/Certs/Pass.rtf new file mode 100644 index 00000000..2fe18706 --- /dev/null +++ b/Certs/Pass.rtf @@ -0,0 +1,8 @@ +{\rtf1\ansi\ansicpg1252\cocoartf2513 +\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +{\*\expandedcolortbl;;} +\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0 +\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0 + +\f0\fs24 \cf0 Hmg54321} \ No newline at end of file diff --git a/Certs/aps.cer b/Certs/aps.cer new file mode 100644 index 00000000..d95bac40 Binary files /dev/null and b/Certs/aps.cer differ diff --git a/Certs/aps_development.cer b/Certs/aps_development.cer new file mode 100644 index 00000000..9a9934bb Binary files /dev/null and b/Certs/aps_development.cer differ diff --git a/CustomFlutterFirebaseMessagingService.java b/CustomFlutterFirebaseMessagingService.java new file mode 100644 index 00000000..0a4d83be --- /dev/null +++ b/CustomFlutterFirebaseMessagingService.java @@ -0,0 +1,17 @@ +package io.flutter.plugins.firebasemessaging; + +import android.content.Intent; + +import com.google.firebase.messaging.RemoteMessage; + +public class CustomFlutterFirebaseMessagingService extends FlutterFirebaseMessagingService { + @Override + public void onMessageReceived(RemoteMessage remoteMessage) { + if (remoteMessage.getData().containsKey("is_call")) { + Intent intent = getPackageManager().getLaunchIntentForPackage(getPackageName()); + startActivity(intent); + super.onMessageReceived(remoteMessage); + } else + super.onMessageReceived(remoteMessage); + } +} \ No newline at end of file diff --git a/GoogleService-Info.plist b/GoogleService-Info.plist new file mode 100644 index 00000000..0c093a2a --- /dev/null +++ b/GoogleService-Info.plist @@ -0,0 +1,36 @@ + + + + + CLIENT_ID + 864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r + API_KEY + AIzaSyA_6ayGCk4fly7o7eTVBrj9kuHBYHMAOfs + GCM_SENDER_ID + 864393916058 + PLIST_VERSION + 1 + BUNDLE_ID + com.cloud.diplomaticquarterapp + PROJECT_ID + diplomaticquarter-d2385 + STORAGE_BUCKET + diplomaticquarter-d2385.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:864393916058:ios:13f787bbfe6051f8b97923 + DATABASE_URL + https://diplomaticquarter-d2385.firebaseio.com + + \ No newline at end of file diff --git a/android/CustomFlutterFirebaseMessagingService.java b/android/CustomFlutterFirebaseMessagingService.java new file mode 100644 index 00000000..0a4d83be --- /dev/null +++ b/android/CustomFlutterFirebaseMessagingService.java @@ -0,0 +1,17 @@ +package io.flutter.plugins.firebasemessaging; + +import android.content.Intent; + +import com.google.firebase.messaging.RemoteMessage; + +public class CustomFlutterFirebaseMessagingService extends FlutterFirebaseMessagingService { + @Override + public void onMessageReceived(RemoteMessage remoteMessage) { + if (remoteMessage.getData().containsKey("is_call")) { + Intent intent = getPackageManager().getLaunchIntentForPackage(getPackageName()); + startActivity(intent); + super.onMessageReceived(remoteMessage); + } else + super.onMessageReceived(remoteMessage); + } +} \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index 807f7fad..99f2b204 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -23,10 +23,11 @@ if (flutterVersionName == null) { apply plugin: 'com.android.application' apply plugin: 'kotlin-android' +apply plugin: 'com.google.gms.google-services' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 30 + compileSdkVersion 28 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -40,17 +41,28 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.cloud.diplomaticquarterapp" minSdkVersion 21 - targetSdkVersion 30 + targetSdkVersion 28 versionCode flutterVersionCode.toInteger() versionName flutterVersionName + multiDexEnabled true + } buildTypes { + debug {} 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 } + staging { + // Specifies a sorted list of fallback build types that the + // plugin should try to use when a dependency does not include a + // "staging" build type. You may specify as many fallbacks as you + // like, and the plugin selects the first build type that's + // available in the dependency. + matchingFallbacks = ['debug', 'qa', 'release'] + } } } @@ -60,4 +72,22 @@ flutter { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation "com.google.firebase:firebase-messaging:20.3.0" + implementation 'pub.devrel:easypermissions:0.4.0' + implementation 'com.google.firebase:firebase-inappmessaging-display:17.2.0' + implementation 'com.google.guava:guava:27.0.1-android' + // Dependency on local binaries + implementation fileTree(dir: 'libs', include: ['*.jar']) + + // Dependency on a remote binary +// implementation 'com.example.android:app-magic:12.3' + + + // Native Dependency + implementation "org.jetbrains.anko:anko-commons:0.10.4" + implementation 'com.github.kittinunf.fuel:fuel:2.3.0' //for JVM + implementation 'com.github.kittinunf.fuel:fuel-android:2.3.0' + implementation 'com.google.android.gms:play-services-location:17.1.0'//for Android + + } diff --git a/android/app/google-services.json b/android/app/google-services.json new file mode 100644 index 00000000..f86832ad --- /dev/null +++ b/android/app/google-services.json @@ -0,0 +1,42 @@ +{ + "project_info": { + "project_number": "815750722565", + "firebase_url": "https://api-project-815750722565.firebaseio.com", + "project_id": "api-project-815750722565", + "storage_bucket": "api-project-815750722565.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:815750722565:android:62281cd3e5df4063", + "android_client_info": { + "package_name": "com.cloud.diplomaticquarterapp" + } + }, + "oauth_client": [ + { + "client_id": "815750722565-3a0gc7neins0eoahdrimrfksk0sqice8.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyDUfg6AKM1-00WyzpvLImUBC46wFrq9-qw" + } + ], + "services": { + "analytics_service": { + "status": 1 + }, + "appinvite_service": { + "status": 1, + "other_platform_oauth_client": [] + }, + "ads_service": { + "status": 2 + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/app/gradle/wrapper/gradle-wrapper.properties b/android/app/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..8fc3bbec --- /dev/null +++ b/android/app/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Sun Sep 20 09:53:06 EEST 2020 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip diff --git a/android/app/gradlew b/android/app/gradlew new file mode 100644 index 00000000..cccdd3d5 --- /dev/null +++ b/android/app/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/android/app/gradlew.bat b/android/app/gradlew.bat new file mode 100644 index 00000000..f9553162 --- /dev/null +++ b/android/app/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/android/app/local.properties b/android/app/local.properties new file mode 100644 index 00000000..b29c63c9 --- /dev/null +++ b/android/app/local.properties @@ -0,0 +1,8 @@ +## This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. +# +# Location of the SDK. This is only used by Gradle. +# For customization when using a Version Control System, please read the +# header note. +#Sun Sep 20 09:53:03 EEST 2020 +sdk.dir=/Users/erababah/Library/Android/sdk diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index b88d5204..1032b29b 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -5,43 +5,99 @@ In most cases you can leave this as-is, but you if you want to provide additional functionality it is fine to subclass or reimplement FlutterApplication and put your custom class here. --> + + + + + + + + + + + + + + + + + + + + + + + + + android:icon="@mipmap/ic_launcher" + android:usesCleartextTraffic="true" + android:label="diplomaticquarterapp"> + android:name="io.flutter.embedding.android.NormalTheme" + android:resource="@style/NormalTheme" /> + android:name="io.flutter.embedding.android.SplashScreenDrawable" + android:resource="@drawable/launch_background" /> + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt index 7ae40d3f..8b73b0c7 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt @@ -1,6 +1,23 @@ package com.cloud.diplomaticquarterapp +import android.os.Bundle +import android.util.Log +import androidx.annotation.NonNull; +import com.cloud.diplomaticquarterapp.utils.FlutterText +import com.cloud.diplomaticquarterapp.utils.PlatformBridge +import io.flutter.embedding.android.FlutterFragmentActivity + import io.flutter.embedding.engine.FlutterEngine +import io.flutter.plugin.common.MethodChannel +import io.flutter.plugins.GeneratedPluginRegistrant -import io.flutter.embedding.android.FlutterActivity +class MainActivity: FlutterFragmentActivity() { + override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { + GeneratedPluginRegistrant.registerWith(flutterEngine); + // Create Flutter Platform Bridge + PlatformBridge(flutterEngine.dartExecutor.binaryMessenger, this).create() -class MainActivity: FlutterActivity() { -} + } + + override fun onResume() { + super.onResume() + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeoZoneModel.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeoZoneModel.kt new file mode 100644 index 00000000..7eba1ead --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeoZoneModel.kt @@ -0,0 +1,56 @@ +package com.cloud.diplomaticquarterapp.geofence + +import com.google.android.gms.location.Geofence +import com.google.gson.Gson +import com.google.gson.reflect.TypeToken + +class GeoZoneModel { + var GEOF_ID:Int = 0 + var Radius:Int = 0 + var Type:Int = 0 + var ProjectID:Int = 0 + + var Description:String? = null + var DescriptionN:String? = null + var Latitude:String? = null + var Longitude:String? = null + var ImageURL:String? = null + var IsCity:String? = null + + fun identifier():String{ + return "$GEOF_ID" + "_hmg" + } + + fun message():String{ + return Description ?: "nil" + } + + fun listFrom(jsonString: String) : List{ + val type = object : TypeToken?>() {}.getType() + return Gson().fromJson(jsonString, type) + } + + fun toGeofence() : Geofence?{ + if (!Latitude.isNullOrEmpty() && !Longitude.isNullOrEmpty() && Radius > 50) { + val lat = Latitude!!.trim().toDoubleOrNull() + val long = Longitude!!.trim().toDoubleOrNull() + val rad = Radius.toFloat() + if(lat != null && long != null){ + + return Geofence.Builder() + .setRequestId(identifier()) + .setCircularRegion( + lat, + long, + rad + ) + .setTransitionTypes(GeofenceTransition.ENTER_EXIT.value) +// .setNotificationResponsiveness(0) + .setExpirationDuration(Geofence.NEVER_EXPIRE) + .build() + } + } + return null + } + +} diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceBroadcastReceiver.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceBroadcastReceiver.kt new file mode 100644 index 00000000..8fc1faae --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceBroadcastReceiver.kt @@ -0,0 +1,13 @@ + + +package com.cloud.diplomaticquarterapp.geofence + +import android.content.BroadcastReceiver +import android.content.Context +import android.content.Intent + +class GeofenceBroadcastReceiver : BroadcastReceiver() { + override fun onReceive(context: Context, intent: Intent) { + GeofenceTransitionsJobIntentService.enqueueWork(context, intent) + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceErrorMessages.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceErrorMessages.kt new file mode 100755 index 00000000..4890f7cb --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceErrorMessages.kt @@ -0,0 +1,34 @@ + + +package com.cloud.diplomaticquarterapp.geofence + +import android.content.Context +import com.cloud.diplomaticquarterapp.R +import com.google.android.gms.common.api.ApiException +import com.google.android.gms.location.GeofenceStatusCodes + +object GeofenceErrorMessages { + fun getErrorString(context: Context, e: Exception): String { + return if (e is ApiException) { + getErrorString(context, e.statusCode) + } else { + context.resources.getString(R.string.geofence_unknown_error) + } + } + + fun getErrorString(context: Context, errorCode: Int): String { + val resources = context.resources + return when (errorCode) { + GeofenceStatusCodes.GEOFENCE_NOT_AVAILABLE -> + resources.getString(R.string.geofence_not_available) + + GeofenceStatusCodes.GEOFENCE_TOO_MANY_GEOFENCES -> + resources.getString(R.string.geofence_too_many_geofences) + + GeofenceStatusCodes.GEOFENCE_TOO_MANY_PENDING_INTENTS -> + resources.getString(R.string.geofence_too_many_pending_intents) + + else -> resources.getString(R.string.geofence_unknown_error) + } + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceTransitionsJobIntentService.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceTransitionsJobIntentService.kt new file mode 100755 index 00000000..f28e1720 --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceTransitionsJobIntentService.kt @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2018 Razeware LLC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * Notwithstanding the foregoing, you may not use, copy, modify, merge, publish, + * distribute, sublicense, create a derivative work, and/or sell copies of the + * Software in any work that is designed, intended, or marketed for pedagogical or + * instructional purposes related to programming, coding, application development, + * or information technology. Permission for such use, copying, modification, + * merger, publication, distribution, sublicensing, creation of derivative works, + * or sale is expressly withheld. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +package com.cloud.diplomaticquarterapp.geofence + +import android.content.Context +import android.content.Intent +import android.location.Location +import android.util.Log +import androidx.core.app.JobIntentService +import com.cloud.diplomaticquarterapp.utils.API +import com.cloud.diplomaticquarterapp.utils.httpPost +import com.cloud.diplomaticquarterapp.utils.sendNotification +import com.github.kittinunf.fuel.core.extensions.jsonBody +import com.github.kittinunf.fuel.core.isSuccessful +import com.github.kittinunf.fuel.httpPost +import com.google.android.gms.location.Geofence +import com.google.android.gms.location.GeofencingEvent +import com.google.gson.Gson + +class GeofenceTransitionsJobIntentService : JobIntentService() { + + companion object { + private const val LOG_TAG = "GeoTrIntentService" + + private const val JOB_ID = 573 + + fun enqueueWork(context: Context, intent: Intent) { + enqueueWork( + context, + GeofenceTransitionsJobIntentService::class.java, JOB_ID, + intent) + } + } + + override fun onHandleWork(intent: Intent) { + val geofencingEvent = GeofencingEvent.fromIntent(intent) + if (geofencingEvent.hasError()) { + val errorMessage = GeofenceErrorMessages.getErrorString(this, geofencingEvent.errorCode) + Log.e(LOG_TAG, errorMessage) + return + } + + if (geofencingEvent.geofenceTransition == Geofence.GEOFENCE_TRANSITION_ENTER || geofencingEvent.geofenceTransition == Geofence.GEOFENCE_TRANSITION_EXIT) { + handleEvent(geofencingEvent.triggeringGeofences,geofencingEvent.triggeringLocation, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition)); + } + } + + private fun handleEvent(triggerGeofences: List, location:Location, transition:GeofenceTransition) { + val hmg = HMG_Geofence.shared(this) + hmg.getPatientID()?.let { patientId -> + + hmg.getActiveGeofences({ activeGeofences -> + + triggerGeofences.forEach { geofence -> + // Extract PointID from 'geofence.requestId' and find from active geofences + val pointID = activeGeofences.firstOrNull {it == geofence.requestId}?.split('_')?.first() + if(!pointID.isNullOrEmpty() && pointID.toIntOrNull() != null){ + + val body = mapOf( + "PointsID" to pointID.toIntOrNull(), + "GeoType" to transition.value, + "PatientID" to patientId + ) + + httpPost>(API.LOG_GEOFENCE, body, { response -> + sendNotification(this, transition.named(), geofence.requestId, "Notified to server.😎") + },{ exception -> + sendNotification(this, transition.named(), geofence.requestId, "Failed to notify server.😔") + }) + + } + } + + },null) + } + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofencingRebootBroadcastReceiver.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofencingRebootBroadcastReceiver.kt new file mode 100644 index 00000000..08a0c93f --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofencingRebootBroadcastReceiver.kt @@ -0,0 +1,27 @@ + + +package com.cloud.diplomaticquarterapp.geofence + +import android.content.BroadcastReceiver +import android.content.Context +import android.content.Intent +import android.os.Handler +import android.os.Message +import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence +import com.cloud.diplomaticquarterapp.utils.HMGUtils + +class GeofencingRebootBroadcastReceiver : BroadcastReceiver(){ + override fun onReceive(context: Context, intent: Intent) { + + if (Intent.ACTION_BOOT_COMPLETED.equals(intent.action)) { + val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) + pref.edit().putString("REBOOT_DETECTED","YES").apply() + + HMG_Geofence.shared(context).unRegisterAll { status, exception -> + val geoZones = HMGUtils.getGeoZonesFromPreference(context) + HMG_Geofence.shared(context).register(geoZones) + } + } + } + +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt new file mode 100644 index 00000000..4d2c48b3 --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt @@ -0,0 +1,165 @@ +package com.cloud.diplomaticquarterapp.geofence + +import android.Manifest +import android.app.PendingIntent +import android.content.Context +import android.content.Intent +import android.content.SharedPreferences +import android.content.pm.PackageManager +import androidx.core.content.ContextCompat +import com.google.android.gms.location.Geofence +import com.google.android.gms.location.GeofencingClient +import com.google.android.gms.location.GeofencingRequest +import com.google.android.gms.location.LocationServices +import com.google.gson.Gson +import com.google.gson.reflect.TypeToken + +enum class GeofenceTransition(val value: Int) { + ENTER(1), + EXIT(2), + ENTER_EXIT((ENTER.value or EXIT.value)), + DWELL(4); + + companion object { + fun fromInt(value: Int) = GeofenceTransition.values().first { it.value == value } + } + + fun named():String{ + if (value == 1)return "Enter" + if (value == 2)return "Exit" + if (value == (ENTER.value or EXIT.value))return "Enter or Exit" + if (value == 4)return "dWell" + return "unknown" + } +} + +const val PREFS_STORAGE = "FlutterSharedPreferences" +const val PREF_KEY_SUCCESS = "HMG_GEOFENCE_SUCCESS" +const val PREF_KEY_FAILED = "HMG_GEOFENCE_FAILED" +const val PREF_KEY_HMG_ZONES = "flutter.hmg-geo-fences" + +class HMG_Geofence { + // https://developer.android.com/training/location/geofencing#java + + private lateinit var context: Context + private lateinit var preferences:SharedPreferences + private val gson = Gson() + + private lateinit var geofencingClient:GeofencingClient + private val geofencePendingIntent: PendingIntent by lazy { + val intent = Intent(context, GeofenceBroadcastReceiver::class.java) + PendingIntent.getBroadcast( + context, + 0, + intent, + PendingIntent.FLAG_UPDATE_CURRENT) + } + + companion object{ + + var instance: HMG_Geofence? = null + fun shared(context: Context) : HMG_Geofence { + if (instance == null) { + instance = HMG_Geofence() + instance?.context = context + instance?.geofencingClient = LocationServices.getGeofencingClient(context) + instance?.preferences = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) + } + return instance!! + } + } + + fun register(geoZones: List){ + if (geoZones.isEmpty()) + return + + fun buildGeofencingRequest(geofences: List): GeofencingRequest { + return GeofencingRequest.Builder() + .setInitialTrigger(0) + .addGeofences(geofences) + .build() + } + + getActiveGeofences({ active -> + + val geofences = mutableListOf() + geoZones.forEach { + it.toGeofence()?.let { geof -> + if(!active.contains(geof.requestId)){ // if not already registered then register + geofences.add(geof) + } + } + } + + if (checkPermission() && geofences.isNotEmpty()) { + geofencingClient + .addGeofences(buildGeofencingRequest(geofences), geofencePendingIntent) + .addOnSuccessListener { + saveActiveGeofence(geofences.map { it.requestId }, listOf()) + } + .addOnFailureListener { + print(it.localizedMessage) + } + } + },null) + } + + fun unRegisterAll(completion: (status: Boolean, exception:Exception?) -> Unit){ + getActiveGeofences({ success -> + val mList = success.toMutableList() + mList.add("12345") + geofencingClient + .removeGeofences(success) + .addOnSuccessListener { + completion(true, null) + } + .addOnFailureListener { + completion(false, it) + } + removeActiveGeofences() + }, { failed -> + // Nothing to do with failed geofences. + }) + } + + fun saveActiveGeofence(success: List, failed: List){ + val jsonSuccess = gson.toJson(success) + val jsonFailure = gson.toJson(failed) + preferences.edit().putString(PREF_KEY_SUCCESS, jsonSuccess).apply() + preferences.edit().putString(PREF_KEY_FAILED, jsonFailure).apply() + } + + fun removeActiveGeofences(){ + preferences.edit().putString(PREF_KEY_SUCCESS,"[]").apply() + preferences.edit().putString(PREF_KEY_FAILED,"[]").apply() + } + + fun getActiveGeofences(success: (success: List) -> Unit, failure: ((failed: List) -> Unit)?){ + val type = object : TypeToken?>() {}.type + + val jsonSuccess = preferences.getString(PREF_KEY_SUCCESS, "[]") + val success = gson.fromJson>(jsonSuccess, type) + success(success) + + if(failure != null){ + val jsonFailure = preferences.getString(PREF_KEY_FAILED, "[]") + val failed = gson.fromJson>(jsonFailure, type) + failure(failed) + } + + } + + private fun checkPermission() : Boolean{ + return ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED + } + + fun getPatientID():Int?{ + val profileJson = preferences.getString("flutter.imei-user-data", "{}") + val type = object : TypeToken?>() {}.type + return gson.fromJson?>(profileJson,type) + ?.get("PatientID") + .toString() + .toDoubleOrNull() + ?.toInt() + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/hmgwifi/HMG_Guest.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/hmgwifi/HMG_Guest.kt new file mode 100644 index 00000000..61433596 --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/hmgwifi/HMG_Guest.kt @@ -0,0 +1,172 @@ +package com.cloud.diplomaticquarterapp.hmgwifi + +import android.content.Context +import android.net.ConnectivityManager +import android.net.wifi.WifiConfiguration +import android.net.wifi.WifiInfo +import android.net.wifi.WifiManager +import android.os.Build +import android.util.Log +import android.widget.Toast +import com.cloud.diplomaticquarterapp.MainActivity +import com.cloud.diplomaticquarterapp.utils.FlutterText +import com.cloud.diplomaticquarterapp.utils.HMGUtils + + +class HMG_Guest(context: MainActivity) { + private var wifiManager: WifiManager? = context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager? + private var connectivityManager: ConnectivityManager? = context.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager? + private var context = context + + private val TAG = "HMG_Guest" + private val TEST = false + private var SSID = """"HMG-MobileApp"""" + + private lateinit var completionListener: ((status: Boolean, message: String) -> Unit) + + fun completionOnUiThread(status: Boolean, message: String){ + completionListener(status, message) + } + + /* + * Helpful: + * http://stackoverflow.com/questions/8818290/how-to-connect-to-a-specific-wifi-network-in-android-programmatically + */ + fun connectToHMGGuestNetwork(completion: (status: Boolean, message: String) -> Unit) { + wifiManager?.let { wm -> + completionListener = completion + + if (!wm.isWifiEnabled){ + wm.isWifiEnabled = true + HMGUtils.popFlutterText(context,"enablingWifi"); + HMGUtils.timer(2000,false){ + connect() + } + }else{ + connect() + } + + } + + } + + + private fun connect(){ + val security = "OPEN" + val networkPass = "" + Log.d(TAG, "Connecting to SSID \"$SSID\" with password \"$networkPass\" and with security \"$security\" ...") + + // You need to create WifiConfiguration instance like this: + val conf = WifiConfiguration() + conf.SSID = SSID + conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE) + conf.networkId = ssidToNetworkId(SSID) + + val wm = wifiManager!! + + if (conf.networkId == -1) { + wm.addNetwork(conf) + } else { + Log.v(TAG, "WiFi found - updating it.\n") + wm.updateNetwork(conf) + } + + conf.networkId = ssidToNetworkId(SSID) + Log.d(TAG, "Network ID: ${conf.networkId}") + + val networkIdToConnect = conf.networkId + if (networkIdToConnect >= 0) { + Log.v(TAG, "Start connecting to $SSID Wifi...") + + // We disable the network before connecting, because if this was the last connection before + // a disconnect(), this will not reconnect. + wm.disableNetwork(networkIdToConnect) + val result = wm.enableNetwork(networkIdToConnect, true) + if(result){ + HMGUtils.timer(8000,false){ + if(wm.getConnectionInfo().getSSID() == SSID){ + completionOnUiThread(true, "successConnectingHmgNetwork") + + }else{ + errorConnecting() + } + } + + }else{ + errorConnecting() + } + + + + }else{ + Log.v(TAG, "Cannot connect to $SSID network") + errorConnecting() + } + } + + private fun errorConnecting(){ + completionOnUiThread(false, "errorConnectingHmgNetwork") + } + + // If CompileSDK is greater and equals to APILevel 29 + private fun connectNewer(wm:WifiManager){ + +// Log.e(TAG, "connection wifi Q") +// +// val wifiNetworkSpecifier: WifiNetworkSpecifier = WifiNetworkSpecifier.Builder() +// .setSsid(ssid) +// .setWpa2Passphrase(password) +// .build() +// +// val networkRequest: NetworkRequest = NetworkRequest.Builder() +// .addTransportType(NetworkCapabilities.TRANSPORT_WIFI) +// .setNetworkSpecifier(wifiNetworkSpecifier) +// .build() +// +// var connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager +// var networkCallback = object : ConnectivityManager.NetworkCallback() { +// override fun onAvailable(network: Network) { +// super.onAvailable(network) +// connectivityManager.bindProcessToNetwork(network) +// Log.e(TAG, "onAvailable") +// } +// +// override fun onLosing(network: Network, maxMsToLive: Int) { +// super.onLosing(network, maxMsToLive) +// Log.e(TAG, "onLosing") +// } +// +// override fun onLost(network: Network) { +// super.onLost(network) +// Log.e(TAG, "onLosing") +// Log.e(TAG, "losing active connection") +// } +// +// override fun onUnavailable() { +// super.onUnavailable() +// Log.e(TAG, "onUnavailable") +// } +// } +// connectivityManager.requestNetwork(networkRequest, networkCallback) + } + + + /** + * This method takes a given String, searches the current list of configured WiFi + * networks, and returns the networkId for the network if the SSID matches. If not, + * it returns -1. + */ + private fun ssidToNetworkId(ssid: String): Int { + val currentNetworks = wifiManager!!.configuredNetworks + var networkId = -1 + + // For each network in the list, compare the SSID with the given one + for (test in currentNetworks) { + if (test.SSID == ssid) { + networkId = test.networkId + break + } + } + return networkId + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/hmgwifi/HMG_Internet.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/hmgwifi/HMG_Internet.kt new file mode 100644 index 00000000..332e60a5 --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/hmgwifi/HMG_Internet.kt @@ -0,0 +1,110 @@ +package com.cloud.diplomaticquarterapp.hmgwifi + +import android.annotation.SuppressLint +import com.cloud.diplomaticquarterapp.utils.API +import com.cloud.diplomaticquarterapp.MainActivity +import com.cloud.diplomaticquarterapp.utils.FlutterText +import com.github.kittinunf.fuel.core.extensions.jsonBody +import com.github.kittinunf.fuel.httpGet +import com.github.kittinunf.fuel.httpPost +import org.json.JSONObject +import java.util.* + + +@SuppressLint("MissingPermission") +class HMG_Internet(flutterMainActivity: MainActivity) { + private val TAG = "HMG_Wifi" + private val TEST = false + + private var context = flutterMainActivity; + + private lateinit var completionListener: ((status: Boolean, message: String) -> Unit) + + private var SSID = "GUEST-POC" + private var USER_NAME = "" + private var PASSWORD = "" + + fun completionOnUiThread(status: Boolean, message: String){ + completionListener(status, message) +// context.runOnUiThread { +// +// FlutterText.with(message){localized -> +// completionListener(status, localized) +// } +// } + } + + /* + * Helpful: + * http://stackoverflow.com/questions/8818290/how-to-connect-to-a-specific-wifi-network-in-android-programmatically + */ + fun connectToHMGGuestNetwork(patientId: String, completion: (status: Boolean, message: String) -> Unit): HMG_Internet { + completionListener = completion + getWifiCredentials(patientId) { + WPA(context,SSID).connect(USER_NAME,PASSWORD) { status, message -> + completionOnUiThread(status,message) + } + } + return this + } + + private fun haveInternet(completion: ((status: Boolean) -> Unit)){ + if (TEST) + completion(true) + + "https://captive.apple.com".httpGet().response { request, response, result -> + result.fold(success = { + val html = String(it).toLowerCase(Locale.ENGLISH) + .replace(" ", "", true) + .replace("\n","",true) + val have = html.contains("success", true) + completion(have) + + },failure = { + completion(false) + }) + } + } + + private fun getWifiCredentials(patientId:String, success: (() -> Unit)){ + if (TEST){ + SSID = "GUEST-POC" + USER_NAME = "0696" + PASSWORD = "0000" + success() + return + } + + val jsonBody = """{"PatientID":$patientId}""" + API.WIFI_CREDENTIALS. + httpPost() + .jsonBody(jsonBody, Charsets.UTF_8) + .response { request, response, result -> + + result.fold(success = { data -> + val jsonString = String(data) + val jsonObject = JSONObject(jsonString) + if(!jsonObject.getString("ErrorMessage").equals("null")){ + val errorMsg = jsonObject.getString("ErrorMessage") + completionOnUiThread(false, errorMsg) + + }else{ + jsonObject.getJSONArray("Hmg_SMS_Get_By_ProjectID_And_PatientIDList").let { array -> + array.getJSONObject(0).let { object_ -> + if (object_.has("UserName") && object_.has("UserName")){ + USER_NAME = object_.getString("UserName") + PASSWORD = object_.getString("Password") + success() + }else{ + completionOnUiThread(false, "somethingWentWrong") + } + } + } + } + + },failure = { error -> + completionOnUiThread(false, "somethingWentWrong" ) + }) + } + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/hmgwifi/WPA.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/hmgwifi/WPA.kt new file mode 100644 index 00000000..86e67def --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/hmgwifi/WPA.kt @@ -0,0 +1,105 @@ +package com.cloud.diplomaticquarterapp.hmgwifi + +import android.annotation.SuppressLint +import android.content.Context +import android.net.ConnectivityManager +import android.net.wifi.* +import android.net.wifi.SupplicantState.ASSOCIATED +import android.net.wifi.SupplicantState.COMPLETED +import android.util.Log +import com.cloud.diplomaticquarterapp.MainActivity +import com.cloud.diplomaticquarterapp.utils.HMGUtils + +class WPA(mainActivity: MainActivity, SSID:String) { + private var TAG = "WPA" + private var SSID = "GUEST-POC" + private var wifiManager_: WifiManager? = null + private var connectivityManager_: ConnectivityManager? = null + + init { + wifiManager_ = mainActivity.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager? + connectivityManager_ = mainActivity.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager? + } + + fun connect(identity:String, password:String, completion: (status: Boolean, message: String) -> Unit) { + if(wifiManager_ == null || connectivityManager_ == null){ + completion(false,"errorConnectingHmgNetwork") + return + } + + val wifiManager = wifiManager_!! + val connectivityManager = connectivityManager_!! + + // Initialize the WifiConfiguration object + val enterpriseConfig = WifiEnterpriseConfig() + val wifi = WifiConfiguration() + wifi.SSID = """"$SSID"""" + wifi.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_EAP) + wifi.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.IEEE8021X) + enterpriseConfig.eapMethod = WifiEnterpriseConfig.Eap.PEAP + enterpriseConfig.identity = identity + enterpriseConfig.password = password + wifi.enterpriseConfig = enterpriseConfig + wifi.networkId = ssidToNetworkId(wifi.SSID) + if (wifi.networkId == -1) { + wifiManager.addNetwork(wifi) + } else { + Log.v(TAG, "WiFi found - updating it.\n") + wifiManager.updateNetwork(wifi) + } + Log.v(TAG, "saving config.\n") + wifiManager.saveConfiguration() + wifi.networkId = ssidToNetworkId(wifi.SSID) + + Log.v(TAG, "wifi ID in device = " + wifi.networkId) + + var supState: SupplicantState + val networkIdToConnect = wifi.networkId + if (networkIdToConnect >= 0) { + Log.v(TAG, "Start connecting...\n") + + // We disable the network before connecting, because if this was the last connection before + // a disconnect(), this will not reconnect. + wifiManager.disableNetwork(networkIdToConnect) + wifiManager.enableNetwork(networkIdToConnect, true) + + val wifiInfo: WifiInfo = wifiManager.connectionInfo + + HMGUtils.timer(5000,false){ + supState = wifiInfo.supplicantState + Log.i(TAG, "WifiWizard: Done connect to network : status = $supState") + val successStates = listOf(COMPLETED, ASSOCIATED) + if (successStates.contains(COMPLETED /*supState*/)) + + completion(true,"Connected to internet Wifi") + + else + completion(false,"errorConnectingHmgNetwork") + } + + } else { + Log.v(TAG, "WifiWizard: cannot connect to network") + completion(false,"errorConnectingHmgNetwork") + } + } + + /** + * This method takes a given String, searches the current list of configured WiFi + * networks, and returns the networkId for the network if the SSID matches. If not, + * it returns -1. + */ + @SuppressLint("MissingPermission") + private fun ssidToNetworkId(ssid: String): Int { + val currentNetworks = wifiManager_!!.configuredNetworks + var networkId = -1 + + // For each network in the list, compare the SSID with the given one + for (test in currentNetworks) { + if (test.SSID == ssid) { + networkId = test.networkId + break + } + } + return networkId + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/API.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/API.kt new file mode 100644 index 00000000..30f57dde --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/API.kt @@ -0,0 +1,11 @@ +package com.cloud.diplomaticquarterapp.utils + +class API { + companion object{ + private val BASE = "https://uat.hmgwebservices.com" + private val SERVICE = "Services/Patients.svc/REST" + + val WIFI_CREDENTIALS = "$BASE/$SERVICE/Hmg_SMS_Get_By_ProjectID_And_PatientID" + val LOG_GEOFENCE = "$BASE/$SERVICE/GeoF_InsertPatientFileInfo" + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/FlutterText.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/FlutterText.kt new file mode 100644 index 00000000..419eb340 --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/FlutterText.kt @@ -0,0 +1,36 @@ +package com.cloud.diplomaticquarterapp.utils + +import io.flutter.plugin.common.MethodChannel +import io.flutter.plugin.common.MethodChannel.Result + +class FlutterText{ + + companion object{ + fun with(key:String, completion:(String)->Unit){ + HMGUtils.getPlatformChannel().invokeMethod("localizedValue",key, object:MethodChannel.Result{ + override fun success(result: Any?) { + val localized = result as String? + if (localized != null){ + completion(localized) + }else{ + completion(key) + } + } + + override fun error(errorCode: String?, errorMessage: String?, errorDetails: Any?) { + completion(key) + require(false){ + "'localizedValue' $errorMessage" + } + } + + override fun notImplemented() { + require(false){ + "'localizedValue' method not implemented at flutter" + } + } + + }) + } + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt new file mode 100644 index 00000000..bebd0101 --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt @@ -0,0 +1,160 @@ +package com.cloud.diplomaticquarterapp.utils + +import android.app.NotificationChannel +import android.app.NotificationManager +import android.app.PendingIntent +import android.content.Context +import android.content.Intent +import android.os.Build +import android.widget.Toast +import androidx.annotation.Nullable +import androidx.core.app.NotificationCompat +import androidx.core.app.TaskStackBuilder +import com.cloud.diplomaticquarterapp.BuildConfig +import com.cloud.diplomaticquarterapp.MainActivity +import com.cloud.diplomaticquarterapp.R +import com.cloud.diplomaticquarterapp.geofence.GeoZoneModel +import com.cloud.diplomaticquarterapp.geofence.PREFS_STORAGE +import com.cloud.diplomaticquarterapp.geofence.PREF_KEY_HMG_ZONES +import com.github.kittinunf.fuel.core.extensions.jsonBody +import com.github.kittinunf.fuel.httpPost +import com.google.android.gms.location.Geofence +import com.google.gson.Gson +import com.google.gson.reflect.TypeToken +import io.flutter.plugin.common.MethodChannel +import org.json.JSONArray +import org.json.JSONException +import org.json.JSONObject +import java.util.* +import kotlin.concurrent.timerTask + + +class HMGUtils { + + companion object{ + private lateinit var platformChannel: MethodChannel + fun getPlatformChannel():MethodChannel{ + return platformChannel + } + fun setPlatformChannel(channel: MethodChannel){ + platformChannel = channel + } + + fun timer(delay: Long, repeat: Boolean, tick: (Timer) -> Unit) : Timer{ + val timer = Timer() + if(repeat) + timer.schedule(timerTask { + tick(timer) + }, delay, delay) + else + timer.schedule(timerTask { + tick(timer) + }, delay) + + return timer + } + + fun popMessage(context: MainActivity, message: String){ + context.runOnUiThread { + Toast.makeText(context, message, Toast.LENGTH_LONG).show() + } + } + + fun popFlutterText(context: MainActivity, key: String){ + context.runOnUiThread { + FlutterText.with(key){ + Toast.makeText(context, it, Toast.LENGTH_LONG).show() + } + } + } + + fun getGeoZonesFromPreference(context: Context):List{ + val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) + val json = pref.getString(PREF_KEY_HMG_ZONES,"[]") + + val geoZones = GeoZoneModel().listFrom(json) + return geoZones + } + + } + +} + +private fun Timer.schedule(timerTask: TimerTask) { + +} +private const val NOTIFICATION_CHANNEL_ID = BuildConfig.APPLICATION_ID + ".channel" + +fun sendNotification(context: Context, title:String, @Nullable subtitle:String?, message:String?) { + val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O + && notificationManager.getNotificationChannel(NOTIFICATION_CHANNEL_ID) == null) { + val name = context.getString(R.string.app_name) + val channel = NotificationChannel(NOTIFICATION_CHANNEL_ID, + name, + NotificationManager.IMPORTANCE_DEFAULT) + + notificationManager.createNotificationChannel(channel) + } + + val intent = Intent(context, MainActivity::class.java) + + val stackBuilder = TaskStackBuilder.create(context) + .addParentStack(MainActivity::class.java) + .addNextIntent(intent) + val notificationPendingIntent = stackBuilder.getPendingIntent(getUniqueId(), PendingIntent.FLAG_UPDATE_CURRENT) + + val notification = NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID) + .setSmallIcon(R.mipmap.ic_launcher) + .setContentIntent(notificationPendingIntent) + .setAutoCancel(true) + .setContentTitle(title) + + subtitle.let { notification.setContentText(it) } + message.let { notification.setSubText(it) } + + notificationManager.notify(getUniqueId(), notification.build()) +} + + +private fun getUniqueId() = ((System.currentTimeMillis() % 10000).toInt()) + +fun isJSONValid(jsonString: String?): Boolean { + try { JSONObject(jsonString) } catch (ex: JSONException) { + try { JSONArray(jsonString) } catch (ex1: JSONException) { + return false + } + } + return true +} + +class HTTPResponse(data: T){ + final var data:T = data +} +fun httpPost(url: String, body: Map, onSuccess: (response: HTTPResponse) -> Unit, onError: (error: Exception) -> Unit){ + + val gson = Gson() + val type = object : TypeToken() {}.type + val jsonBody = gson.toJson(body) + url.httpPost() + .jsonBody(jsonBody, Charsets.UTF_8) + .timeout(10000) + .header("Content-Type","application/json") + .header("Allow","*/*") + .response { request, response, result -> + result.fold({ data -> + val dataString = String(data) + if(isJSONValid(dataString)){ + val responseData = gson.fromJson(dataString,type) + onSuccess(HTTPResponse(responseData)) + }else{ + onError(Exception("Invalid response from server (Not a valid JSON)")) + } + }, { + onError(it) + it.localizedMessage + }) + + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMG_Wifi_.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMG_Wifi_.kt new file mode 100644 index 00000000..decc9bdf --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMG_Wifi_.kt @@ -0,0 +1,351 @@ +//package com.cloud.diplomaticquarterapp.utils +// +//import android.annotation.SuppressLint +//import android.content.Context +//import android.net.ConnectivityManager +//import android.net.Network +//import android.net.NetworkCapabilities +//import android.net.NetworkRequest +//import android.net.wifi.ScanResult +//import android.net.wifi.WifiConfiguration +//import android.net.wifi.WifiManager +//import android.util.Log +//import com.cloud.diplomaticquarterapp.utils.API +//import com.cloud.diplomaticquarterapp.FlutterMainActivity +//import com.github.kittinunf.fuel.core.extensions.jsonBody +//import com.github.kittinunf.fuel.httpGet +//import com.github.kittinunf.fuel.httpPost +//import org.json.JSONObject +//import java.util.* +// +// +//@SuppressLint("MissingPermission") +//class HMG_Wifi_(flutterMainActivity: FlutterMainActivity) { +// val TAG = "WIFI" +// val TEST = true +// +// var context = flutterMainActivity; +// var completionListener: ((status: Boolean, message: String) -> Unit)? = null +// +// +// private var SSID = "HMG-GUEST" +// private var USER_NAME = "" +// private var PASSWORD = "" +// var NETWORK_ID = -1 // HMG-GUEST Assigned Network ID by Android +// private lateinit var PATIENT_ID:String +// /* +// * Helpful: +// * http://stackoverflow.com/questions/5452940/how-can-i-get-android-wifi-scan-results-into-a-list +// */ +// fun triggerWifiScan(context: Context) { +// val wifi = context.getSystemService(Context.WIFI_SERVICE) as WifiManager +// wifi.startScan() +// } +// +// /* +// * Helpful: +// * http://stackoverflow.com/questions/8818290/how-to-connect-to-a-specific-wifi-network-in-android-programmatically +// */ +// fun connectToWifiNetworkWith(patientId: String): HMG_Wifi_ { +// +// val connectivityManager = context.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager +// +// PATIENT_ID = patientId +// +// val security = "OPEN" +// val networkPass = "" +// Log.d(TAG, "Connecting to SSID \"$SSID\" with password \"$networkPass\" and with security \"$security\" ...") +// +// // You need to create WifiConfiguration instance like this: +// val conf = WifiConfiguration() +// conf.SSID = "\"" + SSID + "\"" +// +// if (security == "OPEN") { +// conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE) +// } else if (security == "WEP") { +// conf.wepKeys[0] = "\"" + networkPass + "\"" +// conf.wepTxKeyIndex = 0 +// conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE) +// conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP40) +// } else { +// conf.preSharedKey = "\"" + networkPass + "\"" +// } +// +// // Then, you need to add it to Android wifi manager settings: +// val wifiManager = context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager +// +// NETWORK_ID = wifiManager.addNetwork(conf) +// Log.d(TAG, "Network ID: $NETWORK_ID") +// +// //wifiManager.disconnect(); +// val result = wifiManager.enableNetwork(NETWORK_ID, true) +// //wifiManager.reconnect(); +// wifiManager.saveConfiguration() +// +// if(result == true){ +// authNetworkConnection(NETWORK_ID); +// }else{ +// completionListener?.let { it(false, "Error connecting to HMG network") } +// } +// return this +// } +// +// private var authTimer:Timer? = null +// fun authNetworkConnection(networkId: Int){ +// authTimer = Timer() +// authTimer?.scheduleAtFixedRate(object : TimerTask() { +// override fun run() { +// if (connectedNetworkId() == networkId && connectedNetworkIPAddress() > 0) { +// authServerCall() +// authTimer?.cancel() +// } +// } +// +// }, 2000, 1000) +// +// // If wifi not connected in 5 sec terminate with fail status +// Timer().schedule(object : TimerTask() { +// override fun run() { +// if (null != authTimer) { +// authTimer?.cancel() +// completionListener?.let { it(false, "Error connecting to HMG network") } +// } +// } +// }, 5000) +// +// } +// +// fun authServerCall(){ +// +// fun call(){ +// +// forceNetworkCallOverWifi() +// +// val params = listOf("cmd" to "authenticate", "password" to PASSWORD, "user" to USER_NAME) +// val serverUrl = "https://captiveportal-login.hmg.com/cgi-bin/login" +//// val serverUrl = "http://192.168.102.223/cgi-bin/login" +// serverUrl +// .httpPost(params) +// .timeout(10000) +// .response { request, response, result -> +// Log.v(TAG, response.statusCode.toString()) +// +// haveInternet { have -> +// if(have){ +// Log.v(TAG, "Connected to internet via $SSID network at HMG") +// completionListener?.let { it(true, "Successfully connected to the internet") } +// }else{ +// Log.e(TAG, "failed to connect to internet via $SSID network at HMG") +// completionListener?.let { it(false, "Authentication failed or you are already using your credentials on another device") } +// } +// } +// } +// } +// +// haveInternet { has -> +// if (has){ +// getAuthCredentials { +// call() +// } +// }else{ +// completionListener?.let { it(false, "You must have active internet connection to connect with HMG Network") } +// } +// } +// } +// +// fun haveInternet(completion: ((status: Boolean) -> Unit)){ +// if (TEST) +// completion(true) +// +// "https://captive.apple.com".httpGet().response { request, response, result -> +// val have = response.statusCode == 200 && String(response.data).contains("Success", true) +// completion(have) +// } +// } +// +// fun getAuthCredentials(completion: (() -> Unit)){ +// if (TEST){ +// USER_NAME = "2300" +// PASSWORD = "1820" +// completion() +// return +// } +// +// val jsonBody = """{"PatientID":$PATIENT_ID}""" +// API.WIFI_CREDENTIALS +// .httpPost() +// .jsonBody(jsonBody, Charsets.UTF_8) +// .response { request, response, result -> +// val jsonString = String(response.data) +// Log.d(TAG, "JSON $jsonString") +// +// if (response.statusCode == 200){ +// +// val jsonObject = JSONObject(jsonString) +// if(!jsonObject.getString("ErrorMessage").equals("null")){ +// val errorMsg = jsonObject.getString("ErrorMessage") +// completionListener?.let { it(false, errorMsg) } +// +// }else{ +// jsonObject.getJSONArray("Hmg_SMS_Get_By_ProjectID_And_PatientIDList").let { array -> +// array.getJSONObject(0).let { object_ -> +// if (object_.has("UserName") && object_.has("UserName")){ +// USER_NAME = object_.getString("UserName") +// PASSWORD = object_.getString("Password") +// completion() +// }else{ +// completionListener?.let { it(false, "Failed to get your internet credentials") } +// } +// } +// } +// } +// +// }else{ +// completionListener?.let { it(false, "Failed to get your internet credentials") } +// } +// } +// } +// +// fun forceNetworkCallOverWifi(){ +// val connectivityManager = context.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager +//// val network = Network +//// connectivityManager.activeNetwork +// // Exit app if Network disappears. +// // Exit app if Network disappears. +//// val networkCapabilities: NetworkCapabilities = ConnectivityManager.from(context).getNetworkCapabilities(network) +//// val networkCapabilities: NetworkCapabilities = connectivityManager.getNetworkCapabilities(network) +// +//// if (networkCapabilities == null) { +//// return +//// } +// +// val mNetworkCallback = object : ConnectivityManager.NetworkCallback() { +// override fun onLost(lostNetwork: Network?) { +//// if (network.equals(lostNetwork)){ +//// //GlyphLayout.done(false) +//// } +// } +// } +// val builder: NetworkRequest.Builder = NetworkRequest.Builder() +//// for (transportType in networkCapabilities.getTransportTypes()) { +//// builder.addTransportType(transportType) +//// } +// connectivityManager.registerNetworkCallback(builder.build(), mNetworkCallback) +// } +// +// /* +// * Helpful: +// * http://stackoverflow.com/questions/6517314/android-wifi-connection-programmatically +// */ +// fun getScanResultSecurity(result: ScanResult): String? { +// val capabilities: String = result.capabilities +// val securityModes = arrayOf("WEP", "PSK", "EAP") +// for (securityMode in securityModes) { +// if (capabilities.contains(securityMode)) { +// return securityMode +// } +// } +// return "OPEN" +// } +// +// //connects to the given ssid +// fun connectToWPAWiFi(ssid: String, password: String){ +// +// WifiUtils.withContext(context) +// .connectWith(ssid, "") +// .setTimeout(40000) +// .onConnectionResult(object : ConnectionSuccessListener { +// override fun success() { +// Log.v(TAG,"Success") +// } +// +// override fun failed(@NonNull errorCode: ConnectionErrorCode) { +// Log.v(TAG,"Failed") +// } +// }) +// .start() +// if(isConnectedTo(ssid)){ //see if we are already connected to the given ssid +// return +// } +// +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { +// Log.e(TAG, "connection wifi Q") +// +// val wifiNetworkSpecifier: WifiNetworkSpecifier = WifiNetworkSpecifier.Builder() +// .setSsid(ssid) +// .setWpa2Passphrase(password) +// .build() +// +// val networkRequest: NetworkRequest = NetworkRequest.Builder() +// .addTransportType(NetworkCapabilities.TRANSPORT_WIFI) +// .setNetworkSpecifier(wifiNetworkSpecifier) +// .build() +// +// var connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager +// var networkCallback = object : ConnectivityManager.NetworkCallback() { +// override fun onAvailable(network: Network) { +// super.onAvailable(network) +// connectivityManager.bindProcessToNetwork(network) +// Log.e(TAG, "onAvailable") +// } +// +// override fun onLosing(network: Network, maxMsToLive: Int) { +// super.onLosing(network, maxMsToLive) +// Log.e(TAG, "onLosing") +// } +// +// override fun onLost(network: Network) { +// super.onLost(network) +// Log.e(TAG, "onLosing") +// Log.e(TAG, "losing active connection") +// } +// +// override fun onUnavailable() { +// super.onUnavailable() +// Log.e(TAG, "onUnavailable") +// } +// } +// connectivityManager.requestNetwork(networkRequest, networkCallback) +// +// }else{ +// +// try { +// val wm:WifiManager= context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager +// +// Log.e(TAG, "connection wifi pre Q") +// +// var netId: Int = wm.addNetwork(getWifiConfig(ssid)) +// if (netId == -1) netId = getExistingNetworkId(ssid); +// wm.saveConfiguration() +// if(wm.enableNetwork(netId, true)){ +// Log.v(TAG,"HMG-GUEST Connected") +// }else{ +// Log.v(TAG,"HMG-GUEST failed to connect") +// } +// } catch (e: Exception) { +// e.printStackTrace() +// Log.v(TAG,"HMG-GUEST failed to connect") +// } +// } +// +// } +// +// fun connectedNetworkId():Int{ +// val wm:WifiManager= context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager +// return wm.connectionInfo.networkId +// } +// +// fun connectedNetworkIPAddress():Int{ +// val wm:WifiManager= context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager +// return wm.connectionInfo.ipAddress +// } +// +// fun isConnectedTo(bssid: String):Boolean{ +// val wm:WifiManager= context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager +// if(wm.connectionInfo.bssid == bssid){ +// return true +// } +// return false +// } +// +//} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/PlatformBridge.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/PlatformBridge.kt new file mode 100644 index 00000000..ed1a62c8 --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/PlatformBridge.kt @@ -0,0 +1,127 @@ +package com.cloud.diplomaticquarterapp.utils + +import android.content.Context +import android.net.wifi.WifiManager +import android.util.Log +import com.cloud.diplomaticquarterapp.MainActivity +import com.cloud.diplomaticquarterapp.hmgwifi.HMG_Guest +import com.cloud.diplomaticquarterapp.hmgwifi.HMG_Internet +import com.cloud.diplomaticquarterapp.geofence.GeoZoneModel +import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence +import io.flutter.plugin.common.BinaryMessenger +import io.flutter.plugin.common.MethodCall +import io.flutter.plugin.common.MethodChannel + +class PlatformBridge(binaryMessenger: BinaryMessenger, flutterMainActivity: MainActivity) { + private var binaryMessenger = binaryMessenger + private var mainActivity = flutterMainActivity + + private lateinit var channel: MethodChannel + + companion object { + private const val CHANNEL = "HMG-Platform-Bridge" + private const val HMG_INTERNET_WIFI_CONNECT_METHOD = "connectHMGInternetWifi" + private const val HMG_GUEST_WIFI_CONNECT_METHOD = "connectHMGGuestWifi" + private const val ENABLE_WIFI_IF_NOT = "enableWifiIfNot" + private const val REGISTER_HMG_GEOFENCES = "registerHmgGeofences" + private const val UN_REGISTER_HMG_GEOFENCES = "unRegisterHmgGeofences" + } + + fun create(){ + channel = MethodChannel(binaryMessenger, CHANNEL) + HMGUtils.setPlatformChannel(channel) + channel.setMethodCallHandler { methodCall: MethodCall, result: MethodChannel.Result -> + + if (methodCall.method == HMG_INTERNET_WIFI_CONNECT_METHOD) { + connectHMGInternetWifi(methodCall,result) + + }else if (methodCall.method == HMG_GUEST_WIFI_CONNECT_METHOD) { + connectHMGGuestWifi(methodCall,result) + + }else if (methodCall.method == ENABLE_WIFI_IF_NOT) { + enableWifiIfNot(methodCall,result) + }else if (methodCall.method == REGISTER_HMG_GEOFENCES) { + registerHmgGeofences(methodCall,result) + }else if (methodCall.method == UN_REGISTER_HMG_GEOFENCES) { + unRegisterHmgGeofences(methodCall,result) + }else{ + + result.notImplemented() + } + + } + + val res = channel.invokeMethod("localizedValue","errorConnectingHmgNetwork") + print(res) + } + + private fun connectHMGInternetWifi(methodCall: MethodCall, result: MethodChannel.Result){ + (methodCall.arguments as ArrayList<*>).let { + require(it.size > 0 && (it[0] is String),lazyMessage = { + "Missing or invalid arguments (Must have one argument 'String at 0'" + }) + + val patientId = it[0].toString() + HMG_Internet(mainActivity) + .connectToHMGGuestNetwork(patientId){ status, message -> + + mainActivity.runOnUiThread { + result.success(if(status) 1 else 0) + + HMGUtils.popFlutterText(mainActivity, message) + Log.v(this.javaClass.simpleName, "$status | $message") + } + + } + } + } + + + private fun connectHMGGuestWifi(methodCall: MethodCall, result: MethodChannel.Result){ + HMG_Guest(mainActivity).connectToHMGGuestNetwork { status, message -> + mainActivity.runOnUiThread { + result.success(if(status) 1 else 0) + + HMGUtils.popFlutterText(mainActivity, message) + Log.v(this.javaClass.simpleName, "$status | $message") + } + } + } + + private fun enableWifiIfNot(methodCall: MethodCall, result: MethodChannel.Result) { + val wm = mainActivity.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager? + if (wm != null){ + if (!wm.isWifiEnabled) + wm.isWifiEnabled = true + result.success(true) + }else + result.error("101","Error while opening wifi, Please try to open wifi yourself and try again","'WifiManager' service failed"); + } + + + private fun registerHmgGeofences(methodCall: MethodCall, result: MethodChannel.Result) { + + channel.invokeMethod("getGeoZones",null, object : MethodChannel.Result{ + override fun success(result: Any?) { + if(result is String) { + val geoZones = GeoZoneModel().listFrom(result) + HMG_Geofence.shared(mainActivity).register(geoZones) + } + } + + override fun error(errorCode: String?, errorMessage: String?, errorDetails: Any?) { print(result) } + override fun notImplemented() { print(result) } + }) + + } + + private fun unRegisterHmgGeofences(methodCall: MethodCall, result: MethodChannel.Result) { + HMG_Geofence.shared(mainActivity).unRegisterAll { status, exception -> + if(status) + result.success(true) + else + result.error("101", exception?.localizedMessage, exception); + } + } + +} diff --git a/android/app/src/main/res/drawable/app_icon.png b/android/app/src/main/res/drawable/app_icon.png new file mode 100644 index 00000000..c4cc798d Binary files /dev/null and b/android/app/src/main/res/drawable/app_icon.png differ diff --git a/android/app/src/main/res/drawable/food.png b/android/app/src/main/res/drawable/food.png new file mode 100644 index 00000000..41b394d3 Binary files /dev/null and b/android/app/src/main/res/drawable/food.png differ diff --git a/android/app/src/main/res/drawable/me.png b/android/app/src/main/res/drawable/me.png new file mode 100644 index 00000000..ba75bc55 Binary files /dev/null and b/android/app/src/main/res/drawable/me.png differ diff --git a/android/app/src/main/res/drawable/sample_large_icon.png b/android/app/src/main/res/drawable/sample_large_icon.png new file mode 100644 index 00000000..f354ca23 Binary files /dev/null and b/android/app/src/main/res/drawable/sample_large_icon.png differ diff --git a/android/app/src/main/res/drawable/secondary_icon.png b/android/app/src/main/res/drawable/secondary_icon.png new file mode 100644 index 00000000..9de9ff41 Binary files /dev/null and b/android/app/src/main/res/drawable/secondary_icon.png differ diff --git a/android/app/src/main/res/raw/keep.xml b/android/app/src/main/res/raw/keep.xml new file mode 100644 index 00000000..944a7ace --- /dev/null +++ b/android/app/src/main/res/raw/keep.xml @@ -0,0 +1,3 @@ + + \ No newline at end of file diff --git a/android/app/src/main/res/raw/slow_spring_board.mp3 b/android/app/src/main/res/raw/slow_spring_board.mp3 new file mode 100644 index 00000000..60dbf979 Binary files /dev/null and b/android/app/src/main/res/raw/slow_spring_board.mp3 differ diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml new file mode 100755 index 00000000..8acc0c12 --- /dev/null +++ b/android/app/src/main/res/values/strings.xml @@ -0,0 +1,16 @@ + + HMG Patient App + + + Unknown error: the Geofence service is not available now. + + + Geofence service is not available now. Go to Settings>Location>Mode and choose High accuracy. + + + Your app has registered too many geofences. + + + You have provided too many PendingIntents to the addGeofences() call. + + diff --git a/android/build.gradle b/android/build.gradle index 3100ad2d..8e56476b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,8 +6,9 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' + classpath 'com.android.tools.build:gradle:4.0.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'com.google.gms:google-services:4.3.2' } } diff --git a/android/google-services.json b/android/google-services.json new file mode 100644 index 00000000..a4655794 --- /dev/null +++ b/android/google-services.json @@ -0,0 +1,40 @@ +{ + "project_info": { + "project_number": "864393916058", + "firebase_url": "https://diplomaticquarter-d2385.firebaseio.com", + "project_id": "diplomaticquarter-d2385", + "storage_bucket": "diplomaticquarter-d2385.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:864393916058:android:5b5a65cd6d8c18b4b97923", + "android_client_info": { + "package_name": "com.cloud.diplomaticquarterapp" + } + }, + "oauth_client": [ + { + "client_id": "864393916058-tphjrn8j39ntevt32ekcvmll8aue7qql.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyBdV3mos1BPhUzNKCj2KANJtiO3o2zh9IM" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "864393916058-tphjrn8j39ntevt32ekcvmll8aue7qql.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/gradle.properties b/android/gradle.properties index 38c8d454..9c0729c9 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,4 +1,5 @@ -org.gradle.jvmargs=-Xmx1536M + android.enableR8=true android.useAndroidX=true android.enableJetifier=true +org.gradle.jvmargs=-Xmx4608m diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 296b146b..5660070d 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Jun 23 08:50:38 CEST 2017 +#Thu Sep 03 16:26:30 EEST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip diff --git a/android/settings_aar.gradle b/android/settings_aar.gradle new file mode 100644 index 00000000..e7b4def4 --- /dev/null +++ b/android/settings_aar.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/assets/app_icons/config.json b/assets/app_icons/config.json new file mode 100644 index 00000000..0bedcb06 --- /dev/null +++ b/assets/app_icons/config.json @@ -0,0 +1,262 @@ +{ + "name": "DQIcons", + "css_prefix_text": "", + "css_use_suffix": false, + "hinting": true, + "units_per_em": 1000, + "ascent": 850, + "glyphs": [ + { + "uid": "ff411ee29329279e60e33c8fe13b69cf", + "css": "blood-pressure", + "code": 59392, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M479.2 354.2V423.1A41.1 41.1 0 0 0 458.3 458.4 41.8 41.8 0 0 0 541.7 458.4 41.1 41.1 0 0 0 520.9 423.1V354.2A20.8 20.8 0 1 0 479.1 354.2ZM854.2 0C772.4 0 708.3 73.2 708.3 166.7 708.3 233.8 758.9 352.6 833.3 372V770.9A187.1 187.1 0 0 1 459.5 782.2C524.8 773.9 583.4 758.4 583.4 729.2V649A207.9 207.9 0 0 0 583.4 267.6V145.8C583.4 86.3 340.4 83.3 291.7 83.3S0 86.3 0 145.8V729.3C0 788.8 243 791.8 291.7 791.8 311.4 791.8 363.1 791.2 417.4 786.7A229 229 0 0 0 875 771V372C949.4 352.7 1000 233.8 1000 166.7 1000 73.2 935.9 0 854.2 0ZM666.7 458.3A166.7 166.7 0 1 1 500 291.7 166.8 166.8 0 0 1 666.7 458.3ZM291.7 125A1092.4 1092.4 0 0 1 519.3 145.8 1092.6 1092.6 0 0 1 291.7 166.7 1092.4 1092.4 0 0 1 64 145.8 1092.7 1092.7 0 0 1 291.7 125ZM125 739.8A343.8 343.8 0 0 1 41.8 721.9V181.6A427 427 0 0 0 125 199.2ZM291.7 750C246.4 750 203.7 747.8 166.7 744.4V203.3C220.8 207.8 272.1 208.4 291.7 208.4 327.7 208.4 470.1 206.7 541.7 181.6V254.2A208.3 208.3 0 1 0 541.7 662.5V721.9A850.6 850.6 0 0 1 291.7 750ZM854.2 333.3C801.5 333.3 750 227.9 750 166.7 750 96.5 795.8 41.6 854.2 41.6S958.3 96.5 958.3 166.7C958.4 227.9 906.9 333.3 854.2 333.3Z", + "width": 1000 + }, + "search": [ + "blood-pressure" + ] + }, + { + "uid": "f06e0a60c298fe46fcd558db3c9103e6", + "css": "blood", + "code": 59393, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M902.3 687.5A19.5 19.5 0 1 0 921.9 707 19.6 19.6 0 0 0 902.3 687.5ZM902.3 687.5M332 429.6A19.5 19.5 0 1 0 312.5 410.1 19.6 19.6 0 0 0 332 429.6ZM332 429.6M214.9 625A214.7 214.7 0 0 0 401.1 303.2L231.8 9.8A19.5 19.5 0 0 0 197.9 9.8L28.6 303.1A214.7 214.7 0 0 0 214.9 625ZM62.4 322.7L214.9 58.6 367.3 322.7A175.8 175.8 0 1 1 62.4 322.7ZM62.4 322.7M214.8 546.9A136.2 136.2 0 0 0 321.1 496.1 19.5 19.5 0 0 0 290.7 471.5 97.4 97.4 0 0 1 214.8 507.8 19.5 19.5 0 1 0 214.8 546.9ZM214.8 546.9M1000 726.4A272.4 272.4 0 0 0 954.8 575.6L723.8 189A19.6 19.6 0 0 0 689.6 190.3L487.1 594.3A273.5 273.5 0 1 0 999.9 726.4ZM726.6 960.7A234.4 234.4 0 0 1 521.5 612.9L521.8 612.1 708.6 239.5 921.5 596 921.9 596.7A234.4 234.4 0 0 1 726.4 960.6ZM726.6 960.7M898.9 766.2A19.5 19.5 0 0 0 874 778.2 156.5 156.5 0 0 1 726.4 882.9 19.5 19.5 0 0 0 726.4 922 195.5 195.5 0 0 0 910.9 791.1 19.5 19.5 0 0 0 898.9 766.2ZM898.9 766.2", + "width": 1000 + }, + "search": [ + "blood" + ] + }, + { + "uid": "8bc572f19109474e3c88db0439fd2dcc", + "css": "bmi", + "code": 59394, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M937.8 231.3H846.3V80.5A80.6 80.6 0 0 0 765.8 0H80.3A80.5 80.5 0 0 0 0 80.5V686.2A80.5 80.5 0 0 0 80.3 766.6H456V948.3A51.7 51.7 0 0 0 507.7 1000H937.8A51.7 51.7 0 0 0 989.3 948.3V283A51.7 51.7 0 0 0 937.8 231.3ZM80.3 733.3A47.1 47.1 0 0 1 33.3 686.2V80.5A47.1 47.1 0 0 1 80.3 33.3H765.8A47.2 47.2 0 0 1 813 80.5V231.3H634A216.5 216.5 0 0 0 210.3 240 40.5 40.5 0 0 0 249.9 288.3H455.9V733.3ZM464.2 255H457.9L451.6 229.5A76.5 76.5 0 0 1 472.2 245.5 51.4 51.4 0 0 0 464.2 255ZM415.1 220.1L423.8 255H348.6A78.3 78.3 0 0 1 414.2 220L414.9 220ZM507.7 231.3C506.5 231.3 505.3 231.6 504.1 231.7A109.7 109.7 0 0 0 442 190.3L431.2 146.7 444.5 153.1A16.7 16.7 0 0 0 458.8 122.9L413.7 101.6H413.4A16.2 16.2 0 0 0 409 100.2C408.6 100.2 408.3 100.2 407.9 100.2A17.5 17.5 0 0 0 406 100.2 16.2 16.2 0 0 0 402.1 100.9 13.6 13.6 0 0 0 400.5 101.3 17.6 17.6 0 0 0 395.7 104.2L395.7 104.2A16.7 16.7 0 0 0 392.5 108.1L365.6 152.8A16.7 16.7 0 0 0 394.2 170L400.3 159.8 407.2 187.5A112.5 112.5 0 0 0 311.3 255H250A6.8 6.8 0 0 1 244.5 252.5 7.4 7.4 0 0 1 243 246.3 183.3 183.3 0 0 1 599.8 231.3ZM956 948.3A18.4 18.4 0 0 1 937.7 966.6H507.7A18.4 18.4 0 0 1 489.3 948.3V283A18.4 18.4 0 0 1 507.7 264.7H937.8A18.4 18.4 0 0 1 956.2 283ZM878.7 300H566.6A44 44 0 0 0 522.7 344V506.2A44 44 0 0 0 566.6 550.2H878.7A44 44 0 0 0 922.6 506.2V344A44 44 0 0 0 878.7 300ZM889.3 506A10.7 10.7 0 0 1 878.7 516.6H566.6A10.7 10.7 0 0 1 556 506V343.8A10.7 10.7 0 0 1 566.6 333.1H878.7A10.7 10.7 0 0 1 889.3 343.8V506ZM631 566.7H547.7A16.7 16.7 0 0 0 531 583.3V666.7A16.7 16.7 0 0 0 547.7 683.3H631A16.7 16.7 0 0 0 647.7 666.7V583.3A16.7 16.7 0 0 0 631 566.7ZM614.3 650H564.2V600H614.3ZM764.3 566.7H681A16.7 16.7 0 0 0 664.3 583.3V666.7A16.7 16.7 0 0 0 681 683.3H764.3A16.7 16.7 0 0 0 781 666.7V583.3A16.7 16.7 0 0 0 764.3 566.7ZM747.7 650H697.6V600H747.6ZM897.7 566.7H814.3A16.7 16.7 0 0 0 797.7 583.3V666.7A16.7 16.7 0 0 0 814.3 683.3H897.7A16.7 16.7 0 0 0 914.3 666.7V583.3A16.7 16.7 0 0 0 897.7 566.7ZM881 650H830.9V600H880.9ZM631 700H547.7A16.7 16.7 0 0 0 531 716.7V800A16.7 16.7 0 0 0 547.7 816.7H631A16.7 16.7 0 0 0 647.7 800V716.7A16.7 16.7 0 0 0 631 700ZM614.3 783.3H564.2V733.3H614.3ZM764.3 700H681A16.7 16.7 0 0 0 664.3 716.7V800A16.7 16.7 0 0 0 681 816.7H764.3A16.7 16.7 0 0 0 781 800V716.7A16.7 16.7 0 0 0 764.3 700ZM747.7 783.3H697.6V733.3H747.6ZM897.7 700H814.3A16.7 16.7 0 0 0 797.7 716.7V800A16.7 16.7 0 0 0 814.3 816.7H897.7A16.7 16.7 0 0 0 914.3 800V716.7A16.7 16.7 0 0 0 897.7 700ZM881 783.3H830.9V733.3H880.9ZM631 833.3H547.7A16.7 16.7 0 0 0 531 850V933.3A16.7 16.7 0 0 0 547.7 950H631A16.7 16.7 0 0 0 647.7 933.3V850A16.7 16.7 0 0 0 631 833.3ZM614.3 916.7H564.2V866.6H614.3ZM764.3 833.3H681A16.7 16.7 0 0 0 664.3 850V933.3A16.7 16.7 0 0 0 681 950H764.3A16.7 16.7 0 0 0 781 933.3V850A16.7 16.7 0 0 0 764.3 833.3ZM747.7 916.7H697.6V866.6H747.6ZM897.7 833.3H814.3A16.7 16.7 0 0 0 797.7 850V933.3A16.7 16.7 0 0 0 814.3 950H897.7A16.7 16.7 0 0 0 914.3 933.3V850A16.7 16.7 0 0 0 897.7 833.3ZM881 916.7H830.9V866.6H880.9ZM626.8 350H593.5A16.7 16.7 0 0 0 576.9 366.7V483.3A16.7 16.7 0 0 0 593.5 500H626.8A41.7 41.7 0 0 0 668.5 458.3V450A41.2 41.2 0 0 0 660 425 41.3 41.3 0 0 0 668.5 399.9V391.6A41.7 41.7 0 0 0 626.8 350ZM610.2 383.3H626.8A8.3 8.3 0 0 1 635.2 391.7V400A8.3 8.3 0 0 1 626.8 408.4H610.2ZM635.2 458.5A8.3 8.3 0 0 1 626.8 466.9H610.2V441.9H626.8A8.3 8.3 0 0 1 635.2 450.2ZM802.9 350.8A16.7 16.7 0 0 0 784.3 356.7L747.7 405.4 711 356.5A16.7 16.7 0 0 0 681 366.5V499.8H714.2V416.7L734.2 443.4A17.3 17.3 0 0 0 760.9 443.4L780.9 416.7V500H814.2V366.7A16.7 16.7 0 0 0 802.9 350.8ZM831 350H864.2V500H831Z", + "width": 989 + }, + "search": [ + "bmi" + ] + }, + { + "uid": "66a5ea0b6227f324a7bcce70c85374a9", + "css": "heart", + "code": 59395, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M1308.4 475H1204.8A726.6 726.6 0 0 0 1225.9 394C1251.4 266.6 1234.4 162.5 1177.2 92.3A269.9 269.9 0 0 0 962.4 0.3 417.3 417.3 0 0 0 651.3 143.5 417.3 417.3 0 0 0 340.2 0.3 269.9 269.9 0 0 0 124.3 92.3C67 163 50.1 266.6 75.5 394A725.7 725.7 0 0 0 98.3 476.7H23.6A23.6 23.6 0 1 0 23.6 523.8H115.9C259.5 877 640.3 997.8 644.4 999A23.6 23.6 0 0 0 658.1 999C662.3 997.8 1044.3 877 1187.5 522.1H1308.3A23.6 23.6 0 0 0 1308.3 475.1ZM651.4 951.7H651.4C601.4 934.5 296 818.6 166.7 523.8H423.2L501.2 715.2A23.6 23.6 0 0 0 522.9 729.8H524.8A23.6 23.6 0 0 0 546 711.9L626 384.4 691.8 605.9A24.1 24.1 0 0 0 737.3 607L803.9 422.9 874.5 513.1A23.6 23.6 0 0 0 892.9 522H1136.9C1007.7 817.7 701 934.5 651.4 951.7ZM1179.8 384.8A673.4 673.4 0 0 1 1154.7 475.3H904.5L814.3 360.7A23.6 23.6 0 0 0 773.6 367.3L716.8 523.6 646.2 288.3A23.9 23.9 0 0 0 600.2 289.5L517.6 630.2 460.6 491.3A23.6 23.6 0 0 0 438.7 476.7H147.9A676.1 676.1 0 0 1 122.8 384.8H122.8C99.3 271.8 113.6 181.2 161.9 122.3A223.9 223.9 0 0 1 340.1 47.3 362.4 362.4 0 0 1 631.7 195.7 23.6 23.6 0 0 0 670.8 195.7 362.4 362.4 0 0 1 962.4 47.3 223.9 223.9 0 0 1 1140.7 122.2C1187.8 181.2 1202.4 271.8 1179.8 384.8Z", + "width": 1332 + }, + "search": [ + "heart" + ] + }, + { + "uid": "4131eb4c890febf6ff3d52e759eed4d4", + "css": "height", + "code": 59396, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M518 285.7H508.4A107.1 107.1 0 1 0 349.1 285.7H339.4A89.4 89.4 0 0 0 250.3 374.9V624.9A17.9 17.9 0 0 0 268.1 642.7H321.7V982.2A17.9 17.9 0 0 0 339.6 1000H446.7A89.4 89.4 0 0 0 535.9 910.9V643H589.5A17.9 17.9 0 0 0 607.4 625.1V375A89.4 89.4 0 0 0 518 285.7ZM428.8 142.9A71.4 71.4 0 1 1 357.4 214.3 71.5 71.5 0 0 1 428.6 142.9ZM439.8 321.4L428.8 354.2 417.9 321.4ZM571.7 607.1H536V375H500.3V910.8A53.6 53.6 0 0 1 446.7 964.3V642.9H411V964.3H357.1V375H321.4V607.1H285.7V375A53.6 53.6 0 0 1 339.3 321.4H380L411.7 416.3A17.8 17.8 0 0 0 445.5 416.3L477.2 321.4H518A53.6 53.6 0 0 1 571.6 375V607.1ZM196.4 0H17.9A17.9 17.9 0 0 0 0 17.9V982.2A17.9 17.9 0 0 0 17.9 1000H196.5A17.9 17.9 0 0 0 214.3 982.2V17.9A17.9 17.9 0 0 0 196.4 0ZM178.6 107.1H142.9V142.9H178.6V214.3H107.1V250H178.6V321.4H142.9V357.1H178.6V428.7H107.1V464.4H178.6V535.9H142.9V571.6H178.6V643H107.1V678.7H178.6V750.2H142.9V785.9H178.6V857.3H107.1V893H178.6V964.5H35.7V35.7H178.6Z", + "width": 804 + }, + "search": [ + "height" + ] + }, + { + "uid": "7da96eaf449227b65b25e28f024492a7", + "css": "outline", + "code": 59397, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M295.8 216.2L303.6 183.8C300.3 183 222.5 165.2 167.6 293.5L198.2 306.8C241.3 206 293.6 215.8 295.8 216.2ZM147.9 1000C279.8 1000 416.2 671.4 416.2 583.3A102.5 102.5 0 0 0 399.1 524L499.6 423.6 600 524A102.5 102.5 0 0 0 582.9 583.3C582.9 671.4 719.4 1000 851.2 1000A94.7 94.7 0 0 0 928.2 950.1C1001.6 841.4 1023 563 968.4 427.4A1298.8 1298.8 0 0 0 893.8 267C832.1 156.3 772.7 100.2 717.3 100.2 692.2 100.2 667.5 118.5 646.3 153.3A349.4 349.4 0 0 0 604 380.8L566.2 343.1V16.6A16.6 16.6 0 0 0 549.6 0H449.6A16.6 16.6 0 0 0 432.9 16.6V343L395.2 380.8A349.4 349.4 0 0 0 352.9 153.1C331.6 118.3 307 99.9 281.9 99.9 156.3 99.9 43.6 392.7 30.7 427.2-23.9 562.8-2.5 841.2 70.9 949.9A94.7 94.7 0 0 0 147.9 1000ZM674.5 170.6C688.9 147.3 704.9 133.3 717.3 133.3 804.4 133.3 905.6 354.1 937.3 439.1L937.3 439.5C987.9 564.8 968 831.4 900.5 931.4 884.7 954.6 868.1 966.6 851.1 966.6 749.5 966.6 616.1 669.5 616.1 583.3A77.3 77.3 0 0 1 640.4 526 140.2 140.2 0 0 0 657 503 213.7 213.7 0 0 0 688.8 530.9 126.6 126.6 0 0 0 649.4 633.3H682.6A97.1 97.1 0 0 1 709.2 557.1 373 373 0 0 1 732.6 700C732.6 746.1 753.5 833.3 832.6 833.3V800.1C767 800.1 765.9 704.1 765.9 700.1A433 433 0 0 0 745.5 559 185.9 185.9 0 0 0 783.7 565.9 302.4 302.4 0 0 0 870.8 745.2L894.4 721.6A272.8 272.8 0 0 1 817.6 568 93.1 93.1 0 0 1 899.7 636.6L932.4 629.9A128.5 128.5 0 0 0 799.5 533.2 153.6 153.6 0 0 1 722.1 512.6 152.4 152.4 0 0 0 731.5 493.5 117.5 117.5 0 0 0 773.1 501.2 122.7 122.7 0 0 0 861.2 461.7L837.7 438.1A84.3 84.3 0 0 1 740.6 461 100.7 100.7 0 0 0 711.3 371.5L687.7 395A78.9 78.9 0 0 1 694.7 493.1 172.2 172.2 0 0 1 665.3 460.3 155.7 155.7 0 0 0 648 409.1C616.1 345.9 636.4 232.6 674.5 170.6ZM630.5 454.6A42.4 42.4 0 0 1 620.8 497.8L573.1 450 599.7 423.4ZM576 400L549.4 426.6 516.2 393.4V366.8H542.7ZM466.2 33.2H532.9V66.5H466.2ZM466.2 99.9H532.9V133.1H466.2ZM466.2 166.6H532.9V199.8H466.2ZM466.2 233.2H532.9V266.5H466.2ZM466.2 299.9H532.9V333.1H466.2ZM456.5 366.6H483.1V393.2L449.8 426.4 423.2 399.8ZM399.6 423.6L426.2 450.1 378.3 497.7A42.4 42.4 0 0 1 368.5 454.5ZM61.7 439.6L61.7 439.1C93.4 354.1 194.6 133.4 281.7 133.4 294.1 133.4 310 147.3 324.4 170.7 362.6 232.7 382.8 345.9 351 409.2A155.7 155.7 0 0 0 333.7 460.5 172.4 172.4 0 0 1 304.2 493.3 78.7 78.7 0 0 1 311.3 395.2L287.7 371.6A100.7 100.7 0 0 0 258.4 461.3 84.3 84.3 0 0 1 161.3 438.5L137.8 462A122.8 122.8 0 0 0 225.9 501.6 117.5 117.5 0 0 0 267.6 493.8 152.3 152.3 0 0 0 277 512.9 153.6 153.6 0 0 1 199.6 533.5 128.6 128.6 0 0 0 66.6 630.2L99.3 636.9A91.8 91.8 0 0 1 181.2 567.9 273 273 0 0 1 104.4 721.5L128 745.1A302.4 302.4 0 0 0 215.1 565.9 185.9 185.9 0 0 0 253.3 558.9 432.9 432.9 0 0 0 232.9 700C232.9 704.1 231.8 800 166.2 800V833.2C245.3 833.2 266.2 746 266.2 699.9A373.6 373.6 0 0 1 289.5 557 97.4 97.4 0 0 1 316.1 633.1H349.3A126.7 126.7 0 0 0 309.9 530.8 213.8 213.8 0 0 0 341.6 502.9 140.2 140.2 0 0 0 358.3 525.8 77.3 77.3 0 0 1 382.6 583.1C382.6 669.3 249.1 966.4 147.6 966.4 130.6 966.4 114 954.6 98.2 931.2 31 831.5 11.1 565 61.7 439.6ZM800.9 306.6L831.5 293.3C776.5 165 698.8 182.9 695.5 183.6L703.3 216C705.5 215.8 757.9 206.1 800.9 306.6Z", + "width": 999 + }, + "search": [ + "outline" + ] + }, + { + "uid": "9ad94ca188c9245ce61a2023913176f8", + "css": "thermometer", + "code": 59398, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M183.4 0A116.7 116.7 0 0 0 66.7 116.6V675.1A183.3 183.3 0 1 0 366.6 816.3 181.6 181.6 0 0 0 300 675.1V116.6A116.7 116.7 0 0 0 183.4 0ZM333.3 816.3A150 150 0 1 1 93.4 696.6 16.7 16.7 0 0 0 100.1 683.2V633.1H133.3V599.9H100.1V549.8H133.3V516.6H100.1V466.5H133.3V433.3H100.1V383.2H133.3V350H100.1V299.9H133.3V266.6H100.1V216.6H133.3V183.3H100.1V116.6A83.3 83.3 0 0 1 266.7 116.6V683.3A16.6 16.6 0 0 0 273.3 696.6 148.8 148.8 0 0 1 333.3 816.3ZM333.3 816.3M200.1 734.7V150H166.9V734.7A83.3 83.3 0 1 0 200.1 734.7ZM183.4 866.3A50 50 0 1 1 233.4 816.3 50 50 0 0 1 183.4 866.3ZM183.4 866.3", + "width": 367 + }, + "search": [ + "thermometer" + ] + }, + { + "uid": "dc83d16b71561f6b582663f6b4d604ec", + "css": "weight-scale", + "code": 59399, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M912.1 0H87.9A88 88 0 0 0 0 87.9V912.1A88 88 0 0 0 87.9 1000H912.1A88 88 0 0 0 1000 912.1V87.9A88 88 0 0 0 912.1 0ZM941.4 912.1A29.3 29.3 0 0 1 912.1 941.4H87.9A29.3 29.3 0 0 1 58.6 912.1V87.9A29.3 29.3 0 0 1 87.9 58.6H912.1A29.3 29.3 0 0 1 941.4 87.9ZM941.4 912.1M837.9 233.7A563.3 563.3 0 0 0 162.2 233.7 29.3 29.3 0 0 0 156.4 274.9L311.1 480.7A29.3 29.3 0 0 0 352.2 486.5 246.9 246.9 0 0 1 648.4 486.5 29.3 29.3 0 0 0 689.5 480.7L844.2 274.9A29.3 29.3 0 0 0 838.4 233.7ZM659 422.9A302 302 0 0 0 529.3 379.8V290.6A29.3 29.3 0 0 0 470.7 290.6V379.8A302 302 0 0 0 341 422.9L221.2 263.6A504.8 504.8 0 0 1 778.8 263.6ZM659 422.9", + "width": 1000 + }, + "search": [ + "weight-scale" + ] + }, + { + "uid": "363eebd3ff1ac281c38b4ddbc6a2e9d3", + "css": "parking_icon", + "code": 59400, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M592.8 33.4C552.3 32.7 518.9 60.5 518.3 95.2S550.2 158.9 590.7 159.6 664.6 132.5 665.2 97.7 633.3 34.1 592.8 33.4ZM590.9 145C559.8 144.5 534.8 122.3 535.2 95.5S561.4 47.4 592.6 48 648.7 70.7 648.3 97.5 622.1 145.6 590.9 145ZM593.4 1.7C535.4 0.8 487.5 41.5 486.7 92.5 486.3 115.8 502.6 147.6 535.2 187.2A605.7 605.7 0 0 0 583.6 239.1L589.2 244.4 595.1 239.3A605.6 605.6 0 0 0 645.2 189.1C679.1 150.6 696.5 119.4 696.9 96.1 697.8 45.1 651.3 2.7 593.4 1.7ZM632.5 180.2A610.9 610.9 0 0 1 589.6 223.9 610.5 610.5 0 0 1 548.2 178.9C518.2 142.4 502.4 112.6 502.8 92.8 503.5 49.6 544 15.1 593.1 15.9S681.5 52.6 680.8 95.8C680.4 115.6 663.8 144.8 632.5 180.2ZM599.7 63.9L574.1 63.5 573.1 125.8 587.6 126 587.9 107.2 599 107.4A21.7 21.7 0 0 0 599.7 63.9ZM599.2 92.8L588.2 92.7 588.4 78.3 599.5 78.5A7.2 7.2 0 0 1 599.2 92.8ZM187.7 292.7H128.8A129 129 0 0 0 0 421.5V907.3A55.3 55.3 0 0 0 55.2 962.5H261.3A55.3 55.3 0 0 0 316.5 907.3V421.5A129 129 0 0 0 187.7 292.7ZM116.7 315.4A109.8 109.8 0 0 1 22.8 409.4 106.9 106.9 0 0 1 116.7 315.4ZM22.1 604A135.3 135.3 0 0 1 34.3 547.5L63.4 588.9A32.9 32.9 0 0 0 58.9 605.5V767.4A33 33 0 0 0 62 781.5L28.3 829.5A32.9 32.9 0 0 1 22.1 810.1ZM92 800.5H224.5A32.9 32.9 0 0 0 238.6 797.4L270 842A33 33 0 0 1 261.3 843.2H55.2A33 33 0 0 1 46.5 842L77.9 797.4A32.9 32.9 0 0 0 92 800.5ZM81 767.4V605.5A11.1 11.1 0 0 1 92 594.4H224.5A11.1 11.1 0 0 1 235.5 605.5V767.4A11.1 11.1 0 0 1 224.5 778.4H92A11.1 11.1 0 0 1 81 767.4ZM236.2 574.5A33 33 0 0 0 224.5 572.4H92A33 33 0 0 0 80.3 574.5L46.5 526.4A136 136 0 0 1 270.1 526.4ZM294.4 907.3A33.2 33.2 0 0 1 261.3 940.4H55.2A33.2 33.2 0 0 1 22.1 907.3V854.2A54.9 54.9 0 0 0 55.2 865.3H261.3A54.9 54.9 0 0 0 294.4 854.2ZM294.4 810.1A32.9 32.9 0 0 1 288.2 829.4L254.5 781.5A33 33 0 0 0 257.6 767.4V605.5A32.9 32.9 0 0 0 253.1 588.9L282.2 547.5A135.3 135.3 0 0 1 294.4 604ZM294.4 523.5A158.2 158.2 0 0 0 22.1 523.5V431.7A131.9 131.9 0 0 0 139.1 314.7H181.9A131.9 131.9 0 0 0 294.4 431.2ZM204.3 316A106.9 106.9 0 0 1 293.6 408.7 110.9 110.9 0 0 1 204.3 316ZM204.3 316M624.9 292.7H566A129 129 0 0 0 437.2 421.5V907.3A55.3 55.3 0 0 0 492.4 962.5H698.5A55.3 55.3 0 0 0 753.7 907.3V421.5A129 129 0 0 0 624.9 292.7ZM730.8 408.7A110.9 110.9 0 0 1 641.5 316 106.9 106.9 0 0 1 730.8 408.7ZM554 315.4A109.8 109.8 0 0 1 460 409.4 106.9 106.9 0 0 1 554 315.4ZM459.3 604A135.3 135.3 0 0 1 471.6 547.5L500.6 588.9A32.9 32.9 0 0 0 496.1 605.5V767.4A33 33 0 0 0 499.3 781.5L465.6 829.5A32.9 32.9 0 0 1 459.3 810.1ZM529.2 800.5H661.7A32.9 32.9 0 0 0 675.8 797.4L707.2 842A33 33 0 0 1 698.5 843.2H492.4A33 33 0 0 1 483.7 842L515.1 797.4A32.9 32.9 0 0 0 529.2 800.5ZM518.2 767.4V605.5A11.1 11.1 0 0 1 529.2 594.4H661.7A11.1 11.1 0 0 1 672.8 605.5V767.4A11.1 11.1 0 0 1 661.7 778.4H529.2A11.1 11.1 0 0 1 518.2 767.4ZM673.4 574.5A33 33 0 0 0 661.7 572.4H529.2A33 33 0 0 0 517.5 574.5L483.7 526.4A136 136 0 0 1 707.3 526.4ZM731.6 907.3A33.2 33.2 0 0 1 698.5 940.4H492.4A33.2 33.2 0 0 1 459.3 907.3V854.2A54.9 54.9 0 0 0 492.4 865.3H698.5A54.9 54.9 0 0 0 731.6 854.2ZM731.6 810.1A32.9 32.9 0 0 1 725.4 829.4L691.7 781.5A33 33 0 0 0 694.8 767.4V605.5A32.9 32.9 0 0 0 690.3 588.9L719.4 547.5A135.3 135.3 0 0 1 731.6 604ZM731.6 523.5A158.2 158.2 0 0 0 459.3 523.5V431.7A131.9 131.9 0 0 0 576.3 314.7H619.1A131.9 131.9 0 0 0 731.6 431.2ZM731.6 523.5M366.6 977.9H388.6V1000H366.6ZM366.6 977.9M366.6 290.4H388.6V955.8H366.6ZM366.6 290.4M366.6 246.3H388.6V268.4H366.6ZM366.6 246.3M43.4 896.2H65.5V918.3H43.4ZM43.4 896.2M251 896.2H273.1V918.3H251ZM251 896.2M483.6 896.2H505.7V918.3H483.6ZM483.6 896.2M691.2 896.2H713.2V918.3H691.2ZM691.2 896.2", + "width": 754 + }, + "search": [ + "parking_icon" + ] + }, + { + "uid": "3a1701f9a414e497ab81ae1bb58d3e7c", + "css": "blood_type_icon", + "code": 59401, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M567.7 248.5A2004.5 2004.5 0 0 0 452.6 80.5C395.1 5.9 378.7 0 363.3 0S331.4 5.9 273.8 80.5A2004.4 2004.4 0 0 0 158.8 248.6C99.6 344.8 0 523.3 0 636.7A363.3 363.3 0 0 0 726.5 636.7C726.5 523.3 627 344.8 567.7 248.5ZM510.7 696.3H392.6V814.4A29.3 29.3 0 1 1 334 814.4V696.3H215.8A29.3 29.3 0 0 1 215.8 637.7H334V519.5A29.3 29.3 0 1 1 392.6 519.5V637.7H510.7A29.3 29.3 0 0 1 510.7 696.3Z", + "width": 727 + }, + "search": [ + "blood_type_icon" + ] + }, + { + "uid": "2073f5ad66d9ab6e47cc1be6e6e20146", + "css": "height_icon", + "code": 59402, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M615.2 883H527.3V820.3H566.5A29.3 29.3 0 1 0 566.5 761.7H527.3V703.1H605.6A29.3 29.3 0 0 0 605.6 644.5H527.3V585.9H566.5A29.3 29.3 0 1 0 566.5 527.3H527.3V468.8H605.6A29.3 29.3 0 0 0 605.6 410.2H527.3V351.6H566.5A29.3 29.3 0 1 0 566.5 293H527.3V234.4H605.6A29.3 29.3 0 0 0 605.6 175.7H527.3V117.2H566.5A29.3 29.3 0 1 0 566.5 58.6H527.3V29.3A29.3 29.3 0 1 0 468.7 29.3V883H363L375.5 683.7H152.1L164.6 883H29.3A29.3 29.3 0 0 0 0 912.2V970.8A29.3 29.3 0 0 0 58.6 970.8V941.6H585.9V970.8A29.3 29.3 0 1 0 644.6 970.8V912.1A29.3 29.3 0 0 0 615.2 883ZM146.7 625H381A29.3 29.3 0 0 0 410.2 595.7V400.5A146 146 0 0 0 363.3 293.2 146.1 146.1 0 0 1 164.4 293.2 146 146 0 0 0 117.4 400.6V595.8A29.3 29.3 0 0 0 146.7 625Z", + "width": 645 + }, + "search": [ + "height_icon" + ] + }, + { + "uid": "0f1a73756e84a7173b6426ac45ca4a5a", + "css": "online_payment_icon", + "code": 59403, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M1214.7 273.8L1213.8 274A29 29 0 0 1 1207.2 274.8C1202 274.8 1195.9 272.2 1195.9 259.6 1195.9 253.1 1197 244.7 1206.7 244.7H1206.7A29.1 29.1 0 0 1 1213.7 246L1214.5 246.2V273.8ZM1216.2 211.5L1214.7 211.8V234.9L1213.2 234.5 1212.8 234.4A32.6 32.6 0 0 0 1204.1 232.8C1184.8 232.8 1180.7 247.5 1180.7 259.8A23.9 23.9 0 0 0 1206.6 286.3 52.5 52.5 0 0 0 1224 283.8 7.6 7.6 0 0 0 1230.5 275.5V209.1C1225.9 209.9 1221.1 210.7 1216.5 211.5M1272.2 274.3L1271.4 274.5 1268.4 275.3A30.7 30.7 0 0 1 1261.3 276.4C1256.8 276.4 1254 274.2 1254 270.3 1254 267.8 1255.2 263.6 1262.6 263.6H1272.2ZM1265.4 232.5A65.2 65.2 0 0 0 1245.7 236L1240.8 237.4 1242.4 248.7 1247.3 247.1A56.9 56.9 0 0 1 1263.4 244.3C1265.5 244.3 1272.1 244.3 1272.1 251.4V254.4H1263C1246.6 254.4 1239 259.7 1239 271 1239 280.6 1246 286.3 1257.8 286.3A60.9 60.9 0 0 0 1270.8 284.6L1271.1 284.6 1271.3 284.6 1272.8 284.8C1277.4 285.7 1282.2 286.5 1286.8 287.4V250.5C1286.8 238.6 1279.6 232.5 1265.5 232.5M1157.5 274.3L1156.7 274.5 1153.8 275.3A30.3 30.3 0 0 1 1146.6 276.4C1142.1 276.4 1139.4 274.2 1139.4 270.3 1139.4 267.8 1140.5 263.6 1147.9 263.6H1157.5L1157.5 274.3ZM1150.8 232.5A65 65 0 0 0 1131.1 236L1126.2 237.4 1127.8 248.7 1132.7 247.1A56.9 56.9 0 0 1 1148.8 244.3C1150.9 244.3 1157.5 244.3 1157.5 251.4V254.4H1148.4C1132 254.4 1124.3 259.7 1124.3 271 1124.3 280.6 1131.3 286.3 1143.2 286.3A60.9 60.9 0 0 0 1156.2 284.6L1156.5 284.6 1156.7 284.6 1158.1 284.8C1162.8 285.7 1167.5 286.5 1172.2 287.4V250.6C1172.2 238.5 1165 232.5 1150.9 232.5M1095.4 232.6A39.8 39.8 0 0 0 1079.4 236.2L1078.8 236.5 1078.3 236A24.2 24.2 0 0 0 1063.9 232.6 58.7 58.7 0 0 0 1047 235.1C1042 236.7 1040 239.1 1040 243.6V285.7H1055.7V246.8L1056.5 246.5A20 20 0 0 1 1063.4 245.3 6.2 6.2 0 0 1 1070.3 252.4V285.7H1085.7V251.8A11.4 11.4 0 0 0 1085.2 248.4L1084.7 247.4 1085.8 246.9A18.6 18.6 0 0 1 1093.5 245.3 6.3 6.3 0 0 1 1100.3 252.4V285.7H1115.7V250.9C1115.7 238.6 1109.2 232.7 1095.4 232.7M1260.6 174A53.6 53.6 0 0 1 1251.5 173.1L1250.6 173V150.3A11 11 0 0 0 1250.2 147.1L1249.7 146 1250.7 145.6C1251 145.5 1251.2 145.4 1251.5 145.3L1251.7 145.2 1252.7 144.8A1.5 1.5 0 0 1 1253.1 144.7 36.7 36.7 0 0 1 1261.2 143.8H1261.2C1270.8 143.8 1272 152.4 1272 158.8 1272 171.3 1265.7 174 1260.6 174M1260.6 130.8H1260.2A27.8 27.8 0 0 0 1238.5 138.1 14.7 14.7 0 0 0 1235.7 146.8H1235.7V170.3A6.9 6.9 0 0 1 1235.2 173.3L1234.7 174.2H1206.2V158H1206.2A24.3 24.3 0 0 0 1181 131.3H1166.6C1166 135.5 1165.5 138.5 1165 142.7H1179.2C1186.7 142.7 1190.7 149 1190.7 158.8V175.3L1189.7 174.7A10.9 10.9 0 0 0 1186.3 174.2H1161.7C1161.2 177.4 1160.6 181.4 1159.9 185.5H1235.8C1238.3 185 1241.4 184.5 1244 184.1A42.7 42.7 0 0 0 1259.8 187 25.9 25.9 0 0 0 1287 159 26.1 26.1 0 0 0 1260.6 130.8M1127.6 192.4H1128.3C1144.8 192.4 1152.5 187 1152.5 173.6A17.2 17.2 0 0 0 1133.7 156.2H1118.4A6.5 6.5 0 0 1 1111.2 149.3C1111.2 146.3 1112.3 142.7 1119.7 142.7H1152.9C1153.6 138.4 1154 135.7 1154.6 131.4H1120.2C1104.1 131.4 1096 138.1 1096 149.3S1103.1 166.2 1114.9 166.2H1130.1A7.2 7.2 0 0 1 1137.3 173.6 7.4 7.4 0 0 1 1128.8 181.2H1126.3L1077.7 181.1H1068.9C1061.4 181.1 1056.2 176.7 1056.2 167V160.2C1056.2 150 1060.2 143.6 1068.9 143.6H1083.3C1083.9 139.2 1084.3 136.5 1084.9 132.3H1065.4A24.6 24.6 0 0 0 1040.1 159.3H1040.1V167A23.3 23.3 0 0 0 1065.3 192.3H1079.6L1105.9 192.3H1127.7ZM1266.9 488.1A134.9 134.9 0 1 1 997.1 488.1H997.1A134.9 134.9 0 1 1 1266.9 488.1ZM1132 353.2A135.3 135.3 0 0 1 1266.9 488.1H1266.9A134.9 134.9 0 1 1 997 488.1M1132 353.2A135.3 135.3 0 0 1 1266.9 488.1H1266.9A134.8 134.8 0 0 1 1132 623M950.7 353.2A134.9 134.9 0 0 0 952.1 623 136.5 136.5 0 0 0 1042.8 588H1042.8A128.3 128.3 0 0 0 1056.3 573.8H1028.5A164.7 164.7 0 0 1 1018.5 560.2H1066.3A91.4 91.4 0 0 0 1074.2 545.9H1010.7A85.1 85.1 0 0 1 1004.9 531.6H1079.2A141.7 141.7 0 0 0 1086.3 488.8 184.3 184.3 0 0 0 1083.5 460.2H1000.6A104.3 104.3 0 0 1 1004.2 446H1078.4A85.1 85.1 0 0 0 1072.7 431.7H1009.9A141.6 141.6 0 0 1 1017.8 417.4H1065.6A67.9 67.9 0 0 0 1054.9 403.1H1028.5A121.7 121.7 0 0 1 1042 389.5 131.7 131.7 0 0 0 951.4 354.6C951.4 353.2 951.4 353.2 950.7 353.2ZM817.2 488.1A134.8 134.8 0 0 0 952.1 623 136.5 136.5 0 0 0 1042.7 588H1042.7A128.3 128.3 0 0 0 1056.3 573.8H1028.5A164.7 164.7 0 0 1 1018.5 560.2H1066.3A91.5 91.5 0 0 0 1074.2 545.9H1010.7A85.1 85.1 0 0 1 1004.9 531.6H1079.2A141.8 141.8 0 0 0 1086.3 488.8 184.3 184.3 0 0 0 1083.5 460.2H1000.6A104.3 104.3 0 0 1 1004.1 445.9H1078.4A85.1 85.1 0 0 0 1072.7 431.6H1009.9A141.6 141.6 0 0 1 1017.8 417.3H1065.6A67.9 67.9 0 0 0 1054.9 403.1H1028.5A121.7 121.7 0 0 1 1042 389.5 131.7 131.7 0 0 0 951.4 354.5H950.7M952.1 623A136.5 136.5 0 0 0 1042.8 588H1042.8A128.3 128.3 0 0 0 1056.3 573.8H1028.5A164.7 164.7 0 0 1 1018.5 560.2H1066.3A91.4 91.4 0 0 0 1074.2 545.9H1010.6A85.1 85.1 0 0 1 1004.9 531.6H1079.1A141.7 141.7 0 0 0 1086.3 488.8 184.3 184.3 0 0 0 1083.4 460.2H1000.7A104.3 104.3 0 0 1 1004.2 446H1078.5A85.1 85.1 0 0 0 1072.8 431.7H1009.9A141.6 141.6 0 0 1 1017.8 417.4H1065.6A67.9 67.9 0 0 0 1054.9 403.1H1028.5A121.7 121.7 0 0 1 1042 389.5 131.7 131.7 0 0 0 951.4 354.6H950.7M999.9 522.4L1002.1 510.2A30.9 30.9 0 0 1 998.5 511C993.5 511 992.8 508.1 993.5 506.6L997.9 481.6H1005.7L1007.9 468.1H1000.8L1002.2 459.5H987.9S979.3 506.6 979.3 512.3A10.7 10.7 0 0 0 990.8 524.5 21.9 21.9 0 0 0 999.9 522.4ZM1004.9 499.5A22.7 22.7 0 0 0 1029.9 524.5 37 37 0 0 0 1044.9 522.3L1047.7 508.8A42.8 42.8 0 0 1 1032.7 512.3C1017 512.3 1019.9 500.9 1019.9 500.9H1049.2A92.5 92.5 0 0 0 1051.3 488.1 19.3 19.3 0 0 0 1030.6 467.4C1015.6 466 1004.9 481.7 1004.9 499.5ZM1029.9 478.8C1037.7 478.8 1036.4 488.1 1036.4 488.8H1020.7C1020.6 488.1 1022 478.8 1029.9 478.8ZM1120.6 522.3L1123.4 506.7A35.1 35.1 0 0 1 1111.3 510.2C1101.3 510.2 1097 502.4 1097 493.8 1097 476.7 1105.6 467.4 1115.6 467.4A23.9 23.9 0 0 1 1128.4 471.7L1130.6 456.7A50.2 50.2 0 0 0 1114.2 453.2C1097.8 453.2 1081.3 467.5 1081.3 494.5 1081.3 512.3 1089.9 524.5 1107 524.5A64.1 64.1 0 0 0 1120.6 522.3ZM921.4 466A50.6 50.6 0 0 0 904.3 468.8L902.1 480.9A42.2 42.2 0 0 1 917.8 478.1C922.8 478.1 927.1 478.8 927.1 483.1 927.1 485.9 926.3 486.7 926.3 486.7H919.8C907.7 486.7 894.1 491.7 894.1 508.1 894.1 520.9 902.7 523.8 907.7 523.8A21.5 21.5 0 0 0 922.7 517.2L922 523H934.8L940.5 483.7A16.9 16.9 0 0 0 921.4 466ZM924.2 498.1C924.2 500.3 922.8 511.7 914.2 511.7A5.6 5.6 0 0 1 908.5 505.9C908.5 502.4 910.7 497.4 921.4 497.4A11.3 11.3 0 0 0 924.2 498.1ZM954.2 523.8A18.3 18.3 0 0 0 975.6 505.2C975.6 487.4 958.5 490.9 958.5 483.8 958.5 480.2 961.3 478.8 966.3 478.8 968.5 478.8 976.3 479.5 976.3 479.5L978.5 466.7A54.2 54.2 0 0 0 965 465.2C954.2 465.2 943.5 469.6 943.5 483.8 943.5 500.2 961.4 498.8 961.4 505.2 961.4 509.6 956.4 510.2 952.8 510.2A46.7 46.7 0 0 1 940 508L937.8 520.9C938.5 522.3 942.2 523.8 954.2 523.8ZM1239.1 454.5L1236.2 473.8A19.8 19.8 0 0 0 1222.7 466.7C1209.8 466.7 1198.4 482.4 1198.4 501 1198.4 512.4 1204.1 524.5 1216.2 524.5A19.1 19.1 0 0 0 1229.8 518.8L1229.1 523.8H1243.4L1254.1 455.3ZM1232.5 492.4C1232.5 500.2 1229 510.2 1221.1 510.2 1216.1 510.2 1213.3 505.9 1213.3 498.8 1213.3 487.4 1218.3 480.2 1224.7 480.2 1229.8 480.2 1232.6 483.8 1232.6 492.4ZM843.6 523.1L852.2 471.7 853.6 523.1H863.6L882.2 471.7 874.3 523.1H889.3L900.7 454.5H877.1L862.8 496.7 862.1 454.5H841.4L830 523.1ZM1064.9 523.1C1069.2 499.5 1069.9 480.2 1079.9 483.8A56.1 56.1 0 0 1 1084.9 467.4H1082C1075.5 467.4 1070.6 476 1070.6 476L1072 468.1H1058.5L1049.2 523.8H1064.9ZM1153.4 466A50.6 50.6 0 0 0 1136.3 468.8L1134.1 480.9A42.2 42.2 0 0 1 1149.8 478.1C1154.8 478.1 1159.1 478.8 1159.1 483.1 1159.1 485.9 1158.4 486.7 1158.4 486.7H1151.8C1139.7 486.7 1126.2 491.7 1126.2 508.1 1126.2 520.9 1134.7 523.8 1139.7 523.8A21.5 21.5 0 0 0 1154.7 517.2L1154 523H1166.8L1172.6 483.7A16.7 16.7 0 0 0 1153.4 466ZM1157 498.1C1157 500.3 1155.5 511.7 1147 511.7A5.6 5.6 0 0 1 1141.3 505.9C1141.3 502.4 1143.4 497.4 1154.1 497.4 1156.3 498.1 1156.3 498.1 1157 498.1ZM1184.8 523.1C1189.2 499.5 1189.8 480.2 1199.8 483.8A56 56 0 0 1 1204.8 467.4H1202C1195.4 467.4 1190.5 476 1190.5 476L1192 468.1H1178.4L1169.1 523.8H1184.8ZM977.8 512.4A10.7 10.7 0 0 0 989.2 524.5 27.2 27.2 0 0 0 999.9 522.3L1002.1 510.2A30.9 30.9 0 0 1 998.5 510.9C993.5 510.9 992.8 508.1 993.5 506.6L997.9 481.6H1005.7L1007.9 468H1000.8L1002.2 459.5M1012.1 499.5C1012.1 519.5 1018.6 524.5 1029.9 524.5A37 37 0 0 0 1044.9 522.3L1047.8 508.8A42.8 42.8 0 0 1 1032.8 512.3C1017.1 512.3 1019.9 500.9 1019.9 500.9H1049.2A92.5 92.5 0 0 0 1051.3 488.1 19.3 19.3 0 0 0 1030.7 467.4C1015.6 466 1012.1 481.7 1012.1 499.5ZM1029.9 478.8C1037.8 478.8 1039.2 488.1 1039.2 488.8H1020.6C1020.6 488.1 1022.1 478.8 1029.9 478.8ZM1120.6 522.3L1123.4 506.7A35.1 35.1 0 0 1 1111.3 510.2C1101.3 510.2 1097 502.4 1097 493.8 1097 476.7 1105.6 467.4 1115.6 467.4A23.9 23.9 0 0 1 1128.4 471.7L1130.6 456.7A50.2 50.2 0 0 0 1114.2 453.2C1097.8 453.2 1088.5 467.5 1088.5 494.5 1088.5 512.3 1089.9 524.5 1107 524.5A64.1 64.1 0 0 0 1120.6 522.3ZM902.1 481.7A42.2 42.2 0 0 1 917.8 478.8C922.8 478.8 927.1 479.5 927.1 483.8 927.1 486.7 926.4 487.4 926.4 487.4H919.8C907.7 487.4 894.2 492.4 894.2 508.8 894.2 521.7 902.7 524.5 907.7 524.5A21.5 21.5 0 0 0 922.7 518L922 523.7H934.8L940.6 484.4C940.6 468 926.3 467.3 920.6 467.3M931.3 498A23.4 23.4 0 0 1 914.2 511.6 5.6 5.6 0 0 1 908.5 505.8C908.5 502.3 910.6 497.3 921.3 497.3A58.3 58.3 0 0 0 931.4 498.1ZM938.5 522.3A60.4 60.4 0 0 0 954.9 523.8 18.3 18.3 0 0 0 976.3 505.2C976.3 487.4 959.2 490.9 959.2 483.8 959.2 480.2 962.1 478.8 967.1 478.8 969.2 478.8 977.1 479.5 977.1 479.5L979.2 466.7A54.2 54.2 0 0 0 965.7 465.2C955 465.2 951.4 469.6 951.4 483.8 951.4 500.2 962.1 498.8 962.1 505.2 962.1 509.6 957.1 510.2 953.5 510.2M1236.2 473.8A19.8 19.8 0 0 0 1222.7 466.7C1209.8 466.7 1205.5 482.4 1205.5 501 1205.5 512.4 1204.1 524.5 1216.2 524.5A19.1 19.1 0 0 0 1229.8 518.8L1229.1 523.8H1243.4L1254.1 455.3M1235.5 492.4C1235.5 500.3 1229 510.3 1221.2 510.3 1216.2 510.3 1213.4 505.9 1213.4 498.8 1213.4 487.4 1218.4 480.3 1224.8 480.3A10.9 10.9 0 0 1 1235.5 492.4ZM843.6 523.1L852.2 471.7 853.6 523.1H863.6L882.2 471.7 874.3 523.1H889.3L900.7 454.5H882.8L862.9 496.7 862.2 454.5H854.3L830 523.1ZM1049.9 523.1H1064.9C1069.2 499.5 1069.9 480.2 1079.9 483.8A56 56 0 0 1 1084.9 467.4H1082C1075.5 467.4 1070.6 476 1070.6 476L1072.1 468.1M1134.1 481.7A42.2 42.2 0 0 1 1149.8 478.8C1154.8 478.8 1159.1 479.5 1159.1 483.8 1159.1 486.7 1158.4 487.4 1158.4 487.4H1151.9C1139.7 487.4 1126.2 492.4 1126.2 508.8 1126.2 521.7 1134.7 524.5 1139.7 524.5A21.5 21.5 0 0 0 1154.7 518L1154 523.7H1166.9L1172.6 484.4C1172.6 468 1158.3 467.3 1152.6 467.3M1163.3 498A23.4 23.4 0 0 1 1146.2 511.6 5.6 5.6 0 0 1 1140.5 505.8C1140.5 502.3 1142.7 497.3 1153.3 497.3A62.8 62.8 0 0 0 1163.4 498.1ZM1169.8 523.1H1184.8C1189.2 499.5 1189.8 480.2 1199.8 483.8A56.1 56.1 0 0 1 1204.8 467.4H1202C1195.5 467.4 1190.6 476 1190.6 476L1192 468.1M440.6 102.4C438.6 108.2 405 200.6 393.7 231.3H393.7A0.6 0.6 0 0 1 393.7 231.5 15.2 15.2 0 0 1 380.5 241H362.5C373.4 211.2 398.5 142.3 413 102.4ZM734.2 171.7L722.6 203.4A15.5 15.5 0 0 1 709.2 213.3H690A51.2 51.2 0 0 0 694.9 203.4L706.5 171.7H678.7L667.2 203.4A15.6 15.6 0 0 1 653.8 213.3H634.6A50 50 0 0 0 639.5 203.4L651 171.7H623.3L611.7 203.4A15.5 15.5 0 0 1 598.3 213.3H509.7A48.6 48.6 0 0 0 514.7 203.6L517.6 195.5A25.5 25.5 0 0 0 493.7 157.8H462.2L452.1 185.6H483.7A6.7 6.7 0 0 1 490 195.5L486.9 203.6A15.2 15.2 0 0 1 473.5 213.3H427.9L417.8 241H699.4A59 59 0 0 0 750.3 203.6L762 171.7ZM297.1 241H223.8L233.9 213.3H307.2A15.7 15.7 0 0 0 320.7 203.4L323.5 195.5A6.7 6.7 0 0 0 317.2 185.6H271.7L281.8 157.8H327.3A25.5 25.5 0 0 1 351.2 195.5L348.3 203.4A59.6 59.6 0 0 1 297 241M396 561.7L421.6 417.2H461.8L436.9 561.7ZM396 561.7L428.9 417.2H461.8L436.9 561.7ZM582.2 418.9A101.8 101.8 0 0 0 545.2 412.4C505.1 412.4 476.2 432.4 476.2 461.3 476.2 483.1 496.3 494.2 512.3 501.5S533.2 513.5 533.2 519.9C533.2 529.5 520.3 534.4 509.1 534.4A87.2 87.2 0 0 1 470.6 526.3L465 523.9 459.4 556.8A130.1 130.1 0 0 0 505 564.9C547.6 564.9 575.7 544.8 575.7 514.3 575.7 497.5 565.2 484.6 541.1 474.2 526.7 467 517.8 462.9 517.8 455.7 517.8 449.2 525.1 442.9 541.1 442.9A73.6 73.6 0 0 1 571.6 448.5L575.6 450.1 582.1 418.8ZM582.2 418.9A101.8 101.8 0 0 0 545.2 412.4C505.1 412.4 483.4 432.4 483.4 461.3A42 42 0 0 0 512.3 501.5C528.3 508.7 533.2 513.5 533.2 519.9 533.2 529.5 520.3 534.4 509.1 534.4A87.2 87.2 0 0 1 470.6 526.3L465 523.9 459.4 556.8A130.1 130.1 0 0 0 505 564.9C547.6 564.9 575.7 544.8 575.7 514.3 575.7 497.5 565.2 484.6 541.1 474.2 526.7 467 517.8 462.9 517.8 455.7 517.8 449.2 525.1 442.9 541.1 442.9A73.6 73.6 0 0 1 571.6 448.5L575.6 450.1 582.1 418.8ZM651.2 417.2C641.6 417.2 634.3 418 630.3 427.6L570.1 561.7H613.5L621.5 537.6H672.9L677.7 561.7H716.2L682.5 417.2ZM632.7 513.5C635.2 506.3 648.8 471 648.8 471S652 462.1 654.4 456.5L656.8 470.2S664.8 506.3 666.4 514.3H632.7ZM660.8 417.2C651.2 417.2 644 418 640 427.6L570.1 561.7H613.5L621.5 537.6H672.9L677.7 561.7H716.2L682.5 417.2ZM632.7 513.5C636 505.5 648.8 471 648.8 471S652 462.1 654.4 456.5L656.8 470.2S664.8 506.3 666.4 514.3H632.7ZM322.1 518.3L318.1 497.4A116.3 116.3 0 0 0 261.9 434L298 562.4H341.4L406.4 418H363.1ZM322.1 518.3L318.1 497.4A116.3 116.3 0 0 0 261.9 434L298 562.4H341.4L406.4 418H371.1ZM210.6 417.2L217.8 418.8A135.3 135.3 0 0 1 318.1 497.5L303.7 429.2C301.2 419.6 294 417.2 285.2 417.2ZM210.6 417.2H210.6C261.9 429.2 304.5 460.5 318.1 496.7L304.5 439.7A19.6 19.6 0 0 0 285.2 424.5ZM210.6 417.2H210.6C261.9 429.2 304.5 460.5 318.1 496.7L308.5 465.3A28.3 28.3 0 0 0 291.6 442.1ZM362.3 513.5L335 486.2 322.1 516.7 318.9 496.6A116.3 116.3 0 0 0 262.7 433.2L298.8 561.7H342.2ZM436.9 561.7L402.5 526.3 396 561.7ZM529.2 511.9H529.2C532.4 515.1 534 517.5 533.2 520.7 533.2 530.3 520.4 535.2 509.1 535.2A87.2 87.2 0 0 1 470.6 527.2L465 524.7 459.4 557.5A130.1 130.1 0 0 0 505 565.6 79.5 79.5 0 0 0 563.7 545.5ZM575.8 561.7H613.5L621.5 537.6H672.9L677.7 561.7H716.2L702.5 503 654.4 456.4 656.8 469.3S664.8 505.4 666.4 513.4H632.7C635.9 505.4 648.8 470.9 648.8 470.9S652 462 654.4 456.4M745.6 844.7A15.6 15.6 0 0 1 730 829.2V747.1A15.6 15.6 0 0 1 761.2 747.1V829.2A15.6 15.6 0 0 1 745.6 844.7ZM803.2 844.7A15.6 15.6 0 0 1 787.7 829.2V747.1A15.6 15.6 0 1 1 818.8 747.1V829.2A15.6 15.6 0 0 1 803.2 844.7ZM860.9 844.7A15.6 15.6 0 0 1 845.3 829.2V747.1A15.6 15.6 0 1 1 876.4 747.1V829.2A15.6 15.6 0 0 1 860.9 844.7ZM210.1 698.8A18 18 0 0 1 228.3 680.6 18.2 18.2 0 0 1 246.8 698.8 18.4 18.4 0 0 1 228.3 717.3 18.2 18.2 0 0 1 210.1 698.8ZM214.2 740.7A5.1 5.1 0 0 1 219.3 735.6H238A5.1 5.1 0 0 1 243.1 740.7V837.2A5.3 5.3 0 0 1 238 842.3H219.3A5.3 5.3 0 0 1 214.2 837.2ZM260 740.6A5.1 5.1 0 0 1 265.1 735.5H273.8A4.1 4.1 0 0 1 278.1 738.8L282.1 748.7A43.1 43.1 0 0 1 316.5 733.2C350.5 733.2 359.3 756.1 359.3 782V837.2A5.3 5.3 0 0 1 354.2 842.3H335.5A5.1 5.1 0 0 1 330.4 837.2V782C330.4 768.1 324.9 759.6 311.9 759.6A23.5 23.5 0 0 0 288.8 776.2V837.2C288.8 841.2 287.2 842.3 282.1 842.3H265A5.3 5.3 0 0 1 259.9 837.2ZM371.8 835.2A4.7 4.7 0 0 1 370.5 829.4L377.4 815.5A4 4 0 0 1 383.6 813.7 43.2 43.2 0 0 0 407.2 820.6C415.3 820.6 419 817.6 419 813S413 803.7 398.9 798.2C378.3 790.3 369.1 780.6 369.1 764.4S381.3 733.2 407.4 733.2A58.1 58.1 0 0 1 439.1 741.1 6 6 0 0 1 441.4 748.5L435.4 760.7A5.3 5.3 0 0 1 428.7 762.9 51.1 51.1 0 0 0 407.4 757.6C400.3 757.6 397.3 761 397.3 764.5 397.3 769.4 402.6 771.9 412.5 776.1 433 784.4 447.8 791.8 447.8 813 447.8 829.9 433.5 844.9 406.7 844.9A59.7 59.7 0 0 1 371.8 835.2ZM465 761.4H454.6A5.1 5.1 0 0 1 449.7 756.3V740.6A4.8 4.8 0 0 1 454.6 735.5H465V706A5.3 5.3 0 0 1 470.1 700.9H489A4.9 4.9 0 0 1 493.9 706V735.5H518.8A5 5 0 0 1 523.9 740.6V756.3A5.3 5.3 0 0 1 518.8 761.4H493.8V809.6C493.8 816.8 497.3 818.3 502.5 818.3A70.6 70.6 0 0 0 518.7 814.8 4.1 4.1 0 0 1 524.7 817.6L527.7 831.7A5.2 5.2 0 0 1 524.7 837.9 84.4 84.4 0 0 1 494.7 844.9C470.8 844.9 464.8 828.9 464.8 810.4ZM570.3 774.8A78.3 78.3 0 0 1 590.9 777.8C591.3 764.2 587.4 757.7 576.1 757.7A133.7 133.7 0 0 0 546.1 761.7C542.6 762.8 540.5 760.3 540.1 757L537.8 745A4.9 4.9 0 0 1 541.2 738.5 134.9 134.9 0 0 1 577.7 733.2C611 733.2 618 750.6 618 779.6V837.2A5.1 5.1 0 0 1 612.9 842.2H605C603.2 842.2 601.8 841.5 600.4 838.5L597.4 831.4A46.8 46.8 0 0 1 563.9 844.8 34 34 0 0 1 527.8 808.3C527.8 789.4 543.3 774.8 570.3 774.8ZM571 823.3A22.9 22.9 0 0 0 590.2 812V796.3A42.5 42.5 0 0 0 574.5 793.1C562.2 793.1 555.5 798.8 555.5 808.3A14.1 14.1 0 0 0 571 823.4ZM634.1 685.7A5.5 5.5 0 0 1 639.2 680.6H657.9A5.5 5.5 0 0 1 663 685.7V837.2A5.3 5.3 0 0 1 657.9 842.3H639.2A5.3 5.3 0 0 1 634.1 837.2ZM680.3 685.7A5.5 5.5 0 0 1 685.4 680.6H704.1A5.5 5.5 0 0 1 709.2 685.7V837.2A5.3 5.3 0 0 1 704.1 842.3H685.4A5.3 5.3 0 0 1 680.3 837.2ZM944.7 733.2A47.8 47.8 0 0 1 993.7 782.7C993.7 784.3 993.4 788 993.2 789.6A5.4 5.4 0 0 1 988.1 794.5H919.7A25.7 25.7 0 0 0 946.3 819.2 35.4 35.4 0 0 0 969.2 811.4C971.7 809.2 974.5 809.1 976.1 811.4L985.1 823.4A4.5 4.5 0 0 1 984.7 830.3 60.3 60.3 0 0 1 944.9 844.9 55.8 55.8 0 0 1 944.7 733.3ZM964.5 775.5A19.6 19.6 0 0 0 944 757 21.2 21.2 0 0 0 921.3 775.5ZM1002.7 740.6A5.1 5.1 0 0 1 1007.8 735.5H1016.5A4.1 4.1 0 0 1 1020.8 738.8L1024.7 748.7A43.1 43.1 0 0 1 1059.2 733.2C1093.2 733.2 1101.9 756.1 1101.9 782V837.2A5.3 5.3 0 0 1 1096.8 842.3H1078.1A5.1 5.1 0 0 1 1073 837.2V782C1073 768.1 1067.5 759.6 1054.6 759.6A23.5 23.5 0 0 0 1031.5 776.2V837.2C1031.5 841.2 1029.8 842.3 1024.8 842.3H1007.7A5.3 5.3 0 0 1 1002.6 837.2ZM1124 761.4H1113.6A5.1 5.1 0 0 1 1108.7 756.3V740.6A4.8 4.8 0 0 1 1113.6 735.5H1124V706A5.3 5.3 0 0 1 1129.1 700.9H1148A4.9 4.9 0 0 1 1152.9 706V735.5H1177.8A5 5 0 0 1 1182.9 740.6V756.3A5.3 5.3 0 0 1 1177.8 761.4H1152.9V809.6C1152.9 816.8 1156.3 818.3 1161.6 818.3A70.6 70.6 0 0 0 1177.7 814.8 4.1 4.1 0 0 1 1183.7 817.6L1186.7 831.7A5.2 5.2 0 0 1 1183.7 837.9 84.3 84.3 0 0 1 1153.7 844.9C1129.9 844.9 1123.9 828.9 1123.9 810.4ZM1191 835.2A4.7 4.7 0 0 1 1189.6 829.4L1196.5 815.5A4 4 0 0 1 1202.8 813.7 43.2 43.2 0 0 0 1226.3 820.6C1234.4 820.6 1238.1 817.6 1238.1 813S1232.1 803.7 1218 798.2C1197.5 790.3 1188.2 780.6 1188.2 764.4S1200.5 733.2 1226.6 733.2A58.1 58.1 0 0 1 1258.2 741.1 6 6 0 0 1 1260.5 748.5L1254.5 760.7A5.3 5.3 0 0 1 1247.8 762.9 51.1 51.1 0 0 0 1226.6 757.6C1219.4 757.6 1216.4 761 1216.4 764.5 1216.4 769.4 1221.7 771.9 1231.6 776.1 1252.2 784.4 1267 791.8 1267 813 1267 829.9 1252.7 844.9 1225.8 844.9A59.7 59.7 0 0 1 1191 835.2ZM892.2 863A0.8 0.8 0 0 1 893 862.2H901.7A8.9 8.9 0 1 1 901.7 879.9H895.2V889.3A0.8 0.8 0 0 1 894.4 890H892.9A0.8 0.8 0 0 1 892.2 889.3ZM901.6 877A5.9 5.9 0 0 0 907.6 870.9 5.7 5.7 0 0 0 901.6 865.2H895.3V877ZM922.3 871.3A9.6 9.6 0 1 1 913.1 880.8 9.5 9.5 0 0 1 922.3 871.3ZM922.3 887.8A7 7 0 1 0 916 880.8 6.5 6.5 0 0 0 922.3 887.8ZM947.1 876.2L941.7 890A0.7 0.7 0 0 1 940.9 890.5H940.7A0.8 0.8 0 0 1 939.9 890L934.8 872.6C934.6 872 934.8 871.5 935.5 871.5H936.8A0.8 0.8 0 0 1 937.7 872.1L941 884.5H941L946.2 871.5A0.8 0.8 0 0 1 947 871.1H947.2A0.8 0.8 0 0 1 948 871.5L953.1 884.5H953.1L956.5 872A0.7 0.7 0 0 1 957.3 871.5H958.8C959.5 871.5 959.7 871.9 959.5 872.5L954.5 889.9A0.8 0.8 0 0 1 953.7 890.4H953.5A0.9 0.9 0 0 1 952.7 889.9L947.1 876.2ZM971.7 871.3A8.1 8.1 0 0 1 980 879.6 10.1 10.1 0 0 1 980 880.7 0.8 0.8 0 0 1 979.2 881.5H965.8A6.5 6.5 0 0 0 971.8 887.8 8.5 8.5 0 0 0 976.8 886.3C977.5 885.8 977.7 885.7 978.2 886.4L978.7 887C979.1 887.6 979.2 887.8 978.5 888.3A11.3 11.3 0 0 1 971.8 890.5 9.6 9.6 0 0 1 971.8 871.3ZM977.1 879.2A5.4 5.4 0 0 0 971.7 873.9 6 6 0 0 0 965.8 879.2ZM984.7 872.5A0.9 0.9 0 0 1 985.6 871.7H986.2A0.8 0.8 0 0 1 987 872.3L987.3 873.6A7.3 7.3 0 0 1 993 871.3C994.4 871.3 996.6 871.5 996.2 872.7L995.7 874.2A0.7 0.7 0 0 1 994.6 874.6 4.6 4.6 0 0 0 992.6 874.1 5.8 5.8 0 0 0 987.7 876.4V889.2A0.9 0.9 0 0 1 986.8 890H985.6A0.9 0.9 0 0 1 984.7 889.2ZM1007.3 871.3A8.1 8.1 0 0 1 1015.6 879.6 9.8 9.8 0 0 1 1015.6 880.7 0.8 0.8 0 0 1 1014.8 881.5H1001.4A6.5 6.5 0 0 0 1007.4 887.8 8.5 8.5 0 0 0 1012.4 886.3C1013 885.8 1013.3 885.7 1013.8 886.4L1014.3 887C1014.6 887.6 1014.8 887.8 1014.1 888.3A11.3 11.3 0 0 1 1007.4 890.5 9.6 9.6 0 0 1 1007.4 871.3ZM1012.7 879.2A5.4 5.4 0 0 0 1007.3 873.9 6 6 0 0 0 1001.4 879.2ZM1028 871.3A11.3 11.3 0 0 1 1033.1 872.4V863.1A0.9 0.9 0 0 1 1033.9 862.2H1035A1 1 0 0 1 1036 863.1V889.2A0.9 0.9 0 0 1 1035 890H1034.3C1033.9 890 1033.7 889.7 1033.5 889.3L1033.3 888.1A8.8 8.8 0 0 1 1027.5 890.5 9 9 0 0 1 1019.3 880.8 8.7 8.7 0 0 1 1028 871.3ZM1027.9 887.8A6.8 6.8 0 0 0 1033.1 884.8V875A12.1 12.1 0 0 0 1028.4 873.9 6.3 6.3 0 0 0 1022.2 880.8 6.4 6.4 0 0 0 1027.9 887.8ZM1051.7 863.1A0.9 0.9 0 0 1 1052.6 862.2H1053.8A0.9 0.9 0 0 1 1054.6 863.1V872.4A11.1 11.1 0 0 1 1059.7 871.3 8.7 8.7 0 0 1 1068.4 880.8 9 9 0 0 1 1060.2 890.5 8 8 0 0 1 1054.4 888.1L1054.2 889.3A0.8 0.8 0 0 1 1053.3 890H1052.6A0.9 0.9 0 0 1 1051.8 889.2ZM1059.8 887.8A6.3 6.3 0 0 0 1065.4 880.8 6.3 6.3 0 0 0 1059.3 873.9 10.9 10.9 0 0 0 1054.6 875.1V884.8A6.8 6.8 0 0 0 1059.7 887.8ZM1071.1 872.7C1070.8 872.1 1071.1 871.7 1071.8 871.7H1073.5A0.8 0.8 0 0 1 1074.3 872.2L1079.5 886.8H1079.5L1085.7 872.2A0.8 0.8 0 0 1 1086.5 871.7H1088C1088.7 871.7 1089 872.1 1088.7 872.7L1077.2 898.9A1 1 0 0 1 1076.4 899.5H1075C1074.3 899.5 1073.9 899 1074.2 898.4L1077.8 890ZM1102.1 863A0.8 0.8 0 0 1 1102.8 862.2H1111.5A8.9 8.9 0 1 1 1111.5 879.9H1105V889.3A0.8 0.8 0 0 1 1104.3 890H1102.8A0.8 0.8 0 0 1 1102 889.3ZM1111.4 877A5.9 5.9 0 0 0 1117.5 870.9 5.7 5.7 0 0 0 1111.4 865.2H1105.1V877ZM1120.4 889L1132.5 862.2A0.7 0.7 0 0 1 1133.2 861.8H1133.6A0.7 0.7 0 0 1 1134.2 862.2L1146.2 889A0.7 0.7 0 0 1 1145.6 890H1144A0.7 0.7 0 0 1 1143.3 889.6L1140.4 883H1126.3L1123.4 889.6A0.7 0.7 0 0 1 1122.7 890H1121.1A0.7 0.7 0 0 1 1120.4 889ZM1139.3 880.6C1137.3 876.2 1135.4 871.9 1133.5 867.5H1133.2L1127.3 880.6ZM1154.2 876.7L1144.6 863.4A0.7 0.7 0 0 1 1145.2 862.3H1147.1A0.8 0.8 0 0 1 1147.7 862.6L1155.8 873.7 1163.8 862.6A0.8 0.8 0 0 1 1164.4 862.3H1166.3A0.7 0.7 0 0 1 1166.9 863.4L1157.2 876.7V889.3A0.8 0.8 0 0 1 1156.5 890.1H1154.9A0.8 0.8 0 0 1 1154.2 889.3ZM1171 863A0.8 0.8 0 0 1 1171.7 862.2H1187.4A0.8 0.8 0 0 1 1188.1 863V864.1A0.8 0.8 0 0 1 1187.4 864.9H1174V875.7H1185.4A0.8 0.8 0 0 1 1186.2 876.5V877.7A0.8 0.8 0 0 1 1185.4 878.4H1174V889.3A0.8 0.8 0 0 1 1173.3 890H1171.7A0.8 0.8 0 0 1 1171 889.3ZM1205.5 861.8A14.3 14.3 0 1 1 1191.2 876.2 14.3 14.3 0 0 1 1205.5 861.8ZM1205.5 887.6A11.5 11.5 0 1 0 1194 876.2 11.5 11.5 0 0 0 1205.5 887.6ZM1225.6 863A0.8 0.8 0 0 1 1226.4 862.2H1236.7A8.5 8.5 0 0 1 1245.3 870.7 8.9 8.9 0 0 1 1239.5 878.8L1244.9 888.8A0.8 0.8 0 0 1 1244.2 890H1242.3A0.8 0.8 0 0 1 1241.4 889.4L1236.3 879.1H1228.7V889.3A0.8 0.8 0 0 1 1227.9 890H1226.4A0.8 0.8 0 0 1 1225.6 889.3ZM1236.5 876.5A5.7 5.7 0 1 0 1236.5 865.1H1228.8V876.5ZM1256.1 864.9H1249.2A0.8 0.8 0 0 1 1248.4 864.1V863A0.8 0.8 0 0 1 1249.2 862.2H1266A0.8 0.8 0 0 1 1266.8 863V864.1A0.8 0.8 0 0 1 1266 864.9H1259.1V889.3A0.8 0.8 0 0 1 1258.3 890H1256.8A0.8 0.8 0 0 1 1256.1 889.3Z", + "width": 1478 + }, + "search": [ + "online_payment_icon" + ] + }, + { + "uid": "3238628d101e2f79eeaaf407332b3052", + "css": "vital_sign_icon", + "code": 59405, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M1145 758.4A14.1 14.1 0 0 0 1130.9 772.5 51.9 51.9 0 0 1 1079 824.3H275.7A51.9 51.9 0 0 1 223.9 772.4V232.3A51.9 51.9 0 0 1 275.7 180.5H725.2A14.1 14.1 0 0 0 725.2 152.2H275.7A80.2 80.2 0 0 0 195.7 232.3V772.4A80.2 80.2 0 0 0 275.7 852.5H1079A80.2 80.2 0 0 0 1159.1 772.4 14.1 14.1 0 0 0 1145 758.4ZM1079 152.2H792.5A14.1 14.1 0 0 0 792.5 180.4H1079A51.9 51.9 0 0 1 1130.8 232.3V704.7A14.1 14.1 0 0 0 1159.1 704.7V232.3A80.2 80.2 0 0 0 1079 152.2ZM907.5 585V300.1A36.8 36.8 0 0 0 870.8 263.3H477A14.1 14.1 0 1 0 477 291.6H870.7A8.5 8.5 0 0 1 879.2 300.1V421.1H821.6L799.2 398.7A19.8 19.8 0 0 0 771.2 398.7L712 458 689.3 435.3A19.8 19.8 0 0 0 661.3 435.3L622.9 473.6 521.1 371.8A19.8 19.8 0 0 0 493.1 371.8L443.8 421.1H352.5V300.1A8.5 8.5 0 0 1 361 291.6H406.6A14.1 14.1 0 1 0 406.6 263.3H361A36.8 36.8 0 0 0 324.2 300.1V585A36.8 36.8 0 0 0 361 621.8H870.7A36.8 36.8 0 0 0 907.5 585ZM352.6 585V449.3H447.3A19.6 19.6 0 0 0 461.3 443.5L507.1 397.8 608.9 499.6A19.8 19.8 0 0 0 636.9 499.6L675.2 461.2 697.9 484A19.8 19.8 0 0 0 725.9 484L785.2 424.7 804 443.6A19.6 19.6 0 0 0 818 449.4H879.2V585.1A8.5 8.5 0 0 1 870.7 593.5H361.1A8.5 8.5 0 0 1 352.6 585.1ZM637.6 716.5A57.6 57.6 0 1 0 695.2 658.9 57.7 57.7 0 0 0 637.6 716.5ZM724.5 716.5A29.3 29.3 0 1 1 695.2 687.2 29.4 29.4 0 0 1 724.5 716.5ZM431.7 696.3A57.6 57.6 0 1 0 431.7 736.6 57.6 57.6 0 1 0 431.7 696.3ZM377.8 745.8A29.3 29.3 0 1 1 407.1 716.5 29.4 29.4 0 0 1 377.8 745.8ZM515 716.5A29.3 29.3 0 1 1 485.7 687.2 29.4 29.4 0 0 1 515 716.5Z", + "width": 1348 + }, + "search": [ + "vital_sign_icon" + ] + }, + { + "uid": "e714a92298dafff5fead849df18d449b", + "css": "weight_icon", + "code": 59406, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M491.7 0A263 263 0 0 1 716.9 127Q794.5 140.1 882.6 162A131.3 131.3 0 0 1 982.2 303.3L922.3 881.9A132 132 0 0 1 791.4 1000.1H191.9A131.6 131.6 0 0 1 61 881.9L1.1 303.2A118.4 118.4 0 0 1 100.7 162Q184.1 141.4 266.3 127A263 263 0 0 1 491.7 0ZM240.1 185.1Q151.9 203.4 113.1 212.9A79.2 79.2 0 0 0 53.5 297.7L113.4 876.5A79.8 79.8 0 0 0 191.9 947.3H791.7A80.5 80.5 0 0 0 870.2 876.5L929.9 297.7A78.8 78.8 0 0 0 870.1 212.9Q817.9 200.2 743.1 185.2A253.9 253.9 0 0 1 754.8 263.2 263.1 263.1 0 0 1 228.5 263.2 252.6 252.6 0 0 1 240.1 185.1ZM491.7 52.5A210.5 210.5 0 1 0 702.2 263.1 211.1 211.1 0 0 0 491.7 52.5ZM491.7 105.1A27 27 0 0 1 518 131.3V262.9A26.3 26.3 0 0 1 491.7 289.2 25.9 25.9 0 0 1 465.4 262.9V131.6A26.3 26.3 0 0 1 491.7 105.1Z", + "width": 983 + }, + "search": [ + "weight_icon" + ] + }, + { + "uid": "48c8955311a2a09660e070396941b78b", + "css": "search_medicine_icon", + "code": 59404, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M442.2 620.3A223.9 223.9 0 1 0 369.1 547.3L195.7 720.8 268.7 793.8ZM559.5 240.6A189.3 189.3 0 1 1 370.2 429.9 189.5 189.5 0 0 1 559.5 240.6ZM389.7 575.4A226.8 226.8 0 0 0 414 599.7L377.3 636.5 353 612.1ZM328.7 636.5L353 660.8 268.7 745.1 244.3 720.8ZM328.7 636.5M571.7 515.1L644.7 442.1A68.8 68.8 0 1 0 547.4 344.7L474.3 417.7A68.8 68.8 0 1 0 571.7 515.1ZM571.7 369.1A34.4 34.4 0 0 1 620.4 417.7L596 442.1 547.4 393.4ZM498.7 442.1L523 417.7 571.7 466.4 547.4 490.8A34.4 34.4 0 0 1 498.7 442.1ZM498.7 442.1", + "width": 1000 + }, + "search": [ + "search_medicine_icon" + ] + }, + { + "uid": "2cfd058dc6a521015f26957251d5f9dd", + "css": "my_medical_file", + "code": 59407, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M730.5 105.5H609.8A88.9 88.9 0 0 0 531.4 58.6H469.3A78.1 78.1 0 0 0 318.2 58.6H256.1A88.9 88.9 0 0 0 177.7 105.5H58.6A58.8 58.8 0 0 0 0 164.1V941.6A58.8 58.8 0 0 0 58.6 1000.1H730.6A58.8 58.8 0 0 0 789.1 941.6V164.1A58.8 58.8 0 0 0 730.5 105.5ZM206.1 147.4A49.8 49.8 0 0 1 256 97.6H335A19.6 19.6 0 0 0 354.6 78.1 39.1 39.1 0 1 1 432.7 78.1 19.6 19.6 0 0 0 452.2 97.6H531.3A50 50 0 0 1 578.2 130.6C578.2 130.8 578.4 131 578.4 131.4A49.6 49.6 0 0 1 581.3 147.7V178.3A21 21 0 0 1 560.2 199.4H227.3A21 21 0 0 1 206.3 178.3ZM656.1 238.3V869.7H133.4V238.3ZM750 941.6A19.6 19.6 0 0 1 730.5 961.1H58.4A19.6 19.6 0 0 1 38.9 941.6V164.1A19.6 19.6 0 0 1 58.4 144.5H167V178.1A58.6 58.6 0 0 0 171 199.2H113.7A19.6 19.6 0 0 0 94.2 218.7V889.1A19.6 19.6 0 0 0 113.7 908.6H675.7A19.6 19.6 0 0 0 695.2 889.1V218.7A19.6 19.6 0 0 0 675.7 199.4H616.4A58.6 58.6 0 0 0 620.3 178.3V144.7H730.5A19.6 19.6 0 0 1 750 164.2ZM407.3 111.1A19.3 19.3 0 0 0 393.4 105.5 20.5 20.5 0 0 0 379.5 111.1 19.3 19.3 0 0 0 373.9 125 20.5 20.5 0 0 0 379.5 138.9 19.3 19.3 0 0 0 393.4 144.5 20.5 20.5 0 0 0 407.3 138.9 19.8 19.8 0 0 0 407.3 111.1ZM500 753.9H209.6A19.5 19.5 0 1 0 209.6 793H500A19.5 19.5 0 1 0 500 753.9ZM593 759.6A19.3 19.3 0 0 0 579.1 753.9 20.2 20.2 0 0 0 565.2 759.6 19.3 19.3 0 0 0 559.6 773.4 20.2 20.2 0 0 0 565.2 787.3 19.3 19.3 0 0 0 579.1 793 20.2 20.2 0 0 0 593 787.3 19.8 19.8 0 0 0 593 759.6ZM579.5 675.8H209.6A19.5 19.5 0 0 0 209.6 714.8H579.5A19.5 19.5 0 0 0 579.5 675.8ZM511.9 616.4H275.6A40.3 40.3 0 0 1 235.4 576.2V339.8A40.3 40.3 0 0 1 275.6 299.6H511.9A40.3 40.3 0 0 1 552.2 339.8V576.2A40.6 40.6 0 0 1 511.9 616.4ZM300.6 564.7L359.7 564.9C367.1 564.9 372.6 557.2 373 546.4V497.1C373 486.2 377.9 478.3 385.1 477.7L403.2 477.5C410.4 477.9 415.5 486.1 415.5 496.9V546.5C415.9 557.2 420.9 564.5 427.9 564.5L507.6 564.6 507.7 503.5C507.7 492.8 502.6 484.7 495.4 484.3L463.5 484.2C456.1 484.2 450.8 476.5 450.6 465.8L450.4 449.1C450.8 438.5 456.3 430.7 463.5 430.7H495.7C502.6 430.3 507.8 421.9 507.8 411.1V335.3A32.2 32.2 0 0 1 483.3 350.6H429.1C421.7 350.6 416.2 358.6 415.8 369.1V418.2C415.4 428.9 410 436.6 402.9 436.6L386.6 436.4C379.2 436.4 373.9 428.8 373.4 418.3V368.9C373 358.2 367.7 350.8 360.4 350.8H281.8V411.7C281.8 422.8 286.9 430.7 294.2 431.1L326.4 430.9C333.4 431.3 338.9 439.8 338.9 450.4V464.5C338.9 475.3 333.7 483.4 326.6 483.8H294.4C287 484.4 282.1 492.3 282.1 503.2L281.7 564.6Z", + "width": 789 + }, + "search": [ + "my_medical_file" + ] + }, + { + "uid": "40c03b22028e1b34f230c522b40ca125", + "css": "family", + "code": 59408, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M1255.3 571.5A27.7 27.7 0 0 0 1211.5 605.3 207.6 207.6 0 0 1 1255 733.1 27.7 27.7 0 1 0 1310.4 733.1 262.5 262.5 0 0 0 1255.3 571.5ZM1162.3 385.9A210.9 210.9 0 1 0 926.7 385.9 364.6 364.6 0 0 0 813.6 448.4 155.5 155.5 0 0 0 597.6 448.4 364.8 364.8 0 0 0 484.5 385.9 210.9 210.9 0 1 0 248.9 385.9 367.5 367.5 0 0 0 0 732.4C0 732.6 0 732.8 0 733.1 0 775.5 24.1 838.2 139.1 895.7A1060.2 1060.2 0 0 0 464.8 984.6 1904.1 1904.1 0 0 0 946.5 984.6 1059.9 1059.9 0 0 0 1272.3 895.7C1387.3 838.3 1411.4 775.6 1411.4 733.1A367.5 367.5 0 0 0 1162.3 385.9ZM889 211A155.5 155.5 0 1 1 1044.5 366.5 155.5 155.5 0 0 1 889.1 210.9ZM623 503.3A100.5 100.5 0 0 1 788.2 503.3H788.2A100.5 100.5 0 1 1 623 503.3ZM211.1 210.9A155.5 155.5 0 1 1 366.6 366.4 155.5 155.5 0 0 1 211.1 210.9ZM440.8 925.4A960.1 960.1 0 0 1 163.9 846.2C94.1 811.3 55.5 771.3 55.5 733.4 55.5 733.4 55.5 733.4 55.5 733.1A311.3 311.3 0 0 1 565.3 493.2 155.8 155.8 0 0 0 606.4 680.5 265.2 265.2 0 0 0 440.8 925.4ZM915.2 932.8A1857 1857 0 0 1 496.1 932.8V926A209.5 209.5 0 0 1 915.2 926ZM1247.4 846.2A959.9 959.9 0 0 1 970.5 925.4 265.3 265.3 0 0 0 805.1 680.3 155.7 155.7 0 0 0 846.2 493 311.3 311.3 0 0 1 1356 732.9C1356 771.1 1317.4 811.2 1247.4 846.2ZM1172.6 506.5A27.7 27.7 0 0 0 1172.6 561.8 27.7 27.7 0 0 0 1172.6 506.5Z", + "width": 1411 + }, + "search": [ + "family" + ] + }, + { + "uid": "28e30de5c20857758e187ef8e56eddc1", + "css": "calendar-(2)", + "code": 59409, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M544.9 710.9A78.2 78.2 0 0 0 623 789H714.9A78.2 78.2 0 0 0 793 710.9V619.1A78.2 78.2 0 0 0 714.8 541H623A78.2 78.2 0 0 0 544.9 619.1ZM623 619.1H714.9V710.9H623ZM961 687.5A39 39 0 0 0 1000 648.5V234.4A156.4 156.4 0 0 0 843.8 78.1H793V39A39 39 0 0 0 714.8 39V78.1H537.1V39A39 39 0 1 0 459 39V78.1H283.2V39A39 39 0 1 0 205 39V78.1H156.3A156.4 156.4 0 0 0 0 234.4V843.8A156.4 156.4 0 0 0 156.3 1000H843.8A156.4 156.4 0 0 0 1000 843.8 39 39 0 0 0 921.9 843.8 78.2 78.2 0 0 1 843.7 921.9H156.3A78.2 78.2 0 0 1 78.1 843.8V234.4A78.2 78.2 0 0 1 156.3 156.3H205.1V195.5A39 39 0 0 0 283.2 195.5V156.3H459.1V195.5A39 39 0 0 0 537.2 195.5V156.3H715V195.5A39 39 0 0 0 793.1 195.5V156.3H843.9A78.2 78.2 0 0 1 922 234.4V648.5A39 39 0 0 0 961 687.5Z", + "width": 1000 + }, + "search": [ + "calendar-(2)" + ] + } + ] +} \ No newline at end of file diff --git a/assets/app_icons/fonts/DQIcons.ttf b/assets/app_icons/fonts/DQIcons.ttf new file mode 100644 index 00000000..3cff7aa3 Binary files /dev/null and b/assets/app_icons/fonts/DQIcons.ttf differ diff --git a/assets/fonts/DoctorApp.ttf b/assets/fonts/DoctorApp.ttf new file mode 100644 index 00000000..718a3afc Binary files /dev/null and b/assets/fonts/DoctorApp.ttf differ diff --git a/assets/fonts/Work_Sans/OFL.txt b/assets/fonts/Work_Sans/OFL.txt new file mode 100644 index 00000000..5c0354eb --- /dev/null +++ b/assets/fonts/Work_Sans/OFL.txt @@ -0,0 +1,93 @@ +Copyright (c) 2014-2015 Wei Huang (wweeiihhuuaanngg@gmail.com) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/assets/fonts/Work_Sans/WorkSans-Black.ttf b/assets/fonts/Work_Sans/WorkSans-Black.ttf new file mode 100644 index 00000000..fb744206 Binary files /dev/null and b/assets/fonts/Work_Sans/WorkSans-Black.ttf differ diff --git a/assets/fonts/Work_Sans/WorkSans-Bold.ttf b/assets/fonts/Work_Sans/WorkSans-Bold.ttf new file mode 100644 index 00000000..7caa3595 Binary files /dev/null and b/assets/fonts/Work_Sans/WorkSans-Bold.ttf differ diff --git a/assets/fonts/Work_Sans/WorkSans-ExtraBold.ttf b/assets/fonts/Work_Sans/WorkSans-ExtraBold.ttf new file mode 100644 index 00000000..fd4b9120 Binary files /dev/null and b/assets/fonts/Work_Sans/WorkSans-ExtraBold.ttf differ diff --git a/assets/fonts/Work_Sans/WorkSans-ExtraLight.ttf b/assets/fonts/Work_Sans/WorkSans-ExtraLight.ttf new file mode 100644 index 00000000..b97cf8cf Binary files /dev/null and b/assets/fonts/Work_Sans/WorkSans-ExtraLight.ttf differ diff --git a/assets/fonts/Work_Sans/WorkSans-Light.ttf b/assets/fonts/Work_Sans/WorkSans-Light.ttf new file mode 100644 index 00000000..3e981fb3 Binary files /dev/null and b/assets/fonts/Work_Sans/WorkSans-Light.ttf differ diff --git a/assets/fonts/Work_Sans/WorkSans-Medium.ttf b/assets/fonts/Work_Sans/WorkSans-Medium.ttf new file mode 100644 index 00000000..7a2645ba Binary files /dev/null and b/assets/fonts/Work_Sans/WorkSans-Medium.ttf differ diff --git a/assets/fonts/Work_Sans/WorkSans-Regular.ttf b/assets/fonts/Work_Sans/WorkSans-Regular.ttf new file mode 100644 index 00000000..0ac4520a Binary files /dev/null and b/assets/fonts/Work_Sans/WorkSans-Regular.ttf differ diff --git a/assets/fonts/Work_Sans/WorkSans-SemiBold.ttf b/assets/fonts/Work_Sans/WorkSans-SemiBold.ttf new file mode 100644 index 00000000..589a5f53 Binary files /dev/null and b/assets/fonts/Work_Sans/WorkSans-SemiBold.ttf differ diff --git a/assets/fonts/Work_Sans/WorkSans-Thin.ttf b/assets/fonts/Work_Sans/WorkSans-Thin.ttf new file mode 100644 index 00000000..011fcd38 Binary files /dev/null and b/assets/fonts/Work_Sans/WorkSans-Thin.ttf differ diff --git a/assets/fonts/ar/Cairo-Bold/Cairo-Bold.eot b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.eot new file mode 100644 index 00000000..ed5f0c34 Binary files /dev/null and b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.eot differ diff --git a/assets/fonts/ar/Cairo-Bold/Cairo-Bold.otf b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.otf new file mode 100644 index 00000000..8bc25fbb Binary files /dev/null and b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.otf differ diff --git a/assets/fonts/ar/Cairo-Bold/Cairo-Bold.ttf b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.ttf new file mode 100644 index 00000000..4f026897 Binary files /dev/null and b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.ttf differ diff --git a/assets/fonts/ar/Cairo-Bold/Cairo-Bold.woff b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.woff new file mode 100644 index 00000000..91e3d063 Binary files /dev/null and b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.woff differ diff --git a/assets/fonts/ar/Cairo-Light/Cairo-Light.eot b/assets/fonts/ar/Cairo-Light/Cairo-Light.eot new file mode 100644 index 00000000..d76c5391 Binary files /dev/null and b/assets/fonts/ar/Cairo-Light/Cairo-Light.eot differ diff --git a/assets/fonts/ar/Cairo-Light/Cairo-Light.otf b/assets/fonts/ar/Cairo-Light/Cairo-Light.otf new file mode 100644 index 00000000..f8812a9c Binary files /dev/null and b/assets/fonts/ar/Cairo-Light/Cairo-Light.otf differ diff --git a/assets/fonts/ar/Cairo-Light/Cairo-Light.ttf b/assets/fonts/ar/Cairo-Light/Cairo-Light.ttf new file mode 100644 index 00000000..840cbc3e Binary files /dev/null and b/assets/fonts/ar/Cairo-Light/Cairo-Light.ttf differ diff --git a/assets/fonts/ar/Cairo-Light/Cairo-Light.woff b/assets/fonts/ar/Cairo-Light/Cairo-Light.woff new file mode 100644 index 00000000..9534bb4b Binary files /dev/null and b/assets/fonts/ar/Cairo-Light/Cairo-Light.woff differ diff --git a/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.eot b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.eot new file mode 100644 index 00000000..98bc2468 Binary files /dev/null and b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.eot differ diff --git a/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.otf b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.otf new file mode 100644 index 00000000..73f8bf0a Binary files /dev/null and b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.otf differ diff --git a/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.ttf b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.ttf new file mode 100644 index 00000000..177a3b67 Binary files /dev/null and b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.ttf differ diff --git a/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.woff b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.woff new file mode 100644 index 00000000..8d7013cd Binary files /dev/null and b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.woff differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.eot b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.eot new file mode 100644 index 00000000..9541e418 Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.eot differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.otf b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.otf new file mode 100644 index 00000000..be5e0ac4 Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.otf differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.ttf b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.ttf new file mode 100644 index 00000000..0b010ade Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.ttf differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.woff b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.woff new file mode 100644 index 00000000..12226d75 Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.woff differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Regular.otf b/assets/fonts/en/WorkSans-Light/WorkSans-Regular.otf new file mode 100644 index 00000000..be88832e Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Regular.otf differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Regular.ttf b/assets/fonts/en/WorkSans-Light/WorkSans-Regular.ttf new file mode 100644 index 00000000..0ac4520a Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Regular.ttf differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Regular.woff b/assets/fonts/en/WorkSans-Light/WorkSans-Regular.woff new file mode 100644 index 00000000..89af38b8 Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Regular.woff differ diff --git a/assets/images/AlHabibMedicalService/Wifi-AR.png b/assets/images/AlHabibMedicalService/Wifi-AR.png new file mode 100644 index 00000000..a8e2d9af Binary files /dev/null and b/assets/images/AlHabibMedicalService/Wifi-AR.png differ diff --git a/assets/images/BloodChrt_EN.png b/assets/images/BloodChrt_EN.png new file mode 100644 index 00000000..ac52957d Binary files /dev/null and b/assets/images/BloodChrt_EN.png differ diff --git a/assets/images/CloseIcon.png b/assets/images/CloseIcon.png new file mode 100644 index 00000000..b8e68fea Binary files /dev/null and b/assets/images/CloseIcon.png differ diff --git a/assets/images/DQ/DQ_logo.png b/assets/images/DQ/DQ_logo.png new file mode 100644 index 00000000..993a1bd3 Binary files /dev/null and b/assets/images/DQ/DQ_logo.png differ diff --git a/assets/images/DQ/dq_logo_icon.png b/assets/images/DQ/dq_logo_icon.png new file mode 100644 index 00000000..71626bd8 Binary files /dev/null and b/assets/images/DQ/dq_logo_icon.png differ diff --git a/assets/images/Dr_Schedule_report.png b/assets/images/Dr_Schedule_report.png new file mode 100644 index 00000000..9519f719 Binary files /dev/null and b/assets/images/Dr_Schedule_report.png differ diff --git a/assets/images/Icon-awesome-calendar.png b/assets/images/Icon-awesome-calendar.png new file mode 100644 index 00000000..f058ca77 Binary files /dev/null and b/assets/images/Icon-awesome-calendar.png differ diff --git a/assets/images/SmartWatches/Apple-Watch-6.png b/assets/images/SmartWatches/Apple-Watch-6.png new file mode 100644 index 00000000..1e670506 Binary files /dev/null and b/assets/images/SmartWatches/Apple-Watch-6.png differ diff --git a/assets/images/SmartWatches/apple-watch-1.jpeg b/assets/images/SmartWatches/apple-watch-1.jpeg new file mode 100644 index 00000000..7262e7eb Binary files /dev/null and b/assets/images/SmartWatches/apple-watch-1.jpeg differ diff --git a/assets/images/SmartWatches/apple-watch-2.jpg b/assets/images/SmartWatches/apple-watch-2.jpg new file mode 100644 index 00000000..f688f740 Binary files /dev/null and b/assets/images/SmartWatches/apple-watch-2.jpg differ diff --git a/assets/images/SmartWatches/apple-watch-3.jpg b/assets/images/SmartWatches/apple-watch-3.jpg new file mode 100644 index 00000000..b68c1ced Binary files /dev/null and b/assets/images/SmartWatches/apple-watch-3.jpg differ diff --git a/assets/images/SmartWatches/apple-watch-4.jpg b/assets/images/SmartWatches/apple-watch-4.jpg new file mode 100644 index 00000000..2fc19b67 Binary files /dev/null and b/assets/images/SmartWatches/apple-watch-4.jpg differ diff --git a/assets/images/SmartWatches/apple-watch-5.jpg b/assets/images/SmartWatches/apple-watch-5.jpg new file mode 100644 index 00000000..4c497eac Binary files /dev/null and b/assets/images/SmartWatches/apple-watch-5.jpg differ diff --git a/assets/images/SmartWatches/fossil-sport.png b/assets/images/SmartWatches/fossil-sport.png new file mode 100644 index 00000000..207bbbe3 Binary files /dev/null and b/assets/images/SmartWatches/fossil-sport.png differ diff --git a/assets/images/SmartWatches/heartrate_icon.png b/assets/images/SmartWatches/heartrate_icon.png new file mode 100644 index 00000000..e228bea4 Binary files /dev/null and b/assets/images/SmartWatches/heartrate_icon.png differ diff --git a/assets/images/SmartWatches/huawei-watch-2-classic.png b/assets/images/SmartWatches/huawei-watch-2-classic.png new file mode 100644 index 00000000..0dc44cb6 Binary files /dev/null and b/assets/images/SmartWatches/huawei-watch-2-classic.png differ diff --git a/assets/images/SmartWatches/huawei-watch-2.png b/assets/images/SmartWatches/huawei-watch-2.png new file mode 100644 index 00000000..61530239 Binary files /dev/null and b/assets/images/SmartWatches/huawei-watch-2.png differ diff --git a/assets/images/SmartWatches/lg-watch-sport.jpg b/assets/images/SmartWatches/lg-watch-sport.jpg new file mode 100644 index 00000000..bd2f25ed Binary files /dev/null and b/assets/images/SmartWatches/lg-watch-sport.jpg differ diff --git a/assets/images/SmartWatches/miBand3.jpg b/assets/images/SmartWatches/miBand3.jpg new file mode 100644 index 00000000..c58f85e5 Binary files /dev/null and b/assets/images/SmartWatches/miBand3.jpg differ diff --git a/assets/images/SmartWatches/miBand4.jpg b/assets/images/SmartWatches/miBand4.jpg new file mode 100644 index 00000000..519ef5fb Binary files /dev/null and b/assets/images/SmartWatches/miBand4.jpg differ diff --git a/assets/images/SmartWatches/misfit-vapor-2.jpg b/assets/images/SmartWatches/misfit-vapor-2.jpg new file mode 100644 index 00000000..fe487591 Binary files /dev/null and b/assets/images/SmartWatches/misfit-vapor-2.jpg differ diff --git a/assets/images/SmartWatches/sleep_data.png b/assets/images/SmartWatches/sleep_data.png new file mode 100644 index 00000000..dc6661d6 Binary files /dev/null and b/assets/images/SmartWatches/sleep_data.png differ diff --git a/assets/images/SmartWatches/ticwatche2.png b/assets/images/SmartWatches/ticwatche2.png new file mode 100644 index 00000000..5ad3d308 Binary files /dev/null and b/assets/images/SmartWatches/ticwatche2.png differ diff --git a/assets/images/Weather_ico.png b/assets/images/Weather_ico.png new file mode 100644 index 00000000..2e00ae8c Binary files /dev/null and b/assets/images/Weather_ico.png differ diff --git a/assets/images/Weather_img.png b/assets/images/Weather_img.png new file mode 100644 index 00000000..57901477 Binary files /dev/null and b/assets/images/Weather_img.png differ diff --git a/assets/images/Wifi-AR.png b/assets/images/Wifi-AR.png new file mode 100644 index 00000000..a8e2d9af Binary files /dev/null and b/assets/images/Wifi-AR.png differ diff --git a/assets/images/al-habib_online_payment_service_icon.png b/assets/images/al-habib_online_payment_service_icon.png new file mode 100644 index 00000000..4056bca6 Binary files /dev/null and b/assets/images/al-habib_online_payment_service_icon.png differ diff --git a/assets/images/al-habib_onlne_pharmacy_bg.png b/assets/images/al-habib_onlne_pharmacy_bg.png new file mode 100644 index 00000000..d8809570 Binary files /dev/null and b/assets/images/al-habib_onlne_pharmacy_bg.png differ diff --git a/assets/images/appointment_booking.png b/assets/images/appointment_booking.png new file mode 100644 index 00000000..14db8d89 Binary files /dev/null and b/assets/images/appointment_booking.png differ diff --git a/assets/images/appointment_booking_en.png b/assets/images/appointment_booking_en.png new file mode 100644 index 00000000..14db8d89 Binary files /dev/null and b/assets/images/appointment_booking_en.png differ diff --git a/assets/images/ask_doctor.png b/assets/images/ask_doctor.png new file mode 100644 index 00000000..f74ac6a8 Binary files /dev/null and b/assets/images/ask_doctor.png differ diff --git a/assets/images/ask_doctor_bg.png b/assets/images/ask_doctor_bg.png new file mode 100644 index 00000000..16e8e9d7 Binary files /dev/null and b/assets/images/ask_doctor_bg.png differ diff --git a/assets/images/bg_graphic.png b/assets/images/bg_graphic.png new file mode 100644 index 00000000..01525404 Binary files /dev/null and b/assets/images/bg_graphic.png differ diff --git a/assets/images/blood-drop.png b/assets/images/blood-drop.png new file mode 100644 index 00000000..a981e3d3 Binary files /dev/null and b/assets/images/blood-drop.png differ diff --git a/assets/images/blood_icon.png b/assets/images/blood_icon.png new file mode 100644 index 00000000..9e1b4468 Binary files /dev/null and b/assets/images/blood_icon.png differ diff --git a/assets/images/book_appointment_ar.png b/assets/images/book_appointment_ar.png new file mode 100644 index 00000000..f0bc5aff Binary files /dev/null and b/assets/images/book_appointment_ar.png differ diff --git a/assets/images/book_appointment_arabic.png b/assets/images/book_appointment_arabic.png new file mode 100644 index 00000000..f0bc5aff Binary files /dev/null and b/assets/images/book_appointment_arabic.png differ diff --git a/assets/images/booking_ar.png b/assets/images/booking_ar.png new file mode 100644 index 00000000..b562f288 Binary files /dev/null and b/assets/images/booking_ar.png differ diff --git a/assets/images/booking_en.png b/assets/images/booking_en.png new file mode 100644 index 00000000..a3ffa8be Binary files /dev/null and b/assets/images/booking_en.png differ diff --git a/assets/images/check-in.png b/assets/images/check-in.png new file mode 100644 index 00000000..f6effbeb Binary files /dev/null and b/assets/images/check-in.png differ diff --git a/assets/images/comments.png b/assets/images/comments.png new file mode 100644 index 00000000..353edf4e Binary files /dev/null and b/assets/images/comments.png differ diff --git a/assets/images/comprehensive_medical_checkup_logo.png b/assets/images/comprehensive_medical_checkup_logo.png new file mode 100644 index 00000000..15e4ac04 Binary files /dev/null and b/assets/images/comprehensive_medical_checkup_logo.png differ diff --git a/assets/images/contact_us_bg.png b/assets/images/contact_us_bg.png new file mode 100644 index 00000000..40564039 Binary files /dev/null and b/assets/images/contact_us_bg.png differ diff --git a/assets/images/covid-car.png b/assets/images/covid-car.png new file mode 100644 index 00000000..01090b74 Binary files /dev/null and b/assets/images/covid-car.png differ diff --git a/assets/images/covid_bg_transparent.png b/assets/images/covid_bg_transparent.png new file mode 100644 index 00000000..cd5f12f1 Binary files /dev/null and b/assets/images/covid_bg_transparent.png differ diff --git a/assets/images/cs_logo_container.png b/assets/images/cs_logo_container.png new file mode 100644 index 00000000..5f938580 Binary files /dev/null and b/assets/images/cs_logo_container.png differ diff --git a/assets/images/dashboard_top_bg.png b/assets/images/dashboard_top_bg.png new file mode 100644 index 00000000..98b4c943 Binary files /dev/null and b/assets/images/dashboard_top_bg.png differ diff --git a/assets/images/device_icon.png b/assets/images/device_icon.png new file mode 100644 index 00000000..8ad55c09 Binary files /dev/null and b/assets/images/device_icon.png differ diff --git a/assets/images/dq_home_page_bg_image.png b/assets/images/dq_home_page_bg_image.png new file mode 100644 index 00000000..f70df2ae Binary files /dev/null and b/assets/images/dq_home_page_bg_image.png differ diff --git a/assets/images/emergency_service_image.png b/assets/images/emergency_service_image.png new file mode 100644 index 00000000..4dbcb7d6 Binary files /dev/null and b/assets/images/emergency_service_image.png differ diff --git a/assets/images/ereferral_service_icon.png b/assets/images/ereferral_service_icon.png new file mode 100644 index 00000000..a47b7f36 Binary files /dev/null and b/assets/images/ereferral_service_icon.png differ diff --git a/assets/images/female_face.png b/assets/images/female_face.png new file mode 100644 index 00000000..be8ed225 Binary files /dev/null and b/assets/images/female_face.png differ diff --git a/assets/images/habib-logo.png b/assets/images/habib-logo.png new file mode 100644 index 00000000..bcb6a42b Binary files /dev/null and b/assets/images/habib-logo.png differ diff --git a/assets/images/heartbeat.png b/assets/images/heartbeat.png new file mode 100644 index 00000000..3a83ddee Binary files /dev/null and b/assets/images/heartbeat.png differ diff --git a/assets/images/height_icon.png b/assets/images/height_icon.png new file mode 100644 index 00000000..cca88ac0 Binary files /dev/null and b/assets/images/height_icon.png differ diff --git a/assets/images/hmg_services_bg .png b/assets/images/hmg_services_bg .png new file mode 100644 index 00000000..508f9a0d Binary files /dev/null and b/assets/images/hmg_services_bg .png differ diff --git a/assets/images/home_health_care_icon.png b/assets/images/home_health_care_icon.png new file mode 100644 index 00000000..d80ec015 Binary files /dev/null and b/assets/images/home_health_care_icon.png differ diff --git a/assets/images/home_healthcare_service_bg.png b/assets/images/home_healthcare_service_bg.png new file mode 100644 index 00000000..2765b47e Binary files /dev/null and b/assets/images/home_healthcare_service_bg.png differ diff --git a/assets/images/id_card_icon.png b/assets/images/id_card_icon.png new file mode 100644 index 00000000..96650604 Binary files /dev/null and b/assets/images/id_card_icon.png differ diff --git a/assets/images/livecare_white_logo.png b/assets/images/livecare_white_logo.png new file mode 100644 index 00000000..dc223965 Binary files /dev/null and b/assets/images/livecare_white_logo.png differ diff --git a/assets/images/login/101.png b/assets/images/login/101.png new file mode 100644 index 00000000..90c1c575 Binary files /dev/null and b/assets/images/login/101.png differ diff --git a/assets/images/login/102.png b/assets/images/login/102.png new file mode 100644 index 00000000..8502d197 Binary files /dev/null and b/assets/images/login/102.png differ diff --git a/assets/images/login/103.png b/assets/images/login/103.png new file mode 100644 index 00000000..3326814b Binary files /dev/null and b/assets/images/login/103.png differ diff --git a/assets/images/login/104.png b/assets/images/login/104.png new file mode 100644 index 00000000..ad55ff74 Binary files /dev/null and b/assets/images/login/104.png differ diff --git a/assets/images/login/fileNum.png b/assets/images/login/fileNum.png new file mode 100644 index 00000000..386299b7 Binary files /dev/null and b/assets/images/login/fileNum.png differ diff --git a/assets/images/login/forget.png b/assets/images/login/forget.png new file mode 100644 index 00000000..57aa7ccc Binary files /dev/null and b/assets/images/login/forget.png differ diff --git a/assets/images/login/id.png b/assets/images/login/id.png new file mode 100644 index 00000000..9260cf11 Binary files /dev/null and b/assets/images/login/id.png differ diff --git a/assets/images/login/more_icon.png b/assets/images/login/more_icon.png new file mode 100644 index 00000000..b696d345 Binary files /dev/null and b/assets/images/login/more_icon.png differ diff --git a/assets/images/login/nationalID.png b/assets/images/login/nationalID.png new file mode 100644 index 00000000..5779d562 Binary files /dev/null and b/assets/images/login/nationalID.png differ diff --git a/assets/images/logo.png b/assets/images/logo.png new file mode 100644 index 00000000..0d9e4a56 Binary files /dev/null and b/assets/images/logo.png differ diff --git a/assets/images/male_face.png b/assets/images/male_face.png new file mode 100644 index 00000000..7adf335a Binary files /dev/null and b/assets/images/male_face.png differ diff --git a/assets/images/medical/BMR_calculator.png b/assets/images/medical/BMR_calculator.png new file mode 100644 index 00000000..2c32b80d Binary files /dev/null and b/assets/images/medical/BMR_calculator.png differ diff --git a/assets/images/medical/active_medications.png b/assets/images/medical/active_medications.png new file mode 100644 index 00000000..67122598 Binary files /dev/null and b/assets/images/medical/active_medications.png differ diff --git a/assets/images/medical/ask_doctor_icon.png b/assets/images/medical/ask_doctor_icon.png new file mode 100644 index 00000000..bcb1f279 Binary files /dev/null and b/assets/images/medical/ask_doctor_icon.png differ diff --git a/assets/images/medical/blood_cholesterol_icon.png b/assets/images/medical/blood_cholesterol_icon.png new file mode 100644 index 00000000..3f1ab216 Binary files /dev/null and b/assets/images/medical/blood_cholesterol_icon.png differ diff --git a/assets/images/medical/blood_sugar_icon.png b/assets/images/medical/blood_sugar_icon.png new file mode 100644 index 00000000..6c9e8133 Binary files /dev/null and b/assets/images/medical/blood_sugar_icon.png differ diff --git a/assets/images/medical/bmi_health_calculator.png b/assets/images/medical/bmi_health_calculator.png new file mode 100644 index 00000000..2eb49440 Binary files /dev/null and b/assets/images/medical/bmi_health_calculator.png differ diff --git a/assets/images/medical/body_fat.png b/assets/images/medical/body_fat.png new file mode 100644 index 00000000..3dd36150 Binary files /dev/null and b/assets/images/medical/body_fat.png differ diff --git a/assets/images/medical/body_weight.png b/assets/images/medical/body_weight.png new file mode 100644 index 00000000..d1f0b324 Binary files /dev/null and b/assets/images/medical/body_weight.png differ diff --git a/assets/images/medical/calories-calculator.png b/assets/images/medical/calories-calculator.png new file mode 100644 index 00000000..e9d72554 Binary files /dev/null and b/assets/images/medical/calories-calculator.png differ diff --git a/assets/images/medical/carb_protein.png b/assets/images/medical/carb_protein.png new file mode 100644 index 00000000..eb6c6640 Binary files /dev/null and b/assets/images/medical/carb_protein.png differ diff --git a/assets/images/medical/check-in.png b/assets/images/medical/check-in.png new file mode 100644 index 00000000..f6effbeb Binary files /dev/null and b/assets/images/medical/check-in.png differ diff --git a/assets/images/medical/delivery_date_icon.png b/assets/images/medical/delivery_date_icon.png new file mode 100644 index 00000000..d578be34 Binary files /dev/null and b/assets/images/medical/delivery_date_icon.png differ diff --git a/assets/images/medical/doctor_icon.png b/assets/images/medical/doctor_icon.png new file mode 100644 index 00000000..02b3b9fa Binary files /dev/null and b/assets/images/medical/doctor_icon.png differ diff --git a/assets/images/medical/eye_measurement_icon.png b/assets/images/medical/eye_measurement_icon.png new file mode 100644 index 00000000..ca0c5d4b Binary files /dev/null and b/assets/images/medical/eye_measurement_icon.png differ diff --git a/assets/images/medical/insurance_approvals_icon.png b/assets/images/medical/insurance_approvals_icon.png new file mode 100644 index 00000000..11a00256 Binary files /dev/null and b/assets/images/medical/insurance_approvals_icon.png differ diff --git a/assets/images/medical/insurance_card_icon.png b/assets/images/medical/insurance_card_icon.png new file mode 100644 index 00000000..6fa5b5bf Binary files /dev/null and b/assets/images/medical/insurance_card_icon.png differ diff --git a/assets/images/medical/insurance_update_icon_.png b/assets/images/medical/insurance_update_icon_.png new file mode 100644 index 00000000..0001bcd2 Binary files /dev/null and b/assets/images/medical/insurance_update_icon_.png differ diff --git a/assets/images/medical/lab_result_icon.png b/assets/images/medical/lab_result_icon.png new file mode 100644 index 00000000..c9425278 Binary files /dev/null and b/assets/images/medical/lab_result_icon.png differ diff --git a/assets/images/medical/medical_history_icon.png b/assets/images/medical/medical_history_icon.png new file mode 100644 index 00000000..9a820f12 Binary files /dev/null and b/assets/images/medical/medical_history_icon.png differ diff --git a/assets/images/medical/medical_reports_icon.png b/assets/images/medical/medical_reports_icon.png new file mode 100644 index 00000000..ad9c9f7b Binary files /dev/null and b/assets/images/medical/medical_reports_icon.png differ diff --git a/assets/images/medical/monthly_reports_icon.png b/assets/images/medical/monthly_reports_icon.png new file mode 100644 index 00000000..5d51e24c Binary files /dev/null and b/assets/images/medical/monthly_reports_icon.png differ diff --git a/assets/images/medical/my_allergies_icon.png b/assets/images/medical/my_allergies_icon.png new file mode 100644 index 00000000..689b5321 Binary files /dev/null and b/assets/images/medical/my_allergies_icon.png differ diff --git a/assets/images/medical/my_appointment_icon.png b/assets/images/medical/my_appointment_icon.png new file mode 100644 index 00000000..f5e4c7d4 Binary files /dev/null and b/assets/images/medical/my_appointment_icon.png differ diff --git a/assets/images/medical/my_tracker_icon.png b/assets/images/medical/my_tracker_icon.png new file mode 100644 index 00000000..1d46b859 Binary files /dev/null and b/assets/images/medical/my_tracker_icon.png differ diff --git a/assets/images/medical/my_vaccines_icon.png b/assets/images/medical/my_vaccines_icon.png new file mode 100644 index 00000000..23a7352b Binary files /dev/null and b/assets/images/medical/my_vaccines_icon.png differ diff --git a/assets/images/medical/ovulation_period_icon.png b/assets/images/medical/ovulation_period_icon.png new file mode 100644 index 00000000..c9a075d3 Binary files /dev/null and b/assets/images/medical/ovulation_period_icon.png differ diff --git a/assets/images/medical/prescription_icon.png b/assets/images/medical/prescription_icon.png new file mode 100644 index 00000000..1d40e95d Binary files /dev/null and b/assets/images/medical/prescription_icon.png differ diff --git a/assets/images/medical/radiology_icon.png b/assets/images/medical/radiology_icon.png new file mode 100644 index 00000000..9e760d65 Binary files /dev/null and b/assets/images/medical/radiology_icon.png differ diff --git a/assets/images/medical/sick_leaves_icons.png b/assets/images/medical/sick_leaves_icons.png new file mode 100644 index 00000000..67a9c937 Binary files /dev/null and b/assets/images/medical/sick_leaves_icons.png differ diff --git a/assets/images/medical/smartwatch_icon.png b/assets/images/medical/smartwatch_icon.png new file mode 100644 index 00000000..c43fe468 Binary files /dev/null and b/assets/images/medical/smartwatch_icon.png differ diff --git a/assets/images/medical/triglycerides_blood_icon.png b/assets/images/medical/triglycerides_blood_icon.png new file mode 100644 index 00000000..b3bebf9e Binary files /dev/null and b/assets/images/medical/triglycerides_blood_icon.png differ diff --git a/assets/images/medical/vital_sign_icon.png b/assets/images/medical/vital_sign_icon.png new file mode 100644 index 00000000..fbd0908b Binary files /dev/null and b/assets/images/medical/vital_sign_icon.png differ diff --git a/assets/images/medical/vital_signs.png b/assets/images/medical/vital_signs.png new file mode 100644 index 00000000..7b642d6e Binary files /dev/null and b/assets/images/medical/vital_signs.png differ diff --git a/assets/images/my_file_white_icon.png b/assets/images/my_file_white_icon.png new file mode 100644 index 00000000..6bd9b935 Binary files /dev/null and b/assets/images/my_file_white_icon.png differ diff --git a/assets/images/new-design/AM.PNG b/assets/images/new-design/AM.PNG new file mode 100644 index 00000000..212ca0b1 Binary files /dev/null and b/assets/images/new-design/AM.PNG differ diff --git a/assets/images/new-design/BMR_calculator.png b/assets/images/new-design/BMR_calculator.png new file mode 100644 index 00000000..2c32b80d Binary files /dev/null and b/assets/images/new-design/BMR_calculator.png differ diff --git a/assets/images/new-design/Complaint_icon.png b/assets/images/new-design/Complaint_icon.png new file mode 100644 index 00000000..42af40c2 Binary files /dev/null and b/assets/images/new-design/Complaint_icon.png differ diff --git a/assets/images/new-design/Invoice.png b/assets/images/new-design/Invoice.png new file mode 100644 index 00000000..f109717e Binary files /dev/null and b/assets/images/new-design/Invoice.png differ diff --git a/assets/images/new-design/active_medications.png b/assets/images/new-design/active_medications.png new file mode 100644 index 00000000..67122598 Binary files /dev/null and b/assets/images/new-design/active_medications.png differ diff --git a/assets/images/new-design/add_user_icon.png b/assets/images/new-design/add_user_icon.png new file mode 100644 index 00000000..b8a1d795 Binary files /dev/null and b/assets/images/new-design/add_user_icon.png differ diff --git a/assets/images/new-design/advance_payment.png b/assets/images/new-design/advance_payment.png new file mode 100644 index 00000000..2889e6fc Binary files /dev/null and b/assets/images/new-design/advance_payment.png differ diff --git a/assets/images/new-design/alert-triangle.png b/assets/images/new-design/alert-triangle.png new file mode 100644 index 00000000..5d8d7f25 Binary files /dev/null and b/assets/images/new-design/alert-triangle.png differ diff --git a/assets/images/new-design/alert_top-bar_icon.png b/assets/images/new-design/alert_top-bar_icon.png new file mode 100644 index 00000000..c275fca9 Binary files /dev/null and b/assets/images/new-design/alert_top-bar_icon.png differ diff --git a/assets/images/new-design/alert_top-bar_icon_red.png b/assets/images/new-design/alert_top-bar_icon_red.png new file mode 100644 index 00000000..881ab3ac Binary files /dev/null and b/assets/images/new-design/alert_top-bar_icon_red.png differ diff --git a/assets/images/new-design/allergiesDetails.png b/assets/images/new-design/allergiesDetails.png new file mode 100644 index 00000000..fc268c9c Binary files /dev/null and b/assets/images/new-design/allergiesDetails.png differ diff --git a/assets/images/new-design/ambulance.png b/assets/images/new-design/ambulance.png new file mode 100644 index 00000000..7d8a26c8 Binary files /dev/null and b/assets/images/new-design/ambulance.png differ diff --git a/assets/images/new-design/appointment_booking.png b/assets/images/new-design/appointment_booking.png new file mode 100644 index 00000000..14db8d89 Binary files /dev/null and b/assets/images/new-design/appointment_booking.png differ diff --git a/assets/images/new-design/appointment_info.png b/assets/images/new-design/appointment_info.png new file mode 100644 index 00000000..9f2b8c50 Binary files /dev/null and b/assets/images/new-design/appointment_info.png differ diff --git a/assets/images/new-design/arrow.png b/assets/images/new-design/arrow.png new file mode 100644 index 00000000..19af7c0b Binary files /dev/null and b/assets/images/new-design/arrow.png differ diff --git a/assets/images/new-design/arrow_black.png b/assets/images/new-design/arrow_black.png new file mode 100644 index 00000000..c2132d3e Binary files /dev/null and b/assets/images/new-design/arrow_black.png differ diff --git a/assets/images/new-design/arrow_menu_black-ar.png b/assets/images/new-design/arrow_menu_black-ar.png new file mode 100644 index 00000000..8774a535 Binary files /dev/null and b/assets/images/new-design/arrow_menu_black-ar.png differ diff --git a/assets/images/new-design/arrow_menu_black-en.png b/assets/images/new-design/arrow_menu_black-en.png new file mode 100644 index 00000000..0cd426dc Binary files /dev/null and b/assets/images/new-design/arrow_menu_black-en.png differ diff --git a/assets/images/new-design/arrow_menu_red.png b/assets/images/new-design/arrow_menu_red.png new file mode 100644 index 00000000..de7639ea Binary files /dev/null and b/assets/images/new-design/arrow_menu_red.png differ diff --git a/assets/images/new-design/arrow_white.png b/assets/images/new-design/arrow_white.png new file mode 100644 index 00000000..0c2fa7a4 Binary files /dev/null and b/assets/images/new-design/arrow_white.png differ diff --git a/assets/images/new-design/ask_doctor_icon.png b/assets/images/new-design/ask_doctor_icon.png new file mode 100644 index 00000000..bcb1f279 Binary files /dev/null and b/assets/images/new-design/ask_doctor_icon.png differ diff --git a/assets/images/new-design/attach-prescription.png b/assets/images/new-design/attach-prescription.png new file mode 100644 index 00000000..fc1b649b Binary files /dev/null and b/assets/images/new-design/attach-prescription.png differ diff --git a/assets/images/new-design/available_vaccines_to_bar.png b/assets/images/new-design/available_vaccines_to_bar.png new file mode 100644 index 00000000..b988355f Binary files /dev/null and b/assets/images/new-design/available_vaccines_to_bar.png differ diff --git a/assets/images/new-design/awesome-plus.png b/assets/images/new-design/awesome-plus.png new file mode 100644 index 00000000..78e432a5 Binary files /dev/null and b/assets/images/new-design/awesome-plus.png differ diff --git a/assets/images/new-design/awesome-star.png b/assets/images/new-design/awesome-star.png new file mode 100644 index 00000000..36153c59 Binary files /dev/null and b/assets/images/new-design/awesome-star.png differ diff --git a/assets/images/new-design/blood_cholesterol_icon.png b/assets/images/new-design/blood_cholesterol_icon.png new file mode 100644 index 00000000..3f1ab216 Binary files /dev/null and b/assets/images/new-design/blood_cholesterol_icon.png differ diff --git a/assets/images/new-design/blood_icon.png b/assets/images/new-design/blood_icon.png new file mode 100644 index 00000000..6d1a0c10 Binary files /dev/null and b/assets/images/new-design/blood_icon.png differ diff --git a/assets/images/new-design/blood_pressure_icon.png b/assets/images/new-design/blood_pressure_icon.png new file mode 100644 index 00000000..0d622094 Binary files /dev/null and b/assets/images/new-design/blood_pressure_icon.png differ diff --git a/assets/images/new-design/blood_sugar_icon.png b/assets/images/new-design/blood_sugar_icon.png new file mode 100644 index 00000000..6c9e8133 Binary files /dev/null and b/assets/images/new-design/blood_sugar_icon.png differ diff --git a/assets/images/new-design/blood_type.png b/assets/images/new-design/blood_type.png new file mode 100644 index 00000000..c0e09ae4 Binary files /dev/null and b/assets/images/new-design/blood_type.png differ diff --git a/assets/images/new-design/bmi_health_calculator.png b/assets/images/new-design/bmi_health_calculator.png new file mode 100644 index 00000000..2eb49440 Binary files /dev/null and b/assets/images/new-design/bmi_health_calculator.png differ diff --git a/assets/images/new-design/body_fat.png b/assets/images/new-design/body_fat.png new file mode 100644 index 00000000..3dd36150 Binary files /dev/null and b/assets/images/new-design/body_fat.png differ diff --git a/assets/images/new-design/body_icon.png b/assets/images/new-design/body_icon.png new file mode 100644 index 00000000..b9a70b2b Binary files /dev/null and b/assets/images/new-design/body_icon.png differ diff --git a/assets/images/new-design/body_mass.png b/assets/images/new-design/body_mass.png new file mode 100644 index 00000000..01cebfb8 Binary files /dev/null and b/assets/images/new-design/body_mass.png differ diff --git a/assets/images/new-design/body_mass_icon.png b/assets/images/new-design/body_mass_icon.png new file mode 100644 index 00000000..c93a31cb Binary files /dev/null and b/assets/images/new-design/body_mass_icon.png differ diff --git a/assets/images/new-design/body_weight.png b/assets/images/new-design/body_weight.png new file mode 100644 index 00000000..d1f0b324 Binary files /dev/null and b/assets/images/new-design/body_weight.png differ diff --git a/assets/images/new-design/book_appointment_arabic.png b/assets/images/new-design/book_appointment_arabic.png new file mode 100644 index 00000000..f0bc5aff Binary files /dev/null and b/assets/images/new-design/book_appointment_arabic.png differ diff --git a/assets/images/new-design/booking_icon.png b/assets/images/new-design/booking_icon.png new file mode 100644 index 00000000..8693a1fe Binary files /dev/null and b/assets/images/new-design/booking_icon.png differ diff --git a/assets/images/new-design/booking_icon_active.png b/assets/images/new-design/booking_icon_active.png new file mode 100644 index 00000000..0a829d81 Binary files /dev/null and b/assets/images/new-design/booking_icon_active.png differ diff --git a/assets/images/new-design/calendar.png b/assets/images/new-design/calendar.png new file mode 100644 index 00000000..ac72b030 Binary files /dev/null and b/assets/images/new-design/calendar.png differ diff --git a/assets/images/new-design/calendar_reminder_black_icon.svg b/assets/images/new-design/calendar_reminder_black_icon.svg new file mode 100644 index 00000000..8885e241 --- /dev/null +++ b/assets/images/new-design/calendar_reminder_black_icon.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/images/new-design/calendar_reminder_red_icon.svg b/assets/images/new-design/calendar_reminder_red_icon.svg new file mode 100644 index 00000000..a4116252 --- /dev/null +++ b/assets/images/new-design/calendar_reminder_red_icon.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/images/new-design/calender-secondary.png b/assets/images/new-design/calender-secondary.png new file mode 100644 index 00000000..a790849d Binary files /dev/null and b/assets/images/new-design/calender-secondary.png differ diff --git a/assets/images/new-design/call.png b/assets/images/new-design/call.png new file mode 100644 index 00000000..cf6713cb Binary files /dev/null and b/assets/images/new-design/call.png differ diff --git a/assets/images/new-design/calories-calculator.png b/assets/images/new-design/calories-calculator.png new file mode 100644 index 00000000..e9d72554 Binary files /dev/null and b/assets/images/new-design/calories-calculator.png differ diff --git a/assets/images/new-design/cancel.png b/assets/images/new-design/cancel.png new file mode 100644 index 00000000..5aa51245 Binary files /dev/null and b/assets/images/new-design/cancel.png differ diff --git a/assets/images/new-design/cancel_icon.png b/assets/images/new-design/cancel_icon.png new file mode 100644 index 00000000..499170c4 Binary files /dev/null and b/assets/images/new-design/cancel_icon.png differ diff --git a/assets/images/new-design/carb_protein.png b/assets/images/new-design/carb_protein.png new file mode 100644 index 00000000..eb6c6640 Binary files /dev/null and b/assets/images/new-design/carb_protein.png differ diff --git a/assets/images/new-design/chat_with_us_icon.png b/assets/images/new-design/chat_with_us_icon.png new file mode 100644 index 00000000..6d2af727 Binary files /dev/null and b/assets/images/new-design/chat_with_us_icon.png differ diff --git a/assets/images/new-design/check-icon.png b/assets/images/new-design/check-icon.png new file mode 100644 index 00000000..669a4975 Binary files /dev/null and b/assets/images/new-design/check-icon.png differ diff --git a/assets/images/new-design/check-in.png b/assets/images/new-design/check-in.png new file mode 100644 index 00000000..f6effbeb Binary files /dev/null and b/assets/images/new-design/check-in.png differ diff --git a/assets/images/new-design/check_icon.png b/assets/images/new-design/check_icon.png new file mode 100644 index 00000000..c098b175 Binary files /dev/null and b/assets/images/new-design/check_icon.png differ diff --git a/assets/images/new-design/children_vaccines_icon.png b/assets/images/new-design/children_vaccines_icon.png new file mode 100644 index 00000000..c52e3b8b Binary files /dev/null and b/assets/images/new-design/children_vaccines_icon.png differ diff --git a/assets/images/new-design/clinic-wayfinding-2.png b/assets/images/new-design/clinic-wayfinding-2.png new file mode 100644 index 00000000..5ac63738 Binary files /dev/null and b/assets/images/new-design/clinic-wayfinding-2.png differ diff --git a/assets/images/new-design/close_icon.png b/assets/images/new-design/close_icon.png new file mode 100644 index 00000000..58b10630 Binary files /dev/null and b/assets/images/new-design/close_icon.png differ diff --git a/assets/images/new-design/confirm_appointment_icon.png b/assets/images/new-design/confirm_appointment_icon.png new file mode 100644 index 00000000..9918f4d5 Binary files /dev/null and b/assets/images/new-design/confirm_appointment_icon.png differ diff --git a/assets/images/new-design/confirm_button.png b/assets/images/new-design/confirm_button.png new file mode 100644 index 00000000..fc4c8587 Binary files /dev/null and b/assets/images/new-design/confirm_button.png differ diff --git a/assets/images/new-design/confirm_icon.png b/assets/images/new-design/confirm_icon.png new file mode 100644 index 00000000..d4b72de3 Binary files /dev/null and b/assets/images/new-design/confirm_icon.png differ diff --git a/assets/images/new-design/connect_to_internet_icon.png b/assets/images/new-design/connect_to_internet_icon.png new file mode 100644 index 00000000..14e7758a Binary files /dev/null and b/assets/images/new-design/connect_to_internet_icon.png differ diff --git a/assets/images/new-design/covid-19-big-banner-bg.png b/assets/images/new-design/covid-19-big-banner-bg.png new file mode 100644 index 00000000..a66d6815 Binary files /dev/null and b/assets/images/new-design/covid-19-big-banner-bg.png differ diff --git a/assets/images/new-design/covid_bg_transparent.png b/assets/images/new-design/covid_bg_transparent.png new file mode 100644 index 00000000..cd5f12f1 Binary files /dev/null and b/assets/images/new-design/covid_bg_transparent.png differ diff --git a/assets/images/new-design/cs_logo.png b/assets/images/new-design/cs_logo.png new file mode 100644 index 00000000..fa03e4f9 Binary files /dev/null and b/assets/images/new-design/cs_logo.png differ diff --git a/assets/images/new-design/delivery_date_icon.png b/assets/images/new-design/delivery_date_icon.png new file mode 100644 index 00000000..d578be34 Binary files /dev/null and b/assets/images/new-design/delivery_date_icon.png differ diff --git a/assets/images/new-design/device_icon.png b/assets/images/new-design/device_icon.png new file mode 100644 index 00000000..8ad55c09 Binary files /dev/null and b/assets/images/new-design/device_icon.png differ diff --git a/assets/images/new-design/discount_offers.png b/assets/images/new-design/discount_offers.png new file mode 100644 index 00000000..dd4a0d05 Binary files /dev/null and b/assets/images/new-design/discount_offers.png differ diff --git a/assets/images/new-design/doctor_book_physical_appointment.png b/assets/images/new-design/doctor_book_physical_appointment.png new file mode 100644 index 00000000..16458b29 Binary files /dev/null and b/assets/images/new-design/doctor_book_physical_appointment.png differ diff --git a/assets/images/new-design/doctor_information_icon.png b/assets/images/new-design/doctor_information_icon.png new file mode 100644 index 00000000..cb210a97 Binary files /dev/null and b/assets/images/new-design/doctor_information_icon.png differ diff --git a/assets/images/new-design/doctor_qualification_icon.png b/assets/images/new-design/doctor_qualification_icon.png new file mode 100644 index 00000000..29225e6d Binary files /dev/null and b/assets/images/new-design/doctor_qualification_icon.png differ diff --git a/assets/images/new-design/doctor_video.png b/assets/images/new-design/doctor_video.png new file mode 100644 index 00000000..0e63b22d Binary files /dev/null and b/assets/images/new-design/doctor_video.png differ diff --git a/assets/images/new-design/download_pharmacy_app.png b/assets/images/new-design/download_pharmacy_app.png new file mode 100644 index 00000000..89c64085 Binary files /dev/null and b/assets/images/new-design/download_pharmacy_app.png differ diff --git a/assets/images/new-design/emergency_icon.png b/assets/images/new-design/emergency_icon.png new file mode 100644 index 00000000..8c5ccd85 Binary files /dev/null and b/assets/images/new-design/emergency_icon.png differ diff --git a/assets/images/new-design/emergency_videocall_icon.png b/assets/images/new-design/emergency_videocall_icon.png new file mode 100644 index 00000000..0f67e245 Binary files /dev/null and b/assets/images/new-design/emergency_videocall_icon.png differ diff --git a/assets/images/new-design/envelop_icon.png b/assets/images/new-design/envelop_icon.png new file mode 100644 index 00000000..86f21eb5 Binary files /dev/null and b/assets/images/new-design/envelop_icon.png differ diff --git a/assets/images/new-design/facebook.png b/assets/images/new-design/facebook.png new file mode 100644 index 00000000..cb93d64a Binary files /dev/null and b/assets/images/new-design/facebook.png differ diff --git a/assets/images/new-design/family_icon_bottom_bar.png b/assets/images/new-design/family_icon_bottom_bar.png new file mode 100644 index 00000000..f6be8edf Binary files /dev/null and b/assets/images/new-design/family_icon_bottom_bar.png differ diff --git a/assets/images/new-design/family_member_icon_active.png b/assets/images/new-design/family_member_icon_active.png new file mode 100644 index 00000000..5806c872 Binary files /dev/null and b/assets/images/new-design/family_member_icon_active.png differ diff --git a/assets/images/new-design/family_member_icon_inactive.png b/assets/images/new-design/family_member_icon_inactive.png new file mode 100644 index 00000000..59f6c912 Binary files /dev/null and b/assets/images/new-design/family_member_icon_inactive.png differ diff --git a/assets/images/new-design/family_menu_icon_red.png b/assets/images/new-design/family_menu_icon_red.png new file mode 100644 index 00000000..7d55094e Binary files /dev/null and b/assets/images/new-design/family_menu_icon_red.png differ diff --git a/assets/images/new-design/feedback_icon.png b/assets/images/new-design/feedback_icon.png new file mode 100644 index 00000000..138ce41d Binary files /dev/null and b/assets/images/new-design/feedback_icon.png differ diff --git a/assets/images/new-design/female.png b/assets/images/new-design/female.png new file mode 100644 index 00000000..29cf8c98 Binary files /dev/null and b/assets/images/new-design/female.png differ diff --git a/assets/images/new-design/female_face.png b/assets/images/new-design/female_face.png new file mode 100644 index 00000000..be8ed225 Binary files /dev/null and b/assets/images/new-design/female_face.png differ diff --git a/assets/images/new-design/find_us_icon.png b/assets/images/new-design/find_us_icon.png new file mode 100644 index 00000000..d2666cd4 Binary files /dev/null and b/assets/images/new-design/find_us_icon.png differ diff --git a/assets/images/new-design/garbage.png b/assets/images/new-design/garbage.png new file mode 100644 index 00000000..b0d48797 Binary files /dev/null and b/assets/images/new-design/garbage.png differ diff --git a/assets/images/new-design/generate_visit_ticket.png b/assets/images/new-design/generate_visit_ticket.png new file mode 100644 index 00000000..5d250853 Binary files /dev/null and b/assets/images/new-design/generate_visit_ticket.png differ diff --git a/assets/images/new-design/health_calculator_general.png b/assets/images/new-design/health_calculator_general.png new file mode 100644 index 00000000..2cc02679 Binary files /dev/null and b/assets/images/new-design/health_calculator_general.png differ diff --git a/assets/images/new-design/health_calculator_icon.png b/assets/images/new-design/health_calculator_icon.png new file mode 100644 index 00000000..f2a3fcfb Binary files /dev/null and b/assets/images/new-design/health_calculator_icon.png differ diff --git a/assets/images/new-design/health_calculator_women.png b/assets/images/new-design/health_calculator_women.png new file mode 100644 index 00000000..2c292444 Binary files /dev/null and b/assets/images/new-design/health_calculator_women.png differ diff --git a/assets/images/new-design/health_convertor_icon.png b/assets/images/new-design/health_convertor_icon.png new file mode 100644 index 00000000..903a490c Binary files /dev/null and b/assets/images/new-design/health_convertor_icon.png differ diff --git a/assets/images/new-design/heart_icon.png b/assets/images/new-design/heart_icon.png new file mode 100644 index 00000000..1cf02faf Binary files /dev/null and b/assets/images/new-design/heart_icon.png differ diff --git a/assets/images/new-design/height.png b/assets/images/new-design/height.png new file mode 100644 index 00000000..718f8a5d Binary files /dev/null and b/assets/images/new-design/height.png differ diff --git a/assets/images/new-design/height_icon.png b/assets/images/new-design/height_icon.png new file mode 100644 index 00000000..cca88ac0 Binary files /dev/null and b/assets/images/new-design/height_icon.png differ diff --git a/assets/images/new-design/history_icon.png b/assets/images/new-design/history_icon.png new file mode 100644 index 00000000..8ef33358 Binary files /dev/null and b/assets/images/new-design/history_icon.png differ diff --git a/assets/images/new-design/hmg_full_logo.png b/assets/images/new-design/hmg_full_logo.png new file mode 100644 index 00000000..1449d28d Binary files /dev/null and b/assets/images/new-design/hmg_full_logo.png differ diff --git a/assets/images/new-design/hmg_full_logo_hd_white.png b/assets/images/new-design/hmg_full_logo_hd_white.png new file mode 100644 index 00000000..e4d7ae60 Binary files /dev/null and b/assets/images/new-design/hmg_full_logo_hd_white.png differ diff --git a/assets/images/new-design/hmg_services.png b/assets/images/new-design/hmg_services.png new file mode 100644 index 00000000..5892dd84 Binary files /dev/null and b/assets/images/new-design/hmg_services.png differ diff --git a/assets/images/new-design/hmg_services_ar.png b/assets/images/new-design/hmg_services_ar.png new file mode 100644 index 00000000..da5a5085 Binary files /dev/null and b/assets/images/new-design/hmg_services_ar.png differ diff --git a/assets/images/new-design/home_bottom_bar.png b/assets/images/new-design/home_bottom_bar.png new file mode 100644 index 00000000..49f4e84a Binary files /dev/null and b/assets/images/new-design/home_bottom_bar.png differ diff --git a/assets/images/new-design/home_bottom_bar_active.png b/assets/images/new-design/home_bottom_bar_active.png new file mode 100644 index 00000000..ce642d0b Binary files /dev/null and b/assets/images/new-design/home_bottom_bar_active.png differ diff --git a/assets/images/new-design/hospital_address_icon.png b/assets/images/new-design/hospital_address_icon.png new file mode 100644 index 00000000..8f151087 Binary files /dev/null and b/assets/images/new-design/hospital_address_icon.png differ diff --git a/assets/images/new-design/icon_check_list.png b/assets/images/new-design/icon_check_list.png new file mode 100644 index 00000000..1fc5ab3e Binary files /dev/null and b/assets/images/new-design/icon_check_list.png differ diff --git a/assets/images/new-design/icon_hospital.png b/assets/images/new-design/icon_hospital.png new file mode 100644 index 00000000..413ad813 Binary files /dev/null and b/assets/images/new-design/icon_hospital.png differ diff --git a/assets/images/new-design/info-icon.png b/assets/images/new-design/info-icon.png new file mode 100644 index 00000000..49b1bc44 Binary files /dev/null and b/assets/images/new-design/info-icon.png differ diff --git a/assets/images/new-design/info_icon copy.png b/assets/images/new-design/info_icon copy.png new file mode 100644 index 00000000..49b1bc44 Binary files /dev/null and b/assets/images/new-design/info_icon copy.png differ diff --git a/assets/images/new-design/input_calendar_icon.png b/assets/images/new-design/input_calendar_icon.png new file mode 100644 index 00000000..d3a51014 Binary files /dev/null and b/assets/images/new-design/input_calendar_icon.png differ diff --git a/assets/images/new-design/input_clock_icon.png b/assets/images/new-design/input_clock_icon.png new file mode 100644 index 00000000..67b15715 Binary files /dev/null and b/assets/images/new-design/input_clock_icon.png differ diff --git a/assets/images/new-design/installment.png b/assets/images/new-design/installment.png new file mode 100644 index 00000000..034497ef Binary files /dev/null and b/assets/images/new-design/installment.png differ diff --git a/assets/images/new-design/insurance_approvals_icon.png b/assets/images/new-design/insurance_approvals_icon.png new file mode 100644 index 00000000..593dab33 Binary files /dev/null and b/assets/images/new-design/insurance_approvals_icon.png differ diff --git a/assets/images/new-design/insurance_card_icon.png b/assets/images/new-design/insurance_card_icon.png new file mode 100644 index 00000000..a7bacca5 Binary files /dev/null and b/assets/images/new-design/insurance_card_icon.png differ diff --git a/assets/images/new-design/ionic-ios-eye.png b/assets/images/new-design/ionic-ios-eye.png new file mode 100644 index 00000000..93eabdfc Binary files /dev/null and b/assets/images/new-design/ionic-ios-eye.png differ diff --git a/assets/images/new-design/lab_result_icon.png b/assets/images/new-design/lab_result_icon.png new file mode 100644 index 00000000..60b14ca8 Binary files /dev/null and b/assets/images/new-design/lab_result_icon.png differ diff --git a/assets/images/new-design/lakum_icon.png b/assets/images/new-design/lakum_icon.png new file mode 100644 index 00000000..eab11b56 Binary files /dev/null and b/assets/images/new-design/lakum_icon.png differ diff --git a/assets/images/new-design/linkedin.png b/assets/images/new-design/linkedin.png new file mode 100644 index 00000000..1f35f836 Binary files /dev/null and b/assets/images/new-design/linkedin.png differ diff --git a/assets/images/new-design/list-icon-down.png b/assets/images/new-design/list-icon-down.png new file mode 100644 index 00000000..02c73b5b Binary files /dev/null and b/assets/images/new-design/list-icon-down.png differ diff --git a/assets/images/new-design/list-icon-up.png b/assets/images/new-design/list-icon-up.png new file mode 100644 index 00000000..eb6a6019 Binary files /dev/null and b/assets/images/new-design/list-icon-up.png differ diff --git a/assets/images/new-design/liveCare_ar_bg.png b/assets/images/new-design/liveCare_ar_bg.png new file mode 100644 index 00000000..d29186ae Binary files /dev/null and b/assets/images/new-design/liveCare_ar_bg.png differ diff --git a/assets/images/new-design/liveCare_en_bg.png b/assets/images/new-design/liveCare_en_bg.png new file mode 100644 index 00000000..b0799af0 Binary files /dev/null and b/assets/images/new-design/liveCare_en_bg.png differ diff --git a/assets/images/new-design/live_chat_icon.png b/assets/images/new-design/live_chat_icon.png new file mode 100644 index 00000000..461a1e83 Binary files /dev/null and b/assets/images/new-design/live_chat_icon.png differ diff --git a/assets/images/new-design/loader.gif b/assets/images/new-design/loader.gif new file mode 100644 index 00000000..8fe79bf9 Binary files /dev/null and b/assets/images/new-design/loader.gif differ diff --git a/assets/images/new-design/location-sharp.png b/assets/images/new-design/location-sharp.png new file mode 100644 index 00000000..9682fde1 Binary files /dev/null and b/assets/images/new-design/location-sharp.png differ diff --git a/assets/images/new-design/location_icon.png b/assets/images/new-design/location_icon.png new file mode 100644 index 00000000..f4ccb0e2 Binary files /dev/null and b/assets/images/new-design/location_icon.png differ diff --git a/assets/images/new-design/lock_icon.png b/assets/images/new-design/lock_icon.png new file mode 100644 index 00000000..bf8c6aed Binary files /dev/null and b/assets/images/new-design/lock_icon.png differ diff --git a/assets/images/new-design/mada.png b/assets/images/new-design/mada.png new file mode 100644 index 00000000..f65b970c Binary files /dev/null and b/assets/images/new-design/mada.png differ diff --git a/assets/images/new-design/main_user_icon_active.png b/assets/images/new-design/main_user_icon_active.png new file mode 100644 index 00000000..d1005e17 Binary files /dev/null and b/assets/images/new-design/main_user_icon_active.png differ diff --git a/assets/images/new-design/main_user_icon_inaactive.png b/assets/images/new-design/main_user_icon_inaactive.png new file mode 100644 index 00000000..b203d151 Binary files /dev/null and b/assets/images/new-design/main_user_icon_inaactive.png differ diff --git a/assets/images/new-design/male.png b/assets/images/new-design/male.png new file mode 100644 index 00000000..e957df70 Binary files /dev/null and b/assets/images/new-design/male.png differ diff --git a/assets/images/new-design/male_face.png b/assets/images/new-design/male_face.png new file mode 100644 index 00000000..7adf335a Binary files /dev/null and b/assets/images/new-design/male_face.png differ diff --git a/assets/images/new-design/mastercard.png b/assets/images/new-design/mastercard.png new file mode 100644 index 00000000..1d48b854 Binary files /dev/null and b/assets/images/new-design/mastercard.png differ diff --git a/assets/images/new-design/medical_reports_icon.png b/assets/images/new-design/medical_reports_icon.png new file mode 100644 index 00000000..ad9c9f7b Binary files /dev/null and b/assets/images/new-design/medical_reports_icon.png differ diff --git a/assets/images/new-design/medical_services.png b/assets/images/new-design/medical_services.png new file mode 100644 index 00000000..596ac34e Binary files /dev/null and b/assets/images/new-design/medical_services.png differ diff --git a/assets/images/new-design/medical_services_ar.png b/assets/images/new-design/medical_services_ar.png new file mode 100644 index 00000000..082fe5fa Binary files /dev/null and b/assets/images/new-design/medical_services_ar.png differ diff --git a/assets/images/new-design/medication-refill.png b/assets/images/new-design/medication-refill.png new file mode 100644 index 00000000..fec82538 Binary files /dev/null and b/assets/images/new-design/medication-refill.png differ diff --git a/assets/images/new-design/medicine_prescriptions_icon.png b/assets/images/new-design/medicine_prescriptions_icon.png new file mode 100644 index 00000000..a4022770 Binary files /dev/null and b/assets/images/new-design/medicine_prescriptions_icon.png differ diff --git a/assets/images/new-design/monthly_reports_icon.png b/assets/images/new-design/monthly_reports_icon.png new file mode 100644 index 00000000..5d51e24c Binary files /dev/null and b/assets/images/new-design/monthly_reports_icon.png differ diff --git a/assets/images/new-design/more_icon.png b/assets/images/new-design/more_icon.png new file mode 100644 index 00000000..b696d345 Binary files /dev/null and b/assets/images/new-design/more_icon.png differ diff --git a/assets/images/new-design/my-prescription.png b/assets/images/new-design/my-prescription.png new file mode 100644 index 00000000..077c3453 Binary files /dev/null and b/assets/images/new-design/my-prescription.png differ diff --git a/assets/images/new-design/my_allergies_icon.png b/assets/images/new-design/my_allergies_icon.png new file mode 100644 index 00000000..689b5321 Binary files /dev/null and b/assets/images/new-design/my_allergies_icon.png differ diff --git a/assets/images/new-design/my_appointment_icon.png b/assets/images/new-design/my_appointment_icon.png new file mode 100644 index 00000000..94439627 Binary files /dev/null and b/assets/images/new-design/my_appointment_icon.png differ diff --git a/assets/images/new-design/my_doctor_icon.png b/assets/images/new-design/my_doctor_icon.png new file mode 100644 index 00000000..4043d64a Binary files /dev/null and b/assets/images/new-design/my_doctor_icon.png differ diff --git a/assets/images/new-design/my_file_bottom_bar.png b/assets/images/new-design/my_file_bottom_bar.png new file mode 100644 index 00000000..c89455c2 Binary files /dev/null and b/assets/images/new-design/my_file_bottom_bar.png differ diff --git a/assets/images/new-design/my_file_bottom_bar_active.png b/assets/images/new-design/my_file_bottom_bar_active.png new file mode 100644 index 00000000..d00e22c3 Binary files /dev/null and b/assets/images/new-design/my_file_bottom_bar_active.png differ diff --git a/assets/images/new-design/my_tracker_icon.png b/assets/images/new-design/my_tracker_icon.png new file mode 100644 index 00000000..1d46b859 Binary files /dev/null and b/assets/images/new-design/my_tracker_icon.png differ diff --git a/assets/images/new-design/my_vaccines_icon.png b/assets/images/new-design/my_vaccines_icon.png new file mode 100644 index 00000000..23a7352b Binary files /dev/null and b/assets/images/new-design/my_vaccines_icon.png differ diff --git a/assets/images/new-design/navigate.png b/assets/images/new-design/navigate.png new file mode 100644 index 00000000..99cfa09a Binary files /dev/null and b/assets/images/new-design/navigate.png differ diff --git a/assets/images/new-design/no-wait-queue.png b/assets/images/new-design/no-wait-queue.png new file mode 100644 index 00000000..d87a172f Binary files /dev/null and b/assets/images/new-design/no-wait-queue.png differ diff --git a/assets/images/new-design/noAppointmentIcon.png b/assets/images/new-design/noAppointmentIcon.png new file mode 100644 index 00000000..a52b5011 Binary files /dev/null and b/assets/images/new-design/noAppointmentIcon.png differ diff --git a/assets/images/new-design/online_payment_icon.png b/assets/images/new-design/online_payment_icon.png new file mode 100644 index 00000000..6e167ace Binary files /dev/null and b/assets/images/new-design/online_payment_icon.png differ diff --git a/assets/images/new-design/ovulation_period_icon.png b/assets/images/new-design/ovulation_period_icon.png new file mode 100644 index 00000000..c9a075d3 Binary files /dev/null and b/assets/images/new-design/ovulation_period_icon.png differ diff --git a/assets/images/new-design/parking_system_icon.png b/assets/images/new-design/parking_system_icon.png new file mode 100644 index 00000000..d4f26181 Binary files /dev/null and b/assets/images/new-design/parking_system_icon.png differ diff --git a/assets/images/new-design/patient_call_icon.png b/assets/images/new-design/patient_call_icon.png new file mode 100644 index 00000000..51b286e7 Binary files /dev/null and b/assets/images/new-design/patient_call_icon.png differ diff --git a/assets/images/new-design/patient_referral_icon.png b/assets/images/new-design/patient_referral_icon.png new file mode 100644 index 00000000..8d417b73 Binary files /dev/null and b/assets/images/new-design/patient_referral_icon.png differ diff --git a/assets/images/new-design/pay_now.png b/assets/images/new-design/pay_now.png new file mode 100644 index 00000000..6096d8b9 Binary files /dev/null and b/assets/images/new-design/pay_now.png differ diff --git a/assets/images/new-design/pay_online_button.png b/assets/images/new-design/pay_online_button.png new file mode 100644 index 00000000..988e1ace Binary files /dev/null and b/assets/images/new-design/pay_online_button.png differ diff --git a/assets/images/new-design/pay_online_button_arabic.png b/assets/images/new-design/pay_online_button_arabic.png new file mode 100644 index 00000000..1c49fc17 Binary files /dev/null and b/assets/images/new-design/pay_online_button_arabic.png differ diff --git a/assets/images/new-design/pay_online_button_arabic_disabled.png b/assets/images/new-design/pay_online_button_arabic_disabled.png new file mode 100644 index 00000000..0cb6dbf7 Binary files /dev/null and b/assets/images/new-design/pay_online_button_arabic_disabled.png differ diff --git a/assets/images/new-design/pay_online_button_disabled.png b/assets/images/new-design/pay_online_button_disabled.png new file mode 100644 index 00000000..b4d0c5a9 Binary files /dev/null and b/assets/images/new-design/pay_online_button_disabled.png differ diff --git a/assets/images/new-design/payment-method.png b/assets/images/new-design/payment-method.png new file mode 100644 index 00000000..a6b9f863 Binary files /dev/null and b/assets/images/new-design/payment-method.png differ diff --git a/assets/images/new-design/payment_options_invoice_confirmation.png b/assets/images/new-design/payment_options_invoice_confirmation.png new file mode 100644 index 00000000..4bb83fec Binary files /dev/null and b/assets/images/new-design/payment_options_invoice_confirmation.png differ diff --git a/assets/images/new-design/pharmacy_icon.png b/assets/images/new-design/pharmacy_icon.png new file mode 100644 index 00000000..141583ee Binary files /dev/null and b/assets/images/new-design/pharmacy_icon.png differ diff --git a/assets/images/new-design/qr-code.png b/assets/images/new-design/qr-code.png new file mode 100644 index 00000000..1135f7fa Binary files /dev/null and b/assets/images/new-design/qr-code.png differ diff --git a/assets/images/new-design/qr_code_button.png b/assets/images/new-design/qr_code_button.png new file mode 100644 index 00000000..7cd41d4c Binary files /dev/null and b/assets/images/new-design/qr_code_button.png differ diff --git a/assets/images/new-design/radiology_service_icon.png b/assets/images/new-design/radiology_service_icon.png new file mode 100644 index 00000000..9ff23309 Binary files /dev/null and b/assets/images/new-design/radiology_service_icon.png differ diff --git a/assets/images/new-design/refresh_icon.png b/assets/images/new-design/refresh_icon.png new file mode 100644 index 00000000..c9b2db7d Binary files /dev/null and b/assets/images/new-design/refresh_icon.png differ diff --git a/assets/images/new-design/reminder_icon.png b/assets/images/new-design/reminder_icon.png new file mode 100644 index 00000000..c280d7d0 Binary files /dev/null and b/assets/images/new-design/reminder_icon.png differ diff --git a/assets/images/new-design/remove_icon.png b/assets/images/new-design/remove_icon.png new file mode 100644 index 00000000..4a8f9479 Binary files /dev/null and b/assets/images/new-design/remove_icon.png differ diff --git a/assets/images/new-design/reschedule_icon.png b/assets/images/new-design/reschedule_icon.png new file mode 100644 index 00000000..d04a5b49 Binary files /dev/null and b/assets/images/new-design/reschedule_icon.png differ diff --git a/assets/images/new-design/respiration.png b/assets/images/new-design/respiration.png new file mode 100644 index 00000000..944d65aa Binary files /dev/null and b/assets/images/new-design/respiration.png differ diff --git a/assets/images/new-design/respirtation_icon.png b/assets/images/new-design/respirtation_icon.png new file mode 100644 index 00000000..75cd719d Binary files /dev/null and b/assets/images/new-design/respirtation_icon.png differ diff --git a/assets/images/new-design/rotate_icon.png b/assets/images/new-design/rotate_icon.png new file mode 100644 index 00000000..1593fe75 Binary files /dev/null and b/assets/images/new-design/rotate_icon.png differ diff --git a/assets/images/new-design/sadad.png b/assets/images/new-design/sadad.png new file mode 100644 index 00000000..35e0426c Binary files /dev/null and b/assets/images/new-design/sadad.png differ diff --git a/assets/images/new-design/schedule.png b/assets/images/new-design/schedule.png new file mode 100644 index 00000000..a8a78432 Binary files /dev/null and b/assets/images/new-design/schedule.png differ diff --git a/assets/images/new-design/schedule_icon.png b/assets/images/new-design/schedule_icon.png new file mode 100644 index 00000000..555dcd23 Binary files /dev/null and b/assets/images/new-design/schedule_icon.png differ diff --git a/assets/images/new-design/scheduled_reminder.png b/assets/images/new-design/scheduled_reminder.png new file mode 100644 index 00000000..40254fb4 Binary files /dev/null and b/assets/images/new-design/scheduled_reminder.png differ diff --git a/assets/images/new-design/search_by_clinic.png b/assets/images/new-design/search_by_clinic.png new file mode 100644 index 00000000..92964cb3 Binary files /dev/null and b/assets/images/new-design/search_by_clinic.png differ diff --git a/assets/images/new-design/search_by_disease.png b/assets/images/new-design/search_by_disease.png new file mode 100644 index 00000000..b55b2c67 Binary files /dev/null and b/assets/images/new-design/search_by_disease.png differ diff --git a/assets/images/new-design/search_by_doctor.png b/assets/images/new-design/search_by_doctor.png new file mode 100644 index 00000000..f261e6cf Binary files /dev/null and b/assets/images/new-design/search_by_doctor.png differ diff --git a/assets/images/new-design/search_by_symptom.png b/assets/images/new-design/search_by_symptom.png new file mode 100644 index 00000000..551f6ec8 Binary files /dev/null and b/assets/images/new-design/search_by_symptom.png differ diff --git a/assets/images/new-design/search_medicine.png b/assets/images/new-design/search_medicine.png new file mode 100644 index 00000000..f4a1c675 Binary files /dev/null and b/assets/images/new-design/search_medicine.png differ diff --git a/assets/images/new-design/send-email.png b/assets/images/new-design/send-email.png new file mode 100644 index 00000000..86f21eb5 Binary files /dev/null and b/assets/images/new-design/send-email.png differ diff --git a/assets/images/new-design/setting_gear_icon.png b/assets/images/new-design/setting_gear_icon.png new file mode 100644 index 00000000..ac1f0bc4 Binary files /dev/null and b/assets/images/new-design/setting_gear_icon.png differ diff --git a/assets/images/new-design/setting_menu_icon.png b/assets/images/new-design/setting_menu_icon.png new file mode 100644 index 00000000..d4f60540 Binary files /dev/null and b/assets/images/new-design/setting_menu_icon.png differ diff --git a/assets/images/new-design/sick_leaves_icons.png b/assets/images/new-design/sick_leaves_icons.png new file mode 100644 index 00000000..67a9c937 Binary files /dev/null and b/assets/images/new-design/sick_leaves_icons.png differ diff --git a/assets/images/new-design/sign_in_main_icon.png b/assets/images/new-design/sign_in_main_icon.png new file mode 100644 index 00000000..9938f32e Binary files /dev/null and b/assets/images/new-design/sign_in_main_icon.png differ diff --git a/assets/images/new-design/sign_out_menu_icon.png b/assets/images/new-design/sign_out_menu_icon.png new file mode 100644 index 00000000..e5bc35a4 Binary files /dev/null and b/assets/images/new-design/sign_out_menu_icon.png differ diff --git a/assets/images/new-design/smartwatch_icon.png b/assets/images/new-design/smartwatch_icon.png new file mode 100644 index 00000000..c43fe468 Binary files /dev/null and b/assets/images/new-design/smartwatch_icon.png differ diff --git a/assets/images/new-design/star_icon.png b/assets/images/new-design/star_icon.png new file mode 100644 index 00000000..95923936 Binary files /dev/null and b/assets/images/new-design/star_icon.png differ diff --git a/assets/images/new-design/star_rate_menu_icon.png b/assets/images/new-design/star_rate_menu_icon.png new file mode 100644 index 00000000..207b1f71 Binary files /dev/null and b/assets/images/new-design/star_rate_menu_icon.png differ diff --git a/assets/images/new-design/success_icon.png b/assets/images/new-design/success_icon.png new file mode 100644 index 00000000..617cbe89 Binary files /dev/null and b/assets/images/new-design/success_icon.png differ diff --git a/assets/images/new-design/survey.png b/assets/images/new-design/survey.png new file mode 100644 index 00000000..e822c870 Binary files /dev/null and b/assets/images/new-design/survey.png differ diff --git a/assets/images/new-design/temperature.png b/assets/images/new-design/temperature.png new file mode 100644 index 00000000..22bf5241 Binary files /dev/null and b/assets/images/new-design/temperature.png differ diff --git a/assets/images/new-design/temperature_icon.png b/assets/images/new-design/temperature_icon.png new file mode 100644 index 00000000..5d5d1203 Binary files /dev/null and b/assets/images/new-design/temperature_icon.png differ diff --git a/assets/images/new-design/time_icon.png b/assets/images/new-design/time_icon.png new file mode 100644 index 00000000..58ad960b Binary files /dev/null and b/assets/images/new-design/time_icon.png differ diff --git a/assets/images/new-design/triglycerides_blood_icon.png b/assets/images/new-design/triglycerides_blood_icon.png new file mode 100644 index 00000000..b3bebf9e Binary files /dev/null and b/assets/images/new-design/triglycerides_blood_icon.png differ diff --git a/assets/images/new-design/twitter.png b/assets/images/new-design/twitter.png new file mode 100644 index 00000000..823546e7 Binary files /dev/null and b/assets/images/new-design/twitter.png differ diff --git a/assets/images/new-design/twitter_dashboard_icon.png b/assets/images/new-design/twitter_dashboard_icon.png new file mode 100644 index 00000000..5d0a0646 Binary files /dev/null and b/assets/images/new-design/twitter_dashboard_icon.png differ diff --git a/assets/images/new-design/upcoming_icon_bottom_bar.png b/assets/images/new-design/upcoming_icon_bottom_bar.png new file mode 100644 index 00000000..ad0a4804 Binary files /dev/null and b/assets/images/new-design/upcoming_icon_bottom_bar.png differ diff --git a/assets/images/new-design/upcoming_icon_bottom_bar_active.png b/assets/images/new-design/upcoming_icon_bottom_bar_active.png new file mode 100644 index 00000000..cccb9652 Binary files /dev/null and b/assets/images/new-design/upcoming_icon_bottom_bar_active.png differ diff --git a/assets/images/new-design/user_top_bar_icon.png b/assets/images/new-design/user_top_bar_icon.png new file mode 100644 index 00000000..9b7b9a59 Binary files /dev/null and b/assets/images/new-design/user_top_bar_icon.png differ diff --git a/assets/images/new-design/vaccines_availability_icon.png b/assets/images/new-design/vaccines_availability_icon.png new file mode 100644 index 00000000..1bd6f8b3 Binary files /dev/null and b/assets/images/new-design/vaccines_availability_icon.png differ diff --git a/assets/images/new-design/vida_logo.jpg b/assets/images/new-design/vida_logo.jpg new file mode 100644 index 00000000..5fcec65c Binary files /dev/null and b/assets/images/new-design/vida_logo.jpg differ diff --git a/assets/images/new-design/vidamobile.png b/assets/images/new-design/vidamobile.png new file mode 100644 index 00000000..f096e8a7 Binary files /dev/null and b/assets/images/new-design/vidamobile.png differ diff --git a/assets/images/new-design/video_call_book_icon.png b/assets/images/new-design/video_call_book_icon.png new file mode 100644 index 00000000..e4db4a57 Binary files /dev/null and b/assets/images/new-design/video_call_book_icon.png differ diff --git a/assets/images/new-design/video_call_instruction.png b/assets/images/new-design/video_call_instruction.png new file mode 100644 index 00000000..eef9996c Binary files /dev/null and b/assets/images/new-design/video_call_instruction.png differ diff --git a/assets/images/new-design/virtal_respiration.png b/assets/images/new-design/virtal_respiration.png new file mode 100644 index 00000000..7e1b4466 Binary files /dev/null and b/assets/images/new-design/virtal_respiration.png differ diff --git a/assets/images/new-design/virtal_weight.png b/assets/images/new-design/virtal_weight.png new file mode 100644 index 00000000..5247e924 Binary files /dev/null and b/assets/images/new-design/virtal_weight.png differ diff --git a/assets/images/new-design/virtual_appointment_icon.png b/assets/images/new-design/virtual_appointment_icon.png new file mode 100644 index 00000000..f91046c6 Binary files /dev/null and b/assets/images/new-design/virtual_appointment_icon.png differ diff --git a/assets/images/new-design/virtual_tour_icon.png b/assets/images/new-design/virtual_tour_icon.png new file mode 100644 index 00000000..541603ea Binary files /dev/null and b/assets/images/new-design/virtual_tour_icon.png differ diff --git a/assets/images/new-design/visa.png b/assets/images/new-design/visa.png new file mode 100644 index 00000000..8d29703c Binary files /dev/null and b/assets/images/new-design/visa.png differ diff --git a/assets/images/new-design/vital_blood-pressure.png b/assets/images/new-design/vital_blood-pressure.png new file mode 100644 index 00000000..44c9f2e2 Binary files /dev/null and b/assets/images/new-design/vital_blood-pressure.png differ diff --git a/assets/images/new-design/vital_blood_type.png b/assets/images/new-design/vital_blood_type.png new file mode 100644 index 00000000..fbb5296f Binary files /dev/null and b/assets/images/new-design/vital_blood_type.png differ diff --git a/assets/images/new-design/vital_body_mass.png b/assets/images/new-design/vital_body_mass.png new file mode 100644 index 00000000..08476c51 Binary files /dev/null and b/assets/images/new-design/vital_body_mass.png differ diff --git a/assets/images/new-design/vital_heart_rate.png b/assets/images/new-design/vital_heart_rate.png new file mode 100644 index 00000000..e788658b Binary files /dev/null and b/assets/images/new-design/vital_heart_rate.png differ diff --git a/assets/images/new-design/vital_height.png b/assets/images/new-design/vital_height.png new file mode 100644 index 00000000..8c324b2c Binary files /dev/null and b/assets/images/new-design/vital_height.png differ diff --git a/assets/images/new-design/vital_signs.png b/assets/images/new-design/vital_signs.png new file mode 100644 index 00000000..7b642d6e Binary files /dev/null and b/assets/images/new-design/vital_signs.png differ diff --git a/assets/images/new-design/vital_temperature .png b/assets/images/new-design/vital_temperature .png new file mode 100644 index 00000000..7fe657de Binary files /dev/null and b/assets/images/new-design/vital_temperature .png differ diff --git a/assets/images/new-design/waiting-room.png b/assets/images/new-design/waiting-room.png new file mode 100644 index 00000000..02a9650c Binary files /dev/null and b/assets/images/new-design/waiting-room.png differ diff --git a/assets/images/new-design/waiting_for_doctor.png b/assets/images/new-design/waiting_for_doctor.png new file mode 100644 index 00000000..c330c25a Binary files /dev/null and b/assets/images/new-design/waiting_for_doctor.png differ diff --git a/assets/images/new-design/water_icon.png b/assets/images/new-design/water_icon.png new file mode 100644 index 00000000..9e9ccf5d Binary files /dev/null and b/assets/images/new-design/water_icon.png differ diff --git a/assets/images/new-design/weather_dashboard_icon.png b/assets/images/new-design/weather_dashboard_icon.png new file mode 100644 index 00000000..2a73dfac Binary files /dev/null and b/assets/images/new-design/weather_dashboard_icon.png differ diff --git a/assets/images/new-design/youtube.png b/assets/images/new-design/youtube.png new file mode 100644 index 00000000..7c8c847b Binary files /dev/null and b/assets/images/new-design/youtube.png differ diff --git a/assets/images/no-data-found.png b/assets/images/no-data-found.png new file mode 100644 index 00000000..a4ced5d3 Binary files /dev/null and b/assets/images/no-data-found.png differ diff --git a/assets/images/notf.png b/assets/images/notf.png new file mode 100644 index 00000000..39eb3fb3 Binary files /dev/null and b/assets/images/notf.png differ diff --git a/assets/images/offer_icon.png b/assets/images/offer_icon.png new file mode 100644 index 00000000..527fd5a2 Binary files /dev/null and b/assets/images/offer_icon.png differ diff --git a/assets/images/online_payment_icon.png b/assets/images/online_payment_icon.png new file mode 100644 index 00000000..6e167ace Binary files /dev/null and b/assets/images/online_payment_icon.png differ diff --git a/assets/images/online_payments_bg.png b/assets/images/online_payments_bg.png new file mode 100644 index 00000000..72f8e331 Binary files /dev/null and b/assets/images/online_payments_bg.png differ diff --git a/assets/images/pharmacy_logo.png b/assets/images/pharmacy_logo.png new file mode 100644 index 00000000..bf82ed5c Binary files /dev/null and b/assets/images/pharmacy_logo.png differ diff --git a/assets/images/pharmacy_module/bg_1.png b/assets/images/pharmacy_module/bg_1.png new file mode 100644 index 00000000..9505e556 Binary files /dev/null and b/assets/images/pharmacy_module/bg_1.png differ diff --git a/assets/images/pharmacy_module/bg_2.png b/assets/images/pharmacy_module/bg_2.png new file mode 100644 index 00000000..96cfd3bc Binary files /dev/null and b/assets/images/pharmacy_module/bg_2.png differ diff --git a/assets/images/pharmacy_module/bg_3.png b/assets/images/pharmacy_module/bg_3.png new file mode 100644 index 00000000..127c2669 Binary files /dev/null and b/assets/images/pharmacy_module/bg_3.png differ diff --git a/assets/images/pharmacy_module/bg_4.png b/assets/images/pharmacy_module/bg_4.png new file mode 100644 index 00000000..423ab421 Binary files /dev/null and b/assets/images/pharmacy_module/bg_4.png differ diff --git a/assets/images/pharmacy_module/medication_icon.png b/assets/images/pharmacy_module/medication_icon.png new file mode 100644 index 00000000..95851e4e Binary files /dev/null and b/assets/images/pharmacy_module/medication_icon.png differ diff --git a/assets/images/pharmacy_module/offer_icon.png b/assets/images/pharmacy_module/offer_icon.png new file mode 100644 index 00000000..64db2b76 Binary files /dev/null and b/assets/images/pharmacy_module/offer_icon.png differ diff --git a/assets/images/pharmacy_module/pharmacy_logo_green.png b/assets/images/pharmacy_module/pharmacy_logo_green.png new file mode 100644 index 00000000..13c076b0 Binary files /dev/null and b/assets/images/pharmacy_module/pharmacy_logo_green.png differ diff --git a/assets/images/pharmacy_module/prescription_icon.png b/assets/images/pharmacy_module/prescription_icon.png new file mode 100644 index 00000000..740004c7 Binary files /dev/null and b/assets/images/pharmacy_module/prescription_icon.png differ diff --git a/assets/images/pharmacy_module/search_scan_icon.png b/assets/images/pharmacy_module/search_scan_icon.png new file mode 100644 index 00000000..d168b0e6 Binary files /dev/null and b/assets/images/pharmacy_module/search_scan_icon.png differ diff --git a/assets/images/powerd-by.jpg b/assets/images/powerd-by.jpg new file mode 100644 index 00000000..93bdbb18 Binary files /dev/null and b/assets/images/powerd-by.jpg differ diff --git a/assets/images/progress-loading.gif b/assets/images/progress-loading.gif new file mode 100644 index 00000000..0d7769b7 Binary files /dev/null and b/assets/images/progress-loading.gif differ diff --git a/assets/images/rectangle.png b/assets/images/rectangle.png new file mode 100644 index 00000000..e4bdb0b6 Binary files /dev/null and b/assets/images/rectangle.png differ diff --git a/assets/images/report.jpg b/assets/images/report.jpg new file mode 100644 index 00000000..5846cd53 Binary files /dev/null and b/assets/images/report.jpg differ diff --git a/assets/images/robort.png b/assets/images/robort.png new file mode 100644 index 00000000..320afcbc Binary files /dev/null and b/assets/images/robort.png differ diff --git a/assets/images/search_medicine_icon.png b/assets/images/search_medicine_icon.png new file mode 100644 index 00000000..349620a5 Binary files /dev/null and b/assets/images/search_medicine_icon.png differ diff --git a/assets/images/siri-ianzhao.gif b/assets/images/siri-ianzhao.gif new file mode 100644 index 00000000..8d1c644f Binary files /dev/null and b/assets/images/siri-ianzhao.gif differ diff --git a/assets/images/svg/robort_svg.svg b/assets/images/svg/robort_svg.svg new file mode 100644 index 00000000..07d3d4b4 --- /dev/null +++ b/assets/images/svg/robort_svg.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/svg/symptom.svg b/assets/images/svg/symptom.svg new file mode 100644 index 00000000..aa670da1 --- /dev/null +++ b/assets/images/svg/symptom.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/images/test-weight.png b/assets/images/test-weight.png new file mode 100644 index 00000000..934b2467 Binary files /dev/null and b/assets/images/test-weight.png differ diff --git a/assets/images/timeline_bg.png b/assets/images/timeline_bg.png new file mode 100644 index 00000000..d7afc4b1 Binary files /dev/null and b/assets/images/timeline_bg.png differ diff --git a/assets/images/undraw_connected_world_wuay.png b/assets/images/undraw_connected_world_wuay.png new file mode 100644 index 00000000..f1bd3f00 Binary files /dev/null and b/assets/images/undraw_connected_world_wuay.png differ diff --git a/assets/images/weight_icon.png b/assets/images/weight_icon.png new file mode 100644 index 00000000..5c640114 Binary files /dev/null and b/assets/images/weight_icon.png differ diff --git a/assets/images/wifi-EN.png b/assets/images/wifi-EN.png new file mode 100644 index 00000000..5711925c Binary files /dev/null and b/assets/images/wifi-EN.png differ diff --git a/assets/json/bookedAllowCheckInButtons.json b/assets/json/bookedAllowCheckInButtons.json new file mode 100644 index 00000000..5b5c4c5c --- /dev/null +++ b/assets/json/bookedAllowCheckInButtons.json @@ -0,0 +1,44 @@ +[ + { + "title": "confirm", + "subtitle": "appointment", + "icon": "assets/images/new-design/confirm_icon.png", + "caller": "confirmAppointment" + }, + { + "title": "reschedule", + "subtitle": "appointment", + "icon": "assets/images/new-design/reschedule_icon.png", + "caller": "openReschedule" + }, + { + "title": "cancel", + "subtitle": "appointment", + "icon": "assets/images/new-design/cancel_icon.png", + "caller": "onCancelAppointment" + }, + { + "title": "raise", + "subtitle": "complaint", + "icon": "assets/images/new-design/Complaint_icon.png", + "caller": "insertComplaint" + }, + { + "title": "add", + "subtitle": "reminder", + "icon": "assets/images/new-design/reminder_icon.png", + "caller": "addReminder" + }, + { + "title": "hospital", + "subtitle": "locations", + "icon": "assets/images/new-design/location_icon.png", + "caller": "navigateToProject" + }, + { + "title": "online", + "subtitle": "payment", + "icon": "assets/images/new-design/check-in.png", + "caller": "goToTodoList" + } +] \ No newline at end of file diff --git a/assets/json/bookedButtons.json b/assets/json/bookedButtons.json new file mode 100644 index 00000000..e34718e2 --- /dev/null +++ b/assets/json/bookedButtons.json @@ -0,0 +1,38 @@ +[ + { + "title": "confirm", + "subtitle": "appointment", + "icon": "assets/images/new-design/confirm_icon.png", + "caller": "confirmAppointment" + }, + { + "title": "reschedule", + "subtitle": "appointment", + "icon": "assets/images/new-design/reschedule_icon.png", + "caller": "openReschedule" + }, + { + "title": "cancel", + "subtitle": "appointment", + "icon": "assets/images/new-design/cancel_icon.png", + "caller": "onCancelAppointment" + }, + { + "title": "raise", + "subtitle": "complaint", + "icon": "assets/images/new-design/Complaint_icon.png", + "caller": "insertComplaint" + }, + { + "title": "add", + "subtitle": "reminder", + "icon": "assets/images/new-design/reminder_icon.png", + "caller": "addReminder" + }, + { + "title": "hospital", + "subtitle": "locations", + "icon": "assets/images/new-design/location_icon.png", + "caller": "navigateToProject" + } +] \ No newline at end of file diff --git a/assets/json/freeSlots.json b/assets/json/freeSlots.json new file mode 100644 index 00000000..c8f2fee1 --- /dev/null +++ b/assets/json/freeSlots.json @@ -0,0 +1,2182 @@ +{ + "FreeTimeSlots": [ + "\/Date(1595257200000+0300)\/", + "\/Date(1595258100000+0300)\/", + "\/Date(1595259900000+0300)\/", + "\/Date(1595260800000+0300)\/", + "\/Date(1595261700000+0300)\/", + "\/Date(1595263500000+0300)\/", + "\/Date(1595265300000+0300)\/", + "\/Date(1595266200000+0300)\/", + "\/Date(1595341800000+0300)\/", + "\/Date(1595342700000+0300)\/", + "\/Date(1595343600000+0300)\/", + "\/Date(1595344500000+0300)\/", + "\/Date(1595346300000+0300)\/", + "\/Date(1595348100000+0300)\/", + "\/Date(1595349000000+0300)\/", + "\/Date(1595349900000+0300)\/", + "\/Date(1595350800000+0300)\/", + "\/Date(1595351700000+0300)\/", + "\/Date(1595352600000+0300)\/", + "\/Date(1595353500000+0300)\/", + "\/Date(1595426400000+0300)\/", + "\/Date(1595427300000+0300)\/", + "\/Date(1595429100000+0300)\/", + "\/Date(1595430000000+0300)\/", + "\/Date(1595430900000+0300)\/", + "\/Date(1595431800000+0300)\/", + "\/Date(1595432700000+0300)\/", + "\/Date(1595433600000+0300)\/", + "\/Date(1595434500000+0300)\/", + "\/Date(1595435400000+0300)\/", + "\/Date(1595436300000+0300)\/", + "\/Date(1595437200000+0300)\/", + "\/Date(1595438100000+0300)\/", + "\/Date(1595439000000+0300)\/", + "\/Date(1595439900000+0300)\/", + "\/Date(1595509200000+0300)\/", + "\/Date(1595510100000+0300)\/", + "\/Date(1595511000000+0300)\/", + "\/Date(1595511900000+0300)\/", + "\/Date(1595512800000+0300)\/", + "\/Date(1595513700000+0300)\/", + "\/Date(1595514600000+0300)\/", + "\/Date(1595515500000+0300)\/", + "\/Date(1595516400000+0300)\/", + "\/Date(1595517300000+0300)\/", + "\/Date(1595518200000+0300)\/", + "\/Date(1595519100000+0300)\/", + "\/Date(1595520000000+0300)\/", + "\/Date(1595520900000+0300)\/", + "\/Date(1595521800000+0300)\/", + "\/Date(1595522700000+0300)\/", + "\/Date(1595661300000+0300)\/", + "\/Date(1595662200000+0300)\/", + "\/Date(1595663100000+0300)\/", + "\/Date(1595664000000+0300)\/", + "\/Date(1595664900000+0300)\/", + "\/Date(1595665800000+0300)\/", + "\/Date(1595666700000+0300)\/", + "\/Date(1595667600000+0300)\/", + "\/Date(1595668500000+0300)\/", + "\/Date(1595669400000+0300)\/", + "\/Date(1595670300000+0300)\/", + "\/Date(1595671200000+0300)\/", + "\/Date(1595672100000+0300)\/", + "\/Date(1595673000000+0300)\/", + "\/Date(1595673900000+0300)\/", + "\/Date(1595772000000+0300)\/", + "\/Date(1595772900000+0300)\/", + "\/Date(1595773800000+0300)\/", + "\/Date(1595774700000+0300)\/", + "\/Date(1595775600000+0300)\/", + "\/Date(1595776500000+0300)\/", + "\/Date(1595777400000+0300)\/", + "\/Date(1595778300000+0300)\/", + "\/Date(1595779200000+0300)\/", + "\/Date(1595780100000+0300)\/", + "\/Date(1595781000000+0300)\/", + "\/Date(1595781900000+0300)\/", + "\/Date(1595782800000+0300)\/", + "\/Date(1595783700000+0300)\/", + "\/Date(1595784600000+0300)\/", + "\/Date(1595785500000+0300)\/", + "\/Date(1595858400000+0300)\/", + "\/Date(1595859300000+0300)\/", + "\/Date(1595860200000+0300)\/", + "\/Date(1595861100000+0300)\/", + "\/Date(1595862000000+0300)\/", + "\/Date(1595862900000+0300)\/", + "\/Date(1595863800000+0300)\/", + "\/Date(1595864700000+0300)\/", + "\/Date(1595865600000+0300)\/", + "\/Date(1595866500000+0300)\/", + "\/Date(1595867400000+0300)\/", + "\/Date(1595868300000+0300)\/", + "\/Date(1595869200000+0300)\/", + "\/Date(1595870100000+0300)\/", + "\/Date(1595871000000+0300)\/", + "\/Date(1595871900000+0300)\/", + "\/Date(1595944800000+0300)\/", + "\/Date(1595945700000+0300)\/", + "\/Date(1595946600000+0300)\/", + "\/Date(1595947500000+0300)\/", + "\/Date(1595948400000+0300)\/", + "\/Date(1595949300000+0300)\/", + "\/Date(1595950200000+0300)\/", + "\/Date(1595951100000+0300)\/", + "\/Date(1595952000000+0300)\/", + "\/Date(1595952900000+0300)\/", + "\/Date(1595953800000+0300)\/", + "\/Date(1595954700000+0300)\/", + "\/Date(1595955600000+0300)\/", + "\/Date(1595956500000+0300)\/", + "\/Date(1595957400000+0300)\/", + "\/Date(1595958300000+0300)\/", + "\/Date(1596549600000+0300)\/", + "\/Date(1596550500000+0300)\/", + "\/Date(1596551400000+0300)\/", + "\/Date(1596552300000+0300)\/", + "\/Date(1596553200000+0300)\/", + "\/Date(1596554100000+0300)\/", + "\/Date(1596555000000+0300)\/", + "\/Date(1596555900000+0300)\/", + "\/Date(1596556800000+0300)\/", + "\/Date(1596557700000+0300)\/", + "\/Date(1596558600000+0300)\/", + "\/Date(1596559500000+0300)\/", + "\/Date(1596560400000+0300)\/", + "\/Date(1596561300000+0300)\/", + "\/Date(1596562200000+0300)\/", + "\/Date(1596563100000+0300)\/", + "\/Date(1596636000000+0300)\/", + "\/Date(1596636900000+0300)\/", + "\/Date(1596637800000+0300)\/", + "\/Date(1596638700000+0300)\/", + "\/Date(1596639600000+0300)\/", + "\/Date(1596640500000+0300)\/", + "\/Date(1596641400000+0300)\/", + "\/Date(1596642300000+0300)\/", + "\/Date(1596643200000+0300)\/", + "\/Date(1596644100000+0300)\/", + "\/Date(1596645000000+0300)\/", + "\/Date(1596645900000+0300)\/", + "\/Date(1596646800000+0300)\/", + "\/Date(1596647700000+0300)\/", + "\/Date(1596648600000+0300)\/", + "\/Date(1596649500000+0300)\/", + "\/Date(1596718800000+0300)\/", + "\/Date(1596719700000+0300)\/", + "\/Date(1596720600000+0300)\/", + "\/Date(1596721500000+0300)\/", + "\/Date(1596722400000+0300)\/", + "\/Date(1596723300000+0300)\/", + "\/Date(1596724200000+0300)\/", + "\/Date(1596725100000+0300)\/", + "\/Date(1596726000000+0300)\/", + "\/Date(1596726900000+0300)\/", + "\/Date(1596727800000+0300)\/", + "\/Date(1596728700000+0300)\/", + "\/Date(1596729600000+0300)\/", + "\/Date(1596730500000+0300)\/", + "\/Date(1596731400000+0300)\/", + "\/Date(1596732300000+0300)\/", + "\/Date(1596870000000+0300)\/", + "\/Date(1596870900000+0300)\/", + "\/Date(1596871800000+0300)\/", + "\/Date(1596872700000+0300)\/", + "\/Date(1596873600000+0300)\/", + "\/Date(1596874500000+0300)\/", + "\/Date(1596875400000+0300)\/", + "\/Date(1596876300000+0300)\/", + "\/Date(1596877200000+0300)\/", + "\/Date(1596878100000+0300)\/", + "\/Date(1596879000000+0300)\/", + "\/Date(1596879900000+0300)\/", + "\/Date(1596880800000+0300)\/", + "\/Date(1596881700000+0300)\/", + "\/Date(1596882600000+0300)\/", + "\/Date(1596883500000+0300)\/", + "\/Date(1596981600000+0300)\/", + "\/Date(1596982500000+0300)\/", + "\/Date(1596983400000+0300)\/", + "\/Date(1596984300000+0300)\/", + "\/Date(1596985200000+0300)\/", + "\/Date(1596986100000+0300)\/", + "\/Date(1596987000000+0300)\/", + "\/Date(1596987900000+0300)\/", + "\/Date(1596988800000+0300)\/", + "\/Date(1596989700000+0300)\/", + "\/Date(1596990600000+0300)\/", + "\/Date(1596991500000+0300)\/", + "\/Date(1596992400000+0300)\/", + "\/Date(1596993300000+0300)\/", + "\/Date(1596994200000+0300)\/", + "\/Date(1596995100000+0300)\/", + "\/Date(1597068000000+0300)\/", + "\/Date(1597068900000+0300)\/", + "\/Date(1597069800000+0300)\/", + "\/Date(1597070700000+0300)\/", + "\/Date(1597071600000+0300)\/", + "\/Date(1597072500000+0300)\/", + "\/Date(1597073400000+0300)\/", + "\/Date(1597074300000+0300)\/", + "\/Date(1597075200000+0300)\/", + "\/Date(1597076100000+0300)\/", + "\/Date(1597077000000+0300)\/", + "\/Date(1597077900000+0300)\/", + "\/Date(1597078800000+0300)\/", + "\/Date(1597079700000+0300)\/", + "\/Date(1597080600000+0300)\/", + "\/Date(1597081500000+0300)\/", + "\/Date(1597154400000+0300)\/", + "\/Date(1597155300000+0300)\/", + "\/Date(1597156200000+0300)\/", + "\/Date(1597157100000+0300)\/", + "\/Date(1597158000000+0300)\/", + "\/Date(1597158900000+0300)\/", + "\/Date(1597159800000+0300)\/", + "\/Date(1597160700000+0300)\/", + "\/Date(1597161600000+0300)\/", + "\/Date(1597162500000+0300)\/", + "\/Date(1597163400000+0300)\/", + "\/Date(1597164300000+0300)\/", + "\/Date(1597165200000+0300)\/", + "\/Date(1597166100000+0300)\/", + "\/Date(1597167000000+0300)\/", + "\/Date(1597167900000+0300)\/", + "\/Date(1597240800000+0300)\/", + "\/Date(1597241700000+0300)\/", + "\/Date(1597242600000+0300)\/", + "\/Date(1597243500000+0300)\/", + "\/Date(1597244400000+0300)\/", + "\/Date(1597245300000+0300)\/", + "\/Date(1597246200000+0300)\/", + "\/Date(1597247100000+0300)\/", + "\/Date(1597248000000+0300)\/", + "\/Date(1597248900000+0300)\/", + "\/Date(1597249800000+0300)\/", + "\/Date(1597250700000+0300)\/", + "\/Date(1597251600000+0300)\/", + "\/Date(1597252500000+0300)\/", + "\/Date(1597253400000+0300)\/", + "\/Date(1597254300000+0300)\/", + "\/Date(1597323600000+0300)\/", + "\/Date(1597324500000+0300)\/", + "\/Date(1597325400000+0300)\/", + "\/Date(1597326300000+0300)\/", + "\/Date(1597327200000+0300)\/", + "\/Date(1597328100000+0300)\/", + "\/Date(1597329000000+0300)\/", + "\/Date(1597329900000+0300)\/", + "\/Date(1597330800000+0300)\/", + "\/Date(1597331700000+0300)\/", + "\/Date(1597332600000+0300)\/", + "\/Date(1597333500000+0300)\/", + "\/Date(1597334400000+0300)\/", + "\/Date(1597335300000+0300)\/", + "\/Date(1597336200000+0300)\/", + "\/Date(1597337100000+0300)\/", + "\/Date(1597474800000+0300)\/", + "\/Date(1597475700000+0300)\/", + "\/Date(1597476600000+0300)\/", + "\/Date(1597477500000+0300)\/", + "\/Date(1597478400000+0300)\/", + "\/Date(1597479300000+0300)\/", + "\/Date(1597480200000+0300)\/", + "\/Date(1597481100000+0300)\/", + "\/Date(1597482000000+0300)\/", + "\/Date(1597482900000+0300)\/", + "\/Date(1597483800000+0300)\/", + "\/Date(1597484700000+0300)\/", + "\/Date(1597485600000+0300)\/", + "\/Date(1597486500000+0300)\/", + "\/Date(1597487400000+0300)\/", + "\/Date(1597488300000+0300)\/", + "\/Date(1597586400000+0300)\/", + "\/Date(1597587300000+0300)\/", + "\/Date(1597588200000+0300)\/", + "\/Date(1597589100000+0300)\/", + "\/Date(1597590000000+0300)\/", + "\/Date(1597590900000+0300)\/", + "\/Date(1597591800000+0300)\/", + "\/Date(1597592700000+0300)\/", + "\/Date(1597593600000+0300)\/", + "\/Date(1597594500000+0300)\/", + "\/Date(1597595400000+0300)\/", + "\/Date(1597596300000+0300)\/", + "\/Date(1597597200000+0300)\/", + "\/Date(1597598100000+0300)\/", + "\/Date(1597599000000+0300)\/", + "\/Date(1597599900000+0300)\/", + "\/Date(1597672800000+0300)\/", + "\/Date(1597673700000+0300)\/", + "\/Date(1597674600000+0300)\/", + "\/Date(1597675500000+0300)\/", + "\/Date(1597676400000+0300)\/", + "\/Date(1597677300000+0300)\/", + "\/Date(1597678200000+0300)\/", + "\/Date(1597679100000+0300)\/", + "\/Date(1597680000000+0300)\/", + "\/Date(1597680900000+0300)\/", + "\/Date(1597681800000+0300)\/", + "\/Date(1597682700000+0300)\/", + "\/Date(1597683600000+0300)\/", + "\/Date(1597684500000+0300)\/", + "\/Date(1597685400000+0300)\/", + "\/Date(1597686300000+0300)\/", + "\/Date(1597759200000+0300)\/", + "\/Date(1597760100000+0300)\/", + "\/Date(1597761000000+0300)\/", + "\/Date(1597761900000+0300)\/", + "\/Date(1597762800000+0300)\/", + "\/Date(1597763700000+0300)\/", + "\/Date(1597764600000+0300)\/", + "\/Date(1597765500000+0300)\/", + "\/Date(1597766400000+0300)\/", + "\/Date(1597767300000+0300)\/", + "\/Date(1597768200000+0300)\/", + "\/Date(1597769100000+0300)\/", + "\/Date(1597770000000+0300)\/", + "\/Date(1597770900000+0300)\/", + "\/Date(1597771800000+0300)\/", + "\/Date(1597772700000+0300)\/", + "\/Date(1597845600000+0300)\/", + "\/Date(1597846500000+0300)\/", + "\/Date(1597847400000+0300)\/", + "\/Date(1597848300000+0300)\/", + "\/Date(1597849200000+0300)\/", + "\/Date(1597850100000+0300)\/", + "\/Date(1597851000000+0300)\/", + "\/Date(1597851900000+0300)\/", + "\/Date(1597852800000+0300)\/", + "\/Date(1597853700000+0300)\/", + "\/Date(1597854600000+0300)\/", + "\/Date(1597855500000+0300)\/", + "\/Date(1597856400000+0300)\/", + "\/Date(1597857300000+0300)\/", + "\/Date(1597858200000+0300)\/", + "\/Date(1597859100000+0300)\/", + "\/Date(1597928400000+0300)\/", + "\/Date(1597929300000+0300)\/", + "\/Date(1597930200000+0300)\/", + "\/Date(1597931100000+0300)\/", + "\/Date(1597932000000+0300)\/", + "\/Date(1597932900000+0300)\/", + "\/Date(1597933800000+0300)\/", + "\/Date(1597934700000+0300)\/", + "\/Date(1597935600000+0300)\/", + "\/Date(1597936500000+0300)\/", + "\/Date(1597937400000+0300)\/", + "\/Date(1597938300000+0300)\/", + "\/Date(1597939200000+0300)\/", + "\/Date(1597940100000+0300)\/", + "\/Date(1597941000000+0300)\/", + "\/Date(1597941900000+0300)\/", + "\/Date(1598079600000+0300)\/", + "\/Date(1598080500000+0300)\/", + "\/Date(1598081400000+0300)\/", + "\/Date(1598082300000+0300)\/", + "\/Date(1598083200000+0300)\/", + "\/Date(1598084100000+0300)\/", + "\/Date(1598085000000+0300)\/", + "\/Date(1598085900000+0300)\/", + "\/Date(1598086800000+0300)\/", + "\/Date(1598087700000+0300)\/", + "\/Date(1598088600000+0300)\/", + "\/Date(1598089500000+0300)\/", + "\/Date(1598090400000+0300)\/", + "\/Date(1598091300000+0300)\/", + "\/Date(1598092200000+0300)\/", + "\/Date(1598093100000+0300)\/", + "\/Date(1598191200000+0300)\/", + "\/Date(1598192100000+0300)\/", + "\/Date(1598193000000+0300)\/", + "\/Date(1598193900000+0300)\/", + "\/Date(1598194800000+0300)\/", + "\/Date(1598195700000+0300)\/", + "\/Date(1598196600000+0300)\/", + "\/Date(1598197500000+0300)\/", + "\/Date(1598198400000+0300)\/", + "\/Date(1598199300000+0300)\/", + "\/Date(1598200200000+0300)\/", + "\/Date(1598201100000+0300)\/", + "\/Date(1598202000000+0300)\/", + "\/Date(1598202900000+0300)\/", + "\/Date(1598203800000+0300)\/", + "\/Date(1598204700000+0300)\/", + "\/Date(1598277600000+0300)\/", + "\/Date(1598278500000+0300)\/", + "\/Date(1598279400000+0300)\/", + "\/Date(1598280300000+0300)\/", + "\/Date(1598281200000+0300)\/", + "\/Date(1598282100000+0300)\/", + "\/Date(1598283000000+0300)\/", + "\/Date(1598283900000+0300)\/", + "\/Date(1598284800000+0300)\/", + "\/Date(1598285700000+0300)\/", + "\/Date(1598286600000+0300)\/", + "\/Date(1598287500000+0300)\/", + "\/Date(1598288400000+0300)\/", + "\/Date(1598289300000+0300)\/", + "\/Date(1598290200000+0300)\/", + "\/Date(1598291100000+0300)\/", + "\/Date(1598364000000+0300)\/", + "\/Date(1598364900000+0300)\/", + "\/Date(1598365800000+0300)\/", + "\/Date(1598366700000+0300)\/", + "\/Date(1598367600000+0300)\/", + "\/Date(1598368500000+0300)\/", + "\/Date(1598369400000+0300)\/", + "\/Date(1598370300000+0300)\/", + "\/Date(1598371200000+0300)\/", + "\/Date(1598372100000+0300)\/", + "\/Date(1598373000000+0300)\/", + "\/Date(1598373900000+0300)\/", + "\/Date(1598374800000+0300)\/", + "\/Date(1598375700000+0300)\/", + "\/Date(1598376600000+0300)\/", + "\/Date(1598377500000+0300)\/", + "\/Date(1598450400000+0300)\/", + "\/Date(1598451300000+0300)\/", + "\/Date(1598452200000+0300)\/", + "\/Date(1598453100000+0300)\/", + "\/Date(1598454000000+0300)\/", + "\/Date(1598454900000+0300)\/", + "\/Date(1598455800000+0300)\/", + "\/Date(1598456700000+0300)\/", + "\/Date(1598457600000+0300)\/", + "\/Date(1598458500000+0300)\/", + "\/Date(1598459400000+0300)\/", + "\/Date(1598460300000+0300)\/", + "\/Date(1598461200000+0300)\/", + "\/Date(1598462100000+0300)\/", + "\/Date(1598463000000+0300)\/", + "\/Date(1598463900000+0300)\/", + "\/Date(1598533200000+0300)\/", + "\/Date(1598534100000+0300)\/", + "\/Date(1598535000000+0300)\/", + "\/Date(1598535900000+0300)\/", + "\/Date(1598536800000+0300)\/", + "\/Date(1598537700000+0300)\/", + "\/Date(1598538600000+0300)\/", + "\/Date(1598539500000+0300)\/", + "\/Date(1598540400000+0300)\/", + "\/Date(1598541300000+0300)\/", + "\/Date(1598542200000+0300)\/", + "\/Date(1598543100000+0300)\/", + "\/Date(1598544000000+0300)\/", + "\/Date(1598544900000+0300)\/", + "\/Date(1598545800000+0300)\/", + "\/Date(1598546700000+0300)\/", + "\/Date(1598684400000+0300)\/", + "\/Date(1598685300000+0300)\/", + "\/Date(1598686200000+0300)\/", + "\/Date(1598687100000+0300)\/", + "\/Date(1598688000000+0300)\/", + "\/Date(1598688900000+0300)\/", + "\/Date(1598689800000+0300)\/", + "\/Date(1598690700000+0300)\/", + "\/Date(1598691600000+0300)\/", + "\/Date(1598692500000+0300)\/", + "\/Date(1598693400000+0300)\/", + "\/Date(1598694300000+0300)\/", + "\/Date(1598695200000+0300)\/", + "\/Date(1598696100000+0300)\/", + "\/Date(1598697000000+0300)\/", + "\/Date(1598697900000+0300)\/", + "\/Date(1598796000000+0300)\/", + "\/Date(1598796900000+0300)\/", + "\/Date(1598797800000+0300)\/", + "\/Date(1598798700000+0300)\/", + "\/Date(1598799600000+0300)\/", + "\/Date(1598800500000+0300)\/", + "\/Date(1598801400000+0300)\/", + "\/Date(1598802300000+0300)\/", + "\/Date(1598803200000+0300)\/", + "\/Date(1598804100000+0300)\/", + "\/Date(1598805000000+0300)\/", + "\/Date(1598805900000+0300)\/", + "\/Date(1598806800000+0300)\/", + "\/Date(1598807700000+0300)\/", + "\/Date(1598808600000+0300)\/", + "\/Date(1598809500000+0300)\/", + "\/Date(1598882400000+0300)\/", + "\/Date(1598883300000+0300)\/", + "\/Date(1598884200000+0300)\/", + "\/Date(1598885100000+0300)\/", + "\/Date(1598886000000+0300)\/", + "\/Date(1598886900000+0300)\/", + "\/Date(1598887800000+0300)\/", + "\/Date(1598888700000+0300)\/", + "\/Date(1598889600000+0300)\/", + "\/Date(1598890500000+0300)\/", + "\/Date(1598891400000+0300)\/", + "\/Date(1598892300000+0300)\/", + "\/Date(1598893200000+0300)\/", + "\/Date(1598894100000+0300)\/", + "\/Date(1598895000000+0300)\/", + "\/Date(1598895900000+0300)\/", + "\/Date(1598968800000+0300)\/", + "\/Date(1598969700000+0300)\/", + "\/Date(1598970600000+0300)\/", + "\/Date(1598971500000+0300)\/", + "\/Date(1598972400000+0300)\/", + "\/Date(1598973300000+0300)\/", + "\/Date(1598974200000+0300)\/", + "\/Date(1598975100000+0300)\/", + "\/Date(1598976000000+0300)\/", + "\/Date(1598976900000+0300)\/", + "\/Date(1598977800000+0300)\/", + "\/Date(1598978700000+0300)\/", + "\/Date(1598979600000+0300)\/", + "\/Date(1598980500000+0300)\/", + "\/Date(1598981400000+0300)\/", + "\/Date(1598982300000+0300)\/", + "\/Date(1599055200000+0300)\/", + "\/Date(1599056100000+0300)\/", + "\/Date(1599057000000+0300)\/", + "\/Date(1599057900000+0300)\/", + "\/Date(1599058800000+0300)\/", + "\/Date(1599059700000+0300)\/", + "\/Date(1599060600000+0300)\/", + "\/Date(1599061500000+0300)\/", + "\/Date(1599062400000+0300)\/", + "\/Date(1599063300000+0300)\/", + "\/Date(1599064200000+0300)\/", + "\/Date(1599065100000+0300)\/", + "\/Date(1599066000000+0300)\/", + "\/Date(1599066900000+0300)\/", + "\/Date(1599067800000+0300)\/", + "\/Date(1599068700000+0300)\/", + "\/Date(1599138000000+0300)\/", + "\/Date(1599138900000+0300)\/", + "\/Date(1599139800000+0300)\/", + "\/Date(1599140700000+0300)\/", + "\/Date(1599141600000+0300)\/", + "\/Date(1599142500000+0300)\/", + "\/Date(1599143400000+0300)\/", + "\/Date(1599144300000+0300)\/", + "\/Date(1599145200000+0300)\/", + "\/Date(1599146100000+0300)\/", + "\/Date(1599147000000+0300)\/", + "\/Date(1599147900000+0300)\/", + "\/Date(1599148800000+0300)\/", + "\/Date(1599149700000+0300)\/", + "\/Date(1599150600000+0300)\/", + "\/Date(1599151500000+0300)\/", + "\/Date(1599289200000+0300)\/", + "\/Date(1599290100000+0300)\/", + "\/Date(1599291000000+0300)\/", + "\/Date(1599291900000+0300)\/", + "\/Date(1599292800000+0300)\/", + "\/Date(1599293700000+0300)\/", + "\/Date(1599294600000+0300)\/", + "\/Date(1599295500000+0300)\/", + "\/Date(1599296400000+0300)\/", + "\/Date(1599297300000+0300)\/", + "\/Date(1599298200000+0300)\/", + "\/Date(1599299100000+0300)\/", + "\/Date(1599300000000+0300)\/", + "\/Date(1599300900000+0300)\/", + "\/Date(1599301800000+0300)\/", + "\/Date(1599302700000+0300)\/", + "\/Date(1599400800000+0300)\/", + "\/Date(1599401700000+0300)\/", + "\/Date(1599402600000+0300)\/", + "\/Date(1599403500000+0300)\/", + "\/Date(1599404400000+0300)\/", + "\/Date(1599405300000+0300)\/", + "\/Date(1599406200000+0300)\/", + "\/Date(1599407100000+0300)\/", + "\/Date(1599408000000+0300)\/", + "\/Date(1599408900000+0300)\/", + "\/Date(1599409800000+0300)\/", + "\/Date(1599410700000+0300)\/", + "\/Date(1599411600000+0300)\/", + "\/Date(1599412500000+0300)\/", + "\/Date(1599413400000+0300)\/", + "\/Date(1599414300000+0300)\/", + "\/Date(1599487200000+0300)\/", + "\/Date(1599488100000+0300)\/", + "\/Date(1599489000000+0300)\/", + "\/Date(1599489900000+0300)\/", + "\/Date(1599490800000+0300)\/", + "\/Date(1599491700000+0300)\/", + "\/Date(1599492600000+0300)\/", + "\/Date(1599493500000+0300)\/", + "\/Date(1599494400000+0300)\/", + "\/Date(1599495300000+0300)\/", + "\/Date(1599496200000+0300)\/", + "\/Date(1599497100000+0300)\/", + "\/Date(1599498000000+0300)\/", + "\/Date(1599498900000+0300)\/", + "\/Date(1599499800000+0300)\/", + "\/Date(1599500700000+0300)\/", + "\/Date(1599573600000+0300)\/", + "\/Date(1599574500000+0300)\/", + "\/Date(1599575400000+0300)\/", + "\/Date(1599576300000+0300)\/", + "\/Date(1599577200000+0300)\/", + "\/Date(1599578100000+0300)\/", + "\/Date(1599579000000+0300)\/", + "\/Date(1599579900000+0300)\/", + "\/Date(1599580800000+0300)\/", + "\/Date(1599581700000+0300)\/", + "\/Date(1599582600000+0300)\/", + "\/Date(1599583500000+0300)\/", + "\/Date(1599584400000+0300)\/", + "\/Date(1599585300000+0300)\/", + "\/Date(1599586200000+0300)\/", + "\/Date(1599587100000+0300)\/", + "\/Date(1599660000000+0300)\/", + "\/Date(1599660900000+0300)\/", + "\/Date(1599661800000+0300)\/", + "\/Date(1599662700000+0300)\/", + "\/Date(1599663600000+0300)\/", + "\/Date(1599664500000+0300)\/", + "\/Date(1599665400000+0300)\/", + "\/Date(1599666300000+0300)\/", + "\/Date(1599667200000+0300)\/", + "\/Date(1599668100000+0300)\/", + "\/Date(1599669000000+0300)\/", + "\/Date(1599669900000+0300)\/", + "\/Date(1599670800000+0300)\/", + "\/Date(1599671700000+0300)\/", + "\/Date(1599672600000+0300)\/", + "\/Date(1599673500000+0300)\/", + "\/Date(1599742800000+0300)\/", + "\/Date(1599743700000+0300)\/", + "\/Date(1599744600000+0300)\/", + "\/Date(1599745500000+0300)\/", + "\/Date(1599746400000+0300)\/", + "\/Date(1599747300000+0300)\/", + "\/Date(1599748200000+0300)\/", + "\/Date(1599749100000+0300)\/", + "\/Date(1599750000000+0300)\/", + "\/Date(1599750900000+0300)\/", + "\/Date(1599751800000+0300)\/", + "\/Date(1599752700000+0300)\/", + "\/Date(1599753600000+0300)\/", + "\/Date(1599754500000+0300)\/", + "\/Date(1599755400000+0300)\/", + "\/Date(1599756300000+0300)\/", + "\/Date(1599894000000+0300)\/", + "\/Date(1599894900000+0300)\/", + "\/Date(1599895800000+0300)\/", + "\/Date(1599896700000+0300)\/", + "\/Date(1599897600000+0300)\/", + "\/Date(1599898500000+0300)\/", + "\/Date(1599899400000+0300)\/", + "\/Date(1599900300000+0300)\/", + "\/Date(1599901200000+0300)\/", + "\/Date(1599902100000+0300)\/", + "\/Date(1599903000000+0300)\/", + "\/Date(1599903900000+0300)\/", + "\/Date(1599904800000+0300)\/", + "\/Date(1599905700000+0300)\/", + "\/Date(1599906600000+0300)\/", + "\/Date(1599907500000+0300)\/", + "\/Date(1600005600000+0300)\/", + "\/Date(1600006500000+0300)\/", + "\/Date(1600007400000+0300)\/", + "\/Date(1600008300000+0300)\/", + "\/Date(1600009200000+0300)\/", + "\/Date(1600010100000+0300)\/", + "\/Date(1600011000000+0300)\/", + "\/Date(1600011900000+0300)\/", + "\/Date(1600012800000+0300)\/", + "\/Date(1600013700000+0300)\/", + "\/Date(1600014600000+0300)\/", + "\/Date(1600015500000+0300)\/", + "\/Date(1600016400000+0300)\/", + "\/Date(1600017300000+0300)\/", + "\/Date(1600018200000+0300)\/", + "\/Date(1600019100000+0300)\/", + "\/Date(1600092000000+0300)\/", + "\/Date(1600092900000+0300)\/", + "\/Date(1600093800000+0300)\/", + "\/Date(1600094700000+0300)\/", + "\/Date(1600095600000+0300)\/", + "\/Date(1600096500000+0300)\/", + "\/Date(1600097400000+0300)\/", + "\/Date(1600098300000+0300)\/", + "\/Date(1600099200000+0300)\/", + "\/Date(1600100100000+0300)\/", + "\/Date(1600101000000+0300)\/", + "\/Date(1600101900000+0300)\/", + "\/Date(1600102800000+0300)\/", + "\/Date(1600103700000+0300)\/", + "\/Date(1600104600000+0300)\/", + "\/Date(1600105500000+0300)\/", + "\/Date(1600178400000+0300)\/", + "\/Date(1600179300000+0300)\/", + "\/Date(1600180200000+0300)\/", + "\/Date(1600181100000+0300)\/", + "\/Date(1600182000000+0300)\/", + "\/Date(1600182900000+0300)\/", + "\/Date(1600183800000+0300)\/", + "\/Date(1600184700000+0300)\/", + "\/Date(1600185600000+0300)\/", + "\/Date(1600186500000+0300)\/", + "\/Date(1600187400000+0300)\/", + "\/Date(1600188300000+0300)\/", + "\/Date(1600189200000+0300)\/", + "\/Date(1600190100000+0300)\/", + "\/Date(1600191000000+0300)\/", + "\/Date(1600191900000+0300)\/", + "\/Date(1600264800000+0300)\/", + "\/Date(1600265700000+0300)\/", + "\/Date(1600266600000+0300)\/", + "\/Date(1600267500000+0300)\/", + "\/Date(1600268400000+0300)\/", + "\/Date(1600269300000+0300)\/", + "\/Date(1600270200000+0300)\/", + "\/Date(1600271100000+0300)\/", + "\/Date(1600272000000+0300)\/", + "\/Date(1600272900000+0300)\/", + "\/Date(1600273800000+0300)\/", + "\/Date(1600274700000+0300)\/", + "\/Date(1600275600000+0300)\/", + "\/Date(1600276500000+0300)\/", + "\/Date(1600277400000+0300)\/", + "\/Date(1600278300000+0300)\/", + "\/Date(1600347600000+0300)\/", + "\/Date(1600348500000+0300)\/", + "\/Date(1600349400000+0300)\/", + "\/Date(1600350300000+0300)\/", + "\/Date(1600351200000+0300)\/", + "\/Date(1600352100000+0300)\/", + "\/Date(1600353000000+0300)\/", + "\/Date(1600353900000+0300)\/", + "\/Date(1600354800000+0300)\/", + "\/Date(1600355700000+0300)\/", + "\/Date(1600356600000+0300)\/", + "\/Date(1600357500000+0300)\/", + "\/Date(1600358400000+0300)\/", + "\/Date(1600359300000+0300)\/", + "\/Date(1600360200000+0300)\/", + "\/Date(1600361100000+0300)\/", + "\/Date(1600498800000+0300)\/", + "\/Date(1600499700000+0300)\/", + "\/Date(1600500600000+0300)\/", + "\/Date(1600501500000+0300)\/", + "\/Date(1600502400000+0300)\/", + "\/Date(1600503300000+0300)\/", + "\/Date(1600504200000+0300)\/", + "\/Date(1600505100000+0300)\/", + "\/Date(1600506000000+0300)\/", + "\/Date(1600506900000+0300)\/", + "\/Date(1600507800000+0300)\/", + "\/Date(1600508700000+0300)\/", + "\/Date(1600509600000+0300)\/", + "\/Date(1600510500000+0300)\/", + "\/Date(1600511400000+0300)\/", + "\/Date(1600512300000+0300)\/", + "\/Date(1600610400000+0300)\/", + "\/Date(1600611300000+0300)\/", + "\/Date(1600612200000+0300)\/", + "\/Date(1600613100000+0300)\/", + "\/Date(1600614000000+0300)\/", + "\/Date(1600614900000+0300)\/", + "\/Date(1600615800000+0300)\/", + "\/Date(1600616700000+0300)\/", + "\/Date(1600617600000+0300)\/", + "\/Date(1600618500000+0300)\/", + "\/Date(1600619400000+0300)\/", + "\/Date(1600620300000+0300)\/", + "\/Date(1600621200000+0300)\/", + "\/Date(1600622100000+0300)\/", + "\/Date(1600623000000+0300)\/", + "\/Date(1600623900000+0300)\/", + "\/Date(1600696800000+0300)\/", + "\/Date(1600697700000+0300)\/", + "\/Date(1600698600000+0300)\/", + "\/Date(1600699500000+0300)\/", + "\/Date(1600700400000+0300)\/", + "\/Date(1600701300000+0300)\/", + "\/Date(1600702200000+0300)\/", + "\/Date(1600703100000+0300)\/", + "\/Date(1600704000000+0300)\/", + "\/Date(1600704900000+0300)\/", + "\/Date(1600705800000+0300)\/", + "\/Date(1600706700000+0300)\/", + "\/Date(1600707600000+0300)\/", + "\/Date(1600708500000+0300)\/", + "\/Date(1600709400000+0300)\/", + "\/Date(1600710300000+0300)\/", + "\/Date(1600783200000+0300)\/", + "\/Date(1600784100000+0300)\/", + "\/Date(1600785000000+0300)\/", + "\/Date(1600785900000+0300)\/", + "\/Date(1600786800000+0300)\/", + "\/Date(1600787700000+0300)\/", + "\/Date(1600788600000+0300)\/", + "\/Date(1600789500000+0300)\/", + "\/Date(1600790400000+0300)\/", + "\/Date(1600791300000+0300)\/", + "\/Date(1600792200000+0300)\/", + "\/Date(1600793100000+0300)\/", + "\/Date(1600794000000+0300)\/", + "\/Date(1600794900000+0300)\/", + "\/Date(1600795800000+0300)\/", + "\/Date(1600796700000+0300)\/", + "\/Date(1600869600000+0300)\/", + "\/Date(1600870500000+0300)\/", + "\/Date(1600871400000+0300)\/", + "\/Date(1600872300000+0300)\/", + "\/Date(1600873200000+0300)\/", + "\/Date(1600874100000+0300)\/", + "\/Date(1600875000000+0300)\/", + "\/Date(1600875900000+0300)\/", + "\/Date(1600876800000+0300)\/", + "\/Date(1600877700000+0300)\/", + "\/Date(1600878600000+0300)\/", + "\/Date(1600879500000+0300)\/", + "\/Date(1600880400000+0300)\/", + "\/Date(1600881300000+0300)\/", + "\/Date(1600882200000+0300)\/", + "\/Date(1600883100000+0300)\/", + "\/Date(1600952400000+0300)\/", + "\/Date(1600953300000+0300)\/", + "\/Date(1600954200000+0300)\/", + "\/Date(1600955100000+0300)\/", + "\/Date(1600956000000+0300)\/", + "\/Date(1600956900000+0300)\/", + "\/Date(1600957800000+0300)\/", + "\/Date(1600958700000+0300)\/", + "\/Date(1600959600000+0300)\/", + "\/Date(1600960500000+0300)\/", + "\/Date(1600961400000+0300)\/", + "\/Date(1600962300000+0300)\/", + "\/Date(1600963200000+0300)\/", + "\/Date(1600964100000+0300)\/", + "\/Date(1600965000000+0300)\/", + "\/Date(1600965900000+0300)\/", + "\/Date(1601103600000+0300)\/", + "\/Date(1601104500000+0300)\/", + "\/Date(1601105400000+0300)\/", + "\/Date(1601106300000+0300)\/", + "\/Date(1601107200000+0300)\/", + "\/Date(1601108100000+0300)\/", + "\/Date(1601109000000+0300)\/", + "\/Date(1601109900000+0300)\/", + "\/Date(1601110800000+0300)\/", + "\/Date(1601111700000+0300)\/", + "\/Date(1601112600000+0300)\/", + "\/Date(1601113500000+0300)\/", + "\/Date(1601114400000+0300)\/", + "\/Date(1601115300000+0300)\/", + "\/Date(1601116200000+0300)\/", + "\/Date(1601117100000+0300)\/", + "\/Date(1601215200000+0300)\/", + "\/Date(1601216100000+0300)\/", + "\/Date(1601217000000+0300)\/", + "\/Date(1601217900000+0300)\/", + "\/Date(1601218800000+0300)\/", + "\/Date(1601219700000+0300)\/", + "\/Date(1601220600000+0300)\/", + "\/Date(1601221500000+0300)\/", + "\/Date(1601222400000+0300)\/", + "\/Date(1601223300000+0300)\/", + "\/Date(1601224200000+0300)\/", + "\/Date(1601225100000+0300)\/", + "\/Date(1601226000000+0300)\/", + "\/Date(1601226900000+0300)\/", + "\/Date(1601227800000+0300)\/", + "\/Date(1601228700000+0300)\/", + "\/Date(1601301600000+0300)\/", + "\/Date(1601302500000+0300)\/", + "\/Date(1601303400000+0300)\/", + "\/Date(1601304300000+0300)\/", + "\/Date(1601305200000+0300)\/", + "\/Date(1601306100000+0300)\/", + "\/Date(1601307000000+0300)\/", + "\/Date(1601307900000+0300)\/", + "\/Date(1601308800000+0300)\/", + "\/Date(1601309700000+0300)\/", + "\/Date(1601310600000+0300)\/", + "\/Date(1601311500000+0300)\/", + "\/Date(1601312400000+0300)\/", + "\/Date(1601313300000+0300)\/", + "\/Date(1601314200000+0300)\/", + "\/Date(1601315100000+0300)\/", + "\/Date(1601388000000+0300)\/", + "\/Date(1601388900000+0300)\/", + "\/Date(1601389800000+0300)\/", + "\/Date(1601390700000+0300)\/", + "\/Date(1601391600000+0300)\/", + "\/Date(1601392500000+0300)\/", + "\/Date(1601393400000+0300)\/", + "\/Date(1601394300000+0300)\/", + "\/Date(1601395200000+0300)\/", + "\/Date(1601396100000+0300)\/", + "\/Date(1601397000000+0300)\/", + "\/Date(1601397900000+0300)\/", + "\/Date(1601398800000+0300)\/", + "\/Date(1601399700000+0300)\/", + "\/Date(1601400600000+0300)\/", + "\/Date(1601401500000+0300)\/", + "\/Date(1601474400000+0300)\/", + "\/Date(1601475300000+0300)\/", + "\/Date(1601476200000+0300)\/", + "\/Date(1601477100000+0300)\/", + "\/Date(1601478000000+0300)\/", + "\/Date(1601478900000+0300)\/", + "\/Date(1601479800000+0300)\/", + "\/Date(1601480700000+0300)\/", + "\/Date(1601481600000+0300)\/", + "\/Date(1601482500000+0300)\/", + "\/Date(1601483400000+0300)\/", + "\/Date(1601484300000+0300)\/", + "\/Date(1601485200000+0300)\/", + "\/Date(1601486100000+0300)\/", + "\/Date(1601487000000+0300)\/", + "\/Date(1601487900000+0300)\/", + "\/Date(1601557200000+0300)\/", + "\/Date(1601558100000+0300)\/", + "\/Date(1601559000000+0300)\/", + "\/Date(1601559900000+0300)\/", + "\/Date(1601560800000+0300)\/", + "\/Date(1601561700000+0300)\/", + "\/Date(1601562600000+0300)\/", + "\/Date(1601563500000+0300)\/", + "\/Date(1601564400000+0300)\/", + "\/Date(1601565300000+0300)\/", + "\/Date(1601566200000+0300)\/", + "\/Date(1601567100000+0300)\/", + "\/Date(1601568000000+0300)\/", + "\/Date(1601568900000+0300)\/", + "\/Date(1601569800000+0300)\/", + "\/Date(1601570700000+0300)\/", + "\/Date(1601708400000+0300)\/", + "\/Date(1601709300000+0300)\/", + "\/Date(1601710200000+0300)\/", + "\/Date(1601711100000+0300)\/", + "\/Date(1601712000000+0300)\/", + "\/Date(1601712900000+0300)\/", + "\/Date(1601713800000+0300)\/", + "\/Date(1601714700000+0300)\/", + "\/Date(1601715600000+0300)\/", + "\/Date(1601716500000+0300)\/", + "\/Date(1601717400000+0300)\/", + "\/Date(1601718300000+0300)\/", + "\/Date(1601719200000+0300)\/", + "\/Date(1601720100000+0300)\/", + "\/Date(1601721000000+0300)\/", + "\/Date(1601721900000+0300)\/", + "\/Date(1601820000000+0300)\/", + "\/Date(1601820900000+0300)\/", + "\/Date(1601821800000+0300)\/", + "\/Date(1601822700000+0300)\/", + "\/Date(1601823600000+0300)\/", + "\/Date(1601824500000+0300)\/", + "\/Date(1601825400000+0300)\/", + "\/Date(1601826300000+0300)\/", + "\/Date(1601827200000+0300)\/", + "\/Date(1601828100000+0300)\/", + "\/Date(1601829000000+0300)\/", + "\/Date(1601829900000+0300)\/", + "\/Date(1601830800000+0300)\/", + "\/Date(1601831700000+0300)\/", + "\/Date(1601832600000+0300)\/", + "\/Date(1601833500000+0300)\/", + "\/Date(1601906400000+0300)\/", + "\/Date(1601907300000+0300)\/", + "\/Date(1601908200000+0300)\/", + "\/Date(1601909100000+0300)\/", + "\/Date(1601910000000+0300)\/", + "\/Date(1601910900000+0300)\/", + "\/Date(1601911800000+0300)\/", + "\/Date(1601912700000+0300)\/", + "\/Date(1601913600000+0300)\/", + "\/Date(1601914500000+0300)\/", + "\/Date(1601915400000+0300)\/", + "\/Date(1601916300000+0300)\/", + "\/Date(1601917200000+0300)\/", + "\/Date(1601918100000+0300)\/", + "\/Date(1601919000000+0300)\/", + "\/Date(1601919900000+0300)\/", + "\/Date(1601992800000+0300)\/", + "\/Date(1601993700000+0300)\/", + "\/Date(1601994600000+0300)\/", + "\/Date(1601995500000+0300)\/", + "\/Date(1601996400000+0300)\/", + "\/Date(1601997300000+0300)\/", + "\/Date(1601998200000+0300)\/", + "\/Date(1601999100000+0300)\/", + "\/Date(1602000000000+0300)\/", + "\/Date(1602000900000+0300)\/", + "\/Date(1602001800000+0300)\/", + "\/Date(1602002700000+0300)\/", + "\/Date(1602003600000+0300)\/", + "\/Date(1602004500000+0300)\/", + "\/Date(1602005400000+0300)\/", + "\/Date(1602006300000+0300)\/", + "\/Date(1602079200000+0300)\/", + "\/Date(1602080100000+0300)\/", + "\/Date(1602081000000+0300)\/", + "\/Date(1602081900000+0300)\/", + "\/Date(1602082800000+0300)\/", + "\/Date(1602083700000+0300)\/", + "\/Date(1602084600000+0300)\/", + "\/Date(1602085500000+0300)\/", + "\/Date(1602086400000+0300)\/", + "\/Date(1602087300000+0300)\/", + "\/Date(1602088200000+0300)\/", + "\/Date(1602089100000+0300)\/", + "\/Date(1602090000000+0300)\/", + "\/Date(1602090900000+0300)\/", + "\/Date(1602091800000+0300)\/", + "\/Date(1602092700000+0300)\/", + "\/Date(1602162000000+0300)\/", + "\/Date(1602162900000+0300)\/", + "\/Date(1602163800000+0300)\/", + "\/Date(1602164700000+0300)\/", + "\/Date(1602165600000+0300)\/", + "\/Date(1602166500000+0300)\/", + "\/Date(1602167400000+0300)\/", + "\/Date(1602168300000+0300)\/", + "\/Date(1602169200000+0300)\/", + "\/Date(1602170100000+0300)\/", + "\/Date(1602171000000+0300)\/", + "\/Date(1602171900000+0300)\/", + "\/Date(1602172800000+0300)\/", + "\/Date(1602173700000+0300)\/", + "\/Date(1602174600000+0300)\/", + "\/Date(1602175500000+0300)\/", + "\/Date(1602313200000+0300)\/", + "\/Date(1602314100000+0300)\/", + "\/Date(1602315000000+0300)\/", + "\/Date(1602315900000+0300)\/", + "\/Date(1602316800000+0300)\/", + "\/Date(1602317700000+0300)\/", + "\/Date(1602318600000+0300)\/", + "\/Date(1602319500000+0300)\/", + "\/Date(1602320400000+0300)\/", + "\/Date(1602321300000+0300)\/", + "\/Date(1602322200000+0300)\/", + "\/Date(1602323100000+0300)\/", + "\/Date(1602324000000+0300)\/", + "\/Date(1602324900000+0300)\/", + "\/Date(1602325800000+0300)\/", + "\/Date(1602326700000+0300)\/", + "\/Date(1602424800000+0300)\/", + "\/Date(1602425700000+0300)\/", + "\/Date(1602426600000+0300)\/", + "\/Date(1602427500000+0300)\/", + "\/Date(1602428400000+0300)\/", + "\/Date(1602429300000+0300)\/", + "\/Date(1602430200000+0300)\/", + "\/Date(1602431100000+0300)\/", + "\/Date(1602432000000+0300)\/", + "\/Date(1602432900000+0300)\/", + "\/Date(1602433800000+0300)\/", + "\/Date(1602434700000+0300)\/", + "\/Date(1602435600000+0300)\/", + "\/Date(1602436500000+0300)\/", + "\/Date(1602437400000+0300)\/", + "\/Date(1602438300000+0300)\/", + "\/Date(1602511200000+0300)\/", + "\/Date(1602512100000+0300)\/", + "\/Date(1602513000000+0300)\/", + "\/Date(1602513900000+0300)\/", + "\/Date(1602514800000+0300)\/", + "\/Date(1602515700000+0300)\/", + "\/Date(1602516600000+0300)\/", + "\/Date(1602517500000+0300)\/", + "\/Date(1602518400000+0300)\/", + "\/Date(1602519300000+0300)\/", + "\/Date(1602520200000+0300)\/", + "\/Date(1602521100000+0300)\/", + "\/Date(1602522000000+0300)\/", + "\/Date(1602522900000+0300)\/", + "\/Date(1602523800000+0300)\/", + "\/Date(1602524700000+0300)\/", + "\/Date(1602597600000+0300)\/", + "\/Date(1602598500000+0300)\/", + "\/Date(1602599400000+0300)\/", + "\/Date(1602600300000+0300)\/", + "\/Date(1602601200000+0300)\/", + "\/Date(1602602100000+0300)\/", + "\/Date(1602603000000+0300)\/", + "\/Date(1602603900000+0300)\/", + "\/Date(1602604800000+0300)\/", + "\/Date(1602605700000+0300)\/", + "\/Date(1602606600000+0300)\/", + "\/Date(1602607500000+0300)\/", + "\/Date(1602608400000+0300)\/", + "\/Date(1602609300000+0300)\/", + "\/Date(1602610200000+0300)\/", + "\/Date(1602611100000+0300)\/", + "\/Date(1602684000000+0300)\/", + "\/Date(1602684900000+0300)\/", + "\/Date(1602685800000+0300)\/", + "\/Date(1602686700000+0300)\/", + "\/Date(1602687600000+0300)\/", + "\/Date(1602688500000+0300)\/", + "\/Date(1602689400000+0300)\/", + "\/Date(1602690300000+0300)\/", + "\/Date(1602691200000+0300)\/", + "\/Date(1602692100000+0300)\/", + "\/Date(1602693000000+0300)\/", + "\/Date(1602693900000+0300)\/", + "\/Date(1602694800000+0300)\/", + "\/Date(1602695700000+0300)\/", + "\/Date(1602696600000+0300)\/", + "\/Date(1602697500000+0300)\/", + "\/Date(1602766800000+0300)\/", + "\/Date(1602767700000+0300)\/", + "\/Date(1602768600000+0300)\/", + "\/Date(1602769500000+0300)\/", + "\/Date(1602770400000+0300)\/", + "\/Date(1602771300000+0300)\/", + "\/Date(1602772200000+0300)\/", + "\/Date(1602773100000+0300)\/", + "\/Date(1602774000000+0300)\/", + "\/Date(1602774900000+0300)\/", + "\/Date(1602775800000+0300)\/", + "\/Date(1602776700000+0300)\/", + "\/Date(1602777600000+0300)\/", + "\/Date(1602778500000+0300)\/", + "\/Date(1602779400000+0300)\/", + "\/Date(1602780300000+0300)\/", + "\/Date(1602918000000+0300)\/", + "\/Date(1602918900000+0300)\/", + "\/Date(1602919800000+0300)\/", + "\/Date(1602920700000+0300)\/", + "\/Date(1602921600000+0300)\/", + "\/Date(1602922500000+0300)\/", + "\/Date(1602923400000+0300)\/", + "\/Date(1602924300000+0300)\/", + "\/Date(1602925200000+0300)\/", + "\/Date(1602926100000+0300)\/", + "\/Date(1602927000000+0300)\/", + "\/Date(1602927900000+0300)\/", + "\/Date(1602928800000+0300)\/", + "\/Date(1602929700000+0300)\/", + "\/Date(1602930600000+0300)\/", + "\/Date(1602931500000+0300)\/", + "\/Date(1603029600000+0300)\/", + "\/Date(1603030500000+0300)\/", + "\/Date(1603031400000+0300)\/", + "\/Date(1603032300000+0300)\/", + "\/Date(1603033200000+0300)\/", + "\/Date(1603034100000+0300)\/", + "\/Date(1603035000000+0300)\/", + "\/Date(1603035900000+0300)\/", + "\/Date(1603036800000+0300)\/", + "\/Date(1603037700000+0300)\/", + "\/Date(1603038600000+0300)\/", + "\/Date(1603039500000+0300)\/", + "\/Date(1603040400000+0300)\/", + "\/Date(1603041300000+0300)\/", + "\/Date(1603042200000+0300)\/", + "\/Date(1603043100000+0300)\/", + "\/Date(1603116000000+0300)\/", + "\/Date(1603116900000+0300)\/", + "\/Date(1603117800000+0300)\/", + "\/Date(1603118700000+0300)\/", + "\/Date(1603119600000+0300)\/", + "\/Date(1603120500000+0300)\/", + "\/Date(1603121400000+0300)\/", + "\/Date(1603122300000+0300)\/", + "\/Date(1603123200000+0300)\/", + "\/Date(1603124100000+0300)\/", + "\/Date(1603125000000+0300)\/", + "\/Date(1603125900000+0300)\/", + "\/Date(1603126800000+0300)\/", + "\/Date(1603127700000+0300)\/", + "\/Date(1603128600000+0300)\/", + "\/Date(1603129500000+0300)\/", + "\/Date(1603202400000+0300)\/", + "\/Date(1603203300000+0300)\/", + "\/Date(1603204200000+0300)\/", + "\/Date(1603205100000+0300)\/", + "\/Date(1603206000000+0300)\/", + "\/Date(1603206900000+0300)\/", + "\/Date(1603207800000+0300)\/", + "\/Date(1603208700000+0300)\/", + "\/Date(1603209600000+0300)\/", + "\/Date(1603210500000+0300)\/", + "\/Date(1603211400000+0300)\/", + "\/Date(1603212300000+0300)\/", + "\/Date(1603213200000+0300)\/", + "\/Date(1603214100000+0300)\/", + "\/Date(1603215000000+0300)\/", + "\/Date(1603215900000+0300)\/", + "\/Date(1603288800000+0300)\/", + "\/Date(1603289700000+0300)\/", + "\/Date(1603290600000+0300)\/", + "\/Date(1603291500000+0300)\/", + "\/Date(1603292400000+0300)\/", + "\/Date(1603293300000+0300)\/", + "\/Date(1603294200000+0300)\/", + "\/Date(1603295100000+0300)\/", + "\/Date(1603296000000+0300)\/", + "\/Date(1603296900000+0300)\/", + "\/Date(1603297800000+0300)\/", + "\/Date(1603298700000+0300)\/", + "\/Date(1603299600000+0300)\/", + "\/Date(1603300500000+0300)\/", + "\/Date(1603301400000+0300)\/", + "\/Date(1603302300000+0300)\/", + "\/Date(1603371600000+0300)\/", + "\/Date(1603372500000+0300)\/", + "\/Date(1603373400000+0300)\/", + "\/Date(1603374300000+0300)\/", + "\/Date(1603375200000+0300)\/", + "\/Date(1603376100000+0300)\/", + "\/Date(1603377000000+0300)\/", + "\/Date(1603377900000+0300)\/", + "\/Date(1603378800000+0300)\/", + "\/Date(1603379700000+0300)\/", + "\/Date(1603380600000+0300)\/", + "\/Date(1603381500000+0300)\/", + "\/Date(1603382400000+0300)\/", + "\/Date(1603383300000+0300)\/", + "\/Date(1603384200000+0300)\/", + "\/Date(1603385100000+0300)\/", + "\/Date(1603522800000+0300)\/", + "\/Date(1603523700000+0300)\/", + "\/Date(1603524600000+0300)\/", + "\/Date(1603525500000+0300)\/", + "\/Date(1603526400000+0300)\/", + "\/Date(1603527300000+0300)\/", + "\/Date(1603528200000+0300)\/", + "\/Date(1603529100000+0300)\/", + "\/Date(1603530000000+0300)\/", + "\/Date(1603530900000+0300)\/", + "\/Date(1603531800000+0300)\/", + "\/Date(1603532700000+0300)\/", + "\/Date(1603533600000+0300)\/", + "\/Date(1603534500000+0300)\/", + "\/Date(1603535400000+0300)\/", + "\/Date(1603536300000+0300)\/", + "\/Date(1603634400000+0300)\/", + "\/Date(1603635300000+0300)\/", + "\/Date(1603636200000+0300)\/", + "\/Date(1603637100000+0300)\/", + "\/Date(1603638000000+0300)\/", + "\/Date(1603638900000+0300)\/", + "\/Date(1603639800000+0300)\/", + "\/Date(1603640700000+0300)\/", + "\/Date(1603641600000+0300)\/", + "\/Date(1603642500000+0300)\/", + "\/Date(1603643400000+0300)\/", + "\/Date(1603644300000+0300)\/", + "\/Date(1603645200000+0300)\/", + "\/Date(1603646100000+0300)\/", + "\/Date(1603647000000+0300)\/", + "\/Date(1603647900000+0300)\/", + "\/Date(1603720800000+0300)\/", + "\/Date(1603721700000+0300)\/", + "\/Date(1603722600000+0300)\/", + "\/Date(1603723500000+0300)\/", + "\/Date(1603724400000+0300)\/", + "\/Date(1603725300000+0300)\/", + "\/Date(1603726200000+0300)\/", + "\/Date(1603727100000+0300)\/", + "\/Date(1603728000000+0300)\/", + "\/Date(1603728900000+0300)\/", + "\/Date(1603729800000+0300)\/", + "\/Date(1603730700000+0300)\/", + "\/Date(1603731600000+0300)\/", + "\/Date(1603732500000+0300)\/", + "\/Date(1603733400000+0300)\/", + "\/Date(1603734300000+0300)\/", + "\/Date(1603807200000+0300)\/", + "\/Date(1603808100000+0300)\/", + "\/Date(1603809000000+0300)\/", + "\/Date(1603809900000+0300)\/", + "\/Date(1603810800000+0300)\/", + "\/Date(1603811700000+0300)\/", + "\/Date(1603812600000+0300)\/", + "\/Date(1603813500000+0300)\/", + "\/Date(1603814400000+0300)\/", + "\/Date(1603815300000+0300)\/", + "\/Date(1603816200000+0300)\/", + "\/Date(1603817100000+0300)\/", + "\/Date(1603818000000+0300)\/", + "\/Date(1603818900000+0300)\/", + "\/Date(1603819800000+0300)\/", + "\/Date(1603820700000+0300)\/", + "\/Date(1603893600000+0300)\/", + "\/Date(1603894500000+0300)\/", + "\/Date(1603895400000+0300)\/", + "\/Date(1603896300000+0300)\/", + "\/Date(1603897200000+0300)\/", + "\/Date(1603898100000+0300)\/", + "\/Date(1603899000000+0300)\/", + "\/Date(1603899900000+0300)\/", + "\/Date(1603900800000+0300)\/", + "\/Date(1603901700000+0300)\/", + "\/Date(1603902600000+0300)\/", + "\/Date(1603903500000+0300)\/", + "\/Date(1603904400000+0300)\/", + "\/Date(1603905300000+0300)\/", + "\/Date(1603906200000+0300)\/", + "\/Date(1603907100000+0300)\/", + "\/Date(1603976400000+0300)\/", + "\/Date(1603977300000+0300)\/", + "\/Date(1603978200000+0300)\/", + "\/Date(1603979100000+0300)\/", + "\/Date(1603980000000+0300)\/", + "\/Date(1603980900000+0300)\/", + "\/Date(1603981800000+0300)\/", + "\/Date(1603982700000+0300)\/", + "\/Date(1603983600000+0300)\/", + "\/Date(1603984500000+0300)\/", + "\/Date(1603985400000+0300)\/", + "\/Date(1603986300000+0300)\/", + "\/Date(1603987200000+0300)\/", + "\/Date(1603988100000+0300)\/", + "\/Date(1603989000000+0300)\/", + "\/Date(1603989900000+0300)\/", + "\/Date(1604127600000+0300)\/", + "\/Date(1604128500000+0300)\/", + "\/Date(1604129400000+0300)\/", + "\/Date(1604130300000+0300)\/", + "\/Date(1604131200000+0300)\/", + "\/Date(1604132100000+0300)\/", + "\/Date(1604133000000+0300)\/", + "\/Date(1604133900000+0300)\/", + "\/Date(1604134800000+0300)\/", + "\/Date(1604135700000+0300)\/", + "\/Date(1604136600000+0300)\/", + "\/Date(1604137500000+0300)\/", + "\/Date(1604138400000+0300)\/", + "\/Date(1604139300000+0300)\/", + "\/Date(1604140200000+0300)\/", + "\/Date(1604141100000+0300)\/", + "\/Date(1604239200000+0300)\/", + "\/Date(1604240100000+0300)\/", + "\/Date(1604241000000+0300)\/", + "\/Date(1604241900000+0300)\/", + "\/Date(1604242800000+0300)\/", + "\/Date(1604243700000+0300)\/", + "\/Date(1604244600000+0300)\/", + "\/Date(1604245500000+0300)\/", + "\/Date(1604246400000+0300)\/", + "\/Date(1604247300000+0300)\/", + "\/Date(1604248200000+0300)\/", + "\/Date(1604249100000+0300)\/", + "\/Date(1604250000000+0300)\/", + "\/Date(1604250900000+0300)\/", + "\/Date(1604251800000+0300)\/", + "\/Date(1604252700000+0300)\/", + "\/Date(1604325600000+0300)\/", + "\/Date(1604326500000+0300)\/", + "\/Date(1604327400000+0300)\/", + "\/Date(1604328300000+0300)\/", + "\/Date(1604329200000+0300)\/", + "\/Date(1604330100000+0300)\/", + "\/Date(1604331000000+0300)\/", + "\/Date(1604331900000+0300)\/", + "\/Date(1604332800000+0300)\/", + "\/Date(1604333700000+0300)\/", + "\/Date(1604334600000+0300)\/", + "\/Date(1604335500000+0300)\/", + "\/Date(1604336400000+0300)\/", + "\/Date(1604337300000+0300)\/", + "\/Date(1604338200000+0300)\/", + "\/Date(1604339100000+0300)\/", + "\/Date(1604412000000+0300)\/", + "\/Date(1604412900000+0300)\/", + "\/Date(1604413800000+0300)\/", + "\/Date(1604414700000+0300)\/", + "\/Date(1604415600000+0300)\/", + "\/Date(1604416500000+0300)\/", + "\/Date(1604417400000+0300)\/", + "\/Date(1604418300000+0300)\/", + "\/Date(1604419200000+0300)\/", + "\/Date(1604420100000+0300)\/", + "\/Date(1604421000000+0300)\/", + "\/Date(1604421900000+0300)\/", + "\/Date(1604422800000+0300)\/", + "\/Date(1604423700000+0300)\/", + "\/Date(1604424600000+0300)\/", + "\/Date(1604425500000+0300)\/", + "\/Date(1604498400000+0300)\/", + "\/Date(1604499300000+0300)\/", + "\/Date(1604500200000+0300)\/", + "\/Date(1604501100000+0300)\/", + "\/Date(1604502000000+0300)\/", + "\/Date(1604502900000+0300)\/", + "\/Date(1604503800000+0300)\/", + "\/Date(1604504700000+0300)\/", + "\/Date(1604505600000+0300)\/", + "\/Date(1604506500000+0300)\/", + "\/Date(1604507400000+0300)\/", + "\/Date(1604508300000+0300)\/", + "\/Date(1604509200000+0300)\/", + "\/Date(1604510100000+0300)\/", + "\/Date(1604511000000+0300)\/", + "\/Date(1604511900000+0300)\/", + "\/Date(1604581200000+0300)\/", + "\/Date(1604582100000+0300)\/", + "\/Date(1604583000000+0300)\/", + "\/Date(1604583900000+0300)\/", + "\/Date(1604584800000+0300)\/", + "\/Date(1604585700000+0300)\/", + "\/Date(1604586600000+0300)\/", + "\/Date(1604587500000+0300)\/", + "\/Date(1604588400000+0300)\/", + "\/Date(1604589300000+0300)\/", + "\/Date(1604590200000+0300)\/", + "\/Date(1604591100000+0300)\/", + "\/Date(1604592000000+0300)\/", + "\/Date(1604592900000+0300)\/", + "\/Date(1604593800000+0300)\/", + "\/Date(1604594700000+0300)\/", + "\/Date(1604732400000+0300)\/", + "\/Date(1604733300000+0300)\/", + "\/Date(1604734200000+0300)\/", + "\/Date(1604735100000+0300)\/", + "\/Date(1604736000000+0300)\/", + "\/Date(1604736900000+0300)\/", + "\/Date(1604737800000+0300)\/", + "\/Date(1604738700000+0300)\/", + "\/Date(1604739600000+0300)\/", + "\/Date(1604740500000+0300)\/", + "\/Date(1604741400000+0300)\/", + "\/Date(1604742300000+0300)\/", + "\/Date(1604743200000+0300)\/", + "\/Date(1604744100000+0300)\/", + "\/Date(1604745000000+0300)\/", + "\/Date(1604745900000+0300)\/", + "\/Date(1604844000000+0300)\/", + "\/Date(1604844900000+0300)\/", + "\/Date(1604845800000+0300)\/", + "\/Date(1604846700000+0300)\/", + "\/Date(1604847600000+0300)\/", + "\/Date(1604848500000+0300)\/", + "\/Date(1604849400000+0300)\/", + "\/Date(1604850300000+0300)\/", + "\/Date(1604851200000+0300)\/", + "\/Date(1604852100000+0300)\/", + "\/Date(1604853000000+0300)\/", + "\/Date(1604853900000+0300)\/", + "\/Date(1604854800000+0300)\/", + "\/Date(1604855700000+0300)\/", + "\/Date(1604856600000+0300)\/", + "\/Date(1604857500000+0300)\/", + "\/Date(1604930400000+0300)\/", + "\/Date(1604931300000+0300)\/", + "\/Date(1604932200000+0300)\/", + "\/Date(1604933100000+0300)\/", + "\/Date(1604934000000+0300)\/", + "\/Date(1604934900000+0300)\/", + "\/Date(1604935800000+0300)\/", + "\/Date(1604936700000+0300)\/", + "\/Date(1604937600000+0300)\/", + "\/Date(1604938500000+0300)\/", + "\/Date(1604939400000+0300)\/", + "\/Date(1604940300000+0300)\/", + "\/Date(1604941200000+0300)\/", + "\/Date(1604942100000+0300)\/", + "\/Date(1604943000000+0300)\/", + "\/Date(1604943900000+0300)\/", + "\/Date(1605016800000+0300)\/", + "\/Date(1605017700000+0300)\/", + "\/Date(1605018600000+0300)\/", + "\/Date(1605019500000+0300)\/", + "\/Date(1605020400000+0300)\/", + "\/Date(1605021300000+0300)\/", + "\/Date(1605022200000+0300)\/", + "\/Date(1605023100000+0300)\/", + "\/Date(1605024000000+0300)\/", + "\/Date(1605024900000+0300)\/", + "\/Date(1605025800000+0300)\/", + "\/Date(1605026700000+0300)\/", + "\/Date(1605027600000+0300)\/", + "\/Date(1605028500000+0300)\/", + "\/Date(1605029400000+0300)\/", + "\/Date(1605030300000+0300)\/", + "\/Date(1605103200000+0300)\/", + "\/Date(1605104100000+0300)\/", + "\/Date(1605105000000+0300)\/", + "\/Date(1605105900000+0300)\/", + "\/Date(1605106800000+0300)\/", + "\/Date(1605107700000+0300)\/", + "\/Date(1605108600000+0300)\/", + "\/Date(1605109500000+0300)\/", + "\/Date(1605110400000+0300)\/", + "\/Date(1605111300000+0300)\/", + "\/Date(1605112200000+0300)\/", + "\/Date(1605113100000+0300)\/", + "\/Date(1605114000000+0300)\/", + "\/Date(1605114900000+0300)\/", + "\/Date(1605115800000+0300)\/", + "\/Date(1605116700000+0300)\/", + "\/Date(1605186000000+0300)\/", + "\/Date(1605186900000+0300)\/", + "\/Date(1605187800000+0300)\/", + "\/Date(1605188700000+0300)\/", + "\/Date(1605189600000+0300)\/", + "\/Date(1605190500000+0300)\/", + "\/Date(1605191400000+0300)\/", + "\/Date(1605192300000+0300)\/", + "\/Date(1605193200000+0300)\/", + "\/Date(1605194100000+0300)\/", + "\/Date(1605195000000+0300)\/", + "\/Date(1605195900000+0300)\/", + "\/Date(1605196800000+0300)\/", + "\/Date(1605197700000+0300)\/", + "\/Date(1605198600000+0300)\/", + "\/Date(1605199500000+0300)\/", + "\/Date(1605337200000+0300)\/", + "\/Date(1605338100000+0300)\/", + "\/Date(1605339000000+0300)\/", + "\/Date(1605339900000+0300)\/", + "\/Date(1605340800000+0300)\/", + "\/Date(1605341700000+0300)\/", + "\/Date(1605342600000+0300)\/", + "\/Date(1605343500000+0300)\/", + "\/Date(1605344400000+0300)\/", + "\/Date(1605345300000+0300)\/", + "\/Date(1605346200000+0300)\/", + "\/Date(1605347100000+0300)\/", + "\/Date(1605348000000+0300)\/", + "\/Date(1605348900000+0300)\/", + "\/Date(1605349800000+0300)\/", + "\/Date(1605350700000+0300)\/", + "\/Date(1605448800000+0300)\/", + "\/Date(1605449700000+0300)\/", + "\/Date(1605450600000+0300)\/", + "\/Date(1605451500000+0300)\/", + "\/Date(1605452400000+0300)\/", + "\/Date(1605453300000+0300)\/", + "\/Date(1605454200000+0300)\/", + "\/Date(1605455100000+0300)\/", + "\/Date(1605456000000+0300)\/", + "\/Date(1605456900000+0300)\/", + "\/Date(1605457800000+0300)\/", + "\/Date(1605458700000+0300)\/", + "\/Date(1605459600000+0300)\/", + "\/Date(1605460500000+0300)\/", + "\/Date(1605461400000+0300)\/", + "\/Date(1605462300000+0300)\/", + "\/Date(1605535200000+0300)\/", + "\/Date(1605536100000+0300)\/", + "\/Date(1605537000000+0300)\/", + "\/Date(1605537900000+0300)\/", + "\/Date(1605538800000+0300)\/", + "\/Date(1605539700000+0300)\/", + "\/Date(1605540600000+0300)\/", + "\/Date(1605541500000+0300)\/", + "\/Date(1605542400000+0300)\/", + "\/Date(1605543300000+0300)\/", + "\/Date(1605544200000+0300)\/", + "\/Date(1605545100000+0300)\/", + "\/Date(1605546000000+0300)\/", + "\/Date(1605546900000+0300)\/", + "\/Date(1605547800000+0300)\/", + "\/Date(1605548700000+0300)\/", + "\/Date(1605621600000+0300)\/", + "\/Date(1605622500000+0300)\/", + "\/Date(1605623400000+0300)\/", + "\/Date(1605624300000+0300)\/", + "\/Date(1605625200000+0300)\/", + "\/Date(1605626100000+0300)\/", + "\/Date(1605627000000+0300)\/", + "\/Date(1605627900000+0300)\/", + "\/Date(1605628800000+0300)\/", + "\/Date(1605629700000+0300)\/", + "\/Date(1605630600000+0300)\/", + "\/Date(1605631500000+0300)\/", + "\/Date(1605632400000+0300)\/", + "\/Date(1605633300000+0300)\/", + "\/Date(1605634200000+0300)\/", + "\/Date(1605635100000+0300)\/", + "\/Date(1605708000000+0300)\/", + "\/Date(1605708900000+0300)\/", + "\/Date(1605709800000+0300)\/", + "\/Date(1605710700000+0300)\/", + "\/Date(1605711600000+0300)\/", + "\/Date(1605712500000+0300)\/", + "\/Date(1605713400000+0300)\/", + "\/Date(1605714300000+0300)\/", + "\/Date(1605715200000+0300)\/", + "\/Date(1605716100000+0300)\/", + "\/Date(1605717000000+0300)\/", + "\/Date(1605717900000+0300)\/", + "\/Date(1605718800000+0300)\/", + "\/Date(1605719700000+0300)\/", + "\/Date(1605720600000+0300)\/", + "\/Date(1605721500000+0300)\/", + "\/Date(1605790800000+0300)\/", + "\/Date(1605791700000+0300)\/", + "\/Date(1605792600000+0300)\/", + "\/Date(1605793500000+0300)\/", + "\/Date(1605794400000+0300)\/", + "\/Date(1605795300000+0300)\/", + "\/Date(1605796200000+0300)\/", + "\/Date(1605797100000+0300)\/", + "\/Date(1605798000000+0300)\/", + "\/Date(1605798900000+0300)\/", + "\/Date(1605799800000+0300)\/", + "\/Date(1605800700000+0300)\/", + "\/Date(1605801600000+0300)\/", + "\/Date(1605802500000+0300)\/", + "\/Date(1605803400000+0300)\/", + "\/Date(1605804300000+0300)\/", + "\/Date(1605942000000+0300)\/", + "\/Date(1605942900000+0300)\/", + "\/Date(1605943800000+0300)\/", + "\/Date(1605944700000+0300)\/", + "\/Date(1605945600000+0300)\/", + "\/Date(1605946500000+0300)\/", + "\/Date(1605947400000+0300)\/", + "\/Date(1605948300000+0300)\/", + "\/Date(1605949200000+0300)\/", + "\/Date(1605950100000+0300)\/", + "\/Date(1605951000000+0300)\/", + "\/Date(1605951900000+0300)\/", + "\/Date(1605952800000+0300)\/", + "\/Date(1605953700000+0300)\/", + "\/Date(1605954600000+0300)\/", + "\/Date(1605955500000+0300)\/", + "\/Date(1606053600000+0300)\/", + "\/Date(1606054500000+0300)\/", + "\/Date(1606055400000+0300)\/", + "\/Date(1606056300000+0300)\/", + "\/Date(1606057200000+0300)\/", + "\/Date(1606058100000+0300)\/", + "\/Date(1606059000000+0300)\/", + "\/Date(1606059900000+0300)\/", + "\/Date(1606060800000+0300)\/", + "\/Date(1606061700000+0300)\/", + "\/Date(1606062600000+0300)\/", + "\/Date(1606063500000+0300)\/", + "\/Date(1606064400000+0300)\/", + "\/Date(1606065300000+0300)\/", + "\/Date(1606066200000+0300)\/", + "\/Date(1606067100000+0300)\/", + "\/Date(1606140000000+0300)\/", + "\/Date(1606140900000+0300)\/", + "\/Date(1606141800000+0300)\/", + "\/Date(1606142700000+0300)\/", + "\/Date(1606143600000+0300)\/", + "\/Date(1606144500000+0300)\/", + "\/Date(1606145400000+0300)\/", + "\/Date(1606146300000+0300)\/", + "\/Date(1606147200000+0300)\/", + "\/Date(1606148100000+0300)\/", + "\/Date(1606149000000+0300)\/", + "\/Date(1606149900000+0300)\/", + "\/Date(1606150800000+0300)\/", + "\/Date(1606151700000+0300)\/", + "\/Date(1606152600000+0300)\/", + "\/Date(1606153500000+0300)\/", + "\/Date(1606226400000+0300)\/", + "\/Date(1606227300000+0300)\/", + "\/Date(1606228200000+0300)\/", + "\/Date(1606229100000+0300)\/", + "\/Date(1606230000000+0300)\/", + "\/Date(1606230900000+0300)\/", + "\/Date(1606231800000+0300)\/", + "\/Date(1606232700000+0300)\/", + "\/Date(1606233600000+0300)\/", + "\/Date(1606234500000+0300)\/", + "\/Date(1606235400000+0300)\/", + "\/Date(1606236300000+0300)\/", + "\/Date(1606237200000+0300)\/", + "\/Date(1606238100000+0300)\/", + "\/Date(1606239000000+0300)\/", + "\/Date(1606239900000+0300)\/", + "\/Date(1606312800000+0300)\/", + "\/Date(1606313700000+0300)\/", + "\/Date(1606314600000+0300)\/", + "\/Date(1606315500000+0300)\/", + "\/Date(1606316400000+0300)\/", + "\/Date(1606317300000+0300)\/", + "\/Date(1606318200000+0300)\/", + "\/Date(1606319100000+0300)\/", + "\/Date(1606320000000+0300)\/", + "\/Date(1606320900000+0300)\/", + "\/Date(1606321800000+0300)\/", + "\/Date(1606322700000+0300)\/", + "\/Date(1606323600000+0300)\/", + "\/Date(1606324500000+0300)\/", + "\/Date(1606325400000+0300)\/", + "\/Date(1606326300000+0300)\/", + "\/Date(1606395600000+0300)\/", + "\/Date(1606396500000+0300)\/", + "\/Date(1606397400000+0300)\/", + "\/Date(1606398300000+0300)\/", + "\/Date(1606399200000+0300)\/", + "\/Date(1606400100000+0300)\/", + "\/Date(1606401000000+0300)\/", + "\/Date(1606401900000+0300)\/", + "\/Date(1606402800000+0300)\/", + "\/Date(1606403700000+0300)\/", + "\/Date(1606404600000+0300)\/", + "\/Date(1606405500000+0300)\/", + "\/Date(1606406400000+0300)\/", + "\/Date(1606407300000+0300)\/", + "\/Date(1606408200000+0300)\/", + "\/Date(1606409100000+0300)\/", + "\/Date(1606546800000+0300)\/", + "\/Date(1606547700000+0300)\/", + "\/Date(1606548600000+0300)\/", + "\/Date(1606549500000+0300)\/", + "\/Date(1606550400000+0300)\/", + "\/Date(1606551300000+0300)\/", + "\/Date(1606552200000+0300)\/", + "\/Date(1606553100000+0300)\/", + "\/Date(1606554000000+0300)\/", + "\/Date(1606554900000+0300)\/", + "\/Date(1606555800000+0300)\/", + "\/Date(1606556700000+0300)\/", + "\/Date(1606557600000+0300)\/", + "\/Date(1606558500000+0300)\/", + "\/Date(1606559400000+0300)\/", + "\/Date(1606560300000+0300)\/", + "\/Date(1606658400000+0300)\/", + "\/Date(1606659300000+0300)\/", + "\/Date(1606660200000+0300)\/", + "\/Date(1606661100000+0300)\/", + "\/Date(1606662000000+0300)\/", + "\/Date(1606662900000+0300)\/", + "\/Date(1606663800000+0300)\/", + "\/Date(1606664700000+0300)\/", + "\/Date(1606665600000+0300)\/", + "\/Date(1606666500000+0300)\/", + "\/Date(1606667400000+0300)\/", + "\/Date(1606668300000+0300)\/", + "\/Date(1606669200000+0300)\/", + "\/Date(1606670100000+0300)\/", + "\/Date(1606671000000+0300)\/", + "\/Date(1606671900000+0300)\/", + "\/Date(1606744800000+0300)\/", + "\/Date(1606745700000+0300)\/", + "\/Date(1606746600000+0300)\/", + "\/Date(1606747500000+0300)\/", + "\/Date(1606748400000+0300)\/", + "\/Date(1606749300000+0300)\/", + "\/Date(1606750200000+0300)\/", + "\/Date(1606751100000+0300)\/", + "\/Date(1606752000000+0300)\/", + "\/Date(1606752900000+0300)\/", + "\/Date(1606753800000+0300)\/", + "\/Date(1606754700000+0300)\/", + "\/Date(1606755600000+0300)\/", + "\/Date(1606756500000+0300)\/", + "\/Date(1606757400000+0300)\/", + "\/Date(1606758300000+0300)\/", + "\/Date(1606831200000+0300)\/", + "\/Date(1606832100000+0300)\/", + "\/Date(1606833000000+0300)\/", + "\/Date(1606833900000+0300)\/", + "\/Date(1606834800000+0300)\/", + "\/Date(1606835700000+0300)\/", + "\/Date(1606836600000+0300)\/", + "\/Date(1606837500000+0300)\/", + "\/Date(1606838400000+0300)\/", + "\/Date(1606839300000+0300)\/", + "\/Date(1606840200000+0300)\/", + "\/Date(1606841100000+0300)\/", + "\/Date(1606842000000+0300)\/", + "\/Date(1606842900000+0300)\/", + "\/Date(1606843800000+0300)\/", + "\/Date(1606844700000+0300)\/", + "\/Date(1606917600000+0300)\/", + "\/Date(1606918500000+0300)\/", + "\/Date(1606919400000+0300)\/", + "\/Date(1606920300000+0300)\/", + "\/Date(1606921200000+0300)\/", + "\/Date(1606922100000+0300)\/", + "\/Date(1606923000000+0300)\/", + "\/Date(1606923900000+0300)\/", + "\/Date(1606924800000+0300)\/", + "\/Date(1606925700000+0300)\/", + "\/Date(1606926600000+0300)\/", + "\/Date(1606927500000+0300)\/", + "\/Date(1606928400000+0300)\/", + "\/Date(1606929300000+0300)\/", + "\/Date(1606930200000+0300)\/", + "\/Date(1606931100000+0300)\/", + "\/Date(1607000400000+0300)\/", + "\/Date(1607001300000+0300)\/", + "\/Date(1607002200000+0300)\/", + "\/Date(1607003100000+0300)\/", + "\/Date(1607004000000+0300)\/", + "\/Date(1607004900000+0300)\/", + "\/Date(1607005800000+0300)\/", + "\/Date(1607006700000+0300)\/", + "\/Date(1607007600000+0300)\/", + "\/Date(1607008500000+0300)\/", + "\/Date(1607009400000+0300)\/", + "\/Date(1607010300000+0300)\/", + "\/Date(1607011200000+0300)\/", + "\/Date(1607012100000+0300)\/", + "\/Date(1607013000000+0300)\/", + "\/Date(1607013900000+0300)\/", + "\/Date(1607151600000+0300)\/", + "\/Date(1607152500000+0300)\/", + "\/Date(1607153400000+0300)\/", + "\/Date(1607154300000+0300)\/", + "\/Date(1607155200000+0300)\/", + "\/Date(1607156100000+0300)\/", + "\/Date(1607157000000+0300)\/", + "\/Date(1607157900000+0300)\/", + "\/Date(1607158800000+0300)\/", + "\/Date(1607159700000+0300)\/", + "\/Date(1607160600000+0300)\/", + "\/Date(1607161500000+0300)\/", + "\/Date(1607162400000+0300)\/", + "\/Date(1607163300000+0300)\/", + "\/Date(1607164200000+0300)\/", + "\/Date(1607165100000+0300)\/", + "\/Date(1607263200000+0300)\/", + "\/Date(1607264100000+0300)\/", + "\/Date(1607265000000+0300)\/", + "\/Date(1607265900000+0300)\/", + "\/Date(1607266800000+0300)\/", + "\/Date(1607267700000+0300)\/", + "\/Date(1607268600000+0300)\/", + "\/Date(1607269500000+0300)\/", + "\/Date(1607270400000+0300)\/", + "\/Date(1607271300000+0300)\/", + "\/Date(1607272200000+0300)\/", + "\/Date(1607273100000+0300)\/", + "\/Date(1607274000000+0300)\/", + "\/Date(1607274900000+0300)\/", + "\/Date(1607275800000+0300)\/", + "\/Date(1607276700000+0300)\/", + "\/Date(1607349600000+0300)\/", + "\/Date(1607350500000+0300)\/", + "\/Date(1607351400000+0300)\/", + "\/Date(1607352300000+0300)\/", + "\/Date(1607353200000+0300)\/", + "\/Date(1607354100000+0300)\/", + "\/Date(1607355000000+0300)\/", + "\/Date(1607355900000+0300)\/", + "\/Date(1607356800000+0300)\/", + "\/Date(1607357700000+0300)\/", + "\/Date(1607358600000+0300)\/", + "\/Date(1607359500000+0300)\/", + "\/Date(1607360400000+0300)\/", + "\/Date(1607361300000+0300)\/", + "\/Date(1607362200000+0300)\/", + "\/Date(1607363100000+0300)\/", + "\/Date(1607436000000+0300)\/", + "\/Date(1607436900000+0300)\/", + "\/Date(1607437800000+0300)\/", + "\/Date(1607438700000+0300)\/", + "\/Date(1607439600000+0300)\/", + "\/Date(1607440500000+0300)\/", + "\/Date(1607441400000+0300)\/", + "\/Date(1607442300000+0300)\/", + "\/Date(1607443200000+0300)\/", + "\/Date(1607444100000+0300)\/", + "\/Date(1607445000000+0300)\/", + "\/Date(1607445900000+0300)\/", + "\/Date(1607446800000+0300)\/", + "\/Date(1607447700000+0300)\/", + "\/Date(1607448600000+0300)\/", + "\/Date(1607449500000+0300)\/", + "\/Date(1607522400000+0300)\/", + "\/Date(1607523300000+0300)\/", + "\/Date(1607524200000+0300)\/", + "\/Date(1607525100000+0300)\/", + "\/Date(1607526000000+0300)\/", + "\/Date(1607526900000+0300)\/", + "\/Date(1607527800000+0300)\/", + "\/Date(1607528700000+0300)\/", + "\/Date(1607529600000+0300)\/", + "\/Date(1607530500000+0300)\/", + "\/Date(1607531400000+0300)\/", + "\/Date(1607532300000+0300)\/", + "\/Date(1607533200000+0300)\/", + "\/Date(1607534100000+0300)\/", + "\/Date(1607535000000+0300)\/", + "\/Date(1607535900000+0300)\/", + "\/Date(1607605200000+0300)\/", + "\/Date(1607606100000+0300)\/", + "\/Date(1607607000000+0300)\/", + "\/Date(1607607900000+0300)\/", + "\/Date(1607608800000+0300)\/", + "\/Date(1607609700000+0300)\/", + "\/Date(1607610600000+0300)\/", + "\/Date(1607611500000+0300)\/", + "\/Date(1607612400000+0300)\/", + "\/Date(1607613300000+0300)\/", + "\/Date(1607614200000+0300)\/", + "\/Date(1607615100000+0300)\/", + "\/Date(1607616000000+0300)\/", + "\/Date(1607616900000+0300)\/", + "\/Date(1607617800000+0300)\/", + "\/Date(1607618700000+0300)\/", + "\/Date(1607756400000+0300)\/", + "\/Date(1607757300000+0300)\/", + "\/Date(1607758200000+0300)\/", + "\/Date(1607759100000+0300)\/", + "\/Date(1607760000000+0300)\/", + "\/Date(1607760900000+0300)\/", + "\/Date(1607761800000+0300)\/", + "\/Date(1607762700000+0300)\/", + "\/Date(1607763600000+0300)\/", + "\/Date(1607764500000+0300)\/", + "\/Date(1607765400000+0300)\/", + "\/Date(1607766300000+0300)\/", + "\/Date(1607767200000+0300)\/", + "\/Date(1607768100000+0300)\/", + "\/Date(1607769000000+0300)\/", + "\/Date(1607769900000+0300)\/", + "\/Date(1607868000000+0300)\/", + "\/Date(1607868900000+0300)\/", + "\/Date(1607869800000+0300)\/", + "\/Date(1607870700000+0300)\/", + "\/Date(1607871600000+0300)\/", + "\/Date(1607872500000+0300)\/", + "\/Date(1607873400000+0300)\/", + "\/Date(1607874300000+0300)\/", + "\/Date(1607875200000+0300)\/", + "\/Date(1607876100000+0300)\/", + "\/Date(1607877000000+0300)\/", + "\/Date(1607877900000+0300)\/", + "\/Date(1607878800000+0300)\/", + "\/Date(1607879700000+0300)\/", + "\/Date(1607880600000+0300)\/", + "\/Date(1607881500000+0300)\/", + "\/Date(1607954400000+0300)\/", + "\/Date(1607955300000+0300)\/", + "\/Date(1607956200000+0300)\/", + "\/Date(1607957100000+0300)\/", + "\/Date(1607958000000+0300)\/", + "\/Date(1607958900000+0300)\/", + "\/Date(1607959800000+0300)\/", + "\/Date(1607960700000+0300)\/", + "\/Date(1607961600000+0300)\/", + "\/Date(1607962500000+0300)\/", + "\/Date(1607963400000+0300)\/", + "\/Date(1607964300000+0300)\/", + "\/Date(1607965200000+0300)\/", + "\/Date(1607966100000+0300)\/", + "\/Date(1607967000000+0300)\/", + "\/Date(1607967900000+0300)\/", + "\/Date(1608040800000+0300)\/", + "\/Date(1608041700000+0300)\/", + "\/Date(1608042600000+0300)\/", + "\/Date(1608043500000+0300)\/", + "\/Date(1608044400000+0300)\/", + "\/Date(1608045300000+0300)\/", + "\/Date(1608046200000+0300)\/", + "\/Date(1608047100000+0300)\/", + "\/Date(1608048000000+0300)\/", + "\/Date(1608048900000+0300)\/", + "\/Date(1608049800000+0300)\/", + "\/Date(1608050700000+0300)\/", + "\/Date(1608051600000+0300)\/", + "\/Date(1608052500000+0300)\/", + "\/Date(1608053400000+0300)\/", + "\/Date(1608054300000+0300)\/", + "\/Date(1608127200000+0300)\/", + "\/Date(1608128100000+0300)\/", + "\/Date(1608129000000+0300)\/", + "\/Date(1608129900000+0300)\/", + "\/Date(1608130800000+0300)\/", + "\/Date(1608131700000+0300)\/", + "\/Date(1608132600000+0300)\/", + "\/Date(1608133500000+0300)\/", + "\/Date(1608134400000+0300)\/", + "\/Date(1608135300000+0300)\/", + "\/Date(1608136200000+0300)\/", + "\/Date(1608137100000+0300)\/", + "\/Date(1608138000000+0300)\/", + "\/Date(1608138900000+0300)\/", + "\/Date(1608139800000+0300)\/", + "\/Date(1608140700000+0300)\/", + "\/Date(1608210000000+0300)\/", + "\/Date(1608210900000+0300)\/", + "\/Date(1608211800000+0300)\/", + "\/Date(1608212700000+0300)\/", + "\/Date(1608213600000+0300)\/", + "\/Date(1608214500000+0300)\/", + "\/Date(1608215400000+0300)\/", + "\/Date(1608216300000+0300)\/", + "\/Date(1608217200000+0300)\/", + "\/Date(1608218100000+0300)\/", + "\/Date(1608219000000+0300)\/", + "\/Date(1608219900000+0300)\/", + "\/Date(1608220800000+0300)\/", + "\/Date(1608221700000+0300)\/", + "\/Date(1608222600000+0300)\/", + "\/Date(1608223500000+0300)\/", + "\/Date(1608361200000+0300)\/", + "\/Date(1608362100000+0300)\/", + "\/Date(1608363000000+0300)\/", + "\/Date(1608363900000+0300)\/", + "\/Date(1608364800000+0300)\/", + "\/Date(1608365700000+0300)\/", + "\/Date(1608366600000+0300)\/", + "\/Date(1608367500000+0300)\/", + "\/Date(1608368400000+0300)\/", + "\/Date(1608369300000+0300)\/", + "\/Date(1608370200000+0300)\/", + "\/Date(1608371100000+0300)\/", + "\/Date(1608372000000+0300)\/", + "\/Date(1608372900000+0300)\/", + "\/Date(1608373800000+0300)\/", + "\/Date(1608374700000+0300)\/", + "\/Date(1608472800000+0300)\/", + "\/Date(1608473700000+0300)\/", + "\/Date(1608474600000+0300)\/", + "\/Date(1608475500000+0300)\/", + "\/Date(1608476400000+0300)\/", + "\/Date(1608477300000+0300)\/", + "\/Date(1608478200000+0300)\/", + "\/Date(1608479100000+0300)\/", + "\/Date(1608480000000+0300)\/", + "\/Date(1608480900000+0300)\/", + "\/Date(1608481800000+0300)\/", + "\/Date(1608482700000+0300)\/", + "\/Date(1608483600000+0300)\/", + "\/Date(1608484500000+0300)\/", + "\/Date(1608485400000+0300)\/", + "\/Date(1608486300000+0300)\/", + "\/Date(1608559200000+0300)\/", + "\/Date(1608560100000+0300)\/", + "\/Date(1608561000000+0300)\/", + "\/Date(1608561900000+0300)\/", + "\/Date(1608562800000+0300)\/", + "\/Date(1608563700000+0300)\/", + "\/Date(1608564600000+0300)\/", + "\/Date(1608565500000+0300)\/", + "\/Date(1608566400000+0300)\/", + "\/Date(1608567300000+0300)\/", + "\/Date(1608568200000+0300)\/", + "\/Date(1608569100000+0300)\/", + "\/Date(1608570000000+0300)\/", + "\/Date(1608570900000+0300)\/", + "\/Date(1608571800000+0300)\/", + "\/Date(1608572700000+0300)\/", + "\/Date(1608645600000+0300)\/", + "\/Date(1608646500000+0300)\/", + "\/Date(1608647400000+0300)\/", + "\/Date(1608648300000+0300)\/", + "\/Date(1608649200000+0300)\/", + "\/Date(1608650100000+0300)\/", + "\/Date(1608651000000+0300)\/", + "\/Date(1608651900000+0300)\/", + "\/Date(1608652800000+0300)\/", + "\/Date(1608653700000+0300)\/", + "\/Date(1608654600000+0300)\/", + "\/Date(1608655500000+0300)\/", + "\/Date(1608656400000+0300)\/", + "\/Date(1608657300000+0300)\/", + "\/Date(1608658200000+0300)\/", + "\/Date(1608659100000+0300)\/", + "\/Date(1608732000000+0300)\/", + "\/Date(1608732900000+0300)\/", + "\/Date(1608733800000+0300)\/", + "\/Date(1608734700000+0300)\/", + "\/Date(1608735600000+0300)\/", + "\/Date(1608736500000+0300)\/", + "\/Date(1608737400000+0300)\/", + "\/Date(1608738300000+0300)\/", + "\/Date(1608739200000+0300)\/", + "\/Date(1608740100000+0300)\/", + "\/Date(1608741000000+0300)\/", + "\/Date(1608741900000+0300)\/", + "\/Date(1608742800000+0300)\/", + "\/Date(1608743700000+0300)\/", + "\/Date(1608744600000+0300)\/", + "\/Date(1608745500000+0300)\/", + "\/Date(1608814800000+0300)\/", + "\/Date(1608815700000+0300)\/", + "\/Date(1608816600000+0300)\/", + "\/Date(1608817500000+0300)\/", + "\/Date(1608818400000+0300)\/", + "\/Date(1608819300000+0300)\/", + "\/Date(1608820200000+0300)\/", + "\/Date(1608821100000+0300)\/", + "\/Date(1608822000000+0300)\/", + "\/Date(1608822900000+0300)\/", + "\/Date(1608823800000+0300)\/", + "\/Date(1608824700000+0300)\/", + "\/Date(1608825600000+0300)\/", + "\/Date(1608826500000+0300)\/", + "\/Date(1608827400000+0300)\/", + "\/Date(1608828300000+0300)\/", + "\/Date(1608966000000+0300)\/", + "\/Date(1608966900000+0300)\/", + "\/Date(1608967800000+0300)\/", + "\/Date(1608968700000+0300)\/", + "\/Date(1608969600000+0300)\/", + "\/Date(1608970500000+0300)\/", + "\/Date(1608971400000+0300)\/", + "\/Date(1608972300000+0300)\/", + "\/Date(1608973200000+0300)\/", + "\/Date(1608974100000+0300)\/", + "\/Date(1608975000000+0300)\/", + "\/Date(1608975900000+0300)\/", + "\/Date(1608976800000+0300)\/", + "\/Date(1608977700000+0300)\/", + "\/Date(1608978600000+0300)\/", + "\/Date(1608979500000+0300)\/", + "\/Date(1609077600000+0300)\/", + "\/Date(1609078500000+0300)\/", + "\/Date(1609079400000+0300)\/", + "\/Date(1609080300000+0300)\/", + "\/Date(1609081200000+0300)\/", + "\/Date(1609082100000+0300)\/", + "\/Date(1609083000000+0300)\/", + "\/Date(1609083900000+0300)\/", + "\/Date(1609084800000+0300)\/", + "\/Date(1609085700000+0300)\/", + "\/Date(1609086600000+0300)\/", + "\/Date(1609087500000+0300)\/", + "\/Date(1609088400000+0300)\/", + "\/Date(1609089300000+0300)\/", + "\/Date(1609090200000+0300)\/", + "\/Date(1609091100000+0300)\/", + "\/Date(1609164000000+0300)\/", + "\/Date(1609164900000+0300)\/", + "\/Date(1609165800000+0300)\/", + "\/Date(1609166700000+0300)\/", + "\/Date(1609167600000+0300)\/", + "\/Date(1609168500000+0300)\/", + "\/Date(1609169400000+0300)\/", + "\/Date(1609170300000+0300)\/", + "\/Date(1609171200000+0300)\/", + "\/Date(1609172100000+0300)\/", + "\/Date(1609173000000+0300)\/", + "\/Date(1609173900000+0300)\/", + "\/Date(1609174800000+0300)\/", + "\/Date(1609175700000+0300)\/", + "\/Date(1609176600000+0300)\/", + "\/Date(1609177500000+0300)\/", + "\/Date(1609250400000+0300)\/", + "\/Date(1609251300000+0300)\/", + "\/Date(1609252200000+0300)\/", + "\/Date(1609253100000+0300)\/", + "\/Date(1609254000000+0300)\/", + "\/Date(1609254900000+0300)\/", + "\/Date(1609255800000+0300)\/", + "\/Date(1609256700000+0300)\/", + "\/Date(1609257600000+0300)\/", + "\/Date(1609258500000+0300)\/", + "\/Date(1609259400000+0300)\/", + "\/Date(1609260300000+0300)\/", + "\/Date(1609261200000+0300)\/", + "\/Date(1609262100000+0300)\/", + "\/Date(1609263000000+0300)\/", + "\/Date(1609263900000+0300)\/", + "\/Date(1609336800000+0300)\/", + "\/Date(1609337700000+0300)\/", + "\/Date(1609338600000+0300)\/", + "\/Date(1609339500000+0300)\/", + "\/Date(1609340400000+0300)\/", + "\/Date(1609341300000+0300)\/", + "\/Date(1609342200000+0300)\/", + "\/Date(1609343100000+0300)\/", + "\/Date(1609344000000+0300)\/", + "\/Date(1609344900000+0300)\/", + "\/Date(1609345800000+0300)\/", + "\/Date(1609346700000+0300)\/", + "\/Date(1609347600000+0300)\/", + "\/Date(1609348500000+0300)\/", + "\/Date(1609349400000+0300)\/", + "\/Date(1609350300000+0300)\/", + "\/Date(1609419600000+0300)\/", + "\/Date(1609420500000+0300)\/", + "\/Date(1609421400000+0300)\/", + "\/Date(1609422300000+0300)\/", + "\/Date(1609423200000+0300)\/", + "\/Date(1609424100000+0300)\/", + "\/Date(1609425000000+0300)\/", + "\/Date(1609425900000+0300)\/", + "\/Date(1609426800000+0300)\/", + "\/Date(1609427700000+0300)\/", + "\/Date(1609428600000+0300)\/", + "\/Date(1609429500000+0300)\/", + "\/Date(1609430400000+0300)\/", + "\/Date(1609431300000+0300)\/", + "\/Date(1609432200000+0300)\/", + "\/Date(1609433100000+0300)\/" + ] +} \ No newline at end of file diff --git a/assets/sounds/ring_30Sec.caf b/assets/sounds/ring_30Sec.caf new file mode 100644 index 00000000..b5bb4b88 Binary files /dev/null and b/assets/sounds/ring_30Sec.caf differ diff --git a/assets/sounds/ring_30Sec.mp3 b/assets/sounds/ring_30Sec.mp3 new file mode 100644 index 00000000..f647cca8 Binary files /dev/null and b/assets/sounds/ring_30Sec.mp3 differ diff --git a/assets/sounds/ring_60Sec.mp3 b/assets/sounds/ring_60Sec.mp3 new file mode 100644 index 00000000..ac32394e Binary files /dev/null and b/assets/sounds/ring_60Sec.mp3 differ diff --git a/assets/tracker/blood-pressure.png b/assets/tracker/blood-pressure.png new file mode 100644 index 00000000..7aca3763 Binary files /dev/null and b/assets/tracker/blood-pressure.png differ diff --git a/assets/tracker/blood-suger.png b/assets/tracker/blood-suger.png new file mode 100644 index 00000000..76b1e448 Binary files /dev/null and b/assets/tracker/blood-suger.png differ diff --git a/assets/tracker/devices.png b/assets/tracker/devices.png new file mode 100644 index 00000000..f00f9d95 Binary files /dev/null and b/assets/tracker/devices.png differ diff --git a/assets/tracker/weight.png b/assets/tracker/weight.png new file mode 100644 index 00000000..385fcb81 Binary files /dev/null and b/assets/tracker/weight.png differ diff --git a/google-services.json b/google-services.json new file mode 100644 index 00000000..a4655794 --- /dev/null +++ b/google-services.json @@ -0,0 +1,40 @@ +{ + "project_info": { + "project_number": "864393916058", + "firebase_url": "https://diplomaticquarter-d2385.firebaseio.com", + "project_id": "diplomaticquarter-d2385", + "storage_bucket": "diplomaticquarter-d2385.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:864393916058:android:5b5a65cd6d8c18b4b97923", + "android_client_info": { + "package_name": "com.cloud.diplomaticquarterapp" + } + }, + "oauth_client": [ + { + "client_id": "864393916058-tphjrn8j39ntevt32ekcvmll8aue7qql.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyBdV3mos1BPhUzNKCj2KANJtiO3o2zh9IM" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "864393916058-tphjrn8j39ntevt32ekcvmll8aue7qql.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/heartrate_icon.png b/heartrate_icon.png new file mode 100644 index 00000000..e228bea4 Binary files /dev/null and b/heartrate_icon.png differ diff --git a/help/.gitignore b/help/.gitignore new file mode 100644 index 00000000..9d532b18 --- /dev/null +++ b/help/.gitignore @@ -0,0 +1,41 @@ +# 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 diff --git a/help/.metadata b/help/.metadata new file mode 100644 index 00000000..107fcb7b --- /dev/null +++ b/help/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 8874f21e79d7ec66d0457c7ab338348e31b17f1d + channel: stable + +project_type: app diff --git a/help/README.md b/help/README.md new file mode 100644 index 00000000..4ac021c0 --- /dev/null +++ b/help/README.md @@ -0,0 +1,16 @@ +# help + +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. diff --git a/help/android/.gitignore b/help/android/.gitignore new file mode 100644 index 00000000..0a741cb4 --- /dev/null +++ b/help/android/.gitignore @@ -0,0 +1,11 @@ +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 diff --git a/help/android/app/build.gradle b/help/android/app/build.gradle new file mode 100644 index 00000000..f44ed6c9 --- /dev/null +++ b/help/android/app/build.gradle @@ -0,0 +1,63 @@ +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: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion 29 + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + lintOptions { + disable 'InvalidPackage' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.help" + minSdkVersion 16 + targetSdkVersion 29 + 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" +} diff --git a/help/android/app/src/debug/AndroidManifest.xml b/help/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 00000000..fa2c5cd4 --- /dev/null +++ b/help/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/help/android/app/src/main/AndroidManifest.xml b/help/android/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..125d6242 --- /dev/null +++ b/help/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + diff --git a/help/android/app/src/main/kotlin/com/example/help/MainActivity.kt b/help/android/app/src/main/kotlin/com/example/help/MainActivity.kt new file mode 100644 index 00000000..75298a08 --- /dev/null +++ b/help/android/app/src/main/kotlin/com/example/help/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.help + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/help/android/app/src/main/res/drawable/launch_background.xml b/help/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 00000000..304732f8 --- /dev/null +++ b/help/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/help/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/help/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..db77bb4b Binary files /dev/null and b/help/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/help/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/help/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..17987b79 Binary files /dev/null and b/help/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/help/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/help/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..09d43914 Binary files /dev/null and b/help/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/help/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/help/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..d5f1c8d3 Binary files /dev/null and b/help/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/help/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/help/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..4d6372ee Binary files /dev/null and b/help/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/help/android/app/src/main/res/values/styles.xml b/help/android/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..1f83a33f --- /dev/null +++ b/help/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/help/android/app/src/profile/AndroidManifest.xml b/help/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 00000000..fa2c5cd4 --- /dev/null +++ b/help/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/help/android/build.gradle b/help/android/build.gradle new file mode 100644 index 00000000..3100ad2d --- /dev/null +++ b/help/android/build.gradle @@ -0,0 +1,31 @@ +buildscript { + ext.kotlin_version = '1.3.50' + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:3.5.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/help/android/gradle.properties b/help/android/gradle.properties new file mode 100644 index 00000000..94adc3a3 --- /dev/null +++ b/help/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/help/android/gradle/wrapper/gradle-wrapper.properties b/help/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..296b146b --- /dev/null +++ b/help/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip diff --git a/help/android/settings.gradle b/help/android/settings.gradle new file mode 100644 index 00000000..44e62bcf --- /dev/null +++ b/help/android/settings.gradle @@ -0,0 +1,11 @@ +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" diff --git a/help/ios/.gitignore b/help/ios/.gitignore new file mode 100644 index 00000000..e96ef602 --- /dev/null +++ b/help/ios/.gitignore @@ -0,0 +1,32 @@ +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/help/ios/Flutter/AppFrameworkInfo.plist b/help/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 00000000..f2872cf4 --- /dev/null +++ b/help/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 9.0 + + diff --git a/help/ios/Flutter/Debug.xcconfig b/help/ios/Flutter/Debug.xcconfig new file mode 100644 index 00000000..592ceee8 --- /dev/null +++ b/help/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/help/ios/Flutter/Release.xcconfig b/help/ios/Flutter/Release.xcconfig new file mode 100644 index 00000000..592ceee8 --- /dev/null +++ b/help/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/help/ios/Runner.xcodeproj/project.pbxproj b/help/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..4f158fea --- /dev/null +++ b/help/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,495 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1020; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.help; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.help; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.help; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/help/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/help/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1d526a16 --- /dev/null +++ b/help/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/help/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/help/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/help/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/help/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/help/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/help/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/help/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/help/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..a28140cf --- /dev/null +++ b/help/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/help/ios/Runner.xcworkspace/contents.xcworkspacedata b/help/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1d526a16 --- /dev/null +++ b/help/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/help/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/help/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/help/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/help/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/help/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/help/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/help/ios/Runner/AppDelegate.swift b/help/ios/Runner/AppDelegate.swift new file mode 100644 index 00000000..70693e4a --- /dev/null +++ b/help/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d36b1fab --- /dev/null +++ b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 00000000..dc9ada47 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 00000000..28c6bf03 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 00000000..2ccbfd96 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 00000000..f091b6b0 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 00000000..4cde1211 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 00000000..d0ef06e7 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 00000000..dcdc2306 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 00000000..2ccbfd96 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 00000000..c8f9ed8f Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 00000000..a6d6b860 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 00000000..a6d6b860 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 00000000..75b2d164 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 00000000..c4df70d3 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 00000000..6a84f41e Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 00000000..d0e1f585 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 00000000..0bedcf2f --- /dev/null +++ b/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 00000000..89c2725b --- /dev/null +++ b/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/help/ios/Runner/Base.lproj/LaunchScreen.storyboard b/help/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f2e259c7 --- /dev/null +++ b/help/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/help/ios/Runner/Base.lproj/Main.storyboard b/help/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 00000000..f3c28516 --- /dev/null +++ b/help/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/help/ios/Runner/Info.plist b/help/ios/Runner/Info.plist new file mode 100644 index 00000000..fe4c8174 --- /dev/null +++ b/help/ios/Runner/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + help + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/help/ios/Runner/Runner-Bridging-Header.h b/help/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 00000000..308a2a56 --- /dev/null +++ b/help/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/help/lib/main.dart b/help/lib/main.dart new file mode 100644 index 00000000..11655b66 --- /dev/null +++ b/help/lib/main.dart @@ -0,0 +1,117 @@ +import 'package:flutter/material.dart'; + +void main() { + runApp(MyApp()); +} + +class MyApp extends StatelessWidget { + // This widget is the root of your application. + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Demo', + theme: ThemeData( + // This is the theme of your application. + // + // Try running your application with "flutter run". You'll see the + // application has a blue toolbar. Then, without quitting the app, try + // changing the primarySwatch below to Colors.green and then invoke + // "hot reload" (press "r" in the console where you ran "flutter run", + // or simply save your changes to "hot reload" in a Flutter IDE). + // Notice that the counter didn't reset back to zero; the application + // is not restarted. + primarySwatch: Colors.blue, + // This makes the visual density adapt to the platform that you run + // the app on. For desktop platforms, the controls will be smaller and + // closer together (more dense) than on mobile platforms. + visualDensity: VisualDensity.adaptivePlatformDensity, + ), + home: MyHomePage(title: 'Flutter Demo Home Page'), + ); + } +} + +class MyHomePage extends StatefulWidget { + MyHomePage({Key key, this.title}) : super(key: key); + + // This widget is the home page of your application. It is stateful, meaning + // that it has a State object (defined below) that contains fields that affect + // how it looks. + + // This class is the configuration for the state. It holds the values (in this + // case the title) provided by the parent (in this case the App widget) and + // used by the build method of the State. Fields in a Widget subclass are + // always marked "final". + + final String title; + + @override + _MyHomePageState createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + int _counter = 0; + + void _incrementCounter() { + setState(() { + // This call to setState tells the Flutter framework that something has + // changed in this State, which causes it to rerun the build method below + // so that the display can reflect the updated values. If we changed + // _counter without calling setState(), then the build method would not be + // called again, and so nothing would appear to happen. + _counter++; + }); + } + + @override + Widget build(BuildContext context) { + // This method is rerun every time setState is called, for instance as done + // by the _incrementCounter method above. + // + // The Flutter framework has been optimized to make rerunning build methods + // fast, so that you can just rebuild anything that needs updating rather + // than having to individually change instances of widgets. + return Scaffold( + appBar: AppBar( + // Here we take the value from the MyHomePage object that was created by + // the App.build method, and use it to set our appbar title. + title: Text(widget.title), + ), + body: Center( + // Center is a layout widget. It takes a single child and positions it + // in the middle of the parent. + child: Column( + // Column is also a layout widget. It takes a list of children and + // arranges them vertically. By default, it sizes itself to fit its + // children horizontally, and tries to be as tall as its parent. + // + // Invoke "debug painting" (press "p" in the console, choose the + // "Toggle Debug Paint" action from the Flutter Inspector in Android + // Studio, or the "Toggle Debug Paint" command in Visual Studio Code) + // to see the wireframe for each widget. + // + // Column has various properties to control how it sizes itself and + // how it positions its children. Here we use mainAxisAlignment to + // center the children vertically; the main axis here is the vertical + // axis because Columns are vertical (the cross axis would be + // horizontal). + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'You have pushed the button this many times:', + ), + Text( + '$_counter', + style: Theme.of(context).textTheme.headline4, + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: _incrementCounter, + tooltip: 'Increment', + child: Icon(Icons.add), + ), // This trailing comma makes auto-formatting nicer for build methods. + ); + } +} diff --git a/help/pubspec.yaml b/help/pubspec.yaml new file mode 100644 index 00000000..66af3d9e --- /dev/null +++ b/help/pubspec.yaml @@ -0,0 +1,76 @@ +name: help +description: A new Flutter project. + +# The following line prevents the package from being accidentally published to +# pub.dev using `pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +version: 1.0.0+1 + +environment: + sdk: ">=2.7.0 <3.0.0" + +dependencies: + flutter: + sdk: flutter + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.0 + +dev_dependencies: + flutter_test: + sdk: flutter + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/help/test/widget_test.dart b/help/test/widget_test.dart new file mode 100644 index 00000000..9ca1523f --- /dev/null +++ b/help/test/widget_test.dart @@ -0,0 +1,32 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility that Flutter provides. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import '../lib/main.dart'; + + + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +} diff --git a/ios/.gitignore b/ios/.gitignore index e96ef602..04b5cf29 100644 --- a/ios/.gitignore +++ b/ios/.gitignore @@ -30,3 +30,4 @@ Runner/GeneratedPluginRegistrant.* !default.mode2v3 !default.pbxuser !default.perspectivev3 +/Flutter/.last_build_id diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id new file mode 100644 index 00000000..b8024672 --- /dev/null +++ b/ios/Flutter/.last_build_id @@ -0,0 +1 @@ +59a6c452ee075b50114918f17f1ad8f5 \ No newline at end of file diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index 592ceee8..e8efba11 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index 592ceee8..399e9340 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ios/GoogleService-Info.plist b/ios/GoogleService-Info.plist new file mode 100644 index 00000000..0c093a2a --- /dev/null +++ b/ios/GoogleService-Info.plist @@ -0,0 +1,36 @@ + + + + + CLIENT_ID + 864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r + API_KEY + AIzaSyA_6ayGCk4fly7o7eTVBrj9kuHBYHMAOfs + GCM_SENDER_ID + 864393916058 + PLIST_VERSION + 1 + BUNDLE_ID + com.cloud.diplomaticquarterapp + PROJECT_ID + diplomaticquarter-d2385 + STORAGE_BUCKET + diplomaticquarter-d2385.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:864393916058:ios:13f787bbfe6051f8b97923 + DATABASE_URL + https://diplomaticquarter-d2385.firebaseio.com + + \ No newline at end of file diff --git a/ios/Podfile b/ios/Podfile new file mode 100644 index 00000000..5579d926 --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,94 @@ +# Uncomment this line to define a global platform for your project + platform :ios, '11.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +# pod 'FBSDKCoreKit' +# pod 'FBSDKLoginKit' + +def parse_KV_file(file, separator='=') + file_abs_path = File.expand_path(file) + if !File.exists? file_abs_path + return []; + end + generated_key_values = {} + skip_line_start_symbols = ["#", "/"] + File.foreach(file_abs_path) do |line| + next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } + plugin = line.split(pattern=separator) + if plugin.length == 2 + podname = plugin[0].strip() + path = plugin[1].strip() + podpath = File.expand_path("#{path}", file_abs_path) + generated_key_values[podname] = podpath + else + puts "Invalid plugin specification: #{line}" + end + end + generated_key_values +end + +target 'Runner' do + use_frameworks! + use_modular_headers! + + # Native Pods + pod 'NVActivityIndicatorView' + + + # Flutter Pod + copied_flutter_dir = File.join(__dir__, 'Flutter') + copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework') + copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec') + unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path) + # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet. + # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration. + # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist. + + generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig') + unless File.exist?(generated_xcode_build_settings_path) + raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path) + cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR']; + + unless File.exist?(copied_framework_path) + FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir) + end + unless File.exist?(copied_podspec_path) + FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir) + end + end + + # Keep pod path relative so it can be checked into Podfile.lock. + pod 'Flutter', :path => 'Flutter' + + # Plugin Pods + + # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock + # referring to absolute paths on developers' machines. + system('rm -rf .symlinks') + system('mkdir -p .symlinks/plugins') + plugin_pods = parse_KV_file('../.flutter-plugins') + plugin_pods.each do |name, path| + symlink = File.join('.symlinks', 'plugins', name) + File.symlink(path, symlink) + pod name, :path => File.join(symlink, 'ios') + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['ENABLE_BITCODE'] = 'NO' + end + end +end + diff --git a/ios/Podfile.lock b/ios/Podfile.lock new file mode 100644 index 00000000..a09481c1 --- /dev/null +++ b/ios/Podfile.lock @@ -0,0 +1,455 @@ +PODS: + - android_intent (0.0.1): + - Flutter + - barcode_scan_fix (0.0.1): + - Flutter + - MTBBarcodeScanner + - connectivity (0.0.1): + - Flutter + - Reachability + - connectivity_for_web (0.1.0): + - Flutter + - connectivity_macos (0.0.1): + - Flutter + - device_calendar (0.0.1): + - Flutter + - device_info (0.0.1): + - Flutter + - Firebase/CoreOnly (6.33.0): + - FirebaseCore (= 6.10.3) + - Firebase/Messaging (6.33.0): + - Firebase/CoreOnly + - FirebaseMessaging (~> 4.7.0) + - firebase_core (0.5.3): + - Firebase/CoreOnly (~> 6.33.0) + - Flutter + - firebase_core_web (0.1.0): + - Flutter + - firebase_messaging (7.0.3): + - Firebase/CoreOnly (~> 6.33.0) + - Firebase/Messaging (~> 6.33.0) + - firebase_core + - Flutter + - FirebaseCore (6.10.3): + - FirebaseCoreDiagnostics (~> 1.6) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/Logger (~> 6.7) + - FirebaseCoreDiagnostics (1.7.0): + - GoogleDataTransport (~> 7.4) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/Logger (~> 6.7) + - nanopb (~> 1.30906.0) + - FirebaseInstallations (1.7.0): + - FirebaseCore (~> 6.10) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/UserDefaults (~> 6.7) + - PromisesObjC (~> 1.2) + - FirebaseInstanceID (4.8.0): + - FirebaseCore (~> 6.10) + - FirebaseInstallations (~> 1.6) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/UserDefaults (~> 6.7) + - FirebaseMessaging (4.7.1): + - FirebaseCore (~> 6.10) + - FirebaseInstanceID (~> 4.7) + - GoogleUtilities/AppDelegateSwizzler (~> 6.7) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/Reachability (~> 6.7) + - GoogleUtilities/UserDefaults (~> 6.7) + - Protobuf (>= 3.9.2, ~> 3.9) + - Flutter (1.0.0) + - flutter_email_sender (0.0.1): + - Flutter + - flutter_flexible_toast (0.0.1): + - Flutter + - flutter_inappwebview (0.0.1): + - Flutter + - flutter_local_notifications (0.0.1): + - Flutter + - flutter_plugin_android_lifecycle (0.0.1): + - Flutter + - flutter_tts (0.0.1): + - Flutter + - geolocator (6.1.9): + - Flutter + - google_maps_flutter (0.0.1): + - Flutter + - GoogleMaps (< 3.10) + - GoogleDataTransport (7.5.1): + - nanopb (~> 1.30906.0) + - GoogleMaps (3.9.0): + - GoogleMaps/Maps (= 3.9.0) + - GoogleMaps/Base (3.9.0) + - GoogleMaps/Maps (3.9.0): + - GoogleMaps/Base + - GoogleUtilities/AppDelegateSwizzler (6.7.2): + - GoogleUtilities/Environment + - GoogleUtilities/Logger + - GoogleUtilities/Network + - GoogleUtilities/Environment (6.7.2): + - PromisesObjC (~> 1.2) + - GoogleUtilities/Logger (6.7.2): + - GoogleUtilities/Environment + - GoogleUtilities/Network (6.7.2): + - GoogleUtilities/Logger + - "GoogleUtilities/NSData+zlib" + - GoogleUtilities/Reachability + - "GoogleUtilities/NSData+zlib (6.7.2)" + - GoogleUtilities/Reachability (6.7.2): + - GoogleUtilities/Logger + - GoogleUtilities/UserDefaults (6.7.2): + - GoogleUtilities/Logger + - hexcolor (0.0.1): + - Flutter + - image_cropper (0.0.3): + - Flutter + - TOCropViewController (~> 2.5.4) + - image_picker (0.0.1): + - Flutter + - just_audio (0.0.1): + - Flutter + - local_auth (0.0.1): + - Flutter + - manage_calendar_events (0.0.1): + - Flutter + - map_launcher (0.0.1): + - Flutter + - maps_launcher (0.0.1): + - Flutter + - MTBBarcodeScanner (5.0.11) + - nanopb (1.30906.0): + - nanopb/decode (= 1.30906.0) + - nanopb/encode (= 1.30906.0) + - nanopb/decode (1.30906.0) + - nanopb/encode (1.30906.0) + - native_device_orientation (0.0.1): + - Flutter + - native_progress_hud (0.0.1): + - Flutter + - NVActivityIndicatorView (5.1.1): + - NVActivityIndicatorView/Base (= 5.1.1) + - NVActivityIndicatorView/Base (5.1.1) + - path_provider (0.0.1): + - Flutter + - path_provider_linux (0.0.1): + - Flutter + - path_provider_macos (0.0.1): + - Flutter + - path_provider_windows (0.0.1): + - Flutter + - "permission_handler (5.0.1+1)": + - Flutter + - PromisesObjC (1.2.11) + - Protobuf (3.13.0) + - Reachability (3.2) + - screen (0.0.1): + - Flutter + - shared_preferences (0.0.1): + - Flutter + - shared_preferences_linux (0.0.1): + - Flutter + - shared_preferences_macos (0.0.1): + - Flutter + - shared_preferences_web (0.0.1): + - Flutter + - shared_preferences_windows (0.0.1): + - Flutter + - speech_to_text (0.0.1): + - Flutter + - Try + - TOCropViewController (2.5.5) + - Try (2.1.1) + - "twilio_programmable_video (0.5.0+4)": + - Flutter + - TwilioVideo (~> 3.4) + - TwilioVideo (3.7.2) + - url_launcher (0.0.1): + - Flutter + - url_launcher_linux (0.0.1): + - Flutter + - url_launcher_macos (0.0.1): + - Flutter + - url_launcher_web (0.0.1): + - Flutter + - url_launcher_windows (0.0.1): + - Flutter + - vibration (1.7.3): + - Flutter + - vibration_web (1.6.2): + - Flutter + - video_player (0.0.1): + - Flutter + - video_player_web (0.0.1): + - Flutter + - wakelock (0.0.1): + - Flutter + - webview_flutter (0.0.1): + - Flutter + - wifi (0.0.1): + - Flutter + +DEPENDENCIES: + - android_intent (from `.symlinks/plugins/android_intent/ios`) + - barcode_scan_fix (from `.symlinks/plugins/barcode_scan_fix/ios`) + - connectivity (from `.symlinks/plugins/connectivity/ios`) + - connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`) + - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) + - device_calendar (from `.symlinks/plugins/device_calendar/ios`) + - device_info (from `.symlinks/plugins/device_info/ios`) + - firebase_core (from `.symlinks/plugins/firebase_core/ios`) + - firebase_core_web (from `.symlinks/plugins/firebase_core_web/ios`) + - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) + - Flutter (from `Flutter`) + - flutter_email_sender (from `.symlinks/plugins/flutter_email_sender/ios`) + - flutter_flexible_toast (from `.symlinks/plugins/flutter_flexible_toast/ios`) + - flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`) + - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`) + - flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`) + - flutter_tts (from `.symlinks/plugins/flutter_tts/ios`) + - geolocator (from `.symlinks/plugins/geolocator/ios`) + - google_maps_flutter (from `.symlinks/plugins/google_maps_flutter/ios`) + - hexcolor (from `.symlinks/plugins/hexcolor/ios`) + - image_cropper (from `.symlinks/plugins/image_cropper/ios`) + - image_picker (from `.symlinks/plugins/image_picker/ios`) + - just_audio (from `.symlinks/plugins/just_audio/ios`) + - local_auth (from `.symlinks/plugins/local_auth/ios`) + - manage_calendar_events (from `.symlinks/plugins/manage_calendar_events/ios`) + - map_launcher (from `.symlinks/plugins/map_launcher/ios`) + - maps_launcher (from `.symlinks/plugins/maps_launcher/ios`) + - native_device_orientation (from `.symlinks/plugins/native_device_orientation/ios`) + - native_progress_hud (from `.symlinks/plugins/native_progress_hud/ios`) + - NVActivityIndicatorView + - path_provider (from `.symlinks/plugins/path_provider/ios`) + - path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`) + - path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`) + - path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`) + - permission_handler (from `.symlinks/plugins/permission_handler/ios`) + - screen (from `.symlinks/plugins/screen/ios`) + - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) + - shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`) + - shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`) + - shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`) + - shared_preferences_windows (from `.symlinks/plugins/shared_preferences_windows/ios`) + - speech_to_text (from `.symlinks/plugins/speech_to_text/ios`) + - twilio_programmable_video (from `.symlinks/plugins/twilio_programmable_video/ios`) + - url_launcher (from `.symlinks/plugins/url_launcher/ios`) + - url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`) + - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) + - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) + - url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`) + - vibration (from `.symlinks/plugins/vibration/ios`) + - vibration_web (from `.symlinks/plugins/vibration_web/ios`) + - video_player (from `.symlinks/plugins/video_player/ios`) + - video_player_web (from `.symlinks/plugins/video_player_web/ios`) + - wakelock (from `.symlinks/plugins/wakelock/ios`) + - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`) + - wifi (from `.symlinks/plugins/wifi/ios`) + +SPEC REPOS: + trunk: + - Firebase + - FirebaseCore + - FirebaseCoreDiagnostics + - FirebaseInstallations + - FirebaseInstanceID + - FirebaseMessaging + - GoogleDataTransport + - GoogleMaps + - GoogleUtilities + - MTBBarcodeScanner + - nanopb + - NVActivityIndicatorView + - PromisesObjC + - Protobuf + - Reachability + - TOCropViewController + - Try + - TwilioVideo + +EXTERNAL SOURCES: + android_intent: + :path: ".symlinks/plugins/android_intent/ios" + barcode_scan_fix: + :path: ".symlinks/plugins/barcode_scan_fix/ios" + connectivity: + :path: ".symlinks/plugins/connectivity/ios" + connectivity_for_web: + :path: ".symlinks/plugins/connectivity_for_web/ios" + connectivity_macos: + :path: ".symlinks/plugins/connectivity_macos/ios" + device_calendar: + :path: ".symlinks/plugins/device_calendar/ios" + device_info: + :path: ".symlinks/plugins/device_info/ios" + firebase_core: + :path: ".symlinks/plugins/firebase_core/ios" + firebase_core_web: + :path: ".symlinks/plugins/firebase_core_web/ios" + firebase_messaging: + :path: ".symlinks/plugins/firebase_messaging/ios" + Flutter: + :path: Flutter + flutter_email_sender: + :path: ".symlinks/plugins/flutter_email_sender/ios" + flutter_flexible_toast: + :path: ".symlinks/plugins/flutter_flexible_toast/ios" + flutter_inappwebview: + :path: ".symlinks/plugins/flutter_inappwebview/ios" + flutter_local_notifications: + :path: ".symlinks/plugins/flutter_local_notifications/ios" + flutter_plugin_android_lifecycle: + :path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios" + flutter_tts: + :path: ".symlinks/plugins/flutter_tts/ios" + geolocator: + :path: ".symlinks/plugins/geolocator/ios" + google_maps_flutter: + :path: ".symlinks/plugins/google_maps_flutter/ios" + hexcolor: + :path: ".symlinks/plugins/hexcolor/ios" + image_cropper: + :path: ".symlinks/plugins/image_cropper/ios" + image_picker: + :path: ".symlinks/plugins/image_picker/ios" + just_audio: + :path: ".symlinks/plugins/just_audio/ios" + local_auth: + :path: ".symlinks/plugins/local_auth/ios" + manage_calendar_events: + :path: ".symlinks/plugins/manage_calendar_events/ios" + map_launcher: + :path: ".symlinks/plugins/map_launcher/ios" + maps_launcher: + :path: ".symlinks/plugins/maps_launcher/ios" + native_device_orientation: + :path: ".symlinks/plugins/native_device_orientation/ios" + native_progress_hud: + :path: ".symlinks/plugins/native_progress_hud/ios" + path_provider: + :path: ".symlinks/plugins/path_provider/ios" + path_provider_linux: + :path: ".symlinks/plugins/path_provider_linux/ios" + path_provider_macos: + :path: ".symlinks/plugins/path_provider_macos/ios" + path_provider_windows: + :path: ".symlinks/plugins/path_provider_windows/ios" + permission_handler: + :path: ".symlinks/plugins/permission_handler/ios" + screen: + :path: ".symlinks/plugins/screen/ios" + shared_preferences: + :path: ".symlinks/plugins/shared_preferences/ios" + shared_preferences_linux: + :path: ".symlinks/plugins/shared_preferences_linux/ios" + shared_preferences_macos: + :path: ".symlinks/plugins/shared_preferences_macos/ios" + shared_preferences_web: + :path: ".symlinks/plugins/shared_preferences_web/ios" + shared_preferences_windows: + :path: ".symlinks/plugins/shared_preferences_windows/ios" + speech_to_text: + :path: ".symlinks/plugins/speech_to_text/ios" + twilio_programmable_video: + :path: ".symlinks/plugins/twilio_programmable_video/ios" + url_launcher: + :path: ".symlinks/plugins/url_launcher/ios" + url_launcher_linux: + :path: ".symlinks/plugins/url_launcher_linux/ios" + url_launcher_macos: + :path: ".symlinks/plugins/url_launcher_macos/ios" + url_launcher_web: + :path: ".symlinks/plugins/url_launcher_web/ios" + url_launcher_windows: + :path: ".symlinks/plugins/url_launcher_windows/ios" + vibration: + :path: ".symlinks/plugins/vibration/ios" + vibration_web: + :path: ".symlinks/plugins/vibration_web/ios" + video_player: + :path: ".symlinks/plugins/video_player/ios" + video_player_web: + :path: ".symlinks/plugins/video_player_web/ios" + wakelock: + :path: ".symlinks/plugins/wakelock/ios" + webview_flutter: + :path: ".symlinks/plugins/webview_flutter/ios" + wifi: + :path: ".symlinks/plugins/wifi/ios" + +SPEC CHECKSUMS: + android_intent: 367df2f1277a74e4a90e14a8ab3df3112d087052 + barcode_scan_fix: 80dd65de55f27eec6591dd077c8b85f2b79e31f1 + connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467 + connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b + connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 + device_calendar: 23b28a5f1ab3bf77e34542fb1167e1b8b29a98f5 + device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 + Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 + firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659 + firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1 + firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75 + FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd + FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1 + FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2 + FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1 + FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a + Flutter: 0e3d915762c693b495b44d77113d4970485de6ec + flutter_email_sender: f787522d0e82f50e5766c1213dbffff22fdcf009 + flutter_flexible_toast: 0547e740cae0c33bb7c51bcd931233f4584e1143 + flutter_inappwebview: 69dfbac46157b336ffbec19ca6dfd4638c7bf189 + flutter_local_notifications: 9e4738ce2471c5af910d961a6b7eadcf57c50186 + flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35 + flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d + geolocator: 057a0c63a43e9c5296d8ad845a3ac8e6df23d899 + google_maps_flutter: c7f9c73576de1fbe152a227bfd6e6c4ae8088619 + GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833 + GoogleMaps: 4b5346bddfe6911bb89155d43c903020170523ac + GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3 + hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89 + image_cropper: c8f9b4157933c7bb965a66d1c5e6c8fd408c6eb4 + image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09 + just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa + local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd + manage_calendar_events: 0338d505ea26cdfd20cd883279bc28afa11eca34 + map_launcher: e325db1261d029ff33e08e03baccffe09593ffea + maps_launcher: eae38ee13a9c3f210fa04e04bb4c073fa4c6ed92 + MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb + nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc + native_device_orientation: e24d00be281de72996640885d80e706142707660 + native_progress_hud: f95f5529742b36a3c7fdecfa88dc018319e39bf9 + NVActivityIndicatorView: 1f6c5687f1171810aa27a3296814dc2d7dec3667 + path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c + path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4 + path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0 + path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b + permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6 + PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f + Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748 + Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 + screen: abd91ca7bf3426e1cc3646d27e9b2358d6bf07b0 + shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d + shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78 + shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087 + shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9 + shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae + speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe + TOCropViewController: da59f531f8ac8a94ef6d6c0fc34009350f9e8bfe + Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96 + twilio_programmable_video: 6a41593640f3d86af60b22541fd457b22deaae7f + TwilioVideo: 5257640fab00d1b9f44db060815b03516a9eb0e8 + url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef + url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0 + url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 + url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c + url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5 + vibration: b5a33e764c3f609a975b9dca73dce20fdde627dc + vibration_web: 0ba303d92469ba34d71c612a228b315908d7fcd9 + video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e + video_player_web: da8cadb8274ed4f8dbee8d7171b420dedd437ce7 + wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4 + webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 + wifi: d7d77c94109e36c4175d845f0a5964eadba71060 + +PODFILE CHECKSUM: 5a17be3f8af73a757fa4439c77cf6ab2db29a6e7 + +COCOAPODS: 1.10.0 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index b1c7ff05..009006ed 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,16 +3,33 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 51; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 813F9CBA7DD5ED63B28B8BB6 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 767C165F7ABF3BF1F829B9BF /* Pods_Runner.framework */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + E91B5396256AAA6500E96549 /* GlobalHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B538D256AAA6500E96549 /* GlobalHelper.swift */; }; + E91B5397256AAA6500E96549 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B538E256AAA6500E96549 /* Extensions.swift */; }; + E91B5398256AAA6500E96549 /* API.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B538F256AAA6500E96549 /* API.swift */; }; + E91B539A256AAA6500E96549 /* MainFlutterVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B5392256AAA6500E96549 /* MainFlutterVC.swift */; }; + E91B539B256AAA6500E96549 /* HMG_Internet.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B5394256AAA6500E96549 /* HMG_Internet.swift */; }; + E91B539C256AAA6500E96549 /* HMG_GUEST_bkp.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B5395256AAA6500E96549 /* HMG_GUEST_bkp.swift */; }; + E91B539F256AAC1400E96549 /* GuestPOC_Certificate.p12 in Resources */ = {isa = PBXBuildFile; fileRef = E91B539D256AAC1400E96549 /* GuestPOC_Certificate.p12 */; }; + E91B53A0256AAC1400E96549 /* GuestPOC_Certificate.cer in Resources */ = {isa = PBXBuildFile; fileRef = E91B539E256AAC1400E96549 /* GuestPOC_Certificate.cer */; }; + E91B53A3256AAD8200E96549 /* Main_Custom.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E91B53A1256AAD8200E96549 /* Main_Custom.storyboard */; }; + E923EFD225863FDF00E3E751 /* GeoZoneModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = E923EFD125863FDF00E3E751 /* GeoZoneModel.swift */; }; + E923EFD4258645C100E3E751 /* HMG_Geofence.swift in Sources */ = {isa = PBXBuildFile; fileRef = E923EFD3258645C100E3E751 /* HMG_Geofence.swift */; }; + E923EFD62587443800E3E751 /* HMGPlatformBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = E923EFD52587443800E3E751 /* HMGPlatformBridge.swift */; }; + E923EFD82588D17700E3E751 /* gpx.gpx in Resources */ = {isa = PBXBuildFile; fileRef = E923EFD72588D17700E3E751 /* gpx.gpx */; }; + E9620805255C2ED100D3A35D /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E9620804255C2ED100D3A35D /* NetworkExtension.framework */; }; + E9C8C136256BACDA00EFFB62 /* HMG_Guest.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9C8C135256BACDA00EFFB62 /* HMG_Guest.swift */; }; + E9E27168256E3A4000F49B69 /* LocalizedFromFlutter.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9E27167256E3A4000F49B69 /* LocalizedFromFlutter.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -31,10 +48,13 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 308FEC658188F7D588BE7580 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 767C165F7ABF3BF1F829B9BF /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 969F0CEC868FD7C196987A3E /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -42,6 +62,24 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + DCFFD369041FFFFA94CF7B26 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + E91B538D256AAA6500E96549 /* GlobalHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GlobalHelper.swift; sourceTree = ""; }; + E91B538E256AAA6500E96549 /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; + E91B538F256AAA6500E96549 /* API.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = API.swift; sourceTree = ""; }; + E91B5392256AAA6500E96549 /* MainFlutterVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainFlutterVC.swift; sourceTree = ""; }; + E91B5394256AAA6500E96549 /* HMG_Internet.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMG_Internet.swift; sourceTree = ""; }; + E91B5395256AAA6500E96549 /* HMG_GUEST_bkp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMG_GUEST_bkp.swift; sourceTree = ""; }; + E91B539D256AAC1400E96549 /* GuestPOC_Certificate.p12 */ = {isa = PBXFileReference; lastKnownFileType = file; path = GuestPOC_Certificate.p12; sourceTree = ""; }; + E91B539E256AAC1400E96549 /* GuestPOC_Certificate.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = GuestPOC_Certificate.cer; sourceTree = ""; }; + E91B53A2256AAD8200E96549 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_Custom.storyboard; sourceTree = ""; }; + E923EFD125863FDF00E3E751 /* GeoZoneModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeoZoneModel.swift; sourceTree = ""; }; + E923EFD3258645C100E3E751 /* HMG_Geofence.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HMG_Geofence.swift; sourceTree = ""; }; + E923EFD52587443800E3E751 /* HMGPlatformBridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HMGPlatformBridge.swift; sourceTree = ""; }; + E923EFD72588D17700E3E751 /* gpx.gpx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = gpx.gpx; sourceTree = ""; }; + E9620803255C2ED100D3A35D /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; + E9620804255C2ED100D3A35D /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; }; + E9C8C135256BACDA00EFFB62 /* HMG_Guest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMG_Guest.swift; sourceTree = ""; }; + E9E27167256E3A4000F49B69 /* LocalizedFromFlutter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalizedFromFlutter.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -49,12 +87,33 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 813F9CBA7DD5ED63B28B8BB6 /* Pods_Runner.framework in Frameworks */, + E9620805255C2ED100D3A35D /* NetworkExtension.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 555EAAA626EFB641859EF0BE /* Frameworks */ = { + isa = PBXGroup; + children = ( + E9620804255C2ED100D3A35D /* NetworkExtension.framework */, + 767C165F7ABF3BF1F829B9BF /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 605039E5DDF72C245F9765FE /* Pods */ = { + isa = PBXGroup; + children = ( + DCFFD369041FFFFA94CF7B26 /* Pods-Runner.debug.xcconfig */, + 969F0CEC868FD7C196987A3E /* Pods-Runner.release.xcconfig */, + 308FEC658188F7D588BE7580 /* Pods-Runner.profile.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -69,9 +128,12 @@ 97C146E51CF9000F007C117D = { isa = PBXGroup; children = ( + E923EFD72588D17700E3E751 /* gpx.gpx */, 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, + 605039E5DDF72C245F9765FE /* Pods */, + 555EAAA626EFB641859EF0BE /* Frameworks */, ); sourceTree = ""; }; @@ -86,11 +148,17 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( + E91B539E256AAC1400E96549 /* GuestPOC_Certificate.cer */, + E91B539D256AAC1400E96549 /* GuestPOC_Certificate.p12 */, + E91B5390256AAA6500E96549 /* Controllers */, + E91B538C256AAA6500E96549 /* Helper */, + E91B5393256AAA6500E96549 /* WifiConnect */, + E9620803255C2ED100D3A35D /* Runner.entitlements */, + E91B53A1256AAD8200E96549 /* Main_Custom.storyboard */, 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, @@ -99,11 +167,36 @@ path = Runner; sourceTree = ""; }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { + E91B538C256AAA6500E96549 /* Helper */ = { + isa = PBXGroup; + children = ( + E91B538D256AAA6500E96549 /* GlobalHelper.swift */, + E91B538E256AAA6500E96549 /* Extensions.swift */, + E91B538F256AAA6500E96549 /* API.swift */, + E9E27167256E3A4000F49B69 /* LocalizedFromFlutter.swift */, + E923EFD125863FDF00E3E751 /* GeoZoneModel.swift */, + E923EFD3258645C100E3E751 /* HMG_Geofence.swift */, + E923EFD52587443800E3E751 /* HMGPlatformBridge.swift */, + ); + path = Helper; + sourceTree = ""; + }; + E91B5390256AAA6500E96549 /* Controllers */ = { isa = PBXGroup; children = ( + E91B5392256AAA6500E96549 /* MainFlutterVC.swift */, ); - name = "Supporting Files"; + path = Controllers; + sourceTree = ""; + }; + E91B5393256AAA6500E96549 /* WifiConnect */ = { + isa = PBXGroup; + children = ( + E9C8C135256BACDA00EFFB62 /* HMG_Guest.swift */, + E91B5394256AAA6500E96549 /* HMG_Internet.swift */, + E91B5395256AAA6500E96549 /* HMG_GUEST_bkp.swift */, + ); + path = WifiConnect; sourceTree = ""; }; /* End PBXGroup section */ @@ -113,12 +206,15 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + 299B8FE131E5BAE7FA7E2FC9 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 125A739F71A29FBAE7B4D5AC /* [CP] Embed Pods Frameworks */, + 940F4A376A48B060117A1E5D /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -167,9 +263,13 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + E91B53A0256AAC1400E96549 /* GuestPOC_Certificate.cer in Resources */, 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + E923EFD82588D17700E3E751 /* gpx.gpx in Resources */, + E91B539F256AAC1400E96549 /* GuestPOC_Certificate.p12 in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + E91B53A3256AAD8200E96549 /* Main_Custom.storyboard in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -177,6 +277,45 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 125A739F71A29FBAE7B4D5AC /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 299B8FE131E5BAE7FA7E2FC9 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -191,6 +330,23 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; + 940F4A376A48B060117A1E5D /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -212,8 +368,19 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + E923EFD225863FDF00E3E751 /* GeoZoneModel.swift in Sources */, + E91B539A256AAA6500E96549 /* MainFlutterVC.swift in Sources */, + E91B539C256AAA6500E96549 /* HMG_GUEST_bkp.swift in Sources */, + E91B5396256AAA6500E96549 /* GlobalHelper.swift in Sources */, + E923EFD4258645C100E3E751 /* HMG_Geofence.swift in Sources */, + E923EFD62587443800E3E751 /* HMGPlatformBridge.swift in Sources */, 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + E9E27168256E3A4000F49B69 /* LocalizedFromFlutter.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + E9C8C136256BACDA00EFFB62 /* HMG_Guest.swift in Sources */, + E91B539B256AAA6500E96549 /* HMG_Internet.swift in Sources */, + E91B5397256AAA6500E96549 /* Extensions.swift in Sources */, + E91B5398256AAA6500E96549 /* API.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -236,12 +403,19 @@ name = LaunchScreen.storyboard; sourceTree = ""; }; + E91B53A1256AAD8200E96549 /* Main_Custom.storyboard */ = { + isa = PBXVariantGroup; + children = ( + E91B53A2256AAD8200E96549 /* Base */, + ); + name = Main_Custom.storyboard; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 249021D3217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -281,7 +455,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -296,19 +470,25 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.cloud.diplomaticquarterapp; + PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -318,7 +498,6 @@ }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -364,7 +543,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -374,7 +553,6 @@ }; 97C147041CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -414,11 +592,12 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -430,19 +609,25 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.cloud.diplomaticquarterapp; + PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -457,19 +642,25 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.cloud.diplomaticquarterapp; + PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index a28140cf..fb2dffc4 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -27,8 +27,6 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> - - - - + + - - + + diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index 70693e4a..e686619c 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -1,13 +1,47 @@ import UIKit import Flutter +import GoogleMaps + @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) + let locationManager = CLLocationManager() + + override func application( _ application: UIApplication,didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { +// initLocationManager() + + GMSServices.provideAPIKey("AIzaSyCiiJiHkocPbcziHt9O8rGWavDrxHRQys8") + GeneratedPluginRegistrant.register(with: self) + + if let mainViewController = window.rootViewController as? MainFlutterVC{ + HMGPlatformBridge.initialize(flutterViewController: mainViewController) + } + + if let _ = launchOptions?[.location] { + HMG_Geofence.initGeofencing() + } + + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} + +extension AppDelegate: CLLocationManagerDelegate { + + func initLocationManager(){ + locationManager.allowsBackgroundLocationUpdates = true + locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters + locationManager.activityType = .other + locationManager.delegate = self + locationManager.requestAlwaysAuthorization() + } + + func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) { + if region is CLCircularRegion { + } + } + + func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) { + if region is CLCircularRegion { + } } } diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard index f3c28516..8ae1ba59 100644 --- a/ios/Runner/Base.lproj/Main.storyboard +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -1,26 +1,29 @@ - - + + + - + + - + - + - + - + + diff --git a/ios/Runner/Base.lproj/Main_Custom.storyboard b/ios/Runner/Base.lproj/Main_Custom.storyboard new file mode 100644 index 00000000..de2d580c --- /dev/null +++ b/ios/Runner/Base.lproj/Main_Custom.storyboard @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Controllers/MainFlutterVC.swift b/ios/Runner/Controllers/MainFlutterVC.swift new file mode 100644 index 00000000..4f91d052 --- /dev/null +++ b/ios/Runner/Controllers/MainFlutterVC.swift @@ -0,0 +1,118 @@ +// +// MainFlutterVC.swift +// Runner +// +// Created by ZiKambrani on 25/03/1442 AH. +// + +import UIKit +import Flutter +import NetworkExtension +import SystemConfiguration.CaptiveNetwork + +class MainFlutterVC: FlutterViewController { + + override func viewDidLoad() { + super.viewDidLoad() + +// flutterMethodChannel?.setMethodCallHandler { (methodCall, result) in +// +// if methodCall.method == "connectHMGInternetWifi"{ +// self.connectHMGInternetWifi(methodCall:methodCall, result: result) +// +// }else if methodCall.method == "connectHMGGuestWifi"{ +// self.connectHMGGuestWifi(methodCall:methodCall, result: result) +// +// }else if methodCall.method == "isHMGNetworkAvailable"{ +// self.isHMGNetworkAvailable(methodCall:methodCall, result: result) +// +// }else if methodCall.method == "registerHmgGeofences"{ +// self.registerHmgGeofences(result: result) +// } +// +// print("") +// } +// +// FlutterText.with(key: "errorConnectingHmgNetwork") { (localized) in +// print(localized) +// } + + } + + + // Connect HMG Wifi and Internet + func connectHMGInternetWifi(methodCall:FlutterMethodCall ,result: @escaping FlutterResult){ + + guard let pateintId = (methodCall.arguments as? [Any])?.first as? String + else { return assert(true, "Missing or invalid arguments (Must have one argument 'String at 0'") } + + + HMG_Internet.shared.connect(patientId: pateintId) { (status, message) in + result(status ? 1 : 0) + if status{ + self.showMessage(title:"Congratulations", message:message) + }else{ + self.showMessage(title:"Ooops,", message:message) + } + } + } + + // Connect HMG-Guest for App Access + func connectHMGGuestWifi(methodCall:FlutterMethodCall ,result: @escaping FlutterResult){ + HMG_GUEST.shared.connect() { (status, message) in + result(status ? 1 : 0) + if status{ + self.showMessage(title:"Congratulations", message:message) + }else{ + self.showMessage(title:"Ooops,", message:message) + } + } + } + + func isHMGNetworkAvailable(methodCall:FlutterMethodCall ,result: @escaping FlutterResult) -> Bool{ + guard let ssid = methodCall.arguments as? String else { + assert(true, "Missing or invalid arguments (Must have one argument 'String at 0'") + return false + } + + let queue = DispatchQueue.init(label: "com.hmg.wifilist") + NEHotspotHelper.register(options: nil, queue: queue) { (command) in + print(command) + + if(command.commandType == NEHotspotHelperCommandType.filterScanList) { + if let networkList = command.networkList{ + for network in networkList{ + print(network.ssid) + } + } + } + } + return false + + } + + + // Message Dailog + func showMessage(title:String, message:String){ + DispatchQueue.main.async { + let alert = UIAlertController(title: title, message: message, preferredStyle: .alert ) + alert.addAction(UIAlertAction(title: "OK", style: .destructive, handler: nil)) + self.present(alert, animated: true) { + + } + } + } + + // Register Geofence + func registerHmgGeofences(result: @escaping FlutterResult){ + flutterMethodChannel?.invokeMethod("getGeofencePreferenceKey", arguments: nil){ geoFencesJsonString in + if let jsonString = geoFencesJsonString as? String{ + let allZones = GeoZoneModel.list(from: jsonString) + HMG_Geofence().register(geoZones: allZones) + + }else{ + } + } + } + +} diff --git a/ios/Runner/GoogleService-Info.plist b/ios/Runner/GoogleService-Info.plist new file mode 100644 index 00000000..0c093a2a --- /dev/null +++ b/ios/Runner/GoogleService-Info.plist @@ -0,0 +1,36 @@ + + + + + CLIENT_ID + 864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r + API_KEY + AIzaSyA_6ayGCk4fly7o7eTVBrj9kuHBYHMAOfs + GCM_SENDER_ID + 864393916058 + PLIST_VERSION + 1 + BUNDLE_ID + com.cloud.diplomaticquarterapp + PROJECT_ID + diplomaticquarter-d2385 + STORAGE_BUCKET + diplomaticquarter-d2385.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:864393916058:ios:13f787bbfe6051f8b97923 + DATABASE_URL + https://diplomaticquarter-d2385.firebaseio.com + + \ No newline at end of file diff --git a/ios/Runner/GuestPOC_Certificate.cer b/ios/Runner/GuestPOC_Certificate.cer new file mode 100644 index 00000000..f3804f6e Binary files /dev/null and b/ios/Runner/GuestPOC_Certificate.cer differ diff --git a/ios/Runner/GuestPOC_Certificate.p12 b/ios/Runner/GuestPOC_Certificate.p12 new file mode 100644 index 00000000..8e289212 Binary files /dev/null and b/ios/Runner/GuestPOC_Certificate.p12 differ diff --git a/ios/Runner/Helper/API.swift b/ios/Runner/Helper/API.swift new file mode 100644 index 00000000..763147c8 --- /dev/null +++ b/ios/Runner/Helper/API.swift @@ -0,0 +1,17 @@ +// +// API.swift +// Runner +// +// Created by ZiKambrani on 04/04/1442 AH. +// + +import UIKit + +fileprivate let DOMAIN = "https://uat.hmgwebservices.com" +fileprivate let SERVICE = "Services/Patients.svc/REST" +fileprivate let BASE_URL = "\(DOMAIN)/\(SERVICE)" + +struct API { + static let WIFI_CREDENTIALS = "\(BASE_URL)/Hmg_SMS_Get_By_ProjectID_And_PatientID" + +} diff --git a/ios/Runner/Helper/Extensions.swift b/ios/Runner/Helper/Extensions.swift new file mode 100644 index 00000000..a8793617 --- /dev/null +++ b/ios/Runner/Helper/Extensions.swift @@ -0,0 +1,132 @@ +// +// Extensions.swift +// Runner +// +// Created by ZiKambrani on 04/04/1442 AH. +// + +import UIKit + + +extension String{ + func toUrl() -> URL?{ + return URL(string: self) + } + + func removeSpace() -> String?{ + return self.replacingOccurrences(of: " ", with: "") + } +} + +extension Bundle { + + func certificate(named name: String) -> SecCertificate { + let cerURL = self.url(forResource: name, withExtension: "cer")! + let cerData = try! Data(contentsOf: cerURL) + let cer = SecCertificateCreateWithData(nil, cerData as CFData)! + return cer + } + + func identity(named name: String, password: String) -> SecIdentity { + let p12URL = self.url(forResource: name, withExtension: "p12")! + let p12Data = try! Data(contentsOf: p12URL) + + var importedCF: CFArray? = nil + let options = [kSecImportExportPassphrase as String: password] + let err = SecPKCS12Import(p12Data as CFData, options as CFDictionary, &importedCF) + precondition(err == errSecSuccess) + let imported = importedCF! as NSArray as! [[String:AnyObject]] + precondition(imported.count == 1) + + return (imported[0][kSecImportItemIdentity as String]!) as! SecIdentity + } + + +} + +extension SecCertificate{ + func trust() -> Bool?{ + var optionalTrust: SecTrust? + let policy = SecPolicyCreateBasicX509() + + let status = SecTrustCreateWithCertificates([self] as AnyObject, + policy, + &optionalTrust) + guard status == errSecSuccess else { return false} + let trust = optionalTrust! + + let stat = optionalTrust?.evaluateAllowing(rootCertificates: [self]) + return stat + } + + func secTrustObject() -> SecTrust?{ + var optionalTrust: SecTrust? + let policy = SecPolicyCreateBasicX509() + + let status = SecTrustCreateWithCertificates([self] as AnyObject, + policy, + &optionalTrust) + return optionalTrust + } +} + + +extension SecTrust { + + func evaluate() -> Bool { + var trustResult: SecTrustResultType = .invalid + let err = SecTrustEvaluate(self, &trustResult) + guard err == errSecSuccess else { return false } + return [.proceed, .unspecified].contains(trustResult) + } + + func evaluateAllowing(rootCertificates: [SecCertificate]) -> Bool { + + // Apply our custom root to the trust object. + + var err = SecTrustSetAnchorCertificates(self, rootCertificates as CFArray) + guard err == errSecSuccess else { return false } + + // Re-enable the system's built-in root certificates. + + err = SecTrustSetAnchorCertificatesOnly(self, false) + guard err == errSecSuccess else { return false } + + // Run a trust evaluation and only allow the connection if it succeeds. + + return self.evaluate() + } +} + + +extension UIView{ + func show(){ + self.alpha = 0.0 + self.isHidden = false + UIView.animate(withDuration: 0.25, animations: { + self.alpha = 1 + }) { (complete) in + + } + } + + func hide(){ + UIView.animate(withDuration: 0.25, animations: { + self.alpha = 0.0 + }) { (complete) in + self.isHidden = true + } + } +} + + +extension UIViewController{ + func showAlert(withTitle: String, message: String){ + let alert = UIAlertController(title: withTitle, message: message, preferredStyle: .alert) + alert.addAction(UIAlertAction(title: "OK", style: .destructive, handler: nil)) + present(alert, animated: true) { + + } + } +} + diff --git a/ios/Runner/Helper/GeoZoneModel.swift b/ios/Runner/Helper/GeoZoneModel.swift new file mode 100644 index 00000000..e703b64c --- /dev/null +++ b/ios/Runner/Helper/GeoZoneModel.swift @@ -0,0 +1,67 @@ +// +// GeoZoneModel.swift +// Runner +// +// Created by ZiKambrani on 13/12/2020. +// + +import UIKit +import CoreLocation + +class GeoZoneModel{ + var geofenceId:Int = -1 + var description:String = "" + var descriptionN:String? + var latitude:String? + var longitude:String? + var radius:Int? + var type:Int? + var projectID:Int? + var imageURL:String? + var isCity:String? + + func identifier() -> String{ + return "\(geofenceId)_hmg" + } + + func message() -> String{ + return description + } + + func toRegion(locationManager:CLLocationManager) -> CLCircularRegion?{ + if let rad = radius, let lat = latitude?.removeSpace(), let long = longitude?.removeSpace(), + let radius_d = Double("\(rad)"), let lat_d = Double(lat), let long_d = Double(long){ + + let coordinate = CLLocationCoordinate2D(latitude: lat_d, longitude: long_d) + let validatedRadius = min(radius_d, locationManager.maximumRegionMonitoringDistance) + + let region = CLCircularRegion(center: coordinate, radius: validatedRadius, identifier: identifier()) + region.notifyOnExit = true + region.notifyOnEntry = true + return region + } + return nil + } + + class func from(json:[String:Any]) -> GeoZoneModel{ + let model = GeoZoneModel() + model.geofenceId = json["GEOF_ID"] as? Int ?? 0 + model.radius = json["Radius"] as? Int + model.projectID = json["ProjectID"] as? Int + model.type = json["Type"] as? Int + model.description = json["Description"] as? String ?? "" + model.descriptionN = json["DescriptionN"] as? String + model.latitude = json["Latitude"] as? String + model.longitude = json["Longitude"] as? String + model.imageURL = json["ImageURL"] as? String + model.isCity = json["IsCity"] as? String + + return model + } + + class func list(from jsonString:String) -> [GeoZoneModel]{ + let value = dictionaryArray(from: jsonString) + let geoZones = value.map { GeoZoneModel.from(json: $0) } + return geoZones + } +} diff --git a/ios/Runner/Helper/GlobalHelper.swift b/ios/Runner/Helper/GlobalHelper.swift new file mode 100644 index 00000000..c5eb7295 --- /dev/null +++ b/ios/Runner/Helper/GlobalHelper.swift @@ -0,0 +1,85 @@ +// +// GlobalHelper.swift +// Runner +// +// Created by ZiKambrani on 29/03/1442 AH. +// + +import UIKit + +func dictionaryArray(from:String) -> [[String:Any]]{ + if let data = from.data(using: .utf8) { + do { + return try JSONSerialization.jsonObject(with: data, options: []) as? [[String: Any]] ?? [] + } catch { + print(error.localizedDescription) + } + } + return [] + +} + +func dictionary(from:String) -> [String:Any]?{ + if let data = from.data(using: .utf8) { + do { + return try? JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] + } catch { + print(error.localizedDescription) + } + } + return nil + +} + +func showNotification(identifier:String? = nil, title:String?, subtitle:String?, message:String?, sound:UNNotificationSound = UNNotificationSound.default){ + let notificationContent = UNMutableNotificationContent() + + if identifier != nil { notificationContent.categoryIdentifier = identifier! } + if title != nil { notificationContent.title = title! } + if subtitle != nil { notificationContent.body = message! } + if message != nil { notificationContent.subtitle = subtitle! } + + notificationContent.sound = UNNotificationSound.default + let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false) + let request = UNNotificationRequest(identifier: "\(Date().timeIntervalSinceNow)", content: notificationContent, trigger: trigger) + UNUserNotificationCenter.current().add(request) { error in + if let error = error { + print("Error: \(error)") + } + } +} + + +func httpPostRequest(urlString:String, jsonBody:[String:Any], completion:((Bool,[String:Any]?)->Void)?){ + let json: [String: Any] = jsonBody + let jsonData = try? JSONSerialization.data(withJSONObject: json) + + // create post request + let url = URL(string: urlString)! + var request = URLRequest(url: url) + request.addValue("application/json", forHTTPHeaderField: "Content-Type") + request.addValue("*/*", forHTTPHeaderField: "Accept") + request.httpMethod = "POST" + request.httpBody = jsonData + + let task = URLSession.shared.dataTask(with: request) { data, response, error in + guard let data = data, error == nil else { + print(error?.localizedDescription ?? "No data") + return + } + + let responseJSON = try? JSONSerialization.jsonObject(with: data, options: []) + if let responseJSON = responseJSON as? [String: Any], let status = responseJSON["MessageStatus"] as? Int{ + print(responseJSON) + if status == 1{ + completion?(true,responseJSON) + }else{ + completion?(false,responseJSON) + } + + } + } + + task.resume() + +} diff --git a/ios/Runner/Helper/HMGPlatformBridge.swift b/ios/Runner/Helper/HMGPlatformBridge.swift new file mode 100644 index 00000000..f897188c --- /dev/null +++ b/ios/Runner/Helper/HMGPlatformBridge.swift @@ -0,0 +1,137 @@ +// +// HMGPlatformBridge.swift +// Runner +// +// Created by ZiKambrani on 14/12/2020. +// + +import UIKit +import NetworkExtension +import SystemConfiguration.CaptiveNetwork + +var flutterMethodChannel:FlutterMethodChannel? = nil +var mainViewController:MainFlutterVC! + +class HMGPlatformBridge{ + private let channelName = "HMG-Platform-Bridge" + private static var shared_:HMGPlatformBridge? + + class func initialize(flutterViewController:MainFlutterVC){ + shared_ = HMGPlatformBridge() + mainViewController = flutterViewController + shared_?.openChannel() + } + + func shared() -> HMGPlatformBridge{ + assert((HMGPlatformBridge.shared_ != nil), "HMGPlatformBridge is not initialized, call initialize(mainViewController:MainFlutterVC) function first.") + return HMGPlatformBridge.shared_! + } + + private func openChannel(){ + flutterMethodChannel = FlutterMethodChannel(name: channelName, binaryMessenger: mainViewController.binaryMessenger) + flutterMethodChannel?.setMethodCallHandler { (methodCall, result) in + print("Called function \(methodCall.method)") + if methodCall.method == "connectHMGInternetWifi"{ + self.connectHMGInternetWifi(methodCall:methodCall, result: result) + + }else if methodCall.method == "connectHMGGuestWifi"{ + self.connectHMGGuestWifi(methodCall:methodCall, result: result) + + }else if methodCall.method == "isHMGNetworkAvailable"{ + self.isHMGNetworkAvailable(methodCall:methodCall, result: result) + + }else if methodCall.method == "registerHmgGeofences"{ + self.registerHmgGeofences(result: result) + + }else if methodCall.method == "unRegisterHmgGeofences"{ + self.unRegisterHmgGeofences(result: result) + } + + print("") + } + } + + + + // Connect HMG Wifi and Internet + func connectHMGInternetWifi(methodCall:FlutterMethodCall ,result: @escaping FlutterResult){ + + guard let pateintId = (methodCall.arguments as? [Any])?.first as? String + else { return assert(true, "Missing or invalid arguments (Must have one argument 'String at 0'") } + + + HMG_Internet.shared.connect(patientId: pateintId) { (status, message) in + result(status ? 1 : 0) + if status{ + self.showMessage(title:"Congratulations", message:message) + }else{ + self.showMessage(title:"Ooops,", message:message) + } + } + } + + // Connect HMG-Guest for App Access + func connectHMGGuestWifi(methodCall:FlutterMethodCall ,result: @escaping FlutterResult){ + HMG_GUEST.shared.connect() { (status, message) in + result(status ? 1 : 0) + if status{ + self.showMessage(title:"Congratulations", message:message) + }else{ + self.showMessage(title:"Ooops,", message:message) + } + } + } + + func isHMGNetworkAvailable(methodCall:FlutterMethodCall ,result: @escaping FlutterResult) -> Bool{ + guard let ssid = methodCall.arguments as? String else { + assert(true, "Missing or invalid arguments (Must have one argument 'String at 0'") + return false + } + + let queue = DispatchQueue.init(label: "com.hmg.wifilist") + NEHotspotHelper.register(options: nil, queue: queue) { (command) in + print(command) + + if(command.commandType == NEHotspotHelperCommandType.filterScanList) { + if let networkList = command.networkList{ + for network in networkList{ + print(network.ssid) + } + } + } + } + return false + + } + + + // Message Dailog + func showMessage(title:String, message:String){ + DispatchQueue.main.async { + let alert = UIAlertController(title: title, message: message, preferredStyle: .alert ) + alert.addAction(UIAlertAction(title: "OK", style: .destructive, handler: nil)) + mainViewController.present(alert, animated: true) { + + } + } + } + + // Register Geofence + func registerHmgGeofences(result: @escaping FlutterResult){ + flutterMethodChannel?.invokeMethod("getGeoZones", arguments: nil){ geoFencesJsonString in + if let jsonString = geoFencesJsonString as? String{ + let allZones = GeoZoneModel.list(from: jsonString) + HMG_Geofence.shared().register(geoZones: allZones) + result(true) + }else{ + } + } + } + + // Register Geofence + func unRegisterHmgGeofences(result: @escaping FlutterResult){ + HMG_Geofence.shared().unRegisterAll() + result(true) + } + +} diff --git a/ios/Runner/Helper/HMG_Geofence.swift b/ios/Runner/Helper/HMG_Geofence.swift new file mode 100644 index 00000000..fb469165 --- /dev/null +++ b/ios/Runner/Helper/HMG_Geofence.swift @@ -0,0 +1,189 @@ +// +// HMG_Geofence.swift +// Runner +// +// Created by ZiKambrani on 13/12/2020. +// + +import UIKit +import CoreLocation + +fileprivate var df = DateFormatter() +fileprivate var transition = "" + +enum Transition:Int { + case entry = 1 + case exit = 2 + func name() -> String{ + return self.rawValue == 1 ? "Enter" : "Exit" + } +} + +class HMG_Geofence:NSObject{ + + var geoZones:[GeoZoneModel]? + var locationManager:CLLocationManager!{ + didSet{ + // https://developer.apple.com/documentation/corelocation/cllocationmanager/1423531-startmonitoringsignificantlocati + + locationManager.allowsBackgroundLocationUpdates = true + locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters + locationManager.activityType = .other + locationManager.delegate = self + locationManager.requestAlwaysAuthorization() + // locationManager.distanceFilter = 500 + // locationManager.startMonitoringSignificantLocationChanges() + } + } + + private static var shared_:HMG_Geofence? + class func shared() -> HMG_Geofence{ + if HMG_Geofence.shared_ == nil{ + HMG_Geofence.initGeofencing() + } + return shared_! + } + + class func initGeofencing(){ + shared_ = HMG_Geofence() + shared_?.locationManager = CLLocationManager() + } + + func register(geoZones:[GeoZoneModel]){ + + self.geoZones = geoZones + + let monitoredRegions_ = monitoredRegions() + self.geoZones?.forEach({ (zone) in + if let region = zone.toRegion(locationManager: locationManager){ + if let already = monitoredRegions_.first(where: {$0.identifier == zone.identifier()}){ + debugPrint("Already monitering region: \(already)") + }else{ + startMonitoring(region: region) + } + }else{ + debugPrint("Invalid region: \(zone.latitude ?? "invalid_latitude"),\(zone.longitude ?? "invalid_longitude"),r\(zone.radius ?? 0) | \(zone.identifier())") + } + }) + } + + func monitoredRegions() -> Set{ + return locationManager.monitoredRegions + } + + func unRegisterAll(){ + for region in locationManager.monitoredRegions { + locationManager.stopMonitoring(for: region) + } + } + +} + +// CLLocationManager Delegates +extension HMG_Geofence : CLLocationManagerDelegate{ + + func startMonitoring(region: CLCircularRegion) { + if !CLLocationManager.isMonitoringAvailable(for: CLCircularRegion.self) { + return + } + + if CLLocationManager.authorizationStatus() != .authorizedAlways { + let message = """ + Your geotification is saved but will only be activated once you grant + HMG permission to access the device location. + """ + debugPrint(message) + } + + locationManager.startMonitoring(for: region) + locationManager.requestState(for: region) + debugPrint("Starts monitering region: \(region)") + } + + func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) { + debugPrint("didEnterRegion: \(region)") + if region is CLCircularRegion { + handleEvent(for: region,transition: .entry, location: manager.location) + } + } + + func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) { + debugPrint("didExitRegion: \(region)") + if region is CLCircularRegion { + handleEvent(for: region,transition: .exit, location: manager.location) + } + } + + func locationManager(_ manager: CLLocationManager, didDetermineState state: CLRegionState, for region: CLRegion) { + debugPrint("didDetermineState: \(state)") + } + + func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { + debugPrint("didUpdateLocations: \(locations)") + } + + +} + +// Helpers +extension HMG_Geofence{ + + func handleEvent(for region: CLRegion!, transition:Transition, location:CLLocation?) { + notifyUser(forRegion: region, transition: transition, location: locationManager.location) + notifyServer(forRegion: region, transition: transition, location: locationManager.location) + } + + func geoZone(by id: String) -> GeoZoneModel? { + var zone:GeoZoneModel? = nil + if let zones_ = geoZones{ + zone = zones_.first(where: { $0.identifier() == id}) + }else{ + // let jsonArray = UserDefaults.standard.string(forKey: "hmg-geo-fences") + } + return zone + } + + + func notifyUser(forRegion:CLRegion, transition:Transition, location:CLLocation?){ + if let zone = geoZone(by: forRegion.identifier){ + if UIApplication.shared.applicationState == .active { + mainViewController.showAlert(withTitle: transition.name(), message: zone.message()) + }else{ + + } + } + } + + func notifyServer(forRegion:CLRegion, transition:Transition, location:CLLocation?){ + df.dateFormat = "MMM/dd/yyyy hh:mm:ss" + if let userProfileJson = UserDefaults.standard.string(forKey: "flutter.user-profile"), + let userProfile = dictionary(from: userProfileJson), let patientId = userProfile["PatientID"] as? Int{ + + if let idString = forRegion.identifier.split(separator: "_").first, let idInt = Int(idString){ + let body:[String:Any] = [ + "PointsID":idInt, + "GeoType":transition.rawValue, + "PatientID":patientId + ] + + let url = "https://hmgwebservices.com/Services/Patients.svc/REST/GeoF_InsertPatientFileInfo" + httpPostRequest(urlString: url, jsonBody: body){ (status,json) in + let status_ = status ? "Notified" : "Not notified" + showNotification(title: transition.name(), subtitle: forRegion.identifier, message: status_) + + + var logs = UserDefaults.init(suiteName: "GeoFenceLog")?.dictionary(forKey: "LOGS") ?? [:] + if var geo = logs[forRegion.identifier] as? [String]{ + geo.append("\(status_) at \(df.string(from: Date()))") + }else{ + logs.updateValue(["\(status_) at \(df.string(from: Date()))"], forKey: forRegion.identifier) + } + + UserDefaults.init(suiteName: "GeoFenceLog")?.set(logs, forKey: "LOGS") + + } + } + } + } +} + diff --git a/ios/Runner/Helper/LocalizedFromFlutter.swift b/ios/Runner/Helper/LocalizedFromFlutter.swift new file mode 100644 index 00000000..88530649 --- /dev/null +++ b/ios/Runner/Helper/LocalizedFromFlutter.swift @@ -0,0 +1,22 @@ +// +// LocalizedFromFlutter.swift +// Runner +// +// Created by ZiKambrani on 10/04/1442 AH. +// + +import UIKit + +class FlutterText{ + + class func with(key:String,completion: @escaping (String)->Void){ + flutterMethodChannel?.invokeMethod("localizedValue", arguments: key, result: { (result) in + if let localized = result as? String{ + completion(localized) + }else{ + completion(key) + } + }) + } + +} diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 8f1009c3..ae084167 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -22,10 +22,38 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + NSCalendarsUsageDescription + We need access to record you event in to calender. + NSCameraUsageDescription + Need camera access for uploading images + NSLocationAlwaysAndWhenInUseUsageDescription + This app will use your location to show cool stuffs near you. + NSLocationAlwaysUsageDescription + This app will use your location to show cool stuffs near you. + NSLocationUsageDescription + Need location access for updating nearby friends + NSLocationWhenInUseUsageDescription + This app will use your location to show cool stuffs near you. + NSMicrophoneUsageDescription + Need microphone access for uploading videos + NSPhotoLibraryUsageDescription + Need photo library access for uploading images + UIBackgroundModes + + fetch + location + processing + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main + UIRequiredDeviceCapabilities + + location-services + gps + armv7 + UISupportedInterfaceOrientations UIInterfaceOrientationPortrait @@ -41,5 +69,7 @@ UIViewControllerBasedStatusBarAppearance + io.flutter.embedded_views_preview + diff --git a/ios/Runner/Runner.entitlements b/ios/Runner/Runner.entitlements new file mode 100644 index 00000000..be2e0283 --- /dev/null +++ b/ios/Runner/Runner.entitlements @@ -0,0 +1,14 @@ + + + + + + + aps-environment + development + com.apple.developer.networking.HotspotConfiguration + + com.apple.developer.networking.wifi-info + + + diff --git a/ios/Runner/WifiConnect/HMG_GUEST.swift b/ios/Runner/WifiConnect/HMG_GUEST.swift new file mode 100644 index 00000000..ad6d3922 --- /dev/null +++ b/ios/Runner/WifiConnect/HMG_GUEST.swift @@ -0,0 +1,77 @@ +// +// HMG_GUEST.swift +// HMG-iOS-Wifi +// +// Created by ZiKambrani on 23/03/1442 AH. +// Copyright © 1442 ZiKambrani. All rights reserved. +// + +import UIKit +import NetworkExtension +import SystemConfiguration.CaptiveNetwork + +fileprivate let SSID = "HMG-MobileApp" + +class HMG_GUEST{ + static let shared = HMG_GUEST() + + private var complete:((_ status:Bool, _ message:String) -> Void)! + func connect(completion:@escaping ((_ status:Bool, _ message:String) -> Void)){ + complete = completion + + if isAlreadyConnected() { + FlutterText.with(key: "alreadyConnectedHmgNetwork") { (localized) in + self.complete(true, localized ) + } + }else{ + connect() + } + } + + private func connect() { + + let hotspotConfig = NEHotspotConfiguration(ssid: "\(SSID)") + hotspotConfig.joinOnce = false + NEHotspotConfigurationManager.shared.apply(hotspotConfig) {[weak self] (error) in + guard let self = self else { return; } + + if let error = error { + FlutterText.with(key: "errorConnectingHmgNetwork") { (localized) in + self.complete(false, localized ) + } + }else{ + _ = Timer.scheduledTimer(withTimeInterval: 10, repeats: false) { (timer) in + let connected = self.isAlreadyConnected() + let message = connected ? "successConnectingHmgNetwork" : "failedConnectingHmgNetwork" + FlutterText.with(key: message) { (localized) in + self.complete(false, localized ) + } + } + } + } + + +// NSMutableURLRequest(url: URL(string: "www.google.com")!).bind(to: command) +// NEHotspotHelper.register(options: [:], queue: DispatchQueue.global()) { (command) in +// command +// print(command) +// } + + } + + private func isAlreadyConnected() -> Bool{ + var currentSSID: String? + if let interfaces = CNCopySupportedInterfaces() as NSArray? { + for interface in interfaces { + if let interfaceInfo = CNCopyCurrentNetworkInfo(interface as! CFString) as NSDictionary? { + currentSSID = interfaceInfo[kCNNetworkInfoKeySSID as String] as? String + break + } + } + } + + print("CurrentConnectedSSID: \(currentSSID)") + return currentSSID == SSID + } + +} diff --git a/ios/Runner/WifiConnect/HMG_GUEST_bkp.swift b/ios/Runner/WifiConnect/HMG_GUEST_bkp.swift new file mode 100644 index 00000000..e3dfd468 --- /dev/null +++ b/ios/Runner/WifiConnect/HMG_GUEST_bkp.swift @@ -0,0 +1,129 @@ +//// +//// HMG_GUEST.swift +//// HMG-iOS-Wifi +//// +//// Created by ZiKambrani on 23/03/1442 AH. +//// Copyright © 1442 ZiKambrani. All rights reserved. +//// +// +//import UIKit +//import NetworkExtension +//import SystemConfiguration.CaptiveNetwork +// +// +//class HMG_GUEST{ +// static let shared = HMG_GUEST() +// private let SSID = "GUEST-POC" +// private let USER = "1301" +// private let PASS = "8928" +// +// var complete:((_ status:Bool, _ message:String) -> Void)! +// func connect(completion:@escaping ((_ status:Bool, _ message:String) -> Void)){ +// complete = completion +// +// if isAlreadyConnected() { +// hasInternet { (has) in +// if has == true{ +// self.complete(true, "You already connected to internet") +// return +// }else{ +// self.authenticate() +// } +// } +// }else{ +// connect() +// } +// } +// +// private func connect() { +// let hotspotConfig = NEHotspotConfiguration(ssid: SSID) +// hotspotConfig.joinOnce = true +// +// NEHotspotConfigurationManager.shared.apply(hotspotConfig) {[weak self] (error) in +// guard let self = self else { return; } +// +// if let error = error { +// self.complete(false, error.localizedDescription ?? "Error connecting to HMG wifi network" ) +// }else{ +// _ = Timer.scheduledTimer(withTimeInterval: 2, repeats: false) { (timer) in +// self.authenticate() +// } +// } +// } +// } +// +// func authenticate(){ +// +// func callLogin(){ +// +// let parameters = "Login=Log%20In&cmd=authenticate&password=1820&user=2300" +// let postData = parameters.data(using: .utf8) +// +// var request = URLRequest(url: URL(string: "https://captiveportal-login.hmg.com/cgi-bin/login")!,timeoutInterval: 5) +// request.addValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type") +// +// request.httpMethod = "POST" +// request.httpBody = postData +// +// let task = URLSession.shared.dataTask(with: request) { data, response, error in +// // guard let data = data else { +// // self.complete(false, "Error at authentication") +// // return +// // } +// +// self.hasInternet { (has) in +// self.complete(has, has ? "Successfully connected to the internet" : "Authentication failed or you are already using your credentials on another device") +// } +// } +// task.resume() +// +// } +// +// self.hasInternet { (has) in +// if has == true{ +// self.complete(true, "Your internet account is already authenticated") +// }else{ +// callLogin() +// } +// } +// +// } +// +// private func isAlreadyConnected() -> Bool{ +// var currentSSID: String? +// if let interfaces = CNCopySupportedInterfaces() as NSArray? { +// for interface in interfaces { +// if let interfaceInfo = CNCopyCurrentNetworkInfo(interface as! CFString) as NSDictionary? { +// currentSSID = interfaceInfo[kCNNetworkInfoKeySSID as String] as? String +// break +// } +// } +// } +// +// print("CurrentConnectedSSID: \(currentSSID)") +// return currentSSID == SSID +// } +// +// +// func hasInternet( completion:@escaping ((Bool)->Void)){ +// +// let testUrl = "https://captive.apple.com" +// var request = URLRequest(url: URL(string: testUrl)!,timeoutInterval: 5) +// request.httpMethod = "GET" +// let task = URLSession.shared.dataTask(with: request) { data, response, error in +// guard let data = data else { +// completion(false) +// return +// } +// let resp = String(data: data, encoding: .utf8)! +// if resp.contains("Success"){ +// completion(true) +// }else{ +// completion(false) +// } +// +// } +// task.resume() +// } +// +//} diff --git a/ios/Runner/WifiConnect/HMG_Internet.swift b/ios/Runner/WifiConnect/HMG_Internet.swift new file mode 100644 index 00000000..00ac172f --- /dev/null +++ b/ios/Runner/WifiConnect/HMG_Internet.swift @@ -0,0 +1,193 @@ +// +// HMG_GUEST.swift +// HMG-iOS-Wifi +// +// Created by ZiKambrani on 23/03/1442 AH. +// Copyright © 1442 ZiKambrani. All rights reserved. +// + +import UIKit +import NetworkExtension +import SystemConfiguration.SCNetworkConnection + +fileprivate var TEST = false +fileprivate let SSID = "GUEST-POC" +fileprivate var USER = "" +fileprivate var PASS = "" + +fileprivate func supportedEAPTypes() -> [NSNumber]{ + let peap = NEHotspotEAPSettings.EAPType.EAPPEAP.rawValue + let fast = NEHotspotEAPSettings.EAPType.EAPFAST.rawValue + let tls = NEHotspotEAPSettings.EAPType.EAPTLS.rawValue + let ttls = NEHotspotEAPSettings.EAPType.EAPTTLS.rawValue + return [NSNumber(value: peap), NSNumber(value: fast), NSNumber(value: tls), NSNumber(value: ttls)] +} + +class HMG_Internet{ + static let shared = HMG_Internet() + + private var complete:((_ status:Bool, _ message:String) -> Void)! + func connect(patientId:String, completion:@escaping ((_ status:Bool, _ message:String) -> Void)){ + complete = completion + + if isAlreadyConnected() { + hasInternet { (has) in + if has == true{ + FlutterText.with(key: "alreadyConnectedHmgNetwork"){ localized in + self.complete(true, localized) + } + return + }else{ + FlutterText.with(key: "connectedToHmgNetworkWithNoInternet"){ localized in + self.complete(false, localized) + } + } + } + }else{ + connect(patientId: patientId) + } + } + + private func connect(patientId:String) { + + getWifiCredentials(patientId: patientId) { + let trust_cert = Bundle.main.certificate(named: "GuestPOC_Certificate") + guard trust_cert.trust() == true else{ + FlutterText.with(key: "notConnectedToHmgNetworkSecurityIssue"){ localized in + self.complete(false,localized) + } + return + } + + let eapSettings = NEHotspotEAPSettings() + eapSettings.username = USER + eapSettings.password = PASS + eapSettings.trustedServerNames = ["*.hmg.com","onboard.hmg.com","hmg.com"] + eapSettings.supportedEAPTypes = [supportedEAPTypes().first!] +// eapSettings.isTLSClientCertificateRequired = true +// eapSettings.ttlsInnerAuthenticationType = .eapttlsInnerAuthenticationMSCHAPv2 // MSCHAPv2 +// eapSettings.setIdentity(Bundle.main.identity(named: "GuestPOC_Certificate", password: "1")) +// eapSettings.setTrustedServerCertificates([trust_cert]) + + let hotspotConfig = NEHotspotConfiguration(ssid: SSID, eapSettings: eapSettings) + NEHotspotConfigurationManager.shared.apply(hotspotConfig) {[weak self] (error) in + guard let self = self else { return; } + + if let error = error { + + FlutterText.with(key: "errorConnectingHmgNetwork"){ localized in + self.complete(false,localized) + } + + }else{ + _ = Timer.scheduledTimer(withTimeInterval: 5, repeats: false) { (timer) in + self.hasInternet { (has) in + if has == true{ + FlutterText.with(key: "connectedHmgNetworkWithInternet"){ localized in + self.complete(true,localized) + } + return + }else{ + FlutterText.with(key: "connectedToHmgNetworkWithNoInternet"){ localized in + self.complete(false,localized) + } + } + } + } + } + } + + } + } + + private func isAlreadyConnected() -> Bool{ + var currentSSID: String? + if let interfaces = CNCopySupportedInterfaces() as NSArray? { + for interface in interfaces { + if let interfaceInfo = CNCopyCurrentNetworkInfo(interface as! CFString) as NSDictionary? { + currentSSID = interfaceInfo[kCNNetworkInfoKeySSID as String] as? String + break + } + } + } + print("CurrentConnectedSSID: \(currentSSID)") + return currentSSID == SSID + } + + + private func getWifiCredentials(patientId:String, success: @escaping (() -> Void)){ + if TEST { + success() + return + } + + guard let url = API.WIFI_CREDENTIALS.toUrl() else { return assert(true, "Invalid URL: \(API.WIFI_CREDENTIALS)") } + + // JSON Body for HTTP Request + let json: [String: Any] = ["PatientID": patientId] + let jsonData = try? JSONSerialization.data(withJSONObject: json) + + var request = URLRequest(url: url, timeoutInterval: 20) + request.httpMethod = "POST" + request.setValue("application/json", forHTTPHeaderField: "Content-Type") + request.httpBody = jsonData + + let task = URLSession.shared.dataTask(with: request) { data, response, error in + guard let data = data else { + self.somethingWentWrong() + return + } + + if let responseJSON = try? JSONSerialization.jsonObject(with: data, options: []) as? [String: Any]{ + if let requiredData = (responseJSON["Hmg_SMS_Get_By_ProjectID_And_PatientIDList"] as? [[String:Any]])?.first, + let userName = requiredData["UserName"] as? String, let password = requiredData["Password"] as? String{ + + USER = userName + PASS = password + success() + + }else if let errorMessage = responseJSON["ErrorMessage"] as? String{ + self.complete(false, errorMessage) + }else{ + self.somethingWentWrong() + } + }else{ + self.somethingWentWrong() + } + + } + task.resume() + + } + + private func somethingWentWrong(){ + FlutterText.with(key: "somethingWentWrong") { (localized) in + self.complete(false, localized) + } + } + + + func hasInternet( completion:@escaping ((Bool)->Void)){ + + let testUrl = "https://captive.apple.com" + var request = URLRequest(url: URL(string: testUrl)!,timeoutInterval: 5) + request.httpMethod = "GET" + let task = URLSession.shared.dataTask(with: request) { data, response, error in + guard let data = data else { + completion(false) + return + } + + completion( + String(data: data, encoding: .utf8)! + .replacingOccurrences(of: " ", with: "") + .replacingOccurrences(of: "\n", with: "") + .lowercased() + .contains("success") + ) + + } + task.resume() + } + +} diff --git a/ios/Runner/WifiConnect/HMG_Wifi.swift b/ios/Runner/WifiConnect/HMG_Wifi.swift new file mode 100644 index 00000000..1335f766 --- /dev/null +++ b/ios/Runner/WifiConnect/HMG_Wifi.swift @@ -0,0 +1,172 @@ +// +// HMG_GUEST.swift +// HMG-iOS-Wifi +// +// Created by ZiKambrani on 23/03/1442 AH. +// Copyright © 1442 ZiKambrani. All rights reserved. +// + +import UIKit +import NetworkExtension +import SystemConfiguration.CaptiveNetwork + +fileprivate var TEST = true +fileprivate let SSID = "GUEST-POC" +fileprivate var USER = "0696" +fileprivate var PASS = "0000" + +fileprivate func supportedEAPTypes() -> [NSNumber]{ + let peap = NEHotspotEAPSettings.EAPType.EAPPEAP.rawValue + let fast = NEHotspotEAPSettings.EAPType.EAPFAST.rawValue + let tls = NEHotspotEAPSettings.EAPType.EAPTLS.rawValue + let ttls = NEHotspotEAPSettings.EAPType.EAPTTLS.rawValue + return [NSNumber(value: peap), NSNumber(value: fast), NSNumber(value: tls), NSNumber(value: ttls)] +} + +class HMG_Internet{ + static let shared = HMG_Wifi() + + private var complete:((_ status:Bool, _ message:String) -> Void)! + func connect(patientId:String, completion:@escaping ((_ status:Bool, _ message:String) -> Void)){ + complete = completion + + if isAlreadyConnected() { + hasInternet { (has) in + if has == true{ + self.complete(true, "You already connected to HMG network to access internet") + return + }else{ + self.complete(false, "You are connected to HMG network but it have no internet access") + } + } + }else{ + connect(patientId: patientId) + } + } + + private func connect(patientId:String) { + + getWifiCredentials(patientId: patientId) { + let trust_cert = Bundle.main.certificate(named: "GuestPOC_Certificate") + guard trust_cert.trust() == true else{ + self.complete(false,"We are not able to connect you to HMG network due to security certificate") + return + } + + let eapSettings = NEHotspotEAPSettings() + eapSettings.username = USER + eapSettings.password = PASS + eapSettings.trustedServerNames = ["*.hmg.com","onboard.hmg.com","hmg.com"] + eapSettings.supportedEAPTypes = [supportedEAPTypes().first!] +// eapSettings.isTLSClientCertificateRequired = true +// eapSettings.ttlsInnerAuthenticationType = .eapttlsInnerAuthenticationMSCHAPv2 // MSCHAPv2 +// eapSettings.setIdentity(Bundle.main.identity(named: "GuestPOC_Certificate", password: "1")) +// eapSettings.setTrustedServerCertificates([trust_cert]) + + let hotspotConfig = NEHotspotConfiguration(ssid: SSID, eapSettings: eapSettings) + NEHotspotConfigurationManager.shared.apply(hotspotConfig) {[weak self] (error) in + guard let self = self else { return; } + + if let error = error { + self.complete(false, "Error connecting to HMG network" /*error.localizedDescription*/ ) + }else{ + _ = Timer.scheduledTimer(withTimeInterval: 3, repeats: false) { (timer) in + self.hasInternet { (has) in + if has == true{ + self.complete(true, "Successfully connected to the HMG network to access internet") + return + }else{ + self.complete(false, "Successfully connected to the HMG network but it have no internet access") + } + } + } + } + } + + } + } + + private func isAlreadyConnected() -> Bool{ + var currentSSID: String? + if let interfaces = CNCopySupportedInterfaces() as NSArray? { + for interface in interfaces { + if let interfaceInfo = CNCopyCurrentNetworkInfo(interface as! CFString) as NSDictionary? { + currentSSID = interfaceInfo[kCNNetworkInfoKeySSID as String] as? String + break + } + } + } + + print("CurrentConnectedSSID: \(currentSSID)") + return currentSSID == SSID + } + + + private func getWifiCredentials(patientId:String, completion: @escaping (() -> Void)){ + if TEST { + completion() + return + } + + guard let url = API.WIFI_CREDENTIALS.toUrl() else { return assert(true, "Invalid URL: \(API.WIFI_CREDENTIALS)") } + + // JSON Body for HTTP Request + let json: [String: Any] = ["PatientID": patientId] + let jsonData = try? JSONSerialization.data(withJSONObject: json) + + var request = URLRequest(url: url, timeoutInterval: 20) + request.httpMethod = "POST" + request.setValue("application/json", forHTTPHeaderField: "Content-Type") + request.httpBody = jsonData + + let task = URLSession.shared.dataTask(with: request) { data, response, error in + guard let data = data else { + self.complete(false, "Failed to get your internet credentials") + return + } + + if let responseJSON = try? JSONSerialization.jsonObject(with: data, options: []) as? [String: Any]{ + if let requiredData = responseJSON["Hmg_SMS_Get_By_ProjectID_And_PatientIDList"] as? [String:Any], + let userName = requiredData["UserName"] as? String, let password = requiredData["Password"] as? String{ + + USER = userName + PASS = password + completion() + + }else if let errorMessage = responseJSON["ErrorMessage"] as? String{ + self.complete(false, errorMessage) + } + }else{ + self.complete(false, "Failed to get your internet credentials") + } + + } + task.resume() + + } + + + func hasInternet( completion:@escaping ((Bool)->Void)){ + + let testUrl = "https://captive.apple.com" + var request = URLRequest(url: URL(string: testUrl)!,timeoutInterval: 5) + request.httpMethod = "GET" + let task = URLSession.shared.dataTask(with: request) { data, response, error in + guard let data = data else { + completion(false) + return + } + + completion( + String(data: data, encoding: .utf8)! + .replacingOccurrences(of: " ", with: "") + .replacingOccurrences(of: "\n", with: "") + .lowercased() + .contains("success") + ) + + } + task.resume() + } + +} diff --git a/ios/gpx.gpx b/ios/gpx.gpx new file mode 100644 index 00000000..9cc26956 --- /dev/null +++ b/ios/gpx.gpx @@ -0,0 +1 @@ + Sverrir Sigmundarson Office Office Mahmoud Home Mahmoud Home Panorama Mall Panorama Mall Saudi Architects Crossing Saudi Architects Crossing Office Office \ No newline at end of file diff --git a/key.properties b/key.properties new file mode 100644 index 00000000..eec491b8 --- /dev/null +++ b/key.properties @@ -0,0 +1,4 @@ +storePassword=HmGsa123 +keyPassword=HmGsa123 +keyAlias=key +storeFile=DQKey.jks \ No newline at end of file diff --git a/lib/Constants.dart b/lib/Constants.dart new file mode 100644 index 00000000..5b8fd9da --- /dev/null +++ b/lib/Constants.dart @@ -0,0 +1,3 @@ +import 'package:flutter/material.dart'; + +final Color secondaryColor = Colors.red[800]; \ No newline at end of file diff --git a/lib/config/config.dart b/lib/config/config.dart index 753fcd01..4183fe68 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -1,9 +1,354 @@ +import 'dart:io'; + +import 'package:diplomaticquarterapp/core/service/geofencing/GeofencingServices.dart'; +import 'package:diplomaticquarterapp/models/Request.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; const MAX_SMALL_SCREEN = 660; -const BASE_URL = ''; +// PACKAGES and OFFERS +const EXA_CART_API_BASE_URL = 'https://mdlaboratories.com/exacartapi'; +const PACKAGES_CATEGORIES = '/api/categories'; +const PACKAGES_PRODUCTS = '/api/products'; + +const BASE_URL = 'https://uat.hmgwebservices.com/'; +const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; + +// const BASE_URL = 'https://hmgwebservices.com/'; +const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; + +///Geofencing +const GET_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_GetAllPoints'; +const LOG_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_InsertPatientFileInfo'; +//weather +const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo'; + +const GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege'; + + +///Doctor +const GET_MY_DOCTOR = + 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; +const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles'; +const GET_DOCTOR_RATING_NOTES = + 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; +const GET_DOCTOR_RATING_DETAILS = + 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails'; +const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating'; + +///Prescriptions +const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; +const GET_PRESCRIPTIONS_ALL_ORDERS = + 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PRESCRIPTION_REPORT = + 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; +const SEND_PRESCRIPTION_EMAIL = + 'Services/Notifications.svc/REST/SendPrescriptionEmail'; +const GET_PRESCRIPTION_REPORT_ENH = + 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; + +///Lab Order +const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; +const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const SEND_LAB_RESULT_EMAIL = + 'Services/Notifications.svc/REST/SendLabReportEmail'; +const GET_Patient_LAB_RESULT = + 'Services/Patients.svc/REST/GetPatientLabResults'; +const GET_Patient_LAB_ORDERS_RESULT = + 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; + +/// +const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; +const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = + 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo'; + +const GET_PATIENT_ORDERS_DETAILS = 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead'; +const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; +const SEND_RAD_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendRadReportEmail'; + +///Feedback +const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList'; +const GET_STATUS_FOR_COCO = 'Services/COCWS.svc/REST/GetStatusforCOC'; +const GET_PATIENT_AppointmentHistory = 'Services' + '/Doctors.svc/REST/PateintHasAppoimentHistory'; + +///VITAL SIGN +const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; + +///Er Nearest +const GET_NEAREST_HOSPITAL = 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; + +///Er Nearest +const GET_AMBULANCE_REQUEST = 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; +const GET_PATIENT_ALL_PRES_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID = 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID'; +const UPDATE_PRESS_ORDER = 'Services/Patients.svc/REST/PatientER_UpdatePresOrder'; +const INSERT_ER_INERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; + +///FindUs +const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations'; + +///LiveChat +const GET_LIVECHAT_REQUEST = 'Services/Patients.svc/REST/GetPatientICProjects'; + +///babyInformation +const GET_BABYINFORMATION_REQUEST = 'Services/Community.svc/REST/GetBabyByUserID'; + +///Get Baby By User ID +const GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID'; + +///userInformation +const GET_USERINFORMATION_REQUEST = 'Services/Community.svc/REST/GetUserInformation_New'; + +///addNewChild +const GET_NEWCHILD_REQUEST = 'Services/Community.svc/REST/CreateNewBaby'; + +///newUserId +const GET_NEW_USER_REQUEST = 'Services/Community.svc/REST/CreateNewUser_New'; + +///delteChild +const DELETE_CHILD_REQUEST = 'Services/Community.svc/REST/DeleteBaby'; + +///addNewTABLE +const GET_TABLE_REQUEST = 'Services/Community.svc/REST/CreateVaccinationTable'; + +///BloodDenote +const GET_CITIES_REQUEST = 'Services/Lists.svc/REST/GetAllCities'; + +///BloodDetails +const GET_BLOOD_REQUEST = 'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails'; + +///Reports +const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; +const INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertRequestForMedicalReport'; +const SEND_MEDICAL_REPORT_EMAIL = + 'Services/Notifications.svc/REST/SendMedicalReportEmail'; + +///Rate +const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated'; +const GET_APPOINTMENT_DETAILS_BY_NO = 'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo'; + +const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID'; + +//const BASE_URL = 'https://hmgwebservices.com/'; // Production Environment +//const BASE_URL = 'https://hmgwebservices.com/Services'; // Production Environment +//const BASE_URL = 'https://uat.hmgwebservices.com/Services'; // UAT Environment + +//URL to get clinic list +const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized"; + +//URL to get active appointment list +const GET_ACTIVE_APPOINTMENTS_LIST_URL = "Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber"; + +//URL to get projects list +const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; + +//URL to get doctors list +const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime"; + +//URL to dental doctors list +const GET_DENTAL_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping"; + +//URL to get doctor free slots +const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots"; + +//URL to insert appointment +const INSERT_SPECIFIC_APPOINTMENT = "Services/Doctors.svc/REST/InsertSpecificAppointment"; + +//URL to get patient share +const GET_PATIENT_SHARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO"; + +//URL to get patient appointment history +const GET_PATIENT_APPOINTMENT_HISTORY = "Services/Doctors.svc/REST/PateintHasAppoimentHistory"; + +//URL to get patient appointment curfew history +const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = "Services/Doctors.svc/REST/AppoimentHistoryForCurfew"; + +//URL to confirm appointment +const CONFIRM_APPOINTMENT = "Services/MobileNotifications.svc/REST/ConfirmAppointment"; + +const INSERT_VIDA_REQUEST = "Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart"; + +//URL to cancel appointment +const CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment"; +//URL get appointment QR +const GENERATE_QR_APPOINTMENT = "Services/Doctors.svc/REST/GenerateQRAppointmentNo"; + +//URL send email appointment QR +const EMAIL_QR_APPOINTMENT = "Services/Notifications.svc/REST/sendEmailForOnLineCheckin"; + +//URL check payment status +const CHECK_PAYMENT_STATUS = "Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID"; + +//URL create advance payment +const CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment"; + +const HIS_CREATE_ADVANCE_PAYMENT = "Services/Patients.svc/REST/HIS_CreateAdvancePayment"; + +const ADD_ADVANCE_NUMBER_REQUEST = 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest'; + +const IS_ALLOW_ASK_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; +const GET_CALL_REQUEST_TYPE = 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; +const SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo'; + +const GET_LIVECARE_CLINICS = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics'; + +const GET_LIVECARE_SCHEDULE_CLINICS = 'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule'; + +const GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST = 'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID'; + +const GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS = 'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots'; + +const INSERT_LIVECARE_SCHEDULE_APPOINTMENT = 'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule'; + +const GET_PATIENT_SHARE_LIVECARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForLiveCare"; + +const GET_LIVECARE_CLINIC_TIMING = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule'; + +const GET_ER_APPOINTMENT_FEES = 'Services/DoctorApplication.svc/REST/GetERAppointmentFees'; +const GET_ER_APPOINTMENT_TIME = 'Services/ER_VirtualCall.svc/REST/GetRestTime'; + +const ADD_NEW_CALL_FOR_PATIENT_ER = 'Services/DoctorApplication.svc/REST/NewCallForPatientER'; + +const GET_LIVECARE_HISTORY = 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory'; +const CANCEL_LIVECARE_REQUEST = 'Services/ER_VirtualCall.svc/REST/DeleteErRequest'; +const SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare'; + +const GET_USER_TERMS = '/Services/Patients.svc/REST/GetUserTermsAndConditions'; +const UPDATE_HEALTH_TERMS = '/services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; + +//URL to get medicine and pharmacies list +const CHANNEL = 3; +const GENERAL_ID = 'Cs2020@2016\$2958'; +const IP_ADDRESS = '10.20.10.20'; +const VERSION_ID = 5.8; +const SETUP_ID = '91877'; +const LANGUAGE = 2; +const PATIENT_OUT_SA = 0; +const SESSION_ID = 'TMRhVmkGhOsvamErw'; +const IS_DENTAL_ALLOWED_BACKEND = false; +const PATIENT_TYPE = 1; +const PATIENT_TYPE_ID = 1; +var DEVICE_TOKEN = ""; +var DeviceTypeID = Platform.isIOS ? 1 : 2; +const LANGUAGE_ID = 1; +const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region"; +const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; +const GET_PAtIENTS_INSURANCE = "Services/Patients.svc/REST/Get_PatientInsuranceDetails"; +const GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; + +const INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList"; +const GET_PATIENT_INSURANCE_DETAILS = + "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails"; +const UPLOAD_INSURANCE_CARD = + 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate'; + +const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; +const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; +const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; +const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse'; + +const GET_VACCINATIONS_ITEMS = "/Services/ERP.svc/REST/GET_VACCINATIONS_ITEMS"; +const GET_VACCINATION_ONHAND = "/Services/ERP.svc/REST/GET_VACCINATION_ONHAND"; + +const GET_PATIENT_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; + +const SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail'; + +const GET_PATIENT_AdVANCE_BALANCE_AMOUNT = 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount'; +const GET_PATIENT_INFO_BY_ID = 'Services/Doctors.svc/REST/GetPatientInfoByPatientID'; +const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = 'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber'; +const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment'; +const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; + +const GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter'; + +const GET_COVID_DRIVETHRU_PAYMENT_INFO = 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation'; + +const GET_COVID_DRIVETHRU_FREE_SLOTS = 'Services/Doctors.svc/REST/COVID19_GetFreeSlots'; + +///Smartwatch Integration Services +const GET_PATIENT_LAST_RECORD = 'Services/Patients.svc/REST/Med_GetPatientLastRecord'; + +///My Trackers +const GET_DIABETIC_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; +const GET_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_GetDiabtecResults'; +const ADD_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_AddDiabtecResult'; + +const GET_BLOOD_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; +const GET_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetBloodPressureResult'; +const ADD_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddBloodPressureResult'; + +const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; +const GET_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; +const ADD_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; + +const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID = 'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID'; + +const GET_CALL_INFO_HOURS_RESULT = 'Services/Doctors.svc/REST/GetCallInfoHoursResult'; +const GET_CALL_REQUEST_TYPE_LOV = 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; +const GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse'; +const UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus'; +const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; + +const GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies'; + +// H2O +const H2O_GET_USER_PROGRESS = "Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; +const H2O_INSERT_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; +//E_Referral Services + +const GET_ALL_RELATIONSHIP_TYPES = "Services/Patients.svc/REST/GetAllRelationshipTypes"; +const SEND_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/SendActivationCodeForEReferral'; +const CHECK_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/CheckActivationCodeForEReferral'; +const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities'; +const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral"; +const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; + +// pharmacy +const GET_PHARMACY_BANNER = "epharmacy/api/promotionbanners"; +const GET_PHARMACY_TOP_MANUFACTURER = "epharmacy/api/topmanufacturer"; +const GET_PHARMACY_BEST_SELLER_PRODUCT = "epharmacy/api/bestsellerproducts"; +const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/"; +const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/"; + +// Home Health Care +const HHC_GET_ALL_SERVICES = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; +const HHC_GET_ALL_CMC_SERVICES = "Services/Patients.svc/REST/PatientER_CMC_GetAllServices"; +const PATIENT_ER_UPDATE_PRES_ORDER = "Services/Patients.svc/REST/PatientER_UpdatePresOrder"; +const GET_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder"; +const GET_CMC_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder"; +const GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems"; +const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; +const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead'; +const TIMER_MIN = 10; + +const GOOGLE_API_KEY = "AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw"; class AppGlobal { static var context; + + AppSharedPreferences sharedPref = AppSharedPreferences(); + + Request getPublicRequest() { + Request request = new Request(); + request.VersionID = 5.6; //3.6; + request.Channel = 3; + request.IPAdress = "10.20.10.20"; + request.generalid = 'Cs2020@2016\$2958'; + request.VersionID = VERSION_ID; //5.3; //3.6; + request.Channel = CHANNEL; //3; + request.IPAdress = IP_ADDRESS; //"10.20.10.20"; + request.generalid = GENERAL_ID; //'Cs2020@2016\$2958'; + request.PatientOutSA = 0; + request.SessionID = "wEVNbagIkaNhGECWZjHaA"; + request.TokenID = "@dm!n"; + request.isDentalAllowedBackend = false; + request.DeviceTypeID = Platform.isIOS ? 1 : 2; + request.DeviceType = Platform.isIOS ? "iOS" : "Android"; + + return request; + } } diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index cfa30672..b1f25ad9 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1,4 +1,28 @@ -const Map> localizedValues = { +// --------- - -- - - - - - - - - ---------------- +// Used for Native through Platform Method Channel +// --------- - -- - - - - - - - - ---------------- +const Map platformLocalizedValues = { + "errorConnectingHmgNetwork": {"en": "Sorry you are not connecting to HMG network", "ar": "نعتذر لست متصل في شكبة مستشفى د.سليمان الحبيب"}, + "successConnectingHmgNetwork": {"en": "You connected to HMG network successfully, you can access the app", "ar": "تم التصال بشبكة د.سليمان الحبيب بنجاح, تستطيع الان استخدام تطبيق الحبيب"}, + "failedConnectingHmgNetwork": { + "en": "Sorry the connection to HMG network had been failed, make sure you are in range of HMG network", + "ar": "نعتذر لقد فشل الاتصال بشبكة د.سليمان الحبيب, تاكد من وجودك داخل نطاق الشبكة" + }, + "alreadyConnectedHmgNetwork": {"en": " You already connected to HMG network to access Alhabib app", "ar": "انت متصل مسبقاً بالشبكة تستطيع استخدام تطبيق الحبيب"}, + "somethingWentWrong": {"en": "Sorry something went wrong please try again later", "ar": "نعتذر لخدمتكم يرجى المحاولة لاحقا"}, + "enablingWifi": {"en": "Enabling wifi...", "ar": "Enabling wifi..."}, + "connectedHmgNetworkWithInternet": {"en": "Successfully connected to the HMG network to access internet", "ar": "Successfully connected to the HMG network to access internet"}, + "connectedToHmgNetworkWithNoInternet": { + "en": "Successfully connected to the HMG network but it have no internet access", + "ar": "Successfully connected to the HMG network but it have no internet access" + }, + "notConnectedToHmgNetworkSecurityIssue": { + "en": "We are not able to connect you to HMG network due to security reasons", + "ar": "We are not able to connect you to HMG network due to security reasons" + } +}; + +const Map localizedValues = { 'dashboardScreenToolbarTitle': {'ar': 'الرئيسة', 'en': 'Home'}, 'settings': {'en': 'Settings', 'ar': 'الاعدادات'}, 'language': {'en': 'App Language', 'ar': 'لغة التطبيق'}, @@ -6,5 +30,1215 @@ const Map> localizedValues = { 'lanArabic': {'en': 'العربية', 'ar': 'العربية'}, 'cancel': {'en': 'CANCEL', 'ar': 'الغاء'}, 'done': {'en': 'DONE', 'ar': 'تأكيد'}, + 'replay2': {'en': 'Replay', 'ar': 'رد الطبيب'}, + 'home': {'en': 'Home', 'ar': 'الرئيسية'}, + 'services': {'en': 'SERVICES', 'ar': 'الخدمات'}, + 'mySchedule': {'en': 'My Schedule', 'ar': 'جدولي'}, + 'logout': {'en': 'Logout', 'ar': 'تسجيل خروج'}, + 'respirationRate': {'en': 'Respiration Rate', 'ar': 'معدل التنفس'}, + 'bookAppo': {'en': 'Book Appointment', 'ar': 'حجز موعد'}, + 'searchBy': {'en': 'Search By:', 'ar': 'البحث عن طريق:'}, + 'clinic': {'en': 'Clinic', 'ar': 'العيادة'}, + 'hospital': {'en': 'Hospital', 'ar': 'المستشفى'}, + 'name': {'en': 'Name', 'ar': 'الإسم'}, + 'doctor': {'en': 'Doctor', 'ar': 'الطبيب'}, + 'clinicName': {'en': 'Clinic Name', 'ar': 'اسم العيادة'}, + 'doctorName': {'en': 'Doctor Name', 'ar': 'إسم الطبيب'}, + 'nearestAppo': {'en': 'Nearest appointment', 'ar': 'أقرب موعد'}, + 'searchByDocText': {'en': 'Type the name of the doctor to help you find him', 'ar': 'اكتب اسم الطبيب لمساعدتك في العثور عليه'}, + 'enterDocName': {'en': 'Enter Doctor name', 'ar': 'أدخل إسم الطبيب'}, + 'search': {'en': 'Search', 'ar': 'بحث'}, + 'bookNow': {'en': 'BOOK NOW', 'ar': 'احجز الآن'}, + 'docInfo': {'en': 'Doctor Information', 'ar': 'معلومات الطبيب'}, + 'appoInfo': {'en': 'Appointment Information', 'ar': 'معلومات الموعد'}, + 'availableAppo': {'en': 'Available Appointments', 'ar': 'المواعيد المتاحة'}, + 'gender': {'en': 'Gender', 'ar': 'الجنس'}, + 'nationality': {'en': 'Nationality', 'ar': 'الجنسية'}, + 'docQualifications': {'en': 'Doctor Qualifications', 'ar': 'مؤهلات الطبيب'}, + 'confirmAppoHeading': {'en': 'Kindly confirm your Appointment', 'ar': 'يرجى تأكيد موعدك'}, + 'patientInfo': {'en': 'Patient Information', 'ar': 'معلومات المريض'}, + 'bookSuccess': {'en': 'Book Success', 'ar': 'تم حجز الموعد بنجاح'}, + 'patientShare': {'en': 'Patient Share', 'ar': 'المبلغ المستحق'}, + 'patientShareWithTax': {'en': 'Patient Share with Tax', 'ar': 'المبلغ الإجمالي المستحق'}, + 'confirmAppo': {'en': 'Confirm Appointment', 'ar': 'تأكيد الموعد'}, + 'confirm': {'en': 'Confirm', 'ar': 'تأكيد'}, + 'confirmLiveCare': {'en': 'Confirm LiveCare', 'ar': 'تأكيد لايف كير'}, + 'waitingForDoctor': {'en': 'Waiting for doctor', 'ar': 'في انتظار الطبيب'}, + 'appointment': {'en': 'Appointment', 'ar': 'الموعد'}, + 'confirmLater': {'en': 'Confirm Later', 'ar': 'تأكيد لاحقا'}, + 'todoList': {'en': 'Todo List', 'ar': 'مهامي'}, + 'appoActions': {'en': 'Appointment Actions', 'ar': 'إجراءات الموعد'}, + 'date': {'en': 'Date', 'ar': 'التاريخ'}, + 'time': {'en': 'Time', 'ar': 'الوقت'}, + 'pendingPayment': {'en': 'Pending for payment', 'ar': 'في انتظار الدفع'}, + 'payNow': {'en': 'Pay Now', 'ar': 'ادفع الآن'}, + 'viewQR': {'en': 'View QR Code', 'ar': 'عرض رمز الاستجابة السريعة'}, + 'instruction': {'en': 'Instructions', 'ar': 'تعليمات'}, + 'livecare': {'en': 'LiveCare', 'ar': 'لايف كير'}, + 'livecareAppo': {'en': 'LiveCare Appointment', 'ar': 'الموعد لايف كير'}, + 'cancelAppoMsg': { + 'en': 'Are you sure you want to cancel this appointment?', + 'ar': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟' + }, + + 'upcoming-noAction': {'en': 'No Action Required', 'ar': 'لا يوجد إجراء مطلوب'}, + 'upcoming-confirm': {'en': 'Please confirm the appointment to avoid cancellation', 'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء'}, + "book-success-confirm-more-24-1-2": { + "en": + "The online payment process will be available 24 hours before the appointment.", + "ar": "- عملية الدفع الالكتروني ستكون متاحة قبل الموعد ب 24 ساعة." + }, + 'upcoming-payment-pending': {'en': 'Online Payment will be Activated before 24 Hours of Appointment Time', 'ar': 'سيتم تفعيل خدمة الدفع الالكتروني قبل 24 ساعة من موعد الحجز'}, + 'upcoming-payment-now': {'en': 'Pay Online now to avoid long waiting queue', 'ar': 'ادفع الآن لتفادي الانتظار'}, + 'upcoming-QR': {'en': 'Use the QR Code to Check-In in hospital', 'ar': 'استخدم الرمز لتسجيل الحضور في المستشفى'}, + 'upcoming-virtual': {'en': 'This is a virtual appointment, Please adhere to the instructions for a seamless experience.', 'ar': 'هذا موعد اتصال مرئي عن بعد ، يرجى اتباع تعليمات الخدمة.'}, + 'upcoming-livecare': {'en': 'This is a LiveCare appointment', 'ar': 'هذا موعد لايف كير'}, + 'upcoming-details': {'en': 'More Details', 'ar': 'المزيد'}, + 'reschedule': {'en': 'Reschedule', 'ar': 'إعادة جدولة'}, + 'raise': {'en': 'Raise', 'ar': 'رفع'}, + 'complaint': {'en': 'Complaint', 'ar': 'شكوى'}, + 'add': {'en': 'Add', 'ar': 'إضافة'}, + 'reminder': {'en': 'Reminder', 'ar': 'تذكير'}, + 'location': {'en': 'Locations', 'ar': 'مواقعنا'}, + 'online': {'en': 'Online', 'ar': 'الالكترونية'}, + 'payment': {'en': 'Payment', 'ar': 'الدفع'}, + 'cancel-nocaps': {'en': 'Cancel', 'ar': 'الغاء'}, + 'set-reminder': {'en': 'Set Reminder', 'ar': 'تعيين تذكير'}, + + 'login': {'en': 'Login', 'ar': 'تسجيل الدخول'}, + 'loginregister': {'en': 'Login / Register', 'ar': 'تسجيل الدخول'}, + 'poweredBy': {'en': 'Powered By', 'ar': 'مشغل بواسطة'}, + "welcome": {"en": "Welcome", "ar": "مرحبا"}, + "welcome_text": { + "en": "Dr. Sulaiman Al Habib Mobile Application", + "ar": "الدكتور سليمان الحبيب لتطبيقات الهاتف المتحرك" + }, + 'welcome_text2': { + 'en': 'Have you visited AlHabib Medical Group before? ', + 'ar': 'هل قمت بزيارة مجموعة الحبيب الطبية من قبل؟' + }, + 'yes': {'en': 'Yes', 'ar': 'نعم'}, + 'no': {'en': 'No', 'ar': 'لا'}, + "logintyperadio": { + "en": "Choose from below options to login to your medical file.", + "ar": "اختر من الخيارات أدناه لتسجيل الدخول إلى ملفك الطبي." + }, + "registernow": {"en": "Register Now", "ar": "تسجيل الان"}, + "nationalID": { + "en": "Enter the Identification Number", + "ar": "أدخل رقم الهوية الوطنية او الاقامة" + }, + "national-id": {"en": "National ID", "ar": "رقم الهوية"}, + "fileNo": {"en": "File Number", "ar": "رقم الملف"}, + "fileno": {"en": "File No", "ar": "رقم الملف"}, + "forgotFileNo": {"en": "Forgot file Number?", "ar": "نسيت رقم الملف الطبي؟"}, + "forgotFileNoTitle": { + "en": "Forgot medical file Number", + "ar": "نسيت رقم الملف" + }, + + "enter-national-id": { + "en": "Please enter mobile number and identification number", + "ar": "الرجاء إدخال رقم الجوال ورقم الهوية" + }, + "profile-info": { + "en": "Please enter profile information", + "ar": "الرجاء إدخال معلومات الملف الشخصي" + }, + "submit": {"en": "Submit", "ar": "ارسال"}, + "forgot-desc": { + "en": "Enter the mobile number to receive the Medical file Number via SMS", + "ar": "أدخل رقم الجوال المسجل لاستلام رقم الملف عن طريق الرسائل النصية" + }, + "dob": {"en": "Birth Date:", "ar": "تاريخ الميلاد"}, + "hijri-date": {"en": "Hijri Date", "ar": "التاريخ الهجري"}, + "gregorian-date": {"en": "Gregorian Date", "ar": "التاريخ الميلادي"}, + "verify-login-with": { + "en": "Please choose one of the following options to verify", + "ar": "الرجاء اختيار احدى الخيارات التالية للتحقق من البيانات" + }, + "register-user": {"en": "Register", "ar": "تسجيل"}, + "verify-with-fingerprint": {"en": "Fingerprint", "ar": "بصمة"}, + "verify-with-faceid": {"en": "Face ID", "ar": "معرف الوجه"}, + "verify-with-sms": {"en": "SMS", "ar": "الرسائل القصيرة"}, + "verify-with-whatsapp": {"en": "Whatsapp", "ar": " الواتس اب"}, + "last-login": {"en": "LAST LOGIN AT:", "ar": "آخر تسجيل دخول"}, + "last-login-with": {"en": "VERIFICATION TYPE:", "ar": "نوع التحقق:"}, + "verify-fingerprint": { + "en": + "To activate the fingerprint login service, please verify data by using one of the following options.", + "ar": + "لتفعيل خدمة الدخول بالبصمة، يرجى اختيار احدى القنوات التالية للتحقق من البيانات" + }, + 'searchMedicine': {'en': 'Search Medicine', 'ar': 'البحث عن الدواء'}, + 'pharmaciesList': {'en': 'Pharmacies List', 'ar': 'قائمة الصيدلايات'}, + 'searchMedicineHere': { + 'en': 'Search Medicine Here', + 'ar': 'ابحث عن الدواء هنا' + }, + 'description': {'en': 'Description', 'ar': 'الوصف'}, + 'price': {'en': 'Price', 'ar': 'السعر'}, + 'youCanFindItIn': {'en': 'You can find it in', 'ar': 'يمكنكة ان تجده في'}, + 'pleaseEnterMedicineName': { + 'en': 'Please Enter Medicine Name', + 'ar': 'الرجائ ادخال اسم الدواء' + }, + "verification_message": { + "en": "Please enter the Verification Code sent to", + "ar": "الرجاء ادخال رمز التحقق الذي تم إرساله إلى" + }, + "validation_message": { + "en": "The verification code expires in", + "ar": "تنتهي صلاحية رمز التحقق خلال" + }, + "arabic-change": {"en": "عربي", "ar": "English"}, + "notification": {"en": "Notifications", "ar": "إشعارات"}, + "app-settings": {"en": "App Settings", "ar": "إعدادات التطبيق"}, + "rate-app": {"en": "Rate Our App", "ar": "قيم التطبيق"}, + "before": {"en": "Before", "ar": "قبل"}, + "minute": {"en": "Minutes", "ar": "دقيقة"}, + "hour": {"en": "Hour", "ar": "ساعة"}, + "reminderSuccess": { + "en": "The reminder has been added successfully", + "ar": "يضاف التذكير بنجاح" + }, + "patientShareToDo": { + "en": "Amount before tax: ", + "ar": "المبلغ قبل الضريبة:" + }, + "patientTaxToDo": {"en": "Tax amount: ", "ar": "قيمة الضريبة:"}, + "patientShareTotalToDo": { + "en": "Total amount Due: ", + "ar": "المبلغ الإجمالي المستحق:" + }, + 'paymentMethod': {'en': 'Payment Method', 'ar': 'طريقة الدفع او السداد'}, + 'noNeedToWaitInLine': { + 'en': 'No need to stand in line.', + 'ar': 'لا داعي للوقوف في الطابور.' + }, + 'useQRAppoAttend': { + 'en': 'Use the QR code to register the appointment attendance.', + 'ar': 'استخدم الكود لتسجيل الحضور في المستشفى.' + }, + 'passQRAppoAttend': { + 'en': + 'Pass the QR code through the attendance devices available in the Hospital.', + 'ar': 'تمرير الكود من خلال اجهزة تسجيل الحضور المتوفرة في الفرع.' + }, + 'sitWaitingQR': { + 'en': 'Sit in the waiting rooms until called by the nurse.', + 'ar': 'الجلوس في غرف الانتظار لحين منادتك من قبل الممرضة.' + }, + 'attendRegisterCode': { + 'en': 'Attendance registration code', + 'ar': 'رمز تسجيل الحضور' + }, + 'scanQRHospital': { + 'en': 'Scan above QR Code to Check-In on the Machine in Hospital', + 'ar': 'مسح فوق رمز الاستجابة السريعة للتحقق في الجهاز في المستشفى' + }, + "sendEmail": {"en": "Send Email", "ar": "ارسال نسخة"}, + "EmailSentSuccessfully": { + "en": "Email Sent Successfully", + "ar": "تم إرسال البريد الإلكتروني بنجاح" + }, + "close": {"en": "Close", "ar": "مغلق"}, + "booked": {"en": "Booked", "ar": "محجوز"}, + "confirmed": {"en": "Confirmed", "ar": "مؤكد"}, + "arrived": {"en": "Arrived", "ar": "تم الحضور"}, + "payNowBookSuccess": { + "en": "Pay now via Al Habib App", + "ar": "ادفع الآن عبر تطبيق الحبيب" + }, + "payNowBookSuccesstext1": { + "en": "Pay Now using online payment service From secure payment gateways", + "ar": "ادفع الآن باستخدام خدمة الدفع عبر الإنترنت من بوابات الدفع الآمنة" + }, + "payNowBookSuccesstext2": { + "en": "You can also Pay Later via online payment Or in Hospital", + "ar": "يمكنك أيضًا الدفع لاحقًا عبر الدفع عبر الإنترنت أو في المستشفى" + }, + 'payLater': {'en': 'Pay Later', 'ar': 'ادفع لاحقا'}, + 'askDocNotAllowed': { + 'en': 'This service will be available for last 15 days doctor Visit only', + 'ar': 'هذه الخدمة متاحة للزيارات خلال اخر 15 يوم فقط' + }, + "more-verify": { + "en": "More Verification Options", + "ar": "المزيد من خيارات التحقق" + }, + "welcome-back": {"en": "Welcome back!", "ar": "مرحبا بعودتك!"}, + "account-info": { + "en": "Would you like to login with current username?", + "ar": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟" + }, + "another-acc": {"en": "Use Another Account", "ar": "استخدم حسابا آخر"}, + "next": {"en": "Next", "ar": 'التالى'}, + "first-name": {"en": "First Name", "ar": "الاسم الأول"}, + "middle-name": {"en": "Middle Name", "ar": "الاسم الثاني"}, + "last-name": {"en": "Last Name", "ar": "إسم العائلة"}, + "female": {"en": "Female", "ar": "أنثى"}, + "male": {"en": "Male", "ar": "ذكر"}, + "preferred-language": {"en": "Preferred Language", "ar": "اللغة المفضلة"}, + "english": {"en": "English", "ar": "الإنجليزية"}, + "arabic": {"en": "Arabic", "ar": "العربية"}, + "locations-register": { + "en": "Where do you want to create this file?", + "ar": "أين تريد فتح هذا الملف؟" + }, + "ksa": {"en": "KSA", "ar": "السعودية"}, + "dubai": {"en": "Dubai", "ar": "دبي"}, + "enter-email": {"en": "Enter Email", "ar": "ادخل البريد الالكتروني"}, + "family": {"en": "My Family", "ar": "عائلتي"}, + "family-title": {"en": "My Family Files", "ar": "ملفات العائلة"}, + "myFamily": {"en": "My Family", "ar": "ملفات العائلة"}, + "add-new-member": {"en": "Add Family Member", "ar": "إضافة عضو جديد"}, + "sent-requests": {"en": "Sent Requests", "ar": "الطلبات المرسلة"}, + "recieved-requests": {"en": "Recieved Requests", "ar": "الطلبات المستلمة"}, + "manage-files": {"en": "Manage Family Files", "ar": "إدارة ملفات العائلة"}, + 'oxygenation': {'en': 'Oxygenation', 'ar': 'الأوكسجين'}, + 'bodyMeasurements': {'en': 'body Mass Index', 'ar': 'مؤشر الكتلة'}, + 'temperature': {'en': 'Temperature', 'ar': 'درجة الحرارة'}, + 'pulse': {'en': 'Pulse', 'ar': 'النبض'}, + 'respiration': {'en': 'Respiration', 'ar': 'التنفس'}, + 'bloodPressure': {'en': 'Blood Pressure', 'ar': 'ضغط الدم'}, + 'painScale': {'en': 'Pain Scale', 'ar': 'مقياس الألم'}, + 'weight': {'en': 'Weight', 'ar': 'الوزن'}, + 'height': {'en': 'Height', 'ar': 'الطول'}, + 'heart': {'en': 'Heart', 'ar': 'قلب'}, + + "request": {"en": "Request", "ar": "طلبات الاضافة"}, + "member-name": {"en": "Member Name", "ar": "اسم العضو"}, + "switch-login": {"en": "Switch User", "ar": "تغير المستخدم"}, + "remove-member": {"en": "Remove", "ar": "حذف"}, + "allow-view": {"en": "Allow", "ar": "قبول"}, + "reject-view": {"en": "Reject", "ar": "رفض"}, + "delete-view": {"en": "Delete", "ar": "حذف"}, + // "my-family": {"en": "MY FAMILY", "ar": "عائلتي"}, + "approvals": {"en": "Approvals", "ar": "موافقات التأمين"}, + "approvalNo": {"en": "Approval No.: ", "ar": "رقم الموافقة: "}, + "companyName": {"en": "Company Name ", "ar": "اسم الشركة: "}, + "receiptOn": {"en": "Receipt on: ", "ar": "تاريخ الفاتورة: "}, + "expiryDate": {"en": "Expiry Date: ", "ar": "تاريخ الانتهاء: "}, + "procedureName": {"en": "Procedure Name", "ar": "اسم الاجراء"}, + "procedureStatus": {"en": "Procedure Status: ", "ar": "حالة الاجراء"}, + "usageStatus": {"en": "Usage Status", "ar": "جالة الاستخدام"}, + "unusedCount": {"en": "Unused Count: ", "ar": "غير مستخدم: "}, + "totalApproval": { + "en": "Total approval unused", + "ar": "اجمالي الموافقات الغير مستخدمة" + }, + "category": {"en": "Category: ", "ar": "الفئة"}, + "expirationDate": {"en": "Expiration Date: ", "ar": "تاريخ الانتهاء"}, + "patientCard": {"en": "Patient Card ID: ", "ar": "رقم الاشتراك"}, + "policyNumber": {"en": "Policy Number: ", "ar": "رقم بوليصة التاميت:"}, + "seeDetails": {"en": "SEE DETAILS", "ar": "منافعك التامينية"}, + "insuranceCards": {"en": "Insurance Cards", "ar": "بطاقات التأمين"}, + "requestType": {"en": "Request Type", "ar": "نوع الاستفسار"}, + "register-info-family": {"en": "How would like to add the new member?", "ar": "كيف ترغب باضافة العضو الجديد؟"}, + "remove-family-member": {"en": "Remove this member?", "ar": "إزالة ملف العضو؟"}, + "MyMedicalFile": {"en": "My Medical File", 'ar': 'ملف الطبي الالكتروني'}, + "myMedicalFileSubTitle": {"en": "All your medical records", 'ar': 'جميع سجلاتك الطبية'}, + + "viewMore": {"en": "View More", 'ar': 'عرض المزيد'}, + "homeHealthCareService": {"en": "Home Health Care Service", 'ar': 'الرعاية الصحية المنزلية'}, + "OnlinePharmacy": {"en": "Online Pharmacy", 'ar': 'صيدليات الحبيب'}, + "EmergencyService": {"en": "Emergency Service", 'ar': 'الفحص الطبي الشامل'}, + "OnlinePaymentService": {"en": "Online Payment Service", 'ar': 'خدمة الدفع الإلكتدوني'}, + "OffersAndPackages": {"en": "Online transfer request", 'ar': 'طلب التحويل الالكتروني'}, + "ComprehensiveMedicalCheckup": {"en": "Comprehensive Medical Check up", 'ar': 'فحص طبي شامل'}, + "HMGService": {"en": "HMG Service", 'ar': 'جميع خدمات الحبيب'}, + "ViewAllHabibMedicalService": {"en": "View All Habib Medical Service", 'ar': 'عرض خدمات الحبيب الطبية'}, + "viewAll": {"en": "View All", 'ar': 'عرض الكل'}, + "view": {"en": "View", 'ar': 'عرض'}, + "ContactUs": {"en": "Contact Us", 'ar': 'الوصول إلينا'}, + "ViewAllWaysReachUs": {"en": "View All Ways Reach Us", 'ar': 'جميع طرق الاتصال بنا'}, + "medicalProfile": {"en": "Medical Profile", 'ar': 'الملف الطبي'}, + "consultation": {"en": "Consultation", "ar": "استشارة"}, + "logs": {"en": "Logs", "ar": "السجلات"}, + "textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"}, + "locationDialogMessage": { + "en": "Allow the HMG app to access your location will assist you in showing the hospitals according to the nearest to you.", + "ar": "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك." + }, + + "user-view-requester": {"en": "User Wants To View Your Medical File", "ar": "أشخاص يرغبون الاطلاع على ملفك الطبي"}, + "user-view": {"en": "User Can View Your Medical File", "ar": "أشخاص يمكنهم الاطلاع على ملفك الطبي"}, + + "parking": {"en": "Parking", "ar": "مواقف"}, + "alhabiServices": {"en": "HMG Service", "ar": "خدمات الحبيب"}, + "parkingTitle": { + "en": + "Car service, car service, service to save parking information, return to it later, 1- By clicking on (Read the code), save the parking data. 2- By clicking on the button (view my car park), it shows you the car’s location in Google Maps. 3- Read another position by pressing the Clear Position Data button.", + "ar": + " خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف). " + }, + "readBarcode": {"en": "Read Barcode", "ar": "قراءة الكود"}, + "showMyPark": {"en": "Show My Park", "ar": "عرض بارك"}, + "clearMyData": {"en": "clear My Data", "ar": "امسح البيانات"}, + "floor": {"en": "Floor:", "ar": "الطابق"}, + "gate": {"en": "Gate:", "ar": "بوابة"}, + "building": {"en": "Building:", "ar": "المبنى"}, + "branch": {"en": "Branch:", "ar": "الفرع"}, + "emergencyServices": {"en": "Emergency Services:", "ar": "خدمات الطوارئ"}, + "nearester": {"en": "Nearest ER:", "ar": "أقرب طوارى"}, + "locationa": {"en": "location:", "ar": "الموقع"}, + "ambulancerequest": {"en": "Ambulance :", "ar": "طلب نقل "}, + "requestA": {"en": "Request:", "ar": "اسعاف"}, + "MyAppointments": {"en": "Appointments", "ar": "مواعيدي"}, + "NoBookedAppointments": { + "en": "No Booked Appointments", + "ar": "لا توجد مواعيد محجوزة" + }, + "NoConfirmedAppointments": { + "en": "No Confirmed Appointments", + "ar": "لا توجد مواعيد مؤكدة" + }, + "noArrivedAppointments": { + "en": "No Arrived Appointments", + "ar": "لم تصل المواعيد" + }, + "MyAppointmentsList": {"en": "List", "ar": "قائمة بمواعدي"}, + "Radiology": {"en": "Radiology", "ar": "الأشعة"}, + "RadiologySubtitle": {"en": "Result", "ar": "صور وتقارير"}, + "Lab": {"en": "Lab", "ar": "تحليل المختبر"}, + "LabSubtitle": {"en": "Result", "ar": "نتائج"}, + "Medicines": {"en": "Medicines", "ar": "الوصفات"}, + "MedicinesSubtitle": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, + "VitalSigns": {"en": "Vital Signs", "ar": "المؤشرات الحيوية"}, + "VitalSignsSubTitle": {"en": "Reports", "ar": "قراءات"}, + "MyMedical": {"en": "Active", "ar": "قراءات"}, + "MyMedicalSubtitle": {"en": "Medications", "ar": "النشطة"}, + "MyDoctor": {"en": "My Doctor", "ar": "اطبائي"}, + "MyDoctorSubtitle": {"en": "List", "ar": "قمت بزيارتهم"}, + "Eye": {"en": "Eye", "ar": "قياسات"}, + "EyeSubtitle": {"en": "Measurement", "ar": "النظر"}, + "Insurance": {"en": "Insurance", "ar": "بطاقة"}, + "InsuranceSubtitle": {"en": "Card", "ar": "التأمين"}, + "UpdateInsurance": {"en": "Update Insurance", "ar": "تحديث التأمين"}, + "UpdateInsuranceSubtitle": {"en": "Card", "ar": "التأمين"}, + "InsuranceApproval": {"en": "Insurance Approval", "ar": "موافقات"}, + "InsuranceApprovalSubtitle": {"en": "Approvals", "ar": "موافقات التأمين"}, + "Allergies": {"en": "Allergies", "ar": "الحساسية"}, + "AllergiesSubtitle": {"en": "Diagnosed", "ar": "مسجلة"}, + "MyVaccines": {"en": "My Vaccines", "ar": "تطعيماتي"}, + "MyVaccinesSubtitle": {"en": "List", "ar": "قائمة"}, + "Medical": {"en": "Medical", "ar": "التقارير"}, + "MedicalSubtitle": {"en": "Report", "ar": "الطبية"}, + "Monthly": {"en": "Monthly", "ar": "تقارير"}, + "MonthlySubtitle": {"en": "Report", "ar": "الشهرية"}, + "Sick": {"en": "Sick", "ar": "الإجازات"}, + "SickSubtitle": {"en": "Leaves", "ar": "المرضية"}, + "MyBalance": {"en": "My Balance", "ar": "ارصدتي"}, + "MyBalanceSubtitle": {"en": "Credit", "ar": "المبالغ"}, + "PatientCall": {"en": "Patient Call", "ar": "النداء للموعد"}, + "PatientCallSubtitle": {"en": "Service", "ar": "خدمة"}, + "SmartWatches": {"en": "Smart Watches", "ar": "الساعة الذكية"}, + "SmartWatchesSubtitle": {"en": "Pairing", "ar": "ربط البيانات"}, + "MyTrackers": {"en": "My Trackers", "ar": "تتبع قراءاتي"}, + "MyTrackersSubtitle": {"en": "Service", "ar": "الطبية"}, + "AskYour": {"en": "Ask Your", "ar": "إرسل طبيبك"}, + "AskYourSubtitle": {"en": "Doctor", "ar": "خدمة"}, + "Internet": {"en": "Internet", "ar": "الاتصال"}, + "InternetSubtitle": {"en": "Pairing", "ar": "بالإنترنت"}, + "Chatbot": {"en": "Chatbot", "ar": "تاشت بوت"}, + "ChatbotSubtitle": {"en": "", "ar": ""}, + "TimeLine": {"en": "Time Line", "ar": "الجدول الزمني"}, + "LabOrders": {"en": "Lab Orders", "ar": "تحاليل المختبر"}, + "BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"}, + "Prescriptions": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, + "History": {"en": "History", "ar": "السجلات"}, + "OrderNo": {"en": "Order No", "ar": "رقم الطلب"}, + "OrderDetails": {"en": "Order Details", "ar": "تفاصيل الطلب"}, + "VitalSign": {"en": "Vital Sign", "ar": "العلامة حيوية"}, + "MonthlyReports": {"en": "Monthly Reports", "ar": "تقارير شهرية"}, + "km": {"en": "KMs:", "ar": "كم"}, + "PatientHealthSummaryReport": { + "en": "Patient Health Summary Report", + "ar": " ملخص التقارير الشهرية" + }, + "ToViewTheTermsAndConditions": { + "en": "To View The Terms And Conditions Report", + "ar": " عرض الشروط والأحكام " + }, + "ClickHere": {"en": "Click here", "ar": "أنقر هنا"}, + "IAgreeToTheTermsAndConditions": { + "en": "I agree to the terms and conditions ", + "ar": "أوافق على الشروط والاحكام " + }, + "IAgreeToTheTermsAndConditionsSubtitle": { + "en": "I agree to the terms and conditions ", + "ar": + "هذا ملخص التقرير الصحي الشهري و الذي يسرد المؤشرات الصحية و نتائج التحاليل لأخر الزيارات. يرجى ملاحظة أن هذا التقرير هو تقرير يتم ارساله بشكل آلي من النظام و لا يعتبر رسمي و لا تؤخذ عليه أي قرارات طبية" + }, + "Save": {"en": "Save", "ar": "حفظ "}, + "UserAgreement": {"en": "User Agreement", "ar": "اتفاقية الخصوصية "}, + "UpdateSuccessfully": {"en": "Update Successfully", "ar": "تم التحديث بنجاح"}, + "CHECK_VACCINE_AVAILABILITY": { + "en": "CHECK VACCINE AVAILABILITY", + "ar": "تحقق من توافر اللقاح" + }, + "MyVaccinesAvailability": { + "en": "MyVaccinesAvailability", + "ar": "توفر لقاحي" + }, + "PaymentService": {"en": "Payment Service", "ar": "خدمة المدفوعات"}, + "PaymentOnline": {"en": "Service", "ar": "الالكتروني"}, + "OnlineCheckIn": {"en": "Online Check-In", "ar": "مدفوعات معلقة"}, + "MyBalances": {"en": "My Balances", "ar": "رصيدي"}, + "BalanceAmount": {"en": "Balance Amount", "ar": "رصيدالحساب"}, + "TotalBalance": {"en": "Total Balance", "ar": "الرصيد الكلي"}, + "CreateAdvancedPayment": {"en": "Create Advanced Payment", "ar": "إنشاء دفعة مقدمة"}, + "AdvancePayment": {"en": "Advance Payment", "ar": "الدفع مقدما"}, + "AdvancePaymentLabel": {"en": "You can create and add an Advanced Payment for you account or other accounts.", "ar": "يمكنك تحويل مبلغ لحسابك لدى المجموعة أو لحساب احد المراجعين"}, + "FileNumber": {"en": "File Number", "ar": "رقم الملف"}, + "Amount": {"en": "Amount *", "ar": "المبلغ *"}, + "DepositorEmail": {"en": "Depositor Email *", "ar": "البريد الإلكتروني للمودع *"}, + "Notes": {"en": "Notes", "ar": "ملاحظات"}, + "SelectPatientName": {"en": "Select Patient Name", "ar": "اختر اسم المريض"}, + "SelectFamilyPatientName": {"en": "Family Members", "ar": "أفراد الأسرة"}, + "SelectHospital": {"en": "Select Hospital", "ar": "اختر المستشفى"}, + "MyAccount": {"en": "My Account", "ar": "حسابي"}, + "OtherAccount": {"en": "Other Account", "ar": "حساب آخر"}, + "SelectBeneficiary": {"en": "Select Beneficiary", "ar": "حدد المستفيد"}, + "ConfirmThePayment": {"en": "Confirm The Payment", "ar": "تأكيد عملية الدفع"}, + "DepositorName": {"en": "Depositor Name", "ar": "اسم المودع *"}, + "MobileNumber": {"en": "Mobile Number", "ar": "رقم الجوال"}, + "Ok": {"en": "Ok", "ar": "حسنا"}, + "TheVerificationCodeExpiresIn": { + "en": "The Verification Code Expires In", + "ar": "تنتهي صلاحية رمز التحقق في" + }, + "PleaseEnterTheVerificationCode": { + "en": "Please enter the verification code send to", + "ar": "الرجاء إدخال رمز التحقق المرسل إلى" + }, + "EyeMeasurements": {"en": "Eye Measurements", "ar": "قياسات النظر"}, + "Measurements": {"en": "Measurements", "ar": "قياسات"}, + "Classes": {"en": "Classes", "ar": "نظارات"}, + "ContactLens": {"en": "Contact Lens", "ar": "العدسات اللاصقة"}, + "RightEye": {"en": "Right Eye", "ar": "العين اليمين"}, + "Sphere": {"en": "Sphere", "ar": "القوة"}, + "Cylinder": {"en": "Cylinder", "ar": "الدائرية"}, + "Axis": {"en": "Axis", "ar": "المحاور"}, + "Prism": {"en": "Prism", "ar": "موشور"}, + "VA": {"en": "Prism", "ar": "المحاور"}, + "LeftEye": {"en": "Left Eye", "ar": "العين اليسرى"}, + "Brand": {"en": "Brand", "ar": "النوع"}, + "Power": {"en": "Power", "ar": "القوة"}, + "Diameter": {"en": "Diameter", "ar": "القطر"}, + "Remarks": {"en": "Remarks", "ar": "ملاحضات"}, + "ActiveMedications": {"en": "Active Medications", "ar": "ادويتي النشطة"}, + "ExpDate": {"en": "Active Exp Date :", "VA": "تاريخ الإنتهاء"}, + "Route": {"en": "Route :", "ar": "الطريقة"}, + "Frequency": {"en": "Frequency :", "ar": "المعدل"}, + "DailyQuantity": {"en": "Daily Quantity :", "ar": "جرعات يومية"}, + "AddReminder": {"en": "Add Reminder", "ar": "إضافة تذكير"}, + "reminderDes": { + "en": + "Please select treatment start day and time to be notified when it\'s time to take the medicine", + "ar": + " يرجى تحديد يوم بدء العلاج والوقت ليتم ارسال تنبيه عندما يحين الوقت لتناول الدواء" + }, + "StartDay": {"en": "Start Day", "ar": "يوم البداية"}, + "EndDay": {"en": "End Day", "ar": "يوم الانتهاء"}, + "Days": {"en": "Days ", "ar": "أيام"}, + "ScheduleTime": {"en": "Schedule time", "ar": "الجدول الزمني"}, + "AskDoctor": {"en": "Ask Doctor", "ar": "اسأل طبيبك"}, + "DoctorResponses": {"en": "Doctor Responses", "ar": "ردود الأطباء"}, + "New": {"en": "New", "ar": "جديد"}, + "All": {"en": "All", "ar": "الكل"}, + "QuestionHere": { + "en": "Enter the question here...", + "ar": "اضف الاستفسار هنا" + }, + "ViewDoctorResponses": { + "en": "View Doctor Responses", + "ar": "الاطلاع على ردود الأطباء" + }, + "ServiceInformationButton": {"en": "LOGIN / REGISTER", "ar": "دخول / تسجيل"}, + "ServiceInformationTitle": { + "en": "Service Information", + "ar": "معلومات الخدمة" + }, + "ServiceInformation": {"en": "Service Information", "ar": "معلومات الخدمة"}, + "HomeHealthCare": { + "en": "Home Health Care", + "ar": " الرعاية الصحية المنزلية " + }, + "HomeHealthCareText": { + "en": + "This service provides a set of home health care services, continuous and comprehensive follow-up in their places of residence for those who cannot access health facilities, such as (laboratory analyzes - radiology - vaccinations - physical therapy), etc.", + "ar": + "توفر هذه الخدمة مجموعه من خدمات الرعايه الصحيه المنزلية و متابعه مستمره وشامله للذين لا يستطيعون الوصول للمنشات الصحيه في اماكن اقامتهم (التحاليل المخبرية – الاشعة – التطعيمات – العلاج الطبيعي)... " + }, + "LoginRegister": {"en": "Login/Register", "ar": "دخول / تسجيل"}, + "OrderLog": {"en": "Order Log", "ar": " سجل الطلبات"}, + "info-lab": { + "en": + "This service allows you to view the results of all laboratory tests performed in Al Habib Medical Group as well as sending the report via e-mail.", + "ar": + "خدمة نتائج المختبر: هذه الخدمة تمكنك من الاطلاع على نتائج جميع الفحوصات المخبرية التي تمت في مجموعة الحبيب الطبية." + }, + "info-radiology": { + "en": + "This service allows you to view the reports and photos of radiology in Al Habib Medical Group as well as send the report by e-mail.", + "ar": + "خدمة الاشعة: هذه الخدمة تمكنك من الاطلاع على تقارير وصور الاشعة التي تمت في مجموعة الحبيب الطبية وكذلك ارسال التقرير عن طريق الايميل." + }, + + "TermsService": {"en": "Terms of Service", "ar": "شروط الخدمه"}, + "Beforeusing": { + "en": "Before using the checkup, please read Terms of Service.", + "ar": "قبل استخدام الفحص ، يرجى قراءة شروط الخدمة" + }, + "accept": { + "en": "I read and accept Terms of Service and Privacy Policy", + "ar": "قرأت ووافقت على شروط الخدمة وسياسة الخصوصية" + }, + "data-safe-info": { + "en": + "Information that you provide is anonymous and not shared with anyone.", + "ar": "المعلومات التي تقدمها لا تتم مشاركتها مع أي شخص" + }, + "data-safe": {"en": " Your data is safe.", "ar": "بياناتك آمنة"}, + "informational": { + "en": + "Checkup is for informational purposes and is not a qualified medical opinion", + "ar": "الفحص هو لأغراض معلوماتية وليس رأي طبي مؤهل" + }, + "not-use-in-emerbency": { + "en": "Do not use in emergencies.", + "ar": "لا تستخدم في حالات الطوارئ" + }, + "not-use-in-emerbency-details": { + "en": "In case of health emergency, ", + "ar": "في حالة الطوارئ اتصل بأقرب رقم للطوارئ على الفور" + }, + "not-use-in-emerbency-details-call": { + "en": "call the nearest emergency number immediately", + "ar": " اتصل بأقرب رقم للطوارئ على الفور" + }, + "check-diagnosis": { + "en": "Checkup is not a diagnosis.", + "ar": "الفحص ليس تشخيص." + }, + "remeberthat": {"en": "Remember that", "ar": "تذكر ذلك:"}, + "loginToUseService": { + "en": "You need to login to use this service", + "ar": "هذة الخدمة تتطلب تسجيل الدخول" + }, + + // pharmacy module + "medicationRefill": {"en": "MEDICATION REFILL", "ar": "إعادة تعبئة الدواء"}, + "offersAndPromotions": {"en": "OFFERS & SPECIAL PROMOTIONS", "ar": "العروض والترقيات الخاصة"}, + "myPrescriptions": {"en": "MY PRESCRIPTIONS", "ar": "وصفاتي"}, + "searchAndScanMedication": {"en": "SEARCH & SCAN FOR MEDICATION", "ar": "البحث والمسح للأدوية"}, + "shopByBrands": {"en": "Shop By Brands", "ar": "تسوق حسب الماركات"}, + "recentlyViewed": {"en": "Recently Viewed", "ar": "شوهدت مؤخرا"}, + "bestSellers": {"en": "Best Sellers", "ar": "أفضل البائعين"}, + "deleteAllItems": {"en": "Delete All Items", "ar": "حذف كافة العناصر"}, + "select-gender": {"en": "Select Gender", "ar": "اختر الجنس"}, + "i-am-a": {"en": "I am a ...", "ar": "أنا ..."}, + "select-age": {"en": "Select Your Age", "ar": "حدد العمر"}, + "i-am": {"en": "I am", "ar": "أنا"}, + "years-old": {"en": "years old", "ar": "سنة"}, + "drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"}, + "email": {"en": "Email", "ar": "البريد الالكتروني"}, + "Book": {"en": "Book", "ar": "احجز"}, + "AppointmentLabel": {"en": "Appointment", "ar": "موعد"}, + "BloodType": {"en": "Blood Type", "ar": "فصيلة الدم"}, + "marital-status": {"en": "Marital status", "ar": "الحالة الإجتماعية"}, + "general": {"en": "General", "ar": "عام"}, + "profile": {"en": "Profile", "ar": "ملفي"}, + "notifications": {"en": "Notifications", "ar": "إشعارات"}, + "notificationDetails": {"en": "Notification Details", "ar": "تفاصيل الاشعار"}, + "notificationDetailsa": {"en": "Notification Details", "ar": "تفاصيل الاشعار"}, + + "info-my-doctor-points": { + "en": [ + "View the doctor's profile and qualifications.", + "View the doctor's schedule.", + "View details of your appointments with the selected doctor.", + "Book appointment with the doctor. ", + ], + "ar": ["الاطلاع على معلومات الطبيب ومؤهلاته.", "الاطلاع على جدول الطبيب.", "الاطلاع على تفاصيل المواعيد التي تمت مع الطبيب.", "حجز موعد مع الطبيب."] + }, + "info-my-doctor": { + "en": "This service allows you to see all the doctors you have visited in Al Habib Medical Group, and through this service:", + "ar": "خدمة اطبائي: هذه الخدمة تمكنك من الاطلاع على جميع الاطباء الذين قمت بزيارتهم في مجموعة الحبيب الطبية, كما تستطيع من خلال هذه الخدمة:" + }, + "info-prescriptions": { + "en": "This service allows you to view all the medical prescriptions issued by Al Habib Medical Group, and through this service, you can:", + "ar": "خدمة الوصفات الطبية: هذه الخدمة تمكنك من الاطلاع على جميع الوصفات الطبية التي تم اصدارها في مجموعة الحبيب الطبية، كما تستطيع من خلال هذه الخدمة:" + }, + "info-my-prescription-points": { + "en": [ + "View the duration days.", + "View the frequency timing.", + "View the doctor's remarks.", + "Add a reminder to remind you when to take medicine doses.", + "Search in AlHabib Pharmacies about the branches where medicines are available, pharmacies locations and contact numbers.", + "Ordering and delivery medications online.", + "View the prices of the drug. ", + ], + "ar": [ + "الاطلاع على طريقة تناول العلاج.", + "الاطلاع على مدة تناول العلاج.", + "الاطلاع على ملاحظات الطبيب.", + "اضافة منبه للتذكير بموعد تناول جرعات الادوية.", + "البحث في صيدليات الحبيب عن الفروع التي يتوفر فيها العلاج وكذلك مواقع الصيدليات وارقام الاتصال. ", + "امكانية شراء وتوصيل العلاج عن طريق الانترنت.", + "الاطلاع على اسعار الادوية المصروفة." + ] + }, + + "info-insurance-cards": { + "en": "This service allows you to view all the insurance cards that recorded during your visits to Al Habib Medical Group in addition to:", + "ar": "خدمة بطاقات التامين: هذه الخدمة تمكنك من الاطلاع على جميع بطاقات التامين والتي تم تسجيلها اثناء زياراتك لمجموعة الحبيب الطبية بالاضافة الى:" + }, + + "info-insurance-cards-points": { + "en": [ + "Name of the insurance company.", + "Insurance category.", + "Insurance policy number.", + "The expiry date of insurance.", + "The status of the insurance card (active or inactive).", + "Details of the coverage, e.x the room category covered as well some cases covered by the insurance.", + ], + "ar": [ + "اسم شركة التامين.", + "فئة التامين.", + "رقم بوليصة التامين.", + "تاريخ انتهاء التامين.", + "حالة بطاقة التامين (فعالة او غير فعالة).", + "تفاصيل التامين، مثلاً: مستوى الغرفة التي يغطيها التامين وكذلك الحالات التي يغطيها التامين.", + ] + }, + + "info-allergies": { + "en": + "This service allows you to view all types of allergies recorded during your visits to Al Habib Medical Group.", + "ar": + "خدمة الحساسية: هذه الخدمة تمكنك من الاطلاع على جميع انواع الحساسية التي تم تسجيلها خلال زياراتك في مجموعة الحبيب الطبية." + }, + + "sick-leaves": {"en": "Sick Leaves", "ar": "الاجازات المرضية"}, + + "info-sick-leaves": { + "en": + "This service allows you to view all sick leaves that were taken in Al Habib Medical Group in addition to:", + "ar": + "الاجازات المرضية: هذه الخدمة تمكنك من الاطلاع على جميع الاجازات المرضية والتي تم اصدارها في مجموعة الحبيب الطبية بالاضافة الى:" + }, + "info-sick-leave-points": { + "en": [ + "Doctor Name", + "Sick leave date ", + "Sick leave days", + "Branch that patient take the vaccination form.", + "Sending a report of vaccinations to the email. ", + ], + "ar": [ + "اسم الطبيب", + "تاريخ الاجازة.", + "عدد ايام الاجازة.", + "الفرع الذي تم اصدار الاجازة منه.", + "ارسال نسخة مختومة من الاجازة الى البريد الالكتروني." + ] + }, + + "info-approvals": { + "en": + "This service allows you to view all approvals requests that have been sent to the insurance companies in addition to:", + "ar": + "خدمة الموافقات: هذه الخدمة تمكنك من الاطلاع على جميع طلبات الموافقات والتي تم ارسالها الى شركات التامين بالاضافة الى:" + }, + + "info-approval-points": { + "en": [ + "View the total unused approvals.", + "Track the approvals status.", + ], + "ar": [ + "الاطلاع على اجمالي الموافقات الغير مستخدمة.", + "تتبع حالة الموافقة.", + ] + }, + + "month-report": {"en": "Monthly Reports", "ar": "تقاريري الشهرية"}, + "info-month-report": { + "en": + "Upon activation of this service, the system will send a monthly report automatically to the registered email which lists the vital signs and the results for the last visits made in AlHabib Medical Group.", + "ar": + "خدمة التقارير الشهرية: عند تفعيل هذه الخدمة سيقوم النظام بارسال تقرير شهري بشكل آلي على الايميل المسجل والذي يسرد المؤشرات الحيوية ونتائج التحاليل لآخر زيارات تمت بمجموعة الحبيب الطبية." + }, + "language-setting": { + "en": "SMS and Confirmation Calls Language", + "ar": "لغة الرسائل القصيرة و الاتصال الآلي" + }, + "alert": {"en": "Alerts", "ar": "التنبيهات"}, + "email-alert": { + "en": "Alert By Email", + "ar": "استلام التنبيهات بالبريد الالكتروني" + }, + "sms-alert": { + "en": "Alert By SMS", + "ar": "استلام التنبيهات بالرسائل القصيرة" + }, + "contact-info": {"en": "Contact Information", "ar": "معلومات التواصل"}, + "emrg-name": { + "en": "Emergency Contact Name", + "ar": "اسم للتواصل في حالة الطوارئ" + }, + "emrg-no": { + "en": "Emergency Contact Number", + "ar": "رقم للتواصل في حالة الطوارئ" + }, + "modes": {"en": "Modes", "ar": "الاوضاع"}, + "vibration": {"en": "Vibration Touch Feedback", "ar": "الاهتزاز عند اللمس"}, + "blind-modes": { + "en": "Modes for Partially Blind", + "ar": "تأثيرات لدعم ضعاف البصر" + }, + "invert-theme": {"en": "Invert", "ar": "ألوان سلبية"}, + "off-theme": {"en": "Off", "ar": "إيقاف"}, + "dim-theme": {"en": "Dim", "ar": "ضوء خافت"}, + "bw-theme": {"en": "Black and White", "ar": "أبيض و أسود"}, + "permissions": {"en": "Permission", "ar": "الصلاحيات"}, + "camera-permission": {"en": "Camera", "ar": "الكاميرا"}, + "location-permission": {"en": "Location", "ar": "تحديد المواقع"}, + + "accessibility": {"en": "Accessibility Mode", "ar": "وضع امكانية الوصول"}, + "orderStatus": {"en": "Order Status", "ar": "حالة الطلب"}, + "CancelOrder": {"en": "Cancel Order", "ar": "الغاء الطلب"}, + "FindUs": {"en": "Find Us", "ar": "اين تجدنا"}, + "Feedback": {"en": "Feedback", "ar": "رأيك يهمنا"}, + "LiveChat": {"en": "Live Chat", "ar": "محادثة مباشرة"}, + "Service": {"en": "Service", "ar": "خدمة"}, + "HMGServiceLabel": {"en": "HMG Service", 'ar': 'خدمات الحبيب'}, + "HealthWeatherIndicators": { + "en": "Health Weather Indicators", + 'ar': ' مؤشرات الطقس الصحية ' + }, + "HealthTipsBasedOnCurrentWeather": { + "en": "Health Tips Based On Current Weather", + 'ar': ' نصائح صحية على أساس الطقس الحالي ' + }, + "MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "}, + "SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"}, + "ResendOrder": {"en": "Resend order & deliver", "ar": "إعادة طلب و توصيل"}, + "Ports": {"en": "Ports", "ar": "المنافذ"}, + "Way": {"en": "Way", "ar": "الطزيقة"}, + "Average": {"en": "Average", "ar": "المعدل"}, + "DailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"}, + "Period": {"en": "Period", "ar": "الفترة"}, + "cm": {"en": "CM", "ar": "سم"}, + "kg": {"en": "kg", "ar": "كجم"}, + "mass": {"en": "Mass", "ar": "كتلة"}, + "temp-c": {"en": "°C", "ar": "°س"}, + "bpm": {"en": "bpm", "ar": "نبضة"}, + "respiration-signs": {"en": "Respiration", "ar": "تنفس"}, + "sys-dias": {"en": "SBP/DBP", "ar": "إنقباض/إنبساط"}, + "body": {"en": "Body \n Mass", "ar": "كتلة\nالجسم"}, + "feedback": {"en": "Feedback", "ar": "رأيك يهمنا"}, + "send": {"en": "Send", "ar": "أرسل"}, + "status": {"en": "Status", "ar": "الحالة"}, + "like-to-hear": { + "en": + "We would love to hear the feedback, concerns on healthcare services and eServices experience. Please use the below form", + "ar": + "يسعدنا سماع ملاحظاتك حول خدمات الرعاية الصحية والخدمات الإلكترونية. يرجى تعبئة الحقول المطلوبة" + }, + "subject": {"en": "Subject", "ar": "الموضوع"}, + "message": {"en": "Message", "ar": "رسالة"}, + "empty-subject": { + "en": "Please enter the subject", + "ar": "يرجى ادخال الموضوع" + }, + "empty-message": {"en": "Please enter message", "ar": "يرجى ادخال الرسالة"}, + "select-attachment": {"en": "Select Attachment", "ar": "إختر المرفق"}, + "complain-appo": {"en": "Complaint for appointment", "ar": "شكوى على موعد"}, + "complain-without-appo": { + "en": "Complaint without appointment", + "ar": "شكوى بدون موعد" + }, + "question": {"en": "Question", "ar": "سؤال"}, + "message-type": {"en": "Message Type", "ar": "نوع الرسالة"}, + "compliment": {"en": "compliment", "ar": "ثناء"}, + "suggestion": {"en": "Suggestion", "ar": "إقتراح"}, + "your-feedback": {"en": "Your feedback was sent", "ar": "لقد تم ارسال اقراحك شكرا لك"}, + "select-part": { + "en": "Please select the part that complain about", + "ar": "يرجى تحديد الجزء الذي تشكو منه" + }, + "number": {"en": "Number", "ar": "الرقم"}, + "not-classified": {"en": "Not classified", "ar": "غير محدد"}, + "selectClinic": {"en": "Select Clinic", "ar": " بحث بالعيادة"}, + "reviews": {"en": "Reviews", "ar": "تقييمات"}, + "searchItemError": { + "en": "Item name should be more than 3 character ", + "ar": "يجب أن يكون اسم العنصر أكثر من 3 أحرف" + }, + "YouCanFind": {"en": "You Can Find ", "ar": "باستطاعتك العثور على "}, + "ItemInSearch": {"en": " Item In Search", "ar": " عنصر في البحث "}, + "wantConnectHmgNetwork": { + "en": "Dear customer there is no internet access, Do you want to connect with HMG network to use our app, make sure you are in range of HMG network", + "ar": "عزيز العميل لا يوجد اتصال بالإنترنت, هل تريد الاتصال بشبكة مستشفى د. سليمان الحبيب لاستخدام التطبيق. يجب عليك ان تكون في نطاق شبكة المستشفى" + }, + "failedToAccessHmgServices": {"en": "Connected with HMG Network,\n\nBut failed to access HMG services", "ar": "Connected with HMG Network,\n\nBut failed to access HMG services"}, + "offerAndPackages": {"en": "Offers And Packages", "ar": "العروض والباقات"}, + "InvoiceNo": {"en": " Invoice No", "ar": "رقم الفاتورة"}, + "SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"}, + "GeneralResult": {"en": "General Result", "ar": "نتيجة عامة"}, + "show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"}, + + "value": {"en": "Value", "ar": "القيمة"}, + "range": {"en": "Range", "ar": "المدى"}, + "out-patient": {"en": "Out Patient", "ar": "عيادات خارجية"}, + "in-patient": {"en": "In Patient", "ar": "تنويم"}, + "report": {"en": "Radiology Report", "ar": "تقرير الاشعة"}, + "open-rad": {"en": "Open Image", "ar": "فتح صور الاشعة"}, + "send-copy": {"en": "Email the Report", "ar": "أرسل التقرير"}, + "appoSurvey": {"en": "Survey", "ar": "إستبيان"}, + "appoSurveySubtitle": {"en": "Survey", "ar": "إستبيان"}, + "labResults": {"en": "Lab Result", "ar": "نتيجة المختبر"}, + "doctorRating": {"en": "Doctor Rating", "ar": "تقييم الطبيب"}, + "good": {"en": "Good", "ar": "جيد"}, + "v-good": {"en": "Very Good", "ar": "جيد جدا"}, + "excellent": {"en": "Excellent", "ar": "ممتاز"}, + "average": {"en": "Average", "ar": "متوسط"}, + "below-average": {"en": "Below Average", "ar": "أقل من المتوسط"}, + "info-signs": { + "en": + "This service allows you to view all vital signs were performed in the Habib Medical Group, e.x (height, weight, body mass index, heart rate, etc.) as well shows some statistics charts.", + "ar": + "خدمة المؤشرات الحيوية: هذه الخدمة تمكنك من الاطلاع على جميع المؤشرات الحيوية على سبيل المثال (الطول، الوزن، مؤشر كتلة الجسم، معدل نبضات القلب الخ..) التي تمت في مجموعة الحبيب الطبية وكذلك رسوم بيانية على مستوى المؤشر." + }, + "info-advance-payment": { + "en": + "This service designed so that you can deposit an amount in advance either in your account or in someone else's account with Al Habib Medical Group.", + "ar": + "تم تصميم هذه الخدمة حتى تتمكن من دفع مبلغ مقدما او تحت الحساب سواء في حسابك او في حساب شخص اخر لدى مجموعة الحبيب الطبية." + }, + "info-my-balance": { + "en": "This service allows you to check your balance in all branchs", + "ar": "هذه الخدمه تتيح لك الاطلاع رصيدك في كل الفروع" + }, + "er-contant": { + "en": + "This service displays nearest branch among all the branches of Al Habib Medical Group based on your current location.", + "ar": + "تعرض هذه الخدمة أقرب فرع من بين جميع فروع مجموعة الحبيب الطبية بناءً على موقعك الحالي." + }, + "er": {"en": "ER", "ar": "الطوارىء"}, + "transportation-Service": {"en": "Ambulance Request", "ar": "طلب نقل اسعاف"}, + "info-ambulance": { + "en": + "Through this service, you can request evacuation by ambulance, whether from home or to home, in addition to a set of other services", + "ar": + "عن طريق هذه الخدمة يمكنك طلب اخلاء بواسطة سيارة اسعاف سواء من المزل او الى المنزل بالاضافة الى مجموعة من الخدمات الاخرى" + }, + "RRT-transport-heading": { + "en": "Select Transportation Method", + "ar": "حدد طريقة النقل" + }, + "sar": {"en": "SR", "ar": "ر.س"}, + "RRT-direction-heading": {"en": "Select Direction", "ar": "حدد الاتجاه"}, + "to-hospital": {"en": "To Hospital", "ar": "الى المستشفى"}, + "from-hospital": {"en": "From Hospital", "ar": "من المستشفى"}, + "one-direc": {"en": "One Way", "ar": "ذهاب"}, + "two-direc": {"en": "Two Ways", "ar": "ذهاب وعودة"}, + "pickup-location": {"en": "Pickup Location", "ar": "نقطة الانطلاق"}, + "pickup-spot": {"en": "Pickup Spot", "ar": "نقطة اللقاء"}, + "inside-home": {"en": "Inside Home", "ar": "داخل المنزل"}, + "have-appo": {"en": "Do you have an appointment?", "ar": "هل لديك موعد؟"}, + "dropoff-location": {"en": "Dropoff Location", "ar": "نقطة الوصول"}, + "select-all": { + "en": "Please select all fields", + "ar": "يرجى تحديد جميع الحقول" + }, + "select-map": {"en": "Select From Map", "ar": "حدد من الخريطة"}, + "no-appointment": { + "en": "You don't have any appointments yet", + "ar": "ليس لديك أي مواعيد حتى الآن" + }, + "patient-share": {"en": "Amount before tax: ", "ar": "المبلغ قبل الضريبة:"}, + "patient-share-tax": {"en": "Tax amount: ", "ar": "قيمة الضريبة:"}, + "patient-share-total": { + "en": "Total amount payable: ", + "ar": "المبلغ الإجمالي المستحق:" + }, + "select-ambulate": {"en": "Select Ambulate", "ar": "بحاجة للتنقل بواسطة"}, + "wheelchair": {"en": "Wheelchair", "ar": "كرسي متحرك"}, + "walker": {"en": "Walker", "ar": "مشاية"}, + "stretcher": {"en": "Stretcher", "ar": "نقالة"}, + "none": {"en": "None", "ar": "لا شيء"}, + "RRT-Summary": {"en": "Summary", "ar": "ملخص الطلب"}, + "bill-amount": {"en": "Bill Amount", "ar": "مبلغ الفاتورة"}, + "transport-method": {"en": "Transportation Method", "ar": "طريقة النقل"}, + "directions": {"en": "Directions", "ar": "الاتجاهات"}, + "info-my-appointments": { + "en": + "This service allows you to see all the appointment you have visited in Al Habib Medical Group, and through this service:", + "ar": + "خدمة مواعيدي: هذه الخدمة تمكنك من الاطلاع على جميع المواعيد التي قمت بزيارتهم في مجموعة الحبيب الطبية, كما تستطيع من خلال هذه الخدمة:" + }, + "info-todo": { + "en": + "This service is designed to enable you to have a quick link to the list of tasks that need to be done", + "ar": + "هذه الخدمة تم تصميمها لتمكنك من الوصول الى رابط سريع لقائمة المهام التي يجب القيام بها" + }, + "family-info": { + "en": + "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.", + "ar": + "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." + }, + "update-succ": { + "en": "Successfully updated profile", + "ar": "تم تحديث البيانات بنجاح" + }, + "dental-complains": {"en": "Symptoms", "ar": "الأعراض"}, + "empty-result": { + "en": "There is no search results found", + "ar": "لايوجد نتائج" + }, + + "no-booked-appointment": { + "en": "No booked appointments", + "ar": "لا يوجد مواعيد محجوزة" + }, + "no-confirmed-appointment": { + "en": "No confirmed appointments", + "ar": "لا توجد مواعيد مؤكدة" + }, + "no-arrived-appointment": { + "en": "No arrived appointments", + "ar": "لا يوجد مواعيد" + }, + "upcoming-empty": { + "en": "You do not have any Todo actions yet.", + "ar": "ليس لديك أي إجراءات الآن." + }, + "upcoming-timeLeft": { + "en": "time left for appointment", + "ar": "الوقت المتبقي للموعد" + }, + "covid-test-all-services": { + "en": "Covid-19 Drive-Thru Test", + "ar": "فحص كورونا من داخل السيارة" + }, + "pharmacy": {"en": "Pharmacy", "ar": "الصيدلية"}, + "ereferral": {"en": "E-Referral", "ar": "طلب التحويل"}, + "child-vaccine": {"en": "Child Vaccines", "ar": "تطعيمات الأطفال"}, + "calculators": {"en": "Health Calculators", "ar": "الحاسبات الصحية"}, + "converters": {"en": "Health Converter", "ar": "تحويل القياسات"}, + "h2o": {"en": "Water Tracker", "ar": "حساب كمية الماء"}, + "v-tour": {"en": "Virtual Tour", "ar": "جولة إفتراضية"}, + "hmg-news": {"en": "HMG News", "ar": "أخبار المجموعة"}, + "blood-d": {"en": "Blood Donation", "ar": "تبرع بالدم"}, + "symptomCheckerTitle": {"en": "Symptom Checker", "ar": "مدقق الأعراض"}, + "latest-news": {"en": "Latest News", "ar": "أحدث الأخبار"}, + "our-location": {"en": "Our Locations", "ar": "موقعنا"}, + "pharmacies": {"en": "Pharmacies", "ar": "الصيدليات"}, + "hospitals": {"en": "Hospitals", "ar": "المستشفيات"}, + "wallet": {"en": "Wallet", "ar": "محفظة نقود"}, + "hmg": {"en": "Al Habib", "ar": "الحبيب"}, + + "requested": {"en": "Requested", "ar": "مطلوب"}, + "ready": {"en": "Ready", "ar": "جاهز"}, + "completed": {"en": "Completed", "ar": "مكتمل"}, + "cancelled": {"en": "Cancelled", "ar": "ملغى"}, + "request-medical-report": { + "en": "Request medical report", + "ar": "طلب تقرير طبي" + }, + "insur-cards": {"en": "Insurance Cards", "ar": "بطاقات التأمين"}, + 'labResult': {"en": "Lab results", "ar": "نتائج التحاليل المخبرية"}, + 'details': {'en': 'Details', 'ar': 'التفاصيل'}, + "age": {"en": "Age", "ar": "العمر"}, + "active-insurence": {"en": "Active", "ar": "نشطة"}, + "not-active": {"en": "Not Active", "ar": "غير نشط"}, + "card-detail": {"en": "Insurance Details", "ar": "منافعك التامينية"}, + "Dr": {"en": "Dr. ", "ar": "الدكتور."}, + "empty": {"en": "You do not have any records.", "ar": "ليس لديك أي سجلات"}, + "last-visit": { + "en": "How was your last visit with doctor?", + "ar": "كيف تقيم زيارتك الأخيرة للطبيب؟" + }, + "tap-title": {"en": "Please rate the doctor", "ar": "يرجى تقييم الطبيب"}, + "later": {"en": "Later", "ar": "لاحقاً"}, + "sendSuc": { + "en": "A copy has been sent to the email", + "ar": "تم إرسال نسخة إلى البريد الإلكتروني" + }, + "instructions": { + "en": + "You can now talk directly to the appointments department by chat or request a call back", + "ar": + "يمكنك الان التحدث مباشرة مع قسم المواعيد عن طريق خدمة المحادثة النصية أو طلب معاودة الاتصال" + }, + "instructions-pharmacies": { + "en": + "You can now talk directly to the pharmacist by chat or request a call back", + "ar": + "يمكنك الآن التحدث مباشرة إلى الصيدلي عن طريق الدردشة أو طلب معاودة الاتصال" + }, + "select-hospital": {"en": "Choose Hospital", "ar": "اختر المستشفى"}, + "start": {"en": "Start", "ar": "ابدأ"}, + "info-chat": { + "en": + "This service allows you to chat with customer service directly without the need to call.", + "ar": + "المحادثة المباشرة: هذه الخدمة تمكنك التحدث كتابياً مع خدمة العملاء مباشرة دون الحاجة الى الاتصال هاتفياً." + }, + "last-appointment": { + "en": "How was your appointment?", + "ar": "كيف كان موعدك الطبي ؟" + }, + "rate-clinic": {"en": "Please rate the clinic", "ar": "يرجى تقييم العيادة"}, + "fetch-data": {"en": "Fetch Data", "ar": "تحديث الان"}, + "rate": {"en": "Rate", "ar": "تقييم"}, + "send-email": { + "en": "Send a copy of this report to the email", + "ar": "أرسل نسخة من هذا التقرير إلى البريد الإلكتروني" + }, + "update-email": {"en": "Update Email", "ar": "تحديث البريد الالكتروني"}, + "booked-success": { + "en": "The appointment has been successfully booked.", + "ar": "لقد تم حجز الموعد بنجاح" + }, + "appo-reminder-select-option-30": { + "en": "Before 30 Mins", + "ar": "قبل 30 دقيقة" + }, + "appo-reminder-select-option-60": { + "en": "Before 1 Hour", + "ar": "قبل ساعة واحدة" + }, + "appo-reminder-select-option-90": { + "en": "Before 1 Hour and 30 mins", + "ar": "قبل ساعة و 30 دقيقة" + }, + "appo-reminder-select-option-120": { + "en": "Before 2 Hours", + "ar": "قبل ساعتين" + }, + "noDataAvailable": { + "en": "No data available", + "ar": " لا يوجد بيانات متاحة " + }, + "thename": {"en": "The Name", "ar": "الاسم"}, + "noSearchResult": {"en": "No Search Result", "ar": "لا توجد نتيجة بحث"}, + "selectFileSouse": {"en": "Select file souse", "ar": "حدد الملف"}, + "gallery": {"en": "Gallery", "ar": "معرض الصور"}, + "camera": {"en": "Camera", "ar": "كاميرا"}, + "med-report": { + "en": "Medical Reports", + "ar": "التقارير الطبية" + }, + "new-med-report": { + "en": "Requests", + "ar": "الطلبات" + }, + "requestReport":{ + "en":"Request a report", + "ar":" طلب تقرير" + }, + "confirm-msg-report": { + "en": "Request for medical report?", + "ar": "طلب تقرير طبي؟" + }, + "successSendReport": { + "en": "The request has been submitted successfully", + "ar": "تم تنفيذ طلبك بنجاح" + }, + "pulseTitle": { + "en": "Heart rate", + "ar": "معدل النبض بالدقيقة" + }, + "systolic-lng": { + "en": "Systolic", + "ar": "الإنقباض" + }, + "diastolic-lng": { + "en": "Diastolic", + "ar": "الإنبساط" + }, + "policy-holder": { + "en": "Policy Holder", + "ar": "حامل بطاقة التأمين" + }, + "policy-no": { + "en": "Policy Number", + "ar": "رقم سياسات" + }, + "agree": { + "en": "I agree, this is the correct information", + "ar": "موافق، هذه المعلومات صحيحة" + }, + "disagree": { + "en": "No, this is not the correct information", + "ar": "غير موافق، هذه المعلومات غير الصحيحة" + }, + "expiry-date": { + "en": "Expiry Date", + "ar": "تاريخ انتهاء الصلاحية" + }, + "class": { + "en": "Class", + "ar": "فئة" + }, + "approval": { + "en": "Approval", + "ar": "موافقة" + }, + "no-data": { + "en": "No data found", + "ar": "لاتوجد بيانات" + }, + "insurance-details": { + "en": "Insurance Details", + "ar": "تفاصيل التأمين" + }, + "nearest-hospital": { + "en": "Nearest Hospital", + "ar": "أقرب مستشفى" + }, + "request-sent": { + "en": "Request sent successfully", + "ar": "تم إرسال الطلب بنجاح" + }, + "message-sent": { + "en": "Message sent successfully", + "ar": "تم إرسال الرسالة بنجاح" + }, + "sent-on": { + "en": "Sent on", + "ar": "أرسلت في" + }, + "attach-insurace-image": { + "en": "Attach insurance card image", + "ar": "إرفاق صورة بطاقة التأمين" + }, + "upload-without-image": { + "en": "You can still submit, if you don't have Insurance Image", + "ar": "لا يزال بإمكانك الإرسال ، إذا لم يكن لديك صورة تأمين" + }, + "info-insur-cards": { + "en": "This service allows you to view all the insurance cards that recorded during your visits to Al Habib Medical Group in addition to:", + "ar": "خدمة بطاقات التامين: هذه الخدمة تمكنك من الاطلاع على جميع بطاقات التامين والتي تم تسجيلها اثناء زياراتك لمجموعة الحبيب الطبية بالاضافة الى:" + }, + "scan-now": { + "en": "If you have a card / Document Scan now", + "ar": "إذا كانت لديك بطاقة / مستند ارفقها الان" + }, + "liveCare": { + "en": "Live Care", + "ar": "لايف كير" + }, }; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 8c03fcce..16b826d2 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -1,3 +1,27 @@ const TOKEN = 'token'; const APP_LANGUAGE = 'language'; +const USER_PROFILE = 'user-profile'; +const PUSH_TOKEN = 'push-token'; +const REGISTER_DATA_FOR_REGISTER = 'register-data-for-register'; +const LOGIN_TOKEN_ID = 'register-data-for-register'; +const REGISTER_DATA_FOR_LOGIIN = 'register-data-for-login'; +const LAST_LOGIN = 'last-login'; +const ONLY_SMS = 'only-sms'; +const AUTH_DATA = 'auth-data'; +const IMEI_USER_DATA = 'imei-user-data'; +const NHIC_DATA = 'nhic-data'; +const FAMILY_FILE = 'family-file'; +const USER_LAT = 'user-lat'; +const USER_LONG = 'user-long'; +const IS_GO_TO_PARKING = 'IS_GO_TO_PARKING'; +const IS_SEARCH_APPO = 'is-search-appo'; +const IS_LIVECARE_APPOINTMENT = 'is_livecare_appointment'; +const IS_VIBRATION = 'is_vibration'; +const THEME_VALUE = 'is_vibration'; +const MAIN_USER = 'main-user'; +const PHARMACY_LAST_VISITED_PRODUCTS = 'last-visited'; +const HMG_GEOFENCES = 'hmg-geo-fences'; +const WEATHER = 'weather'; +const BLOOD_TYPE = 'blood-type'; +const NOTIFICATION_COUNT = 'notification-count'; diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 76f52149..e7e1b41b 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -31,15 +31,11 @@ class SizeConfig { if (realScreenWidth < 450) { isMobilePortrait = true; } - // textMultiplier = _blockHeight; - // imageSizeMultiplier = _blockWidth; screenHeight = realScreenHeight; screenWidth = realScreenWidth; } else { isPortrait = false; isMobilePortrait = false; - // textMultiplier = _blockWidth; - // imageSizeMultiplier = _blockHeight; screenHeight = realScreenWidth; screenWidth = realScreenHeight; } diff --git a/lib/core/enum/Ambulate.dart b/lib/core/enum/Ambulate.dart new file mode 100644 index 00000000..f8b2e8be --- /dev/null +++ b/lib/core/enum/Ambulate.dart @@ -0,0 +1,60 @@ +import 'package:flutter/cupertino.dart'; + +enum Ambulate { Wheelchair, Walker, Stretcher, None } + +extension SelectedAmbulate on Ambulate { + String getAmbulateTitle(BuildContext context) { + switch (this) { + case Ambulate.Wheelchair: + return 'Wheelchair'; + break; + case Ambulate.Walker: + return 'Walker'; + break; + case Ambulate.Stretcher: + return 'Stretcher'; + break; + case Ambulate.None: + return 'None'; + break; + } + return 'None'; + } + + int selectAmbulateNumber() { + switch (this) { + case Ambulate.Wheelchair: + return 0; + break; + case Ambulate.Walker: + return 1; + break; + case Ambulate.Stretcher: + return 2; + break; + case Ambulate.None: + return 3; + break; + } + return 3; + } + + Ambulate getAmbulateById(int id) { + switch (id) { + case 0: + return Ambulate.Wheelchair; + break; + case 1: + return Ambulate.Walker; + break; + case 2: + return Ambulate.Stretcher; + break; + case 3: + return Ambulate.None; + break; + } + + return Ambulate.None; + } +} diff --git a/lib/core/enum/OrderService.dart b/lib/core/enum/OrderService.dart new file mode 100644 index 00000000..833e0919 --- /dev/null +++ b/lib/core/enum/OrderService.dart @@ -0,0 +1,35 @@ +enum OrderService { AMBULANCE,HOME_HEALTH_CARE,Comprehensive_Medical_Checkup } + +extension SelectedOrderService on OrderService { + int getIdOrderService() { + switch (this) { + case OrderService.AMBULANCE: + return 4; + break; + case OrderService.Comprehensive_Medical_Checkup: + return 3; + break; + case OrderService.HOME_HEALTH_CARE: + return 2; + break; + + } + return 4; + } + + OrderService getOrderServiceById(int id) { + switch (id) { + case 4: + return OrderService.AMBULANCE; + break; + case 2: + return OrderService.HOME_HEALTH_CARE; + break; + case 3: + return OrderService.Comprehensive_Medical_Checkup; + break; + } + + return OrderService.AMBULANCE; + } +} diff --git a/lib/core/enum/filter_type.dart b/lib/core/enum/filter_type.dart new file mode 100644 index 00000000..4591e023 --- /dev/null +++ b/lib/core/enum/filter_type.dart @@ -0,0 +1,2 @@ +enum FilterType { Clinic, Hospital } + diff --git a/lib/core/enum/patient_lookup.dart b/lib/core/enum/patient_lookup.dart new file mode 100644 index 00000000..08de54b2 --- /dev/null +++ b/lib/core/enum/patient_lookup.dart @@ -0,0 +1,39 @@ +const PATIENT_TYPE = const [ + {"text": "outPatiant", "text_ar": "المريض الخارجي", "val": "0"}, + {"text": "InPatiant", "text_ar": "المريض المنوم", "val": "1"}, + {"text": "Discharge", "text_ar": "المريض المعافى", "val": "2"}, + {"text": "Referrd", "text_ar": "المريض المحول الي", "val": "3"}, + { + "text": "Referral Discharge", + "text_ar": "المريض المحال المعافى", + "val": "4" + }, + {"text": "Tomorrow Patient", "text_ar": "مريض الغد", "val": "5"}, + {"text": "Referral", "text_ar": "المريض المحول مني", "val": "6"}, +]; + +const LOCATIONS = const [ + { + "text": "In Saudi Arabia", + "text-ar": "داخل المملكة العربية السعودية", + "val": "1" + }, + { + "text": "Out Saudi Arabia", + "text-ar": "خارج المملكة العربية السعودية", + "val": "2" + }, +]; + +enum VitalSignDetails { + BodyMeasurements, + Temperature, + Pulse, + Prescriptions, + BloodPressure, + Respiration, + heart, + PainScale, + Weight, + Height +} diff --git a/lib/core/enum/reportfilter_type.dart b/lib/core/enum/reportfilter_type.dart new file mode 100644 index 00000000..74cd97c6 --- /dev/null +++ b/lib/core/enum/reportfilter_type.dart @@ -0,0 +1 @@ +enum ReportFilterType { Requested, Ready,Completed,Cancelled } \ No newline at end of file diff --git a/lib/core/enum/viewstate.dart b/lib/core/enum/viewstate.dart new file mode 100644 index 00000000..94d79bec --- /dev/null +++ b/lib/core/enum/viewstate.dart @@ -0,0 +1 @@ +enum ViewState { Idle, Busy, Error, BusyLocal, ErrorLocal } diff --git a/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart new file mode 100644 index 00000000..6880f9f5 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart @@ -0,0 +1,68 @@ +class CMCGetItemsRequestModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int checkupType; + + CMCGetItemsRequestModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.checkupType}); + + CMCGetItemsRequestModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + checkupType = json['CheckupType']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['CheckupType'] = this.checkupType; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart new file mode 100644 index 00000000..6f362baa --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart @@ -0,0 +1,18 @@ +class CMCGetItemsResponseModel { + String itemDescription; + String itemName; + + CMCGetItemsResponseModel({this.itemDescription, this.itemName}); + + CMCGetItemsResponseModel.fromJson(Map json) { + itemDescription = json['ItemDescription']; + itemName = json['ItemName']; + } + + Map toJson() { + final Map data = new Map(); + data['ItemDescription'] = this.itemDescription; + data['ItemName'] = this.itemName; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart new file mode 100644 index 00000000..534988a7 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart @@ -0,0 +1,135 @@ +class CMCInsertPresOrderRequestModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + double latitude; + double longitude; + int createdBy; + int orderServiceID; + List patientERCMCInsertServicesList; + + CMCInsertPresOrderRequestModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.latitude, + this.longitude, + this.createdBy, + this.orderServiceID, + this.patientERCMCInsertServicesList}); + + CMCInsertPresOrderRequestModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + latitude = json['Latitude']; + longitude = json['Longitude']; + createdBy = json['CreatedBy']; + orderServiceID = json['OrderServiceID']; + if (json['PatientER_CMC_InsertServicesList'] != null) { + patientERCMCInsertServicesList = + new List(); + json['PatientER_CMC_InsertServicesList'].forEach((v) { + patientERCMCInsertServicesList + .add(new PatientERCMCInsertServicesList.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['CreatedBy'] = this.createdBy; + data['OrderServiceID'] = this.orderServiceID; + if (this.patientERCMCInsertServicesList != null) { + data['PatientER_CMC_InsertServicesList'] = + this.patientERCMCInsertServicesList.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class PatientERCMCInsertServicesList { + int recordID; + String serviceID; + String selectedServiceName; + String selectedServiceNameAR; + dynamic price; + dynamic vAT; + dynamic totalPrice; + + PatientERCMCInsertServicesList( + {this.recordID, + this.serviceID, + this.selectedServiceName, + this.selectedServiceNameAR, + this.price, + this.vAT, + this.totalPrice}); + + PatientERCMCInsertServicesList.fromJson(Map json) { + recordID = json['RecordID']; + serviceID = json['ServiceID']; + selectedServiceName = json['selectedServiceName']; + selectedServiceNameAR = json['selectedServiceNameAR']; + price = json['Price']; + vAT = json['VAT']; + totalPrice = json['TotalPrice']; + } + + Map toJson() { + final Map data = new Map(); + data['RecordID'] = this.recordID; + data['ServiceID'] = this.serviceID; + data['selectedServiceName'] = this.selectedServiceName; + data['selectedServiceNameAR'] = this.selectedServiceNameAR; + data['Price'] = this.price; + data['VAT'] = this.vAT; + data['TotalPrice'] = this.totalPrice; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_request_model.dart b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_request_model.dart new file mode 100644 index 00000000..e80b656d --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_request_model.dart @@ -0,0 +1,72 @@ +class GetCMCServicesRequestModel { + int channel; + int deviceTypeID; + int genderID; + String generalid; + String identificationNo; + String iPAdress; + bool isDentalAllowedBackend; + int languageID; + int patientID; + int patientOutSA; + int patientType; + int patientTypeID; + String sessionID; + String tokenID; + double versionID; + + GetCMCServicesRequestModel( + {this.channel, + this.deviceTypeID, + this.genderID, + this.generalid, + this.identificationNo, + this.iPAdress, + this.isDentalAllowedBackend, + this.languageID, + this.patientID, + this.patientOutSA, + this.patientType, + this.patientTypeID, + this.sessionID, + this.tokenID, + this.versionID}); + + GetCMCServicesRequestModel.fromJson(Map json) { + channel = json['Channel']; + deviceTypeID = json['DeviceTypeID']; + genderID = json['GenderID']; + generalid = json['generalid']; + identificationNo = json['IdentificationNo']; + iPAdress = json['IPAdress']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + languageID = json['LanguageID']; + patientID = json['PatientID']; + patientOutSA = json['PatientOutSA']; + patientType = json['PatientType']; + patientTypeID = json['PatientTypeID']; + sessionID = json['SessionID']; + tokenID = json['TokenID']; + versionID = json['VersionID']; + } + + Map toJson() { + final Map data = new Map(); + data['Channel'] = this.channel; + data['DeviceTypeID'] = this.deviceTypeID; + data['GenderID'] = this.genderID; + data['generalid'] = this.generalid; + data['IdentificationNo'] = this.identificationNo; + data['IPAdress'] = this.iPAdress; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['LanguageID'] = this.languageID; + data['PatientID'] = this.patientID; + data['PatientOutSA'] = this.patientOutSA; + data['PatientType'] = this.patientType; + data['PatientTypeID'] = this.patientTypeID; + data['SessionID'] = this.sessionID; + data['TokenID'] = this.tokenID; + data['VersionID'] = this.versionID; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart new file mode 100644 index 00000000..5f356e2b --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart @@ -0,0 +1,44 @@ +class GetCMCServicesResponseModel { + String description; + String descriptionN; + int iD; + bool isActive; + dynamic price; + int serviceID; + dynamic totalPrice; + dynamic vAT; + + GetCMCServicesResponseModel( + {this.description, + this.descriptionN, + this.iD, + this.isActive, + this.price, + this.serviceID, + this.totalPrice, + this.vAT}); + + GetCMCServicesResponseModel.fromJson(Map json) { + description = json['Description']; + descriptionN = json['DescriptionN']; + iD = json['ID']; + isActive = json['IsActive']; + price = json['Price']; + serviceID = json['ServiceID']; + totalPrice = json['TotalPrice']; + vAT = json['VAT']; + } + + Map toJson() { + final Map data = new Map(); + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['ID'] = this.iD; + data['IsActive'] = this.isActive; + data['Price'] = this.price; + data['ServiceID'] = this.serviceID; + data['TotalPrice'] = this.totalPrice; + data['VAT'] = this.vAT; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart new file mode 100644 index 00000000..3f26abe7 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart @@ -0,0 +1,57 @@ +class CheckActivationCodeForEReferralResponseModel { + String logInTokenID; + String activationCode; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + + CheckActivationCodeForEReferralResponseModel( + {this.logInTokenID, + this.activationCode, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); + + CheckActivationCodeForEReferralResponseModel.fromJson( + Map json) { + logInTokenID = json['LogInTokenID']; + activationCode = json['activationCode']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['LogInTokenID'] = this.logInTokenID; + data['activationCode'] = this.activationCode; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart new file mode 100644 index 00000000..e13de327 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart @@ -0,0 +1,153 @@ +class CreateEReferralRequestModel { + bool isInsuredPatient; + String cityCode; + String cityName; + String requesterName; + String requesterContactNo; + int requesterRelationship; + String otherRelationship; + String fullName; + int identificationNo; + String patientMobileNumber; + int preferredBranchCode; + String preferredBranchName; + List medicalReportAttachment; + dynamic insuranceCardAttachment; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + CreateEReferralRequestModel( + {this.isInsuredPatient, + this.cityCode, + this.cityName, + this.requesterName, + this.requesterContactNo, + this.requesterRelationship, + this.otherRelationship, + this.fullName, + this.identificationNo, + this.patientMobileNumber, + this.preferredBranchCode, + this.preferredBranchName, + this.medicalReportAttachment, + this.insuranceCardAttachment, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + CreateEReferralRequestModel.fromJson(Map json) { + isInsuredPatient = json['IsInsuredPatient']; + cityCode = json['CityCode']; + cityName = json['CityName']; + requesterName = json['RequesterName']; + requesterContactNo = json['RequesterContactNo']; + requesterRelationship = json['RequesterRelationship']; + otherRelationship = json['OtherRelationship']; + fullName = json['FullName']; + identificationNo = json['IdentificationNo']; + patientMobileNumber = json['PatientMobileNumber']; + preferredBranchCode = json['PreferredBranchCode']; + preferredBranchName = json['PreferredBranchName']; + if (json['MedicalReportAttachment'] != null) { + medicalReportAttachment = new List(); + json['MedicalReportAttachment'].forEach((v) { + medicalReportAttachment.add(new EReferralAttachment.fromJson(v)); + }); + } + insuranceCardAttachment = json['InsuranceCardAttachment'] != null + ? new EReferralAttachment.fromJson(json['InsuranceCardAttachment']) + : null; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['IsInsuredPatient'] = this.isInsuredPatient; + data['CityCode'] = this.cityCode; + data['CityName'] = this.cityName; + data['RequesterName'] = this.requesterName; + data['RequesterContactNo'] = this.requesterContactNo; + data['RequesterRelationship'] = this.requesterRelationship; + data['OtherRelationship'] = this.otherRelationship; + data['FullName'] = this.fullName; + data['IdentificationNo'] = this.identificationNo; + data['PatientMobileNumber'] = this.patientMobileNumber; + data['PreferredBranchCode'] = this.preferredBranchCode; + data['PreferredBranchName'] = this.preferredBranchName; + if (this.medicalReportAttachment != null) { + data['MedicalReportAttachment'] = + this.medicalReportAttachment.map((v) => v.toJson()).toList(); + } + if (this.insuranceCardAttachment == null) { + data['InsuranceCardAttachment'] = {}; + } else + data['InsuranceCardAttachment'] = this.insuranceCardAttachment.toJson(); + + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} + +class EReferralAttachment { + String fileName; + String base64String; + + EReferralAttachment({this.fileName, this.base64String}); + + EReferralAttachment.fromJson(Map json) { + fileName = json['FileName']; + base64String = json['Base64String']; + } + + Map toJson() { + final Map data = new Map(); + data['FileName'] = this.fileName; + data['Base64String'] = this.base64String; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/EReferral/get_all_cities_request_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/get_all_cities_request_model.dart new file mode 100644 index 00000000..dd46a48b --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/EReferral/get_all_cities_request_model.dart @@ -0,0 +1,48 @@ +class GetAllCitiesRequestModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + + GetAllCitiesRequestModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); + + GetAllCitiesRequestModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart new file mode 100644 index 00000000..224cb84d --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart @@ -0,0 +1,21 @@ +class GetAllCitiesResponseModel { + int iD; + String description; + String descriptionN; + + GetAllCitiesResponseModel({this.iD, this.description, this.descriptionN}); + + GetAllCitiesResponseModel.fromJson(Map json) { + iD = json['ID']; + description = json['Description']; + descriptionN = json['DescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_request_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_request_model.dart new file mode 100644 index 00000000..10eb03de --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_request_model.dart @@ -0,0 +1,48 @@ +class GetAllRelationshipTypeRequestModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + + GetAllRelationshipTypeRequestModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); + + GetAllRelationshipTypeRequestModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart new file mode 100644 index 00000000..997e3f3c --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart @@ -0,0 +1,25 @@ +class GetAllRelationshipTypeResponseModel { + int iD; + String text; + String textAr; + String textEn; + + GetAllRelationshipTypeResponseModel( + {this.iD, this.text, this.textAr, this.textEn}); + + GetAllRelationshipTypeResponseModel.fromJson(Map json) { + iD = json['ID']; + text = json['Text']; + textAr = json['Text_Ar']; + textEn = json['Text_En']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['Text'] = this.text; + data['Text_Ar'] = this.textAr; + data['Text_En'] = this.textEn; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/EReferral/search_criteria_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/search_criteria_model.dart new file mode 100644 index 00000000..3ddbe331 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/EReferral/search_criteria_model.dart @@ -0,0 +1,21 @@ +class SearchCriteriaModel { + String name; + String nameAr; + int value; + + SearchCriteriaModel({this.name, this.nameAr, this.value}); + + SearchCriteriaModel.fromJson(Map json) { + name = json['name']; + nameAr = json['name_ar']; + value = json['value']; + } + + Map toJson() { + final Map data = new Map(); + data['name'] = this.name; + data['name_ar'] = this.nameAr; + data['value'] = this.value; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart new file mode 100644 index 00000000..b06ce8e7 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart @@ -0,0 +1,60 @@ +class SearchEReferralRequestModel { + String patientMobileNumber; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int referralNumber; + String identificationNo; + + SearchEReferralRequestModel( + {this.patientMobileNumber, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.referralNumber, + this.identificationNo}); + + SearchEReferralRequestModel.fromJson(Map json) { + patientMobileNumber = json['PatientMobileNumber']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + referralNumber = json['ReferralNumber']; + identificationNo = json['IdentificationNo']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMobileNumber'] = this.patientMobileNumber; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['ReferralNumber'] = this.referralNumber; + data['IdentificationNo'] = this.identificationNo; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/EReferral/search_e_referral_response_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/search_e_referral_response_model.dart new file mode 100644 index 00000000..801d8e13 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/EReferral/search_e_referral_response_model.dart @@ -0,0 +1,60 @@ +class SearchEReferralResponseModel { + String patientMobileNumber; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int referralNumber; + String identificationNo; + + SearchEReferralResponseModel( + {this.patientMobileNumber, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.referralNumber, + this.identificationNo}); + + SearchEReferralResponseModel.fromJson(Map json) { + patientMobileNumber = json['PatientMobileNumber']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + referralNumber = json['ReferralNumber']; + identificationNo = json['IdentificationNo']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMobileNumber'] = this.patientMobileNumber; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['ReferralNumber'] = this.referralNumber; + data['IdentificationNo'] = this.identificationNo; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/EReferral/send_activation_code_for_e_referral_request_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/send_activation_code_for_e_referral_request_model.dart new file mode 100644 index 00000000..622ef143 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/EReferral/send_activation_code_for_e_referral_request_model.dart @@ -0,0 +1,57 @@ +class SendActivationCodeForEReferralRequestModel { + int patientMobileNumber; + String zipCode; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + + SendActivationCodeForEReferralRequestModel( + {this.patientMobileNumber, + this.zipCode, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); + + SendActivationCodeForEReferralRequestModel.fromJson( + Map json) { + patientMobileNumber = json['PatientMobileNumber']; + zipCode = json['ZipCode']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMobileNumber'] = this.patientMobileNumber; + data['ZipCode'] = this.zipCode; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart b/lib/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart new file mode 100644 index 00000000..2d27729b --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart @@ -0,0 +1,76 @@ +class InsertUserActivityRequestModel { + String identificationNo; + String mobileNumber; + int quantityIntake; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + InsertUserActivityRequestModel( + {this.identificationNo, + this.mobileNumber, + this.quantityIntake, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + InsertUserActivityRequestModel.fromJson(Map json) { + identificationNo = json['IdentificationNo']; + mobileNumber = json['MobileNumber']; + quantityIntake = json['QuantityIntake']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['IdentificationNo'] = this.identificationNo; + data['MobileNumber'] = this.mobileNumber; + data['QuantityIntake'] = this.quantityIntake; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/H2O/user_progress_for_month_data_model.dart b/lib/core/model/AlHabibMedicalService/H2O/user_progress_for_month_data_model.dart new file mode 100644 index 00000000..a7f7805e --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/H2O/user_progress_for_month_data_model.dart @@ -0,0 +1,22 @@ +class UserProgressForMonthDataModel { + int monthNumber; + String monthName; + int percentageConsumed; + + UserProgressForMonthDataModel( + {this.monthNumber, this.monthName, this.percentageConsumed}); + + UserProgressForMonthDataModel.fromJson(Map json) { + monthNumber = json['MonthNumber']; + monthName = json['MonthName']; + percentageConsumed = json['PercentageConsumed']; + } + + Map toJson() { + final Map data = new Map(); + data['MonthNumber'] = this.monthNumber; + data['MonthName'] = this.monthName; + data['PercentageConsumed'] = this.percentageConsumed; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/H2O/user_progress_for_today_data_model.dart b/lib/core/model/AlHabibMedicalService/H2O/user_progress_for_today_data_model.dart new file mode 100644 index 00000000..63c7093b --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/H2O/user_progress_for_today_data_model.dart @@ -0,0 +1,28 @@ +class UserProgressForTodayDataModel { + dynamic quantityConsumed; + dynamic percentageConsumed; + dynamic percentageLeft; + dynamic quantityLimit; + + UserProgressForTodayDataModel( + {this.quantityConsumed, + this.percentageConsumed, + this.percentageLeft, + this.quantityLimit}); + + UserProgressForTodayDataModel.fromJson(Map json) { + quantityConsumed = json['QuantityConsumed']; + percentageConsumed = json['PercentageConsumed']; + percentageLeft = json['PercentageLeft']; + quantityLimit = json['QuantityLimit']; + } + + Map toJson() { + final Map data = new Map(); + data['QuantityConsumed'] = this.quantityConsumed; + data['PercentageConsumed'] = this.percentageConsumed; + data['PercentageLeft'] = this.percentageLeft; + data['QuantityLimit'] = this.quantityLimit; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/H2O/user_progress_for_week_data_model.dart b/lib/core/model/AlHabibMedicalService/H2O/user_progress_for_week_data_model.dart new file mode 100644 index 00000000..2641a678 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/H2O/user_progress_for_week_data_model.dart @@ -0,0 +1,25 @@ +class UserProgressForWeekDataModel { + int dayNumber; + dynamic dayDate; + String dayName; + int percentageConsumed; + + UserProgressForWeekDataModel( + {this.dayNumber, this.dayDate, this.dayName, this.percentageConsumed}); + + UserProgressForWeekDataModel.fromJson(Map json) { + dayNumber = json['DayNumber']; + dayDate = json['DayDate']; + dayName = json['DayName']; + percentageConsumed = json['PercentageConsumed']; + } + + Map toJson() { + final Map data = new Map(); + data['DayNumber'] = this.dayNumber; + data['DayDate'] = this.dayDate; + data['DayName'] = this.dayName; + data['PercentageConsumed'] = this.percentageConsumed; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/H2O/user_progress_request_model.dart b/lib/core/model/AlHabibMedicalService/H2O/user_progress_request_model.dart new file mode 100644 index 00000000..d06e053b --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/H2O/user_progress_request_model.dart @@ -0,0 +1,76 @@ +class UserProgressRequestModel { + int progress; + String mobileNumber; + String identificationNo; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + UserProgressRequestModel( + {this.progress, + this.mobileNumber, + this.identificationNo, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + UserProgressRequestModel.fromJson(Map json) { + progress = json['Progress']; + mobileNumber = json['MobileNumber']; + identificationNo = json['IdentificationNo']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['Progress'] = this.progress; + data['MobileNumber'] = this.mobileNumber; + data['IdentificationNo'] = this.identificationNo; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart b/lib/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart new file mode 100644 index 00000000..7b24c149 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart @@ -0,0 +1,64 @@ +class HHCGetAllServicesRequestModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + HHCGetAllServicesRequestModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + HHCGetAllServicesRequestModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart b/lib/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart new file mode 100644 index 00000000..e2f39733 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart @@ -0,0 +1,32 @@ +class HHCGetAllServicesResponseModel { + int iD; + int serviceID; + String description; + String descriptionN; + bool isActive; + + HHCGetAllServicesResponseModel( + {this.iD, + this.serviceID, + this.description, + this.descriptionN, + this.isActive}); + + HHCGetAllServicesResponseModel.fromJson(Map json) { + iD = json['ID']; + serviceID = json['ServiceID']; + description = json['Description']; + descriptionN = json['DescriptionN']; + isActive = json['IsActive']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['ServiceID'] = this.serviceID; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['IsActive'] = this.isActive; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/HomeHealthCare/PatientERHHCInsertServicesList.dart b/lib/core/model/AlHabibMedicalService/HomeHealthCare/PatientERHHCInsertServicesList.dart new file mode 100644 index 00000000..bc5a4ddf --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/HomeHealthCare/PatientERHHCInsertServicesList.dart @@ -0,0 +1,23 @@ + +class PatientERHHCInsertServicesList { + int recordID; + int serviceID; + String serviceName; + + PatientERHHCInsertServicesList( + {this.recordID, this.serviceID, this.serviceName}); + + PatientERHHCInsertServicesList.fromJson(Map json) { + recordID = json['RecordID']; + serviceID = json['ServiceID']; + serviceName = json['ServiceName']; + } + + Map toJson() { + final Map data = new Map(); + data['RecordID'] = this.recordID; + data['ServiceID'] = this.serviceID; + data['ServiceName'] = this.serviceName; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_request_model.dart b/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_request_model.dart new file mode 100644 index 00000000..ed55b3a9 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_request_model.dart @@ -0,0 +1,64 @@ +class GetHHCAllPresOrdersRequestModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + GetHHCAllPresOrdersRequestModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + GetHHCAllPresOrdersRequestModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart b/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart new file mode 100644 index 00000000..5dedac1c --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart @@ -0,0 +1,132 @@ +class GetHHCAllPresOrdersResponseModel { + int iD; + String patientID; + bool patientOutSA; + bool isOutPatient; + int projectID; + int nearestProjectID; + double longitude; + double latitude; + String appointmentNo; + String dischargeID; + int lineItemNo; + int status; + String description; + String descriptionN; + String createdOn; + int serviceID; + int createdBy; + String editedOn; + int editedBy; + int channel; + dynamic clientRequestID; + bool returnedToQueue; + dynamic pickupDateTime; + dynamic pickupLocationName; + dynamic dropoffLocationName; + int realRRTHaveTransactions; + String nearestProjectDescription; + String nearestProjectDescriptionN; + String projectDescription; + String projectDescriptionN; + + GetHHCAllPresOrdersResponseModel( + {this.iD, + this.patientID, + this.patientOutSA, + this.isOutPatient, + this.projectID, + this.nearestProjectID, + this.longitude, + this.latitude, + this.appointmentNo, + this.dischargeID, + this.lineItemNo, + this.status, + this.description, + this.descriptionN, + this.createdOn, + this.serviceID, + this.createdBy, + this.editedOn, + this.editedBy, + this.channel, + this.clientRequestID, + this.returnedToQueue, + this.pickupDateTime, + this.pickupLocationName, + this.dropoffLocationName, + this.realRRTHaveTransactions, + this.nearestProjectDescription, + this.nearestProjectDescriptionN, + this.projectDescription, + this.projectDescriptionN}); + + GetHHCAllPresOrdersResponseModel.fromJson(Map json) { + iD = json['ID']; + patientID = json['PatientID']; + patientOutSA = json['PatientOutSA']; + isOutPatient = json['IsOutPatient']; + projectID = json['ProjectID']; + nearestProjectID = json['NearestProjectID']; + longitude = json['Longitude']; + latitude = json['Latitude']; + appointmentNo = json['AppointmentNo']; + dischargeID = json['DischargeID']; + lineItemNo = json['LineItemNo']; + status = json['Status']; + description = json['Description']; + descriptionN = json['DescriptionN']; + createdOn = json['CreatedOn']; + serviceID = json['ServiceID']; + createdBy = json['CreatedBy']; + editedOn = json['EditedOn']; + editedBy = json['EditedBy']; + channel = json['Channel']; + clientRequestID = json['ClientRequestID']; + returnedToQueue = json['ReturnedToQueue']; + pickupDateTime = json['PickupDateTime']; + pickupLocationName = json['PickupLocationName']; + dropoffLocationName = json['DropoffLocationName']; + realRRTHaveTransactions = json['RealRRT_HaveTransactions']; + nearestProjectDescription = json['NearestProjectDescription']; + nearestProjectDescriptionN = json['NearestProjectDescriptionN']; + projectDescription = json['ProjectDescription']; + projectDescriptionN = json['ProjectDescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['PatientID'] = this.patientID; + data['PatientOutSA'] = this.patientOutSA; + data['IsOutPatient'] = this.isOutPatient; + data['ProjectID'] = this.projectID; + data['NearestProjectID'] = this.nearestProjectID; + data['Longitude'] = this.longitude; + data['Latitude'] = this.latitude; + data['AppointmentNo'] = this.appointmentNo; + data['DischargeID'] = this.dischargeID; + data['LineItemNo'] = this.lineItemNo; + data['Status'] = this.status; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['CreatedOn'] = this.createdOn; + data['ServiceID'] = this.serviceID; + data['CreatedBy'] = this.createdBy; + data['EditedOn'] = this.editedOn; + data['EditedBy'] = this.editedBy; + data['Channel'] = this.channel; + data['ClientRequestID'] = this.clientRequestID; + data['ReturnedToQueue'] = this.returnedToQueue; + data['PickupDateTime'] = this.pickupDateTime; + data['PickupLocationName'] = this.pickupLocationName; + data['DropoffLocationName'] = this.dropoffLocationName; + data['RealRRT_HaveTransactions'] = this.realRRTHaveTransactions; + data['NearestProjectDescription'] = this.nearestProjectDescription; + data['NearestProjectDescriptionN'] = this.nearestProjectDescriptionN; + data['ProjectDescription'] = this.projectDescription; + data['ProjectDescriptionN'] = this.projectDescriptionN; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart b/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart new file mode 100644 index 00000000..04b69b98 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart @@ -0,0 +1,68 @@ +class GetOrderDetailByOrderIDRequestModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int presOrderID; + + GetOrderDetailByOrderIDRequestModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.presOrderID}); + + GetOrderDetailByOrderIDRequestModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + presOrderID = json['PresOrderID']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['PresOrderID'] = this.presOrderID; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart b/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart new file mode 100644 index 00000000..6fc31ce8 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart @@ -0,0 +1,52 @@ +class GetOrderDetailByOrderIDResponseModel { + int iD; + int presOrderID; + int hHCServiceID; + int createdBy; + String createdOn; + int editedBy; + String editedOn; + bool isActive; + String description; + String descriptionN; + + GetOrderDetailByOrderIDResponseModel( + {this.iD, + this.presOrderID, + this.hHCServiceID, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.isActive, + this.description, + this.descriptionN}); + + GetOrderDetailByOrderIDResponseModel.fromJson(Map json) { + iD = json['ID']; + presOrderID = json['PresOrderID']; + hHCServiceID = json['HHC_ServiceID']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + isActive = json['IsActive']; + description = json['Description']; + descriptionN = json['DescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['PresOrderID'] = this.presOrderID; + data['HHC_ServiceID'] = this.hHCServiceID; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['IsActive'] = this.isActive; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart b/lib/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart new file mode 100644 index 00000000..6987ee44 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart @@ -0,0 +1,97 @@ +import 'PatientERHHCInsertServicesList.dart'; + +class PatientERInsertPresOrderRequestModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + double latitude; + double longitude; + int createdBy; + int orderServiceID; + List patientERHHCInsertServicesList = List(); + + PatientERInsertPresOrderRequestModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.latitude, + this.longitude, + this.createdBy, + this.orderServiceID, + this.patientERHHCInsertServicesList + }); + + PatientERInsertPresOrderRequestModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + latitude = json['Latitude']; + longitude = json['Longitude']; + createdBy = json['CreatedBy']; + orderServiceID = json['OrderServiceID']; + if (json['PatientER_HHC_InsertServicesList'] != null) { + patientERHHCInsertServicesList = + new List(); + json['PatientER_HHC_InsertServicesList'].forEach((v) { + patientERHHCInsertServicesList + .add(new PatientERHHCInsertServicesList.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['CreatedBy'] = this.createdBy; + data['OrderServiceID'] = this.orderServiceID; + if (this.patientERHHCInsertServicesList != null) { + data['PatientER_HHC_InsertServicesList'] = + this.patientERHHCInsertServicesList.map((v) => v.toJson()).toList(); + } + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart b/lib/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart new file mode 100644 index 00000000..3b0ef151 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart @@ -0,0 +1,80 @@ +class UpdatePresOrderRequestModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int presOrderID; + int presOrderStatus; + int editedBy; + String rejectionReason; + + UpdatePresOrderRequestModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.presOrderID, + this.presOrderStatus, + this.editedBy, + this.rejectionReason}); + + UpdatePresOrderRequestModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + presOrderID = json['PresOrderID']; + presOrderStatus = json['PresOrderStatus']; + editedBy = json['EditedBy']; + rejectionReason = json['RejectionReason']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['PresOrderID'] = this.presOrderID; + data['PresOrderStatus'] = this.presOrderStatus; + data['EditedBy'] = this.editedBy; + data['RejectionReason'] = this.rejectionReason; + return data; + } +} diff --git a/lib/core/model/Allergy/Allergy.dart b/lib/core/model/Allergy/Allergy.dart new file mode 100644 index 00000000..be71c7fe --- /dev/null +++ b/lib/core/model/Allergy/Allergy.dart @@ -0,0 +1,48 @@ +class Allergy { + int patientID; + int allergyDiseaseType; + int allergyDiseaseID; + String description; + dynamic descriptionN; + dynamic remarks; + dynamic avgDoctorRatingList; + dynamic doctorRatingDetailsList; + dynamic notesDoctorRatingList; + + Allergy( + {this.patientID, + this.allergyDiseaseType, + this.allergyDiseaseID, + this.description, + this.descriptionN, + this.remarks, + this.avgDoctorRatingList, + this.doctorRatingDetailsList, + this.notesDoctorRatingList}); + + Allergy.fromJson(Map json) { + patientID = json['PatientID']; + allergyDiseaseType = json['AllergyDiseaseType']; + allergyDiseaseID = json['AllergyDiseaseID']; + description = json['Description']; + descriptionN = json['DescriptionN']; + remarks = json['Remarks']; + avgDoctorRatingList = json['AvgDoctorRatingList']; + doctorRatingDetailsList = json['DoctorRatingDetailsList']; + notesDoctorRatingList = json['NotesDoctorRatingList']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['AllergyDiseaseType'] = this.allergyDiseaseType; + data['AllergyDiseaseID'] = this.allergyDiseaseID; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['Remarks'] = this.remarks; + data['AvgDoctorRatingList'] = this.avgDoctorRatingList; + data['DoctorRatingDetailsList'] = this.doctorRatingDetailsList; + data['NotesDoctorRatingList'] = this.notesDoctorRatingList; + return data; + } +} diff --git a/lib/core/model/ImagesInfo.dart b/lib/core/model/ImagesInfo.dart new file mode 100644 index 00000000..5ab48fb3 --- /dev/null +++ b/lib/core/model/ImagesInfo.dart @@ -0,0 +1,6 @@ +class ImagesInfo { + final String imageAr; + final String imageEn; + + ImagesInfo({this.imageAr, this.imageEn}); +} diff --git a/lib/core/model/active_medications/ActivePrescriptionReport.dart b/lib/core/model/active_medications/ActivePrescriptionReport.dart new file mode 100644 index 00000000..866cb728 --- /dev/null +++ b/lib/core/model/active_medications/ActivePrescriptionReport.dart @@ -0,0 +1,146 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class ActivePrescriptionReport { + dynamic address; + int appointmentNo; + dynamic clinic; + dynamic companyName; + int days; + dynamic doctorName; + int doseDailyQuantity; + String frequency; + int frequencyNumber; + List image; + String imageExtension; + dynamic imageSRCUrl; + String imageString; + dynamic imageThumbUrl; + dynamic isCovered; + String itemDescription; + int itemID; + DateTime orderDate; + int patientID; + dynamic patientName; + dynamic phoneOffice1; + dynamic prescriptionQR; + int prescriptionTimes; + dynamic productImage; + String productImageBase64; + String productImageString; + int projectID; + dynamic projectName; + dynamic remarks; + String route; + String sKU; + int scaleOffset; + DateTime startDate; + + ActivePrescriptionReport( + {this.address, + this.appointmentNo, + this.clinic, + this.companyName, + this.days, + this.doctorName, + this.doseDailyQuantity, + this.frequency, + this.frequencyNumber, + this.image, + this.imageExtension, + this.imageSRCUrl, + this.imageString, + this.imageThumbUrl, + this.isCovered, + this.itemDescription, + this.itemID, + this.orderDate, + this.patientID, + this.patientName, + this.phoneOffice1, + this.prescriptionQR, + this.prescriptionTimes, + this.productImage, + this.productImageBase64, + this.productImageString, + this.projectID, + this.projectName, + this.remarks, + this.route, + this.sKU, + this.scaleOffset, + this.startDate}); + + ActivePrescriptionReport.fromJson(Map json) { + address = json['Address']; + appointmentNo = json['AppointmentNo']; + clinic = json['Clinic']; + companyName = json['CompanyName']; + days = json['Days']; + doctorName = json['DoctorName']; + doseDailyQuantity = json['DoseDailyQuantity']; + frequency = json['Frequency']; + frequencyNumber = json['FrequencyNumber']; + image = json['Image'].cast(); + imageExtension = json['ImageExtension']; + imageSRCUrl = json['ImageSRCUrl']; + imageString = json['ImageString']; + imageThumbUrl = json['ImageThumbUrl']; + isCovered = json['IsCovered']; + itemDescription = json['ItemDescription']; + itemID = json['ItemID']; + orderDate = DateUtil.convertStringToDate(json['OrderDate']); + patientID = json['PatientID']; + patientName = json['PatientName']; + phoneOffice1 = json['PhoneOffice1']; + prescriptionQR = json['PrescriptionQR']; + prescriptionTimes = json['PrescriptionTimes']; + productImage = json['ProductImage']; + productImageBase64 = json['ProductImageBase64']; + productImageString = json['ProductImageString']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + remarks = json['Remarks']; + route = json['Route']; + sKU = json['SKU']; + scaleOffset = json['ScaleOffset']; + startDate = DateUtil.convertStringToDate(json['StartDate']); + } + + Map toJson() { + final Map data = new Map(); + data['Address'] = this.address; + data['AppointmentNo'] = this.appointmentNo; + data['Clinic'] = this.clinic; + data['CompanyName'] = this.companyName; + data['Days'] = this.days; + data['DoctorName'] = this.doctorName; + data['DoseDailyQuantity'] = this.doseDailyQuantity; + data['Frequency'] = this.frequency; + data['FrequencyNumber'] = this.frequencyNumber; + data['Image'] = this.image; + data['ImageExtension'] = this.imageExtension; + data['ImageSRCUrl'] = this.imageSRCUrl; + data['ImageString'] = this.imageString; + data['ImageThumbUrl'] = this.imageThumbUrl; + data['IsCovered'] = this.isCovered; + data['ItemDescription'] = this.itemDescription; + data['ItemID'] = this.itemID; + data['OrderDate'] = this.orderDate; + data['PatientID'] = this.patientID; + data['PatientName'] = this.patientName; + data['PhoneOffice1'] = this.phoneOffice1; + data['PrescriptionQR'] = this.prescriptionQR; + data['PrescriptionTimes'] = this.prescriptionTimes; + data['ProductImage'] = this.productImage; + data['ProductImageBase64'] = this.productImageBase64; + data['ProductImageString'] = this.productImageString; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['Remarks'] = this.remarks; + data['Route'] = this.route; + data['SKU'] = this.sKU; + data['ScaleOffset'] = this.scaleOffset; + data['StartDate'] = this.startDate; + return data; + } +} diff --git a/lib/core/model/ask_doctor/AskDoctorReqTypes.dart b/lib/core/model/ask_doctor/AskDoctorReqTypes.dart new file mode 100644 index 00000000..b306f97b --- /dev/null +++ b/lib/core/model/ask_doctor/AskDoctorReqTypes.dart @@ -0,0 +1,92 @@ +class AskDoctorReqTypes { + dynamic setupID; + int parameterGroup; + int parameterType; + int parameterCode; + String description; + dynamic descriptionN; + dynamic alias; + dynamic aliasN; + dynamic prefix; + dynamic suffix; + dynamic isColorCodingRequired; + dynamic backColor; + dynamic foreColor; + bool isBuiltIn; + bool isActive; + int createdBy; + String createdOn; + dynamic editedBy; + dynamic editedOn; + dynamic rowVer; + + AskDoctorReqTypes( + {this.setupID, + this.parameterGroup, + this.parameterType, + this.parameterCode, + this.description, + this.descriptionN, + this.alias, + this.aliasN, + this.prefix, + this.suffix, + this.isColorCodingRequired, + this.backColor, + this.foreColor, + this.isBuiltIn, + this.isActive, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.rowVer}); + + AskDoctorReqTypes.fromJson(Map json) { + setupID = json['SetupID']; + parameterGroup = json['ParameterGroup']; + parameterType = json['ParameterType']; + parameterCode = json['ParameterCode']; + description = json['Description']; + descriptionN = json['DescriptionN']; + alias = json['Alias']; + aliasN = json['AliasN']; + prefix = json['Prefix']; + suffix = json['Suffix']; + isColorCodingRequired = json['IsColorCodingRequired']; + backColor = json['BackColor']; + foreColor = json['ForeColor']; + isBuiltIn = json['IsBuiltIn']; + isActive = json['IsActive']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + rowVer = json['RowVer']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ParameterGroup'] = this.parameterGroup; + data['ParameterType'] = this.parameterType; + data['ParameterCode'] = this.parameterCode; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['Alias'] = this.alias; + data['AliasN'] = this.aliasN; + data['Prefix'] = this.prefix; + data['Suffix'] = this.suffix; + data['IsColorCodingRequired'] = this.isColorCodingRequired; + data['BackColor'] = this.backColor; + data['ForeColor'] = this.foreColor; + data['IsBuiltIn'] = this.isBuiltIn; + data['IsActive'] = this.isActive; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['RowVer'] = this.rowVer; + return data; + } +} diff --git a/lib/core/model/ask_doctor/DoctorResponse.dart b/lib/core/model/ask_doctor/DoctorResponse.dart new file mode 100644 index 00000000..0dcd41b0 --- /dev/null +++ b/lib/core/model/ask_doctor/DoctorResponse.dart @@ -0,0 +1,76 @@ +class DoctorResponse { + int projectID; + int transactionNo; + int patientID; + int doctorID; + int requestType; + String requestTypeDescription; + dynamic requestTypeDescriptionN; + int status; + String remarks; + String createdOn; + dynamic readStatus; + String doctorName; + bool isDoctorRespond; + bool isPatientRead; + List transactions; + + DoctorResponse( + {this.projectID, + this.transactionNo, + this.patientID, + this.doctorID, + this.requestType, + this.requestTypeDescription, + this.requestTypeDescriptionN, + this.status, + this.remarks, + this.createdOn, + this.readStatus, + this.doctorName, + this.isDoctorRespond, + this.isPatientRead, + this.transactions}); + + DoctorResponse.fromJson(Map json) { + projectID = json['ProjectID']; + transactionNo = json['TransactionNo']; + patientID = json['PatientID']; + doctorID = json['DoctorID']; + requestType = json['RequestType']; + requestTypeDescription = json['RequestTypeDescription']; + requestTypeDescriptionN = json['RequestTypeDescriptionN']; + status = json['Status']; + remarks = json['Remarks']; + createdOn = json['CreatedOn']; + readStatus = json['ReadStatus']; + doctorName = json['DoctorName']; + isDoctorRespond = json['IsDoctorRespond']; + isPatientRead = json['IsPatientRead']; + if (json['Transactions'] != null) { + transactions = json['Transactions']; + } + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['TransactionNo'] = this.transactionNo; + data['PatientID'] = this.patientID; + data['DoctorID'] = this.doctorID; + data['RequestType'] = this.requestType; + data['RequestTypeDescription'] = this.requestTypeDescription; + data['RequestTypeDescriptionN'] = this.requestTypeDescriptionN; + data['Status'] = this.status; + data['Remarks'] = this.remarks; + data['CreatedOn'] = this.createdOn; + data['ReadStatus'] = this.readStatus; + data['DoctorName'] = this.doctorName; + data['IsDoctorRespond'] = this.isDoctorRespond; + data['IsPatientRead'] = this.isPatientRead; + if (this.transactions != null) { + data['Transactions'] = this.transactions.map((v) => v.toJson()).toList(); + } + return data; + } +} diff --git a/lib/core/model/blooddonation/blood_groub_details.dart b/lib/core/model/blooddonation/blood_groub_details.dart new file mode 100644 index 00000000..34dcafe0 --- /dev/null +++ b/lib/core/model/blooddonation/blood_groub_details.dart @@ -0,0 +1,77 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +class List_BloodGroupDetailsModel { + int iD; + int patientID; + int patientType; + bool patientOutSA; + int zipCode; + String cellNumber; + String cityCode; + String city; + int gender; + String bloodGroup; + String nationalID; + bool isActive; + int createdBy; + DateTime createdOn; + int editedBy; + DateTime editedOn; + + List_BloodGroupDetailsModel( + {this.iD, + this.patientID, + this.patientType, + this.patientOutSA, + this.zipCode, + this.cellNumber, + this.cityCode, + this.city, + this.gender, + this.bloodGroup, + this.nationalID, + this.isActive, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn}); + + List_BloodGroupDetailsModel.fromJson(Map json) { + iD = json['ID']; + patientID = json['PatientID']; + patientType = json['PatientType']; + patientOutSA = json['PatientOutSA']; + zipCode = json['ZipCode']; + cellNumber = json['CellNumber']; + cityCode = json['CityCode']; + city = json['City']; + gender = json['Gender']; + bloodGroup = json['BloodGroup']; + nationalID = json['NationalID']; + isActive = json['IsActive']; + createdBy = json['CreatedBy']; + createdOn = DateUtil.convertStringToDate(json['CreatedOn']);// json['CreatedOn']; + editedBy = json['EditedBy']; + editedOn = DateUtil.convertStringToDate(json['EditedOn']);//json['EditedOn']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['PatientID'] = this.patientID; + data['PatientType'] = this.patientType; + data['PatientOutSA'] = this.patientOutSA; + data['ZipCode'] = this.zipCode; + data['CellNumber'] = this.cellNumber; + data['CityCode'] = this.cityCode; + data['City'] = this.city; + data['Gender'] = this.gender; + data['BloodGroup'] = this.bloodGroup; + data['NationalID'] = this.nationalID; + data['IsActive'] = this.isActive; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/blooddonation/get_all_cities.dart b/lib/core/model/blooddonation/get_all_cities.dart new file mode 100644 index 00000000..3d685bb6 --- /dev/null +++ b/lib/core/model/blooddonation/get_all_cities.dart @@ -0,0 +1,21 @@ +class CitiesModel { + int iD; + String description; + String descriptionN; + + CitiesModel({this.iD, this.description, this.descriptionN}); + + CitiesModel.fromJson(Map json) { + iD = json['ID']; + description = json['Description']; + descriptionN = json['DescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/childvaccines/List_BabyInformationModel.dart b/lib/core/model/childvaccines/List_BabyInformationModel.dart new file mode 100644 index 00000000..0711b8a2 --- /dev/null +++ b/lib/core/model/childvaccines/List_BabyInformationModel.dart @@ -0,0 +1,45 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +class List_BabyInformationModel { + int alertBy; + int babyID; + String babyName; + DateTime dOB; + int gender; + String genderDescription; + int patientID; + int userID; + + List_BabyInformationModel( + {this.alertBy, + this.babyID, + this.babyName, + this.dOB, + this.gender, + this.genderDescription, + this.patientID, + this.userID}); + + List_BabyInformationModel.fromJson(Map json) { + alertBy = json['AlertBy']; + babyID = json['BabyID']; + babyName = json['BabyName']; + dOB = DateUtil.convertStringToDate(json['DOB']); + gender = json['Gender']; + genderDescription = json['GenderDescription']; + patientID = json['PatientID']; + userID = json['UserID']; + } + + Map toJson() { + final Map data = new Map(); + data['AlertBy'] = this.alertBy; + data['BabyID'] = this.babyID; + data['BabyName'] = this.babyName; + data['DOB'] = this.dOB; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['PatientID'] = this.patientID; + data['UserID'] = this.userID; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/childvaccines/add_newchild_model.dart b/lib/core/model/childvaccines/add_newchild_model.dart new file mode 100644 index 00000000..9bbfe6ad --- /dev/null +++ b/lib/core/model/childvaccines/add_newchild_model.dart @@ -0,0 +1,100 @@ +class CreateNewBaby { + String babyName; + String gender; + String strDOB; + int editedBy; + int createdBy; + bool tempValue; + int userID; + bool isLogin; + int alertBy; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + CreateNewBaby( + {this.babyName, + this.gender, + this.strDOB, + this.editedBy, + this.createdBy, + this.tempValue, + this.userID, + this.isLogin, + this.alertBy, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + CreateNewBaby.fromJson(Map json) { + babyName = json['BabyName']; + gender = json['Gender']; + strDOB = json['StrDOB']; + editedBy = json['EditedBy']; + createdBy = json['CreatedBy']; + tempValue = json['TempValue']; + userID = json['UserID']; + isLogin = json['IsLogin']; + alertBy = json['AlertBy']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['BabyName'] = this.babyName; + data['Gender'] = this.gender; + data['StrDOB'] = this.strDOB; + data['EditedBy'] = this.editedBy; + data['CreatedBy'] = this.createdBy; + data['TempValue'] = this.tempValue; + data['UserID'] = this.userID; + data['IsLogin'] = this.isLogin; + data['AlertBy'] = this.alertBy; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/childvaccines/create_new_user_model.dart b/lib/core/model/childvaccines/create_new_user_model.dart new file mode 100644 index 00000000..980567e2 --- /dev/null +++ b/lib/core/model/childvaccines/create_new_user_model.dart @@ -0,0 +1,165 @@ +class CreateNewUser_New { + Null date; + int languageID; + int serviceName; + Null time; + Null androidLink; + Null authenticationTokenID; + Null data; + bool dataw; + int dietType; + Null errorCode; + Null errorEndUserMessage; + Null errorEndUserMessageN; + Null errorMessage; + int errorType; + int foodCategory; + Null iOSLink; + bool isAuthenticated; + int mealOrderStatus; + int mealType; + int messageStatus; + int numberOfResultRecords; + Null patientBlodType; + Null successMsg; + Null successMsgN; + Null htmlResult; + bool isHMGPatient; + bool isRegister; + bool isSendSMS; + Null listBabyInformationModel; + Null listBabyNeedReminderModel; + Null listCreateVaccinationTableModel; + Null listHisPatientModel; + Null listUserInformationModel; + Null listUserInformationModelNew; + Null listVaccinationTableModel; + Null tokinID; + int userID; + Null verificationCode; + + CreateNewUser_New( + {this.date, + this.languageID, + this.serviceName, + this.time, + this.androidLink, + this.authenticationTokenID, + this.data, + this.dataw, + this.dietType, + this.errorCode, + this.errorEndUserMessage, + this.errorEndUserMessageN, + this.errorMessage, + this.errorType, + this.foodCategory, + this.iOSLink, + this.isAuthenticated, + this.mealOrderStatus, + this.mealType, + this.messageStatus, + this.numberOfResultRecords, + this.patientBlodType, + this.successMsg, + this.successMsgN, + this.htmlResult, + this.isHMGPatient, + this.isRegister, + this.isSendSMS, + this.listBabyInformationModel, + this.listBabyNeedReminderModel, + this.listCreateVaccinationTableModel, + this.listHisPatientModel, + this.listUserInformationModel, + this.listUserInformationModelNew, + this.listVaccinationTableModel, + this.tokinID, + this.userID, + this.verificationCode}); + + CreateNewUser_New.fromJson(Map json) { + date = json['Date']; + languageID = json['LanguageID']; + serviceName = json['ServiceName']; + time = json['Time']; + androidLink = json['AndroidLink']; + authenticationTokenID = json['AuthenticationTokenID']; + data = json['Data']; + dataw = json['Dataw']; + dietType = json['DietType']; + errorCode = json['ErrorCode']; + errorEndUserMessage = json['ErrorEndUserMessage']; + errorEndUserMessageN = json['ErrorEndUserMessageN']; + errorMessage = json['ErrorMessage']; + errorType = json['ErrorType']; + foodCategory = json['FoodCategory']; + iOSLink = json['IOSLink']; + isAuthenticated = json['IsAuthenticated']; + mealOrderStatus = json['MealOrderStatus']; + mealType = json['MealType']; + messageStatus = json['MessageStatus']; + numberOfResultRecords = json['NumberOfResultRecords']; + patientBlodType = json['PatientBlodType']; + successMsg = json['SuccessMsg']; + successMsgN = json['SuccessMsgN']; + htmlResult = json['HtmlResult']; + isHMGPatient = json['IsHMGPatient']; + isRegister = json['IsRegister']; + isSendSMS = json['IsSendSMS']; + listBabyInformationModel = json['List_BabyInformationModel']; + listBabyNeedReminderModel = json['List_BabyNeedReminderModel']; + listCreateVaccinationTableModel = json['List_CreateVaccinationTableModel']; + listHisPatientModel = json['List_His_PatientModel']; + listUserInformationModel = json['List_UserInformationModel']; + listUserInformationModelNew = json['List_UserInformationModel_New']; + listVaccinationTableModel = json['List_VaccinationTableModel']; + tokinID = json['TokinID']; + userID = json['UserID']; + verificationCode = json['VerificationCode']; + } + + Map toJson() { + final Map data = new Map(); + data['Date'] = this.date; + data['LanguageID'] = this.languageID; + data['ServiceName'] = this.serviceName; + data['Time'] = this.time; + data['AndroidLink'] = this.androidLink; + data['AuthenticationTokenID'] = this.authenticationTokenID; + data['Data'] = this.data; + data['Dataw'] = this.dataw; + data['DietType'] = this.dietType; + data['ErrorCode'] = this.errorCode; + data['ErrorEndUserMessage'] = this.errorEndUserMessage; + data['ErrorEndUserMessageN'] = this.errorEndUserMessageN; + data['ErrorMessage'] = this.errorMessage; + data['ErrorType'] = this.errorType; + data['FoodCategory'] = this.foodCategory; + data['IOSLink'] = this.iOSLink; + data['IsAuthenticated'] = this.isAuthenticated; + data['MealOrderStatus'] = this.mealOrderStatus; + data['MealType'] = this.mealType; + data['MessageStatus'] = this.messageStatus; + data['NumberOfResultRecords'] = this.numberOfResultRecords; + data['PatientBlodType'] = this.patientBlodType; + data['SuccessMsg'] = this.successMsg; + data['SuccessMsgN'] = this.successMsgN; + data['HtmlResult'] = this.htmlResult; + data['IsHMGPatient'] = this.isHMGPatient; + data['IsRegister'] = this.isRegister; + data['IsSendSMS'] = this.isSendSMS; + data['List_BabyInformationModel'] = this.listBabyInformationModel; + data['List_BabyNeedReminderModel'] = this.listBabyNeedReminderModel; + data['List_CreateVaccinationTableModel'] = + this.listCreateVaccinationTableModel; + data['List_His_PatientModel'] = this.listHisPatientModel; + data['List_UserInformationModel'] = this.listUserInformationModel; + data['List_UserInformationModel_New'] = this.listUserInformationModelNew; + data['List_VaccinationTableModel'] = this.listVaccinationTableModel; + data['TokinID'] = this.tokinID; + data['UserID'] = this.userID; + data['VerificationCode'] = this.verificationCode; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/childvaccines/create_vaccination_table.dart b/lib/core/model/childvaccines/create_vaccination_table.dart new file mode 100644 index 00000000..d39f2a64 --- /dev/null +++ b/lib/core/model/childvaccines/create_vaccination_table.dart @@ -0,0 +1,25 @@ +class CreateVaccinationTable { + String givenAt; + String status; + String vaccinesDescription; + String visit; + + CreateVaccinationTable( + {this.givenAt, this.status, this.vaccinesDescription, this.visit}); + + CreateVaccinationTable.fromJson(Map json) { + givenAt = json['GivenAt']; + status = json['Status']; + vaccinesDescription = json['VaccinesDescription']; + visit = json['Visit']; + } + + Map toJson() { + final Map data = new Map(); + data['GivenAt'] = this.givenAt; + data['Status'] = this.status; + data['VaccinesDescription'] = this.vaccinesDescription; + data['Visit'] = this.visit; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/childvaccines/delete_baby_model.dart b/lib/core/model/childvaccines/delete_baby_model.dart new file mode 100644 index 00000000..9274b1e8 --- /dev/null +++ b/lib/core/model/childvaccines/delete_baby_model.dart @@ -0,0 +1,76 @@ +class DeleteBaby { + bool isLogin; + int babyID; + int editedBy; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + DeleteBaby( + {this.isLogin, + this.babyID, + this.editedBy, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + DeleteBaby.fromJson(Map json) { + isLogin = json['IsLogin']; + babyID = json['BabyID']; + editedBy = json['EditedBy']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['IsLogin'] = this.isLogin; + data['BabyID'] = this.babyID; + data['EditedBy'] = this.editedBy; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/childvaccines/get_vacainations_itemsmodel.dart b/lib/core/model/childvaccines/get_vacainations_itemsmodel.dart new file mode 100644 index 00000000..14891852 --- /dev/null +++ b/lib/core/model/childvaccines/get_vacainations_itemsmodel.dart @@ -0,0 +1,18 @@ +class GET_VACCINATIONS_ITEMSMODEL { + String dESCRIPTION; + String iTEMCODE; + + GET_VACCINATIONS_ITEMSMODEL({this.dESCRIPTION, this.iTEMCODE}); + + GET_VACCINATIONS_ITEMSMODEL.fromJson(Map json) { + dESCRIPTION = json['DESCRIPTION']; + iTEMCODE = json['ITEM_CODE']; + } + + Map toJson() { + final Map data = new Map(); + data['DESCRIPTION'] = this.dESCRIPTION; + data['ITEM_CODE'] = this.iTEMCODE; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/childvaccines/user_information_model.dart b/lib/core/model/childvaccines/user_information_model.dart new file mode 100644 index 00000000..9e1687d3 --- /dev/null +++ b/lib/core/model/childvaccines/user_information_model.dart @@ -0,0 +1,48 @@ +class List_UserInformationModel { + int userID; + String mobileNumber; + String nationalID; + String emailAddress; + int patientID; + int patientType; + bool patientOutSA; + int createdBy; + int editedBy; + + List_UserInformationModel( + {this.userID, + this.mobileNumber, + this.nationalID, + this.emailAddress, + this.patientID, + this.patientType, + this.patientOutSA, + this.createdBy, + this.editedBy}); + + List_UserInformationModel.fromJson(Map json) { + userID = json['UserID']; + mobileNumber = json['MobileNumber']; + nationalID = json['NationalID']; + emailAddress = json['EmailAddress']; + patientID = json['PatientID']; + patientType = json['PatientType']; + patientOutSA = json['PatientOutSA']; + createdBy = json['CreatedBy']; + editedBy = json['EditedBy']; + } + + Map toJson() { + final Map data = new Map(); + data['UserID'] = this.userID; + data['MobileNumber'] = this.mobileNumber; + data['NationalID'] = this.nationalID; + data['EmailAddress'] = this.emailAddress; + data['PatientID'] = this.patientID; + data['PatientType'] = this.patientType; + data['PatientOutSA'] = this.patientOutSA; + data['CreatedBy'] = this.createdBy; + data['EditedBy'] = this.editedBy; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/contactus/get_hmg_locations.dart b/lib/core/model/contactus/get_hmg_locations.dart new file mode 100644 index 00000000..89d26951 --- /dev/null +++ b/lib/core/model/contactus/get_hmg_locations.dart @@ -0,0 +1,80 @@ +class GetHMGLocationsModel { + dynamic cityID; + String cityName; + dynamic cityNameN; + dynamic distanceInKilometers; + bool isActive; + String latitude; + int locationID; + String locationName; + dynamic locationNameN; + dynamic locationType; + String longitude; + int pharmacyLocationID; + String phoneNumber; + int projectID; + String projectImageURL; + int setupID; + dynamic sortOrder; + + GetHMGLocationsModel( + {this.cityID, + this.cityName, + this.cityNameN, + this.distanceInKilometers, + this.isActive, + this.latitude, + this.locationID, + this.locationName, + this.locationNameN, + this.locationType, + this.longitude, + this.pharmacyLocationID, + this.phoneNumber, + this.projectID, + this.projectImageURL, + this.setupID, + this.sortOrder}); + + GetHMGLocationsModel.fromJson(Map json) { + cityID = json['CityID']; + cityName = json['CityName']; + cityNameN = json['CityNameN']; + distanceInKilometers = json['DistanceInKilometers']; + isActive = json['IsActive']; + latitude = json['Latitude']; + locationID = json['LocationID']; + locationName = json['LocationName']; + locationNameN = json['LocationNameN']; + locationType = json['LocationType']; + longitude = json['Longitude']; + pharmacyLocationID = json['PharmacyLocationID']; + phoneNumber = json['PhoneNumber']; + projectID = json['ProjectID']; + projectImageURL = json['ProjectImageURL']; + setupID = json['SetupID']; + sortOrder = json['SortOrder']; + } + + Map toJson() { + final Map data = new Map(); + data['CityID'] = this.cityID; + data['CityName'] = this.cityName; + data['CityNameN'] = this.cityNameN; + data['DistanceInKilometers'] = this.distanceInKilometers; + data['IsActive'] = this.isActive; + data['Latitude'] = this.latitude; + data['LocationID'] = this.locationID; + data['LocationName'] = this.locationName; + data['LocationNameN'] = this.locationNameN; + data['LocationType'] = this.locationType; + data['Longitude'] = this.longitude; + data['PharmacyLocationID'] = this.pharmacyLocationID; + data['PhoneNumber'] = this.phoneNumber; + data['ProjectID'] = this.projectID; + data['ProjectImageURL'] = this.projectImageURL; + data['SetupID'] = this.setupID; + data['SortOrder'] = this.sortOrder; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/contactus/get_patientI_cprojects.dart b/lib/core/model/contactus/get_patientI_cprojects.dart new file mode 100644 index 00000000..e9a6b712 --- /dev/null +++ b/lib/core/model/contactus/get_patientI_cprojects.dart @@ -0,0 +1,54 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class GetPatientICProjectsModel { + int id; + String projectName; + String projectNameN; + String value; + dynamic languageId; + DateTime createdOn; + String createdBy; + dynamic editedOn; + dynamic editedBy; + bool isActive; + + GetPatientICProjectsModel( + {this.id, + this.projectName, + this.projectNameN, + this.value, + this.languageId, + this.createdOn, + this.createdBy, + this.editedOn, + this.editedBy, + this.isActive}); + + GetPatientICProjectsModel.fromJson(Map json) { + id = json['id']; + projectName = json['ProjectName']; + projectNameN = json['ProjectNameN']; + value = json['Value']; + languageId = json['LanguageId']; + createdOn = DateUtil.convertStringToDate(json['CreatedOn']); + createdBy = json['CreatedBy']; + editedOn = json['EditedOn']; + editedBy = json['EditedBy']; + isActive = json['IsActive']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['ProjectName'] = this.projectName; + data['ProjectNameN'] = this.projectNameN; + data['Value'] = this.value; + data['LanguageId'] = this.languageId; + data['CreatedOn'] = this.createdOn; + data['CreatedBy'] = this.createdBy; + data['EditedOn'] = this.editedOn; + data['EditedBy'] = this.editedBy; + data['IsActive'] = this.isActive; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/doctor/doctor_profile.dart b/lib/core/model/doctor/doctor_profile.dart new file mode 100644 index 00000000..9e222e5a --- /dev/null +++ b/lib/core/model/doctor/doctor_profile.dart @@ -0,0 +1,176 @@ +class DoctorProfile { + int doctorID; + String doctorName; + Null doctorNameN; + int clinicID; + String clinicDescription; + Null clinicDescriptionN; + Null licenseExpiry; + int employmentType; + Null setupID; + int projectID; + String projectName; + String nationalityID; + String nationalityName; + Null nationalityNameN; + int gender; + String genderDescription; + Null genderDescriptionN; + Null doctorTitle; + Null projectNameN; + bool isAllowWaitList; + String titleDescription; + Null titleDescriptionN; + Null isRegistered; + Null isDoctorDummy; + bool isActive; + Null isDoctorAppointmentDisplayed; + bool doctorClinicActive; + Null isbookingAllowed; + String doctorCases; + Null doctorPicture; + String doctorProfileInfo; + List specialty; + int actualDoctorRate; + String doctorImageURL; + int doctorRate; + String doctorTitleForProfile; + bool isAppointmentAllowed; + String nationalityFlagURL; + int noOfPatientsRate; + String qR; + int serviceID; + + DoctorProfile( + {this.doctorID, + this.doctorName, + this.doctorNameN, + this.clinicID, + this.clinicDescription, + this.clinicDescriptionN, + this.licenseExpiry, + this.employmentType, + this.setupID, + this.projectID, + this.projectName, + this.nationalityID, + this.nationalityName, + this.nationalityNameN, + this.gender, + this.genderDescription, + this.genderDescriptionN, + this.doctorTitle, + this.projectNameN, + this.isAllowWaitList, + this.titleDescription, + this.titleDescriptionN, + this.isRegistered, + this.isDoctorDummy, + this.isActive, + this.isDoctorAppointmentDisplayed, + this.doctorClinicActive, + this.isbookingAllowed, + this.doctorCases, + this.doctorPicture, + this.doctorProfileInfo, + this.specialty, + this.actualDoctorRate, + this.doctorImageURL, + this.doctorRate, + this.doctorTitleForProfile, + this.isAppointmentAllowed, + this.nationalityFlagURL, + this.noOfPatientsRate, + this.qR, + this.serviceID}); + + DoctorProfile.fromJson(Map json) { + doctorID = json['DoctorID']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + clinicID = json['ClinicID']; + clinicDescription = json['ClinicDescription']; + clinicDescriptionN = json['ClinicDescriptionN']; + licenseExpiry = json['LicenseExpiry']; + employmentType = json['EmploymentType']; + setupID = json['SetupID']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + nationalityID = json['NationalityID']; + nationalityName = json['NationalityName']; + nationalityNameN = json['NationalityNameN']; + gender = json['Gender']; + genderDescription = json['Gender_Description']; + genderDescriptionN = json['Gender_DescriptionN']; + doctorTitle = json['DoctorTitle']; + projectNameN = json['ProjectNameN']; + isAllowWaitList = json['IsAllowWaitList']; + titleDescription = json['Title_Description']; + titleDescriptionN = json['Title_DescriptionN']; + isRegistered = json['IsRegistered']; + isDoctorDummy = json['IsDoctorDummy']; + isActive = json['IsActive']; + isDoctorAppointmentDisplayed = json['IsDoctorAppointmentDisplayed']; + doctorClinicActive = json['DoctorClinicActive']; + isbookingAllowed = json['IsbookingAllowed']; + doctorCases = json['DoctorCases']; + doctorPicture = json['DoctorPicture']; + doctorProfileInfo = json['DoctorProfileInfo']; + specialty = json['Specialty'].cast(); + actualDoctorRate = json['ActualDoctorRate']; + doctorImageURL = json['DoctorImageURL']; + doctorRate = json['DoctorRate']; + doctorTitleForProfile = json['DoctorTitleForProfile']; + isAppointmentAllowed = json['IsAppointmentAllowed']; + nationalityFlagURL = json['NationalityFlagURL']; + noOfPatientsRate = json['NoOfPatientsRate']; + qR = json['QR']; + serviceID = json['ServiceID']; + } + + Map toJson() { + final Map data = new Map(); + data['DoctorID'] = this.doctorID; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['ClinicID'] = this.clinicID; + data['ClinicDescription'] = this.clinicDescription; + data['ClinicDescriptionN'] = this.clinicDescriptionN; + data['LicenseExpiry'] = this.licenseExpiry; + data['EmploymentType'] = this.employmentType; + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['NationalityID'] = this.nationalityID; + data['NationalityName'] = this.nationalityName; + data['NationalityNameN'] = this.nationalityNameN; + data['Gender'] = this.gender; + data['Gender_Description'] = this.genderDescription; + data['Gender_DescriptionN'] = this.genderDescriptionN; + data['DoctorTitle'] = this.doctorTitle; + data['ProjectNameN'] = this.projectNameN; + data['IsAllowWaitList'] = this.isAllowWaitList; + data['Title_Description'] = this.titleDescription; + data['Title_DescriptionN'] = this.titleDescriptionN; + data['IsRegistered'] = this.isRegistered; + data['IsDoctorDummy'] = this.isDoctorDummy; + data['IsActive'] = this.isActive; + data['IsDoctorAppointmentDisplayed'] = this.isDoctorAppointmentDisplayed; + data['DoctorClinicActive'] = this.doctorClinicActive; + data['IsbookingAllowed'] = this.isbookingAllowed; + data['DoctorCases'] = this.doctorCases; + data['DoctorPicture'] = this.doctorPicture; + data['DoctorProfileInfo'] = this.doctorProfileInfo; + data['Specialty'] = this.specialty; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitleForProfile'] = this.doctorTitleForProfile; + data['IsAppointmentAllowed'] = this.isAppointmentAllowed; + data['NationalityFlagURL'] = this.nationalityFlagURL; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['QR'] = this.qR; + data['ServiceID'] = this.serviceID; + return data; + } +} diff --git a/lib/core/model/doctor/doctor_rating.dart b/lib/core/model/doctor/doctor_rating.dart new file mode 100644 index 00000000..f02e052b --- /dev/null +++ b/lib/core/model/doctor/doctor_rating.dart @@ -0,0 +1,32 @@ +class DoctorRating { + Null projectID; + Null clinicID; + int doctorID; + int patientNumber; + int doctorRate; + + DoctorRating( + {this.projectID, + this.clinicID, + this.doctorID, + this.patientNumber, + this.doctorRate}); + + DoctorRating.fromJson(Map json) { + projectID = json['ProjectID']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + patientNumber = json['PatientNumber']; + doctorRate = json['DoctorRate']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['PatientNumber'] = this.patientNumber; + data['DoctorRate'] = this.doctorRate; + return data; + } +} diff --git a/lib/core/model/doctor/patient_doctor_appointment.dart b/lib/core/model/doctor/patient_doctor_appointment.dart new file mode 100644 index 00000000..265561cd --- /dev/null +++ b/lib/core/model/doctor/patient_doctor_appointment.dart @@ -0,0 +1,325 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class PatientDoctorAppointment { + String setupID; + int projectID; + int appointmentNo; + DateTime appointmentDate; + String appointmentDateN; + bool appointmentType; + DateTime bookDate; + bool patientType; + int patientID; + int clinicID; + int doctorID; + DateTime endDate; + String startTime; + String endTime; + bool status; + bool visitType; + String visitFor; + String patientStatusType; + String actualVisitStartTime; + String actualVisitEndTime; + bool isReminderActivated; + String reminderDisplayInterval; + String reminderDisplayIntervalUnit; + String mainAppointmentNo; + String notes; + int companyID; + String dHCCPatApptRef; + String bookedBy; + DateTime bookedOn; + String confirmedBy; + DateTime confirmedOn; + String arrivalChangedBy; + DateTime arrivedOn; + String rescheduledBy; + String rescheduledOn; + String mRStatus; + String mRSentBy; + String mRSentOn; + String mRReceiptBy; + String mRReceiptOn; + String isDocumentScanned; + String documentScanDateTime; + String documentScannedUser; + String editedBy; + String editedOn; + String isRecordedByNurse; + String isCheckedByDoctor; + String isVisitClosed; + String isRecurring; + String isPersonallyConfirmed; + String confirmationBy; + String relationId; + int appointmentDays; + int isActive; + int actualDoctorRate; + String clinicName; + String doctorCases; + String doctorImageURL; + String doctorInfo; + String doctorName; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isAppointmentAllowed; + bool isDoctorAllowVedioCall; + String nationalityFlagURL; + String nationalityID; + String nationalityName; + int noOfPatientsRate; + String projectName; + String qR; + List speciality; + + PatientDoctorAppointment( + {this.setupID, + this.projectID, + this.appointmentNo, + this.appointmentDate, + this.appointmentDateN, + this.appointmentType, + this.bookDate, + this.patientType, + this.patientID, + this.clinicID, + this.doctorID, + this.endDate, + this.startTime, + this.endTime, + this.status, + this.visitType, + this.visitFor, + this.patientStatusType, + this.actualVisitStartTime, + this.actualVisitEndTime, + this.isReminderActivated, + this.reminderDisplayInterval, + this.reminderDisplayIntervalUnit, + this.mainAppointmentNo, + this.notes, + this.companyID, + this.dHCCPatApptRef, + this.bookedBy, + this.bookedOn, + this.confirmedBy, + this.confirmedOn, + this.arrivalChangedBy, + this.arrivedOn, + this.rescheduledBy, + this.rescheduledOn, + this.mRStatus, + this.mRSentBy, + this.mRSentOn, + this.mRReceiptBy, + this.mRReceiptOn, + this.isDocumentScanned, + this.documentScanDateTime, + this.documentScannedUser, + this.editedBy, + this.editedOn, + this.isRecordedByNurse, + this.isCheckedByDoctor, + this.isVisitClosed, + this.isRecurring, + this.isPersonallyConfirmed, + this.confirmationBy, + this.relationId, + this.appointmentDays, + this.isActive, + this.actualDoctorRate, + this.clinicName, + this.doctorCases, + this.doctorImageURL, + this.doctorInfo, + this.doctorName, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isAppointmentAllowed, + this.isDoctorAllowVedioCall, + this.nationalityFlagURL, + this.nationalityID, + this.nationalityName, + this.noOfPatientsRate, + this.projectName, + this.qR, + this.speciality}); + + PatientDoctorAppointment.fromJson(Map json) { + try { + setupID = json['SetupID']; + projectID = json['ProjectID']; + appointmentNo = json['AppointmentNo']; + appointmentDate = DateUtil.convertStringToDate(json['AppointmentDate']); + appointmentDateN = json['AppointmentDateN']; + appointmentType = json['AppointmentType']; + bookDate = DateUtil.convertStringToDate(json['BookDate']); + patientType = json['PatientType']; + patientID = json['PatientID']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + endDate = DateUtil.convertStringToDate(json['EndDate']); + startTime = json['StartTime']; + endTime = json['EndTime']; + status = json['Status']; + visitType = json['VisitType']; + visitFor = json['VisitFor']; + patientStatusType = json['PatientStatusType']; + actualVisitStartTime = json['ActualVisitStartTime']; + actualVisitEndTime = json['ActualVisitEndTime']; + isReminderActivated = json['IsReminderActivated']; + reminderDisplayInterval = json['ReminderDisplayInterval']; + reminderDisplayIntervalUnit = json['ReminderDisplayIntervalUnit']; + mainAppointmentNo = json['MainAppointmentNo']; + notes = json['Notes']; + companyID = json['CompanyID']; + dHCCPatApptRef = json['DHCCPatApptRef']; + bookedBy = json['BookedBy']; + // bookedOn = DateUtil.convertStringToDate(json['BookedOn']); + confirmedBy = json['ConfirmedBy']; + // confirmedOn = DateUtil.convertStringToDate(json['ConfirmedOn']); + arrivalChangedBy = json['ArrivalChangedBy']; + // arrivedOn = DateUtil.convertStringToDate(json['ArrivedOn']); + rescheduledBy = json['RescheduledBy']; + rescheduledOn = json['RescheduledOn']; + mRStatus = json['MRStatus']; + mRSentBy = json['MRSentBy']; + mRSentOn = json['MRSentOn']; + mRReceiptBy = json['MRReceiptBy']; + mRReceiptOn = json['MRReceiptOn']; + isDocumentScanned = json['IsDocumentScanned']; + documentScanDateTime = json['DocumentScanDateTime']; + documentScannedUser = json['DocumentScannedUser']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + isRecordedByNurse = json['IsRecordedByNurse']; + isCheckedByDoctor = json['IsCheckedByDoctor']; + isVisitClosed = json['IsVisitClosed']; + isRecurring = json['IsRecurring']; + isPersonallyConfirmed = json['IsPersonallyConfirmed']; + confirmationBy = json['ConfirmationBy']; + relationId = json['RelationId']; + appointmentDays = json['AppointmentDays']; + isActive = json['IsActive']; + actualDoctorRate = json['ActualDoctorRate']; + clinicName = json['ClinicName']; + doctorCases = json['DoctorCases']; + doctorImageURL = json['DoctorImageURL']; + doctorInfo = json['DoctorInfo']; + doctorName = json['DoctorName']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isAppointmentAllowed = json['IsAppointmentAllowed']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + nationalityFlagURL = json['NationalityFlagURL']; + nationalityID = json['NationalityID']; + nationalityName = json['NationalityName']; + noOfPatientsRate = json['NoOfPatientsRate']; + projectName = json['ProjectName']; + qR = json['QR']; + // speciality = json['Speciality'].cast(); + } catch (e) { + print(e); + } + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentDateN'] = this.appointmentDateN; + data['AppointmentType'] = this.appointmentType; + data['BookDate'] = this.bookDate; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['EndDate'] = this.endDate; + data['StartTime'] = this.startTime; + data['EndTime'] = this.endTime; + data['Status'] = this.status; + data['VisitType'] = this.visitType; + data['VisitFor'] = this.visitFor; + data['PatientStatusType'] = this.patientStatusType; + data['ActualVisitStartTime'] = this.actualVisitStartTime; + data['ActualVisitEndTime'] = this.actualVisitEndTime; + data['IsReminderActivated'] = this.isReminderActivated; + data['ReminderDisplayInterval'] = this.reminderDisplayInterval; + data['ReminderDisplayIntervalUnit'] = this.reminderDisplayIntervalUnit; + data['MainAppointmentNo'] = this.mainAppointmentNo; + data['Notes'] = this.notes; + data['CompanyID'] = this.companyID; + data['DHCCPatApptRef'] = this.dHCCPatApptRef; + data['BookedBy'] = this.bookedBy; + data['BookedOn'] = this.bookedOn; + data['ConfirmedBy'] = this.confirmedBy; + data['ConfirmedOn'] = this.confirmedOn; + data['ArrivalChangedBy'] = this.arrivalChangedBy; + data['ArrivedOn'] = this.arrivedOn; + data['RescheduledBy'] = this.rescheduledBy; + data['RescheduledOn'] = this.rescheduledOn; + data['MRStatus'] = this.mRStatus; + data['MRSentBy'] = this.mRSentBy; + data['MRSentOn'] = this.mRSentOn; + data['MRReceiptBy'] = this.mRReceiptBy; + data['MRReceiptOn'] = this.mRReceiptOn; + data['IsDocumentScanned'] = this.isDocumentScanned; + data['DocumentScanDateTime'] = this.documentScanDateTime; + data['DocumentScannedUser'] = this.documentScannedUser; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['IsRecordedByNurse'] = this.isRecordedByNurse; + data['IsCheckedByDoctor'] = this.isCheckedByDoctor; + data['IsVisitClosed'] = this.isVisitClosed; + data['IsRecurring'] = this.isRecurring; + data['IsPersonallyConfirmed'] = this.isPersonallyConfirmed; + data['ConfirmationBy'] = this.confirmationBy; + data['RelationId'] = this.relationId; + data['AppointmentDays'] = this.appointmentDays; + data['IsActive'] = this.isActive; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['ClinicName'] = this.clinicName; + data['DoctorCases'] = this.doctorCases; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorInfo'] = this.doctorInfo; + data['DoctorName'] = this.doctorName; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsAppointmentAllowed'] = this.isAppointmentAllowed; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['NationalityFlagURL'] = this.nationalityFlagURL; + data['NationalityID'] = this.nationalityID; + data['NationalityName'] = this.nationalityName; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['ProjectName'] = this.projectName; + data['QR'] = this.qR; + data['Speciality'] = this.speciality; + return data; + } +} + +class PatientDoctorAppointmentList{ + + String filterName =""; + List patientDoctorAppointmentList = List(); + + PatientDoctorAppointmentList({this.filterName,PatientDoctorAppointment patientDoctorAppointment}){ + patientDoctorAppointmentList.add(patientDoctorAppointment); + } + +} diff --git a/lib/core/model/doctor/reques_patient_doctor_appointmentt.dart b/lib/core/model/doctor/reques_patient_doctor_appointmentt.dart new file mode 100644 index 00000000..8ed90132 --- /dev/null +++ b/lib/core/model/doctor/reques_patient_doctor_appointmentt.dart @@ -0,0 +1,76 @@ +class RequestPatientDoctorAppointment { + int top; + double versionID; + int beforeDays; + int exludType; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + RequestPatientDoctorAppointment( + {this.top, + this.versionID, + this.beforeDays, + this.exludType, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + RequestPatientDoctorAppointment.fromJson(Map json) { + top = json['Top']; + versionID = json['VersionID']; + beforeDays = json['beforeDays']; + exludType = json['exludType']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['Top'] = this.top; + data['VersionID'] = this.versionID; + data['beforeDays'] = this.beforeDays; + data['exludType'] = this.exludType; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/model/doctor/request_doctor_profile.dart b/lib/core/model/doctor/request_doctor_profile.dart new file mode 100644 index 00000000..80766b3f --- /dev/null +++ b/lib/core/model/doctor/request_doctor_profile.dart @@ -0,0 +1,72 @@ +class RequestDoctorProfile { + int doctorID; + bool license; + bool isRegistered; + int projectID; + int clinicID; + int patientID; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + + RequestDoctorProfile( + {this.doctorID, + this.license, + this.isRegistered, + this.projectID, + this.clinicID, + this.patientID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); + + RequestDoctorProfile.fromJson(Map json) { + doctorID = json['doctorID']; + license = json['License']; + isRegistered = json['IsRegistered']; + projectID = json['ProjectID']; + clinicID = json['ClinicID']; + patientID = json['PatientID']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['doctorID'] = this.doctorID; + data['License'] = this.license; + data['IsRegistered'] = this.isRegistered; + data['ProjectID'] = this.projectID; + data['ClinicID'] = this.clinicID; + data['PatientID'] = this.patientID; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/core/model/doctor/request_doctor_rating.dart b/lib/core/model/doctor/request_doctor_rating.dart new file mode 100644 index 00000000..fcc9386b --- /dev/null +++ b/lib/core/model/doctor/request_doctor_rating.dart @@ -0,0 +1,52 @@ +class RequestDoctorRating { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int doctorID; + + RequestDoctorRating( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.doctorID}); + + RequestDoctorRating.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + doctorID = json['DoctorID']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['DoctorID'] = this.doctorID; + return data; + } +} diff --git a/lib/core/model/er/PatientAllPresOrders.dart b/lib/core/model/er/PatientAllPresOrders.dart new file mode 100644 index 00000000..90ce074a --- /dev/null +++ b/lib/core/model/er/PatientAllPresOrders.dart @@ -0,0 +1,132 @@ +class PatientAllPresOrders { + int iD; + String patientID; + bool patientOutSA; + bool isOutPatient; + int projectID; + int nearestProjectID; + double longitude; + double latitude; + String appointmentNo; + String dischargeID; + int lineItemNo; + int status; + String description; + String descriptionN; + String createdOn; + int serviceID; + int createdBy; + String editedOn; + int editedBy; + int channel; + dynamic clientRequestID; + bool returnedToQueue; + dynamic pickupDateTime; + dynamic pickupLocationName; + dynamic dropoffLocationName; + int realRRTHaveTransactions; + String nearestProjectDescription; + String nearestProjectDescriptionN; + String projectDescription; + String projectDescriptionN; + + PatientAllPresOrders( + {this.iD, + this.patientID, + this.patientOutSA, + this.isOutPatient, + this.projectID, + this.nearestProjectID, + this.longitude, + this.latitude, + this.appointmentNo, + this.dischargeID, + this.lineItemNo, + this.status, + this.description, + this.descriptionN, + this.createdOn, + this.serviceID, + this.createdBy, + this.editedOn, + this.editedBy, + this.channel, + this.clientRequestID, + this.returnedToQueue, + this.pickupDateTime, + this.pickupLocationName, + this.dropoffLocationName, + this.realRRTHaveTransactions, + this.nearestProjectDescription, + this.nearestProjectDescriptionN, + this.projectDescription, + this.projectDescriptionN}); + + PatientAllPresOrders.fromJson(Map json) { + iD = json['ID']; + patientID = json['PatientID']; + patientOutSA = json['PatientOutSA']; + isOutPatient = json['IsOutPatient']; + projectID = json['ProjectID']; + nearestProjectID = json['NearestProjectID']; + longitude = json['Longitude']; + latitude = json['Latitude']; + appointmentNo = json['AppointmentNo']; + dischargeID = json['DischargeID']; + lineItemNo = json['LineItemNo']; + status = json['Status']; + description = json['Description']; + descriptionN = json['DescriptionN']; + createdOn = json['CreatedOn']; + serviceID = json['ServiceID']; + createdBy = json['CreatedBy']; + editedOn = json['EditedOn']; + editedBy = json['EditedBy']; + channel = json['Channel']; + clientRequestID = json['ClientRequestID']; + returnedToQueue = json['ReturnedToQueue']; + pickupDateTime = json['PickupDateTime']; + pickupLocationName = json['PickupLocationName']; + dropoffLocationName = json['DropoffLocationName']; + realRRTHaveTransactions = json['RealRRT_HaveTransactions']; + nearestProjectDescription = json['NearestProjectDescription']; + nearestProjectDescriptionN = json['NearestProjectDescriptionN']; + projectDescription = json['ProjectDescription']; + projectDescriptionN = json['ProjectDescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['PatientID'] = this.patientID; + data['PatientOutSA'] = this.patientOutSA; + data['IsOutPatient'] = this.isOutPatient; + data['ProjectID'] = this.projectID; + data['NearestProjectID'] = this.nearestProjectID; + data['Longitude'] = this.longitude; + data['Latitude'] = this.latitude; + data['AppointmentNo'] = this.appointmentNo; + data['DischargeID'] = this.dischargeID; + data['LineItemNo'] = this.lineItemNo; + data['Status'] = this.status; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['CreatedOn'] = this.createdOn; + data['ServiceID'] = this.serviceID; + data['CreatedBy'] = this.createdBy; + data['EditedOn'] = this.editedOn; + data['EditedBy'] = this.editedBy; + data['Channel'] = this.channel; + data['ClientRequestID'] = this.clientRequestID; + data['ReturnedToQueue'] = this.returnedToQueue; + data['PickupDateTime'] = this.pickupDateTime; + data['PickupLocationName'] = this.pickupLocationName; + data['DropoffLocationName'] = this.dropoffLocationName; + data['RealRRT_HaveTransactions'] = this.realRRTHaveTransactions; + data['NearestProjectDescription'] = this.nearestProjectDescription; + data['NearestProjectDescriptionN'] = this.nearestProjectDescriptionN; + data['ProjectDescription'] = this.projectDescription; + data['ProjectDescriptionN'] = this.projectDescriptionN; + return data; + } +} diff --git a/lib/core/model/er/PatientER.dart b/lib/core/model/er/PatientER.dart new file mode 100644 index 00000000..f1694f9e --- /dev/null +++ b/lib/core/model/er/PatientER.dart @@ -0,0 +1,207 @@ +import 'package:diplomaticquarterapp/core/enum/Ambulate.dart'; + +import 'get_all_transportation_method_list_model.dart'; + +class PatientER { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int orderServiceID; + String patientIdentificationID; + int direction; + bool haveAppointment; + int tripType; + int pickupUrgency; + int pickupSpot; + String pickupDateTime; + int transportationMethodId; + int selectedAmbulate; + String requesterNote; + int requesterFileNo; + String requesterMobileNo; + bool requesterIsOutSA; + int isOutPatient; + String pickupLocationName; + String dropoffLocationName; + int projectID; + int createdBy; + int lineItemNo; + double cost; + double vAT; + double totalPrice; + String pickupLocationLattitude; + String pickupLocationLongitude; + String dropoffLocationLattitude; + String dropoffLocationLongitude; + String latitude; + String longitude; + String appointmentNo; + dynamic appointmentClinicName; + dynamic appointmentDoctorName; + dynamic appointmentBranch; + dynamic appointmentTime; + PatientERTransportationMethod patientERTransportationMethod; + Ambulate ambulate; + PatientER( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.orderServiceID = 4, + this.patientIdentificationID, + this.direction, + this.haveAppointment, + this.tripType, + this.pickupUrgency, + this.pickupSpot, + this.pickupDateTime, + this.transportationMethodId, + this.selectedAmbulate, + this.requesterNote, + this.requesterFileNo, + this.requesterMobileNo, + this.requesterIsOutSA, + this.isOutPatient, + this.pickupLocationName, + this.dropoffLocationName, + this.projectID, + this.createdBy, + this.lineItemNo, + this.cost, + this.vAT, + this.totalPrice, + this.pickupLocationLattitude, + this.pickupLocationLongitude, + this.dropoffLocationLattitude, + this.dropoffLocationLongitude, + this.latitude, + this.longitude, + this.appointmentNo, + this.appointmentClinicName, + this.appointmentDoctorName, + this.appointmentBranch, + this.appointmentTime, + this.patientERTransportationMethod, + this.ambulate}); + + PatientER.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + orderServiceID = json['OrderServiceID']; + patientIdentificationID = json['PatientIdentificationID']; + direction = json['Direction']; + haveAppointment = json['HaveAppointment']; + tripType = json['TripType']; + pickupUrgency = json['PickupUrgency']; + pickupSpot = json['PickupSpot']; + pickupDateTime = json['PickupDateTime']; + transportationMethodId = json['TransportationMethodId']; + selectedAmbulate = json['SelectedAmbulate']; + requesterNote = json['RequesterNote']; + requesterFileNo = json['RequesterFileNo']; + requesterMobileNo = json['RequesterMobileNo']; + requesterIsOutSA = json['RequesterIsOutSA']; + isOutPatient = json['IsOutPatient']; + pickupLocationName = json['PickupLocationName']; + dropoffLocationName = json['DropoffLocationName']; + projectID = json['ProjectID']; + createdBy = json['CreatedBy']; + lineItemNo = json['LineItemNo']; + cost = json['Cost']; + vAT = json['VAT']; + totalPrice = json['TotalPrice']; + pickupLocationLattitude = json['PickupLocationLattitude']; + pickupLocationLongitude = json['PickupLocationLongitude']; + dropoffLocationLattitude = json['DropoffLocationLattitude']; + dropoffLocationLongitude = json['DropoffLocationLongitude']; + latitude = json['Latitude']; + longitude = json['Longitude']; + appointmentNo = json['AppointmentNo']; + appointmentClinicName = json['AppointmentClinicName']; + appointmentDoctorName = json['AppointmentDoctorName']; + appointmentBranch = json['AppointmentBranch']; + appointmentTime = json['AppointmentTime']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['OrderServiceID'] = this.orderServiceID; + data['PatientIdentificationID'] = this.patientIdentificationID; + data['Direction'] = this.direction; + data['HaveAppointment'] = this.haveAppointment; + data['TripType'] = this.tripType; + data['PickupUrgency'] = this.pickupUrgency; + data['PickupSpot'] = this.pickupSpot; + data['PickupDateTime'] = this.pickupDateTime; + data['TransportationMethodId'] = this.transportationMethodId; + data['SelectedAmbulate'] = this.selectedAmbulate; + data['RequesterNote'] = this.requesterNote; + data['RequesterFileNo'] = this.requesterFileNo; + data['RequesterMobileNo'] = this.requesterMobileNo; + data['RequesterIsOutSA'] = this.requesterIsOutSA; + data['IsOutPatient'] = this.isOutPatient; + data['PickupLocationName'] = this.pickupLocationName; + data['DropoffLocationName'] = this.dropoffLocationName; + data['ProjectID'] = this.projectID; + data['CreatedBy'] = this.createdBy; + data['LineItemNo'] = this.lineItemNo; + data['Cost'] = this.cost; + data['VAT'] = this.vAT; + data['TotalPrice'] = this.totalPrice; + data['PickupLocationLattitude'] = this.pickupLocationLattitude; + data['PickupLocationLongitude'] = this.pickupLocationLongitude; + data['DropoffLocationLattitude'] = this.dropoffLocationLattitude; + data['DropoffLocationLongitude'] = this.dropoffLocationLongitude; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentClinicName'] = this.appointmentClinicName; + data['AppointmentDoctorName'] = this.appointmentDoctorName; + data['AppointmentBranch'] = this.appointmentBranch; + data['AppointmentTime'] = this.appointmentTime; + return data; + } +} diff --git a/lib/core/model/er/PickUpRequestPresOrder.dart b/lib/core/model/er/PickUpRequestPresOrder.dart new file mode 100644 index 00000000..376e30ae --- /dev/null +++ b/lib/core/model/er/PickUpRequestPresOrder.dart @@ -0,0 +1,204 @@ +class PickUpRequestPresOrder { + int id; + int presOrderID; + String createDate; + String lastEditDate; + int createdBy; + int lastEditBy; + bool isActive; + String requestNo; + int requesterId; + int direction; + bool haveAppointment; + dynamic appointmentId; + int tripType; + int pickupUrgency; + String pickupDateTime; + dynamic pickupLocationId; + int pickupSpot; + dynamic dropoffLocationId; + int transportationMethodId; + double cost; + double vAT; + double totalPrice; + int amountCollected; + int selectedAmbulate; + String requesterNote; + int status; + int paymentStatus; + dynamic rejectReason; + int visibility; + dynamic durationId; + dynamic imageId; + String requesterFileNo; + String requesterMobileNo; + bool requesterIsOutSA; + String pickupLocationLongitude; + String pickupLocationLattitude; + String dropoffLocationLongitude; + String dropoffLocationLattitude; + dynamic appointmentClinicName; + dynamic appointmentDoctorName; + dynamic appointmentBranch; + dynamic appointmentTime; + String pickupLocationName; + String dropoffLocationName; + String title; + String titleAR; + String ambulateDescription; + String ambulateDescriptionN; + + PickUpRequestPresOrder( + {this.id, + this.presOrderID, + this.createDate, + this.lastEditDate, + this.createdBy, + this.lastEditBy, + this.isActive, + this.requestNo, + this.requesterId, + this.direction, + this.haveAppointment, + this.appointmentId, + this.tripType, + this.pickupUrgency, + this.pickupDateTime, + this.pickupLocationId, + this.pickupSpot, + this.dropoffLocationId, + this.transportationMethodId, + this.cost, + this.vAT, + this.totalPrice, + this.amountCollected, + this.selectedAmbulate, + this.requesterNote, + this.status, + this.paymentStatus, + this.rejectReason, + this.visibility, + this.durationId, + this.imageId, + this.requesterFileNo, + this.requesterMobileNo, + this.requesterIsOutSA, + this.pickupLocationLongitude, + this.pickupLocationLattitude, + this.dropoffLocationLongitude, + this.dropoffLocationLattitude, + this.appointmentClinicName, + this.appointmentDoctorName, + this.appointmentBranch, + this.appointmentTime, + this.pickupLocationName, + this.dropoffLocationName, + this.title, + this.titleAR, + this.ambulateDescription, + this.ambulateDescriptionN}); + + PickUpRequestPresOrder.fromJson(Map json) { + id = json['Id']; + presOrderID = json['PresOrderID']; + createDate = json['CreateDate']; + lastEditDate = json['LastEditDate']; + createdBy = json['CreatedBy']; + lastEditBy = json['LastEditBy']; + isActive = json['IsActive']; + requestNo = json['RequestNo']; + requesterId = json['RequesterId']; + direction = json['Direction']; + haveAppointment = json['HaveAppointment']; + appointmentId = json['AppointmentId']; + tripType = json['TripType']; + pickupUrgency = json['PickupUrgency']; + pickupDateTime = json['PickupDateTime']; + pickupLocationId = json['PickupLocationId']; + pickupSpot = json['PickupSpot']; + dropoffLocationId = json['DropoffLocationId']; + transportationMethodId = json['TransportationMethodId']; + cost = json['Cost']; + vAT = json['VAT']; + totalPrice = json['TotalPrice']; + amountCollected = json['AmountCollected']; + selectedAmbulate = json['SelectedAmbulate']; + requesterNote = json['RequesterNote']; + status = json['Status']; + paymentStatus = json['PaymentStatus']; + rejectReason = json['RejectReason']; + visibility = json['Visibility']; + durationId = json['DurationId']; + imageId = json['ImageId']; + requesterFileNo = json['RequesterFileNo']; + requesterMobileNo = json['RequesterMobileNo']; + requesterIsOutSA = json['RequesterIsOutSA']; + pickupLocationLongitude = json['PickupLocationLongitude']; + pickupLocationLattitude = json['PickupLocationLattitude']; + dropoffLocationLongitude = json['DropoffLocationLongitude']; + dropoffLocationLattitude = json['DropoffLocationLattitude']; + appointmentClinicName = json['AppointmentClinicName']; + appointmentDoctorName = json['AppointmentDoctorName']; + appointmentBranch = json['AppointmentBranch']; + appointmentTime = json['AppointmentTime']; + pickupLocationName = json['PickupLocationName']; + dropoffLocationName = json['DropoffLocationName']; + title = json['Title']; + titleAR = json['TitleAR']; + ambulateDescription = json['AmbulateDescription']; + ambulateDescriptionN = json['AmbulateDescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['Id'] = this.id; + data['PresOrderID'] = this.presOrderID; + data['CreateDate'] = this.createDate; + data['LastEditDate'] = this.lastEditDate; + data['CreatedBy'] = this.createdBy; + data['LastEditBy'] = this.lastEditBy; + data['IsActive'] = this.isActive; + data['RequestNo'] = this.requestNo; + data['RequesterId'] = this.requesterId; + data['Direction'] = this.direction; + data['HaveAppointment'] = this.haveAppointment; + data['AppointmentId'] = this.appointmentId; + data['TripType'] = this.tripType; + data['PickupUrgency'] = this.pickupUrgency; + data['PickupDateTime'] = this.pickupDateTime; + data['PickupLocationId'] = this.pickupLocationId; + data['PickupSpot'] = this.pickupSpot; + data['DropoffLocationId'] = this.dropoffLocationId; + data['TransportationMethodId'] = this.transportationMethodId; + data['Cost'] = this.cost; + data['VAT'] = this.vAT; + data['TotalPrice'] = this.totalPrice; + data['AmountCollected'] = this.amountCollected; + data['SelectedAmbulate'] = this.selectedAmbulate; + data['RequesterNote'] = this.requesterNote; + data['Status'] = this.status; + data['PaymentStatus'] = this.paymentStatus; + data['RejectReason'] = this.rejectReason; + data['Visibility'] = this.visibility; + data['DurationId'] = this.durationId; + data['ImageId'] = this.imageId; + data['RequesterFileNo'] = this.requesterFileNo; + data['RequesterMobileNo'] = this.requesterMobileNo; + data['RequesterIsOutSA'] = this.requesterIsOutSA; + data['PickupLocationLongitude'] = this.pickupLocationLongitude; + data['PickupLocationLattitude'] = this.pickupLocationLattitude; + data['DropoffLocationLongitude'] = this.dropoffLocationLongitude; + data['DropoffLocationLattitude'] = this.dropoffLocationLattitude; + data['AppointmentClinicName'] = this.appointmentClinicName; + data['AppointmentDoctorName'] = this.appointmentDoctorName; + data['AppointmentBranch'] = this.appointmentBranch; + data['AppointmentTime'] = this.appointmentTime; + data['PickupLocationName'] = this.pickupLocationName; + data['DropoffLocationName'] = this.dropoffLocationName; + data['Title'] = this.title; + data['TitleAR'] = this.titleAR; + data['AmbulateDescription'] = this.ambulateDescription; + data['AmbulateDescriptionN'] = this.ambulateDescriptionN; + return data; + } +} diff --git a/lib/core/model/er/get_all_transportation_method_list_model.dart b/lib/core/model/er/get_all_transportation_method_list_model.dart new file mode 100644 index 00000000..ebc9caf7 --- /dev/null +++ b/lib/core/model/er/get_all_transportation_method_list_model.dart @@ -0,0 +1,79 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +class PatientERTransportationMethod { + dynamic id; + DateTime createDate; + DateTime lastEditDate; + dynamic createdBy; + dynamic lastEditBy; + bool isActive; + String title; + String titleAR; + dynamic price; + dynamic isDefault; + dynamic visibility; + dynamic durationId; + String description; + String descriptionAR; + dynamic totalPrice; + dynamic vAT; + + PatientERTransportationMethod( + { + this.id, + this.createDate, + this.lastEditDate, + this.createdBy, + this.lastEditBy, + this.isActive, + this.title, + this.titleAR, + this.price, + this.isDefault, + this.visibility, + this.durationId, + this.description, + this.descriptionAR, + this.totalPrice, + this.vAT}); + + PatientERTransportationMethod.fromJson( + Map json) { + id = json['Id']; + createDate = DateUtil.convertStringToDate(json['CreateDate']); + lastEditDate = DateUtil.convertStringToDate(json['LastEditDate']); + createdBy = json['CreatedBy']; + lastEditBy = json['LastEditBy']; + isActive = json['IsActive']; + title = json['Title']; + titleAR = json['TitleAR']; + price = json['Price']; + isDefault = json['isDefault']; + visibility = json['Visibility']; + durationId = json['DurationId']; + description = json['Description']; + descriptionAR = json['DescriptionAR']; + totalPrice = json['TotalPrice']; + vAT = json['VAT']; + } + + Map toJson() { + final Map data = new Map(); + data['Id'] = this.id; + data['CreateDate'] = this.createDate; + data['LastEditDate'] = this.lastEditDate; + data['CreatedBy'] = this.createdBy; + data['LastEditBy'] = this.lastEditBy; + data['IsActive'] = this.isActive; + data['Title'] = this.title; + data['TitleAR'] = this.titleAR; + data['Price'] = this.price; + data['isDefault'] = this.isDefault; + data['Visibility'] = this.visibility; + data['DurationId'] = this.durationId; + data['Description'] = this.description; + data['DescriptionAR'] = this.descriptionAR; + data['TotalPrice'] = this.totalPrice; + data['VAT'] = this.vAT; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/er/projectavgerwaitingtime.dart b/lib/core/model/er/projectavgerwaitingtime.dart new file mode 100644 index 00000000..9b21ec66 --- /dev/null +++ b/lib/core/model/er/projectavgerwaitingtime.dart @@ -0,0 +1,104 @@ +class ProjectAvgERWaitingTime { + int iD; + int projectID; + int avgTimeInMinutes; + String avgTimeInHHMM; + dynamic distanceInKilometers; + String latitude; + String longitude; + String phoneNumber; + String projectImageURL; + String projectName; + + ProjectAvgERWaitingTime( + {this.iD, + this.projectID, + this.avgTimeInMinutes, + this.avgTimeInHHMM, + this.distanceInKilometers, + this.latitude, + this.longitude, + this.phoneNumber, + this.projectImageURL, + this.projectName}); + + ProjectAvgERWaitingTime.fromJson(Map json) { + iD = json['ID']; + projectID = json['ProjectID']; + avgTimeInMinutes = json['AvgTimeInMinutes']; + avgTimeInHHMM = json['AvgTimeInHHMM']; + distanceInKilometers = json['DistanceInKilometers']; + latitude = json['Latitude']; + longitude = json['Longitude']; + phoneNumber = json['PhoneNumber']; + projectImageURL = json['ProjectImageURL']; + projectName = json['ProjectName']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['ProjectID'] = this.projectID; + data['AvgTimeInMinutes'] = this.avgTimeInMinutes; + data['AvgTimeInHHMM'] = this.avgTimeInHHMM; + data['DistanceInKilometers'] = this.distanceInKilometers; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['PhoneNumber'] = this.phoneNumber; + data['ProjectImageURL'] = this.projectImageURL; + data['ProjectName'] = this.projectName; + return data; + } +} +//class ProjectAvgERWaitingTime { +// int iD; +// int projectID; +// int avgTimeInMinutes; +// String avgTimeInHHMM; +// String distanceInKilometers; +// String latitude; +// String longitude; +// String phoneNumber; +// String projectImageURL; +// String projectName; +// +// ProjectAvgERWaitingTime( +// {this.iD, +// this.projectID, +// this.avgTimeInMinutes, +// this.avgTimeInHHMM, +// this.distanceInKilometers, +// this.latitude, +// this.longitude, +// this.phoneNumber, +// this.projectImageURL, +// this.projectName}); +// +// ProjectAvgERWaitingTime.fromJson(Map json) { +// iD = json['ID']; +// projectID = json['ProjectID']; +// avgTimeInMinutes = json['AvgTimeInMinutes']; +// avgTimeInHHMM = json['AvgTimeInHHMM']; +// distanceInKilometers = json['DistanceInKilometers']; +// latitude = json['Latitude']; +// longitude = json['Longitude']; +// phoneNumber = json['PhoneNumber']; +// projectImageURL = json['ProjectImageURL']; +// projectName = json['ProjectName']; +// } +// +// Map toJson() { +// final Map data = new Map(); +// data['ID'] = this.iD; +// data['ProjectID'] = this.projectID; +// data['AvgTimeInMinutes'] = this.avgTimeInMinutes; +// data['AvgTimeInHHMM'] = this.avgTimeInHHMM; +// data['DistanceInKilometers'] = this.distanceInKilometers; +// data['Latitude'] = this.latitude; +// data['Longitude'] = this.longitude; +// data['PhoneNumber'] = this.phoneNumber; +// data['ProjectImageURL'] = this.projectImageURL; +// data['ProjectName'] = this.projectName; +// return data; +// } +//} \ No newline at end of file diff --git a/lib/core/model/eye/AppoimentAllHistoryResult.dart b/lib/core/model/eye/AppoimentAllHistoryResult.dart new file mode 100644 index 00000000..ed123023 --- /dev/null +++ b/lib/core/model/eye/AppoimentAllHistoryResult.dart @@ -0,0 +1,497 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class AppoimentAllHistoryResultList { + String setupID; + int projectID; + int appointmentNo; + String appointmentDate; + Null appointmentDateN; + int appointmentType; + DateTime bookDate; + dynamic patientType; + int patientID; + dynamic clinicID; + int doctorID; + String endDate; + String startTime; + String endTime; + dynamic status; + dynamic visitType; + int visitFor; + int patientStatusType; + int companyID; + int bookedBy; + String bookedOn; + int confirmedBy; + String confirmedOn; + int arrivalChangedBy; + String arrivedOn; + Null editedBy; + Null editedOn; + Null doctorName; + Null doctorNameN; + String statusDesc; + Null statusDescN; + bool vitalStatus; + Null vitalSignAppointmentNo; + int episodeID; + int actualDoctorRate; + String clinicName; + bool complainExists; + String doctorImageURL; + String doctorNameObj; + int doctorRate; + List doctorSpeciality; + String doctorTitle; + int gender; + String genderDescription; + bool iSAllowOnlineCheckedIN; + bool isActiveDoctor; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + int isFollowup; + bool isLiveCareAppointment; + bool isMedicalReportRequested; + bool isOnlineCheckedIN; + String latitude; + List listHISGetContactLensPerscription; + List listHISGetGlassPerscription; + String longitude; + int nextAction; + int noOfPatientsRate; + int originalClinicID; + int originalProjectID; + String projectName; + String qR; + int remaniningHoursTocanPay; + bool sMSButtonVisable; + + AppoimentAllHistoryResultList( + {this.setupID, + this.projectID, + this.appointmentNo, + this.appointmentDate, + this.appointmentDateN, + this.appointmentType, + this.bookDate, + this.patientID, + this.doctorID, + this.endDate, + this.startTime, + this.endTime, + this.status, + this.visitFor, + this.patientStatusType, + this.companyID, + this.bookedBy, + this.bookedOn, + this.confirmedBy, + this.confirmedOn, + this.arrivalChangedBy, + this.arrivedOn, + this.editedBy, + this.editedOn, + this.doctorName, + this.doctorNameN, + this.statusDesc, + this.statusDescN, + this.vitalStatus, + this.vitalSignAppointmentNo, + this.episodeID, + this.actualDoctorRate, + this.clinicName, + this.complainExists, + this.doctorImageURL, + this.doctorNameObj, + this.doctorRate, + this.doctorSpeciality, + this.doctorTitle, + this.gender, + this.genderDescription, + this.iSAllowOnlineCheckedIN, + this.isActiveDoctor, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isFollowup, + this.isLiveCareAppointment, + this.isMedicalReportRequested, + this.isOnlineCheckedIN, + this.latitude, + this.listHISGetContactLensPerscription, + this.listHISGetGlassPerscription, + this.longitude, + this.nextAction, + this.noOfPatientsRate, + this.originalClinicID, + this.originalProjectID, + this.projectName, + this.qR, + this.remaniningHoursTocanPay, + this.sMSButtonVisable, + this.clinicID, + this.patientType, + + this.visitType}); + + AppoimentAllHistoryResultList.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + appointmentNo = json['AppointmentNo']; + appointmentDate = json['AppointmentDate']; + appointmentDateN = json['AppointmentDateN']; + appointmentType = json['AppointmentType']; + bookDate = DateUtil.convertStringToDate(json['BookDate']); + patientType = json['PatientType']; + patientID = json['PatientID']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + endDate = json['EndDate']; + startTime = json['StartTime']; + endTime = json['EndTime']; + status = json['Status']; + visitType = json['VisitType']; + visitFor = json['VisitFor']; + patientStatusType = json['PatientStatusType']; + companyID = json['CompanyID']; + bookedBy = json['BookedBy']; + bookedOn = json['BookedOn']; + confirmedBy = json['ConfirmedBy']; + confirmedOn = json['ConfirmedOn']; + arrivalChangedBy = json['ArrivalChangedBy']; + arrivedOn = json['ArrivedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + statusDesc = json['StatusDesc']; + statusDescN = json['StatusDescN']; + vitalStatus = json['VitalStatus']; + vitalSignAppointmentNo = json['VitalSignAppointmentNo']; + episodeID = json['EpisodeID']; + actualDoctorRate = json['ActualDoctorRate']; + clinicName = json['ClinicName']; + complainExists = json['ComplainExists']; + doctorImageURL = json['DoctorImageURL']; + doctorNameObj = json['DoctorNameObj']; + doctorRate = json['DoctorRate']; + // doctorSpeciality = json['DoctorSpeciality'].cast(); + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + iSAllowOnlineCheckedIN = json['ISAllowOnlineCheckedIN']; + isActiveDoctor = json['IsActiveDoctor']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + isFollowup = json['IsFollowup']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + isMedicalReportRequested = json['IsMedicalReportRequested']; + isOnlineCheckedIN = json['IsOnlineCheckedIN']; + latitude = json['Latitude']; + if (json['List_HIS_GetContactLensPerscription'] != null) { + listHISGetContactLensPerscription = + new List(); + json['List_HIS_GetContactLensPerscription'].forEach((v) { + listHISGetContactLensPerscription + .add(new ListHISGetContactLensPerscription.fromJson(v)); + }); + } + if (json['List_HIS_GetGlassPerscription'] != null) { + listHISGetGlassPerscription = new List(); + json['List_HIS_GetGlassPerscription'].forEach((v) { + listHISGetGlassPerscription + .add(new ListHISGetGlassPerscription.fromJson(v)); + }); + } + longitude = json['Longitude']; + nextAction = json['NextAction']; + noOfPatientsRate = json['NoOfPatientsRate']; + originalClinicID = json['OriginalClinicID']; + originalProjectID = json['OriginalProjectID']; + projectName = json['ProjectName']; + qR = json['QR']; + remaniningHoursTocanPay = json['RemaniningHoursTocanPay']; + sMSButtonVisable = json['SMSButtonVisable']; + clinicID = json['clinicID']; + patientType = json['patientType']; + status = json['status']; + visitType = json['visitType']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentDateN'] = this.appointmentDateN; + data['AppointmentType'] = this.appointmentType; + data['BookDate'] = this.bookDate; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['EndDate'] = this.endDate; + data['StartTime'] = this.startTime; + data['EndTime'] = this.endTime; + data['Status'] = this.status; + data['VisitType'] = this.visitType; + data['VisitFor'] = this.visitFor; + data['PatientStatusType'] = this.patientStatusType; + data['CompanyID'] = this.companyID; + data['BookedBy'] = this.bookedBy; + data['BookedOn'] = this.bookedOn; + data['ConfirmedBy'] = this.confirmedBy; + data['ConfirmedOn'] = this.confirmedOn; + data['ArrivalChangedBy'] = this.arrivalChangedBy; + data['ArrivedOn'] = this.arrivedOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['StatusDesc'] = this.statusDesc; + data['StatusDescN'] = this.statusDescN; + data['VitalStatus'] = this.vitalStatus; + data['VitalSignAppointmentNo'] = this.vitalSignAppointmentNo; + data['EpisodeID'] = this.episodeID; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['ClinicName'] = this.clinicName; + data['ComplainExists'] = this.complainExists; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorNameObj'] = this.doctorNameObj; + data['DoctorRate'] = this.doctorRate; + data['DoctorSpeciality'] = this.doctorSpeciality; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['ISAllowOnlineCheckedIN'] = this.iSAllowOnlineCheckedIN; + data['IsActiveDoctor'] = this.isActiveDoctor; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsFollowup'] = this.isFollowup; + data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + data['IsMedicalReportRequested'] = this.isMedicalReportRequested; + data['IsOnlineCheckedIN'] = this.isOnlineCheckedIN; + data['Latitude'] = this.latitude; + if (this.listHISGetContactLensPerscription != null) { + data['List_HIS_GetContactLensPerscription'] = this + .listHISGetContactLensPerscription + .map((v) => v.toJson()) + .toList(); + } + if (this.listHISGetGlassPerscription != null) { + data['List_HIS_GetGlassPerscription'] = + this.listHISGetGlassPerscription.map((v) => v.toJson()).toList(); + } + data['Longitude'] = this.longitude; + data['NextAction'] = this.nextAction; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['OriginalClinicID'] = this.originalClinicID; + data['OriginalProjectID'] = this.originalProjectID; + data['ProjectName'] = this.projectName; + data['QR'] = this.qR; + data['RemaniningHoursTocanPay'] = this.remaniningHoursTocanPay; + data['SMSButtonVisable'] = this.sMSButtonVisable; + data['clinicID'] = this.clinicID; + data['patientType'] = this.patientType; + data['status'] = this.status; + data['visitType'] = this.visitType; + return data; + } +} + +class ListHISGetContactLensPerscription { + String setupId; + int projectId; + int patientType; + int patientId; + int encounterType; + int encounterNo; + int oDOS; + dynamic brand; + dynamic baseCurve; + dynamic power; + dynamic diameter; + dynamic oZ; + dynamic cT; + dynamic blend; + String remarks; + int status; + bool isActive; + String createdOn; + + ListHISGetContactLensPerscription( + {this.setupId, + this.projectId, + this.patientType, + this.patientId, + this.encounterType, + this.encounterNo, + this.oDOS, + this.brand, + this.baseCurve, + this.power, + this.diameter, + this.oZ, + this.cT, + this.blend, + this.remarks, + this.status, + this.isActive, + this.createdOn}); + + ListHISGetContactLensPerscription.fromJson(Map json) { + setupId = json['SetupId']; + projectId = json['ProjectId']; + patientType = json['PatientType']; + patientId = json['PatientId']; + encounterType = json['EncounterType']; + encounterNo = json['EncounterNo']; + oDOS = json['OD_OS']; + brand = json['Brand']; + baseCurve = json['BaseCurve']; + power = json['Power']; + diameter = json['Diameter']; + oZ = json['OZ']; + cT = json['CT']; + blend = json['Blend']; + remarks = json['Remarks']; + status = json['Status']; + isActive = json['IsActive']; + createdOn = json['CreatedOn']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupId'] = this.setupId; + data['ProjectId'] = this.projectId; + data['PatientType'] = this.patientType; + data['PatientId'] = this.patientId; + data['EncounterType'] = this.encounterType; + data['EncounterNo'] = this.encounterNo; + data['OD_OS'] = this.oDOS; + data['Brand'] = this.brand; + data['BaseCurve'] = this.baseCurve; + data['Power'] = this.power; + data['Diameter'] = this.diameter; + data['OZ'] = this.oZ; + data['CT'] = this.cT; + data['Blend'] = this.blend; + data['Remarks'] = this.remarks; + data['Status'] = this.status; + data['IsActive'] = this.isActive; + data['CreatedOn'] = this.createdOn; + return data; + } +} + +class ListHISGetGlassPerscription { + dynamic projectID; + String setupID; + dynamic patientId; + dynamic encounterType; + dynamic encounterNo; + String visionType; + double rightEyeSpherical; + dynamic rightEyeCylinder; + dynamic rightEyeAxis; + dynamic rightEyePrism; + dynamic rightEyeVA; + String rightEyeRemarks; + dynamic leftEyeSpherical; + dynamic leftEyeCylinder; + dynamic leftEyeAxis; + dynamic leftEyePrism; + dynamic leftEyeVA; + String leftEyeRemarks; + dynamic pD; + dynamic bVD; + dynamic status; + bool isActive; + String createdOn; + + ListHISGetGlassPerscription( + {this.projectID, + this.setupID, + this.patientId, + this.encounterType, + this.encounterNo, + this.visionType, + this.rightEyeSpherical, + this.rightEyeCylinder, + this.rightEyeAxis, + this.rightEyePrism, + this.rightEyeVA, + this.rightEyeRemarks, + this.leftEyeSpherical, + this.leftEyeCylinder, + this.leftEyeAxis, + this.leftEyePrism, + this.leftEyeVA, + this.leftEyeRemarks, + this.pD, + this.bVD, + this.status, + this.isActive, + this.createdOn}); + + ListHISGetGlassPerscription.fromJson(Map json) { + projectID = json['ProjectID']; + setupID = json['SetupID']; + patientId = json['PatientId']; + encounterType = json['EncounterType']; + encounterNo = json['EncounterNo']; + visionType = json['VisionType']; + rightEyeSpherical = json['RightEyeSpherical']; + rightEyeCylinder = json['RightEyeCylinder']; + rightEyeAxis = json['RightEyeAxis']; + rightEyePrism = json['RightEyePrism']; + rightEyeVA = json['RightEyeVA']; + rightEyeRemarks = json['RightEyeRemarks']; + leftEyeSpherical = json['LeftEyeSpherical']; + leftEyeCylinder = json['LeftEyeCylinder']; + leftEyeAxis = json['LeftEyeAxis']; + leftEyePrism = json['LeftEyePrism']; + leftEyeVA = json['LeftEyeVA']; + leftEyeRemarks = json['LeftEyeRemarks']; + pD = json['PD']; + bVD = json['BVD']; + status = json['Status']; + isActive = json['IsActive']; + createdOn = json['CreatedOn']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['SetupID'] = this.setupID; + data['PatientId'] = this.patientId; + data['EncounterType'] = this.encounterType; + data['EncounterNo'] = this.encounterNo; + data['VisionType'] = this.visionType; + data['RightEyeSpherical'] = this.rightEyeSpherical; + data['RightEyeCylinder'] = this.rightEyeCylinder; + data['RightEyeAxis'] = this.rightEyeAxis; + data['RightEyePrism'] = this.rightEyePrism; + data['RightEyeVA'] = this.rightEyeVA; + data['RightEyeRemarks'] = this.rightEyeRemarks; + data['LeftEyeSpherical'] = this.leftEyeSpherical; + data['LeftEyeCylinder'] = this.leftEyeCylinder; + data['LeftEyeAxis'] = this.leftEyeAxis; + data['LeftEyePrism'] = this.leftEyePrism; + data['LeftEyeVA'] = this.leftEyeVA; + data['LeftEyeRemarks'] = this.leftEyeRemarks; + data['PD'] = this.pD; + data['BVD'] = this.bVD; + data['Status'] = this.status; + data['IsActive'] = this.isActive; + data['CreatedOn'] = this.createdOn; + return data; + } +} + + + diff --git a/lib/core/model/eye/AppointmentFilter.dart b/lib/core/model/eye/AppointmentFilter.dart new file mode 100644 index 00000000..1f4b0ae5 --- /dev/null +++ b/lib/core/model/eye/AppointmentFilter.dart @@ -0,0 +1,12 @@ +import 'AppoimentAllHistoryResult.dart'; + +class AppointmentFilter { + List appointmentAllHistoryResultList = List(); + String filterName; + + AppointmentFilter( + AppoimentAllHistoryResultList allHistoryResultList, String filterName) { + appointmentAllHistoryResultList.add(allHistoryResultList); + this.filterName = filterName; + } +} diff --git a/lib/core/model/family-file/add_family_file_request.dart b/lib/core/model/family-file/add_family_file_request.dart new file mode 100644 index 00000000..cfec8e39 --- /dev/null +++ b/lib/core/model/family-file/add_family_file_request.dart @@ -0,0 +1,92 @@ +class AddFamilyFileReq { + int searchType; + int sharedPatientID; + String sharedPatientIdentificationID; + String sharedPatientMobileNumber; + String zipCode; + bool isRegister; + int patientStatus; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + AddFamilyFileReq( + {this.searchType, + this.sharedPatientID, + this.sharedPatientIdentificationID, + this.sharedPatientMobileNumber, + this.zipCode, + this.isRegister, + this.patientStatus, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + AddFamilyFileReq.fromJson(Map json) { + searchType = json['SearchType']; + sharedPatientID = json['SharedPatientID']; + sharedPatientIdentificationID = json['SharedPatientIdentificationID']; + sharedPatientMobileNumber = json['SharedPatientMobileNumber']; + zipCode = json['ZipCode']; + isRegister = json['isRegister']; + patientStatus = json['PatientStatus']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['SearchType'] = this.searchType; + data['SharedPatientID'] = this.sharedPatientID; + data['SharedPatientIdentificationID'] = this.sharedPatientIdentificationID; + data['SharedPatientMobileNumber'] = this.sharedPatientMobileNumber; + data['ZipCode'] = this.zipCode; + data['isRegister'] = this.isRegister; + data['PatientStatus'] = this.patientStatus; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/model/family-file/insert b/lib/core/model/family-file/insert new file mode 100644 index 00000000..e69de29b diff --git a/lib/core/model/family-file/insert_share_file_request.dart b/lib/core/model/family-file/insert_share_file_request.dart new file mode 100644 index 00000000..02fa9a0b --- /dev/null +++ b/lib/core/model/family-file/insert_share_file_request.dart @@ -0,0 +1,80 @@ +class InsertSharePatientFileReq { + int responseID; + String shareFamilyPatientName; + int status; + int regionID; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + InsertSharePatientFileReq( + {this.responseID, + this.shareFamilyPatientName, + this.status, + this.regionID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + InsertSharePatientFileReq.fromJson(Map json) { + responseID = json['ResponseID']; + shareFamilyPatientName = json['ShareFamilyPatientName']; + status = json['Status']; + regionID = json['RegionID']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['ResponseID'] = this.responseID; + data['ShareFamilyPatientName'] = this.shareFamilyPatientName; + data['Status'] = this.status; + data['RegionID'] = this.regionID; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/model/feedback/COC_items.dart b/lib/core/model/feedback/COC_items.dart new file mode 100644 index 00000000..068c8bee --- /dev/null +++ b/lib/core/model/feedback/COC_items.dart @@ -0,0 +1,120 @@ +class COCItem { + Null appointment; + String appointmentClinicName; + String appointmentDate; + String appointmentProjectName; + String cOCID; + String cOCTitle; + String channel; + dynamic clinic; + String clinicID; + String date; + dynamic detail; + dynamic doctor; + String doctorID; + String formType; + int formTypeID; + dynamic identificationNo; + int itemID; + dynamic mobileNo; + dynamic naturename; + dynamic patientID; + dynamic patientName; + dynamic project; + dynamic projectID; + String solution; + String status; + String statusAr; + dynamic statusEn; + + COCItem( + {this.appointment, + this.appointmentClinicName, + this.appointmentDate, + this.appointmentProjectName, + this.cOCID, + this.cOCTitle, + this.channel, + this.clinic, + this.clinicID, + this.date, + this.detail, + this.doctor, + this.doctorID, + this.formType, + this.formTypeID, + this.identificationNo, + this.itemID, + this.mobileNo, + this.naturename, + this.patientID, + this.patientName, + this.project, + this.projectID, + this.solution, + this.status, + this.statusAr, + this.statusEn}); + + COCItem.fromJson(Map json) { + appointment = json['Appointment']; + appointmentClinicName = json['AppointmentClinicName']; + appointmentDate = json['AppointmentDate']; + appointmentProjectName = json['AppointmentProjectName']; + cOCID = json['COCID']; + cOCTitle = json['COCTitle']; + channel = json['Channel']; + clinic = json['Clinic']; + clinicID = json['ClinicID']; + date = json['Date']; + detail = json['Detail']; + doctor = json['Doctor']; + doctorID = json['DoctorID']; + formType = json['FormType']; + formTypeID = json['FormTypeID']; + identificationNo = json['IdentificationNo']; + itemID = json['ItemID']; + mobileNo = json['MobileNo']; + naturename = json['Naturename']; + patientID = json['PatientID']; + patientName = json['PatientName']; + project = json['Project']; + projectID = json['ProjectID']; + solution = json['Solution']; + status = json['Status']; + statusAr = json['StatusAr']; + statusEn = json['StatusEn']; + } + + Map toJson() { + final Map data = new Map(); + data['Appointment'] = this.appointment; + data['AppointmentClinicName'] = this.appointmentClinicName; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentProjectName'] = this.appointmentProjectName; + data['COCID'] = this.cOCID; + data['COCTitle'] = this.cOCTitle; + data['Channel'] = this.channel; + data['Clinic'] = this.clinic; + data['ClinicID'] = this.clinicID; + data['Date'] = this.date; + data['Detail'] = this.detail; + data['Doctor'] = this.doctor; + data['DoctorID'] = this.doctorID; + data['FormType'] = this.formType; + data['FormTypeID'] = this.formTypeID; + data['IdentificationNo'] = this.identificationNo; + data['ItemID'] = this.itemID; + data['MobileNo'] = this.mobileNo; + data['Naturename'] = this.naturename; + data['PatientID'] = this.patientID; + data['PatientName'] = this.patientName; + data['Project'] = this.project; + data['ProjectID'] = this.projectID; + data['Solution'] = this.solution; + data['Status'] = this.status; + data['StatusAr'] = this.statusAr; + data['StatusEn'] = this.statusEn; + return data; + } +} diff --git a/lib/core/model/feedback/request_insert_coc_item.dart b/lib/core/model/feedback/request_insert_coc_item.dart new file mode 100644 index 00000000..e8b6fce5 --- /dev/null +++ b/lib/core/model/feedback/request_insert_coc_item.dart @@ -0,0 +1,132 @@ +class RequestInsertCOCItem { + bool isUserLoggedIn; + String mobileNo; + int identificationNo; + int patientID; + int patientOutSA; + int patientTypeID; + String tokenID; + String patientName; + int projectID; + String fileName; + String attachment; + String uILanguage; + String browserInfo; + String cOCTypeName; + String formTypeID; + String details; + String deviceInfo; + String deviceType; + String title; + String resolution; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientType; + double appVersion; + + RequestInsertCOCItem( + {this.isUserLoggedIn, + this.mobileNo, + this.identificationNo, + this.patientID, + this.patientOutSA, + this.patientTypeID, + this.tokenID, + this.patientName, + this.projectID, + this.fileName, + this.attachment, + this.uILanguage, + this.browserInfo, + this.cOCTypeName, + this.formTypeID, + this.details, + this.deviceInfo, + this.deviceType, + this.title, + this.resolution, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientType, + this.appVersion}); + + RequestInsertCOCItem.fromJson(Map json) { + isUserLoggedIn = json['IsUserLoggedIn']; + mobileNo = json['MobileNo']; + identificationNo = json['IdentificationNo']; + patientID = json['PatientID']; + patientOutSA = json['PatientOutSA']; + patientTypeID = json['PatientTypeID']; + tokenID = json['TokenID']; + patientName = json['PatientName']; + projectID = json['ProjectID']; + fileName = json['FileName']; + attachment = json['Attachment']; + uILanguage = json['UILanguage']; + browserInfo = json['BrowserInfo']; + cOCTypeName = json['COCTypeName']; + formTypeID = json['FormTypeID']; + details = json['Details']; + deviceInfo = json['DeviceInfo']; + deviceType = json['DeviceType']; + title = json['Title']; + resolution = json['Resolution']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientType = json['PatientType']; + appVersion = json['AppVersion']; + } + + Map toJson() { + final Map data = new Map(); + data['IsUserLoggedIn'] = this.isUserLoggedIn; + data['MobileNo'] = this.mobileNo; + data['IdentificationNo'] = this.identificationNo; + data['PatientID'] = this.patientID; + data['PatientOutSA'] = this.patientOutSA; + data['PatientTypeID'] = this.patientTypeID; + data['TokenID'] = this.tokenID; + data['PatientName'] = this.patientName; + data['ProjectID'] = this.projectID; + data['FileName'] = this.fileName; + data['Attachment'] = this.attachment; + data['UILanguage'] = this.uILanguage; + data['BrowserInfo'] = this.browserInfo; + data['COCTypeName'] = this.cOCTypeName; + data['FormTypeID'] = this.formTypeID; + data['Details'] = this.details; + data['DeviceInfo'] = this.deviceInfo; + data['DeviceType'] = this.deviceType; + data['Title'] = this.title; + data['Resolution'] = this.resolution; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientType'] = this.patientType; + data['AppVersion'] = this.appVersion; + return data; + } +} diff --git a/lib/core/model/geofencing/requests/GeoZonesRequestModel.dart b/lib/core/model/geofencing/requests/GeoZonesRequestModel.dart new file mode 100644 index 00000000..219c46ae --- /dev/null +++ b/lib/core/model/geofencing/requests/GeoZonesRequestModel.dart @@ -0,0 +1,11 @@ +class GeoZonesRequestModel { + final String PatientID; + + GeoZonesRequestModel({this.PatientID}); + + Map toFlatMap() { + if (PatientID == null) return {}; + + return {"PatientID": PatientID.toString()}; + } +} diff --git a/lib/core/model/geofencing/requests/LogGeoZoneRequestModel.dart b/lib/core/model/geofencing/requests/LogGeoZoneRequestModel.dart new file mode 100644 index 00000000..e21a7d69 --- /dev/null +++ b/lib/core/model/geofencing/requests/LogGeoZoneRequestModel.dart @@ -0,0 +1,12 @@ +import 'package:flutter/cupertino.dart'; + +class LogGeoZoneRequestModel { + final int PointsID; + final int GeoType; + + LogGeoZoneRequestModel({@required this.PointsID, @required this.GeoType}); + + Map toFlatMap() { + return {"PointsID": PointsID.toString(), "GeoType": GeoType.toString()}; + } +} diff --git a/lib/core/model/geofencing/responses/GeoZonesResponseModel.dart b/lib/core/model/geofencing/responses/GeoZonesResponseModel.dart new file mode 100644 index 00000000..58771fab --- /dev/null +++ b/lib/core/model/geofencing/responses/GeoZonesResponseModel.dart @@ -0,0 +1,62 @@ +import 'package:diplomaticquarterapp/generated/json/base/json_convert_content.dart'; +import 'package:diplomaticquarterapp/generated/json/base/json_field.dart'; + +class GeoZonesResponseModel with JsonConvert { + @JSONField(name: "GEOF_ID") + int geofId; + @JSONField(name: "Description") + String description; + @JSONField(name: "DescriptionN") + String descriptionN; + @JSONField(name: "Latitude") + String latitude; + @JSONField(name: "Longitude") + String longitude; + @JSONField(name: "Radius") + int radius; + @JSONField(name: "Type") + int type; + @JSONField(name: "ProjectID") + int projectID; + @JSONField(name: "ImageURL") + String imageURL; + @JSONField(name: "IsCity") + bool isCity; + + // Outside Server Response + bool isRegistered = false; + bool onEntry = true; + bool onExit = true; + + String geofenceId() { + return "$geofId\_${description.replaceAll(" ", "")}"; + } + + static get(String coordinates, int radius, String name) { + coordinates = coordinates.replaceAll(" ", ""); + var geo = GeoZonesResponseModel(); + geo.latitude = coordinates.split(",").first; + geo.longitude = coordinates.split(",").last; + geo.radius = radius; + geo.description = name; + return geo; + } + + static GeoZonesResponseModel zkH() { + var geo = GeoZonesResponseModel(); + geo.latitude = "24.691136"; + geo.longitude = "46.650116"; + geo.radius = 150; + geo.description = "zkH"; + return geo; + } + + static GeoZonesResponseModel csO() { + var geo = GeoZonesResponseModel(); + geo.latitude = "24.7087913"; + geo.longitude = "46.6656461"; + geo.radius = 150; + geo.description = "csO"; + return geo; + } +} diff --git a/lib/core/model/geofencing/responses/LogGeoZoneResponseModel.dart b/lib/core/model/geofencing/responses/LogGeoZoneResponseModel.dart new file mode 100644 index 00000000..2242755f --- /dev/null +++ b/lib/core/model/geofencing/responses/LogGeoZoneResponseModel.dart @@ -0,0 +1,26 @@ +import 'package:diplomaticquarterapp/generated/json/base/json_convert_content.dart'; +import 'package:diplomaticquarterapp/generated/json/base/json_field.dart'; + +class LogGeoZoneResponseModel with JsonConvert { + @JSONField(name: "LanguageID") + int languageID; + @JSONField(name: "ErrorCode") + dynamic errorCode; + @JSONField(name: "ErrorEndUserMessage") + String errorEndUserMessage; + @JSONField(name: "ErrorEndUserMessageN") + dynamic errorEndUserMessageN; + @JSONField(name: "ErrorMessage") + dynamic errorMessage; + @JSONField(name: "ErrorType") + int errorType; + @JSONField(name: "IsAuthenticated") + bool isAuthenticated; + @JSONField(name: "SuccessMsg") + dynamic successMsg; + @JSONField(name: "SuccessMsgN") + dynamic successMsgN; + int statusCode; + @JSONField(name: "MessageStatus") + int messageStatus; +} diff --git a/lib/core/model/hospitals/hospitals_model.dart b/lib/core/model/hospitals/hospitals_model.dart new file mode 100644 index 00000000..264528c7 --- /dev/null +++ b/lib/core/model/hospitals/hospitals_model.dart @@ -0,0 +1,76 @@ +class HospitalsModel { + String desciption; + Null desciptionN; + dynamic iD; + String legalName; + String legalNameN; + String name; + Null nameN; + String phoneNumber; + String setupID; + dynamic distanceInKilometers; + bool isActive; + String latitude; + String longitude; + dynamic mainProjectID; + Null projectOutSA; + bool usingInDoctorApp; + + HospitalsModel( + {this.desciption, + this.desciptionN, + this.iD, + this.legalName, + this.legalNameN, + this.name, + this.nameN, + this.phoneNumber, + this.setupID, + this.distanceInKilometers, + this.isActive, + this.latitude, + this.longitude, + this.mainProjectID, + this.projectOutSA, + this.usingInDoctorApp}); + + HospitalsModel.fromJson(Map json) { + desciption = json['Desciption']; + desciptionN = json['DesciptionN']; + iD = json['ID']; + legalName = json['LegalName']; + legalNameN = json['LegalNameN']; + name = json['Name']; + nameN = json['NameN']; + phoneNumber = json['PhoneNumber']; + setupID = json['SetupID']; + distanceInKilometers = json['DistanceInKilometers']; + isActive = json['IsActive']; + latitude = json['Latitude']; + longitude = json['Longitude']; + mainProjectID = json['MainProjectID']; + projectOutSA = json['ProjectOutSA']; + usingInDoctorApp = json['UsingInDoctorApp']; + } + + Map toJson() { + final Map data = new Map(); + data['Desciption'] = this.desciption; + data['DesciptionN'] = this.desciptionN; + data['ID'] = this.iD; + data['LegalName'] = this.legalName; + data['LegalNameN'] = this.legalNameN; + data['Name'] = this.name; + data['NameN'] = this.nameN; + data['PhoneNumber'] = this.phoneNumber; + data['SetupID'] = this.setupID; + data['DistanceInKilometers'] = this.distanceInKilometers; + data['IsActive'] = this.isActive; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['MainProjectID'] = this.mainProjectID; + data['ProjectOutSA'] = this.projectOutSA; + data['UsingInDoctorApp'] = this.usingInDoctorApp; + return data; + } +} diff --git a/lib/core/model/hospitals/request_get_hospitals_model.dart b/lib/core/model/hospitals/request_get_hospitals_model.dart new file mode 100644 index 00000000..be163654 --- /dev/null +++ b/lib/core/model/hospitals/request_get_hospitals_model.dart @@ -0,0 +1,56 @@ +class RequestGetHospitalsModel { + int latitude; + int longitude; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + + RequestGetHospitalsModel( + {this.latitude, + this.longitude, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); + + RequestGetHospitalsModel.fromJson(Map json) { + latitude = json['Latitude']; + longitude = json['Longitude']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/core/model/insurance/Insurance_card_details.dart b/lib/core/model/insurance/Insurance_card_details.dart new file mode 100644 index 00000000..ddc33b2e --- /dev/null +++ b/lib/core/model/insurance/Insurance_card_details.dart @@ -0,0 +1,88 @@ +class InsuranceCardDetailsModel { + int approvalLimit; + int companyGroupID; + String companyName; + String companyRemarks; + String dOB; + int deductible; + String effectiveFrom; + String effectiveTo; + String eligabilityFailureReason; + bool isMemberEligible; + String memberID; + String memberName; + String memberStatus; + dynamic message; + String nationalId; + String policyNumber; + String responseMessage; + String room; + String subCategory; + + InsuranceCardDetailsModel( + {this.approvalLimit, + this.companyGroupID, + this.companyName, + this.companyRemarks, + this.dOB, + this.deductible, + this.effectiveFrom, + this.effectiveTo, + this.eligabilityFailureReason, + this.isMemberEligible, + this.memberID, + this.memberName, + this.memberStatus, + this.message, + this.nationalId, + this.policyNumber, + this.responseMessage, + this.room, + this.subCategory}); + + InsuranceCardDetailsModel.fromJson(Map json) { + approvalLimit = json['ApprovalLimit']; + companyGroupID = json['CompanyGroupID']; + companyName = json['CompanyName']; + companyRemarks = json['CompanyRemarks']; + dOB = json['DOB']; + deductible = json['Deductible']; + effectiveFrom = json['EffectiveFrom']; + effectiveTo = json['EffectiveTo']; + eligabilityFailureReason = json['EligabilityFailureReason']; + isMemberEligible = json['IsMemberEligible']; + memberID = json['MemberID']; + memberName = json['MemberName']; + memberStatus = json['MemberStatus']; + message = json['Message']; + nationalId = json['NationalId']; + policyNumber = json['PolicyNumber']; + responseMessage = json['ResponseMessage']; + room = json['Room']; + subCategory = json['SubCategory']; + } + + Map toJson() { + final Map data = new Map(); + data['ApprovalLimit'] = this.approvalLimit; + data['CompanyGroupID'] = this.companyGroupID; + data['CompanyName'] = this.companyName; + data['CompanyRemarks'] = this.companyRemarks; + data['DOB'] = this.dOB; + data['Deductible'] = this.deductible; + data['EffectiveFrom'] = this.effectiveFrom; + data['EffectiveTo'] = this.effectiveTo; + data['EligabilityFailureReason'] = this.eligabilityFailureReason; + data['IsMemberEligible'] = this.isMemberEligible; + data['MemberID'] = this.memberID; + data['MemberName'] = this.memberName; + data['MemberStatus'] = this.memberStatus; + data['Message'] = this.message; + data['NationalId'] = this.nationalId; + data['PolicyNumber'] = this.policyNumber; + data['ResponseMessage'] = this.responseMessage; + data['Room'] = this.room; + data['SubCategory'] = this.subCategory; + return data; + } +} diff --git a/lib/core/model/insurance/ReauestInsuranceApprovalModel.dart b/lib/core/model/insurance/ReauestInsuranceApprovalModel.dart new file mode 100644 index 00000000..5f41f878 --- /dev/null +++ b/lib/core/model/insurance/ReauestInsuranceApprovalModel.dart @@ -0,0 +1,72 @@ +class ReauestInsuranceApprovalModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int eXuldAPPNO; + int projectID; + + ReauestInsuranceApprovalModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.eXuldAPPNO, + this.projectID}); + + ReauestInsuranceApprovalModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + eXuldAPPNO = json['EXuldAPPNO']; + projectID = json['ProjectID']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['EXuldAPPNO'] = this.eXuldAPPNO; + data['ProjectID'] = this.projectID; + return data; + } +} diff --git a/lib/core/model/insurance/insurance_approval.dart b/lib/core/model/insurance/insurance_approval.dart new file mode 100644 index 00000000..894fad46 --- /dev/null +++ b/lib/core/model/insurance/insurance_approval.dart @@ -0,0 +1,140 @@ +class InsuranceApprovalDetails { + String procedureName; + String status; + String isInvoicedDesc; + + InsuranceApprovalDetails({ + this.procedureName, + this.status, + this.isInvoicedDesc, + }); + + InsuranceApprovalDetails.fromJson(Map json) { + try { + isInvoicedDesc = json['IsInvoicedDesc']; + status = json['Status']; + procedureName = json['ProcedureName']; + } catch (e) { + print(e); + } + } +} + +class InsuranceApprovalModel { + InsuranceApprovalDetails approvalDetails; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int eXuldAPPNO; + int projectID; + String doctorName; + String clinicName; + String patientDescription; + int approvalNo; + String approvalStatusDescption; + int unUsedCount; + + //String companyName; + String expiryDate; + String rceiptOn; + int appointmentNo; + + InsuranceApprovalModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.eXuldAPPNO, + this.projectID, + this.doctorName, + this.clinicName, + this.patientDescription, + this.approvalNo, + this.approvalStatusDescption, + this.unUsedCount, + //this.companyName, + this.expiryDate, + this.rceiptOn, + this.approvalDetails, + this.appointmentNo}); + + InsuranceApprovalDetails x = InsuranceApprovalDetails(); + + InsuranceApprovalModel.fromJson(Map json) { + try { + rceiptOn = json['ReceiptOn']; + expiryDate = json['ExpiryDate']; + //companyName = json['CompanyName']; + unUsedCount = json['TotaUnUsedCount']; + approvalStatusDescption = json['ApprovalStatusDescption']; + approvalNo = json['ApprovalNo']; + patientDescription = json['IsInOutPatientDescription']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + eXuldAPPNO = json['EXuldAPPNO']; + projectID = json['ProjectID']; + doctorName = json['DoctorName']; + clinicName = json['ClinicName']; + approvalDetails = + InsuranceApprovalDetails.fromJson(json['ApporvalDetails'][0]); + appointmentNo = json['AppointmentNo']; + } catch (e) { + print(e); + } + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + if (appointmentNo == null) { + data['EXuldAPPNO'] = this.eXuldAPPNO; + data['ProjectID'] = this.projectID; + } + if (appointmentNo != null) { + data['AppointmentNo'] = this.appointmentNo; + } + return data; + } +} diff --git a/lib/core/model/insurance/insurance_card.dart b/lib/core/model/insurance/insurance_card.dart new file mode 100644 index 00000000..ebab8d71 --- /dev/null +++ b/lib/core/model/insurance/insurance_card.dart @@ -0,0 +1,96 @@ +import 'dart:convert'; + +class InsuranceCardModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + String groupName; + String companyName; + int companyID; + String subCategoryDesc; + int subCategoryID; + String patientCardID; + String insurancePolicyNumber; + bool isActive; + String cardValidTo; + + InsuranceCardModel({ + this.insurancePolicyNumber, + this.subCategoryDesc, + this.subCategoryID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.groupName, + this.companyName, + this.companyID, + this.patientCardID, + this.isActive, + this.cardValidTo + }); + + InsuranceCardModel.fromJson(Map json) { + isActive = json['IsActive']; + insurancePolicyNumber = json['InsurancePolicyNo']; + patientCardID = json['PatientCardID']; + companyName = json['CompanyName']; + companyID = json['CompanyID']; + groupName = json['GroupName']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + subCategoryDesc = json['SubCategoryDesc']; + subCategoryID = json["SubCategoryID"]; + cardValidTo = json['CardValidTo']; + } + + Map toJson() { + final Map data = new Map(); + + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + + return data; + } +} diff --git a/lib/core/model/insurance/insurance_card_update_model.dart b/lib/core/model/insurance/insurance_card_update_model.dart new file mode 100644 index 00000000..6f5331ce --- /dev/null +++ b/lib/core/model/insurance/insurance_card_update_model.dart @@ -0,0 +1,67 @@ +import 'dart:convert'; + +import 'package:intl/intl.dart'; + +class InsuranceUpdateModel { + int patientID; + int patientType; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + String createdOn; + String statusDescription; + int appointmentNo; + + InsuranceUpdateModel( + {this.patientID, + this.patientType, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.createdOn, + this.statusDescription}); + + InsuranceUpdateModel.fromJson(Map json) { + statusDescription = json['StatusDescription']; + patientID = json['PatientID']; + patientType = json['PatientType']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + createdOn = json['CreatedOn']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['PatientType'] = this.patientType; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/core/model/labs/LabOrderResult.dart b/lib/core/model/labs/LabOrderResult.dart new file mode 100644 index 00000000..ecb4ae65 --- /dev/null +++ b/lib/core/model/labs/LabOrderResult.dart @@ -0,0 +1,88 @@ +class LabOrderResult { + String description; + dynamic femaleInterpretativeData; + int gender; + int lineItemNo; + dynamic maleInterpretativeData; + dynamic notes; + String packageID; + int patientID; + String projectID; + String referanceRange; + String resultValue; + String sampleCollectedOn; + String sampleReceivedOn; + String setupID; + dynamic superVerifiedOn; + String testCode; + String uOM; + String verifiedOn; + String verifiedOnDateTime; + + LabOrderResult( + {this.description, + this.femaleInterpretativeData, + this.gender, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); + + LabOrderResult.fromJson(Map json) { + description = json['Description']; + femaleInterpretativeData = json['FemaleInterpretativeData']; + gender = json['Gender']; + lineItemNo = json['LineItemNo']; + maleInterpretativeData = json['MaleInterpretativeData']; + notes = json['Notes']; + packageID = json['PackageID']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + referanceRange = json['ReferanceRange']; + resultValue = json['ResultValue']; + sampleCollectedOn = json['SampleCollectedOn']; + sampleReceivedOn = json['SampleReceivedOn']; + setupID = json['SetupID']; + superVerifiedOn = json['SuperVerifiedOn']; + testCode = json['TestCode']; + uOM = json['UOM']; + verifiedOn = json['VerifiedOn']; + verifiedOnDateTime = json['VerifiedOnDateTime']; + } + + Map toJson() { + final Map data = new Map(); + data['Description'] = this.description; + data['FemaleInterpretativeData'] = this.femaleInterpretativeData; + data['Gender'] = this.gender; + data['LineItemNo'] = this.lineItemNo; + data['MaleInterpretativeData'] = this.maleInterpretativeData; + data['Notes'] = this.notes; + data['PackageID'] = this.packageID; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['ReferanceRange'] = this.referanceRange; + data['ResultValue'] = this.resultValue; + data['SampleCollectedOn'] = this.sampleCollectedOn; + data['SampleReceivedOn'] = this.sampleReceivedOn; + data['SetupID'] = this.setupID; + data['SuperVerifiedOn'] = this.superVerifiedOn; + data['TestCode'] = this.testCode; + data['UOM'] = this.uOM; + data['VerifiedOn'] = this.verifiedOn; + data['VerifiedOnDateTime'] = this.verifiedOnDateTime; + return data; + } +} diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart new file mode 100644 index 00000000..2deb13f3 --- /dev/null +++ b/lib/core/model/labs/lab_result.dart @@ -0,0 +1,98 @@ +class LabResult { + String description; + dynamic femaleInterpretativeData; + int gender; + int lineItemNo; + dynamic maleInterpretativeData; + String notes; + String packageID; + int patientID; + String projectID; + String referanceRange; + String resultValue; + String sampleCollectedOn; + String sampleReceivedOn; + String setupID; + dynamic superVerifiedOn; + String testCode; + String uOM; + String verifiedOn; + dynamic verifiedOnDateTime; + + LabResult( + {this.description, + this.femaleInterpretativeData, + this.gender, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); + + LabResult.fromJson(Map json) { + description = json['Description']; + femaleInterpretativeData = json['FemaleInterpretativeData']; + gender = json['Gender']; + lineItemNo = json['LineItemNo']; + maleInterpretativeData = json['MaleInterpretativeData']; + notes = json['Notes']; + packageID = json['PackageID']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + referanceRange = json['ReferanceRange']; + resultValue = json['ResultValue']; + sampleCollectedOn = json['SampleCollectedOn']; + sampleReceivedOn = json['SampleReceivedOn']; + setupID = json['SetupID']; + superVerifiedOn = json['SuperVerifiedOn']; + testCode = json['TestCode']; + uOM = json['UOM']; + verifiedOn = json['VerifiedOn']; + verifiedOnDateTime = json['VerifiedOnDateTime']; + } + + Map toJson() { + final Map data = new Map(); + data['Description'] = this.description; + data['FemaleInterpretativeData'] = this.femaleInterpretativeData; + data['Gender'] = this.gender; + data['LineItemNo'] = this.lineItemNo; + data['MaleInterpretativeData'] = this.maleInterpretativeData; + data['Notes'] = this.notes; + data['PackageID'] = this.packageID; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['ReferanceRange'] = this.referanceRange; + data['ResultValue'] = this.resultValue; + data['SampleCollectedOn'] = this.sampleCollectedOn; + data['SampleReceivedOn'] = this.sampleReceivedOn; + data['SetupID'] = this.setupID; + data['SuperVerifiedOn'] = this.superVerifiedOn; + data['TestCode'] = this.testCode; + data['UOM'] = this.uOM; + data['VerifiedOn'] = this.verifiedOn; + data['VerifiedOnDateTime'] = this.verifiedOnDateTime; + return data; + } +} + + +class LabResultList { + String filterName = ""; + List patientLabResultList = List(); + + LabResultList({this.filterName, LabResult lab}) { + patientLabResultList.add(lab); + } +} diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart new file mode 100644 index 00000000..3c49b80a --- /dev/null +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -0,0 +1,158 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class PatientLabOrders { + int actualDoctorRate; + String clinicDescription; + String clinicDescriptionEnglish; + Null clinicDescriptionN; + int clinicID; + int doctorID; + String doctorImageURL; + String doctorName; + String doctorNameEnglish; + Null doctorNameN; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + String invoiceNo; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + bool isInOutPatient; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + bool isRead; + String nationalityFlagURL; + int noOfPatientsRate; + DateTime orderDate; + String orderNo; + String patientID; + String projectID; + String projectName; + Null projectNameN; + String qR; + String setupID; + List speciality; + bool isLiveCareAppointment; + PatientLabOrders( + {this.actualDoctorRate, + this.clinicDescription, + this.clinicDescriptionEnglish, + this.clinicDescriptionN, + this.clinicID, + this.doctorID, + this.doctorImageURL, + this.doctorName, + this.doctorNameEnglish, + this.doctorNameN, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.invoiceNo, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isInOutPatient, + this.isInOutPatientDescription, + this.isInOutPatientDescriptionN, + this.isRead, + this.nationalityFlagURL, + this.noOfPatientsRate, + this.orderDate, + this.orderNo, + this.patientID, + this.projectID, + this.projectName, + this.projectNameN, + this.qR, + this.setupID, + this.speciality,this.isLiveCareAppointment}); + + PatientLabOrders.fromJson(Map json) { + actualDoctorRate = json['ActualDoctorRate']; + clinicDescription = json['ClinicDescription']; + clinicDescriptionEnglish = json['ClinicDescriptionEnglish']; + clinicDescriptionN = json['ClinicDescriptionN']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorNameEnglish = json['DoctorNameEnglish']; + doctorNameN = json['DoctorNameN']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + invoiceNo = json['InvoiceNo']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + isInOutPatient = json['IsInOutPatient']; + isInOutPatientDescription = json['IsInOutPatientDescription']; + isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN']; + isRead = json['IsRead']; + nationalityFlagURL = json['NationalityFlagURL']; + noOfPatientsRate = json['NoOfPatientsRate']; + orderDate = DateUtil.convertStringToDate(json['OrderDate']); + orderNo = json['OrderNo']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + projectNameN = json['ProjectNameN']; + qR = json['QR']; + setupID = json['SetupID']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + // speciality = json['Speciality'].cast(); + } + + Map toJson() { + final Map data = new Map(); + data['ActualDoctorRate'] = this.actualDoctorRate; + data['ClinicDescription'] = this.clinicDescription; + data['ClinicDescriptionEnglish'] = this.clinicDescriptionEnglish; + data['ClinicDescriptionN'] = this.clinicDescriptionN; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['DoctorNameEnglish'] = this.doctorNameEnglish; + data['DoctorNameN'] = this.doctorNameN; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['InvoiceNo'] = this.invoiceNo; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsInOutPatient'] = this.isInOutPatient; + data['IsInOutPatientDescription'] = this.isInOutPatientDescription; + data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN; + data['IsRead'] = this.isRead; + data['NationalityFlagURL'] = this.nationalityFlagURL; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['OrderDate'] = this.orderDate; + data['OrderNo'] = this.orderNo; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['ProjectNameN'] = this.projectNameN; + data['QR'] = this.qR; + data['SetupID'] = this.setupID; + data['Speciality'] = this.speciality; + data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + return data; + } +} + +class PatientLabOrdersList { + String filterName = ""; + List patientLabOrdersList = List(); + + PatientLabOrdersList( + {this.filterName, PatientLabOrders patientDoctorAppointment}) { + patientLabOrdersList.add(patientDoctorAppointment); + } +} diff --git a/lib/core/model/labs/patient_lab_special_result.dart b/lib/core/model/labs/patient_lab_special_result.dart new file mode 100644 index 00000000..2fbcb832 --- /dev/null +++ b/lib/core/model/labs/patient_lab_special_result.dart @@ -0,0 +1,32 @@ +class PatientLabSpecialResult { + String invoiceNo; + String moduleID; + String resultData; + String resultDataHTML; + Null resultDataTxt; + + PatientLabSpecialResult( + {this.invoiceNo, + this.moduleID, + this.resultData, + this.resultDataHTML, + this.resultDataTxt}); + + PatientLabSpecialResult.fromJson(Map json) { + invoiceNo = json['InvoiceNo']; + moduleID = json['ModuleID']; + resultData = json['ResultData']; + resultDataHTML = json['ResultDataHTML']; + resultDataTxt = json['ResultDataTxt']; + } + + Map toJson() { + final Map data = new Map(); + data['InvoiceNo'] = this.invoiceNo; + data['ModuleID'] = this.moduleID; + data['ResultData'] = this.resultData; + data['ResultDataHTML'] = this.resultDataHTML; + data['ResultDataTxt'] = this.resultDataTxt; + return data; + } +} diff --git a/lib/core/model/labs/request_patient_lab_orders.dart b/lib/core/model/labs/request_patient_lab_orders.dart new file mode 100644 index 00000000..ce9263ef --- /dev/null +++ b/lib/core/model/labs/request_patient_lab_orders.dart @@ -0,0 +1,64 @@ +class RequestPatientLabOrders { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + RequestPatientLabOrders( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + RequestPatientLabOrders.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/model/labs/request_patient_lab_special_result.dart b/lib/core/model/labs/request_patient_lab_special_result.dart new file mode 100644 index 00000000..bdeb3930 --- /dev/null +++ b/lib/core/model/labs/request_patient_lab_special_result.dart @@ -0,0 +1,84 @@ +class RequestPatientLabSpecialResult { + String invoiceNo; + String orderNo; + String setupID; + String projectID; + int clinicID; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + RequestPatientLabSpecialResult( + {this.invoiceNo, + this.orderNo, + this.setupID, + this.projectID, + this.clinicID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + RequestPatientLabSpecialResult.fromJson(Map json) { + invoiceNo = json['InvoiceNo']; + orderNo = json['OrderNo']; + setupID = json['SetupID']; + projectID = json['ProjectID']; + clinicID = json['ClinicID']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['InvoiceNo'] = this.invoiceNo; + data['OrderNo'] = this.orderNo; + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['ClinicID'] = this.clinicID; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/model/labs/request_send_lab_report_email.dart b/lib/core/model/labs/request_send_lab_report_email.dart new file mode 100644 index 00000000..118da906 --- /dev/null +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -0,0 +1,112 @@ +class RequestSendLabReportEmail { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + String to; + String dateofBirth; + String patientIditificationNum; + String patientMobileNumber; + String patientName; + String setupID; + String projectName; + String clinicName; + String doctorName; + String projectID; + String invoiceNo; + String orderDate; + + RequestSendLabReportEmail( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.to, + this.dateofBirth, + this.patientIditificationNum, + this.patientMobileNumber, + this.patientName, + this.setupID, + this.projectName, + this.clinicName, + this.doctorName, + this.projectID, + this.invoiceNo, + this.orderDate}); + + RequestSendLabReportEmail.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + to = json['To']; + dateofBirth = json['DateofBirth']; + patientIditificationNum = json['PatientIditificationNum']; + patientMobileNumber = json['PatientMobileNumber']; + patientName = json['PatientName']; + setupID = json['SetupID']; + projectName = json['ProjectName']; + clinicName = json['ClinicName']; + doctorName = json['DoctorName']; + projectID = json['ProjectID']; + invoiceNo = json['InvoiceNo']; + orderDate = json['OrderDate']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['To'] = this.to; + data['DateofBirth'] = this.dateofBirth; + data['PatientIditificationNum'] = this.patientIditificationNum; + data['PatientMobileNumber'] = this.patientMobileNumber; + data['PatientName'] = this.patientName; + data['SetupID'] = this.setupID; + data['ProjectName'] = this.projectName; + data['ClinicName'] = this.clinicName; + data['DoctorName'] = this.doctorName; + data['ProjectID'] = this.projectID; + data['InvoiceNo'] = this.invoiceNo; + data['OrderDate'] = this.orderDate; + return data; + } +} diff --git a/lib/core/model/my_balance/AdvanceModel.dart b/lib/core/model/my_balance/AdvanceModel.dart new file mode 100644 index 00000000..d2792990 --- /dev/null +++ b/lib/core/model/my_balance/AdvanceModel.dart @@ -0,0 +1,27 @@ +import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart'; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; + +class AdvanceModel { + String fileNumber; + String amount; + HospitalsModel hospitalsModel; + String email; + String note; + String depositorName; + String mobileNumber; + String patientName; + int projectID; + CitiesModel citiessModel; + + AdvanceModel( + {this.amount, + this.email, + this.note, + this.hospitalsModel, + this.fileNumber, + this.depositorName, + this.mobileNumber, + this.patientName, + this.projectID, + this.citiessModel}); +} diff --git a/lib/core/model/my_balance/patient_advance_balance_amount.dart b/lib/core/model/my_balance/patient_advance_balance_amount.dart new file mode 100644 index 00000000..44a5083f --- /dev/null +++ b/lib/core/model/my_balance/patient_advance_balance_amount.dart @@ -0,0 +1,28 @@ +class PatientAdvanceBalanceAmount { + int distanceInKilometers; + dynamic patientAdvanceBalanceAmount; + String projectDescription; + int projectID; + + PatientAdvanceBalanceAmount( + {this.distanceInKilometers, + this.patientAdvanceBalanceAmount, + this.projectDescription, + this.projectID}); + + PatientAdvanceBalanceAmount.fromJson(Map json) { + distanceInKilometers = json['DistanceInKilometers']; + patientAdvanceBalanceAmount = json['PatientAdvanceBalanceAmount']; + projectDescription = json['ProjectDescription']; + projectID = json['ProjectID']; + } + + Map toJson() { + final Map data = new Map(); + data['DistanceInKilometers'] = this.distanceInKilometers; + data['PatientAdvanceBalanceAmount'] = this.patientAdvanceBalanceAmount; + data['ProjectDescription'] = this.projectDescription; + data['ProjectID'] = this.projectID; + return data; + } +} diff --git a/lib/core/model/my_balance/patient_info.dart b/lib/core/model/my_balance/patient_info.dart new file mode 100644 index 00000000..6004f014 --- /dev/null +++ b/lib/core/model/my_balance/patient_info.dart @@ -0,0 +1,32 @@ +class PatientInfo { + String fullName; + String mobileNumber; + int patientID; + int projectID; + String zipCode; + + PatientInfo( + {this.fullName, + this.mobileNumber, + this.patientID, + this.projectID, + this.zipCode}); + + PatientInfo.fromJson(Map json) { + fullName = json['FullName']; + mobileNumber = json['MobileNumber']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + zipCode = json['ZipCode']; + } + + Map toJson() { + final Map data = new Map(); + data['FullName'] = this.fullName; + data['MobileNumber'] = this.mobileNumber; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['ZipCode'] = this.zipCode; + return data; + } +} diff --git a/lib/core/model/my_balance/patient_info_and_mobile_number.dart b/lib/core/model/my_balance/patient_info_and_mobile_number.dart new file mode 100644 index 00000000..8f05b4d9 --- /dev/null +++ b/lib/core/model/my_balance/patient_info_and_mobile_number.dart @@ -0,0 +1,84 @@ +class PatientInfoAndMobileNumber { + String setupID; + int projectID; + int mainAccountID; + int patientType; + int patientID; + String firstName; + Null middleName; + Null lastName; + Null firstNameN; + Null middleNameN; + Null lastNameN; + Null gender; + Null dateofBirth; + Null dateofBirthN; + Null nationalityID; + String mobileNumber; + String emailAddress; + Null zipCode; + + PatientInfoAndMobileNumber( + {this.setupID, + this.projectID, + this.mainAccountID, + this.patientType, + this.patientID, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.dateofBirthN, + this.nationalityID, + this.mobileNumber, + this.emailAddress, + this.zipCode}); + + PatientInfoAndMobileNumber.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + mainAccountID = json['MainAccountID']; + patientType = json['PatientType']; + patientID = json['PatientID']; + firstName = json['FirstName']; + middleName = json['MiddleName']; + lastName = json['LastName']; + firstNameN = json['FirstNameN']; + middleNameN = json['MiddleNameN']; + lastNameN = json['LastNameN']; + gender = json['Gender']; + dateofBirth = json['DateofBirth']; + dateofBirthN = json['DateofBirthN']; + nationalityID = json['NationalityID']; + mobileNumber = json['MobileNumber']; + emailAddress = json['EmailAddress']; + zipCode = json['ZipCode']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['MainAccountID'] = this.mainAccountID; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['FirstName'] = this.firstName; + data['MiddleName'] = this.middleName; + data['LastName'] = this.lastName; + data['FirstNameN'] = this.firstNameN; + data['MiddleNameN'] = this.middleNameN; + data['LastNameN'] = this.lastNameN; + data['Gender'] = this.gender; + data['DateofBirth'] = this.dateofBirth; + data['DateofBirthN'] = this.dateofBirthN; + data['NationalityID'] = this.nationalityID; + data['MobileNumber'] = this.mobileNumber; + data['EmailAddress'] = this.emailAddress; + data['ZipCode'] = this.zipCode; + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_pressur/BloodPressureResult.dart b/lib/core/model/my_trakers/blood_pressur/BloodPressureResult.dart new file mode 100644 index 00000000..57f2cd54 --- /dev/null +++ b/lib/core/model/my_trakers/blood_pressur/BloodPressureResult.dart @@ -0,0 +1,90 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class BloodPressureResult { + int patientID; + int lineItemNo; + DateTime bloodPressureDate; + int measuredArm; + int systolicePressure; + int diastolicPressure; + dynamic remark; + bool isActive; + int chartYear; + String chartMonth; + dynamic yearSystolicePressureAverageResult; + dynamic monthSystolicePressureResult; + dynamic weekSystolicePressureResult; + int yearDiastolicPressureAverageResult; + dynamic monthDiastolicPressureResult; + dynamic weekDiastolicPressureResult; + String measuredArmDesc; + dynamic weekDesc; + + BloodPressureResult( + {this.patientID, + this.lineItemNo, + this.bloodPressureDate, + this.measuredArm, + this.systolicePressure, + this.diastolicPressure, + this.remark, + this.isActive, + this.chartYear, + this.chartMonth, + this.yearSystolicePressureAverageResult, + this.monthSystolicePressureResult, + this.weekSystolicePressureResult, + this.yearDiastolicPressureAverageResult, + this.monthDiastolicPressureResult, + this.weekDiastolicPressureResult, + this.measuredArmDesc, + this.weekDesc}); + + BloodPressureResult.fromJson(Map json) { + patientID = json['PatientID']; + lineItemNo = json['LineItemNo']; + bloodPressureDate =DateUtil.convertStringToDate(json['BloodPressureDate']); + measuredArm = json['MeasuredArm']; + systolicePressure = json['SystolicePressure']; + diastolicPressure = json['DiastolicPressure']; + remark = json['Remark']; + isActive = json['IsActive']; + chartYear = json['ChartYear']; + chartMonth = json['ChartMonth']; + yearSystolicePressureAverageResult = + json['YearSystolicePressureAverageResult']; + monthSystolicePressureResult = json['MonthSystolicePressureResult']; + weekSystolicePressureResult = json['WeekSystolicePressureResult']; + yearDiastolicPressureAverageResult = + json['YearDiastolicPressureAverageResult']; + monthDiastolicPressureResult = json['MonthDiastolicPressureResult']; + weekDiastolicPressureResult = json['WeekDiastolicPressureResult']; + measuredArmDesc = json['MeasuredArmDesc']; + weekDesc = json['WeekDesc']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['LineItemNo'] = this.lineItemNo; + data['BloodPressureDate'] = this.bloodPressureDate; + data['MeasuredArm'] = this.measuredArm; + data['SystolicePressure'] = this.systolicePressure; + data['DiastolicPressure'] = this.diastolicPressure; + data['Remark'] = this.remark; + data['IsActive'] = this.isActive; + data['ChartYear'] = this.chartYear; + data['ChartMonth'] = this.chartMonth; + data['YearSystolicePressureAverageResult'] = + this.yearSystolicePressureAverageResult; + data['MonthSystolicePressureResult'] = this.monthSystolicePressureResult; + data['WeekSystolicePressureResult'] = this.weekSystolicePressureResult; + data['YearDiastolicPressureAverageResult'] = + this.yearDiastolicPressureAverageResult; + data['MonthDiastolicPressureResult'] = this.monthDiastolicPressureResult; + data['WeekDiastolicPressureResult'] = this.weekDiastolicPressureResult; + data['MeasuredArmDesc'] = this.measuredArmDesc; + data['WeekDesc'] = this.weekDesc; + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_pressur/MonthBloodPressureResultAverage.dart b/lib/core/model/my_trakers/blood_pressur/MonthBloodPressureResultAverage.dart new file mode 100644 index 00000000..5343119c --- /dev/null +++ b/lib/core/model/my_trakers/blood_pressur/MonthBloodPressureResultAverage.dart @@ -0,0 +1,76 @@ +class MonthBloodPressureResultAverage { + dynamic weekfourSystolicePressureAverageResult; + dynamic weekfourDiastolicPressureAverageResult; + dynamic weekthreeSystolicePressureAverageResult; + dynamic weekthreeDiastolicPressureAverageResult; + dynamic weektwoSystolicePressureAverageResult; + dynamic weektwoDiastolicPressureAverageResult; + dynamic weekoneSystolicePressureAverageResult; + dynamic weekoneDiastolicPressureAverageResult; + String weekDesc; + int weekDiastolicPressureAverageResult; + int weekSystolicePressureAverageResult; + + MonthBloodPressureResultAverage( + {this.weekfourSystolicePressureAverageResult, + this.weekfourDiastolicPressureAverageResult, + this.weekthreeSystolicePressureAverageResult, + this.weekthreeDiastolicPressureAverageResult, + this.weektwoSystolicePressureAverageResult, + this.weektwoDiastolicPressureAverageResult, + this.weekoneSystolicePressureAverageResult, + this.weekoneDiastolicPressureAverageResult, + this.weekDesc, + this.weekDiastolicPressureAverageResult, + this.weekSystolicePressureAverageResult}); + + MonthBloodPressureResultAverage.fromJson(Map json) { + weekfourSystolicePressureAverageResult = + json['weekfourSystolicePressureAverageResult']; + weekfourDiastolicPressureAverageResult = + json['weekfourDiastolicPressureAverageResult']; + weekthreeSystolicePressureAverageResult = + json['weekthreeSystolicePressureAverageResult']; + weekthreeDiastolicPressureAverageResult = + json['weekthreeDiastolicPressureAverageResult']; + weektwoSystolicePressureAverageResult = + json['weektwoSystolicePressureAverageResult']; + weektwoDiastolicPressureAverageResult = + json['weektwoDiastolicPressureAverageResult']; + weekoneSystolicePressureAverageResult = + json['weekoneSystolicePressureAverageResult']; + weekoneDiastolicPressureAverageResult = + json['weekoneDiastolicPressureAverageResult']; + weekDesc = json['WeekDesc']; + weekDiastolicPressureAverageResult = + json['WeekDiastolicPressureAverageResult']; + weekSystolicePressureAverageResult = + json['WeekSystolicePressureAverageResult']; + } + + Map toJson() { + final Map data = new Map(); + data['weekfourSystolicePressureAverageResult'] = + this.weekfourSystolicePressureAverageResult; + data['weekfourDiastolicPressureAverageResult'] = + this.weekfourDiastolicPressureAverageResult; + data['weekthreeSystolicePressureAverageResult'] = + this.weekthreeSystolicePressureAverageResult; + data['weekthreeDiastolicPressureAverageResult'] = + this.weekthreeDiastolicPressureAverageResult; + data['weektwoSystolicePressureAverageResult'] = + this.weektwoSystolicePressureAverageResult; + data['weektwoDiastolicPressureAverageResult'] = + this.weektwoDiastolicPressureAverageResult; + data['weekoneSystolicePressureAverageResult'] = + this.weekoneSystolicePressureAverageResult; + data['weekoneDiastolicPressureAverageResult'] = + this.weekoneDiastolicPressureAverageResult; + data['WeekDesc'] = this.weekDesc; + data['WeekDiastolicPressureAverageResult'] = + this.weekDiastolicPressureAverageResult; + data['WeekSystolicePressureAverageResult'] = + this.weekSystolicePressureAverageResult; + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_pressur/WeekBloodPressureResultAverage.dart b/lib/core/model/my_trakers/blood_pressur/WeekBloodPressureResultAverage.dart new file mode 100644 index 00000000..b7f3fc80 --- /dev/null +++ b/lib/core/model/my_trakers/blood_pressur/WeekBloodPressureResultAverage.dart @@ -0,0 +1,30 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class WeekBloodPressureResultAverage { + int dailySystolicePressureAverageResult; + int dailyDiastolicPressureAverageResult; + DateTime bloodPressureDate; + + WeekBloodPressureResultAverage( + {this.dailySystolicePressureAverageResult, + this.dailyDiastolicPressureAverageResult, + this.bloodPressureDate}); + + WeekBloodPressureResultAverage.fromJson(Map json) { + dailySystolicePressureAverageResult = + json['DailySystolicePressureAverageResult']; + dailyDiastolicPressureAverageResult = + json['DailyDiastolicPressureAverageResult']; + bloodPressureDate = DateUtil.convertStringToDate(json['BloodPressureDate']); + } + + Map toJson() { + final Map data = new Map(); + data['DailySystolicePressureAverageResult'] = + this.dailySystolicePressureAverageResult; + data['DailyDiastolicPressureAverageResult'] = + this.dailyDiastolicPressureAverageResult; + data['BloodPressureDate'] = this.bloodPressureDate; + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_pressur/YearBloodPressureResultAverage.dart b/lib/core/model/my_trakers/blood_pressur/YearBloodPressureResultAverage.dart new file mode 100644 index 00000000..095738d6 --- /dev/null +++ b/lib/core/model/my_trakers/blood_pressur/YearBloodPressureResultAverage.dart @@ -0,0 +1,41 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class YearBloodPressureResultAverage { + int monthSystolicePressureAverageResult; + int monthDiastolicPressureAverageResult; + dynamic monthNumber; + String monthName; + String yearName; + DateTime date; + + YearBloodPressureResultAverage( + {this.monthSystolicePressureAverageResult, + this.monthDiastolicPressureAverageResult, + this.monthNumber, + this.monthName, + this.yearName}); + + YearBloodPressureResultAverage.fromJson(Map json) { + monthSystolicePressureAverageResult = + json['monthSystolicePressureAverageResult']; + monthDiastolicPressureAverageResult = + json['monthDiastolicPressureAverageResult']; + monthNumber = json['monthNumber']; + monthName = json['monthName']; + yearName = json['yearName']; + date = DateUtil.getMonthDateTime(monthName,yearName); + + } + + Map toJson() { + final Map data = new Map(); + data['monthSystolicePressureAverageResult'] = + this.monthSystolicePressureAverageResult; + data['monthDiastolicPressureAverageResult'] = + this.monthDiastolicPressureAverageResult; + data['monthNumber'] = this.monthNumber; + data['monthName'] = this.monthName; + data['yearName'] = this.yearName; + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart b/lib/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart new file mode 100644 index 00000000..5b95409e --- /dev/null +++ b/lib/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart @@ -0,0 +1,98 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class DiabtecPatientResult { + String chartMonth; + var chartYear; + DateTime dateChart; + var description; + var descriptionN; + int diabtecAvarage; + bool isActive; + int lineItemNo; + var listMonth; + var listWeek; + int measured; + String measuredDesc; + var monthAverageResult; + int patientID; + var remark; + var resultDesc; + int resultValue; + String unit; + var weekAverageResult; + String weekDesc; + var yearAverageResult; + + DiabtecPatientResult( + {this.chartMonth, + this.chartYear, + this.dateChart, + this.description, + this.descriptionN, + this.diabtecAvarage, + this.isActive, + this.lineItemNo, + this.listMonth, + this.listWeek, + this.measured, + this.measuredDesc, + this.monthAverageResult, + this.patientID, + this.remark, + this.resultDesc, + this.resultValue, + this.unit, + this.weekAverageResult, + this.weekDesc, + this.yearAverageResult}); + + DiabtecPatientResult.fromJson(Map json) { + chartMonth = json['ChartMonth']; + chartYear = json['ChartYear']; + dateChart = DateUtil.convertStringToDate(json['DateChart']); + description = json['Description']; + descriptionN = json['DescriptionN']; + diabtecAvarage = json['DiabtecAvarage']; + isActive = json['IsActive']; + lineItemNo = json['LineItemNo']; + listMonth = json['List_Month']; + listWeek = json['List_Week']; + measured = json['Measured']; + measuredDesc = json['MeasuredDesc']; + monthAverageResult = json['MonthAverageResult']; + patientID = json['PatientID']; + remark = json['Remark']; + resultDesc = json['ResultDesc']; + resultValue = json['ResultValue']; + unit = json['Unit']; + weekAverageResult = json['WeekAverageResult']; + weekDesc = json['WeekDesc']; + yearAverageResult = json['YearAverageResult']; + } + + Map toJson() { + final Map data = new Map(); + data['ChartMonth'] = this.chartMonth; + data['ChartYear'] = this.chartYear; + data['DateChart'] = DateUtil.convertDateToString(this.dateChart); + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['DiabtecAvarage'] = this.diabtecAvarage; + data['IsActive'] = this.isActive; + data['LineItemNo'] = this.lineItemNo; + data['List_Month'] = this.listMonth; + data['List_Week'] = this.listWeek; + data['Measured'] = this.measured; + data['MeasuredDesc'] = this.measuredDesc; + data['MonthAverageResult'] = this.monthAverageResult; + data['PatientID'] = this.patientID; + data['Remark'] = this.remark; + data['ResultDesc'] = this.resultDesc; + data['ResultValue'] = this.resultValue; + data['Unit'] = this.unit; + data['WeekAverageResult'] = this.weekAverageResult; + data['WeekDesc'] = this.weekDesc; + data['YearAverageResult'] = this.yearAverageResult; + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_sugar/MonthDiabtectResultAverage.dart b/lib/core/model/my_trakers/blood_sugar/MonthDiabtectResultAverage.dart new file mode 100644 index 00000000..65522098 --- /dev/null +++ b/lib/core/model/my_trakers/blood_sugar/MonthDiabtectResultAverage.dart @@ -0,0 +1,36 @@ +class MonthDiabtectResultAverage { + var weekfourAverageResult; + var weekthreeAverageResult; + var weektwoAverageResult; + var weekoneAverageResult; + dynamic weekAverageResult; + String weekDesc; + + MonthDiabtectResultAverage( + {this.weekfourAverageResult, + this.weekthreeAverageResult, + this.weektwoAverageResult, + this.weekoneAverageResult, + this.weekAverageResult, + this.weekDesc}); + + MonthDiabtectResultAverage.fromJson(Map json) { + weekfourAverageResult = json['weekfourAverageResult']; + weekthreeAverageResult = json['weekthreeAverageResult']; + weektwoAverageResult = json['weektwoAverageResult']; + weekoneAverageResult = json['weekoneAverageResult']; + weekAverageResult = json['WeekAverageResult']; + weekDesc = json['WeekDesc']; + } + + Map toJson() { + final Map data = new Map(); + data['weekfourAverageResult'] = this.weekfourAverageResult; + data['weekthreeAverageResult'] = this.weekthreeAverageResult; + data['weektwoAverageResult'] = this.weektwoAverageResult; + data['weekoneAverageResult'] = this.weekoneAverageResult; + data['WeekAverageResult'] = this.weekAverageResult; + data['WeekDesc'] = this.weekDesc; + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart b/lib/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart new file mode 100644 index 00000000..c18e5433 --- /dev/null +++ b/lib/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart @@ -0,0 +1,20 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class WeekDiabtectResultAverage { + int dailyAverageResult; + DateTime dateChart; + + WeekDiabtectResultAverage({this.dailyAverageResult, this.dateChart}); + + WeekDiabtectResultAverage.fromJson(Map json) { + dailyAverageResult = json['DailyAverageResult']; + dateChart = DateUtil.convertStringToDate(json['DateChart']); + } + + Map toJson() { + final Map data = new Map(); + data['DailyAverageResult'] = this.dailyAverageResult; + data['DateChart'] = DateUtil.convertDateToString(this.dateChart); + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_sugar/YearDiabtecResultAverage.dart b/lib/core/model/my_trakers/blood_sugar/YearDiabtecResultAverage.dart new file mode 100644 index 00000000..cfdec286 --- /dev/null +++ b/lib/core/model/my_trakers/blood_sugar/YearDiabtecResultAverage.dart @@ -0,0 +1,36 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class YearDiabtecResultAverage { + dynamic monthAverageResult; + var monthNumber; + String monthName; + String yearName; + DateTime date; + + YearDiabtecResultAverage( + {this.monthAverageResult, + this.monthNumber, + this.monthName, + this.yearName}); + + YearDiabtecResultAverage.fromJson(Map json) { + try { + monthAverageResult = json['monthAverageResult']; + monthNumber = json['monthNumber']; + monthName = json['monthName']; + yearName = json['yearName']; + date = DateUtil.getMonthDateTime(monthName,yearName); + } catch (e) { + print(e); + } + } + + Map toJson() { + final Map data = new Map(); + data['monthAverageResult'] = this.monthAverageResult; + data['monthNumber'] = this.monthNumber; + data['monthName'] = this.monthName; + data['yearName'] = this.yearName; + return data; + } +} diff --git a/lib/core/model/my_trakers/chartData/WeekChartDate.dart b/lib/core/model/my_trakers/chartData/WeekChartDate.dart new file mode 100644 index 00000000..d972265d --- /dev/null +++ b/lib/core/model/my_trakers/chartData/WeekChartDate.dart @@ -0,0 +1,6 @@ +class WeekChartDate { + final DateTime x; + final dynamic y; + + WeekChartDate({this.x, this.y}); +} \ No newline at end of file diff --git a/lib/core/model/my_trakers/chartData/YearMonthlyChartDate.dart b/lib/core/model/my_trakers/chartData/YearMonthlyChartDate.dart new file mode 100644 index 00000000..96adca21 --- /dev/null +++ b/lib/core/model/my_trakers/chartData/YearMonthlyChartDate.dart @@ -0,0 +1,6 @@ + class YearMonthlyChartDate { + final dynamic x; + final dynamic y; + + YearMonthlyChartDate({this.x, this.y}); +} diff --git a/lib/core/model/my_trakers/weight/MonthWeightMeasurementResultAverage.dart b/lib/core/model/my_trakers/weight/MonthWeightMeasurementResultAverage.dart new file mode 100644 index 00000000..8165302d --- /dev/null +++ b/lib/core/model/my_trakers/weight/MonthWeightMeasurementResultAverage.dart @@ -0,0 +1,36 @@ +class MonthWeightMeasurementResultAverage { + dynamic weekfourAverageResult; + dynamic weekthreeAverageResult; + dynamic weektwoAverageResult; + dynamic weekoneAverageResult; + dynamic weekAverageResult; + String weekDesc; + + MonthWeightMeasurementResultAverage( + {this.weekfourAverageResult, + this.weekthreeAverageResult, + this.weektwoAverageResult, + this.weekoneAverageResult, + this.weekAverageResult, + this.weekDesc}); + + MonthWeightMeasurementResultAverage.fromJson(Map json) { + weekfourAverageResult = json['weekfourAverageResult']; + weekthreeAverageResult = json['weekthreeAverageResult']; + weektwoAverageResult = json['weektwoAverageResult']; + weekoneAverageResult = json['weekoneAverageResult']; + weekAverageResult = json['WeekAverageResult']; + weekDesc = json['WeekDesc']; + } + + Map toJson() { + final Map data = new Map(); + data['weekfourAverageResult'] = this.weekfourAverageResult; + data['weekthreeAverageResult'] = this.weekthreeAverageResult; + data['weektwoAverageResult'] = this.weektwoAverageResult; + data['weekoneAverageResult'] = this.weekoneAverageResult; + data['WeekAverageResult'] = this.weekAverageResult; + data['WeekDesc'] = this.weekDesc; + return data; + } +} diff --git a/lib/core/model/my_trakers/weight/WeekWeightMeasurementResultAverage.dart b/lib/core/model/my_trakers/weight/WeekWeightMeasurementResultAverage.dart new file mode 100644 index 00000000..b7345ad7 --- /dev/null +++ b/lib/core/model/my_trakers/weight/WeekWeightMeasurementResultAverage.dart @@ -0,0 +1,21 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class WeekWeightMeasurementResultAverage { + dynamic dailyAverageResult; + DateTime weightDate; + + WeekWeightMeasurementResultAverage( + {this.dailyAverageResult, this.weightDate}); + + WeekWeightMeasurementResultAverage.fromJson(Map json) { + dailyAverageResult = json['DailyAverageResult']; + weightDate = DateUtil.convertStringToDate(json['WeightDate']); + } + + Map toJson() { + final Map data = new Map(); + data['DailyAverageResult'] = this.dailyAverageResult; + data['WeightDate'] = this.weightDate; + return data; + } +} diff --git a/lib/core/model/my_trakers/weight/WeightMeasurementResult.dart b/lib/core/model/my_trakers/weight/WeightMeasurementResult.dart new file mode 100644 index 00000000..337e8662 --- /dev/null +++ b/lib/core/model/my_trakers/weight/WeightMeasurementResult.dart @@ -0,0 +1,74 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class WeightMeasurementResult { + int patientID; + int lineItemNo; + int weightMeasured; + DateTime weightDate; + dynamic remark; + bool isActive; + int measured; + dynamic unit; + int chartYear; + dynamic chartMonth; + double yearAverageResult; + dynamic monthAverageResult; + dynamic weekAverageResult; + dynamic weekDesc; + + WeightMeasurementResult( + {this.patientID, + this.lineItemNo, + this.weightMeasured, + this.weightDate, + this.remark, + this.isActive, + this.measured, + this.unit, + this.chartYear, + this.chartMonth, + this.yearAverageResult, + this.monthAverageResult, + this.weekAverageResult, + this.weekDesc}); + + WeightMeasurementResult.fromJson(Map json) { + try { + patientID = json['PatientID']; + lineItemNo = json['LineItemNo']; + weightMeasured = json['WeightMeasured']; + weightDate = DateUtil.convertStringToDate(json['WeightDate']); + remark = json['Remark']; + isActive = json['IsActive']; + measured = json['Measured']; + unit = json['Unit']; + chartYear = json['ChartYear']; + chartMonth = json['ChartMonth']; + yearAverageResult = json['YearAverageResult']; + monthAverageResult = json['MonthAverageResult']; + weekAverageResult = json['WeekAverageResult']; + weekDesc = json['WeekDesc']; + } catch (e) { + print(e); + } + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['LineItemNo'] = this.lineItemNo; + data['WeightMeasured'] = this.weightMeasured; + data['WeightDate'] = this.weightDate; + data['Remark'] = this.remark; + data['IsActive'] = this.isActive; + data['Measured'] = this.measured; + data['Unit'] = this.unit; + data['ChartYear'] = this.chartYear; + data['ChartMonth'] = this.chartMonth; + data['YearAverageResult'] = this.yearAverageResult; + data['MonthAverageResult'] = this.monthAverageResult; + data['WeekAverageResult'] = this.weekAverageResult; + data['WeekDesc'] = this.weekDesc; + return data; + } +} diff --git a/lib/core/model/my_trakers/weight/YearWeightMeasurementResultAverage.dart b/lib/core/model/my_trakers/weight/YearWeightMeasurementResultAverage.dart new file mode 100644 index 00000000..c2e20cb9 --- /dev/null +++ b/lib/core/model/my_trakers/weight/YearWeightMeasurementResultAverage.dart @@ -0,0 +1,33 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class YearWeightMeasurementResultAverage { + dynamic monthAverageResult; + int monthNumber; + String monthName; + String yearName; + DateTime date; + + YearWeightMeasurementResultAverage( + {this.monthAverageResult, + this.monthNumber, + this.monthName, + this.yearName}); + + YearWeightMeasurementResultAverage.fromJson(Map json) { + monthAverageResult = json['monthAverageResult']; + monthNumber = json['monthNumber']; + monthName = json['monthName']; + yearName = json['yearName']; + date = DateUtil.getMonthDateTime(monthName,yearName); + + } + + Map toJson() { + final Map data = new Map(); + data['monthAverageResult'] = this.monthAverageResult; + data['monthNumber'] = this.monthNumber; + data['monthName'] = this.monthName; + data['yearName'] = this.yearName; + return data; + } +} diff --git a/lib/core/model/notifications/get_notifications_request_model.dart b/lib/core/model/notifications/get_notifications_request_model.dart new file mode 100644 index 00000000..9659754a --- /dev/null +++ b/lib/core/model/notifications/get_notifications_request_model.dart @@ -0,0 +1,22 @@ +class GetNotificationsRequestModel { + int notificationStatusID; + int pagingSize; + int currentPage; + + GetNotificationsRequestModel( + {this.notificationStatusID, this.pagingSize, this.currentPage}); + + GetNotificationsRequestModel.fromJson(Map json) { + notificationStatusID = json['NotificationStatusID']; + pagingSize = json['pagingSize']; + currentPage = json['currentPage']; + } + + Map toJson() { + final Map data = new Map(); + data['NotificationStatusID'] = this.notificationStatusID; + data['pagingSize'] = this.pagingSize; + data['currentPage'] = this.currentPage; + return data; + } +} diff --git a/lib/core/model/notifications/get_notifications_response_model.dart b/lib/core/model/notifications/get_notifications_response_model.dart new file mode 100644 index 00000000..1f3bbc28 --- /dev/null +++ b/lib/core/model/notifications/get_notifications_response_model.dart @@ -0,0 +1,96 @@ +class GetNotificationsResponseModel { + int id; + int recordId; + int patientID; + bool projectOutSA; + String deviceType; + String deviceToken; + String message; + String messageType; + String messageTypeData; + dynamic videoURL; + bool isQueue; + String isQueueOn; + String createdOn; + String createdBy; + String notificationType; + bool isSent; + String isSentOn; + bool isRead; + String isReadOn; + int channelID; + int projectID; + + GetNotificationsResponseModel( + {this.id, + this.recordId, + this.patientID, + this.projectOutSA, + this.deviceType, + this.deviceToken, + this.message, + this.messageType, + this.messageTypeData, + this.videoURL, + this.isQueue, + this.isQueueOn, + this.createdOn, + this.createdBy, + this.notificationType, + this.isSent, + this.isSentOn, + this.isRead, + this.isReadOn, + this.channelID, + this.projectID}); + + GetNotificationsResponseModel.fromJson(Map json) { + id = json['Id']; + recordId = json['RecordId']; + patientID = json['PatientID']; + projectOutSA = json['ProjectOutSA']; + deviceType = json['DeviceType']; + deviceToken = json['DeviceToken']; + message = json['Message']; + messageType = json['MessageType']; + messageTypeData = json['MessageTypeData']; + videoURL = json['VideoURL']; + isQueue = json['IsQueue']; + isQueueOn = json['IsQueueOn']; + createdOn = json['CreatedOn']; + createdBy = json['CreatedBy']; + notificationType = json['NotificationType']; + isSent = json['IsSent']; + isSentOn = json['IsSentOn']; + isRead = json['IsRead']; + isReadOn = json['IsReadOn']; + channelID = json['ChannelID']; + projectID = json['ProjectID']; + } + + Map toJson() { + final Map data = new Map(); + data['Id'] = this.id; + data['RecordId'] = this.recordId; + data['PatientID'] = this.patientID; + data['ProjectOutSA'] = this.projectOutSA; + data['DeviceType'] = this.deviceType; + data['DeviceToken'] = this.deviceToken; + data['Message'] = this.message; + data['MessageType'] = this.messageType; + data['MessageTypeData'] = this.messageTypeData; + data['VideoURL'] = this.videoURL; + data['IsQueue'] = this.isQueue; + data['IsQueueOn'] = this.isQueueOn; + data['CreatedOn'] = this.createdOn; + data['CreatedBy'] = this.createdBy; + data['NotificationType'] = this.notificationType; + data['IsSent'] = this.isSent; + data['IsSentOn'] = this.isSentOn; + data['IsRead'] = this.isRead; + data['IsReadOn'] = this.isReadOn; + data['ChannelID'] = this.channelID; + data['ProjectID'] = this.projectID; + return data; + } +} diff --git a/lib/core/model/notifications/mark_message_as_read_request_model.dart b/lib/core/model/notifications/mark_message_as_read_request_model.dart new file mode 100644 index 00000000..99dab006 --- /dev/null +++ b/lib/core/model/notifications/mark_message_as_read_request_model.dart @@ -0,0 +1,15 @@ +class MarkMessageAsReadRequestModel { + int notificationPoolID; + + MarkMessageAsReadRequestModel({this.notificationPoolID}); + + MarkMessageAsReadRequestModel.fromJson(Map json) { + notificationPoolID = json['NotificationPoolID']; + } + + Map toJson() { + final Map data = new Map(); + data['NotificationPoolID'] = this.notificationPoolID; + return data; + } +} diff --git a/lib/core/model/packages_offers/requests/OffersCategoriesRequestModel.dart b/lib/core/model/packages_offers/requests/OffersCategoriesRequestModel.dart new file mode 100644 index 00000000..f2f4af11 --- /dev/null +++ b/lib/core/model/packages_offers/requests/OffersCategoriesRequestModel.dart @@ -0,0 +1,11 @@ +class OffersCategoriesRequestModel { + final int limit; + final int page; + final int sinceId; + + OffersCategoriesRequestModel({this.limit, this.page, this.sinceId}); + + Map toFlatMap() { + return {"limit": limit.toString(), "page": page.toString(), "sinceId": sinceId.toString()}; + } +} diff --git a/lib/core/model/packages_offers/requests/OffersProductsRequestModel.dart b/lib/core/model/packages_offers/requests/OffersProductsRequestModel.dart new file mode 100644 index 00000000..84862568 --- /dev/null +++ b/lib/core/model/packages_offers/requests/OffersProductsRequestModel.dart @@ -0,0 +1,12 @@ +class OffersProductsRequestModel { + final int categoryId; + final int limit; + final int page; + final int sinceId; + + OffersProductsRequestModel({this.categoryId, this.limit, this.page, this.sinceId}); + + Map toFlatMap() { + return {"limit": limit.toString(), "page": page.toString(), "sinceId": sinceId.toString(), "categoryId": categoryId.toString()}; + } +} diff --git a/lib/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart b/lib/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart new file mode 100644 index 00000000..087f1961 --- /dev/null +++ b/lib/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart @@ -0,0 +1,65 @@ +import 'package:diplomaticquarterapp/generated/json/base/json_convert_content.dart'; +import 'package:diplomaticquarterapp/generated/json/base/json_field.dart'; + +class OfferCategoriesResponseModel with JsonConvert { + String id; + String name; + String namen; + @JSONField(name: "localized_names") + List localizedNames; + dynamic description; + @JSONField(name: "category_template_id") + int categoryTemplateId; + @JSONField(name: "meta_keywords") + String metaKeywords; + @JSONField(name: "meta_description") + String metaDescription; + @JSONField(name: "meta_title") + String metaTitle; + @JSONField(name: "parent_category_id") + int parentCategoryId; + @JSONField(name: "page_size") + int pageSize; + @JSONField(name: "page_size_options") + String pageSizeOptions; + @JSONField(name: "price_ranges") + dynamic priceRanges; + @JSONField(name: "show_on_home_page") + bool showOnHomePage; + @JSONField(name: "include_in_top_menu") + bool includeInTopMenu; + @JSONField(name: "has_discounts_applied") + dynamic hasDiscountsApplied; + bool published; + bool deleted; + @JSONField(name: "display_order") + int displayOrder; + @JSONField(name: "created_on_utc") + String createdOnUtc; + @JSONField(name: "updated_on_utc") + String updatedOnUtc; + @JSONField(name: "role_ids") + List roleIds; + @JSONField(name: "discount_ids") + List discountIds; + @JSONField(name: "store_ids") + List storeIds; + OfferCategoriesResponseModelImage image; + @JSONField(name: "se_name") + String seName; + @JSONField(name: "is_leaf") + bool isLeaf; +} + +class OfferCategoriesResponseModelLocalizedName with JsonConvert { + @JSONField(name: "language_id") + int languageId; + @JSONField(name: "localized_name") + String localizedName; +} + +class OfferCategoriesResponseModelImage with JsonConvert { + String src; + dynamic thumb; + dynamic attachment; +} diff --git a/lib/core/model/packages_offers/responses/OfferProductsResponseModel.dart b/lib/core/model/packages_offers/responses/OfferProductsResponseModel.dart new file mode 100644 index 00000000..58481a8b --- /dev/null +++ b/lib/core/model/packages_offers/responses/OfferProductsResponseModel.dart @@ -0,0 +1,235 @@ +import 'package:diplomaticquarterapp/generated/json/base/json_convert_content.dart'; +import 'package:diplomaticquarterapp/generated/json/base/json_field.dart'; + +class OfferProductsResponseModel with JsonConvert { + String id; + @JSONField(name: "visible_individually") + bool visibleIndividually; + String name; + String namen; + @JSONField(name: "localized_names") + List localizedNames; + @JSONField(name: "short_description") + String shortDescription; + @JSONField(name: "short_descriptionn") + String shortDescriptionn; + @JSONField(name: "full_description") + String fullDescription; + @JSONField(name: "full_descriptionn") + String fullDescriptionn; + @JSONField(name: "markas_new") + bool markasNew; + @JSONField(name: "show_on_home_page") + bool showOnHomePage; + @JSONField(name: "meta_keywords") + dynamic metaKeywords; + @JSONField(name: "meta_description") + dynamic metaDescription; + @JSONField(name: "meta_title") + dynamic metaTitle; + @JSONField(name: "allow_customer_reviews") + bool allowCustomerReviews; + @JSONField(name: "approved_rating_sum") + int approvedRatingSum; + @JSONField(name: "not_approved_rating_sum") + int notApprovedRatingSum; + @JSONField(name: "approved_total_reviews") + int approvedTotalReviews; + @JSONField(name: "not_approved_total_reviews") + int notApprovedTotalReviews; + String sku; + @JSONField(name: "is_rx") + bool isRx; + @JSONField(name: "prescription_required") + bool prescriptionRequired; + @JSONField(name: "rx_message") + dynamic rxMessage; + @JSONField(name: "rx_messagen") + dynamic rxMessagen; + @JSONField(name: "manufacturer_part_number") + dynamic manufacturerPartNumber; + dynamic gtin; + @JSONField(name: "is_gift_card") + bool isGiftCard; + @JSONField(name: "require_other_products") + bool requireOtherProducts; + @JSONField(name: "automatically_add_required_products") + bool automaticallyAddRequiredProducts; + @JSONField(name: "is_download") + bool isDownload; + @JSONField(name: "unlimited_downloads") + bool unlimitedDownloads; + @JSONField(name: "max_number_of_downloads") + int maxNumberOfDownloads; + @JSONField(name: "download_expiration_days") + dynamic downloadExpirationDays; + @JSONField(name: "has_sample_download") + bool hasSampleDownload; + @JSONField(name: "has_user_agreement") + bool hasUserAgreement; + @JSONField(name: "is_recurring") + bool isRecurring; + @JSONField(name: "recurring_cycle_length") + int recurringCycleLength; + @JSONField(name: "recurring_total_cycles") + int recurringTotalCycles; + @JSONField(name: "is_rental") + bool isRental; + @JSONField(name: "rental_price_length") + int rentalPriceLength; + @JSONField(name: "is_ship_enabled") + bool isShipEnabled; + @JSONField(name: "is_free_shipping") + bool isFreeShipping; + @JSONField(name: "ship_separately") + bool shipSeparately; + @JSONField(name: "additional_shipping_charge") + double additionalShippingCharge; + @JSONField(name: "is_tax_exempt") + bool isTaxExempt; + @JSONField(name: "is_telecommunications_or_broadcasting_or_electronic_services") + bool isTelecommunicationsOrBroadcastingOrElectronicServices; + @JSONField(name: "use_multiple_warehouses") + bool useMultipleWarehouses; + @JSONField(name: "manage_inventory_method_id") + int manageInventoryMethodId; + @JSONField(name: "stock_quantity") + int stockQuantity; + @JSONField(name: "stock_availability") + String stockAvailability; + @JSONField(name: "stock_availabilityn") + String stockAvailabilityn; + @JSONField(name: "display_stock_availability") + bool displayStockAvailability; + @JSONField(name: "display_stock_quantity") + bool displayStockQuantity; + @JSONField(name: "min_stock_quantity") + int minStockQuantity; + @JSONField(name: "notify_admin_for_quantity_below") + int notifyAdminForQuantityBelow; + @JSONField(name: "allow_back_in_stock_subscriptions") + bool allowBackInStockSubscriptions; + @JSONField(name: "order_minimum_quantity") + int orderMinimumQuantity; + @JSONField(name: "order_maximum_quantity") + int orderMaximumQuantity; + @JSONField(name: "allowed_quantities") + dynamic allowedQuantities; + @JSONField(name: "allow_adding_only_existing_attribute_combinations") + bool allowAddingOnlyExistingAttributeCombinations; + @JSONField(name: "disable_buy_button") + bool disableBuyButton; + @JSONField(name: "disable_wishlist_button") + bool disableWishlistButton; + @JSONField(name: "available_for_pre_order") + bool availableForPreOrder; + @JSONField(name: "pre_order_availability_start_date_time_utc") + dynamic preOrderAvailabilityStartDateTimeUtc; + @JSONField(name: "call_for_price") + bool callForPrice; + double price; + @JSONField(name: "old_price") + double oldPrice; + @JSONField(name: "product_cost") + double productCost; + @JSONField(name: "special_price") + dynamic specialPrice; + @JSONField(name: "special_price_start_date_time_utc") + dynamic specialPriceStartDateTimeUtc; + @JSONField(name: "special_price_end_date_time_utc") + dynamic specialPriceEndDateTimeUtc; + @JSONField(name: "customer_enters_price") + bool customerEntersPrice; + @JSONField(name: "minimum_customer_entered_price") + double minimumCustomerEnteredPrice; + @JSONField(name: "maximum_customer_entered_price") + double maximumCustomerEnteredPrice; + @JSONField(name: "baseprice_enabled") + bool basepriceEnabled; + @JSONField(name: "baseprice_amount") + double basepriceAmount; + @JSONField(name: "baseprice_base_amount") + double basepriceBaseAmount; + @JSONField(name: "has_tier_prices") + bool hasTierPrices; + @JSONField(name: "has_discounts_applied") + bool hasDiscountsApplied; + @JSONField(name: "discount_name") + dynamic discountName; + @JSONField(name: "discount_namen") + dynamic discountNamen; + @JSONField(name: "discount_description") + dynamic discountDescription; + @JSONField(name: "discount_Descriptionn") + dynamic discountDescriptionn; + @JSONField(name: "discount_percentage") + dynamic discountPercentage; + String currency; + String currencyn; + double weight; + double length; + double width; + double height; + @JSONField(name: "available_start_date_time_utc") + dynamic availableStartDateTimeUtc; + @JSONField(name: "available_end_date_time_utc") + dynamic availableEndDateTimeUtc; + @JSONField(name: "display_order") + int displayOrder; + bool published; + bool deleted; + @JSONField(name: "created_on_utc") + String createdOnUtc; + @JSONField(name: "updated_on_utc") + String updatedOnUtc; + @JSONField(name: "product_type") + String productType; + @JSONField(name: "parent_grouped_product_id") + int parentGroupedProductId; + @JSONField(name: "role_ids") + List roleIds; + @JSONField(name: "discount_ids") + List discountIds; + @JSONField(name: "store_ids") + List storeIds; + @JSONField(name: "manufacturer_ids") + List manufacturerIds; + List reviews; + List images; + List attributes; + List specifications; + @JSONField(name: "associated_product_ids") + List associatedProductIds; + List tags; + @JSONField(name: "vendor_id") + int vendorId; + @JSONField(name: "se_name") + String seName; +} + +class OfferProductsResponseModelLocalizedName with JsonConvert { + @JSONField(name: "language_id") + int languageId; + @JSONField(name: "localized_name") + String localizedName; +} + +class OfferProductsResponseModelImage with JsonConvert { + int id; + int position; + String src; + String thumb; + String attachment; +} + +class OfferProductsResponseModelSpecification with JsonConvert { + int id; + @JSONField(name: "display_order") + int displayOrder; + @JSONField(name: "default_value") + String defaultValue; + @JSONField(name: "default_valuen") + String defaultValuen; + String name; + String nameN; +} diff --git a/lib/core/model/pharmacies/Addresses.dart b/lib/core/model/pharmacies/Addresses.dart new file mode 100644 index 00000000..74d5a591 --- /dev/null +++ b/lib/core/model/pharmacies/Addresses.dart @@ -0,0 +1,85 @@ +class Addresses { + String id; + String firstName; + String lastName; + String email; + String company; + int countryId; + String country; + String stateProvinceId; + String city; + String address1; + String address2; + String zipPostalCode; + String phoneNumber; + String faxNumber; + String customerAttributes; + String createdOnUtc; + String province; + String latLong; + + Addresses( + {this.id, + this.firstName, + this.lastName, + this.email, + this.company, + this.countryId, + this.country, + this.stateProvinceId, + this.city, + this.address1, + this.address2, + this.zipPostalCode, + this.phoneNumber, + this.faxNumber, + this.customerAttributes, + this.createdOnUtc, + this.province, + this.latLong}); + + Addresses.fromJson(Map json) { + id = json['id']; + firstName = json['first_name']; + lastName = json['last_name']; + email = json['email']; + company = json['company']; + countryId = json['country_id']; + country = json['country']; + stateProvinceId = json['state_province_id']; + city = json['city']; + address1 = json['address1']; + address2 = json['address2']; + zipPostalCode = json['zip_postal_code']; + phoneNumber = json['phone_number']; + faxNumber = json['fax_number']; + customerAttributes = json['customer_attributes']; + createdOnUtc = json['created_on_utc']; + province = json['province']; + latLong = json['lat_long']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['first_name'] = this.firstName; + data['last_name'] = this.lastName; + data['email'] = this.email; + data['company'] = this.company; + data['country_id'] = this.countryId; + data['country'] = this.country; + data['state_province_id'] = this.stateProvinceId; + data['city'] = this.city; + data['address1'] = this.address1; + data['address2'] = this.address2; + data['zip_postal_code'] = this.zipPostalCode; + data['phone_number'] = this.phoneNumber; + data['fax_number'] = this.faxNumber; + data['customer_attributes'] = this.customerAttributes; + data['created_on_utc'] = this.createdOnUtc; + data['province'] = this.province; + data['lat_long'] = this.latLong; + return data; + } + +} diff --git a/lib/core/model/pharmacies/Customer.dart b/lib/core/model/pharmacies/Customer.dart new file mode 100644 index 00000000..a5311489 --- /dev/null +++ b/lib/core/model/pharmacies/Customer.dart @@ -0,0 +1,128 @@ +class Customer { + String fileNumber; + String iqamaNumber; + int isOutSa; + int patientType; + String gender; + String birthDate; + String phone; + String countryCode; + String yahalaAccountno; + String billingAddress; + String shippingAddress; + String id; + String username; + String email; + String firstName; + String lastName; + String languageId; + String adminComment; + String isTaxExempt; + String hasShoppingCartItems; + String active; + String deleted; + String isSystemAccount; + String systemName; + String lastIpAddress; + String createdOnUtc; + String lastLoginDateUtc; + String lastActivityDateUtc; + String registeredInStoreId; + + Customer( + {this.fileNumber, + this.iqamaNumber, + this.isOutSa, + this.patientType, + this.gender, + this.birthDate, + this.phone, + this.countryCode, + this.yahalaAccountno, + this.billingAddress, + this.shippingAddress, + this.id, + this.username, + this.email, + this.firstName, + this.lastName, + this.languageId, + this.adminComment, + this.isTaxExempt, + this.hasShoppingCartItems, + this.active, + this.deleted, + this.isSystemAccount, + this.systemName, + this.lastIpAddress, + this.createdOnUtc, + this.lastLoginDateUtc, + this.lastActivityDateUtc, + this.registeredInStoreId}); + + Customer.fromJson(Map json) { + fileNumber = json['file_number']; + iqamaNumber = json['iqama_number']; + isOutSa = json['is_out_sa']; + patientType = json['patient_type']; + gender = json['gender']; + birthDate = json['birth_date']; + phone = json['phone']; + countryCode = json['country_code']; + yahalaAccountno = json['yahala_accountno']; + billingAddress = json['billing_address']; + shippingAddress = json['shipping_address']; + id = json['id']; + username = json['username']; + email = json['email']; + firstName = json['first_name']; + lastName = json['last_name']; + languageId = json['language_id']; + adminComment = json['admin_comment']; + isTaxExempt = json['is_tax_exempt']; + hasShoppingCartItems = json['has_shopping_cart_items']; + active = json['active']; + deleted = json['deleted']; + isSystemAccount = json['is_system_account']; + systemName = json['system_name']; + lastIpAddress = json['last_ip_address']; + createdOnUtc = json['created_on_utc']; + lastLoginDateUtc = json['last_login_date_utc']; + lastActivityDateUtc = json['last_activity_date_utc']; + registeredInStoreId = json['registered_in_store_id']; + } + + Map toJson() { + final Map data = new Map(); + data['file_number'] = this.fileNumber; + data['iqama_number'] = this.iqamaNumber; + data['is_out_sa'] = this.isOutSa; + data['patient_type'] = this.patientType; + data['gender'] = this.gender; + data['birth_date'] = this.birthDate; + data['phone'] = this.phone; + data['country_code'] = this.countryCode; + data['yahala_accountno'] = this.yahalaAccountno; + data['billing_address'] = this.billingAddress; + data['shipping_address'] = this.shippingAddress; + data['id'] = this.id; + data['username'] = this.username; + data['email'] = this.email; + data['first_name'] = this.firstName; + data['last_name'] = this.lastName; + data['language_id'] = this.languageId; + data['admin_comment'] = this.adminComment; + data['is_tax_exempt'] = this.isTaxExempt; + data['has_shopping_cart_items'] = this.hasShoppingCartItems; + data['active'] = this.active; + data['deleted'] = this.deleted; + data['is_system_account'] = this.isSystemAccount; + data['system_name'] = this.systemName; + data['last_ip_address'] = this.lastIpAddress; + data['created_on_utc'] = this.createdOnUtc; + data['last_login_date_utc'] = this.lastLoginDateUtc; + data['last_activity_date_utc'] = this.lastActivityDateUtc; + data['registered_in_store_id'] = this.registeredInStoreId; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/pharmacies/Manufacturer.dart b/lib/core/model/pharmacies/Manufacturer.dart new file mode 100644 index 00000000..3b16337b --- /dev/null +++ b/lib/core/model/pharmacies/Manufacturer.dart @@ -0,0 +1,98 @@ +import 'PharmacyImageObject.dart'; + +class Manufacturer { + String id; + String name; + String namen; + // List localizedNames; + String description; + int manufacturerTemplateId; + String metaKeywords; + String metaDescription; + String metaTitle; + int pageSize; + String pageSizeOptions; + String priceRanges; + bool published; + bool deleted; + int displayOrder; + String createdOnUtc; + String updatedOnUtc; + PharmacyImageObject image; + + Manufacturer( + {this.id, + this.name, + this.namen, + // this.localizedNames, + this.description, + this.manufacturerTemplateId, + this.metaKeywords, + this.metaDescription, + this.metaTitle, + this.pageSize, + this.pageSizeOptions, + this.priceRanges, + this.published, + this.deleted, + this.displayOrder, + this.createdOnUtc, + this.updatedOnUtc, + this.image}); + + Manufacturer.fromJson(Map json) { + id = json['id']; + name = json['name']; + namen = json['namen']; + // if (json['localized_names'] != null) { + // localizedNames = new List(); + // json['localized_names'].forEach((v) { + // localizedNames.add(new LocalizedNames.fromJson(v)); + // }); + // } + description = json['description']; + manufacturerTemplateId = json['manufacturer_template_id']; + metaKeywords = json['meta_keywords']; + metaDescription = json['meta_description']; + metaTitle = json['meta_title']; + pageSize = json['page_size']; + pageSizeOptions = json['page_size_options']; + priceRanges = json['price_ranges']; + published = json['published']; + deleted = json['deleted']; + displayOrder = json['display_order']; + createdOnUtc = json['created_on_utc']; + updatedOnUtc = json['updated_on_utc']; + image = json['image'] != null + ? new PharmacyImageObject.fromJson(json['image']) + : null; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + data['namen'] = this.namen; + // if (this.localizedNames != null) { + // data['localized_names'] = + // this.localizedNames.map((v) => v.toJson()).toList(); + // } + data['description'] = this.description; + data['manufacturer_template_id'] = this.manufacturerTemplateId; + data['meta_keywords'] = this.metaKeywords; + data['meta_description'] = this.metaDescription; + data['meta_title'] = this.metaTitle; + data['page_size'] = this.pageSize; + data['page_size_options'] = this.pageSizeOptions; + data['price_ranges'] = this.priceRanges; + data['published'] = this.published; + data['deleted'] = this.deleted; + data['display_order'] = this.displayOrder; + data['created_on_utc'] = this.createdOnUtc; + data['updated_on_utc'] = this.updatedOnUtc; + if (this.image != null) { + data['image'] = this.image.toJson(); + } + return data; + } +} diff --git a/lib/core/model/pharmacies/PharmacyImageObject.dart b/lib/core/model/pharmacies/PharmacyImageObject.dart new file mode 100644 index 00000000..d3db634b --- /dev/null +++ b/lib/core/model/pharmacies/PharmacyImageObject.dart @@ -0,0 +1,27 @@ +class PharmacyImageObject { + int id; + int position; + String src; + String thumb; + String attachment; + + PharmacyImageObject({this.id, this.position, this.src, this.thumb, this.attachment}); + + PharmacyImageObject.fromJson(Map json) { + id = json['id']; + position = json['position']; + src = json['src']; + thumb = json['thumb']; + attachment = json['attachment']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['position'] = this.position; + data['src'] = this.src; + data['thumb'] = this.thumb; + data['attachment'] = this.attachment; + return data; + } +} diff --git a/lib/core/model/pharmacies/PharmacyProduct.dart b/lib/core/model/pharmacies/PharmacyProduct.dart new file mode 100644 index 00000000..cd461ae5 --- /dev/null +++ b/lib/core/model/pharmacies/PharmacyProduct.dart @@ -0,0 +1,149 @@ +import 'PharmacyImageObject.dart'; +import 'Reviews.dart'; + +class PharmacyProduct { + String id; + String name; + String namen; + String shortDescription; + String fullDescription; + String fullDescriptionn; + int approvedRatingSum; + int approvedTotalReviews; + String sku; + bool isRx; + String rxMessage; + String rxMessagen; + int stockQuantity; + String stockAvailability; + String stockAvailabilityn; + bool allowBackInStockSubscriptions; + int orderMinimumQuantity; + int orderMaximumQuantity; + double price; + double oldPrice; + String discountName; + String discountNamen; + String discountPercentage; + int displayOrder; + List discountIds; + List reviews; + List images; + + PharmacyProduct( + {this.id, + this.name, + this.namen, + this.shortDescription, + this.fullDescription, + this.fullDescriptionn, + this.approvedRatingSum, + this.approvedTotalReviews, + this.sku, + this.isRx, + this.rxMessage, + this.rxMessagen, + this.stockQuantity, + this.stockAvailability, + this.stockAvailabilityn, + this.allowBackInStockSubscriptions, + this.orderMinimumQuantity, + this.orderMaximumQuantity, + this.price, + this.oldPrice, + this.discountName, + this.discountNamen, + this.discountPercentage, + this.displayOrder, + this.discountIds, + this.reviews, + this.images}); + + PharmacyProduct.fromJson(Map json) { + try { + id = json['id']; + name = json['name']; + namen = json['namen']; + shortDescription = json['short_description']; + fullDescription = json['full_description']; + fullDescriptionn = json['full_descriptionn']; + approvedRatingSum = json['approved_rating_sum']; + approvedTotalReviews = json['approved_total_reviews']; + sku = json['sku']; + isRx = json['is_rx']; + rxMessage = json['rx_message']; + rxMessagen = json['rx_messagen']; + stockQuantity = json['stock_quantity']; + stockAvailability = json['stock_availability']; + stockAvailabilityn = json['stock_availabilityn']; + allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions']; + orderMinimumQuantity = json['order_minimum_quantity']; + orderMaximumQuantity = json['order_maximum_quantity']; + price = json['price']; + oldPrice = json['old_price']; + discountName = json['discount_name']; + discountNamen = json['discount_namen']; + discountPercentage = json['discount_percentage']; + displayOrder = json['display_order']; + if (json['discount_ids'] != null) { + discountIds = new List(); + json['discount_ids'].forEach((v) { + discountIds.add(v); + }); + } + if (json['reviews'] != null) { + reviews = new List(); + json['reviews'].forEach((v) { + reviews.add(new Reviews.fromJson(v)); + }); + } + if (json['images'] != null) { + images = new List(); + json['images'].forEach((v) { + images.add(new PharmacyImageObject.fromJson(v)); + }); + } + } catch (e) { + print(e); + } + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + data['namen'] = this.namen; + data['short_description'] = this.shortDescription; + data['full_description'] = this.fullDescription; + data['full_descriptionn'] = this.fullDescriptionn; + data['approved_rating_sum'] = this.approvedRatingSum; + data['approved_total_reviews'] = this.approvedTotalReviews; + data['sku'] = this.sku; + data['is_rx'] = this.isRx; + data['rx_message'] = this.rxMessage; + data['rx_messagen'] = this.rxMessagen; + data['stock_quantity'] = this.stockQuantity; + data['stock_availability'] = this.stockAvailability; + data['stock_availabilityn'] = this.stockAvailabilityn; + data['allow_back_in_stock_subscriptions'] = + this.allowBackInStockSubscriptions; + data['order_minimum_quantity'] = this.orderMinimumQuantity; + data['order_maximum_quantity'] = this.orderMaximumQuantity; + data['price'] = this.price; + data['old_price'] = this.oldPrice; + data['discount_name'] = this.discountName; + data['discount_namen'] = this.discountNamen; + data['discount_percentage'] = this.discountPercentage; + data['display_order'] = this.displayOrder; + if (this.discountIds != String) { + data['discount_ids'] = this.discountIds.map((v) => v).toList(); + } + if (this.reviews != String) { + data['reviews'] = this.reviews.map((v) => v.toJson()).toList(); + } + if (this.images != String) { + data['images'] = this.images.map((v) => v.toJson()).toList(); + } + return data; + } +} diff --git a/lib/core/model/pharmacies/Reviews.dart b/lib/core/model/pharmacies/Reviews.dart new file mode 100644 index 00000000..f924dce3 --- /dev/null +++ b/lib/core/model/pharmacies/Reviews.dart @@ -0,0 +1,82 @@ +import '../pharmacies/Customer.dart'; + +class Reviews { + int id; + int position; + int reviewId; + int customerId; + int productId; + int storeId; + bool isApproved; + String title; + String reviewText; + Null replyText; + int rating; + int helpfulYesTotal; + int helpfulNoTotal; + String createdOnUtc; + Customer customer; + Null product; + + Reviews( + {this.id, + this.position, + this.reviewId, + this.customerId, + this.productId, + this.storeId, + this.isApproved, + this.title, + this.reviewText, + this.replyText, + this.rating, + this.helpfulYesTotal, + this.helpfulNoTotal, + this.createdOnUtc, + this.customer, + this.product}); + + Reviews.fromJson(Map json) { + id = json['id']; + position = json['position']; + reviewId = json['review_id']; + customerId = json['customer_id']; + productId = json['product_id']; + storeId = json['store_id']; + isApproved = json['is_approved']; + title = json['title']; + reviewText = json['review_text']; + replyText = json['reply_text']; + rating = json['rating']; + helpfulYesTotal = json['helpful_yes_total']; + helpfulNoTotal = json['helpful_no_total']; + createdOnUtc = json['created_on_utc']; + customer = json['customer'] != null + ? new Customer.fromJson(json['customer']) + : null; + product = json['product']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['position'] = this.position; + data['review_id'] = this.reviewId; + data['customer_id'] = this.customerId; + data['product_id'] = this.productId; + data['store_id'] = this.storeId; + data['is_approved'] = this.isApproved; + data['title'] = this.title; + data['review_text'] = this.reviewText; + data['reply_text'] = this.replyText; + data['rating'] = this.rating; + data['helpful_yes_total'] = this.helpfulYesTotal; + data['helpful_no_total'] = this.helpfulNoTotal; + data['created_on_utc'] = this.createdOnUtc; + if (this.customer != null) { + data['customer'] = this.customer.toJson(); + } + data['product'] = this.product; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/pharmacies/pharmacies_list_model.dart b/lib/core/model/pharmacies/pharmacies_list_model.dart new file mode 100644 index 00000000..01a43a0a --- /dev/null +++ b/lib/core/model/pharmacies/pharmacies_list_model.dart @@ -0,0 +1,93 @@ +class PharmaciesListModel { + int itemID; + int patientTypeID; + int languageID; + String stamp; + String iPAdress; + double versionID; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + int patientOutSA; + int channel; + int doctorID; + int editedBy; + int projectID; + int clinicID; + double price; + String imageLocation; + String desLocation; + String itemDes; + String phoneNumber; + String longitude; + String latitude; + + PharmaciesListModel( + {this.itemID, + this.patientTypeID, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.channel, + this.editedBy, + this.doctorID, + this.patientOutSA, + this.clinicID, + this.projectID, + this.price, + this.imageLocation, + this.desLocation, + this.itemDes, + this.phoneNumber, + this.longitude, + this.latitude}); + + PharmaciesListModel.fromJson(Map json) { + longitude = json['Longitude']; + latitude = json['Latitude']; + phoneNumber = json['PhoneNumber']; + itemDes = json['ItemDescription']; + desLocation = json['LocationDescription']; + imageLocation = json['ProjectImageURL']; + price = json['SellingPrice']; + itemID = json['ItemID']; + patientTypeID = json['PatientTypeID']; + languageID = json['LanguageID']; + stamp = json['stamp']; + iPAdress = json['IPAdress']; + versionID = json['VersionID']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + patientOutSA = json['PatientOutSA']; + channel = json['Channel']; + doctorID = json['DoctorID']; + editedBy = json['EditedBy']; + projectID = json['ProjectID']; + clinicID = json['ClinicID']; + } + + Map toJson() { + final Map data = new Map(); + data['ItemID'] = this.itemID; + data['PatientTypeID'] = this.patientTypeID; + data['LanguageID'] = this.languageID; + data['stamp'] = this.stamp; + data['IPAdress'] = this.iPAdress; + data['VersionID'] = this.versionID; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['PatientOutSA'] = this.patientOutSA; + data['Channel'] = this.channel; + data['DoctorID'] = this.doctorID; + data['EditedBy'] = this.editedBy; + data['ProjectID'] = this.projectID; + data['ClinicID'] = this.clinicID; + return data; + } +} diff --git a/lib/core/model/pharmacies/pharmacies_model.dart b/lib/core/model/pharmacies/pharmacies_model.dart new file mode 100644 index 00000000..d1b9b967 --- /dev/null +++ b/lib/core/model/pharmacies/pharmacies_model.dart @@ -0,0 +1,98 @@ +class PharmaciesModel { + String pHRItemName; + int pageIndex; + int pageSize; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int doctorID; + int editedBy; + int projectID; + int clinicID; + String tokenID; + String stamp; + bool isLoginForDoctorApp; + String itemDes; + String productImage; + int itemID; + + PharmaciesModel( + {this.pHRItemName, + this.pageIndex, + this.pageSize, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.doctorID, + this.editedBy, + this.projectID, + this.clinicID, + this.tokenID, + this.stamp, + this.itemDes, + this.productImage, + this.isLoginForDoctorApp, + this.itemID}); + + PharmaciesModel.fromJson(Map json) { + itemID = json['ItemID']; + + productImage = json['ProductImageBase64']; + itemDes = json['ItemDescription']; + pHRItemName = json['PHR_itemName']; + pageIndex = json['PageIndex']; + pageSize = json['PageSize']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + doctorID = json['DoctorID']; + editedBy = json['EditedBy']; + projectID = json['ProjectID']; + clinicID = json['ClinicID']; + tokenID = json['TokenID']; + stamp = json['stamp']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + } + + Map toJson() { + final Map data = new Map(); + data['PHR_itemName'] = this.pHRItemName; + data['PageIndex'] = this.pageIndex; + data['PageSize'] = this.pageSize; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['DoctorID'] = this.doctorID; + data['EditedBy'] = this.editedBy; + data['ProjectID'] = this.projectID; + data['ClinicID'] = this.clinicID; + data['TokenID'] = this.tokenID; + data['stamp'] = this.stamp; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + return data; + } +} diff --git a/lib/core/model/prescriptions/Prescriptions.dart b/lib/core/model/prescriptions/Prescriptions.dart new file mode 100644 index 00000000..0169010f --- /dev/null +++ b/lib/core/model/prescriptions/Prescriptions.dart @@ -0,0 +1,158 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class Prescriptions { + String setupID; + int projectID; + int patientID; + int appointmentNo; + String appointmentDate; + String doctorName; + String clinicDescription; + String name; + int episodeID; + int actualDoctorRate; + int admission; + int clinicID; + String companyName; + String despensedStatus; + DateTime dischargeDate; + int dischargeNo; + int doctorID; + String doctorImageURL; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + bool isInOutPatient; + bool isLiveCareAppointment; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + bool isInsurancePatient; + String nationalityFlagURL; + int noOfPatientsRate; + String qR; + List speciality; + + Prescriptions( + {this.setupID, + this.projectID, + this.patientID, + this.appointmentNo, + this.appointmentDate, + this.doctorName, + this.clinicDescription, + this.name, + this.episodeID, + this.actualDoctorRate, + this.admission, + this.clinicID, + this.companyName, + this.despensedStatus, + this.dischargeDate, + this.dischargeNo, + this.doctorID, + this.doctorImageURL, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isInOutPatient, + this.isInOutPatientDescription, + this.isInOutPatientDescriptionN, + this.isInsurancePatient, + this.nationalityFlagURL, + this.noOfPatientsRate, + this.qR, + this.speciality,this.isLiveCareAppointment}); + + Prescriptions.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + appointmentNo = json['AppointmentNo']; + appointmentDate = json['AppointmentDate']; + doctorName = json['DoctorName']; + clinicDescription = json['ClinicDescription']; + name = json['Name']; + episodeID = json['EpisodeID']; + actualDoctorRate = json['ActualDoctorRate']; + admission = json['Admission']; + clinicID = json['ClinicID']; + companyName = json['CompanyName']; + despensedStatus = json['Despensed_Status']; + dischargeDate = DateUtil.convertStringToDate(json['DischargeDate']); + dischargeNo = json['DischargeNo']; + doctorID = json['DoctorID']; + doctorImageURL = json['DoctorImageURL']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + isInOutPatient = json['IsInOutPatient']; + isInOutPatientDescription = json['IsInOutPatientDescription']; + isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN']; + isInsurancePatient = json['IsInsurancePatient']; + nationalityFlagURL = json['NationalityFlagURL']; + noOfPatientsRate = json['NoOfPatientsRate']; + qR = json['QR']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + // speciality = json['Speciality'].cast(); + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentDate'] = this.appointmentDate; + data['DoctorName'] = this.doctorName; + data['ClinicDescription'] = this.clinicDescription; + data['Name'] = this.name; + data['EpisodeID'] = this.episodeID; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['Admission'] = this.admission; + data['ClinicID'] = this.clinicID; + data['CompanyName'] = this.companyName; + data['Despensed_Status'] = this.despensedStatus; + data['DischargeDate'] = this.dischargeDate; + data['DischargeNo'] = this.dischargeNo; + data['DoctorID'] = this.doctorID; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsInOutPatient'] = this.isInOutPatient; + data['IsInOutPatientDescription'] = this.isInOutPatientDescription; + data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN; + data['IsInsurancePatient'] = this.isInsurancePatient; + data['NationalityFlagURL'] = this.nationalityFlagURL; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['QR'] = this.qR; + data['Speciality'] = this.speciality; + data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + return data; + } +} + +class PrescriptionsList { + String filterName = ""; + List prescriptionsList = List(); + + PrescriptionsList({this.filterName, Prescriptions prescriptions}) { + prescriptionsList.add(prescriptions); + } +} diff --git a/lib/core/model/prescriptions/perscription_pharmacy.dart b/lib/core/model/prescriptions/perscription_pharmacy.dart new file mode 100644 index 00000000..3adaef7e --- /dev/null +++ b/lib/core/model/prescriptions/perscription_pharmacy.dart @@ -0,0 +1,108 @@ +class PharmacyPrescriptions { + String expiryDate; + dynamic sellingPrice; + int quantity; + int itemID; + int locationID; + int projectID; + String setupID; + String locationDescription; + Null locationDescriptionN; + String itemDescription; + Null itemDescriptionN; + String alias; + int locationTypeID; + int barcode; + Null companybarcode; + int cityID; + String cityName; + int distanceInKilometers; + String latitude; + int locationType; + String longitude; + String phoneNumber; + String projectImageURL; + Null sortOrder; + + PharmacyPrescriptions( + {this.expiryDate, + this.sellingPrice, + this.quantity, + this.itemID, + this.locationID, + this.projectID, + this.setupID, + this.locationDescription, + this.locationDescriptionN, + this.itemDescription, + this.itemDescriptionN, + this.alias, + this.locationTypeID, + this.barcode, + this.companybarcode, + this.cityID, + this.cityName, + this.distanceInKilometers, + this.latitude, + this.locationType, + this.longitude, + this.phoneNumber, + this.projectImageURL, + this.sortOrder}); + + PharmacyPrescriptions.fromJson(Map json) { + expiryDate = json['ExpiryDate']; + sellingPrice = json['SellingPrice']; + quantity = json['Quantity']; + itemID = json['ItemID']; + locationID = json['LocationID']; + projectID = json['ProjectID']; + setupID = json['SetupID']; + locationDescription = json['LocationDescription']; + locationDescriptionN = json['LocationDescriptionN']; + itemDescription = json['ItemDescription']; + itemDescriptionN = json['ItemDescriptionN']; + alias = json['Alias']; + locationTypeID = json['LocationTypeID']; + barcode = json['Barcode']; + companybarcode = json['Companybarcode']; + cityID = json['CityID']; + cityName = json['CityName']; + distanceInKilometers = json['DistanceInKilometers']; + latitude = json['Latitude']; + locationType = json['LocationType']; + longitude = json['Longitude']; + phoneNumber = json['PhoneNumber']; + projectImageURL = json['ProjectImageURL']; + sortOrder = json['SortOrder']; + } + + Map toJson() { + final Map data = new Map(); + data['ExpiryDate'] = this.expiryDate; + data['SellingPrice'] = this.sellingPrice; + data['Quantity'] = this.quantity; + data['ItemID'] = this.itemID; + data['LocationID'] = this.locationID; + data['ProjectID'] = this.projectID; + data['SetupID'] = this.setupID; + data['LocationDescription'] = this.locationDescription; + data['LocationDescriptionN'] = this.locationDescriptionN; + data['ItemDescription'] = this.itemDescription; + data['ItemDescriptionN'] = this.itemDescriptionN; + data['Alias'] = this.alias; + data['LocationTypeID'] = this.locationTypeID; + data['Barcode'] = this.barcode; + data['Companybarcode'] = this.companybarcode; + data['CityID'] = this.cityID; + data['CityName'] = this.cityName; + data['DistanceInKilometers'] = this.distanceInKilometers; + data['Latitude'] = this.latitude; + data['LocationType'] = this.locationType; + data['Longitude'] = this.longitude; + data['PhoneNumber'] = this.phoneNumber; + data['ProjectImageURL'] = this.projectImageURL; + data['SortOrder'] = this.sortOrder; + return data; + } +} diff --git a/lib/core/model/prescriptions/prescription_report.dart b/lib/core/model/prescriptions/prescription_report.dart new file mode 100644 index 00000000..51f5750f --- /dev/null +++ b/lib/core/model/prescriptions/prescription_report.dart @@ -0,0 +1,127 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class PrescriptionReport { + int patientID; + String patientName; + String patientAge; + String patientGender; + String address; + String phoneOffice; + String itemDescription; + int doseTimingID; + int frequencyID; + int routeID; + String clinic; + String doctorName; + String route; + String frequency; + String remarks; + String name; + int days; + String startDate; + String orderDate; + int doseDailyQuantity; + int itemID; + Null productImage; + String sKU; + String itemDescriptionN; + String routeN; + String frequencyN; + String imageSRCUrl; + String imageThumbUrl; + + PrescriptionReport( + {this.patientID, + this.patientName, + this.patientAge, + this.patientGender, + this.address, + this.phoneOffice, + this.itemDescription, + this.doseTimingID, + this.frequencyID, + this.routeID, + this.clinic, + this.doctorName, + this.route, + this.frequency, + this.remarks, + this.name, + this.days, + this.startDate, + this.orderDate, + this.doseDailyQuantity, + this.itemID, + this.productImage, + this.sKU, + this.itemDescriptionN, + this.routeN, + this.frequencyN, + this.imageSRCUrl, + this.imageThumbUrl}); + + PrescriptionReport.fromJson(Map json) { + patientID = json['PatientID']; + patientName = json['PatientName']; + patientAge = json['PatientAge']; + patientGender = json['PatientGender']; + address = json['Address']; + phoneOffice = json['PhoneOffice']; + itemDescription = json['ItemDescription']; + doseTimingID = json['DoseTimingID']; + frequencyID = json['FrequencyID']; + routeID = json['RouteID']; + clinic = json['Clinic']; + doctorName = json['DoctorName']; + route = json['Route']; + frequency = json['Frequency']; + remarks = json['Remarks']; + name = json['Name']; + days = json['Days']; + startDate = json['StartDate']; + orderDate = json['OrderDate']; + doseDailyQuantity = json['DoseDailyQuantity']; + itemID = json['ItemID']; + productImage = json['ProductImage']; + sKU = json['SKU']; + itemDescriptionN = json['ItemDescriptionN']; + routeN = json['RouteN']; + frequencyN = json['FrequencyN']; + imageSRCUrl = json['ImageSRCUrl']; + imageThumbUrl = json['ImageThumbUrl']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['PatientName'] = this.patientName; + data['PatientAge'] = this.patientAge; + data['PatientGender'] = this.patientGender; + data['Address'] = this.address; + data['PhoneOffice'] = this.phoneOffice; + data['ItemDescription'] = this.itemDescription; + data['DoseTimingID'] = this.doseTimingID; + data['FrequencyID'] = this.frequencyID; + data['RouteID'] = this.routeID; + data['Clinic'] = this.clinic; + data['DoctorName'] = this.doctorName; + data['Route'] = this.route; + data['Frequency'] = this.frequency; + data['Remarks'] = this.remarks; + data['Name'] = this.name; + data['Days'] = this.days; + data['StartDate'] = this.startDate; + data['OrderDate'] = this.orderDate; + data['DoseDailyQuantity'] = this.doseDailyQuantity; + data['ItemID'] = this.itemID; + data['ProductImage'] = this.productImage; + data['SKU'] = this.sKU; + data['ItemDescriptionN'] = this.itemDescriptionN; + data['RouteN'] = this.routeN; + data['FrequencyN'] = this.frequencyN; + data['ImageSRCUrl'] = this.imageSRCUrl; + data['ImageThumbUrl'] = this.imageThumbUrl; + data['hasPlan'] = false; + return data; + } +} diff --git a/lib/core/model/prescriptions/prescription_report_enh.dart b/lib/core/model/prescriptions/prescription_report_enh.dart new file mode 100644 index 00000000..203eaaff --- /dev/null +++ b/lib/core/model/prescriptions/prescription_report_enh.dart @@ -0,0 +1,144 @@ +class PrescriptionReportEnh { + String address; + int appointmentNo; + String clinic; + Null companyName; + int days; + String doctorName; + int doseDailyQuantity; + String frequency; + int frequencyNumber; + Null image; + Null imageExtension; + String imageSRCUrl; + Null imageString; + String imageThumbUrl; + String isCovered; + String itemDescription; + int itemID; + String orderDate; + int patientID; + String patientName; + String phoneOffice1; + Null prescriptionQR; + int prescriptionTimes; + Null productImage; + Null productImageBase64; + String productImageString; + int projectID; + String projectName; + String remarks; + String route; + String sKU; + int scaleOffset; + String startDate; + + PrescriptionReportEnh( + {this.address, + this.appointmentNo, + this.clinic, + this.companyName, + this.days, + this.doctorName, + this.doseDailyQuantity, + this.frequency, + this.frequencyNumber, + this.image, + this.imageExtension, + this.imageSRCUrl, + this.imageString, + this.imageThumbUrl, + this.isCovered, + this.itemDescription, + this.itemID, + this.orderDate, + this.patientID, + this.patientName, + this.phoneOffice1, + this.prescriptionQR, + this.prescriptionTimes, + this.productImage, + this.productImageBase64, + this.productImageString, + this.projectID, + this.projectName, + this.remarks, + this.route, + this.sKU, + this.scaleOffset, + this.startDate}); + + PrescriptionReportEnh.fromJson(Map json) { + address = json['Address']; + appointmentNo = json['AppointmentNo']; + clinic = json['Clinic']; + companyName = json['CompanyName']; + days = json['Days']; + doctorName = json['DoctorName']; + doseDailyQuantity = json['DoseDailyQuantity']; + frequency = json['Frequency']; + frequencyNumber = json['FrequencyNumber']; + image = json['Image']; + imageExtension = json['ImageExtension']; + imageSRCUrl = json['ImageSRCUrl']; + imageString = json['ImageString']; + imageThumbUrl = json['ImageThumbUrl']; + isCovered = json['IsCovered']; + itemDescription = json['ItemDescription']; + itemID = json['ItemID']; + orderDate = json['OrderDate']; + patientID = json['PatientID']; + patientName = json['PatientName']; + phoneOffice1 = json['PhoneOffice1']; + prescriptionQR = json['PrescriptionQR']; + prescriptionTimes = json['PrescriptionTimes']; + productImage = json['ProductImage']; + productImageBase64 = json['ProductImageBase64']; + productImageString = json['ProductImageString']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + remarks = json['Remarks']; + route = json['Route']; + sKU = json['SKU']; + scaleOffset = json['ScaleOffset']; + startDate = json['StartDate']; + } + + Map toJson() { + final Map data = new Map(); + data['Address'] = this.address; + data['AppointmentNo'] = this.appointmentNo; + data['Clinic'] = this.clinic; + data['CompanyName'] = this.companyName; + data['Days'] = this.days; + data['DoctorName'] = this.doctorName; + data['DoseDailyQuantity'] = this.doseDailyQuantity; + data['Frequency'] = this.frequency; + data['FrequencyNumber'] = this.frequencyNumber; + data['Image'] = this.image; + data['ImageExtension'] = this.imageExtension; + data['ImageSRCUrl'] = this.imageSRCUrl; + data['ImageString'] = this.imageString; + data['ImageThumbUrl'] = this.imageThumbUrl; + data['IsCovered'] = this.isCovered; + data['ItemDescription'] = this.itemDescription; + data['ItemID'] = this.itemID; + data['OrderDate'] = this.orderDate; + data['PatientID'] = this.patientID; + data['PatientName'] = this.patientName; + data['PhoneOffice1'] = this.phoneOffice1; + data['PrescriptionQR'] = this.prescriptionQR; + data['PrescriptionTimes'] = this.prescriptionTimes; + data['ProductImage'] = this.productImage; + data['ProductImageBase64'] = this.productImageBase64; + data['ProductImageString'] = this.productImageString; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['Remarks'] = this.remarks; + data['Route'] = this.route; + data['SKU'] = this.sKU; + data['ScaleOffset'] = this.scaleOffset; + data['StartDate'] = this.startDate; + return data; + } +} diff --git a/lib/core/model/prescriptions/prescriptions_order.dart b/lib/core/model/prescriptions/prescriptions_order.dart new file mode 100644 index 00000000..fdcbf203 --- /dev/null +++ b/lib/core/model/prescriptions/prescriptions_order.dart @@ -0,0 +1,134 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class PrescriptionsOrder { + int iD; + dynamic patientID; + bool patientOutSA; + bool isOutPatient; + int projectID; + int nearestProjectID; + double longitude; + double latitude; + dynamic appointmentNo; + dynamic dischargeID; + int lineItemNo; + int status; + dynamic description; + dynamic descriptionN; + DateTime createdOn; + int serviceID; + int createdBy; + DateTime editedOn; + int editedBy; + int channel; + dynamic clientRequestID; + bool returnedToQueue; + dynamic pickupDateTime; + dynamic pickupLocationName; + dynamic dropoffLocationName; + int realRRTHaveTransactions; + dynamic nearestProjectDescription; + dynamic nearestProjectDescriptionN; + dynamic projectDescription; + dynamic projectDescriptionN; + + PrescriptionsOrder( + {this.iD, + this.patientID, + this.patientOutSA, + this.isOutPatient, + this.projectID, + this.nearestProjectID, + this.longitude, + this.latitude, + this.appointmentNo, + this.dischargeID, + this.lineItemNo, + this.status, + this.description, + this.descriptionN, + this.createdOn, + this.serviceID, + this.createdBy, + this.editedOn, + this.editedBy, + this.channel, + this.clientRequestID, + this.returnedToQueue, + this.pickupDateTime, + this.pickupLocationName, + this.dropoffLocationName, + this.realRRTHaveTransactions, + this.nearestProjectDescription, + this.nearestProjectDescriptionN, + this.projectDescription, + this.projectDescriptionN}); + + PrescriptionsOrder.fromJson(Map json) { + iD = json['ID']; + patientID = json['PatientID']; + patientOutSA = json['PatientOutSA']; + isOutPatient = json['IsOutPatient']; + projectID = json['ProjectID']; + nearestProjectID = json['NearestProjectID']; + longitude = json['Longitude']; + latitude = json['Latitude']; + appointmentNo = json['AppointmentNo']; + dischargeID = json['DischargeID']; + lineItemNo = json['LineItemNo']; + status = json['Status']; + description = json['Description']; + descriptionN = json['DescriptionN']; + createdOn = DateUtil.convertStringToDate(json['CreatedOn']); + serviceID = json['ServiceID']; + createdBy = json['CreatedBy']; + editedOn = DateUtil.convertStringToDate(json['EditedOn']); + editedBy = json['EditedBy']; + channel = json['Channel']; + clientRequestID = json['ClientRequestID']; + returnedToQueue = json['ReturnedToQueue']; + pickupDateTime = json['PickupDateTime']; + pickupLocationName = json['PickupLocationName']; + dropoffLocationName = json['DropoffLocationName']; + realRRTHaveTransactions = json['RealRRT_HaveTransactions']; + nearestProjectDescription = json['NearestProjectDescription']; + nearestProjectDescriptionN = json['NearestProjectDescriptionN']; + projectDescription = json['ProjectDescription']; + projectDescriptionN = json['ProjectDescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['PatientID'] = this.patientID; + data['PatientOutSA'] = this.patientOutSA; + data['IsOutPatient'] = this.isOutPatient; + data['ProjectID'] = this.projectID; + data['NearestProjectID'] = this.nearestProjectID; + data['Longitude'] = this.longitude; + data['Latitude'] = this.latitude; + data['AppointmentNo'] = this.appointmentNo; + data['DischargeID'] = this.dischargeID; + data['LineItemNo'] = this.lineItemNo; + data['Status'] = this.status; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['CreatedOn'] = this.createdOn; + data['ServiceID'] = this.serviceID; + data['CreatedBy'] = this.createdBy; + data['EditedOn'] = this.editedOn; + data['EditedBy'] = this.editedBy; + data['Channel'] = this.channel; + data['ClientRequestID'] = this.clientRequestID; + data['ReturnedToQueue'] = this.returnedToQueue; + data['PickupDateTime'] = this.pickupDateTime; + data['PickupLocationName'] = this.pickupLocationName; + data['DropoffLocationName'] = this.dropoffLocationName; + data['RealRRT_HaveTransactions'] = this.realRRTHaveTransactions; + data['NearestProjectDescription'] = this.nearestProjectDescription; + data['NearestProjectDescriptionN'] = this.nearestProjectDescriptionN; + data['ProjectDescription'] = this.projectDescription; + data['ProjectDescriptionN'] = this.projectDescriptionN; + return data; + } +} diff --git a/lib/core/model/prescriptions/request_get_list_pharmacy_for_prescriptions.dart b/lib/core/model/prescriptions/request_get_list_pharmacy_for_prescriptions.dart new file mode 100644 index 00000000..739bb838 --- /dev/null +++ b/lib/core/model/prescriptions/request_get_list_pharmacy_for_prescriptions.dart @@ -0,0 +1,60 @@ +class RequestGetListPharmacyForPrescriptions { + int latitude; + int longitude; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int itemID; + + RequestGetListPharmacyForPrescriptions( + {this.latitude, + this.longitude, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.itemID}); + + RequestGetListPharmacyForPrescriptions.fromJson(Map json) { + latitude = json['Latitude']; + longitude = json['Longitude']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + itemID = json['ItemID']; + } + + Map toJson() { + final Map data = new Map(); + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['ItemID'] = this.itemID; + return data; + } +} diff --git a/lib/core/model/prescriptions/request_prescription_report.dart b/lib/core/model/prescriptions/request_prescription_report.dart new file mode 100644 index 00000000..c8323740 --- /dev/null +++ b/lib/core/model/prescriptions/request_prescription_report.dart @@ -0,0 +1,88 @@ +class RequestPrescriptionReport { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int appointmentNo; + String setupID; + int episodeID; + int clinicID; + int projectID; + int dischargeNo; + + RequestPrescriptionReport( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.appointmentNo, + this.setupID, + this.episodeID, + this.clinicID, + this.projectID, + this.dischargeNo}); + + RequestPrescriptionReport.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + appointmentNo = json['AppointmentNo']; + setupID = json['SetupID']; + episodeID = json['EpisodeID']; + clinicID = json['ClinicID']; + projectID = json['ProjectID']; + dischargeNo = json['DischargeNo']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['AppointmentNo'] = this.appointmentNo; + data['SetupID'] = this.setupID; + data['EpisodeID'] = this.episodeID; + data['ClinicID'] = this.clinicID; + data['ProjectID'] = this.projectID; + data['DischargeNo'] = this.dischargeNo; + return data; + } +} diff --git a/lib/core/model/prescriptions/request_prescription_report_enh.dart b/lib/core/model/prescriptions/request_prescription_report_enh.dart new file mode 100644 index 00000000..4905fc2a --- /dev/null +++ b/lib/core/model/prescriptions/request_prescription_report_enh.dart @@ -0,0 +1,86 @@ +class RequestPrescriptionReportEnh { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int appointmentNo; + String setupID; + int dischargeNo; + int episodeID; + int clinicID; + int projectID; + + RequestPrescriptionReportEnh( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.appointmentNo, + this.setupID, + this.episodeID, + this.clinicID, + this.projectID,this.dischargeNo}); + + RequestPrescriptionReportEnh.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + appointmentNo = json['AppointmentNo']; + setupID = json['SetupID']; + episodeID = json['EpisodeID']; + clinicID = json['ClinicID']; + projectID = json['ProjectID']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['AppointmentNo'] = this.appointmentNo; + data['SetupID'] = this.setupID; + data['EpisodeID'] = this.episodeID; + data['ClinicID'] = this.clinicID; + data['ProjectID'] = this.projectID; + data['DischargeNo'] = this.dischargeNo; + return data; + } +} diff --git a/lib/core/model/prescriptions/request_prescriptions.dart b/lib/core/model/prescriptions/request_prescriptions.dart new file mode 100644 index 00000000..abb39143 --- /dev/null +++ b/lib/core/model/prescriptions/request_prescriptions.dart @@ -0,0 +1,64 @@ +class RequestPrescriptions { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + RequestPrescriptions( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + RequestPrescriptions.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/model/prescriptions/request_prescriptions_orders.dart b/lib/core/model/prescriptions/request_prescriptions_orders.dart new file mode 100644 index 00000000..9aaab33d --- /dev/null +++ b/lib/core/model/prescriptions/request_prescriptions_orders.dart @@ -0,0 +1,52 @@ +class RequestPrescriptionsOrders { + int patientID; + int patientOutSA; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + + RequestPrescriptionsOrders( + {this.patientID, + this.patientOutSA, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); + + RequestPrescriptionsOrders.fromJson(Map json) { + patientID = json['PatientID']; + patientOutSA = json['PatientOutSA']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['PatientOutSA'] = this.patientOutSA; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/core/model/prescriptions/request_send_prescription_email.dart b/lib/core/model/prescriptions/request_send_prescription_email.dart new file mode 100644 index 00000000..2d1f3aa3 --- /dev/null +++ b/lib/core/model/prescriptions/request_send_prescription_email.dart @@ -0,0 +1,112 @@ +import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; + +class RequestSendPrescriptionEmail { + String appointmentDate; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + String to; + String dateofBirth; + String patientIditificationNum; + String patientMobileNumber; + String patientName; + String setupID; + String clinicName; + String doctorName; + int projectID; + List listPrescriptions; + + RequestSendPrescriptionEmail( + {this.appointmentDate, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.to, + this.dateofBirth, + this.patientIditificationNum, + this.patientMobileNumber, + this.patientName, + this.setupID, + this.clinicName, + this.doctorName, + this.projectID}); + + RequestSendPrescriptionEmail.fromJson(Map json) { + appointmentDate = json['AppointmentDate']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + to = json['To']; + dateofBirth = json['DateofBirth']; + patientIditificationNum = json['PatientIditificationNum']; + patientMobileNumber = json['PatientMobileNumber']; + patientName = json['PatientName']; + setupID = json['SetupID']; + clinicName = json['ClinicName']; + doctorName = json['DoctorName']; + projectID = json['ProjectID']; + } + + Map toJson() { + final Map data = new Map(); + data['AppointmentDate'] = this.appointmentDate; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['To'] = this.to; + data['DateofBirth'] = this.dateofBirth; + data['PatientIditificationNum'] = this.patientIditificationNum; + data['PatientMobileNumber'] = this.patientMobileNumber; + data['PatientName'] = this.patientName; + data['SetupID'] = this.setupID; + if (this.listPrescriptions != null) { + data['ListPrescriptions'] = + this.listPrescriptions.map((v) => v.toJson()).toList(); + } + data['ClinicName'] = this.clinicName; + data['DoctorName'] = this.doctorName; + data['ProjectID'] = this.projectID; + + return data; + } +} diff --git a/lib/core/model/privilege/PrivilegeModel.dart b/lib/core/model/privilege/PrivilegeModel.dart new file mode 100644 index 00000000..3b629fde --- /dev/null +++ b/lib/core/model/privilege/PrivilegeModel.dart @@ -0,0 +1,24 @@ +class PrivilegeModel { + int iD; + String serviceName; + bool privilege; + dynamic region; + + PrivilegeModel({this.iD, this.serviceName, this.privilege, this.region}); + + PrivilegeModel.fromJson(Map json) { + iD = json['ID']; + serviceName = json['ServiceName']; + privilege = json['Previlege']; + region = json['Region']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['ServiceName'] = this.serviceName; + data['Previlege'] = this.privilege; + data['Region'] = this.region; + return data; + } +} diff --git a/lib/core/model/qr/qr_parking_model.dart b/lib/core/model/qr/qr_parking_model.dart new file mode 100644 index 00000000..1df927bc --- /dev/null +++ b/lib/core/model/qr/qr_parking_model.dart @@ -0,0 +1,172 @@ +class QRParkingModel { + Null totalRecords; + Null nRowID; + int qRParkingID; + String description; + String descriptionN; + Null qRCompare; + Null qRValue; + String imagePath; + bool isActive; + int parkingID; + int branchID; + int companyID; + int buildingID; + int rowID; + int gateID; + int floorID; + Null imagePath1; + int createdBy; + String createdOn; + Null editedBy; + Null editedOn; + String parkingDescription; + String parkingDescriptionN; + String gateDescription; + String gateDescriptionN; + String branchDescription; + String branchDescriptionN; + String companyDescription; + String companyDescriptionN; + String rowDescription; + String rowDescriptionN; + String floorDescription; + String floorDescriptionN; + String buildingDescription; + String buildingDescriptionN; + String qRParkingCode; + String parkingCode; + double latitude; + double longitude; + String qRImageStr; + + QRParkingModel( + {this.totalRecords, + this.nRowID, + this.qRParkingID, + this.description, + this.descriptionN, + this.qRCompare, + this.qRValue, + this.imagePath, + this.isActive, + this.parkingID, + this.branchID, + this.companyID, + this.buildingID, + this.rowID, + this.gateID, + this.floorID, + this.imagePath1, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.parkingDescription, + this.parkingDescriptionN, + this.gateDescription, + this.gateDescriptionN, + this.branchDescription, + this.branchDescriptionN, + this.companyDescription, + this.companyDescriptionN, + this.rowDescription, + this.rowDescriptionN, + this.floorDescription, + this.floorDescriptionN, + this.buildingDescription, + this.buildingDescriptionN, + this.qRParkingCode, + this.parkingCode, + this.latitude, + this.longitude, + this.qRImageStr}); + + QRParkingModel.fromJson(Map json) { + totalRecords = json['TotalRecords']; + nRowID = json['nRowID']; + qRParkingID = json['QRParkingID']; + description = json['Description']; + descriptionN = json['DescriptionN']; + qRCompare = json['QRCompare']; + qRValue = json['QRValue']; + imagePath = json['ImagePath']; + isActive = json['IsActive']; + parkingID = json['ParkingID']; + branchID = json['BranchID']; + companyID = json['CompanyID']; + buildingID = json['BuildingID']; + rowID = json['RowID']; + gateID = json['GateID']; + floorID = json['FloorID']; + imagePath1 = json['ImagePath1']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + parkingDescription = json['ParkingDescription']; + parkingDescriptionN = json['ParkingDescriptionN']; + gateDescription = json['GateDescription']; + gateDescriptionN = json['GateDescriptionN']; + branchDescription = json['BranchDescription']; + branchDescriptionN = json['BranchDescriptionN']; + companyDescription = json['CompanyDescription']; + companyDescriptionN = json['CompanyDescriptionN']; + rowDescription = json['RowDescription']; + rowDescriptionN = json['RowDescriptionN']; + floorDescription = json['FloorDescription']; + floorDescriptionN = json['FloorDescriptionN']; + buildingDescription = json['BuildingDescription']; + buildingDescriptionN = json['BuildingDescriptionN']; + qRParkingCode = json['QRParkingCode']; + parkingCode = json['ParkingCode']; + latitude = json['Latitude']; + longitude = json['Longitude']; + qRImageStr = json['QRImageStr']; + } + + Map toJson() { + final Map data = new Map(); + data['TotalRecords'] = this.totalRecords; + data['nRowID'] = this.nRowID; + data['QRParkingID'] = this.qRParkingID; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['QRCompare'] = this.qRCompare; + data['QRValue'] = this.qRValue; + data['ImagePath'] = this.imagePath; + data['IsActive'] = this.isActive; + data['ParkingID'] = this.parkingID; + data['BranchID'] = this.branchID; + data['CompanyID'] = this.companyID; + data['BuildingID'] = this.buildingID; + data['RowID'] = this.rowID; + data['GateID'] = this.gateID; + data['FloorID'] = this.floorID; + data['ImagePath1'] = this.imagePath1; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['ParkingDescription'] = this.parkingDescription; + data['ParkingDescriptionN'] = this.parkingDescriptionN; + data['GateDescription'] = this.gateDescription; + data['GateDescriptionN'] = this.gateDescriptionN; + data['BranchDescription'] = this.branchDescription; + data['BranchDescriptionN'] = this.branchDescriptionN; + data['CompanyDescription'] = this.companyDescription; + data['CompanyDescriptionN'] = this.companyDescriptionN; + data['RowDescription'] = this.rowDescription; + data['RowDescriptionN'] = this.rowDescriptionN; + data['FloorDescription'] = this.floorDescription; + data['FloorDescriptionN'] = this.floorDescriptionN; + data['BuildingDescription'] = this.buildingDescription; + data['BuildingDescriptionN'] = this.buildingDescriptionN; + data['QRParkingCode'] = this.qRParkingCode; + data['ParkingCode'] = this.parkingCode; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['QRImageStr'] = this.qRImageStr; + return data; + } +} diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart new file mode 100644 index 00000000..ed47b51d --- /dev/null +++ b/lib/core/model/radiology/final_radiology.dart @@ -0,0 +1,190 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class FinalRadiology { + String setupID; + int projectID; + Null patientID; + int invoiceLineItemNo; + int invoiceNo; + int doctorID; + int clinicID; + DateTime orderDate; + String reportData; + String imageURL; + String procedureID; + int appointmentNo; + Null dIAPacsURL; + bool isRead; + String readOn; + var admissionNo; + bool isInOutPatient; + int actualDoctorRate; + String clinicDescription; + String dIAPACSURL; + String doctorImageURL; + String doctorName; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isExecludeDoctor; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + String nationalityFlagURL; + int noOfPatientsRate; + int orderNo; + String projectName; + String qR; + String reportDataHTML; + String reportDataTextString; + List speciality; + bool isCVI; + bool isRadMedicalReport; + bool isLiveCareAppointment; + + FinalRadiology( + {this.setupID, + this.projectID, + this.patientID, + this.invoiceLineItemNo, + this.invoiceNo, + this.doctorID, + this.clinicID, + this.orderDate, + this.reportData, + this.imageURL, + this.procedureID, + this.appointmentNo, + this.dIAPacsURL, + this.isRead, + this.readOn, + this.admissionNo, + this.isInOutPatient, + this.actualDoctorRate, + this.clinicDescription, + this.dIAPACSURL, + this.doctorImageURL, + this.doctorName, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isExecludeDoctor, + this.isInOutPatientDescription, + this.isInOutPatientDescriptionN, + this.nationalityFlagURL, + this.noOfPatientsRate, + this.orderNo, + this.projectName, + this.qR, + this.reportDataHTML, + this.reportDataTextString, + this.speciality, + this.isCVI, + this.isRadMedicalReport,this.isLiveCareAppointment}); + + FinalRadiology.fromJson(Map json) { + try { + setupID = json['SetupID']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + invoiceLineItemNo = json['InvoiceLineItemNo']; + invoiceNo = json['InvoiceNo']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + orderDate = DateUtil.convertStringToDate(json['OrderDate']); + reportData = json['ReportData']; + imageURL = json['ImageURL']; + procedureID = json['ProcedureID']; + appointmentNo = json['AppointmentNo']; + dIAPacsURL = json['DIAPacsURL']; + isRead = json['IsRead']; + readOn = json['ReadOn']; + admissionNo = json['AdmissionNo']; + isInOutPatient = json['IsInOutPatient']; + actualDoctorRate = json['ActualDoctorRate']; + clinicDescription = json['ClinicDescription']; + dIAPACSURL = json['DIA_PACS_URL']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isExecludeDoctor = json['IsExecludeDoctor']; + isInOutPatientDescription = json['IsInOutPatientDescription']; + isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN']; + nationalityFlagURL = json['NationalityFlagURL']; + noOfPatientsRate = json['NoOfPatientsRate']; + orderNo = json['OrderNo']; + projectName = json['ProjectName']; + qR = json['QR']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + reportDataHTML = json['ReportDataHTML']; + reportDataTextString = json['ReportDataTextString']; + // speciality = json['Speciality'].cast(); + isCVI = json['isCVI']; + isRadMedicalReport = json['isRadMedicalReport']; + + } catch (e) { + print(e); + } + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['InvoiceLineItemNo'] = this.invoiceLineItemNo; + data['InvoiceNo'] = this.invoiceNo; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + data['OrderDate'] = this.orderDate; + data['ReportData'] = this.reportData; + data['ImageURL'] = this.imageURL; + data['ProcedureID'] = this.procedureID; + data['AppointmentNo'] = this.appointmentNo; + data['DIAPacsURL'] = this.dIAPacsURL; + data['IsRead'] = this.isRead; + data['ReadOn'] = this.readOn; + data['AdmissionNo'] = this.admissionNo; + data['IsInOutPatient'] = this.isInOutPatient; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['ClinicDescription'] = this.clinicDescription; + data['DIA_PACS_URL'] = this.dIAPACSURL; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsInOutPatientDescription'] = this.isInOutPatientDescription; + data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN; + data['NationalityFlagURL'] = this.nationalityFlagURL; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['OrderNo'] = this.orderNo; + data['ProjectName'] = this.projectName; + data['QR'] = this.qR; + data['ReportDataHTML'] = this.reportDataHTML; + data['ReportDataTextString'] = this.reportDataTextString; + data['Speciality'] = this.speciality; + data['isCVI'] = this.isCVI; + data['isRadMedicalReport'] = this.isRadMedicalReport; + return data; + } +} + +class FinalRadiologyList { + String filterName = ""; + List finalRadiologyList = List(); + + FinalRadiologyList({this.filterName, FinalRadiology finalRadiology}) { + finalRadiologyList.add(finalRadiology); + } +} diff --git a/lib/core/model/radiology/request_patient_rad_orders_details.dart b/lib/core/model/radiology/request_patient_rad_orders_details.dart new file mode 100644 index 00000000..9e3458d5 --- /dev/null +++ b/lib/core/model/radiology/request_patient_rad_orders_details.dart @@ -0,0 +1,92 @@ +class RequestPatientRadOrdersDetails { + int projectID; + int orderNo; + int invoiceNo; + String setupID; + String procedureID; + bool isMedicalReport; + bool isCVI; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + RequestPatientRadOrdersDetails( + {this.projectID, + this.orderNo, + this.invoiceNo, + this.setupID, + this.procedureID, + this.isMedicalReport, + this.isCVI, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + RequestPatientRadOrdersDetails.fromJson(Map json) { + projectID = json['ProjectID']; + orderNo = json['OrderNo']; + invoiceNo = json['InvoiceNo']; + setupID = json['SetupID']; + procedureID = json['ProcedureID']; + isMedicalReport = json['IsMedicalReport']; + isCVI = json['isCVI']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['OrderNo'] = this.orderNo; + data['InvoiceNo'] = this.invoiceNo; + data['SetupID'] = this.setupID; + data['ProcedureID'] = this.procedureID; + data['IsMedicalReport'] = this.isMedicalReport; + data['isCVI'] = this.isCVI; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/model/radiology/request_send_rad_report_email.dart b/lib/core/model/radiology/request_send_rad_report_email.dart new file mode 100644 index 00000000..6d68653d --- /dev/null +++ b/lib/core/model/radiology/request_send_rad_report_email.dart @@ -0,0 +1,116 @@ +class RequestSendRadReportEmail { + int channel; + String clinicName; + String dateofBirth; + int deviceTypeID; + String doctorName; + String generalid; + int invoiceNo; + String iPAdress; + bool isDentalAllowedBackend; + int languageID; + String orderDate; + int patientID; + String patientIditificationNum; + String patientMobileNumber; + String patientName; + int patientOutSA; + int patientType; + int patientTypeID; + int projectID; + String projectName; + String radResult; + String sessionID; + String setupID; + String to; + String tokenID; + double versionID; + + RequestSendRadReportEmail( + {this.channel, + this.clinicName, + this.dateofBirth, + this.deviceTypeID, + this.doctorName, + this.generalid, + this.invoiceNo, + this.iPAdress, + this.isDentalAllowedBackend, + this.languageID, + this.orderDate, + this.patientID, + this.patientIditificationNum, + this.patientMobileNumber, + this.patientName, + this.patientOutSA, + this.patientType, + this.patientTypeID, + this.projectID, + this.projectName, + this.radResult, + this.sessionID, + this.setupID, + this.to, + this.tokenID, + this.versionID}); + + RequestSendRadReportEmail.fromJson(Map json) { + channel = json['Channel']; + clinicName = json['ClinicName']; + dateofBirth = json['DateofBirth']; + deviceTypeID = json['DeviceTypeID']; + doctorName = json['DoctorName']; + generalid = json['generalid']; + invoiceNo = json['InvoiceNo']; + iPAdress = json['IPAdress']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + languageID = json['LanguageID']; + orderDate = json['OrderDate']; + patientID = json['PatientID']; + patientIditificationNum = json['PatientIditificationNum']; + patientMobileNumber = json['PatientMobileNumber']; + patientName = json['PatientName']; + patientOutSA = json['PatientOutSA']; + patientType = json['PatientType']; + patientTypeID = json['PatientTypeID']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + radResult = json['RadResult']; + sessionID = json['SessionID']; + setupID = json['SetupID']; + to = json['To']; + tokenID = json['TokenID']; + versionID = json['VersionID']; + } + + Map toJson() { + final Map data = new Map(); + data['Channel'] = this.channel; + data['ClinicName'] = this.clinicName; + data['DateofBirth'] = this.dateofBirth; + data['DeviceTypeID'] = this.deviceTypeID; + data['DoctorName'] = this.doctorName; + data['generalid'] = this.generalid; + data['InvoiceNo'] = this.invoiceNo; + data['IPAdress'] = this.iPAdress; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['LanguageID'] = this.languageID; + data['OrderDate'] = this.orderDate; + data['PatientID'] = this.patientID; + data['PatientIditificationNum'] = this.patientIditificationNum; + data['PatientMobileNumber'] = this.patientMobileNumber; + data['PatientName'] = this.patientName; + data['PatientOutSA'] = this.patientOutSA; + data['PatientType'] = this.patientType; + data['PatientTypeID'] = this.patientTypeID; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['RadResult'] = this.radResult; + data['SessionID'] = this.sessionID; + data['SetupID'] = this.setupID; + data['To'] = this.to; + data['TokenID'] = this.tokenID; + data['VersionID'] = this.versionID; + return data; + } +} diff --git a/lib/core/model/rate/appointment_details.dart b/lib/core/model/rate/appointment_details.dart new file mode 100644 index 00000000..77d759db --- /dev/null +++ b/lib/core/model/rate/appointment_details.dart @@ -0,0 +1,64 @@ +class AppointmentDetails { + String setupID; + int projectID; + int patientID; + int appointmentNo; + int clinicID; + int doctorID; + dynamic startTime; + dynamic endTime; + dynamic appointmentDate; + dynamic clinicName; + dynamic doctorImageURL; + dynamic doctorName; + dynamic projectName; + + AppointmentDetails( + {this.setupID, + this.projectID, + this.patientID, + this.appointmentNo, + this.clinicID, + this.doctorID, + this.startTime, + this.endTime, + this.appointmentDate, + this.clinicName, + this.doctorImageURL, + this.doctorName, + this.projectName}); + + AppointmentDetails.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + appointmentNo = json['AppointmentNo']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + startTime = json['StartTime']; + endTime = json['EndTime']; + appointmentDate = json['AppointmentDate']; + clinicName = json['ClinicName']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + projectName = json['ProjectName']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['AppointmentNo'] = this.appointmentNo; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['StartTime'] = this.startTime; + data['EndTime'] = this.endTime; + data['AppointmentDate'] = this.appointmentDate; + data['ClinicName'] = this.clinicName; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['ProjectName'] = this.projectName; + return data; + } +} diff --git a/lib/core/model/rate/appointment_rate.dart b/lib/core/model/rate/appointment_rate.dart new file mode 100644 index 00000000..abb249f4 --- /dev/null +++ b/lib/core/model/rate/appointment_rate.dart @@ -0,0 +1,100 @@ +class AppointmentRate { + int rate; + int appointmentNo; + int projectID; + int doctorID; + int clinicID; + String note; + String mobileNumber; + int createdBy; + int editedBy; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + AppointmentRate( + {this.rate, + this.appointmentNo, + this.projectID, + this.doctorID, + this.clinicID, + this.note, + this.mobileNumber, + this.createdBy, + this.editedBy, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + AppointmentRate.fromJson(Map json) { + rate = json['Rate']; + appointmentNo = json['AppointmentNo']; + projectID = json['ProjectID']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + note = json['Note']; + mobileNumber = json['MobileNumber']; + createdBy = json['CreatedBy']; + editedBy = json['EditedBy']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['Rate'] = this.rate; + data['AppointmentNo'] = this.appointmentNo; + data['ProjectID'] = this.projectID; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + data['Note'] = this.note; + data['MobileNumber'] = this.mobileNumber; + data['CreatedBy'] = this.createdBy; + data['EditedBy'] = this.editedBy; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/model/rate/appoitment_rated.dart b/lib/core/model/rate/appoitment_rated.dart new file mode 100644 index 00000000..95358b23 --- /dev/null +++ b/lib/core/model/rate/appoitment_rated.dart @@ -0,0 +1,160 @@ +class AppoitmentRated { + String setupID; + int projectID; + int appointmentNo; + String appointmentDate; + String appointmentDateN; + int appointmentType; + String bookDate; + int patientType; + int patientID; + int clinicID; + int doctorID; + String endDate; + String startTime; + String endTime; + int status; + int visitType; + int visitFor; + int patientStatusType; + int companyID; + int bookedBy; + String bookedOn; + int confirmedBy; + String confirmedOn; + int arrivalChangedBy; + String arrivedOn; + int editedBy; + String editedOn; + Null doctorName; + String doctorNameN; + String statusDesc; + String statusDescN; + bool vitalStatus; + Null vitalSignAppointmentNo; + int episodeID; + String doctorTitle; + bool isAppoitmentLiveCare; + + AppoitmentRated( + {this.setupID, + this.projectID, + this.appointmentNo, + this.appointmentDate, + this.appointmentDateN, + this.appointmentType, + this.bookDate, + this.patientType, + this.patientID, + this.clinicID, + this.doctorID, + this.endDate, + this.startTime, + this.endTime, + this.status, + this.visitType, + this.visitFor, + this.patientStatusType, + this.companyID, + this.bookedBy, + this.bookedOn, + this.confirmedBy, + this.confirmedOn, + this.arrivalChangedBy, + this.arrivedOn, + this.editedBy, + this.editedOn, + this.doctorName, + this.doctorNameN, + this.statusDesc, + this.statusDescN, + this.vitalStatus, + this.vitalSignAppointmentNo, + this.episodeID, + this.doctorTitle, + this.isAppoitmentLiveCare}); + + AppoitmentRated.fromJson(Map json) { + try { + setupID = json['SetupID']; + projectID = json['ProjectID']; + appointmentNo = json['AppointmentNo']; + appointmentDate = json['AppointmentDate']; + appointmentDateN = json['AppointmentDateN']; + appointmentType = json['AppointmentType']; + bookDate = json['BookDate']; + patientType = json['PatientType']; + patientID = json['PatientID']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + endDate = json['EndDate']; + startTime = json['StartTime']; + endTime = json['EndTime']; + status = json['Status']; + visitType = json['VisitType']; + visitFor = json['VisitFor']; + patientStatusType = json['PatientStatusType']; + companyID = json['CompanyID']; + bookedBy = json['BookedBy']; + bookedOn = json['BookedOn']; + confirmedBy = json['ConfirmedBy']; + confirmedOn = json['ConfirmedOn']; + arrivalChangedBy = json['ArrivalChangedBy']; + arrivedOn = json['ArrivedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + statusDesc = json['StatusDesc']; + statusDescN = json['StatusDescN']; + vitalStatus = json['VitalStatus']; + vitalSignAppointmentNo = json['VitalSignAppointmentNo']; + episodeID = json['EpisodeID']; + doctorTitle = json['DoctorTitle']; + isAppoitmentLiveCare = json['IsAppoitmentLiveCare']; + } catch (e) { + print(e); + } + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentDateN'] = this.appointmentDateN; + data['AppointmentType'] = this.appointmentType; + data['BookDate'] = this.bookDate; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['EndDate'] = this.endDate; + data['StartTime'] = this.startTime; + data['EndTime'] = this.endTime; + data['Status'] = this.status; + data['VisitType'] = this.visitType; + data['VisitFor'] = this.visitFor; + data['PatientStatusType'] = this.patientStatusType; + data['CompanyID'] = this.companyID; + data['BookedBy'] = this.bookedBy; + data['BookedOn'] = this.bookedOn; + data['ConfirmedBy'] = this.confirmedBy; + data['ConfirmedOn'] = this.confirmedOn; + data['ArrivalChangedBy'] = this.arrivalChangedBy; + data['ArrivedOn'] = this.arrivedOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['StatusDesc'] = this.statusDesc; + data['StatusDescN'] = this.statusDescN; + data['VitalStatus'] = this.vitalStatus; + data['VitalSignAppointmentNo'] = this.vitalSignAppointmentNo; + data['EpisodeID'] = this.episodeID; + data['DoctorTitle'] = this.doctorTitle; + data['IsAppoitmentLiveCare'] = this.isAppoitmentLiveCare; + return data; + } +} diff --git a/lib/core/model/reports/Reports.dart b/lib/core/model/reports/Reports.dart new file mode 100644 index 00000000..a8a5869d --- /dev/null +++ b/lib/core/model/reports/Reports.dart @@ -0,0 +1,139 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class Reports { + int status; + DateTime encounterDate; + int projectID; + int invoiceNo; + int encounterNo; + String procedureId; + int requestType; + String setupId; + int patientID; + int doctorID; + Null clinicID; + DateTime requestDate; + bool isRead; + DateTime isReadOn; + int actualDoctorRate; + String clinicDescription; + Null clinicDescriptionN; + String docName; + Null docNameN; + String doctorImageURL; + Null doctorName; + Null doctorNameN; + int doctorRate; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + int noOfPatientsRate; + String projectName; + Null projectNameN; + + Reports( + {this.status, + this.encounterDate, + this.projectID, + this.invoiceNo, + this.encounterNo, + this.procedureId, + this.requestType, + this.setupId, + this.patientID, + this.doctorID, + this.clinicID, + this.requestDate, + this.isRead, + this.isReadOn, + this.actualDoctorRate, + this.clinicDescription, + this.clinicDescriptionN, + this.docName, + this.docNameN, + this.doctorImageURL, + this.doctorName, + this.doctorNameN, + this.doctorRate, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.noOfPatientsRate, + this.projectName, + this.projectNameN}); + + Reports.fromJson(Map json) { + status = json['Status']; + encounterDate = DateUtil.convertStringToDate( + json['EncounterDate']); //json['EncounterDate']; + projectID = json['ProjectID']; + invoiceNo = json['InvoiceNo']; + encounterNo = json['EncounterNo']; + procedureId = json['ProcedureId']; + requestType = json['RequestType']; + setupId = json['SetupId']; + patientID = json['PatientID']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + requestDate = DateUtil.convertStringToDate( + json['RequestDate']); //json['RequestDate']; + isRead = json['IsRead']; + isReadOn = + DateUtil.convertStringToDate(json['IsReadOn']); //json['IsReadOn']; + actualDoctorRate = json['ActualDoctorRate']; + clinicDescription = json['ClinicDescription']; + clinicDescriptionN = json['ClinicDescriptionN']; + docName = json['DocName']; + docNameN = json['DocNameN']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + doctorRate = json['DoctorRate']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + noOfPatientsRate = json['NoOfPatientsRate']; + projectName = json['ProjectName']; + projectNameN = json['ProjectNameN']; + } + + Map toJson() { + final Map data = new Map(); + data['Status'] = this.status; + data['EncounterDate'] = this.encounterDate; + data['ProjectID'] = this.projectID; + data['InvoiceNo'] = this.invoiceNo; + data['EncounterNo'] = this.encounterNo; + data['ProcedureId'] = this.procedureId; + data['RequestType'] = this.requestType; + data['SetupId'] = this.setupId; + data['PatientID'] = this.patientID; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + data['RequestDate'] = this.requestDate; + data['IsRead'] = this.isRead; + data['IsReadOn'] = this.isReadOn; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['ClinicDescription'] = this.clinicDescription; + data['ClinicDescriptionN'] = this.clinicDescriptionN; + data['DocName'] = this.docName; + data['DocNameN'] = this.docNameN; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['DoctorRate'] = this.doctorRate; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['ProjectName'] = this.projectName; + data['ProjectNameN'] = this.projectNameN; + return data; + } +} + +class ReportsList { + String filterName = ""; + + List reportsList = List(); + + ReportsList({this.filterName, Reports reports}) { + reportsList.add(reports); + } +} diff --git a/lib/core/model/reports/request_report_history.dart b/lib/core/model/reports/request_report_history.dart new file mode 100644 index 00000000..f7d02cc5 --- /dev/null +++ b/lib/core/model/reports/request_report_history.dart @@ -0,0 +1,76 @@ +class RequestReportHistory { + int projectID; + int clinicID; + bool isForMedicalReport; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + RequestReportHistory( + {this.projectID, + this.clinicID, + this.isForMedicalReport, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + RequestReportHistory.fromJson(Map json) { + projectID = json['ProjectID']; + clinicID = json['ClinicID']; + isForMedicalReport = json['IsForMedicalReport']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['ClinicID'] = this.clinicID; + data['IsForMedicalReport'] = this.isForMedicalReport; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/model/reports/request_reports.dart b/lib/core/model/reports/request_reports.dart new file mode 100644 index 00000000..14359591 --- /dev/null +++ b/lib/core/model/reports/request_reports.dart @@ -0,0 +1,76 @@ +class RequestReports { + bool isReport; + int encounterType; + int requestType; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + RequestReports( + {this.isReport, + this.encounterType, + this.requestType, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + RequestReports.fromJson(Map json) { + isReport = json['IsReport']; + encounterType = json['EncounterType']; + requestType = json['RequestType']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['IsReport'] = this.isReport; + data['EncounterType'] = this.encounterType; + data['RequestType'] = this.requestType; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/sick_leave/sick_leave.dart b/lib/core/model/sick_leave/sick_leave.dart new file mode 100644 index 00000000..6811a552 --- /dev/null +++ b/lib/core/model/sick_leave/sick_leave.dart @@ -0,0 +1,141 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class SickLeave { + String setupID; + int projectID; + int patientID; + int patientType; + int clinicID; + int doctorID; + int requestNo; + DateTime requestDate; + int sickLeaveDays; + int appointmentNo; + int admissionNo; + int actualDoctorRate; + String appointmentDate; + String clinicName; + String doctorImageURL; + String doctorName; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + bool isInOutPatient; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + int noOfPatientsRate; + Null patientName; + String projectName; + String qR; + List speciality; + bool isLiveCareAppointment; + + SickLeave( + {this.setupID, + this.projectID, + this.patientID, + this.patientType, + this.clinicID, + this.doctorID, + this.requestNo, + this.requestDate, + this.sickLeaveDays, + this.appointmentNo, + this.admissionNo, + this.actualDoctorRate, + this.appointmentDate, + this.clinicName, + this.doctorImageURL, + this.doctorName, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isInOutPatient, + this.isInOutPatientDescription, + this.isInOutPatientDescriptionN, + this.noOfPatientsRate, + this.patientName, + this.projectName, + this.qR, + this.speciality,this.isLiveCareAppointment}); + + SickLeave.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + patientType = json['PatientType']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + requestNo = json['RequestNo']; + requestDate = DateUtil.convertStringToDate(json['RequestDate']); + sickLeaveDays = json['SickLeaveDays']; + appointmentNo = json['AppointmentNo']; + admissionNo = json['AdmissionNo']; + actualDoctorRate = json['ActualDoctorRate']; + appointmentDate = json['AppointmentDate']; + clinicName = json['ClinicName']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + isInOutPatient = json['IsInOutPatient']; + isInOutPatientDescription = json['IsInOutPatientDescription']; + isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN']; + noOfPatientsRate = json['NoOfPatientsRate']; + patientName = json['PatientName']; + projectName = json['ProjectName']; + qR = json['QR']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + if(json['Speciality']!=null) + speciality = json['Speciality'].cast(); + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['PatientType'] = this.patientType; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['RequestNo'] = this.requestNo; + data['RequestDate'] = DateUtil.convertDateToString(requestDate); + data['SickLeaveDays'] = this.sickLeaveDays; + data['AppointmentNo'] = this.appointmentNo; + data['AdmissionNo'] = this.admissionNo; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['AppointmentDate'] = this.appointmentDate; + data['ClinicName'] = this.clinicName; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsInOutPatient'] = this.isInOutPatient; + data['IsInOutPatientDescription'] = this.isInOutPatientDescription; + data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['PatientName'] = this.patientName; + data['ProjectName'] = this.projectName; + data['QR'] = this.qR; + data['Speciality'] = this.speciality; + return data; + } +} diff --git a/lib/core/model/vaccine/my_vaccine.dart b/lib/core/model/vaccine/my_vaccine.dart new file mode 100644 index 00000000..dc921c12 --- /dev/null +++ b/lib/core/model/vaccine/my_vaccine.dart @@ -0,0 +1,152 @@ +class VaccineModel { + String setupID; + int projectID; + int patientID; + int invoiceNo; + String procedureID; + String vaccineName; + Null vaccineNameN; + String invoiceDate; + int doctorID; + int clinicID; + String firstName; + String middleName; + String lastName; + Null firstNameN; + Null middleNameN; + Null lastNameN; + String dateofBirth; + int actualDoctorRate; + String age; + String clinicName; + String doctorImageURL; + String doctorName; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + int noOfPatientsRate; + String patientName; + String projectName; + String qR; + List speciality; + String vaccinationDate; + + VaccineModel( + {this.setupID, + this.projectID, + this.patientID, + this.invoiceNo, + this.procedureID, + this.vaccineName, + this.vaccineNameN, + this.invoiceDate, + this.doctorID, + this.clinicID, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.dateofBirth, + this.actualDoctorRate, + this.age, + this.clinicName, + this.doctorImageURL, + this.doctorName, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.noOfPatientsRate, + this.patientName, + this.projectName, + this.qR, + this.speciality, + this.vaccinationDate}); + + VaccineModel.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + invoiceNo = json['InvoiceNo']; + procedureID = json['ProcedureID']; + vaccineName = json['VaccineName']; + vaccineNameN = json['VaccineNameN']; + invoiceDate = json['InvoiceDate']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + firstName = json['FirstName']; + middleName = json['MiddleName']; + lastName = json['LastName']; + firstNameN = json['FirstNameN']; + middleNameN = json['MiddleNameN']; + lastNameN = json['LastNameN']; + dateofBirth = json['DateofBirth']; + actualDoctorRate = json['ActualDoctorRate']; + age = json['Age']; + clinicName = json['ClinicName']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + noOfPatientsRate = json['NoOfPatientsRate']; + patientName = json['PatientName']; + projectName = json['ProjectName']; + qR = json['QR']; + speciality = json['Speciality'].cast(); + vaccinationDate = json['VaccinationDate']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['InvoiceNo'] = this.invoiceNo; + data['ProcedureID'] = this.procedureID; + data['VaccineName'] = this.vaccineName; + data['VaccineNameN'] = this.vaccineNameN; + data['InvoiceDate'] = this.invoiceDate; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + data['FirstName'] = this.firstName; + data['MiddleName'] = this.middleName; + data['LastName'] = this.lastName; + data['FirstNameN'] = this.firstNameN; + data['MiddleNameN'] = this.middleNameN; + data['LastNameN'] = this.lastNameN; + data['DateofBirth'] = this.dateofBirth; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['Age'] = this.age; + data['ClinicName'] = this.clinicName; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['PatientName'] = this.patientName; + data['ProjectName'] = this.projectName; + data['QR'] = this.qR; + data['Speciality'] = this.speciality; + data['VaccinationDate'] = this.vaccinationDate; + return data; + } +} diff --git a/lib/core/model/vaccine/vaccination_item.dart b/lib/core/model/vaccine/vaccination_item.dart new file mode 100644 index 00000000..0009ea7d --- /dev/null +++ b/lib/core/model/vaccine/vaccination_item.dart @@ -0,0 +1,18 @@ +class VaccinationItem { + String dESCRIPTION; + String iTEMCODE; + + VaccinationItem({this.dESCRIPTION, this.iTEMCODE}); + + VaccinationItem.fromJson(Map json) { + dESCRIPTION = json['DESCRIPTION']; + iTEMCODE = json['ITEM_CODE']; + } + + Map toJson() { + final Map data = new Map(); + data['DESCRIPTION'] = this.dESCRIPTION; + data['ITEM_CODE'] = this.iTEMCODE; + return data; + } +} diff --git a/lib/core/model/vaccine/vaccination_on_hand.dart b/lib/core/model/vaccine/vaccination_on_hand.dart new file mode 100644 index 00000000..daf3e886 --- /dev/null +++ b/lib/core/model/vaccine/vaccination_on_hand.dart @@ -0,0 +1,44 @@ +class VaccinationOnHand { + int distanceInKilometers; + int iTEMONHAND; + bool isThereItems; + String oRGANIZATIONCODE; + String oRGANIZATIONNAME; + String projectAlias; + int projectID; + String projectName; + + VaccinationOnHand( + {this.distanceInKilometers, + this.iTEMONHAND, + this.isThereItems, + this.oRGANIZATIONCODE, + this.oRGANIZATIONNAME, + this.projectAlias, + this.projectID, + this.projectName}); + + VaccinationOnHand.fromJson(Map json) { + distanceInKilometers = json['DistanceInKilometers']; + iTEMONHAND = json['ITEM_ONHAND']; + isThereItems = json['IsThereItems']; + oRGANIZATIONCODE = json['ORGANIZATION_CODE']; + oRGANIZATIONNAME = json['ORGANIZATION_NAME']; + projectAlias = json['ProjectAlias']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + } + + Map toJson() { + final Map data = new Map(); + data['DistanceInKilometers'] = this.distanceInKilometers; + data['ITEM_ONHAND'] = this.iTEMONHAND; + data['IsThereItems'] = this.isThereItems; + data['ORGANIZATION_CODE'] = this.oRGANIZATIONCODE; + data['ORGANIZATION_NAME'] = this.oRGANIZATIONNAME; + data['ProjectAlias'] = this.projectAlias; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + return data; + } +} diff --git a/lib/core/model/vital_sign/vital_sign_req_model.dart b/lib/core/model/vital_sign/vital_sign_req_model.dart new file mode 100644 index 00000000..7cad3ef7 --- /dev/null +++ b/lib/core/model/vital_sign/vital_sign_req_model.dart @@ -0,0 +1,69 @@ +class VitalSignReqModel { + int patientID; + int projectID; + int patientTypeID; + int inOutpatientType; + int transNo; + int languageID; + String stamp ; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + + VitalSignReqModel( + {this.patientID, + this.projectID, + this.inOutpatientType, + this.transNo, + this.languageID, + this.tokenID, + this.stamp = '2020-04-26T09:32:18.317Z', + this.iPAdress='11.11.11.11', + this.versionID=1.2, + this.channel=9, + this.sessionID='E2bsEeYEJo', + this.isLoginForDoctorApp=true, + this.patientTypeID, + this.patientOutSA=false}); + + VitalSignReqModel.fromJson(Map json) { + projectID = json['ProjectID']; + patientID = json['PatientID']; + languageID = json['LanguageID']; + inOutpatientType = json['InOutpatientType']; + transNo = json['TransNo']; + stamp = json['stamp']; + iPAdress = json['IPAdress']; + versionID = json['VersionID']; + channel = json['Channel']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + patientOutSA = json['PatientOutSA']; + patientTypeID = json['PatientTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['InOutPatientType'] = this.inOutpatientType; + data['TransNo'] = this.transNo; + data['LanguageID'] = this.languageID; + data['stamp'] = this.stamp; + data['IPAdress'] = this.iPAdress; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['PatientOutSA'] = this.patientOutSA; + data['PatientTypeID'] = this.patientTypeID; + return data; + } + +} diff --git a/lib/core/model/vital_sign/vital_sign_res_model.dart b/lib/core/model/vital_sign/vital_sign_res_model.dart new file mode 100644 index 00000000..1377e626 --- /dev/null +++ b/lib/core/model/vital_sign/vital_sign_res_model.dart @@ -0,0 +1,259 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class VitalSignResModel { + var transNo; + var projectID; + var weightKg; + var heightCm; + var temperatureCelcius; + var pulseBeatPerMinute; + var respirationBeatPerMinute; + var bloodPressureLower; + var bloodPressureHigher; + var sAO2; + var fIO2; + var painScore; + var bodyMassIndex; + var headCircumCm; + var leanBodyWeightLbs; + var idealBodyWeightLbs; + var temperatureCelciusMethod; + var pulseRhythm; + var respirationPattern; + var bloodPressureCuffLocation; + var bloodPressureCuffSize; + var bloodPressurePatientPosition; + var painLocation; + var painDuration; + var painCharacter; + var painFrequency; + bool isPainManagementDone; + var status; + bool isVitalsRequired; + var patientID; + var createdOn; + var doctorID; + var clinicID; + var triageCategory; + var gCScore; + var lineItemNo; + DateTime vitalSignDate; + var actualTimeTaken; + var sugarLevel; + var fBS; + var rBS; + var observationType; + var heartRate; + var muscleTone; + var reflexIrritability; + var bodyColor; + var isFirstAssessment; + var dateofBirth; + var timeOfBirth; + var bloodPressure; + var bloodPressureCuffLocationDesc; + var bloodPressureCuffSizeDesc; + var bloodPressurePatientPositionDesc; + var clinicName; + var doctorImageURL; + var doctorName; + var painScoreDesc; + var pulseRhythmDesc; + var respirationPatternDesc; + var temperatureCelciusMethodDesc; + var time; + + VitalSignResModel( + {this.transNo, + this.projectID, + this.weightKg, + this.heightCm, + this.temperatureCelcius, + this.pulseBeatPerMinute, + this.respirationBeatPerMinute, + this.bloodPressureLower, + this.bloodPressureHigher, + this.sAO2, + this.fIO2, + this.painScore, + this.bodyMassIndex, + this.headCircumCm, + this.leanBodyWeightLbs, + this.idealBodyWeightLbs, + this.temperatureCelciusMethod, + this.pulseRhythm, + this.respirationPattern, + this.bloodPressureCuffLocation, + this.bloodPressureCuffSize, + this.bloodPressurePatientPosition, + this.painLocation, + this.painDuration, + this.painCharacter, + this.painFrequency, + this.isPainManagementDone, + this.status, + this.isVitalsRequired, + this.patientID, + this.createdOn, + this.doctorID, + this.clinicID, + this.triageCategory, + this.gCScore, + this.lineItemNo, + this.vitalSignDate, + this.actualTimeTaken, + this.sugarLevel, + this.fBS, + this.rBS, + this.observationType, + this.heartRate, + this.muscleTone, + this.reflexIrritability, + this.bodyColor, + this.isFirstAssessment, + this.dateofBirth, + this.timeOfBirth, + this.bloodPressure, + this.bloodPressureCuffLocationDesc, + this.bloodPressureCuffSizeDesc, + this.bloodPressurePatientPositionDesc, + this.clinicName, + this.doctorImageURL, + this.doctorName, + this.painScoreDesc, + this.pulseRhythmDesc, + this.respirationPatternDesc, + this.temperatureCelciusMethodDesc, + this.time}); + + VitalSignResModel.fromJson(Map json) { + transNo = json['TransNo']; + projectID = json['ProjectID']; + weightKg = json['WeightKg']; + heightCm = json['HeightCm']; + temperatureCelcius = json['TemperatureCelcius']; + pulseBeatPerMinute = json['PulseBeatPerMinute']; + respirationBeatPerMinute = json['RespirationBeatPerMinute']; + bloodPressureLower = json['BloodPressureLower']; + bloodPressureHigher = json['BloodPressureHigher']; + sAO2 = json['SAO2']; + fIO2 = json['FIO2']; + painScore = json['PainScore']; + bodyMassIndex = json['BodyMassIndex']; + headCircumCm = json['HeadCircumCm']; + leanBodyWeightLbs = json['LeanBodyWeightLbs']; + idealBodyWeightLbs = json['IdealBodyWeightLbs']; + temperatureCelciusMethod = json['TemperatureCelciusMethod']; + pulseRhythm = json['PulseRhythm']; + respirationPattern = json['RespirationPattern']; + bloodPressureCuffLocation = json['BloodPressureCuffLocation']; + bloodPressureCuffSize = json['BloodPressureCuffSize']; + bloodPressurePatientPosition = json['BloodPressurePatientPosition']; + painLocation = json['PainLocation']; + painDuration = json['PainDuration']; + painCharacter = json['PainCharacter']; + painFrequency = json['PainFrequency']; + isPainManagementDone = json['IsPainManagementDone']; + status = json['Status']; + isVitalsRequired = json['IsVitalsRequired']; + patientID = json['PatientID']; + createdOn = json['CreatedOn']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + triageCategory = json['TriageCategory']; + gCScore = json['GCScore']; + lineItemNo = json['LineItemNo']; + vitalSignDate = DateUtil.convertStringToDate(json['CreatedOn']); + actualTimeTaken = json['ActualTimeTaken']; + sugarLevel = json['SugarLevel']; + fBS = json['FBS']; + rBS = json['RBS']; + observationType = json['ObservationType']; + heartRate = json['HeartRate']; + muscleTone = json['MuscleTone']; + reflexIrritability = json['ReflexIrritability']; + bodyColor = json['BodyColor']; + isFirstAssessment = json['IsFirstAssessment']; + dateofBirth = json['DateofBirth']; + timeOfBirth = json['TimeOfBirth']; + bloodPressure = json['BloodPressure']; + bloodPressureCuffLocationDesc = json['BloodPressureCuffLocationDesc']; + bloodPressureCuffSizeDesc = json['BloodPressureCuffSizeDesc']; + bloodPressurePatientPositionDesc = json['BloodPressurePatientPositionDesc']; + clinicName = json['ClinicName']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + painScoreDesc = json['PainScoreDesc']; + pulseRhythmDesc = json['PulseRhythmDesc']; + respirationPatternDesc = json['RespirationPatternDesc']; + temperatureCelciusMethodDesc = json['TemperatureCelciusMethodDesc']; + time = json['Time']; + } + + Map toJson() { + final Map data = new Map(); + data['TransNo'] = this.transNo; + data['ProjectID'] = this.projectID; + data['WeightKg'] = this.weightKg; + data['HeightCm'] = this.heightCm; + data['TemperatureCelcius'] = this.temperatureCelcius; + data['PulseBeatPerMinute'] = this.pulseBeatPerMinute; + data['RespirationBeatPerMinute'] = this.respirationBeatPerMinute; + data['BloodPressureLower'] = this.bloodPressureLower; + data['BloodPressureHigher'] = this.bloodPressureHigher; + data['SAO2'] = this.sAO2; + data['FIO2'] = this.fIO2; + data['PainScore'] = this.painScore; + data['BodyMassIndex'] = this.bodyMassIndex; + data['HeadCircumCm'] = this.headCircumCm; + data['LeanBodyWeightLbs'] = this.leanBodyWeightLbs; + data['IdealBodyWeightLbs'] = this.idealBodyWeightLbs; + data['TemperatureCelciusMethod'] = this.temperatureCelciusMethod; + data['PulseRhythm'] = this.pulseRhythm; + data['RespirationPattern'] = this.respirationPattern; + data['BloodPressureCuffLocation'] = this.bloodPressureCuffLocation; + data['BloodPressureCuffSize'] = this.bloodPressureCuffSize; + data['BloodPressurePatientPosition'] = this.bloodPressurePatientPosition; + data['PainLocation'] = this.painLocation; + data['PainDuration'] = this.painDuration; + data['PainCharacter'] = this.painCharacter; + data['PainFrequency'] = this.painFrequency; + data['IsPainManagementDone'] = this.isPainManagementDone; + data['Status'] = this.status; + data['IsVitalsRequired'] = this.isVitalsRequired; + data['PatientID'] = this.patientID; + data['CreatedOn'] = this.createdOn; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + data['TriageCategory'] = this.triageCategory; + data['GCScore'] = this.gCScore; + data['LineItemNo'] = this.lineItemNo; + data['VitalSignDate'] = this.vitalSignDate; + data['ActualTimeTaken'] = this.actualTimeTaken; + data['SugarLevel'] = this.sugarLevel; + data['FBS'] = this.fBS; + data['RBS'] = this.rBS; + data['ObservationType'] = this.observationType; + data['HeartRate'] = this.heartRate; + data['MuscleTone'] = this.muscleTone; + data['ReflexIrritability'] = this.reflexIrritability; + data['BodyColor'] = this.bodyColor; + data['IsFirstAssessment'] = this.isFirstAssessment; + data['DateofBirth'] = this.dateofBirth; + data['TimeOfBirth'] = this.timeOfBirth; + data['BloodPressure'] = this.bloodPressure; + data['BloodPressureCuffLocationDesc'] = this.bloodPressureCuffLocationDesc; + data['BloodPressureCuffSizeDesc'] = this.bloodPressureCuffSizeDesc; + data['BloodPressurePatientPositionDesc'] = + this.bloodPressurePatientPositionDesc; + data['ClinicName'] = this.clinicName; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['PainScoreDesc'] = this.painScoreDesc; + data['PulseRhythmDesc'] = this.pulseRhythmDesc; + data['RespirationPatternDesc'] = this.respirationPatternDesc; + data['TemperatureCelciusMethodDesc'] = this.temperatureCelciusMethodDesc; + data['Time'] = this.time; + return data; + } +} diff --git a/lib/core/model/weahter/weather_model.dart b/lib/core/model/weahter/weather_model.dart new file mode 100644 index 00000000..37ee5983 --- /dev/null +++ b/lib/core/model/weahter/weather_model.dart @@ -0,0 +1,267 @@ +class WeatherIndicatorModel { + Null date; + int languageID; + int serviceName; + Null time; + Null androidLink; + Null authenticationTokenID; + Null data; + bool dataw; + int dietType; + Null errorCode; + Null errorEndUserMessage; + Null errorEndUserMessageN; + Null errorMessage; + int errorType; + int foodCategory; + Null iOSLink; + bool isAuthenticated; + int mealOrderStatus; + int mealType; + int messageStatus; + int numberOfResultRecords; + Null patientBlodType; + Null successMsg; + Null successMsgN; + Null citiesList; + Null cityName; + Null get5DaysWeatherForecastList; + List getCityInfoList; + Null getTodayWeatherForecastList; + Null iniciesList; + + WeatherIndicatorModel( + {this.date, + this.languageID, + this.serviceName, + this.time, + this.androidLink, + this.authenticationTokenID, + this.data, + this.dataw, + this.dietType, + this.errorCode, + this.errorEndUserMessage, + this.errorEndUserMessageN, + this.errorMessage, + this.errorType, + this.foodCategory, + this.iOSLink, + this.isAuthenticated, + this.mealOrderStatus, + this.mealType, + this.messageStatus, + this.numberOfResultRecords, + this.patientBlodType, + this.successMsg, + this.successMsgN, + this.citiesList, + this.cityName, + this.get5DaysWeatherForecastList, + this.getCityInfoList, + this.getTodayWeatherForecastList, + this.iniciesList}); + + WeatherIndicatorModel.fromJson(Map json) { + date = json['Date']; + languageID = json['LanguageID']; + serviceName = json['ServiceName']; + time = json['Time']; + androidLink = json['AndroidLink']; + authenticationTokenID = json['AuthenticationTokenID']; + data = json['Data']; + dataw = json['Dataw']; + dietType = json['DietType']; + errorCode = json['ErrorCode']; + errorEndUserMessage = json['ErrorEndUserMessage']; + errorEndUserMessageN = json['ErrorEndUserMessageN']; + errorMessage = json['ErrorMessage']; + errorType = json['ErrorType']; + foodCategory = json['FoodCategory']; + iOSLink = json['IOSLink']; + isAuthenticated = json['IsAuthenticated']; + mealOrderStatus = json['MealOrderStatus']; + mealType = json['MealType']; + messageStatus = json['MessageStatus']; + numberOfResultRecords = json['NumberOfResultRecords']; + patientBlodType = json['PatientBlodType']; + successMsg = json['SuccessMsg']; + successMsgN = json['SuccessMsgN']; + citiesList = json['CitiesList']; + cityName = json['CityName']; + get5DaysWeatherForecastList = json['Get5DaysWeatherForecastList']; + if (json['GetCityInfo_List'] != null) { + getCityInfoList = new List(); + json['GetCityInfo_List'].forEach((v) { + getCityInfoList.add(new GetCityInfoList.fromJson(v)); + }); + } + getTodayWeatherForecastList = json['GetTodayWeatherForecastList']; + iniciesList = json['IniciesList']; + } + + Map toJson() { + final Map data = new Map(); + data['Date'] = this.date; + data['LanguageID'] = this.languageID; + data['ServiceName'] = this.serviceName; + data['Time'] = this.time; + data['AndroidLink'] = this.androidLink; + data['AuthenticationTokenID'] = this.authenticationTokenID; + data['Data'] = this.data; + data['Dataw'] = this.dataw; + data['DietType'] = this.dietType; + data['ErrorCode'] = this.errorCode; + data['ErrorEndUserMessage'] = this.errorEndUserMessage; + data['ErrorEndUserMessageN'] = this.errorEndUserMessageN; + data['ErrorMessage'] = this.errorMessage; + data['ErrorType'] = this.errorType; + data['FoodCategory'] = this.foodCategory; + data['IOSLink'] = this.iOSLink; + data['IsAuthenticated'] = this.isAuthenticated; + data['MealOrderStatus'] = this.mealOrderStatus; + data['MealType'] = this.mealType; + data['MessageStatus'] = this.messageStatus; + data['NumberOfResultRecords'] = this.numberOfResultRecords; + data['PatientBlodType'] = this.patientBlodType; + data['SuccessMsg'] = this.successMsg; + data['SuccessMsgN'] = this.successMsgN; + data['CitiesList'] = this.citiesList; + data['CityName'] = this.cityName; + data['Get5DaysWeatherForecastList'] = this.get5DaysWeatherForecastList; + if (this.getCityInfoList != null) { + data['GetCityInfo_List'] = + this.getCityInfoList.map((v) => v.toJson()).toList(); + } + data['GetTodayWeatherForecastList'] = this.getTodayWeatherForecastList; + data['IniciesList'] = this.iniciesList; + return data; + } +} + +class GetCityInfoList { + CategoriesNames categoriesNames; + String category; + String categoryValue; + int cityID; + String cityName; + String cityNameN; + String colorName; + String createdOn; + String iD; + int iniceID; + bool isOrderEmpty; + bool isValuesReversed; + bool language; + double latitude; + double longitude; + String name; + int orderNum; + double temperature; + String value; + + GetCityInfoList( + {this.categoriesNames, + this.category, + this.categoryValue, + this.cityID, + this.cityName, + this.cityNameN, + this.colorName, + this.createdOn, + this.iD, + this.iniceID, + this.isOrderEmpty, + this.isValuesReversed, + this.language, + this.latitude, + this.longitude, + this.name, + this.orderNum, + this.temperature, + this.value}); + + GetCityInfoList.fromJson(Map json) { + categoriesNames = json['CategoriesNames'] != null + ? new CategoriesNames.fromJson(json['CategoriesNames']) + : null; + category = json['Category']; + categoryValue = json['CategoryValue']; + cityID = json['CityID']; + cityName = json['CityName']; + cityNameN = json['CityNameN']; + colorName = json['ColorName']; + createdOn = json['CreatedOn']; + iD = json['ID']; + iniceID = json['IniceID']; + isOrderEmpty = json['IsOrderEmpty']; + isValuesReversed = json['IsValuesReversed']; + language = json['Language']; + latitude = json['Latitude']; + longitude = json['Longitude']; + name = json['Name']; + orderNum = json['OrderNum']; + temperature = json['Temperature']; + value = json['Value']; + } + + Map toJson() { + final Map data = new Map(); + if (this.categoriesNames != null) { + data['CategoriesNames'] = this.categoriesNames.toJson(); + } + data['Category'] = this.category; + data['CategoryValue'] = this.categoryValue; + data['CityID'] = this.cityID; + data['CityName'] = this.cityName; + data['CityNameN'] = this.cityNameN; + data['ColorName'] = this.colorName; + data['CreatedOn'] = this.createdOn; + data['ID'] = this.iD; + data['IniceID'] = this.iniceID; + data['IsOrderEmpty'] = this.isOrderEmpty; + data['IsValuesReversed'] = this.isValuesReversed; + data['Language'] = this.language; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['Name'] = this.name; + data['OrderNum'] = this.orderNum; + data['Temperature'] = this.temperature; + data['Value'] = this.value; + return data; + } +} + +class CategoriesNames { + String category1; + String category2; + String category3; + String category4; + String category5; + + CategoriesNames( + {this.category1, + this.category2, + this.category3, + this.category4, + this.category5}); + + CategoriesNames.fromJson(Map json) { + category1 = json['Category1']; + category2 = json['Category2']; + category3 = json['Category3']; + category4 = json['Category4']; + category5 = json['Category5']; + } + + Map toJson() { + final Map data = new Map(); + data['Category1'] = this.category1; + data['Category2'] = this.category2; + data['Category3'] = this.category3; + data['Category4'] = this.category4; + data['Category5'] = this.category5; + return data; + } +} + diff --git a/lib/core/service/AlHabibMedicalService/H2O_service.dart b/lib/core/service/AlHabibMedicalService/H2O_service.dart new file mode 100644 index 00000000..c65221c5 --- /dev/null +++ b/lib/core/service/AlHabibMedicalService/H2O_service.dart @@ -0,0 +1,89 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_month_data_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_today_data_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_week_data_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_request_model.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class H2OService extends BaseService { + List userProgressForTodayDataList = List(); + List userProgressForWeekDataList = List(); + List userProgressForMonthDataList = List(); + UserProgressRequestModel userProgressRequestModel = + UserProgressRequestModel(); + + Future getUserProgressForTodayData() async { + userProgressRequestModel.progress = 1; + userProgressRequestModel.mobileNumber = user.mobileNumber.substring(1); + userProgressRequestModel.identificationNo = user.patientIdentificationNo; + + hasError = false; + await baseAppClient.post(H2O_GET_USER_PROGRESS, + onSuccess: (dynamic response, int statusCode) { + userProgressForTodayDataList.clear(); + response['UserProgressForTodayData'].forEach((progressData) { + userProgressForTodayDataList + .add(UserProgressForTodayDataModel.fromJson(progressData)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: userProgressRequestModel.toJson()); + } + + Future getUserProgressForWeekData() async { + userProgressRequestModel.progress = 2; + userProgressRequestModel.mobileNumber = super.user.mobileNumber.substring(1); + userProgressRequestModel.identificationNo = super.user.patientIdentificationNo; + + hasError = false; + await baseAppClient.post(H2O_GET_USER_PROGRESS, + onSuccess: (dynamic response, int statusCode) { + userProgressForTodayDataList.clear(); + response['UserProgressForWeekData'].forEach((hospital) { + userProgressForWeekDataList.add(UserProgressForWeekDataModel.fromJson(hospital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: userProgressRequestModel.toJson()); + } + + Future getUserProgressForMonthData() async { + userProgressRequestModel.progress = 3; + userProgressRequestModel.mobileNumber = super.user.mobileNumber.substring(1); + userProgressRequestModel.identificationNo = super.user.patientIdentificationNo; + + hasError = false; + await baseAppClient.post(H2O_GET_USER_PROGRESS, + onSuccess: (dynamic response, int statusCode) { + userProgressForMonthDataList.clear(); + response['UserProgressForMonthData'].forEach((hospital) { + userProgressForMonthDataList.add(UserProgressForMonthDataModel.fromJson(hospital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: userProgressRequestModel.toJson()); + } + + + + + Future insertUserActivity(InsertUserActivityRequestModel insertUserActivityRequestModel) async { + + hasError = false; + await baseAppClient.post(H2O_INSERT_USER_ACTIVITY, + onSuccess: (dynamic response, int statusCode) { + userProgressForTodayDataList.clear(); + response['UserProgressForTodayData'].forEach((progressData) { + userProgressForTodayDataList + .add(UserProgressForTodayDataModel.fromJson(progressData)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: insertUserActivityRequestModel.toJson()); + } +} diff --git a/lib/core/service/AlHabibMedicalService/cmc_service.dart b/lib/core/service/AlHabibMedicalService/cmc_service.dart new file mode 100644 index 00000000..dffa6683 --- /dev/null +++ b/lib/core/service/AlHabibMedicalService/cmc_service.dart @@ -0,0 +1,115 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hHC_all_pres_orders_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; + +import '../base_service.dart'; + +class CMCService extends BaseService { + List cmcAllServicesList = List(); + List cmcAllPresOrdersList = List(); + + List cmcAllOrderDetail = List(); + List checkupItemsList = List(); + + bool isOrderUpdated; + + Future getCMCAllServices() async { + + + GetCMCServicesRequestModel getCMCServicesRequestModel= new GetCMCServicesRequestModel(genderID: user.gender, identificationNo: user.patientIdentificationNo); + hasError = false; + await baseAppClient.post(HHC_GET_ALL_CMC_SERVICES, + onSuccess: (dynamic response, int statusCode) { + cmcAllServicesList.clear(); + response['PatientER_CMC_GetAllServicesList'].forEach((data) { + cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getCMCServicesRequestModel.toJson()); + } + + + + Future getCmcAllPresOrders() async { + + GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel= GetHHCAllPresOrdersRequestModel(); + hasError = false; + await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS, + onSuccess: (dynamic response, int statusCode) { + cmcAllPresOrdersList.clear(); + response['PatientER_GetPatientAllPresOrdersList'].forEach((data) { + if (data['ServiceID'] == 3) + cmcAllPresOrdersList + .add(GetHHCAllPresOrdersResponseModel.fromJson(data)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getHHCAllPresOrdersRequestModel.toJson()); + } + + Future getOrderDetailByOrderID(GetOrderDetailByOrderIDRequestModel getOrderDetailByOrderIDRequestModel) async { + + hasError = false; + await baseAppClient.post(GET_CMC_ORDER_DETAIL_BY_ID, + onSuccess: (dynamic response, int statusCode) { + cmcAllOrderDetail.clear(); + response['PatientER_CMC_GetTransactionsForOrderList'].forEach((data) { + cmcAllOrderDetail.add(GetOrderDetailByOrderIDResponseModel.fromJson(data)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getOrderDetailByOrderIDRequestModel.toJson()); + } + + + Future getCheckupItems(CMCGetItemsRequestModel cMCGetItemsRequestModel) async { + + hasError = false; + await baseAppClient.post(GET_CHECK_UP_ITEMS, + onSuccess: (dynamic response, int statusCode) { + checkupItemsList.clear(); + response['GetCheckUpItemsList'].forEach((data) { + checkupItemsList.add(CMCGetItemsResponseModel.fromJson(data)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: cMCGetItemsRequestModel.toJson()); + } + + Future updateCmcPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { + + hasError = false; + await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, + onSuccess: (dynamic response, int statusCode) { + isOrderUpdated = true; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: updatePresOrderRequestModel.toJson()); + } + + Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async { + + hasError = false; + await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, + onSuccess: (dynamic response, int statusCode) { + isOrderUpdated = true; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: order.toJson()); + } +} diff --git a/lib/core/service/AlHabibMedicalService/e_referral_service.dart b/lib/core/service/AlHabibMedicalService/e_referral_service.dart new file mode 100644 index 00000000..6c356f5c --- /dev/null +++ b/lib/core/service/AlHabibMedicalService/e_referral_service.dart @@ -0,0 +1,125 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/send_activation_code_for_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class EReferralService extends BaseService { + List _relationTypes = List(); + List get relationTypes => _relationTypes; + List _allCities = List(); + List get allCities => _allCities; + + List _allReferral = List(); + List get allReferral => _allReferral; + String _activationCode; + String _logInTokenID; + + String get activationCode => _activationCode; + + bool _isActivationCodeValid = false; + + bool get isActivationCodeValid => _isActivationCodeValid; + + Future getRelationTypes() async { + await baseAppClient.post(GET_ALL_RELATIONSHIP_TYPES, + onSuccess: (dynamic response, int statusCode) { + _relationTypes.clear(); + response['List_EReferralResult'].forEach((relation) { + _relationTypes + .add(GetAllRelationshipTypeResponseModel.fromJson(relation)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: {}); + } + + Future getAllCities() async { + await baseAppClient.post(GET_ALL_CITIES, + onSuccess: (dynamic response, int statusCode) { + _allCities.clear(); + response['ListCities'].forEach((city) { + _allCities + .add(GetAllCitiesResponseModel.fromJson(city)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: {}); + } + + Future sendActivationCodeForEReferral( + + SendActivationCodeForEReferralRequestModel + sendActivationCodeForEReferralRequestModel) async { + hasError = false; + await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_E_REFERRAL, + onSuccess: (dynamic response, int statusCode) { + _activationCode = response["VerificationCode"]; + _logInTokenID = response["LogInTokenID"]; + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: sendActivationCodeForEReferralRequestModel.toJson()); + } + + + + Future checkActivationCodeForEReferral( + CheckActivationCodeForEReferralResponseModel + checkActivationCodeForEReferralRequestModel) async { + checkActivationCodeForEReferralRequestModel.isDentalAllowedBackend = false; + checkActivationCodeForEReferralRequestModel.logInTokenID= _logInTokenID; + hasError =false; + await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_E_REFERRAL, + onSuccess: (dynamic response, int statusCode) { + _isActivationCodeValid = true; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: checkActivationCodeForEReferralRequestModel.toJson()); + } + + Future createEReferral( + CreateEReferralRequestModel createEReferralRequestModel + ) async { + hasError = false; + await baseAppClient.post(CREATE_E_REFERRAL/*'Services/Patients.svc/REST/CreateEReferral'*/, + onSuccess: (dynamic response, int statusCode) { + // TODO Waiting for fix service + var asd= ("EEEEEE"); + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: createEReferralRequestModel.toJson()); + } + + Future getEReferrals( + SearchEReferralRequestModel searchEReferralRequestModel + ) async { + hasError = false; + // TODO return this code when the fix the server + // await baseAppClient.post(GET_E_REFERRALS, + // onSuccess: (dynamic response, int statusCode) { + // print("EEEEEE"); + // // TODO Waiting for fix service + // // ToDo change this one when you have data + // _allReferral.clear(); + // // response['ListCities'].forEach((city) { + // // _allReferral + // // .add(SearchEReferralResponseModel.fromJson(city)); + // // }); + // + // }, onFailure: (String error, int statusCode) { + // hasError = true; + // super.error = error; + // }, body: searchEReferralRequestModel.toJson()); + } +} diff --git a/lib/core/service/AlHabibMedicalService/home_health_care_service.dart b/lib/core/service/AlHabibMedicalService/home_health_care_service.dart new file mode 100644 index 00000000..e636321b --- /dev/null +++ b/lib/core/service/AlHabibMedicalService/home_health_care_service.dart @@ -0,0 +1,93 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hHC_all_pres_orders_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; + +import '../base_service.dart'; + +class HomeHealthCareService extends BaseService { + List hhcAllServicesList = List(); + List hhcAllPresOrdersList = List(); + + List hhcAllOrderDetail = List(); + + bool isOrderUpdated; + + Future getHHCAllServices( + HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel) async { + hasError = false; + await baseAppClient.post(HHC_GET_ALL_SERVICES, + onSuccess: (dynamic response, int statusCode) { + hhcAllServicesList.clear(); + response['PatientER_HHC_GetAllServicesList'].forEach((data) { + hhcAllServicesList.add(HHCGetAllServicesResponseModel.fromJson(data)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: hHCGetAllServicesRequestModel.toJson()); + } + + Future getHHCAllPresOrders() async { + GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = + GetHHCAllPresOrdersRequestModel(); + hasError = false; + await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS, + onSuccess: (dynamic response, int statusCode) { + hhcAllPresOrdersList.clear(); + response['PatientER_GetPatientAllPresOrdersList'].forEach((data) { + if (data['ServiceID'] == 2) + hhcAllPresOrdersList + .add(GetHHCAllPresOrdersResponseModel.fromJson(data)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getHHCAllPresOrdersRequestModel.toJson()); + } + + Future getOrderDetailByOrderID(int presOrderID) async { + hasError = false; + Map body = Map(); + body['PresOrderID'] = presOrderID; + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_ORDER_DETAIL_BY_ID, + onSuccess: (dynamic response, int statusCode) { + hhcAllOrderDetail.clear(); + response['PatientER_HHC_GetTransactionsForOrderList'].forEach((data) { + hhcAllOrderDetail + .add(GetOrderDetailByOrderIDResponseModel.fromJson(data)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future updateHHCPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { + hasError = false; + await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, + onSuccess: (dynamic response, int statusCode) { + isOrderUpdated = true; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: updatePresOrderRequestModel.toJson()); + } + + Future insertPresPresOrder({PatientERInsertPresOrderRequestModel order}) async { + hasError = false; + await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: order.toJson()); + } +} diff --git a/lib/core/service/AuthenticatedUserObject.dart b/lib/core/service/AuthenticatedUserObject.dart new file mode 100644 index 00000000..8dd2583d --- /dev/null +++ b/lib/core/service/AuthenticatedUserObject.dart @@ -0,0 +1,27 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; + +class AuthenticatedUserObject { + AuthenticatedUser user; + AppSharedPreferences sharedPref = AppSharedPreferences(); + bool isLogin = false; + + AuthenticatedUserObject() { + getUser(); + } + + getUser({bool getUser = false}) async { + if (getUser) { + var userData = await sharedPref.getObject(USER_PROFILE); + if (userData != null) user = AuthenticatedUser.fromJson(userData); + } else if (user == null) { + var userData = await sharedPref.getObject(USER_PROFILE); + if (userData != null) user = AuthenticatedUser.fromJson(userData); + } + } + + logout() async { + isLogin = false; + } +} diff --git a/lib/core/service/appointment_rate_service.dart b/lib/core/service/appointment_rate_service.dart new file mode 100644 index 00000000..a0c2b208 --- /dev/null +++ b/lib/core/service/appointment_rate_service.dart @@ -0,0 +1,71 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/rate/appointment_rate.dart'; +import 'package:diplomaticquarterapp/core/model/rate/appoitment_rated.dart'; +import 'package:diplomaticquarterapp/core/model/rate/appointment_details.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class AppointmentRateService extends BaseService { + List appointmentRatedList = List(); + AppointmentDetails appointmentDetails; + + Future getIsLastAppointmentRatedList() async { + hasError = false; + await baseAppClient.post(IS_LAST_APPOITMENT_RATED, + onSuccess: (dynamic response, int statusCode) { + appointmentRatedList.clear(); + response['IsLastAppoitmentRatedList'].forEach((appoint) { + appointmentRatedList.add(AppoitmentRated.fromJson(appoint)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + Future getAppointmentDetails() async { + hasError = false; + Map bodyData = Map(); + bodyData['AppointmentNumber'] = appointmentRatedList[0].appointmentNo; + bodyData['ProjectID'] = appointmentRatedList[0].projectID; + await baseAppClient.post(GET_APPOINTMENT_DETAILS_BY_NO, + onSuccess: (dynamic response, int statusCode) { + if (response['AppointmentDetails'] != null) + appointmentDetails = + AppointmentDetails.fromJson(response['AppointmentDetails']); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: bodyData); + } + + Future sendAppointmentRate(int rate, int appointmentNo, int projectID, + int doctorID, int clinicID, String note) async { + hasError = false; + AppointmentRate appointmentRate = AppointmentRate(); + appointmentRate.rate = rate; + appointmentRate.appointmentNo = appointmentNo; + appointmentRate.projectID = projectID; + appointmentRate.doctorID = doctorID; + appointmentRate.clinicID = clinicID; + appointmentRate.note = note; + + await baseAppClient.post(GET_APPOINTMENT_DETAILS_BY_NO, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: appointmentRate.toJson()); + } + + AppoitmentRated get lastAppointmentRated { + if (appointmentRatedList.length > 0) + return appointmentRatedList[appointmentRatedList.length - 1]; + return null; + } + + deleteAppointmentRated(AppoitmentRated appointmentRated) { + appointmentRatedList.remove(appointmentRated); + } + + deleteAllAppAppointmentRate() => appointmentRatedList.clear(); +} diff --git a/lib/core/service/base_service.dart b/lib/core/service/base_service.dart new file mode 100644 index 00000000..fdb80604 --- /dev/null +++ b/lib/core/service/base_service.dart @@ -0,0 +1,31 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; + +import 'AuthenticatedUserObject.dart'; +import 'client/base_app_client.dart'; + +class BaseService { + String error; + bool hasError = false; + BaseAppClient baseAppClient = BaseAppClient(); + AuthenticatedUser user; + + AuthenticatedUserObject authenticatedUserObject = locator(); + + AppSharedPreferences sharedPref = AppSharedPreferences(); + + BaseService() { + authenticatedUserObject.getUser(); + user = authenticatedUserObject.user; + // getUser(); + } + + getUser() async { + if (user==null) { + var userData = await sharedPref.getObject(USER_PROFILE); + if (userData != null) user = AuthenticatedUser.fromJson(userData); + } + } +} diff --git a/lib/core/service/blood/blood_details_servies.dart b/lib/core/service/blood/blood_details_servies.dart new file mode 100644 index 00000000..644d96d9 --- /dev/null +++ b/lib/core/service/blood/blood_details_servies.dart @@ -0,0 +1,31 @@ + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart'; + +import '../base_service.dart'; + +class BloodDetailsService extends BaseService{ + + // List CitiesModelList = List(); + // Map body = Map(); + + List BloodModelList = List(); + Map body = Map(); + Future getAllBloodOrders() async { + hasError = false; + body['List_BloodGroupDetails'] = false; + await baseAppClient.post(GET_BLOOD_REQUEST, + onSuccess: (dynamic response, int statusCode) { + BloodModelList.clear(); + + response['List_BloodGroupDetails'].forEach((vital) { + BloodModelList.add(List_BloodGroupDetailsModel.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + +} \ No newline at end of file diff --git a/lib/core/service/blood/blood_donation_service.dart b/lib/core/service/blood/blood_donation_service.dart new file mode 100644 index 00000000..326407a3 --- /dev/null +++ b/lib/core/service/blood/blood_donation_service.dart @@ -0,0 +1,28 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart'; + +import '../base_service.dart'; + +class BloodDonationService extends BaseService { + //List LivechatModelList = List(); + +// Map body = Map(); + + List CitiesModelList = List(); + Map body = Map(); + Future getAllCitiesOrders() async { + hasError = false; + body['ListCities'] = false; + await baseAppClient.post(GET_CITIES_REQUEST, + onSuccess: (dynamic response, int statusCode) { + CitiesModelList.clear(); + + response['ListCities'].forEach((vital) { + CitiesModelList.add(CitiesModel.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/childvaccines/add_new_child_service.dart b/lib/core/service/childvaccines/add_new_child_service.dart new file mode 100644 index 00000000..5e4a4d86 --- /dev/null +++ b/lib/core/service/childvaccines/add_new_child_service.dart @@ -0,0 +1,41 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/create_new_user_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; +import '../base_service.dart'; + +class CreteNewBabyService extends BaseService { + List createNewBabyModelList = List(); + List userModelList = List(); + List newUserModelList = List(); + + + + Future getCreateNewBabyOrders({CreateNewBaby newChild,int userID}) async { + hasError = false; + await getUser(); + Map body = Map.from(newChild.toJson()); + body['CreatedBy'] = 102; + body['EditedBy'] = 102; + body['UserID'] = userID; + body['AlertBy'] = 2; + body['EmailAddress'] = user.emailAddress; + body['IsLogin'] = true; + body['LogInTokenID'] = await sharedPref.getString(TOKEN); + body['MobileNumber'] = user.mobileNumber; + body['NationalID'] = user.nationalityID; + body['ZipCode'] = user.zipCode; + + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(GET_NEWCHILD_REQUEST, + onSuccess: (dynamic response, int statusCode) { + var asd =""; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/childvaccines/child_vaccines_service.dart b/lib/core/service/childvaccines/child_vaccines_service.dart new file mode 100644 index 00000000..09256f47 --- /dev/null +++ b/lib/core/service/childvaccines/child_vaccines_service.dart @@ -0,0 +1,56 @@ +import 'dart:convert'; + +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; +import '../base_service.dart'; + +class ChildVaccinesService extends BaseService { + List babyInformationModelList = List(); + List userInformationModelList = List(); + int userID = 0; + + Future getAllBabyInformationOrders() async { + Map body = Map(); + hasError = false; + body['isDentalAllowedBackend'] = false; + body['IsLogin'] = true; + body['UserID'] = userID; + await baseAppClient.post(GET_BABY_BY_USER_ID, + onSuccess: (dynamic response, int statusCode) { + babyInformationModelList.clear(); + response['List_BabyInformationModel'].forEach((vital) { + babyInformationModelList.add(List_BabyInformationModel.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getNewUserOrders() async { + Map body = Map(); + hasError = false; + await getUser(); + body['CreatedBy'] = 102; + body['EditedBy'] = 102; + body['UserID'] = userID; + body['AlertBy'] = 2; + body['EmailAddress'] = user.emailAddress; + body['IsLogin'] = true; + body['LogInTokenID'] = await sharedPref.getString(TOKEN); + body['MobileNumber'] = user.mobileNumber; + body['NationalID'] = user.nationalityID; + body['ZipCode'] = user.zipCode; + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(GET_NEW_USER_REQUEST, + onSuccess: (dynamic response, int statusCode) { + userID = response['UserID']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/childvaccines/delete_baby_service.dart b/lib/core/service/childvaccines/delete_baby_service.dart new file mode 100644 index 00000000..115d13c5 --- /dev/null +++ b/lib/core/service/childvaccines/delete_baby_service.dart @@ -0,0 +1,75 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/create_new_user_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; +import '../base_service.dart'; + + + +class DeleteBabyService extends BaseService{ + + List createNewBabyModelList = List(); + List userModelList = List(); + List newUserModelList = List(); + + List deleteBabyModelList= List(); + + + Future getDeleteBabyOrder({DeleteBaby deleteChild,int babyID}) async { + hasError = false; + await getUser(); + Map body = Map.from(deleteChild.toJson()); + // body['CreatedBy'] = 102; + body['EditedBy'] = 102; + //body['BabyID'] = babyID; + //body['BabyID'] = createNewBabyModelList ; + // body['AlertBy'] = 2; + // body['EmailAddress'] = user.emailAddress; + body['IsLogin'] = true; + body['LogInTokenID'] = await sharedPref.getString(TOKEN); + body['MobileNumber'] = user.mobileNumber; + body['NationalID'] = user.nationalityID; + body['ZipCode'] = user.zipCode; + + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(DELETE_CHILD_REQUEST, + onSuccess: (dynamic response, int statusCode) { + var asd =""; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + // Future getCreateNewBabyOrders({CreateNewBaby newChild,int userID}) async { + // hasError = false; + // await getUser(); + // Map body = Map.from(newChild.toJson()); + // body['CreatedBy'] = 102; + // body['EditedBy'] = 102; + // body['UserID'] = userID; + // body['AlertBy'] = 2; + // body['EmailAddress'] = user.emailAddress; + // body['IsLogin'] = true; + // body['LogInTokenID'] = await sharedPref.getString(TOKEN); + // body['MobileNumber'] = user.mobileNumber; + // body['NationalID'] = user.nationalityID; + // body['ZipCode'] = user.zipCode; + // + // body['isDentalAllowedBackend'] = false; + // + // await baseAppClient.post(GET_NEWCHILD_REQUEST, + // onSuccess: (dynamic response, int statusCode) { + // var asd =""; + // }, + // onFailure: (String error, int statusCode) { + // hasError = true; + // super.error = error; + // }, body: body); + // } + +} \ No newline at end of file diff --git a/lib/core/service/childvaccines/get_vaccinations_item_services.dart b/lib/core/service/childvaccines/get_vaccinations_item_services.dart new file mode 100644 index 00000000..5ff936af --- /dev/null +++ b/lib/core/service/childvaccines/get_vaccinations_item_services.dart @@ -0,0 +1,27 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/get_vacainations_itemsmodel.dart'; + +import '../base_service.dart'; + +class GetVccinationsItemsService extends BaseService { + List getVaccinationsItemModelList = List(); + Map body = Map(); + + + + Future getaccinationsitemOrders() async { + hasError = false; + await baseAppClient.post(GET_TABLE_REQUEST, + onSuccess: (dynamic response, int statusCode) { + getVaccinationsItemModelList.clear(); + response['List_CreateVaccinationTableModel'].forEach((vital) { + getVaccinationsItemModelList.add( + GET_VACCINATIONS_ITEMSMODEL.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + +} \ No newline at end of file diff --git a/lib/core/service/childvaccines/user_information_service.dart b/lib/core/service/childvaccines/user_information_service.dart new file mode 100644 index 00000000..0628920c --- /dev/null +++ b/lib/core/service/childvaccines/user_information_service.dart @@ -0,0 +1,35 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; +import '../base_service.dart'; + +class UserInformationService extends BaseService { + List userInformationModelList = List(); + Map body = Map(); + + Future getUserInformationOrders() async { + hasError = false; + await getUser(); + body['CreatedBy'] = 102; + body['EditedBy'] = 102; + body['EmailAddress'] = user.emailAddress; + body['IsLogin'] = true; + body['LogInTokenID'] = await sharedPref.getString(TOKEN); + body['MobileNumber'] = user.mobileNumber; + body['NationalID'] = user.nationalityID; + body['ZipCode'] = user.zipCode; + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(GET_USERINFORMATION_REQUEST, + onSuccess: (dynamic response, int statusCode) { + userInformationModelList.clear(); + + response['List_UserInformationModel_New'].forEach((vital) { + userInformationModelList.add(List_UserInformationModel.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/childvaccines/vaccination_table_service.dart b/lib/core/service/childvaccines/vaccination_table_service.dart new file mode 100644 index 00000000..7f987b76 --- /dev/null +++ b/lib/core/service/childvaccines/vaccination_table_service.dart @@ -0,0 +1,39 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; +import '../base_service.dart'; + +class VaccinationTableService extends BaseService { + List createVaccinationTableModelList = List(); + Map body = Map(); + + + + Future getCreateVaccinationTableOrders() async { + hasError = false; + await getUser(); + body['BabyName']="fffffffffff eeeeeeeeeeeeee"; + body['DOB'] = "/Date(1585774800000+0300)/"; + body['EmailAddress'] = user.emailAddress; + body['isDentalAllowedBackend'] = false; + body['SendEmail'] = false; + body['IsLogin'] =true; + + + + + await baseAppClient.post(GET_TABLE_REQUEST, + onSuccess: (dynamic response, int statusCode) { + createVaccinationTableModelList.clear(); + response['List_CreateVaccinationTableModel'].forEach((vital) { + createVaccinationTableModelList.add( + CreateVaccinationTable.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + +} \ No newline at end of file diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart new file mode 100644 index 00000000..64cd8bdb --- /dev/null +++ b/lib/core/service/client/base_app_client.dart @@ -0,0 +1,262 @@ +import 'dart:convert'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:http/http.dart' as http; +import 'package:provider/provider.dart'; + +import '../../../locator.dart'; +import '../../../routes.dart'; +import '../AuthenticatedUserObject.dart'; + +AppSharedPreferences sharedPref = new AppSharedPreferences(); + +///Example +///await BaseAppClient.post('', +/// onSuccess: (dynamic response, int statusCode) {}, +/// onFailure: (String error, int statusCode) {}, +/// body: Map(); +/// +AuthenticatedUserObject authenticatedUserObject = + locator(); +VitalSignService _vitalSignService = locator(); + +class BaseAppClient { + post(String endPoint, + {Map body, + Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure, + bool isAllowAny = false}) async { + String url = BASE_URL + endPoint; + try { + //Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + String token = await sharedPref.getString(TOKEN); + var languageID = await sharedPref.getString(APP_LANGUAGE) ?? 'ar'; + var user = await sharedPref.getObject(USER_PROFILE); + if (body.containsKey('SetupID')) { + body['SetupID'] = body.containsKey('SetupID') + ? body['SetupID'] != null + ? body['SetupID'] + : SETUP_ID + : SETUP_ID; + } + body['VersionID'] = VERSION_ID; + body['Channel'] = CHANNEL; + body['LanguageID'] = languageID == 'ar' ? 1 : 2; + + + body['IPAdress'] = IP_ADDRESS; + body['generalid'] = GENERAL_ID; + body['PatientOutSA'] = body.containsKey('PatientOutSA') + ? body['PatientOutSA'] != null + ? body['PatientOutSA'] + : PATIENT_OUT_SA + : PATIENT_OUT_SA; + + if (body.containsKey('isDentalAllowedBackend')) { + body['isDentalAllowedBackend'] = + body.containsKey('isDentalAllowedBackend') + ? body['isDentalAllowedBackend'] != null + ? body['isDentalAllowedBackend'] + : IS_DENTAL_ALLOWED_BACKEND + : IS_DENTAL_ALLOWED_BACKEND; + } + + body['DeviceTypeID'] = DeviceTypeID; + + if (!body.containsKey('IsPublicRequest')) { + body['PatientType'] = body.containsKey('PatientType') + ? body['PatientType'] != null + ? body['PatientType'] + : user['PatientType'] != null + ? user['PatientType'] + : PATIENT_TYPE + : PATIENT_TYPE; + + body['PatientTypeID'] = body.containsKey('PatientTypeID') + ? body['PatientTypeID'] != null + ? body['PatientTypeID'] + : user['PatientType'] != null + ? user['PatientType'] + : PATIENT_TYPE_ID + : PATIENT_TYPE_ID; + if (user != null) { + body['TokenID'] = token; + body['PatientID'] = + body['PatientID'] != null ? body['PatientID'] : user['PatientID']; + body['PatientOutSA'] = user['OutSA']; + body['SessionID'] = getSessionId(token); + } + } + + print("URL : $url"); + print("Body : ${json.encode(body)}"); + var ss = json.encode(body); + + if (await Utils.checkConnection()) { + final response = await http.post(url.trim(), + body: json.encode(body), + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + }); + final int statusCode = response.statusCode; + print("statusCode :$statusCode"); + if (statusCode < 200 || statusCode >= 400 || json == null) { + onFailure('Error While Fetching data', statusCode); + } else { + var parsed = json.decode(response.body.toString()); + if (parsed['Response_Message'] != null) { + onSuccess(parsed, statusCode); + } else { + if (isAllowAny) { + onSuccess(parsed, statusCode); + } else if (parsed['IsAuthenticated'] == null) { + if (parsed['isSMSSent'] == true) { + onSuccess(parsed, statusCode); + } else if (parsed['MessageStatus'] == 1) { + onSuccess(parsed, statusCode); + } else if (parsed['Result'] == 'OK') { + onSuccess(parsed, statusCode); + } else { + onFailure( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + } + } else if (parsed['MessageStatus'] == 1 || + parsed['SMSLoginRequired'] == true) { + onSuccess(parsed, statusCode); + } + else if(parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']){ + onFailure( + parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + } + else if (!parsed['IsAuthenticated']) { + await logout(); + + //helpers.showErrorToast('Your session expired Please login agian'); + } else { + if (parsed['SameClinicApptList'] != null) { + onSuccess(parsed, statusCode); + } else { + onFailure( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + } + } + } + } + } else { + onFailure('Please Check The Internet Connection', -1); + } + } catch (e) { + print(e); + onFailure(e.toString(), -1); + } + } + + get(String endPoint, + {Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure, + Map queryParams}) async { + String url = BASE_URL + endPoint; + if (queryParams != null) { + String queryString = Uri(queryParameters: queryParams).query; + url += '?' + queryString; + } + + print("URL : $url"); + + if (await Utils.checkConnection()) { + final response = await http.get(url.trim(), headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + },); + final int statusCode = response.statusCode; + print("statusCode :$statusCode"); + + if (statusCode < 200 || statusCode >= 400 || json == null) { + onFailure('Error While Fetching data', statusCode); + } else { + var parsed = json.decode(response.body.toString()); + onSuccess(parsed, statusCode); + } + } else { + onFailure('Please Check The Internet Connection', -1); + } + } + + + simpleGet(String fullUrl, {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map queryParams}) async { + String url = fullUrl; + var haveParams = (queryParams != null); + if (haveParams) { + String queryString = Uri(queryParameters: queryParams).query; + url += '?' + queryString; + print("URL Query String: $url"); + } + + if (await Utils.checkConnection()) { + final response = await http.get( + url.trim(), + headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}, + ); + + final int statusCode = response.statusCode; + print("statusCode :$statusCode"); + + if (statusCode < 200 || statusCode >= 400 || json == null) { + onFailure('Error While Fetching data', statusCode); + } else { + onSuccess(response.body.toString(), statusCode); + } + } else { + onFailure('Please Check The Internet Connection', -1); + } + } + + logout() async { + await sharedPref.remove(LOGIN_TOKEN_ID); + await authenticatedUserObject.getUser(); + Provider.of(AppGlobal.context, listen: false).isLogin = + false; + var model = Provider.of(AppGlobal.context,listen: false); + _vitalSignService.weightKg = ""; + _vitalSignService.heightCm = ""; + model.setState(0, false); + Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); + } + + String getSessionId(String id) { + ///return id.replaceAll(RegExp('/[^\w\s]/'), ''); + return id.replaceAll(RegExp('/[^a-zA-Z ]'), ''); + } + + static defaultHttpParameters() async { + String token = await sharedPref.getString(TOKEN); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var user = await sharedPref.getObject(USER_PROFILE); + var params = {}; + if (user != null) { + params['TokenID'] = token; + params['PatientID'] = user['PatientID']; + params['PatientOutSA'] = user['OutSA']; + params['SessionID'] = SESSION_ID; //getSessionId(token); + } + + params['IPAdress'] = IP_ADDRESS; + params['generalid'] = GENERAL_ID; + params['VersionID'] = VERSION_ID; + params['Channel'] = CHANNEL; + params['LanguageID'] = languageID == 'ar' ? 1 : 2; + + return params; + } +} diff --git a/lib/core/service/contactus/finadus_service.dart b/lib/core/service/contactus/finadus_service.dart new file mode 100644 index 00000000..4086def9 --- /dev/null +++ b/lib/core/service/contactus/finadus_service.dart @@ -0,0 +1,36 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart'; +import '../base_service.dart'; + +class FindusService extends BaseService { + + + List FindusModelList = List(); + List FindusHospitalModelList = List(); + List FindusPharmaciesModelList = List(); + Map body = Map(); + + Future getAllFindUsOrders() async { + hasError = false; + + await baseAppClient.post(GET_FINDUS_REQUEST, + onSuccess: (dynamic response, int statusCode) { + FindusModelList.clear(); + FindusHospitalModelList.clear(); + FindusPharmaciesModelList.clear(); + + response['ListHMGLocation'].forEach((vital) { + if (GetHMGLocationsModel.fromJson(vital).locationType == 1) { + FindusHospitalModelList.add(GetHMGLocationsModel.fromJson(vital)); + } else { + FindusPharmaciesModelList.add(GetHMGLocationsModel.fromJson(vital)); + } + + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/contactus/livechat_service.dart b/lib/core/service/contactus/livechat_service.dart new file mode 100644 index 00000000..025073ca --- /dev/null +++ b/lib/core/service/contactus/livechat_service.dart @@ -0,0 +1,28 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart'; +import 'package:diplomaticquarterapp/core/model/contactus/get_patientI_cprojects.dart'; +import '../base_service.dart'; + +class LiveChatService extends BaseService { + List LivechatModelList = List(); + + Map body = Map(); + // body['body'] + + Future getAllLiveChatOrders() async { + hasError = false; + body['List_PatientICProjects'] = false; + await baseAppClient.post(GET_LIVECHAT_REQUEST, + onSuccess: (dynamic response, int statusCode) { + LivechatModelList.clear(); + + response['List_PatientICProjects'].forEach((vital) { + LivechatModelList.add(GetPatientICProjectsModel.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/dashboard_service.dart b/lib/core/service/dashboard_service.dart new file mode 100644 index 00000000..a15a4b39 --- /dev/null +++ b/lib/core/service/dashboard_service.dart @@ -0,0 +1,7 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/rate/appoitment_rated.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class DashboardService extends BaseService { + +} diff --git a/lib/core/service/er/am_service.dart b/lib/core/service/er/am_service.dart new file mode 100644 index 00000000..2e9460b8 --- /dev/null +++ b/lib/core/service/er/am_service.dart @@ -0,0 +1,107 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; +import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart'; +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; +import 'package:diplomaticquarterapp/core/model/er/PickUpRequestPresOrder.dart'; +import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; +import 'package:flutter/cupertino.dart'; +import '../base_service.dart'; + +class AmService extends BaseService { + List amModelList = List(); + List patientAllPresOrdersList = List(); + bool hasPendingOrder = false; + int pendingOrderID = 0; + String pendingOrderStatus = ""; + String pendingOrderStatusAR = ""; + PickUpRequestPresOrder pickUpRequestPresOrder; + + Future getAllTransportationOrders() async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['IdentificationNo'] = user.patientIdentificationNo; + await baseAppClient.post(GET_AMBULANCE_REQUEST, + onSuccess: (dynamic response, int statusCode) { + amModelList.clear(); + response['PatientER_RRT_GetAllTransportationMethodList'].forEach((item) { + amModelList.add(PatientERTransportationMethod.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getPatientAllPresOrdersList() async { + hasError = false; + hasPendingOrder = false; + pickUpRequestPresOrder = null; + await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS, + onSuccess: (dynamic response, int statusCode) { + patientAllPresOrdersList.clear(); + response['PatientER_GetPatientAllPresOrdersList'].forEach((item) { + if (item['ServiceID'] == OrderService.AMBULANCE.getIdOrderService()) { + var order = PatientAllPresOrders.fromJson(item); + patientAllPresOrdersList.add(order); + if (order.status == 1) { + hasPendingOrder = true; + pendingOrderID = order.iD; + pendingOrderStatus = order.description; + pendingOrderStatusAR = order.descriptionN; + } + } + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + Future getOrderDetails() async { + hasError = false; + Map body = Map(); + body['PresOrderID'] = pendingOrderID; + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID, + onSuccess: (dynamic response, int statusCode) { + response['PatientER_RRT_GetPickUpRequestByPresOrderIDList'] + .forEach((item) { + pickUpRequestPresOrder = PickUpRequestPresOrder.fromJson(item); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future updatePressOrder({@required int presOrderID}) async { + hasError = false; + Map body = Map(); + body['PresOrderID'] = presOrderID; + body['EditedBy'] = 3; + body['RejectionReason'] = ''; + body['PresOrderStatus'] = OrderService.AMBULANCE.getIdOrderService(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(UPDATE_PRESS_ORDER, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future insertERPressOrder({@required PatientER patientER}) async { + hasError = false; + + await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: patientER.toJson()); + } +} diff --git a/lib/core/service/er/er_service.dart b/lib/core/service/er/er_service.dart new file mode 100644 index 00000000..bd3b6116 --- /dev/null +++ b/lib/core/service/er/er_service.dart @@ -0,0 +1,43 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/er/projectavgerwaitingtime.dart'; +import '../base_service.dart'; + +class ErService extends BaseService { + List projectAvgERWaitingTimeModelList = List(); + + Map body = Map(); + String Latitude = ""; + String Longitude = ""; + String PhoneNumber = ""; + + Future getProjectAvgERWaitingTimeOrders({int id, int projectID}) async { + hasError = false; + + if (id != null && projectID != null) { + body['ID'] = id; + body['ProjectID'] = projectID; + } + var lat = await sharedPref.getDouble(USER_LAT); + var long = await sharedPref.getDouble(USER_LONG); + body['Latitude'] = lat ?? 0; + body['Longitude'] = long ?? 0; + + await baseAppClient.post(GET_NEAREST_HOSPITAL, + onSuccess: (dynamic response, int statusCode) { + projectAvgERWaitingTimeModelList.clear(); + response['List_ProjectAvgERWaitingTime'].forEach((vital) { + projectAvgERWaitingTimeModelList + .add(ProjectAvgERWaitingTime.fromJson(vital)); + }); + projectAvgERWaitingTimeModelList.forEach((element) { + Latitude = '${element.latitude}'; + Longitude = '${element.longitude}'; + PhoneNumber = '${element.phoneNumber}'; + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/feedback/feedback_service.dart b/lib/core/service/feedback/feedback_service.dart new file mode 100644 index 00000000..9df5b0a6 --- /dev/null +++ b/lib/core/service/feedback/feedback_service.dart @@ -0,0 +1,97 @@ +import 'dart:io'; +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/feedback/COC_items.dart'; +import 'package:diplomaticquarterapp/core/model/feedback/request_insert_coc_item.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class FeedbackService extends BaseService { + List cOCItemList = List(); + RequestInsertCOCItem _requestInsertCOCItem = RequestInsertCOCItem(); + List appointHistoryList = List(); + + Future sendCOCItem( + {String title, + String details, + String cOCTypeName, + String attachment, + AppointmentHistory appointHistory}) async { + hasError = false; + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + + _requestInsertCOCItem.attachment = attachment; + _requestInsertCOCItem.title = title; + _requestInsertCOCItem.details = details; + _requestInsertCOCItem.cOCTypeName = cOCTypeName; + _requestInsertCOCItem.formTypeID = cOCTypeName; + _requestInsertCOCItem.mobileNo = user.mobileNumber; + _requestInsertCOCItem.isUserLoggedIn = true; + _requestInsertCOCItem.projectID = user.projectID; + _requestInsertCOCItem.patientName = user.firstName + " " + user.lastName; + _requestInsertCOCItem.fileName = ""; + _requestInsertCOCItem.appVersion = VERSION_ID; + _requestInsertCOCItem.uILanguage = languageID; //TODO Change it to be dynamic + _requestInsertCOCItem.browserInfo = Platform.localHostname; + _requestInsertCOCItem.deviceInfo = Platform.localHostname; + _requestInsertCOCItem.resolution = "400x847"; + _requestInsertCOCItem.projectID = 0; + _requestInsertCOCItem.identificationNo = + int.parse(user.patientIdentificationNo); + + final Map body = _requestInsertCOCItem.toJson(); + + if (appointHistory != null) { + body['AppoinmentNo'] = appointHistory.appointmentNo; + body['AppointmentDate'] = DateUtil.convertDateToString(appointHistory.appointmentDate); + body['ClinicID'] = appointHistory.clinicID; + body['ClinicName'] = appointHistory.clinicName; + body['DoctorID'] = appointHistory.doctorID; + body['DoctorName'] = appointHistory.doctorNameObj; + body['ProjectName'] = appointHistory.projectName; + } + + await baseAppClient + .post(SEND_FEEDBACK, onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getStatusCOC() async { + hasError = false; + Map body = new Map(); + body['IdentificationNo'] = user.patientIdentificationNo; + body['MobileNo'] = user.mobileNumber; + body['Searching_type'] = '1'; + + await baseAppClient.post(GET_STATUS_FOR_COCO, + onSuccess: (dynamic response, int statusCode) { + cOCItemList = []; + response['ListCOCItems'].forEach((cOC) { + cOCItemList.add(COCItem.fromJson(cOC)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getPatentAppointmentHistory() async { + hasError = false; + Map body = new Map(); + body['IsComingFromCOC'] = true; + baseAppClient.post(GET_PATIENT_AppointmentHistory, + onSuccess: (dynamic response, int statusCode) { + appointHistoryList = []; + response['AppoimentAllHistoryResultList'].forEach((appoint) { + appointHistoryList.add(AppointmentHistory.fromJson(appoint)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/geofencing/GeofencingServices.dart b/lib/core/service/geofencing/GeofencingServices.dart new file mode 100644 index 00000000..56b4f56e --- /dev/null +++ b/lib/core/service/geofencing/GeofencingServices.dart @@ -0,0 +1,66 @@ +import 'dart:convert'; +import 'dart:developer'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/geofencing/requests/GeoZonesRequestModel.dart'; +import 'package:diplomaticquarterapp/core/model/geofencing/requests/LogGeoZoneRequestModel.dart'; +import 'package:diplomaticquarterapp/core/model/geofencing/responses/GeoZonesResponseModel.dart'; +import 'package:diplomaticquarterapp/core/model/geofencing/responses/LogGeoZoneResponseModel.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; + +import '../../../locator.dart'; + +class GeofencingServices extends BaseService { + List geoZones = List(); + bool testZones = true; + + Future> getAllGeoZones(GeoZonesRequestModel request) async { + hasError = false; + + var _zonesJsonString; + await baseAppClient.post(GET_GEO_ZONES, onSuccess: (dynamic response, int statusCode) { + var zones = response['GeoF_PointsList']; + zones.forEach((json) { + geoZones.add(GeoZonesResponseModel().fromJson(json)); + }); + + if (kDebugMode || testZones) addTestingGeoZones(zones); + + _zonesJsonString = json.encode(zones); + }, onFailure: (String error, int statusCode) { + hasError = true; + return Future.error(error); + }, body: request.toFlatMap()); + + AppSharedPreferences pref = AppSharedPreferences(); + await pref.setString(HMG_GEOFENCES, _zonesJsonString); + debugPrint("Finished Fetching GEO ZONES from HMG service..."); + debugPrint("GEO ZONES saved to AppPreferences with key '$HMG_GEOFENCES'"); + + return geoZones; + } + + LogGeoZoneResponseModel logResponse; + Future logGeoZone(LogGeoZoneRequestModel request) async { + hasError = false; + await baseAppClient.post(LOG_GEO_ZONES, onSuccess: (dynamic response, int statusCode) { + logResponse = LogGeoZoneResponseModel().fromJson(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + return Future.error(error); + }, body: request.toFlatMap()); + return logResponse; + } + + addTestingGeoZones(List zones) { + // zones.add({"GEOF_ID": 12, "Description": "ZiK Home", "Latitude": "24.691136", "Longitude": "46.650116", "Radius": 100, "Type": 1}); + // zones.add({"GEOF_ID": 13, "Description": "CS Office", "Latitude": "24.7087913", "Longitude": "46.6656461", "Radius": 100, "Type": 1}); + // zones.add({"GEOF_ID": 14, "Description": "Mahmoud Shrouf Home", "Latitude": "24.777577", "Longitude": "46.652675", "Radius": 100, "Type": 1}); + // zones.add({"GEOF_ID": 14, "Description": "Panorama Mall", "Latitude": "24.692453", "Longitude": "46.669168", "Radius": 450, "Type": 1}); + // zones.add({"GEOF_ID": 16, "Description": "Saudi Architects Crossing", "Latitude": "24.698375", "Longitude": "46.668567", "Radius": 140, "Type": 1}); + } +} diff --git a/lib/core/service/hospital_service.dart b/lib/core/service/hospital_service.dart new file mode 100644 index 00000000..312d7fd7 --- /dev/null +++ b/lib/core/service/hospital_service.dart @@ -0,0 +1,45 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/model/hospitals/request_get_hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:geolocator/geolocator.dart'; + +class HospitalService extends BaseService { + List _hospitals = List(); + + List get hospitals => _hospitals; + + double _latitude; + double _longitude; + + _getCurrentLocation() async { + await Geolocator.getLastKnownPosition().then((value) { + _latitude = value.latitude; + _longitude = value.longitude; + }).catchError((e) { + _longitude = 0; + _latitude = 0; + }); + } + + Future getHospitals() async { + await _getCurrentLocation(); + Map body = Map(); + body['Latitude'] = _latitude; + body['Longitude'] = _longitude; + body['IsOnlineCheckIn'] = true; + body['PatientOutSA'] = 0; + + await baseAppClient.post(GET_PROJECT, + onSuccess: (dynamic response, int statusCode) { + _hospitals.clear(); + response['ListProject'].forEach((hospital) { + _hospitals.add(HospitalsModel.fromJson(hospital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + +} diff --git a/lib/core/service/insurance_service.dart b/lib/core/service/insurance_service.dart new file mode 100644 index 00000000..0b626342 --- /dev/null +++ b/lib/core/service/insurance_service.dart @@ -0,0 +1,182 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/insurance/Insurance_card_details.dart'; +import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dart'; +import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart'; +import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update_model.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart'; +import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +class InsuranceCardService extends BaseService { + List _cardList = List(); + List _cardUpdated = List(); + List _insuranceApproval = List(); + + List get cardList => _cardList; + + List get updatedCard => _cardUpdated; + + List get insuranceApproval => _insuranceApproval; + + InsuranceCardDetailsModel insuranceCardDetails; + List insuranceCardDetailsList = List(); + bool isHaveInsuranceCard = false; + + GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse(); + + clearInsuranceCard() { + _cardList.clear(); + } + + clearUpdatedList() { + _cardUpdated.clear(); + } + + + InsuranceApprovalModel _insuranceApprovalModel = InsuranceApprovalModel( + isDentalAllowedBackend: false, + patientTypeID: 1, + patientType: 1, + eXuldAPPNO: 0, + projectID: 0); + + Future getInsurance() async { + hasError = false; + _cardList.clear(); + await baseAppClient.post(GET_PAtIENTS_INSURANCE, + onSuccess: (dynamic response, int statusCode) { + response['List_PatientInsuranceCard'].forEach((item) { + _cardList.add(InsuranceCardModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + Future getInsuranceUpdate() async { + hasError = false; + _cardList.clear(); + await baseAppClient.post(GET_PAtIENTS_INSURANCE_UPDATED, + onSuccess: (dynamic response, int statusCode) { + _cardUpdated.clear(); + response['List_PatientInsuranceCardHistory'].forEach((item) { + _cardUpdated.add(InsuranceUpdateModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + Future getInsuranceApproval({int appointmentNo}) async { + hasError = false; + // _cardList.clear(); + if (appointmentNo != null) { + _insuranceApprovalModel.appointmentNo = appointmentNo; + _insuranceApprovalModel.eXuldAPPNO = null; + _insuranceApprovalModel.projectID = null; + } else { + _insuranceApprovalModel.appointmentNo = null; + _insuranceApprovalModel.eXuldAPPNO = 0; + _insuranceApprovalModel.projectID = 0; + } + + await baseAppClient.post(GET_PAtIENTS_INSURANCE_APPROVALS, + onSuccess: (dynamic response, int statusCode) { + print(response['HIS_Approval_List'].length); + _insuranceApproval.clear(); + _insuranceApproval.length = 0; + response['HIS_Approval_List'].forEach((item) { + _insuranceApproval.add(InsuranceApprovalModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _insuranceApprovalModel.toJson()); + } + + Future getFamilyFiles() async { + var myFamily = await sharedPref.getObject(FAMILY_FILE); + if (myFamily != null) { + getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse.fromJson(myFamily); + } else { + getSharedRecordByStatus(); + } + } + + Future getSharedRecordByStatus() async { + try { + dynamic localRes; + var request = GetAllSharedRecordsByStatusReq(); + request.status = 0; + await baseAppClient.post(GET_SHARED_RECORD_BY_STATUS, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + throw error; + }, body: request.toJson()); + sharedPref.setObject(FAMILY_FILE, localRes); + getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse.fromJson(localRes); + } catch (error) { + print(error); + throw error; + } + } + Future getInsuranceDetails(data) async{ + dynamic localRes; + await baseAppClient.post(INSURANCE_DETAILS, + onSuccess: (dynamic response, int statusCode) { + localRes = response['List_InsuranceCheckList']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body:{'CompanyID': data.companyID,'SubCategoryID':data.subCategoryID },); + return Future.value(localRes); + } + + Future getPatientInsuranceDetails({String setupID, int projectID, String patientIdentificationID,int patientID}) async{ + error = ""; + hasError = false; + insuranceCardDetails = null; + isHaveInsuranceCard = false; + await baseAppClient.post(GET_PATIENT_INSURANCE_DETAILS, + onSuccess: (dynamic response, int statusCode) { + insuranceCardDetailsList.clear(); + isHaveInsuranceCard = true; + response['List_PatientInsuranceDetails'].forEach((item) { + insuranceCardDetailsList.add(InsuranceCardDetailsModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body:{'SetupID': setupID,'ProjectID':projectID,'PatientIdentificationID':patientIdentificationID ,'isDentalAllowedBackend':false,'PatientID':patientID},); + + } + + Future uploadInsuranceCard({ String patientIdentificationID,int patientID,String image=""}) async{ + error = ""; + Map body = Map(); + body['PatientID']=patientID; + body['PatientType']=user.patientType; + body['MobileNo']=user.mobileNumber; + body['PatientIdentificationID']=patientIdentificationID; + body['InsuranceCardImage']= image; + + await baseAppClient.post(UPLOAD_INSURANCE_CARD, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body:body,); + + } +} diff --git a/lib/core/service/medical/ActiveMedicationsService.dart b/lib/core/service/medical/ActiveMedicationsService.dart new file mode 100644 index 00000000..070b7e5f --- /dev/null +++ b/lib/core/service/medical/ActiveMedicationsService.dart @@ -0,0 +1,27 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/active_medications/ActivePrescriptionReport.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class ActiveMedicationsService extends BaseService{ + + List activePrescriptionReport = List(); + + getActiveMedication() async { + hasError = false; + super.error = ""; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID, + onSuccess: (response, statusCode) async { + activePrescriptionReport.clear(); + response['List_ActiveGetPrescriptionReportByPatientID'].forEach((appoitment) { + activePrescriptionReport + .add(ActivePrescriptionReport.fromJson(appoitment)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + +} \ No newline at end of file diff --git a/lib/core/service/medical/AllergiesService.dart b/lib/core/service/medical/AllergiesService.dart new file mode 100644 index 00000000..d3deae2b --- /dev/null +++ b/lib/core/service/medical/AllergiesService.dart @@ -0,0 +1,25 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/Allergy/Allergy.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class AllergiesService extends BaseService { + List allergies = List(); + + getAllergies() async { + hasError = false; + super.error = ""; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['OutSA'] = 0; + await baseAppClient.post(GET_PATIENT_ALLERGIES, + onSuccess: (response, statusCode) async { + allergies.clear(); + response['Patient_Allergies'].forEach((allergy) { + allergies.add(Allergy.fromJson(allergy)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/medical/BloodPressureService.dart b/lib/core/service/medical/BloodPressureService.dart new file mode 100644 index 00000000..f2681191 --- /dev/null +++ b/lib/core/service/medical/BloodPressureService.dart @@ -0,0 +1,96 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/MonthBloodPressureResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/WeekBloodPressureResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/YearBloodPressureResultAverage.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class BloodPressureService extends BaseService { + List monthDiabtectResultAverageList = List(); + List weekDiabtectResultAverageList = List(); + List yearDiabtecResultAverageList = List(); + + ///Result + List monthDiabtecPatientResult = List(); + List weekDiabtecPatientResult = List(); + List yearDiabtecPatientResult = List(); + + Future getBloodSugar() async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_BLOOD_PRESSURE_RESULT_AVERAGE, + onSuccess: (dynamic response, int statusCode) { + monthDiabtectResultAverageList.clear(); + weekDiabtectResultAverageList.clear(); + yearDiabtecResultAverageList.clear(); + response['List_MonthBloodPressureResultAverage'].forEach((item) { + monthDiabtectResultAverageList + .add(MonthBloodPressureResultAverage.fromJson(item)); + }); + + response['List_WeekBloodPressureResultAverage'].forEach((item) { + weekDiabtectResultAverageList + .add(WeekBloodPressureResultAverage.fromJson(item)); + }); + + response['List_YearBloodPressureResultAverage'].forEach((item) { + yearDiabtecResultAverageList + .add(YearBloodPressureResultAverage.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getDiabtecResults() async { + hasError = false; + await baseAppClient.post(GET_BLOOD_PRESSURE_RESULT, + onSuccess: (dynamic response, int statusCode) { + monthDiabtecPatientResult.clear(); + weekDiabtecPatientResult.clear(); + yearDiabtecPatientResult.clear(); + + response['List_WeekBloodPressureResult'].forEach((item) { + weekDiabtecPatientResult.add(BloodPressureResult.fromJson(item)); + }); + + response['List_MonthBloodPressureResult'].forEach((item) { + monthDiabtecPatientResult.add(BloodPressureResult.fromJson(item)); + }); + + response['List_YearBloodPressureResult'].forEach((item) { + yearDiabtecPatientResult.add(BloodPressureResult.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + addDiabtecResult( + {String bloodPressureDate, + String diastolicPressure, + String systolicePressure, + int measuredArm}) async { + hasError = false; + super.error = ""; + + Map body = Map(); + body['BloodPressureDate'] = bloodPressureDate; + body['DiastolicPressure'] = diastolicPressure; + body['SystolicePressure'] = systolicePressure; + body['MeasuredArm'] = measuredArm; + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(ADD_BLOOD_PRESSURE_RESULT, + onSuccess: (response, statusCode) async { + + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/medical/BloodSugarService.dart b/lib/core/service/medical/BloodSugarService.dart new file mode 100644 index 00000000..09fe9fe9 --- /dev/null +++ b/lib/core/service/medical/BloodSugarService.dart @@ -0,0 +1,96 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/MonthDiabtectResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/YearDiabtecResultAverage.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class BloodSugarService extends BaseService { + List monthDiabtectResultAverageList = List(); + List weekDiabtectResultAverageList = List(); + List yearDiabtecResultAverageList = List(); + + ///Result + List monthDiabtecPatientResult = List(); + List weekDiabtecPatientResult = List(); + List yearDiabtecPatientResult = List(); + + Future getBloodSugar() async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_DIABETIC_RESULT_AVERAGE, + onSuccess: (dynamic response, int statusCode) { + monthDiabtectResultAverageList.clear(); + weekDiabtectResultAverageList.clear(); + yearDiabtecResultAverageList.clear(); + response['List_MonthDiabtectResultAverage'].forEach((item) { + monthDiabtectResultAverageList + .add(MonthDiabtectResultAverage.fromJson(item)); + }); + + response['List_WeekDiabtectResultAverage'].forEach((item) { + weekDiabtectResultAverageList + .add(WeekDiabtectResultAverage.fromJson(item)); + }); + + response['List_YearDiabtecResultAverage'].forEach((item) { + yearDiabtecResultAverageList + .add(YearDiabtecResultAverage.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getDiabtecResults() async { + hasError = false; + await baseAppClient.post(GET_DIABTEC_RESULT, + onSuccess: (dynamic response, int statusCode) { + monthDiabtecPatientResult.clear(); + weekDiabtecPatientResult.clear(); + yearDiabtecPatientResult.clear(); + + response['List_MonthDiabtecPatientResult'].forEach((item) { + monthDiabtecPatientResult.add(DiabtecPatientResult.fromJson(item)); + }); + + response['List_WeekDiabtecPatientResult'].forEach((item) { + weekDiabtecPatientResult.add(DiabtecPatientResult.fromJson(item)); + }); + + response['List_YearDiabtecPatientResult'].forEach((item) { + yearDiabtecPatientResult.add(DiabtecPatientResult.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + addDiabtecResult( + {String bloodSugerDateChart, + String bloodSugerResult, + String diabtecUnit, + int measuredTime}) async { + hasError = false; + super.error = ""; + + Map body = Map(); + body['BloodSugerDateChart'] = bloodSugerDateChart; + body['BloodSugerResult'] = bloodSugerResult; + body['DiabtecUnit'] = diabtecUnit; + body['MeasuredTime'] =2;// measuredTime; + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(ADD_BLOOD_PRESSURE_RESULT, + onSuccess: (response, statusCode) async { + var asd =""; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/medical/EyeService.dart b/lib/core/service/medical/EyeService.dart new file mode 100644 index 00000000..879acbbf --- /dev/null +++ b/lib/core/service/medical/EyeService.dart @@ -0,0 +1,26 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class EyeService extends BaseService { + List appoimentAllHistoryResultList = List(); + + getEyeMeasurement() async { + hasError = false; + super.error = ""; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['IsIrisPrescription'] = true; + await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, + onSuccess: (response, statusCode) async { + appoimentAllHistoryResultList.clear(); + response['AppoimentAllHistoryResultList'].forEach((appoitment) { + appoimentAllHistoryResultList + .add(AppoimentAllHistoryResultList.fromJson(appoitment)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/medical/PatientSickLeaveService.dart b/lib/core/service/medical/PatientSickLeaveService.dart new file mode 100644 index 00000000..bb60ee3b --- /dev/null +++ b/lib/core/service/medical/PatientSickLeaveService.dart @@ -0,0 +1,49 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/sick_leave/sick_leave.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class PatientSickLeaveService extends BaseService { + List sickLeaveList = List(); + + getSickLeave() async { + hasError = false; + super.error = ""; + await baseAppClient.post(GET_PATIENT_SICK_LEAVE, + onSuccess: (response, statusCode) async { + sickLeaveList.clear(); + response['List_SickLeave'].forEach((sickLeave) { + sickLeaveList.add(SickLeave.fromJson(sickLeave)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + sendSickLeaveEmail( + {int requestNo, + String projectName, + String doctorName, + int projectID, + String setupID}) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['RequestNo'] = requestNo; + body['To'] = user.emailAddress; + body['DateofBirth'] = user.dateofBirth; + body['PatientIditificationNum'] = user.patientIdentificationNo; + body['PatientMobileNumber'] = user.mobileNumber; + body['PatientName'] = user.firstName + " " + user.firstName; + body['ProjectName'] = projectName; + body['DoctorName'] = doctorName; + body['ProjectID'] = projectID; + body['SetupID'] = setupID; + await baseAppClient + .post(SendSickLeaveEmail, onSuccess: (response, statusCode) async {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/medical/WeightPressureService.dart b/lib/core/service/medical/WeightPressureService.dart new file mode 100644 index 00000000..27048dc8 --- /dev/null +++ b/lib/core/service/medical/WeightPressureService.dart @@ -0,0 +1,96 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/MonthWeightMeasurementResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeekWeightMeasurementResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/YearWeightMeasurementResultAverage.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class WeightService extends BaseService { + + ///Average + List monthWeightMeasurementResultAverage = List(); + List weekWeightMeasurementResultAverage = List(); + List yearWeightMeasurementResultAverage = List(); + + ///Result + List monthWeightMeasurementResult = List(); + List weekWeightMeasurementResult = List(); + List yearWeightMeasurementResult = List(); + + Future getWeightAverage() async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT_AVERAGE, + onSuccess: (dynamic response, int statusCode) { + monthWeightMeasurementResultAverage.clear(); + weekWeightMeasurementResultAverage.clear(); + yearWeightMeasurementResultAverage.clear(); + response['List_MonthWeightMeasurementResultAverage'].forEach((item) { + monthWeightMeasurementResultAverage + .add(MonthWeightMeasurementResultAverage.fromJson(item)); + }); + + response['List_WeekWeightMeasurementResultAverage'].forEach((item) { + weekWeightMeasurementResultAverage + .add(WeekWeightMeasurementResultAverage.fromJson(item)); + }); + + response['List_YearWeightMeasurementResultAverage'].forEach((item) { + yearWeightMeasurementResultAverage + .add(YearWeightMeasurementResultAverage.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getWeightMeasurementResult() async { + hasError = false; + await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT, + onSuccess: (dynamic response, int statusCode) { + monthWeightMeasurementResult.clear(); + weekWeightMeasurementResult.clear(); + yearWeightMeasurementResult.clear(); + + response['List_WeekWeightMeasurementResult'].forEach((item) { + weekWeightMeasurementResult.add(WeightMeasurementResult.fromJson(item)); + }); + + response['List_MonthWeightMeasurementResult'].forEach((item) { + monthWeightMeasurementResult.add(WeightMeasurementResult.fromJson(item)); + }); + + response['List_YearWeightMeasurementResult'].forEach((item) { + yearWeightMeasurementResult.add(WeightMeasurementResult.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + addWeightResult( + {String weightDate, + String weightMeasured, + int weightUnit}) async { + hasError = false; + super.error = ""; + + Map body = Map(); + body['WeightDate'] = weightDate; + body['WeightMeasured'] = weightMeasured; + body['weightUnit'] = weightUnit; + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(ADD_WEIGHT_PRESSURE_RESULT, + onSuccess: (response, statusCode) async { + + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/medical/ask_doctor_services.dart b/lib/core/service/medical/ask_doctor_services.dart new file mode 100644 index 00000000..9a819a6e --- /dev/null +++ b/lib/core/service/medical/ask_doctor_services.dart @@ -0,0 +1,106 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/ask_doctor/AskDoctorReqTypes.dart'; +import 'package:diplomaticquarterapp/core/model/ask_doctor/DoctorResponse.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class AskDoctorService extends BaseService { + List askDoctorReqTypes = List(); + List doctorResponseList = List(); + + Future getCallInfoHoursResult({int projectId, int doctorId}) async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['DoctorID'] = doctorId; + body['ProjectID'] = projectId; + + await baseAppClient.post(GET_CALL_INFO_HOURS_RESULT, + onSuccess: (dynamic response, int statusCode) { + ///OKAY + var asd=""; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getCallRequestTypeLOV() async { + hasError =false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_CALL_REQUEST_TYPE_LOV, + onSuccess: (dynamic response, int statusCode) { + askDoctorReqTypes.clear(); + response['ListReqTypes'].forEach((reqType) { + askDoctorReqTypes.add(AskDoctorReqTypes.fromJson(reqType)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getDoctorResponse() async { + hasError =false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['from'] = + "${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} 00:00:00"; + body['from'] = + "${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} ${DateTime.now().hour}:${DateTime.now().minute}:00"; + await baseAppClient.post(GET_DOCTOR_RESPONSE, + onSuccess: (dynamic response, int statusCode) { + doctorResponseList.clear(); + response['List_DoctorResponse'].forEach((reqType) { + doctorResponseList.add(DoctorResponse.fromJson(reqType)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future updateReadStatus({int transactionNo}) async { + hasError =false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['TransactionNo'] = transactionNo; + await baseAppClient.post(UPDATE_READ_STATUS, + onSuccess: (dynamic response, int statusCode) { + //TODO fix it + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + + Future sendRequestLOV({DoctorList doctorList,String requestType,String remark}) async { + hasError =false; + Map body = Map(); + body['ProjectID'] = doctorList.projectID; + body['SetupID'] = doctorList.setupID; + body['DoctorID'] = doctorList.doctorID; + body['PatientMobileNumber'] = user.mobileNumber; + body['IsMessageSent'] = false; + body['RequestDate'] = DateUtil.yearMonthDay(DateTime.now()); + body['RequestTime'] = DateUtil.time(DateTime.now()); + body['Remarks'] = remark; + body['Status'] = 2;// 4 for testing only.."cancelled status insert" else should be changed to 1 in live version + body['CreatedBy'] = 102; + body['CreatedOn'] = DateUtil.yearMonthDay(DateTime.now()); + body['EditedBy'] = 102; + body['EditedOn'] = DateUtil.yearMonthDay(DateTime.now()); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(INSERT_CALL_INFO, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + +} diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart new file mode 100644 index 00000000..11592956 --- /dev/null +++ b/lib/core/service/medical/labs_service.dart @@ -0,0 +1,131 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart'; +import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; +import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; +import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; +import 'package:diplomaticquarterapp/core/model/labs/request_patient_lab_orders.dart'; +import 'package:diplomaticquarterapp/core/model/labs/request_patient_lab_special_result.dart'; +import 'package:diplomaticquarterapp/core/model/labs/request_send_lab_report_email.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +class LabsService extends BaseService { + List patientLabOrdersList = List(); + + Future getPatientLabOrdersList() async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_Patient_LAB_ORDERS, + onSuccess: (dynamic response, int statusCode) { + patientLabOrdersList.clear(); + response['ListPLO'].forEach((hospital) { + patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + RequestPatientLabSpecialResult _requestPatientLabSpecialResult = + RequestPatientLabSpecialResult(); + + List patientLabSpecialResult = List(); + List labResultList = List(); + List labOrdersResultsList = List(); + + Future getLaboratoryResult( + {String projectID, + int clinicID, + String invoiceNo, + String orderNo}) async { + hasError = false; + _requestPatientLabSpecialResult.projectID = projectID; + _requestPatientLabSpecialResult.clinicID = clinicID; + _requestPatientLabSpecialResult.invoiceNo = invoiceNo; + _requestPatientLabSpecialResult.orderNo = orderNo; + + await baseAppClient.post(GET_Patient_LAB_SPECIAL_RESULT, + onSuccess: (dynamic response, int statusCode) { + patientLabSpecialResult.clear(); + response['ListPLSR'].forEach((hospital) { + patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestPatientLabSpecialResult.toJson()); + } + + Future getPatientLabResult({PatientLabOrders patientLabOrder}) async { + hasError = false; + Map body = Map(); + body['InvoiceNo'] = patientLabOrder.invoiceNo; + body['OrderNo'] = patientLabOrder.orderNo; + body['isDentalAllowedBackend'] = false; + body['SetupID'] = patientLabOrder.setupID; + body['ProjectID'] = patientLabOrder.projectID; + body['ClinicID'] = patientLabOrder.clinicID; + await baseAppClient.post(GET_Patient_LAB_RESULT, + onSuccess: (dynamic response, int statusCode) { + patientLabSpecialResult.clear(); + labResultList.clear(); + response['ListPLR'].forEach((lab) { + labResultList.add(LabResult.fromJson(lab)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder,String procedure}) async { + hasError = false; + Map body = Map(); + body['InvoiceNo'] = patientLabOrder.invoiceNo; + body['OrderNo'] = patientLabOrder.orderNo; + body['isDentalAllowedBackend'] = false; + body['SetupID'] = patientLabOrder.setupID; + body['ProjectID'] = patientLabOrder.projectID; + body['ClinicID'] = patientLabOrder.clinicID; + body['Procedure'] = procedure; + await baseAppClient.post(GET_Patient_LAB_ORDERS_RESULT, + onSuccess: (dynamic response, int statusCode) { + labOrdersResultsList.clear(); + response['ListPLR'].forEach((lab) { + labOrdersResultsList.add(LabOrderResult.fromJson(lab)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + RequestSendLabReportEmail _requestSendLabReportEmail = + RequestSendLabReportEmail(); + + Future sendLabReportEmail({PatientLabOrders patientLabOrder}) async { + _requestSendLabReportEmail.projectID = patientLabOrder.projectID; + _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; + _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; + _requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription; + _requestSendLabReportEmail.patientName = user.firstName +" "+ user.lastName; + _requestSendLabReportEmail.patientIditificationNum = + user.patientIdentificationNo; + _requestSendLabReportEmail.dateofBirth = user.dateofBirth; + _requestSendLabReportEmail.to = user.emailAddress; + _requestSendLabReportEmail.orderDate = '${patientLabOrder.orderDate.year}-${patientLabOrder.orderDate.month}-${patientLabOrder.orderDate.day}'; + _requestSendLabReportEmail.patientMobileNumber = user.mobileNumber; + _requestSendLabReportEmail.projectName = patientLabOrder.projectName; + _requestSendLabReportEmail.setupID = user.setupID; + + await baseAppClient.post(SEND_LAB_RESULT_EMAIL, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestSendLabReportEmail.toJson()); + } +} diff --git a/lib/core/service/medical/medical_service.dart b/lib/core/service/medical/medical_service.dart new file mode 100644 index 00000000..f90280cf --- /dev/null +++ b/lib/core/service/medical/medical_service.dart @@ -0,0 +1,48 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:flutter/cupertino.dart'; + +class MedicalService extends BaseService { + List appoitmentAllHistoryResultList = List(); + + getAppointmentHistory({bool isActiveAppointment = false}) async { + hasError = false; + super.error = ""; + Map body = Map(); + if(isActiveAppointment) { + body['IsActiveAppointment'] = true; + body['isDentalAllowedBackend'] = false; + } + + await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, + onSuccess: (response, statusCode) async { + appoitmentAllHistoryResultList.clear(); + response['AppoimentAllHistoryResultList'].forEach((appoitment) { + appoitmentAllHistoryResultList + .add(AppoitmentAllHistoryResultList.fromJson(appoitment)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + addAmbulanceRequest({@required PatientER patientER}) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['RequesterFileNo'] = user.patientID; + body['RequesterMobileNo'] = user.mobileNumber; + body['RequesterIsOutSA'] = user.outSA; + await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, + onSuccess: (response, statusCode) async { + + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/medical/my_balance_service.dart b/lib/core/service/medical/my_balance_service.dart new file mode 100644 index 00000000..86e925b8 --- /dev/null +++ b/lib/core/service/medical/my_balance_service.dart @@ -0,0 +1,159 @@ +import 'dart:convert'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_advance_balance_amount.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart'; +import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +class MyBalanceService extends BaseService { + List patientAdvanceBalanceAmountList = List(); + double totalAdvanceBalanceAmount; + List patientInfoList = List(); + GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse(); + PatientInfoAndMobileNumber patientInfoAndMobileNumber; + String logInTokenID; + String verificationCode; + + AuthenticatedUserObject authenticatedUserObject = + locator(); + + MyBalanceService(){ + getFamilyFiles(); + } + + getPatientAdvanceBalanceAmount() async { + hasError = false; + super.error = ""; + await baseAppClient.post(GET_PATIENT_AdVANCE_BALANCE_AMOUNT, + onSuccess: (response, statusCode) async { + patientAdvanceBalanceAmountList.clear(); + response['List_PatientAdvanceBalanceAmount'].forEach((item) { + patientAdvanceBalanceAmountList + .add(PatientAdvanceBalanceAmount.fromJson(item)); + }); + totalAdvanceBalanceAmount = response['TotalAdvanceBalanceAmount']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + getPatientInfoByPatientID({String id}) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['SearchPatientID'] = int.parse(id); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_PATIENT_INFO_BY_ID, + onSuccess: (response, statusCode) async { + patientInfoList.clear(); + response['GetPatientInfoByPatientIDList'].forEach((item) { + patientInfoList.add(PatientInfo.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + getPatientInfoByPatientIDAndMobileNumber(AdvanceModel advanceModel) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['MobileNo'] = advanceModel.mobileNumber; + body['ProjectID'] = advanceModel.hospitalsModel.iD; + body['PatientID'] = advanceModel.fileNumber; + + await baseAppClient.post(GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER, + onSuccess: (response, statusCode) async { + response['List_PatientInfo'].forEach((item) { + patientInfoAndMobileNumber = PatientInfoAndMobileNumber.fromJson(item); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + super.error = error; + }, body: body); + } + + sendActivationCodeForAdvancePayment({int patientID, int projectID}) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['PatientID'] = patientID; + body['ProjectID'] = projectID; + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT, + onSuccess: (response, statusCode) async { + logInTokenID = response['LogInTokenID']; + verificationCode = response['VerificationCode']; + print(verificationCode); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + super.error = error; + }, body: body); + } + + checkActivationCodeForAdvancePayment({String activationCode}) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['activationCode'] = activationCode; + body['PatientMobileNumber'] = 'XXXXXXXXXX'; + body['isDentalAllowedBackend'] = false; + body['LogInTokenID'] = logInTokenID; + + await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT, + onSuccess: (response, statusCode) async {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + super.error = error; + }, body: body); + } + + getSharedRecordByStatus() async { + try { + var request = GetAllSharedRecordsByStatusReq(); + request.status = 0; + await baseAppClient.post(GET_SHARED_RECORD_BY_STATUS, + onSuccess: (dynamic response, int statusCode) { + sharedPref.setObject(FAMILY_FILE, response); + getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse.fromJson(response); + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + hasError = true; + super.error = error; + }, body: request.toJson()); + } catch (error) { + print(error); + hasError = true; + super.error = error; + } + } + + getFamilyFiles() async { + if (await sharedPref.getObject(FAMILY_FILE) != null) { + getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse.fromJson( + await sharedPref.getObject(FAMILY_FILE)); + return getAllSharedRecordsByStatusResponse; + } else { + return await getSharedRecordByStatus(); + } + } +} diff --git a/lib/core/service/medical/my_doctor_service.dart b/lib/core/service/medical/my_doctor_service.dart new file mode 100644 index 00000000..3d9e14b7 --- /dev/null +++ b/lib/core/service/medical/my_doctor_service.dart @@ -0,0 +1,81 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/doctor/doctor_profile.dart'; +import 'package:diplomaticquarterapp/core/model/doctor/doctor_rating.dart'; +import 'package:diplomaticquarterapp/core/model/doctor/reques_patient_doctor_appointmentt.dart'; +import 'package:diplomaticquarterapp/core/model/doctor/request_doctor_profile.dart'; +import 'package:diplomaticquarterapp/core/model/doctor/request_doctor_rating.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; + +class MyDoctorService extends BaseService { + List patientDoctorAppointmentList = List(); + DoctorProfile doctorProfile; + DoctorList doctorList; + DoctorRating doctorRating = DoctorRating(); + + RequestPatientDoctorAppointment patientDoctorAppointmentRequest = + RequestPatientDoctorAppointment( + isDentalAllowedBackend: false, + ); + + RequestDoctorRating _requestDoctorRating = RequestDoctorRating( + channel: 3, + deviceTypeID: 2, + doctorID: 2477, + isDentalAllowedBackend: false); + + Future getPatientDoctorAppointmentList({int top = 0, int beforeDays = 0,int exludType=4}) async { + hasError = false; + patientDoctorAppointmentRequest.top = top; + patientDoctorAppointmentRequest.beforeDays = beforeDays; + patientDoctorAppointmentRequest.exludType = exludType; + + await baseAppClient.post(GET_MY_DOCTOR, + onSuccess: (dynamic response, int statusCode) { + patientDoctorAppointmentList.clear(); + response['PatientDoctorAppointmentResultList'].forEach((hospital) { + patientDoctorAppointmentList + .add(DoctorList.fromJson(hospital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: patientDoctorAppointmentRequest.toJson()); + } + + RequestDoctorProfile _requestDoctorProfile = RequestDoctorProfile( + license: true, + isRegistered: true, + ); + + Future getDoctorProfileAndRating( + {int doctorId, int clinicID, int projectID}) async { + ///GET DOCTOR PROFILE + _requestDoctorProfile.doctorID = doctorId; + _requestDoctorProfile.clinicID = clinicID; + _requestDoctorProfile.projectID = projectID; + hasError = false; + await baseAppClient.post(GET_DOCTOR_PROFILE, + onSuccess: (dynamic response, int statusCode) { + doctorProfile = DoctorProfile.fromJson(response['DoctorProfileList'][0]); + doctorList = DoctorList.fromJson(response['DoctorProfileList'][0]); + doctorList.clinicName = doctorProfile.clinicDescription; + doctorList.doctorTitle = doctorProfile.doctorTitleForProfile; + doctorList.name = doctorProfile.doctorName; + doctorList.projectName = doctorProfile.projectName; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestDoctorProfile.toJson()); + + ///GET DOCTOR RATING + _requestDoctorRating.doctorID = doctorId; + await baseAppClient.post(GET_DOCTOR_RATING, + onSuccess: (dynamic response, int statusCode) { + doctorRating = DoctorRating.fromJson(response['AvgDoctorRatingList'][0]); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestDoctorRating.toJson()); + } +} diff --git a/lib/core/service/medical/prescriptions_service.dart b/lib/core/service/medical/prescriptions_service.dart new file mode 100644 index 00000000..e9741a7f --- /dev/null +++ b/lib/core/service/medical/prescriptions_service.dart @@ -0,0 +1,222 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart'; +import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart'; +import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; +import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; +import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; +import 'package:diplomaticquarterapp/core/model/prescriptions/request_get_list_pharmacy_for_prescriptions.dart'; +import 'package:diplomaticquarterapp/core/model/prescriptions/request_prescription_report.dart'; +import 'package:diplomaticquarterapp/core/model/prescriptions/request_prescription_report_enh.dart'; +import 'package:diplomaticquarterapp/core/model/prescriptions/request_prescriptions.dart'; +import 'package:diplomaticquarterapp/core/model/prescriptions/request_prescriptions_orders.dart'; +import 'package:diplomaticquarterapp/core/model/prescriptions/request_send_prescription_email.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:flutter/cupertino.dart'; + +class PrescriptionsService extends BaseService { + List prescriptionsList = List(); + + List prescriptionsOrderList = List(); + + Future getPrescriptions() async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(PRESCRIPTIONS, + onSuccess: (dynamic response, int statusCode) { + prescriptionsList.clear(); + response['PatientPrescriptionList'].forEach((prescriptions) { + prescriptionsList.add(Prescriptions.fromJson(prescriptions)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getPrescriptionsOrders() async { + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, + onSuccess: (dynamic response, int statusCode) { + prescriptionsOrderList.clear(); + response['PatientER_GetPatientAllPresOrdersList'] + .forEach((prescriptionsOrder) { + prescriptionsOrderList + .add(PrescriptionsOrder.fromJson(prescriptionsOrder)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + RequestPrescriptionReport _requestPrescriptionReport = + RequestPrescriptionReport( + appointmentNo: 0, isDentalAllowedBackend: false); + List prescriptionReportList = List(); + + Future getPrescriptionReport( + {Prescriptions prescriptions}) async { + hasError = false; + _requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo; + _requestPrescriptionReport.projectID = prescriptions.projectID; + _requestPrescriptionReport.clinicID = prescriptions.clinicID; + _requestPrescriptionReport.setupID = prescriptions.setupID; + _requestPrescriptionReport.episodeID = prescriptions.episodeID; + _requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo; + + await baseAppClient.post(prescriptions.isInOutPatient? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT, + onSuccess: (dynamic response, int statusCode) { + prescriptionReportList.clear(); + prescriptionReportEnhList.clear(); + if(prescriptions.isInOutPatient){ + response['ListPRM'].forEach((prescriptions) { + prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions)); + prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions)); + }); + }else{ + response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { + prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions)); + }); + } + + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestPrescriptionReport.toJson()); + } + + RequestSendPrescriptionEmail _requestSendPrescriptionEmail = + RequestSendPrescriptionEmail( + isDentalAllowedBackend: false,); + + Future sendPrescriptionEmail(String appointmentDate, int patientID, + String clinicName, String doctorName, int projectID) async { + _requestSendPrescriptionEmail.listPrescriptions = prescriptionReportList; + _requestSendPrescriptionEmail.appointmentDate = appointmentDate; + _requestSendPrescriptionEmail.patientID = patientID; + _requestSendPrescriptionEmail.clinicName = clinicName; + _requestSendPrescriptionEmail.doctorName = doctorName; + _requestSendPrescriptionEmail.projectID = projectID; + _requestSendPrescriptionEmail.to = user.emailAddress; + _requestSendPrescriptionEmail.dateofBirth = user.dateofBirth; + _requestSendPrescriptionEmail.patientIditificationNum = user.patientIdentificationNo; + _requestSendPrescriptionEmail.patientMobileNumber = user.mobileNumber; + _requestSendPrescriptionEmail.patientName = user.firstName +" "+ user.lastName; + _requestSendPrescriptionEmail.setupID = user.setupID; + hasError = false; + await baseAppClient.post(SEND_PRESCRIPTION_EMAIL, onSuccess: (response, statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestSendPrescriptionEmail.toJson()); + } + + RequestGetListPharmacyForPrescriptions requestGetListPharmacyForPrescriptions = RequestGetListPharmacyForPrescriptions( + latitude: 0, + longitude: 0, + isDentalAllowedBackend: false, + + ); + List pharmacyPrescriptionsList = List(); + + Future getListPharmacyForPrescriptions({int itemId}) async { + hasError = false; + requestGetListPharmacyForPrescriptions.itemID = itemId; + await baseAppClient.post(GET_PHARMACY_LIST, + onSuccess: (dynamic response, int statusCode) { + pharmacyPrescriptionsList.clear(); + response['PharmList'].forEach((prescriptions) { + pharmacyPrescriptionsList + .add(PharmacyPrescriptions.fromJson(prescriptions)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: requestGetListPharmacyForPrescriptions.toJson()); + } + + RequestPrescriptionReportEnh _requestPrescriptionReportEnh = + RequestPrescriptionReportEnh(isDentalAllowedBackend: false,); + + List prescriptionReportEnhList = List(); + + Future getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async { + + ///This logic copy from the old app from class [order-history.component.ts] in line 45 + bool isInPatient = false; + prescriptionsList.forEach((element) { + if (prescriptionsOrder.appointmentNo == "0") { + if (element.dischargeNo == int.parse(prescriptionsOrder.dischargeID)) { + + _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; + _requestPrescriptionReportEnh.clinicID = element.clinicID; + _requestPrescriptionReportEnh.projectID = element.projectID; + _requestPrescriptionReportEnh.episodeID = element.episodeID; + _requestPrescriptionReportEnh.setupID = element.setupID; + _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; + isInPatient = element.isInOutPatient; + } + } else { + if (int.parse(prescriptionsOrder.appointmentNo) == element.appointmentNo) { + _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; + _requestPrescriptionReportEnh.clinicID = element.clinicID; + _requestPrescriptionReportEnh.projectID = element.projectID; + _requestPrescriptionReportEnh.episodeID = element.episodeID; + _requestPrescriptionReportEnh.setupID = element.setupID; + _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; + isInPatient = element.isInOutPatient;///call inpGetPrescriptionReport + } + } + }); + + hasError = false; + + await baseAppClient.post(isInPatient? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT, + onSuccess: (dynamic response, int statusCode) { + prescriptionReportEnhList.clear(); + + if(isInPatient){ + response['ListPRM'].forEach((prescriptions) { + prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions)); + }); + }else{ + response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { + + PrescriptionReportEnh reportEnh = PrescriptionReportEnh.fromJson(prescriptions); + reportEnh.itemDescription = prescriptions['ItemDescriptionN']; + prescriptionReportEnhList.add(reportEnh); + + }); + + } + + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestPrescriptionReportEnh.toJson()); + + + } + + Future updatePressOrder({@required int presOrderID}) async { + hasError = false; + Map body = Map(); + body['PresOrderID'] = presOrderID; + body['EditedBy'] = user.patientID; + body['RejectionReason'] = ''; + body['PresOrderStatus'] = 4; + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(UPDATE_PRESS_ORDER, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + +} diff --git a/lib/core/service/medical/radiology_service.dart b/lib/core/service/medical/radiology_service.dart new file mode 100644 index 00000000..965fa752 --- /dev/null +++ b/lib/core/service/medical/radiology_service.dart @@ -0,0 +1,82 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; +import 'package:diplomaticquarterapp/core/model/radiology/request_send_rad_report_email.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class RadiologyService extends BaseService { + List finalRadiologyList = List(); + String url = ''; + + Future getRadImageURL({int invoiceNo, int lineItem, int projectId}) async { + hasError = false; + final Map body = new Map(); + body['InvoiceNo'] = invoiceNo; + body['LineItemNo'] = lineItem; + body['ProjectID'] = projectId; + + await baseAppClient.post(GET_RAD_IMAGE_URL, + isAllowAny: true, + onSuccess: (dynamic response, int statusCode) { + url = response['Data']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getPatientRadOrders() async { + hasError = false; + await baseAppClient.post(GET_PATIENT_ORDERS, + onSuccess: (dynamic response, int statusCode) { + finalRadiologyList.clear(); + response['FinalRadiologyList'].forEach((radiology) { + finalRadiologyList.add(FinalRadiology.fromJson(radiology)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + Future getPatientRadOrdersDetails() async { + hasError = false; + await baseAppClient.post(GET_PATIENT_ORDERS, + onSuccess: (dynamic response, int statusCode) { + finalRadiologyList.clear(); + response['FinalRadiologyList'].forEach((radiology) { + finalRadiologyList.add(FinalRadiology.fromJson(radiology)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + RequestSendRadReportEmail _requestSendRadReportEmail = + RequestSendRadReportEmail(); + + Future sendRadReportEmail({FinalRadiology finalRadiology}) async { + _requestSendRadReportEmail.projectID = finalRadiology.projectID; + _requestSendRadReportEmail.clinicName = finalRadiology.clinicDescription; + _requestSendRadReportEmail.invoiceNo = finalRadiology.invoiceNo; + _requestSendRadReportEmail.setupID = finalRadiology.setupID; + _requestSendRadReportEmail.doctorName = finalRadiology.doctorName; + _requestSendRadReportEmail.orderDate = '${finalRadiology.orderDate.year}-${finalRadiology.orderDate.month}-${finalRadiology.orderDate.day}'; + _requestSendRadReportEmail.patientIditificationNum = user.patientIdentificationNo; + _requestSendRadReportEmail.patientMobileNumber = user.mobileNumber; + _requestSendRadReportEmail.patientName = user.firstName + " " + user.lastName; + _requestSendRadReportEmail.patientIditificationNum = user.patientIdentificationNo; + _requestSendRadReportEmail.projectName = finalRadiology.projectName; + _requestSendRadReportEmail.radResult = finalRadiology.reportData; + _requestSendRadReportEmail.to = user.emailAddress; + _requestSendRadReportEmail.dateofBirth = user.dateofBirth; + + hasError = false; + await baseAppClient.post(SEND_RAD_REPORT_EMAIL, + isAllowAny: true, onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestSendRadReportEmail.toJson()); + } +} diff --git a/lib/core/service/medical/reports_monthly_service.dart b/lib/core/service/medical/reports_monthly_service.dart new file mode 100644 index 00000000..479360ac --- /dev/null +++ b/lib/core/service/medical/reports_monthly_service.dart @@ -0,0 +1,72 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/reports/Reports.dart'; +import 'package:diplomaticquarterapp/core/model/reports/request_reports.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; + +class ReportsMonthlyService extends BaseService { + List reportsList = List(); + List appointHistoryList = List(); + + RequestReports _requestReports = RequestReports( + isReport: true, + encounterType: 1, + requestType: 1, + isDentalAllowedBackend: false, + ); + + Future getReports() async { + hasError = false; + await baseAppClient.post(REPORTS, + onSuccess: (dynamic response, int statusCode) { + reportsList.clear(); + response['GetPatientMedicalStatus'].forEach((reports) { + reportsList.add(Reports.fromJson(reports)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestReports.toJson()); + } + + Future getPatentAppointmentHistory() async { + hasError = false; + Map body = new Map(); + body['IsForMedicalReport'] = true; + await baseAppClient.post(GET_PATIENT_AppointmentHistory, + onSuccess: (dynamic response, int statusCode) { + appointHistoryList = []; + response['AppoimentAllHistoryResultList'].forEach((appoint) { + appointHistoryList.add(AppointmentHistory.fromJson(appoint)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future insertRequestForMedicalReport( + AppointmentHistory appointmentHistory) async { + Map body = new Map(); + body['ClinicID'] = appointmentHistory.clinicID; + body['DoctorID'] = appointmentHistory.doctorID; + body['SetupID'] = appointmentHistory.setupID; + body['EncounterNo'] = appointmentHistory.appointmentNo; + body['EncounterType'] = 1;// appointmentHistory.appointmentType; + body['IsActive'] = appointmentHistory.isActiveDoctor; + body['ProjectID'] = appointmentHistory.projectID; + body['Remarks'] = ""; + body['ProcedureId'] = ""; + body['RequestType'] = 1; + body['Source'] = 2; + body['Status'] = 1; + body['CreatedBy'] = 102; + hasError = false; + await baseAppClient.post(INSERT_REQUEST_FOR_MEDICAL_REPORT, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/medical/reports_service.dart b/lib/core/service/medical/reports_service.dart new file mode 100644 index 00000000..b2f90e61 --- /dev/null +++ b/lib/core/service/medical/reports_service.dart @@ -0,0 +1,135 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/reports/Reports.dart'; +import 'package:diplomaticquarterapp/core/model/reports/request_reports.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; + +class ReportsService extends BaseService { + List reportsList = List(); + List appointHistoryList = List(); + String userAgreementContent = ""; + RequestReports _requestReports = RequestReports( + isReport: true, + encounterType: 1, + requestType: 1, + patientOutSA: 0, + ); + + Future getReports() async { + hasError = false; + await baseAppClient.post(REPORTS, + onSuccess: (dynamic response, int statusCode) { + reportsList.clear(); + response['GetPatientMedicalStatus'].forEach((reports) { + reportsList.add(Reports.fromJson(reports)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestReports.toJson()); + } + + Future getPatentAppointmentHistory() async { + hasError = false; + Map body = new Map(); + body['IsForMedicalReport'] = true; + await baseAppClient.post(GET_PATIENT_AppointmentHistory, + onSuccess: (dynamic response, int statusCode) { + appointHistoryList = []; + response['AppoimentAllHistoryResultList'].forEach((appoint) { + appointHistoryList.add(AppointmentHistory.fromJson(appoint)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getUserTermsAndConditions() async { + hasError = false; + await baseAppClient.post(GET_USER_TERMS, + onSuccess: (dynamic response, int statusCode) { + userAgreementContent = response['UserAgreementContent']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + Future updatePatientHealthSummaryReport({bool isSummary}) async { + Map body = Map(); + body['RSummaryReport'] = isSummary; + hasError = false; + await baseAppClient.post(UPDATE_HEALTH_TERMS, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future insertRequestForMedicalReport( + AppointmentHistory appointmentHistory) async { + Map body = new Map(); + body['ClinicID'] = appointmentHistory.clinicID; + body['DoctorID'] = appointmentHistory.doctorID; + body['SetupID'] = appointmentHistory.setupID; + body['EncounterNo'] = appointmentHistory.appointmentNo; + body['EncounterType'] = 1; // appointmentHistory.appointmentType; + body['IsActive'] = appointmentHistory.isActiveDoctor; + body['ProjectID'] = appointmentHistory.projectID; + body['Remarks'] = ""; + body['ProcedureId'] = ""; + body['RequestType'] = 1; + body['Source'] = 2; + body['Status'] = 1; + body['CreatedBy'] = 102; + hasError = false; + await baseAppClient.post(INSERT_REQUEST_FOR_MEDICAL_REPORT, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future sendEmailForMedicalReport( + String projectName, + String clinicName, + String doctorName, + String requestDate, + String invoiceNo, + int projectID, + String stamp, + String setupID) async { + Map body = new Map(); + body['SetupID'] = setupID; + body['PrintDate'] = requestDate; + body['ProcedureID'] = "05005009"; + body['Reporttype'] = "MEDICAL REPORT"; + body['stamp'] = stamp; + body['To'] = user.emailAddress; + body['DateofBirth'] = user.dateofBirth; + body['PatientIditificationNum'] = user.patientIdentificationNo; + body['PatientMobileNumber'] = user.mobileNumber; + body['PatientName'] = user.firstName + " " + user.lastName; + body['ProjectName'] = projectName; + body['ClinicName'] = clinicName; + body['ProjectID'] = projectID; + body['InvoiceNo'] = invoiceNo; + body['PrintedByName'] = user.firstName + " " + user.lastName; + + dynamic response; + + hasError = false; + await baseAppClient.post(SEND_MEDICAL_REPORT_EMAIL, + onSuccess: (dynamic res, int statusCode) { + response = res; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + return response; + } +} diff --git a/lib/core/service/medical/vital_sign_service.dart b/lib/core/service/medical/vital_sign_service.dart new file mode 100644 index 00000000..d1fbbf1c --- /dev/null +++ b/lib/core/service/medical/vital_sign_service.dart @@ -0,0 +1,44 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; + +import '../base_service.dart'; + +class VitalSignService extends BaseService { + List vitalSignResModelList = List(); + + String weightKg = ""; + String heightCm = ""; + String bloadType = ""; + + Future getPatientRadOrders({int appointmentNo, int projectID}) async { + hasError = false; + Map body = Map(); + if (appointmentNo != null && projectID != null) { + body['TransNo'] = appointmentNo; + body['ProjectID'] = projectID; + } + + await baseAppClient.post(GET_PATIENT_VITAL_SIGN, + onSuccess: (dynamic response, int statusCode) { + vitalSignResModelList.clear(); + response['List_DoctorPatientVitalSign'].forEach((vital) { + vitalSignResModelList.add(VitalSignResModel.fromJson(vital)); + }); + bool isHaveWeight = false; + bool isHaveHeight = false; + vitalSignResModelList.forEach((element) { + if (element.weightKg != 0 && !isHaveWeight) { + weightKg = '${element.weightKg}'; + isHaveWeight = true; + } + if (element.heightCm != 0 && !isHaveHeight) { + heightCm = '${element.heightCm}'; + isHaveHeight = true; + } + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/notifications_service.dart b/lib/core/service/notifications_service.dart new file mode 100644 index 00000000..f2cac55e --- /dev/null +++ b/lib/core/service/notifications_service.dart @@ -0,0 +1,40 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/notifications/mark_message_as_read_request_model.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class NotificationService extends BaseService { + List notificationsList = List(); + + Future getAllNotifications(GetNotificationsRequestModel getNotificationsRequestModel ) async { + hasError = false; + await baseAppClient.post(PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS, + onSuccess: (dynamic response, int statusCode) { + if(getNotificationsRequestModel.currentPage ==0) + notificationsList.clear(); + response['List_GetAllNotificationsFromPool'].forEach((appoint) { + notificationsList.add(GetNotificationsResponseModel.fromJson(appoint)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getNotificationsRequestModel.toJson()); + } + Future markAsRead(MarkMessageAsReadRequestModel markMessageAsReadRequestModel ) async { + hasError = false; + await baseAppClient.post(PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ, + onSuccess: (dynamic response, int statusCode) { + updateNotification(markMessageAsReadRequestModel.notificationPoolID); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: markMessageAsReadRequestModel.toJson()); + } + + updateNotification(id) { + int index = notificationsList.indexWhere((element) => element.id == id); + notificationsList[index].isRead = true; + + } +} diff --git a/lib/core/service/packages_offers/PackagesOffersServices.dart b/lib/core/service/packages_offers/PackagesOffersServices.dart new file mode 100644 index 00000000..e58c3fa3 --- /dev/null +++ b/lib/core/service/packages_offers/PackagesOffersServices.dart @@ -0,0 +1,51 @@ +import 'dart:convert'; +import 'dart:developer'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/packages_offers/requests/OffersCategoriesRequestModel.dart'; +import 'package:diplomaticquarterapp/core/model/packages_offers/requests/OffersProductsRequestModel.dart'; +import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart'; +import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferProductsResponseModel.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; + +import '../../../locator.dart'; + +class OffersAndPackagesServices extends BaseService { + List categoryList = List(); + + Future> getAllCategories(OffersCategoriesRequestModel request) async { + hasError = false; + var url = EXA_CART_API_BASE_URL + PACKAGES_CATEGORIES; + await baseAppClient.simpleGet(url, onSuccess: (dynamic stringResponse, int statusCode) { + if (statusCode == 200) { + var jsonResponse = json.decode(stringResponse); + jsonResponse['categories'].forEach((json) { + categoryList.add(OfferCategoriesResponseModel().fromJson(json)); + }); + } + }, onFailure: (String error, int statusCode) { + log(error); + }, queryParams: request.toFlatMap()); + + return categoryList; + } + + List productList = List(); + Future> getAllProducts(OffersProductsRequestModel request) async { + hasError = false; + var url = EXA_CART_API_BASE_URL + PACKAGES_PRODUCTS; + await baseAppClient.simpleGet(url, onSuccess: (dynamic stringResponse, int statusCode) { + if (statusCode == 200) { + var jsonResponse = json.decode(stringResponse); + jsonResponse['products'].forEach((json) { + productList.add(OfferProductsResponseModel().fromJson(json)); + }); + } + }, onFailure: (String error, int statusCode) { + log(error); + }, queryParams: request.toFlatMap()); + + return productList; + } +} diff --git a/lib/core/service/parmacyModule/order-preview-service.dart b/lib/core/service/parmacyModule/order-preview-service.dart new file mode 100644 index 00000000..89d5550e --- /dev/null +++ b/lib/core/service/parmacyModule/order-preview-service.dart @@ -0,0 +1,29 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class OrderPreviewService extends BaseService{ + bool isFinished = true; + bool hasError = false; + String errorMsg = ''; + + List addresses = List(); + + Future getBannerListList() async { + // hasError = false; + // try { + // await baseAppClient.get(GET_CUSTOMERS_ADDRESSES, + // onSuccess: (dynamic response, int statusCode) { + // addresses.clear(); + // response['customers'][0]['addresses'].forEach((item) { + // addresses.add(Addresses.fromJson(item)); + // }); + // }, onFailure: (String error, int statusCode) { + // hasError = true; + // super.error = error; + // }); + // } catch (error) { + // throw error; + // } + } +} \ No newline at end of file diff --git a/lib/core/service/parmacyModule/parmacy_module_service.dart b/lib/core/service/parmacyModule/parmacy_module_service.dart new file mode 100644 index 00000000..53dc7e0a --- /dev/null +++ b/lib/core/service/parmacyModule/parmacy_module_service.dart @@ -0,0 +1,97 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class PharmacyModuleService extends BaseService { + bool isFinished = true; + bool hasError = false; + String errorMsg = ''; + + List bannerItems = List(); + List manufacturerList = List(); + List bestSellerProducts = List(); + List lastVisitedProducts = List(); + + Future getBannerListList() async { + hasError = false; + try { + // await baseAppClient.get(GET_PHARMACY_BANNER, + // onSuccess: (dynamic response, int statusCode) { + // bannerItems.clear(); + // response['images'].forEach((item) { + // bannerItems.add(PharmacyImageObject.fromJson(item)); + // }); + // }, onFailure: (String error, int statusCode) { + // hasError = true; + // super.error = error; + // }); + } catch (error) { + throw error; + } + } + + Future getTopManufacturerList() async { + Map queryParams = {'page': '1', 'limit': '8'}; + try { + // await baseAppClient.get(GET_PHARMACY_TOP_MANUFACTURER, + // onSuccess: (dynamic response, int statusCode) { + // manufacturerList.clear(); + // response['manufacturer'].forEach((item) { + // manufacturerList.add(Manufacturer.fromJson(item)); + // }); + // }, onFailure: (String error, int statusCode) { + // hasError = true; + // super.error = error; + // }, queryParams: queryParams); + } catch (error) { + throw error; + } + } + + Future getBestSellerProducts() async { + Map queryParams = { + 'fields': + 'id,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,reviews', + }; + try { + // await baseAppClient.get(GET_PHARMACY_BEST_SELLER_PRODUCT, + // onSuccess: (dynamic response, int statusCode) { + // bestSellerProducts.clear(); + // response['products'].forEach((item) { + // bestSellerProducts.add(PharmacyProduct.fromJson(item)); + // }); + // }, onFailure: (String error, int statusCode) { + // hasError = true; + // super.error = error; + // }, queryParams: queryParams); + } catch (error) { + throw error; + } + } + + Future getLastVisitedProducts() async { + String lastVisited = ""; + if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) != + null) { + lastVisited = + await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS); + try { + // await baseAppClient.get("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited", + // onSuccess: (dynamic response, int statusCode) { + // lastVisitedProducts.clear(); + // response['products'].forEach((item) { + // lastVisitedProducts.add(PharmacyProduct.fromJson(item)); + // }); + // }, onFailure: (String error, int statusCode) { + // hasError = true; + // super.error = error; + // }); + } catch (error) { + throw error; + } + } + } +} diff --git a/lib/core/service/pharmacies_service.dart b/lib/core/service/pharmacies_service.dart new file mode 100644 index 00000000..dbd4fae1 --- /dev/null +++ b/lib/core/service/pharmacies_service.dart @@ -0,0 +1,121 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_list_model.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_model.dart'; +import 'package:geolocator/geolocator.dart'; + +class PharmacyService extends BaseService { + List _medicineItem = List(); + List _pharmaciesList = List(); + + List get medicineItem => _medicineItem; + List get pharmaciesList => _pharmaciesList; + + bool isFinished = true; + bool hasError = false; + String errorMsg = ''; + + void clearMedicineList() { + _medicineItem.clear(); + } + + void clearPharmaciesList() { + _pharmaciesList.clear(); + } + + PharmaciesModel _requestGetPharmaciesModel = PharmaciesModel( + channel: 3, + clinicID: 1, + deviceTypeID: 2, + doctorID: 1485, + editedBy: 1485, + generalid: "Cs2020@2016\$2958", + iPAdress: "11.11.11.11", + isDentalAllowedBackend: false, + isLoginForDoctorApp: true, + languageID: 2, + pageIndex: 0, + pageSize: 20, + patientOutSA: 0, + pHRItemName: "panadol", + projectID: 15, + sessionID: "BlUSkYymTt", + stamp: "2020-04-27T12:17:17.721Z", + tokenID: "6EfeKCLRu0GPdFutIt3m7Q==", + versionID: 8.3); + + PharmaciesListModel _pharmaciesListModel = PharmaciesListModel( + patientTypeID: 1, + languageID: 2, + stamp: '2020-04-23T21:01:21.492Z', + iPAdress: '11.11.11.11', + versionID: 8.3, + sessionID: 'e29zoooEJ4', + isLoginForDoctorApp: true, + channel: 9, + editedBy: 1485, + doctorID: 1485, + patientOutSA: 0, + clinicID: 1, + projectID: 15, + ); + + double _latitude=0; + double _longitude=0; + + _getCurrentLocation() async { + await Geolocator.getLastKnownPosition().then((value) { + _latitude = value.latitude; + _longitude = value.longitude; + }).catchError((e) { + _longitude = 0; + _latitude = 0; + }); + } + + Future getMedicineList({String drugName}) async { + hasError = false; + await _getCurrentLocation(); + Map body = Map(); + body['PHR_itemName'] = drugName.trim(); + body['isLoginForDoctorApp'] = true; + body['isDentalAllowedBackend'] = true; + body['PageSize'] = 25; + body['Latitude'] = _latitude; + body['Longitude'] = _longitude; + + await baseAppClient.post(GET_PHARMCY_ITEMS, + onSuccess: (dynamic response, int statusCode) { + _medicineItem.clear(); + response['ListPharmcy_Region'].forEach((item) { + _medicineItem.add(PharmaciesModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + + } + + Future getPharmaciesList({int itemID}) async { + + await _getCurrentLocation(); + Map body = Map(); + body['ItemID'] = itemID; + body['Latitude'] = _latitude; + body['Longitude'] = _longitude; + + await baseAppClient.post(GET_PHARMACY_LIST, + onSuccess: (dynamic response, int statusCode) { + _pharmaciesList.clear(); + response['PharmList'].forEach((item) { + _pharmaciesList.add(PharmaciesListModel.fromJson(item)); + hasError = false; + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body:body); + + } +} diff --git a/lib/core/service/privilege_service.dart b/lib/core/service/privilege_service.dart new file mode 100644 index 00000000..5beef992 --- /dev/null +++ b/lib/core/service/privilege_service.dart @@ -0,0 +1,22 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class PrivilegeService extends BaseService { + + List privilegeModelList = List(); + + Future getPrivilege() async { + Map body = Map(); + body['PatientType'] = 4; + await baseAppClient.post(GET_PRIVILEGE, + onSuccess: (dynamic response, int statusCode) { + response['ServicePrivilegeList'].forEach((item) { + privilegeModelList.add(PrivilegeModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/qr_service.dart b/lib/core/service/qr_service.dart new file mode 100644 index 00000000..d43ed5bb --- /dev/null +++ b/lib/core/service/qr_service.dart @@ -0,0 +1,21 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/qr/qr_parking_model.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class QrService extends BaseService { + List qRParkingList = List(); + + Future getQRParkingByID(int qRParkingID) async { + Map body = Map(); + body['QRParkingID'] = qRParkingID; + await baseAppClient.post(GET_QR_PARKING, + onSuccess: (dynamic response, int statusCode) { + response['List_SWP_QRParkingModel'].forEach((item) { + qRParkingList.add(QRParkingModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/vaccine_service.dart b/lib/core/service/vaccine_service.dart new file mode 100644 index 00000000..297909a4 --- /dev/null +++ b/lib/core/service/vaccine_service.dart @@ -0,0 +1,75 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/vaccine/vaccination_item.dart'; +import 'package:diplomaticquarterapp/core/model/vaccine/vaccination_on_hand.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/core/model/vaccine/my_vaccine.dart'; + +class VaccineService extends BaseService { + List _vaccineList = List(); + List vaccinationItemList = List(); + List vaccinationOnHandList = List(); + + List get vaccineList => _vaccineList; + + Future getMyVaccine() async { + Map body = Map(); + body['To'] = "0"; + body['From'] = "0"; + hasError = false; + _vaccineList.clear(); + await baseAppClient.post(GET_VACCINES, + onSuccess: (dynamic response, int statusCode) { + response['List_DoneVaccines'].forEach((item) { + _vaccineList.add(VaccineModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future sendEmail() async { + Map body = Map(); + body['ListVaccines'] = vaccineList.map((v) => v.toJson()).toList(); + body['To'] = user.emailAddress; + body['DateofBirth'] = user.dateofBirth; + body['PatientIditificationNum'] = user.patientIdentificationNo; + body['PatientMobileNumber'] = user.mobileNumber; + body['PatientName'] = user.firstName + " " + user.lastName; + + hasError = false; + + await baseAppClient.post(GET_VACCINES_EMAIL, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getMyVaccinationItem() async { + await baseAppClient.post(GET_VACCINATIONS_ITEMS, + onSuccess: (dynamic response, int statusCode) { + response['GetVaccinationsList'].forEach((item) { + vaccinationItemList.add(VaccinationItem.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + Future getMyVaccinationOnHand({String pItemCode}) async { + Map body = Map(); + body['P_ITEM_CODE'] = pItemCode; + await baseAppClient.post(GET_VACCINATION_ONHAND, + onSuccess: (dynamic response, int statusCode) { + response['GetVaccinationOnHandList'].forEach((item) { + vaccinationOnHandList.add(VaccinationOnHand.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/weather_service.dart b/lib/core/service/weather_service.dart new file mode 100644 index 00000000..10ab1adf --- /dev/null +++ b/lib/core/service/weather_service.dart @@ -0,0 +1,36 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/weahter/weather_model.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class WeatherService extends BaseService { + List weatherIndicatorData = List(); + + Map body = Map(); + String Latitude = ""; + String Longitude = ""; + String PhoneNumber = ""; + + Future getWeatherData() async { + hasError = false; + + var lat = await sharedPref.getDouble(USER_LAT); + var long = await sharedPref.getDouble(USER_LONG); + body['Latitude'] = lat ?? 0; + body['Longitude'] = long ?? 0; + + await baseAppClient.post(WEATHER_INDICATOR, + onSuccess: (dynamic response, int statusCode) { + weatherIndicatorData = []; + response['GetCityInfo_List'].forEach((data) { + weatherIndicatorData.add(GetCityInfoList.fromJson(data)); + }); + print(weatherIndicatorData); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + await this.sharedPref.setObject(WEATHER, weatherIndicatorData[0]); + return Future.value(weatherIndicatorData[0]); + } +} diff --git a/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart new file mode 100644 index 00000000..15b00e37 --- /dev/null +++ b/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart @@ -0,0 +1,125 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_month_data_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_today_data_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_week_data_model.dart'; +import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import '../../../locator.dart'; + +class H2OViewModel extends BaseViewModel { + + H2OService _h2OService = locator(); + + List userProgressForWeekDataSeries; + List userProgressForMonthDataSeries; + + UserProgressForTodayDataModel get userProgressData { + if (_h2OService.userProgressForTodayDataList.length != 0) + return _h2OService.userProgressForTodayDataList[0]; + return null; + } + + + Future getUserProgressForTodayData() async { + // if(_h2OService.userProgressForTodayDataList.length==0){ + setState(ViewState.Busy); + await _h2OService.getUserProgressForTodayData(); + if (_h2OService.hasError) { + error = _h2OService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future getUserProgressForWeekData() async { + setState(ViewState.Busy); + await _h2OService.getUserProgressForWeekData(); + if (_h2OService.hasError) { + error = _h2OService.error; + setState(ViewState.Error); + } else { + userProgressForWeekDataSeries = createUserProgressForWeekDataSeries(); + setState(ViewState.Idle); + } + } + + Future getUserProgressForMonthData() async { + setState(ViewState.Busy); + await _h2OService.getUserProgressForMonthData(); + if (_h2OService.hasError) { + error = _h2OService.error; + setState(ViewState.Error); + } else { + userProgressForMonthDataSeries = createUserProgressForMonthDataSeries(); + setState(ViewState.Idle); + } + } + + + List> createUserProgressForWeekDataSeries() { + List globalData = [ + ]; + _h2OService.userProgressForWeekDataList.forEach(( + UserProgressForWeekDataModel data) { + globalData.add(new ChartSeries(data.dayName, data.percentageConsumed)); + }); + return [ + new charts.Series( + id: 'Global Revenue', + domainFn: (ChartSeries sales, _) => sales.y, + measureFn: (ChartSeries sales, _) => sales.x, + data: globalData, + ), + ]; + } + + List> createUserProgressForMonthDataSeries() { + List globalData = [ + ]; + _h2OService.userProgressForMonthDataList.forEach(( + UserProgressForMonthDataModel data) { + globalData.add(new ChartSeries(data.monthName, data.percentageConsumed)); + }); + return [ + new charts.Series( + id: 'Global Revenue', + domainFn: (ChartSeries sales, _) => sales.y, + measureFn: (ChartSeries sales, _) => sales.x, + data: globalData, + ), + ]; + } + + + Future insertUserActivity( + InsertUserActivityRequestModel insertUserActivityRequestModel) async { + setState(ViewState.BusyLocal); + insertUserActivityRequestModel.mobileNumber = + user.mobileNumber.substring(1); + insertUserActivityRequestModel.identificationNo = + user.patientIdentificationNo; + + await _h2OService.insertUserActivity(insertUserActivityRequestModel); + if (_h2OService.hasError) { + error = _h2OService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + +} + + +/// Sample ordinal data type. +class ChartSeries { + final String y; + final int x; + + ChartSeries(this.y, this.x); +} diff --git a/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart new file mode 100644 index 00000000..bf3404a9 --- /dev/null +++ b/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart @@ -0,0 +1,110 @@ +import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; +import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/cmc_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; + +import '../../../locator.dart'; + +class CMCViewModel extends BaseViewModel { + CMCService _cMCService = + locator(); + + List get cmcAllServicesList => + + _cMCService.cmcAllServicesList; + + List get cmcAllPresOrders => + _cMCService.cmcAllPresOrdersList; + + List get cmcAllOrderDetail => + _cMCService.cmcAllOrderDetail; + List get checkupItems => + _cMCService.checkupItemsList; + + bool get isOrderUpdated => _cMCService.isOrderUpdated; + + Future getCMCAllServices() async { + await _cMCService + .getCMCAllServices(); + CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel(checkupType: cmcAllServicesList[0].iD); + + await getCheckupItems(cMCGetItemsRequestModel: cMCGetItemsRequestModel,isFirst: true); + if (_cMCService.hasError) { + error = _cMCService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + Future getCheckupItems({CMCGetItemsRequestModel cMCGetItemsRequestModel, bool isFirst = false}) async { + if(!isFirst) + setState(ViewState.Busy); + await _cMCService.getCheckupItems(cMCGetItemsRequestModel); + if (_cMCService.hasError) { + error = _cMCService.error; + setState(ViewState.Error); + } + if(!isFirst) + setState(ViewState.Idle); + } + + Future getCmcAllPresOrders() async { + setState(ViewState.Busy); + await _cMCService.getCmcAllPresOrders(); + if (_cMCService.hasError) { + error = _cMCService.error; + setState(ViewState.Error); + } else { + var pendingOrder = _cMCService.cmcAllPresOrdersList.firstWhere( + (element) => element.status == 1 || element.status == 2, + orElse: () => null); + if (pendingOrder != null) { + await getOrderDetailByOrderID(pendingOrder); + setState(ViewState.Idle); + } else { + getCMCAllServices(); + } + } + } + + Future updateCmcPresOrder( + UpdatePresOrderRequestModel updatePresOrderRequestModel) async { + setState(ViewState.BusyLocal); + await _cMCService.updateCmcPresOrder( + updatePresOrderRequestModel); + if (_cMCService.hasError) { + error = _cMCService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + Future getOrderDetailByOrderID(GetHHCAllPresOrdersResponseModel order) async { + GetOrderDetailByOrderIDRequestModel getOrderDetailByOrderIDRequestModel = + GetOrderDetailByOrderIDRequestModel(presOrderID: order.iD); + await _cMCService + .getOrderDetailByOrderID(getOrderDetailByOrderIDRequestModel); + } + //TODO check it in uat + Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async { + setState(ViewState.Busy); + order.createdBy = user.patientID; + order.orderServiceID = OrderService.Comprehensive_Medical_Checkup.getIdOrderService(); + await _cMCService.insertPresPresOrder(order: order); + if (_cMCService.hasError) { + error = _cMCService.error; + setState(ViewState.ErrorLocal); + } else { + getCmcAllPresOrders(); + } + } +} \ No newline at end of file diff --git a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart new file mode 100644 index 00000000..031d0a0c --- /dev/null +++ b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart @@ -0,0 +1,97 @@ +import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/PatientERHHCInsertServicesList.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; +import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/home_health_care_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; + +import '../../../locator.dart'; + +class HomeHealthCareViewModel extends BaseViewModel { + HomeHealthCareService _homeHealthCareService = + locator(); + + List get hhcAllServicesList => + _homeHealthCareService.hhcAllServicesList; + + List get hhcAllPresOrders => + _homeHealthCareService.hhcAllPresOrdersList; + + List get hhcAllOrderDetail => + _homeHealthCareService.hhcAllOrderDetail; + + bool get isOrderUpdated => _homeHealthCareService.isOrderUpdated; + + GetHHCAllPresOrdersResponseModel pendingOrder; + + List patientERHHCInsertServicesList = List(); + + Future getHHCAllServices() async { + HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel = + new HHCGetAllServicesRequestModel(); + //setState(ViewState.Busy); + await _homeHealthCareService + .getHHCAllServices(hHCGetAllServicesRequestModel); + if (_homeHealthCareService.hasError) { + error = _homeHealthCareService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future getHHCAllPresOrders() async { + pendingOrder = null; + setState(ViewState.Busy); + await _homeHealthCareService.getHHCAllPresOrders(); + if (_homeHealthCareService.hasError) { + error = _homeHealthCareService.error; + setState(ViewState.Error); + } else { + pendingOrder = _homeHealthCareService.hhcAllPresOrdersList + .firstWhere((element) => element.status == 1 || element.status == 2, + orElse: () => null); + if (pendingOrder != null) { + await _homeHealthCareService.getOrderDetailByOrderID(pendingOrder.iD); + setState(ViewState.Idle); + } else { + getHHCAllServices(); + } + + } + } + + Future updateHHCPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { + setState(ViewState.Busy); + await _homeHealthCareService.updateHHCPresOrder( + updatePresOrderRequestModel); + if (_homeHealthCareService.hasError) { + error = _homeHealthCareService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + Future insertPresPresOrder({PatientERInsertPresOrderRequestModel order}) async { + setState(ViewState.Busy); + order.createdBy = user.patientID; + order.orderServiceID = OrderService.HOME_HEALTH_CARE.getIdOrderService(); + await _homeHealthCareService.insertPresPresOrder(order: order); + if (_homeHealthCareService.hasError) { + error = _homeHealthCareService.error; + setState(ViewState.ErrorLocal); + } else { + getHHCAllPresOrders(); + } + } + + + +} \ No newline at end of file diff --git a/lib/core/viewModels/all_habib_medical_services/e_referral_view_model.dart b/lib/core/viewModels/all_habib_medical_services/e_referral_view_model.dart new file mode 100644 index 00000000..1972e08f --- /dev/null +++ b/lib/core/viewModels/all_habib_medical_services/e_referral_view_model.dart @@ -0,0 +1,91 @@ +import 'dart:core'; + +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/send_activation_code_for_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/e_referral_service.dart'; + +import '../../../locator.dart'; +import '../base_view_model.dart'; + +class EReferralViewModel extends BaseViewModel { + EReferralService _eReferralService = locator(); + + List get relationTypes => + _eReferralService.relationTypes; + List get allCities => _eReferralService.allCities; + List get allReferral => _eReferralService.allReferral; + + + + void getRelationTypes() async { + setState(ViewState.Busy); + await _eReferralService.getRelationTypes(); + if (_eReferralService.hasError) { + error = _eReferralService.error; + setState(ViewState.Error); + } else{ + setState(ViewState.Idle); + } + } + void getAllCities() async { + setState(ViewState.Busy); + await _eReferralService.getAllCities(); + if (_eReferralService.hasError) { + error = _eReferralService.error; + setState(ViewState.Error); + } else{ + setState(ViewState.Idle); + } + } + + void sendActivationCodeForEReferral(SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel) async { + setState(ViewState.BusyLocal); + await _eReferralService.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel); + if (_eReferralService.hasError) { + error = _eReferralService.error; + setState(ViewState.ErrorLocal); + } else{ + setState(ViewState.Idle); + } + } + + checkActivationCodeForEReferral(CheckActivationCodeForEReferralResponseModel checkActivationCodeForEReferralRequestModel) async { + setState(ViewState.BusyLocal); + await _eReferralService.checkActivationCodeForEReferral(checkActivationCodeForEReferralRequestModel); + if (_eReferralService.hasError) { + error = _eReferralService.error; + setState(ViewState.ErrorLocal); + } else{ + setState(ViewState.Idle); + } + } + + void createEReferral( + CreateEReferralRequestModel createEReferralRequestModel) async { + setState(ViewState.BusyLocal); + await _eReferralService.createEReferral(createEReferralRequestModel); + if (_eReferralService.hasError) { + error = _eReferralService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + getEReferrals(SearchEReferralRequestModel searchEReferralRequestModel) async { + setState(ViewState.BusyLocal); + await _eReferralService.getEReferrals(searchEReferralRequestModel); + if (_eReferralService.hasError) { + error = _eReferralService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/appointment_rate_view_model.dart b/lib/core/viewModels/appointment_rate_view_model.dart new file mode 100644 index 00000000..23d00366 --- /dev/null +++ b/lib/core/viewModels/appointment_rate_view_model.dart @@ -0,0 +1,68 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/rate/appointment_details.dart'; +import 'package:diplomaticquarterapp/core/model/rate/appoitment_rated.dart'; +import 'package:diplomaticquarterapp/core/service/appointment_rate_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import '../../locator.dart'; + +class AppointmentRateViewModel extends BaseViewModel { + AppointmentRateService _appointmentRateService = + locator(); + bool isHaveAppointmentNotRate = false; + + AppointmentDetails get appointmentDetails => _appointmentRateService.appointmentDetails; + + + Future getIsLastAppointmentRatedList() async { + isHaveAppointmentNotRate = false; + setState(ViewState.Busy); + await _appointmentRateService.getIsLastAppointmentRatedList(); + if (_appointmentRateService.hasError) { + error = _appointmentRateService.error; + setState(ViewState.Error); + } else { + if(_appointmentRateService.appointmentRatedList.length>0) + await getAppointmentDetails(); + } + } + + getAppointmentDetails() async { + await _appointmentRateService.getAppointmentDetails(); + if (_appointmentRateService.hasError) { + error = _appointmentRateService.error; + setState(ViewState.Error); + } else { + if (_appointmentRateService.appointmentDetails != null) + isHaveAppointmentNotRate = true; + setState(ViewState.Idle); + } + } + + Future sendAppointmentRate(int rate, int appointmentNo, int projectID, + int doctorID, int clinicID, String note) async { + setState(ViewState.BusyLocal); + await _appointmentRateService.sendAppointmentRate( + rate, appointmentNo, projectID, doctorID, clinicID, note); + if (_appointmentRateService.hasError) { + error = _appointmentRateService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + _appointmentRateService.deleteAllAppAppointmentRate(); + } + } + + AppoitmentRated get lastAppointmentRated => + _appointmentRateService.lastAppointmentRated; + + deleteAppointmentRated(AppoitmentRated appointmentRated) => + _appointmentRateService.deleteAppointmentRated(appointmentRated); + + deleteAppAppointmentRate() => + _appointmentRateService.deleteAllAppAppointmentRate(); + + setIsRated(bool isRated) { + this.isHaveAppointmentNotRate = isRated; + notifyListeners(); + } +} diff --git a/lib/core/viewModels/base_view_model.dart b/lib/core/viewModels/base_view_model.dart new file mode 100644 index 00000000..aab267e9 --- /dev/null +++ b/lib/core/viewModels/base_view_model.dart @@ -0,0 +1,59 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:flutter/material.dart'; + +import '../../locator.dart'; + +class BaseViewModel extends ChangeNotifier { + ViewState _state = ViewState.Idle; + bool isInternetConnection = true; + bool isLogin = false; + + ViewState get state => _state; + + String error = ""; + + AuthenticatedUser user; + AppSharedPreferences sharedPref = AppSharedPreferences(); + AuthenticatedUserObject authenticatedUserObject = locator(); + + void setState(ViewState viewState) { + _state = viewState; + + if (viewState == ViewState.Busy || viewState == ViewState.BusyLocal) + error = ""; + + if (hasListeners) notifyListeners(); + } + + setUser(AuthenticatedUser user){ + this.user = user; + notifyListeners(); + } + + BaseViewModel() { + //authenticatedUserObject.getUser(); + user = authenticatedUserObject.user; + this.isLogin = authenticatedUserObject.isLogin; + + } + + _getUser() async { + var userData = await sharedPref.getObject(USER_PROFILE); + if (userData != null) user = AuthenticatedUser.fromJson(userData); + + var isLogin = await sharedPref.getString(LOGIN_TOKEN_ID); + this.isLogin = isLogin != null; + + notifyListeners(); + } + + @override + void dispose() { + removeListener(() {}); + super.dispose(); + } +} diff --git a/lib/core/viewModels/blooddonation/blood_details_view_model.dart b/lib/core/viewModels/blooddonation/blood_details_view_model.dart new file mode 100644 index 00000000..a6b341cf --- /dev/null +++ b/lib/core/viewModels/blooddonation/blood_details_view_model.dart @@ -0,0 +1,27 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart'; +import 'package:diplomaticquarterapp/core/service/blood/blood_details_servies.dart'; +import '../../../locator.dart'; +import '../base_view_model.dart'; + +class BloodDeatailsViewModel extends BaseViewModel{ + + + BloodDetailsService _bloodDetailsService =locator(); + List get BloodDetailsModelList => _bloodDetailsService.BloodModelList;//_bloodDonationService.CitiesModelList; + + + Future getBlood() async { + setState(ViewState.Busy); + await _bloodDetailsService .getAllBloodOrders();; + + if (_bloodDetailsService.hasError) { + error = _bloodDetailsService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + + +} \ No newline at end of file diff --git a/lib/core/viewModels/blooddonation/booddonation_view_model.dart b/lib/core/viewModels/blooddonation/booddonation_view_model.dart new file mode 100644 index 00000000..b9c13c57 --- /dev/null +++ b/lib/core/viewModels/blooddonation/booddonation_view_model.dart @@ -0,0 +1,24 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart'; +import 'package:diplomaticquarterapp/core/service/blood/blood_donation_service.dart'; + +import '../../../locator.dart'; +import '../base_view_model.dart'; + +class BloodDonationViewModel extends BaseViewModel{ + + + + BloodDonationService _bloodDonationService =locator(); + List get CitiesModelList => _bloodDonationService.CitiesModelList; + Future getCities() async { + setState(ViewState.Busy); + await _bloodDonationService.getAllCitiesOrders(); + // getHospitals(); + if (_bloodDonationService.hasError) { + error = _bloodDonationService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } +} \ No newline at end of file diff --git a/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart b/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart new file mode 100644 index 00000000..eebaca02 --- /dev/null +++ b/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart @@ -0,0 +1,42 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/child_vaccines_service.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/delete_baby_service.dart'; + +import '../../../locator.dart'; +import '../base_view_model.dart'; + + +class AddNewChildViewModel extends BaseViewModel { + + CreteNewBabyService _creteNewBabyService = locator(); + ChildVaccinesService _childVaccinesService = locator(); + // DeleteBabyService _deleteBabyService = locator(); + bool isAdded = false; + ///create new baby + createNewBabyOrders({ CreateNewBaby newChild}) async { + setState(ViewState.Busy); + await _creteNewBabyService.getCreateNewBabyOrders(newChild: newChild, userID: _childVaccinesService.userID); + if (_creteNewBabyService.hasError) { + error = _creteNewBabyService.error; + setState(ViewState.Error); + } else { + isAdded = true; + setState(ViewState.Idle); + await _childVaccinesService.getAllBabyInformationOrders(); + if (_childVaccinesService.hasError) { + error = _childVaccinesService.error; + setState(ViewState.Error); + } else{ + + } + } + } + + + + + +} diff --git a/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart b/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart new file mode 100644 index 00000000..7c4af285 --- /dev/null +++ b/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart @@ -0,0 +1,73 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart'; + +import 'package:diplomaticquarterapp/core/service/childvaccines/child_vaccines_service.dart'; +//======== +import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/child_vaccines_service.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/delete_baby_service.dart'; + +import '../../../locator.dart'; +import '../base_view_model.dart'; + +class ChildVaccinesViewModel extends BaseViewModel{ + ChildVaccinesService _childVaccinesService = locator(); + + List get babyInformationModelList=> _childVaccinesService.babyInformationModelList; + + +//=========== + CreteNewBabyService _creteNewBabyService = locator(); + + DeleteBabyService _deleteBabyService = locator(); + bool isAdded = false; + bool isDeleted = false; + //============ + + + getNewUserOrders() async { + setState(ViewState.Busy); + await _childVaccinesService.getNewUserOrders(); + if (_childVaccinesService.hasError) { + error = _childVaccinesService.error; + setState(ViewState.Error); + } else + getBabyInformatioRequestOrders(); + } + + getBabyInformatioRequestOrders() async { + await _childVaccinesService.getAllBabyInformationOrders(); + if (_childVaccinesService.hasError) { + error = _childVaccinesService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + + + ///delete baby + deleteBabyOrders({ DeleteBaby newChild}) async { + setState(ViewState.Busy); + //await _creteNewBabyService.getCreateNewBabyOrders(newChild: newChild, userID: _childVaccinesService.userID); + await _deleteBabyService.getDeleteBabyOrder(deleteChild: newChild,babyID: newChild.babyID); + //getDeleteBabyOrder(deleteChild: newChild,); + // getDeleteBabyOrder + if (_creteNewBabyService.hasError) { + error = _creteNewBabyService.error; + setState(ViewState.Error); + } else { + isDeleted = true; + setState(ViewState.Idle); + await _childVaccinesService.getAllBabyInformationOrders(); + if (_childVaccinesService.hasError) { + error = _childVaccinesService.error; + setState(ViewState.Error); + } else{ + + } + } + } + +} \ No newline at end of file diff --git a/lib/core/viewModels/child_vaccines/user_information_view_model.dart b/lib/core/viewModels/child_vaccines/user_information_view_model.dart new file mode 100644 index 00000000..43269f42 --- /dev/null +++ b/lib/core/viewModels/child_vaccines/user_information_view_model.dart @@ -0,0 +1,23 @@ +import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/user_information_service.dart'; +import '../../../locator.dart'; +import '../base_view_model.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; + +class UserInformationViewModel extends BaseViewModel { + UserInformationService _userInformationService = + locator(); + + List get userInformationModelList => + _userInformationService.userInformationModelList; + + getUserInformationRequestOrders() async { + setState(ViewState.Busy); + await _userInformationService.getUserInformationOrders(); + if (_userInformationService.hasError) { + error = _userInformationService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart b/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart new file mode 100644 index 00000000..3b72dd50 --- /dev/null +++ b/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart @@ -0,0 +1,30 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/vaccination_table_service.dart'; + +import '../../../locator.dart'; +import '../base_view_model.dart'; + + +class VaccinationTableViewModel extends BaseViewModel{ + + VaccinationTableService _creteVaccinationTableService = locator(); + + // String get creteVaccinationTableContent => _creteVaccinationTableService.userAgreementContent; + //String get userAgreementContent => _creteNewBabyService.v//_reportsService.userAgreementContent; + List get creteVaccinationTableModelList=> _creteVaccinationTableService.createVaccinationTableModelList;//.createNewBabyModelList; + getCreateVaccinationTable() async { + setState(ViewState.Busy); + + await _creteVaccinationTableService.getCreateVaccinationTableOrders();//getCreateNewBabyOrders(); + + if ( _creteVaccinationTableService.hasError) { + error = _creteVaccinationTableService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + +} diff --git a/lib/core/viewModels/contactus/findus_view_model.dart b/lib/core/viewModels/contactus/findus_view_model.dart new file mode 100644 index 00000000..800c3106 --- /dev/null +++ b/lib/core/viewModels/contactus/findus_view_model.dart @@ -0,0 +1,30 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart'; +import 'package:diplomaticquarterapp/core/service/contactus/finadus_service.dart'; +import '../base_view_model.dart'; +import '../../../locator.dart'; + +class FindusViewModel extends BaseViewModel { + FindusService _findusService = locator(); + + List get FindusModelList => + _findusService.FindusModelList; + + List get FindusHospitalModelList=> + _findusService.FindusHospitalModelList; + + List get FindusPharmaciesModelList=> + _findusService.FindusPharmaciesModelList; + + getFindUsRequestOrders() async { + setState(ViewState.Busy); + + await _findusService.getAllFindUsOrders(); + + if (_findusService.hasError) { + error = _findusService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/core/viewModels/contactus/livechat_view_model.dart b/lib/core/viewModels/contactus/livechat_view_model.dart new file mode 100644 index 00000000..8df4e801 --- /dev/null +++ b/lib/core/viewModels/contactus/livechat_view_model.dart @@ -0,0 +1,33 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/contactus/get_patientI_cprojects.dart'; +import 'package:diplomaticquarterapp/core/service/contactus/livechat_service.dart'; +import '../base_view_model.dart'; +import '../../../locator.dart'; + + +class LiveChatViewModel extends BaseViewModel{ + + + + LiveChatService _liveChatService =locator(); + + List get LiveChatModelList=> + + _liveChatService.LivechatModelList; + + + getLiveChatRequestOrders() async { + setState(ViewState.Busy); + + await _liveChatService.getAllLiveChatOrders(); + + if (_liveChatService.hasError) { + error = _liveChatService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + + +} \ No newline at end of file diff --git a/lib/core/viewModels/dashboard_view_model.dart b/lib/core/viewModels/dashboard_view_model.dart new file mode 100644 index 00000000..e085e476 --- /dev/null +++ b/lib/core/viewModels/dashboard_view_model.dart @@ -0,0 +1,46 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import '../../locator.dart'; + +class DashboardViewModel extends BaseViewModel { + VitalSignService _vitalSignService = locator(); + + String get weightKg => _vitalSignService.weightKg; + + String get heightCm => _vitalSignService.heightCm; + String booldType = "-"; + + // ToDoCountProviderModel toDoProvider = + // Provider.of(AppGlobal.context); + + getPatientRadOrders() async { + if (isLogin && _vitalSignService.weightKg.isEmpty) { + setState(ViewState.Busy); + await _vitalSignService.getPatientRadOrders(); + if (_vitalSignService.hasError) { + error = _vitalSignService.error; + setState(ViewState.ErrorLocal); + } else { + booldType = await sharedPref.getString(BLOOD_TYPE) ?? "-"; + setState(ViewState.Idle); + } + } + } + +// getToDoCount() { +// toDoProvider.setState(0); +// ClinicListService service = new ClinicListService(); +// service.getActiveAppointmentNo(AppGlobal.context).then((res) { +// print(res['AppointmentActiveNumber']); +// if (res['MessageStatus'] == 1) { +// toDoProvider.setState(res['AppointmentActiveNumber']); +// } else {} +// }).catchError((err) { +// print(err); +// }); +// } +} diff --git a/lib/core/viewModels/er/am_request_view_model.dart b/lib/core/viewModels/er/am_request_view_model.dart new file mode 100644 index 00000000..2cf8e877 --- /dev/null +++ b/lib/core/viewModels/er/am_request_view_model.dart @@ -0,0 +1,108 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart'; +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; +import 'package:diplomaticquarterapp/core/model/er/PickUpRequestPresOrder.dart'; +import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/service/er/am_service.dart'; +import 'package:diplomaticquarterapp/core/service/hospital_service.dart'; +import 'package:diplomaticquarterapp/core/service/medical/medical_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:flutter/cupertino.dart'; +import '../base_view_model.dart'; +import '../../../locator.dart'; + +class AmRequestViewModel extends BaseViewModel { + AmService _amService = locator(); + HospitalService _hospitalService = locator(); + MedicalService _medicalService = locator(); + + List get amRequestModeList => + _amService.amModelList; + + List get patientAllPresOrdersList => + _amService.patientAllPresOrdersList; + + List get appoitmentAllHistoryResultList => + _medicalService.appoitmentAllHistoryResultList; + + List get hospitals => _hospitalService.hospitals; + + bool get hasPendingOrder =>_amService.hasPendingOrder; + + PickUpRequestPresOrder get pickUpRequestPresOrder =>_amService.pickUpRequestPresOrder; + + Future getAppointmentHistory() async { + setState(ViewState.BusyLocal); + await _medicalService.getAppointmentHistory(isActiveAppointment: true); + if (_medicalService.hasError) { + error = _medicalService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future getAmRequestOrders() async { + setState(ViewState.Busy); + await _amService.getAllTransportationOrders(); + if (_amService.hasError) { + error = _amService.error; + setState(ViewState.Error); + } else + getHospitals(); + } + + Future getHospitals() async { + setState(ViewState.Busy); + await _hospitalService.getHospitals(); + if (_hospitalService.hasError) { + error = _hospitalService.error; + setState(ViewState.Error); + } else + getPatientAllPresOrdersList(); + } + + Future getPatientAllPresOrdersList() async { + setState(ViewState.Busy); + await _amService.getPatientAllPresOrdersList(); + if (_hospitalService.hasError) { + error = _hospitalService.error; + setState(ViewState.Error); + } else if (_amService.hasPendingOrder) { + getOrderDetails(); + } else + setState(ViewState.Idle); + } + + Future getOrderDetails() async { + setState(ViewState.Busy); + await _amService.getOrderDetails(); + if (_amService.hasError) { + error = _amService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future updatePressOrder({@required int presOrderID}) async { + setState(ViewState.Busy); + await _amService.updatePressOrder(presOrderID: presOrderID); + if (_amService.hasError) { + error = _amService.error; + setState(ViewState.Error); + } else + getPatientAllPresOrdersList(); + } + + Future insertERPressOrder({@required PatientER patientER}) async { + setState(ViewState.Busy); + await _amService.insertERPressOrder(patientER: patientER); + if (_amService.hasError) { + error = _amService.error; + setState(ViewState.ErrorLocal); + } else + getAmRequestOrders(); + + } +} diff --git a/lib/core/viewModels/er/near_hospital_view_model.dart b/lib/core/viewModels/er/near_hospital_view_model.dart new file mode 100644 index 00000000..f12aa28f --- /dev/null +++ b/lib/core/viewModels/er/near_hospital_view_model.dart @@ -0,0 +1,31 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/er/projectavgerwaitingtime.dart'; + +import 'package:diplomaticquarterapp/core/service/er/er_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; + +import '../../../locator.dart'; + +class NearHospitalViewModel extends BaseViewModel { + ErService _erService = locator(); + + List get ProjectAvgERWaitingTimeModeList => + _erService.projectAvgERWaitingTimeModelList; + + getProjectAvgERWaitingTimeOrders({int id, int projectID}) async { + setState(ViewState.Busy); + + if (id != null && projectID != null) { + await _erService.getProjectAvgERWaitingTimeOrders( + id: id, projectID: projectID); + } else { + await _erService.getProjectAvgERWaitingTimeOrders(); + } + if (_erService.hasError) { + error = _erService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/core/viewModels/feedback/feedback_view_model.dart b/lib/core/viewModels/feedback/feedback_view_model.dart new file mode 100644 index 00000000..6793c786 --- /dev/null +++ b/lib/core/viewModels/feedback/feedback_view_model.dart @@ -0,0 +1,73 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/feedback/COC_items.dart'; +import 'package:diplomaticquarterapp/core/service/feedback/feedback_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/cupertino.dart'; + +import '../../../locator.dart'; + +enum MessageType { + ComplaintOnAnAppointment, + ComplaintWithoutAppointment, + Question, + Compliment, + Suggestion, + NON +} + +class FeedbackViewModel extends BaseViewModel { + FeedbackService _feedbackService = locator(); + + List get cOCItemList => _feedbackService.cOCItemList; + + + List get appointHistoryList => + _feedbackService.appointHistoryList; + + Future sendCOCItem( + {String title, + String details, + String cOCTypeName, + String attachment, + AppointmentHistory appointHistory}) async { + setState(ViewState.BusyLocal); + await _feedbackService.sendCOCItem( + title: title, + details: details, + cOCTypeName: cOCTypeName, + attachment: attachment, + appointHistory: appointHistory); + if (_feedbackService.hasError) { + error = _feedbackService.error; + setState(ViewState.ErrorLocal); + return false; + } else { + setState(ViewState.Idle); + return true; + } + } + + getCOC() async { + setState(ViewState.Busy); + await _feedbackService.getStatusCOC(); + if (_feedbackService.hasError) { + error = _feedbackService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future getPatentAppointmentHistory() async { + setState(ViewState.Busy); + await _feedbackService.getPatentAppointmentHistory(); + if (_feedbackService.hasError) { + error = _feedbackService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/hospital_view_model.dart b/lib/core/viewModels/hospital_view_model.dart new file mode 100644 index 00000000..66ad4b01 --- /dev/null +++ b/lib/core/viewModels/hospital_view_model.dart @@ -0,0 +1,22 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/service/hospital_service.dart'; + +import '../../locator.dart'; +import 'base_view_model.dart'; + +class HospitalViewModel extends BaseViewModel { + HospitalService _hospitalService = locator(); + + List get hospitals => _hospitalService.hospitals; + + Future getHospitals() async { + setState(ViewState.Busy); + await _hospitalService.getHospitals(); + if (_hospitalService.hasError) { + error = _hospitalService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/core/viewModels/insurance_card_View_model.dart b/lib/core/viewModels/insurance_card_View_model.dart new file mode 100644 index 00000000..234db5d4 --- /dev/null +++ b/lib/core/viewModels/insurance_card_View_model.dart @@ -0,0 +1,85 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dart'; +import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart'; +import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update_model.dart'; +import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; + +import '../../locator.dart'; +import 'base_view_model.dart'; + +class InsuranceViewModel extends BaseViewModel { + bool hasError = false; + + InsuranceCardService _insuranceCardService = locator(); + + List get insurance => _insuranceCardService.cardList; + + List get insuranceUpdate => + _insuranceCardService.updatedCard; + + List get insuranceApproval => + _insuranceCardService.insuranceApproval; + + GetAllSharedRecordsByStatusResponse get getAllSharedRecordsByStatusResponse => + _insuranceCardService.getAllSharedRecordsByStatusResponse; + + Future getInsurance() async { + hasError = false; + _insuranceCardService.clearInsuranceCard(); + setState(ViewState.Busy); + await _insuranceCardService.getInsurance(); + if (_insuranceCardService.hasError) { + error = _insuranceCardService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future getInsuranceUpdated() async { + hasError = false; + //_insuranceCardService.clearInsuranceCard(); + setState(ViewState.Busy); + await _insuranceCardService.getInsuranceUpdate(); + if (_insuranceCardService.hasError) { + error = _insuranceCardService.error; + setState(ViewState.ErrorLocal); + } else + getFamilyFiles(); + } + + Future getInsuranceApproval({int appointmentNo}) async { + hasError = false; + //_insuranceCardService.clearInsuranceCard(); + setState(ViewState.Busy); + if (appointmentNo != null) + await _insuranceCardService.getInsuranceApproval( + appointmentNo: appointmentNo); + else + await _insuranceCardService.getInsuranceApproval(); + if (_insuranceCardService.hasError) { + error = _insuranceCardService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future getFamilyFiles() async { + await _insuranceCardService.getSharedRecordByStatus(); + if (_insuranceCardService.hasError) { + error = _insuranceCardService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + Future uploadInsuranceCard({String patientIdentificationID, int patientID,String image =""}) async { + setState(ViewState.BusyLocal); + await _insuranceCardService.uploadInsuranceCard(patientIdentificationID: patientIdentificationID,patientID: patientID,image: image); + if (_insuranceCardService.hasError) { + error = _insuranceCardService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + +} diff --git a/lib/core/viewModels/medical/ActiveMedicationsViewModel.dart b/lib/core/viewModels/medical/ActiveMedicationsViewModel.dart new file mode 100644 index 00000000..ee4f37c5 --- /dev/null +++ b/lib/core/viewModels/medical/ActiveMedicationsViewModel.dart @@ -0,0 +1,28 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/active_medications/ActivePrescriptionReport.dart'; +import 'package:diplomaticquarterapp/core/service/medical/ActiveMedicationsService.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; + +class ActiveMedicationsViewModel extends BaseViewModel { + ActiveMedicationsService _activeMedicationsService = + locator(); + + List get activePrescriptionReport => + _activeMedicationsService.activePrescriptionReport; + + getActiveMedication() async { + setState(ViewState.Busy); + await _activeMedicationsService.getActiveMedication(); + if (_activeMedicationsService.hasError) { + error = _activeMedicationsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + + + +} diff --git a/lib/core/viewModels/medical/AllergiesViewModel.dart b/lib/core/viewModels/medical/AllergiesViewModel.dart new file mode 100644 index 00000000..bc4666bc --- /dev/null +++ b/lib/core/viewModels/medical/AllergiesViewModel.dart @@ -0,0 +1,22 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/Allergy/Allergy.dart'; +import 'package:diplomaticquarterapp/core/service/medical/AllergiesService.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; + +import '../../../locator.dart'; + +class AllergiesViewModel extends BaseViewModel { + AllergiesService _allergiesService = locator(); + List get allergies => _allergiesService.allergies; + + getAllergies() async { + setState(ViewState.Busy); + await _allergiesService.getAllergies(); + if (_allergiesService.hasError) { + error = _allergiesService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/medical/EyeViewModel.dart b/lib/core/viewModels/medical/EyeViewModel.dart new file mode 100644 index 00000000..d6c3bf80 --- /dev/null +++ b/lib/core/viewModels/medical/EyeViewModel.dart @@ -0,0 +1,46 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; +import 'package:diplomaticquarterapp/core/model/eye/AppointmentFilter.dart'; +import 'package:diplomaticquarterapp/core/service/medical/EyeService.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; + +class EyeViewModel extends BaseViewModel { + EyeService _eyeService = locator(); + + List get appoimentAllHistoryResultList => + _eyeService.appoimentAllHistoryResultList; + + List appointmentFilter = List(); + + getEyeMeasurement() async { + setState(ViewState.Busy); + await _eyeService.getEyeMeasurement(); + if (_eyeService.hasError) { + error = _eyeService.error; + setState(ViewState.Error); + } else { + _eyeService.appoimentAllHistoryResultList.forEach((element) { + List _appointmentFilter = appointmentFilter + .where( + (elementFilter) => + elementFilter.filterName == element.projectName, + ) + .toList(); + + if (_appointmentFilter.length != 0) { + appointmentFilter[appointmentFilter.indexOf(_appointmentFilter[0])] + .appointmentAllHistoryResultList + .add(element); + } else { + appointmentFilter.add(AppointmentFilter( + element, + element.projectName, + )); + } + }); + + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/medical/ask_doctor_view_model.dart b/lib/core/viewModels/medical/ask_doctor_view_model.dart new file mode 100644 index 00000000..629df0a9 --- /dev/null +++ b/lib/core/viewModels/medical/ask_doctor_view_model.dart @@ -0,0 +1,110 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/ask_doctor/AskDoctorReqTypes.dart'; +import 'package:diplomaticquarterapp/core/model/ask_doctor/DoctorResponse.dart'; +import 'package:diplomaticquarterapp/core/service/medical/ask_doctor_services.dart'; +import 'package:diplomaticquarterapp/core/service/medical/my_doctor_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +class AskDoctorViewModel extends BaseViewModel { + AskDoctorService _askDoctorService = locator(); + MyDoctorService _myDoctorService = locator(); + + List patientDoctorAppointmentListHospital = + List(); + + List get askDoctorReqTypes => + _askDoctorService.askDoctorReqTypes; + + List get doctorResponseList => + _askDoctorService.doctorResponseList; + + Future getMyDoctor() async { + setState(ViewState.Busy); + await _myDoctorService.getPatientDoctorAppointmentList( + top: 25, beforeDays: 15); + if (_myDoctorService.hasError) { + error = _myDoctorService.error; + setState(ViewState.Error); + } else + var asd = ""; + _myDoctorService.patientDoctorAppointmentList.forEach((element) { + List doctorByClinic = + patientDoctorAppointmentListHospital + .where((elementClinic) => + elementClinic.filterName == element.projectName) + .toList(); + + if (doctorByClinic.length != 0) { + patientDoctorAppointmentListHospital[ + patientDoctorAppointmentListHospital.indexOf(doctorByClinic[0])] + .patientDoctorAppointmentList + .add(element); + } else { + patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList( + filterName: element.projectName, + patientDoctorAppointment: element)); + } + + setState(ViewState.Idle); + }); + } + + Future getCallRequestTypeLOVs() async { + setState(ViewState.Busy); + await _askDoctorService.getCallRequestTypeLOV(); + if (_askDoctorService.hasError) { + error = _askDoctorService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else + setState(ViewState.Idle); + } + + Future getCallInfoHoursResult({int projectId, int doctorId}) async { + setState(ViewState.Busy); + await _askDoctorService.getCallInfoHoursResult( + projectId: projectId, doctorId: doctorId); + if (_askDoctorService.hasError) { + error = _askDoctorService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + getDoctorResponse() async { + setState(ViewState.Busy); + await _askDoctorService.getDoctorResponse(); + if (_askDoctorService.hasError) { + error = _askDoctorService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future updateReadStatus({int transactionNo}) async { + setState(ViewState.Busy); + await _askDoctorService.updateReadStatus(transactionNo: transactionNo); + if (_askDoctorService.hasError) { + error = _askDoctorService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future sendRequestLOV( + {DoctorList doctorList, String requestType, String remark}) async { + setState(ViewState.BusyLocal); + await _askDoctorService.sendRequestLOV( + doctorList: doctorList, requestType: requestType, remark: remark); + if (_askDoctorService.hasError) { + error = _askDoctorService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/core/viewModels/medical/blood_pressure_view_model.dart b/lib/core/viewModels/medical/blood_pressure_view_model.dart new file mode 100644 index 00000000..dfff5b45 --- /dev/null +++ b/lib/core/viewModels/medical/blood_pressure_view_model.dart @@ -0,0 +1,151 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; +import 'package:diplomaticquarterapp/core/service/medical/BloodPressureService.dart'; +import 'package:diplomaticquarterapp/core/service/medical/BloodSugarService.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:charts_flutter/flutter.dart' as charts; + +import '../../../core/viewModels/base_view_model.dart'; + +class BloodPressureViewMode extends BaseViewModel { + BloodPressureService bloodPressureService = locator(); + + ///BLOOD + List _bloodDiastolicPressureWeeklyTimeSeriesSalesList = List(); + List _bloodSystolicePressureWeeklyTimeSeriesSalesList = List(); + + List _bloodDiastolicMonthlyTimeSeriesSalesList = List(); + List _bloodSystolicMonthlyTimeSeriesSalesList = List(); + + List _bloodSystoliceYearTimeSeriesSalesList = List(); + List _bloodDiastolicYearTimeSeriesSalesList = List(); + + List get monthDiabtecPatientResult => bloodPressureService.monthDiabtecPatientResult; + + List get weekDiabtecPatientResult => bloodPressureService.weekDiabtecPatientResult; + + List get yearDiabtecPatientResult => bloodPressureService.yearDiabtecPatientResult; + + Future getBloodPressure() async { + setState(ViewState.Busy); + await bloodPressureService.getBloodSugar(); + await bloodPressureService.getDiabtecResults(); + if (bloodPressureService.hasError) { + error = bloodPressureService.error; + setState(ViewState.Error); + } else { + bloodPressureService.weekDiabtectResultAverageList.forEach((element) { + _bloodDiastolicPressureWeeklyTimeSeriesSalesList.add(WeekChartDate( + x: element.bloodPressureDate, + y: element.dailyDiastolicPressureAverageResult)); + _bloodSystolicePressureWeeklyTimeSeriesSalesList.add(WeekChartDate( + x: element.bloodPressureDate, + y: element.dailySystolicePressureAverageResult)); + }); + + for (int index = 0; + index < bloodPressureService.monthDiabtectResultAverageList.length; + index++) { + _bloodDiastolicMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate( + x: index, + y: bloodPressureService.monthDiabtectResultAverageList[index] + .weekDiastolicPressureAverageResult)); + _bloodSystolicMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate( + x: index, + y: bloodPressureService.monthDiabtectResultAverageList[index] + .weekSystolicePressureAverageResult)); + } + + bloodPressureService.yearDiabtecResultAverageList.forEach((element) { + _bloodSystoliceYearTimeSeriesSalesList + .add(WeekChartDate(x: element.date, y: element.monthSystolicePressureAverageResult)); + + _bloodDiastolicYearTimeSeriesSalesList + .add(WeekChartDate(x: element.date, y: element.monthDiastolicPressureAverageResult)); + }); + + setState(ViewState.Idle); + } + } + + List> getBloodWeeklySeries() { + return [ + charts.Series( + id: 'Diastolic', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _bloodDiastolicPressureWeeklyTimeSeriesSalesList, + ), + charts.Series( + id: 'Systolice', + colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _bloodSystolicePressureWeeklyTimeSeriesSalesList, + ) + ]; + } + + List> + getBloodMonthlyTimeSeriesSales() { + return [ + charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (YearMonthlyChartDate sales, _) => sales.x, + measureFn: (YearMonthlyChartDate sales, _) => sales.y, + data: _bloodDiastolicMonthlyTimeSeriesSalesList, + ), + charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, + domainFn: (YearMonthlyChartDate sales, _) => sales.x, + measureFn: (YearMonthlyChartDate sales, _) => sales.y, + data: _bloodSystolicMonthlyTimeSeriesSalesList, + ), + ]; + } + + List> getBloodYearTimeSeriesSales() { + return [ + charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _bloodSystoliceYearTimeSeriesSalesList, + ), + charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _bloodDiastolicYearTimeSeriesSalesList, + ) + ]; + } + + addDiabtecResult( + {String bloodPressureDate, + String diastolicPressure, + String systolicePressure, + int measuredArm}) async { + setState(ViewState.BusyLocal); + await bloodPressureService.addDiabtecResult( + bloodPressureDate: bloodPressureDate, + diastolicPressure: diastolicPressure, + systolicePressure: systolicePressure, + measuredArm: measuredArm); + if (bloodPressureService.hasError) { + error = bloodPressureService.error; + setState(ViewState.Error); + } else { + await getBloodPressure(); + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/medical/blood_sugar_view_model.dart b/lib/core/viewModels/medical/blood_sugar_view_model.dart new file mode 100644 index 00000000..fb00f80e --- /dev/null +++ b/lib/core/viewModels/medical/blood_sugar_view_model.dart @@ -0,0 +1,119 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; +import 'package:diplomaticquarterapp/core/service/medical/BloodSugarService.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:charts_flutter/flutter.dart' as charts; + +import '../../../core/viewModels/base_view_model.dart'; + +class BloodSugarViewMode extends BaseViewModel { + BloodSugarService bloodSugarService = locator(); + + ///BLOOD + List _bloodWeeklyTimeSeriesSalesList = List(); + List _bloodMonthlyTimeSeriesSalesList = List(); + List _bloodYearTimeSeriesSalesList = List(); + + List get monthDiabtecPatientResult => + bloodSugarService.monthDiabtecPatientResult; + + List get weekDiabtecPatientResult => + bloodSugarService.weekDiabtecPatientResult; + + List get yearDiabtecPatientResult => + bloodSugarService.yearDiabtecPatientResult; + + Future getBloodSugar() async { + setState(ViewState.Busy); + await bloodSugarService.getBloodSugar(); + await bloodSugarService.getDiabtecResults(); + if (bloodSugarService.hasError) { + error = bloodSugarService.error; + setState(ViewState.Error); + } else { + bloodSugarService.weekDiabtectResultAverageList.forEach((element) { + _bloodWeeklyTimeSeriesSalesList.add( + WeekChartDate(x: element.dateChart, y: element.dailyAverageResult)); + }); + + for (int index = 0; + index < bloodSugarService.monthDiabtectResultAverageList.length; + index++) { + _bloodMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate( + x: index, + y: bloodSugarService + .monthDiabtectResultAverageList[index].weekAverageResult)); + var asd=""; + } + + bloodSugarService.yearDiabtecResultAverageList.forEach((element) { + _bloodYearTimeSeriesSalesList + .add(WeekChartDate(x: element.date, y: element.monthAverageResult)); + }); + + setState(ViewState.Idle); + } + } + + List> getBloodWeeklySeries() { + return [ + new charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _bloodWeeklyTimeSeriesSalesList, + ) + ]; + } + + List> + getBloodMonthlyTimeSeriesSales() { + return [ + new charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (YearMonthlyChartDate sales, _) => sales.x, + measureFn: (YearMonthlyChartDate sales, _) => sales.y, + data: _bloodMonthlyTimeSeriesSalesList, + ) + ]; + } + + List> getBloodYearTimeSeriesSales() { + return [ + new charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _bloodYearTimeSeriesSalesList, + ) + ]; + } + + addDiabtecResult( + {String bloodSugerDateChart, + String bloodSugerResult, + String diabtecUnit, + int measuredTime}) async { + setState(ViewState.BusyLocal); + await bloodSugarService.addDiabtecResult( + bloodSugerDateChart: bloodSugerDateChart, + bloodSugerResult: bloodSugerResult , + diabtecUnit: diabtecUnit, + measuredTime: measuredTime); + if (bloodSugarService.hasError) { + error = bloodSugarService.error; + setState(ViewState.Error); + } else { + await getBloodSugar(); + setState(ViewState.Idle); + } + } + + + +} diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart new file mode 100644 index 00000000..9e3f09e5 --- /dev/null +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -0,0 +1,163 @@ +import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart'; +import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; +import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; +import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; +import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +import '../../../locator.dart'; +import '../base_view_model.dart'; + +class LabsViewModel extends BaseViewModel { + FilterType filterType = FilterType.Clinic; + LabsService _labsService = locator(); + + List get labOrdersResultsList => _labsService.labOrdersResultsList; + + + List _patientLabOrdersListClinic = List(); + List _patientLabOrdersListHospital = List(); + + List get patientLabOrdersList => + filterType == FilterType.Clinic + ? _patientLabOrdersListClinic + : _patientLabOrdersListHospital; + + void getLabs() async { + if (authenticatedUserObject.isLogin) { + setState(ViewState.Busy); + await _labsService.getPatientLabOrdersList(); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + _labsService.patientLabOrdersList.forEach((element) { + List patientLabOrdersClinic = + _patientLabOrdersListClinic + .where((elementClinic) => + elementClinic.filterName == element.clinicDescription) + .toList(); + + if (patientLabOrdersClinic.length != 0) { + _patientLabOrdersListClinic[_patientLabOrdersListClinic + .indexOf(patientLabOrdersClinic[0])] + .patientLabOrdersList + .add(element); + } else { + _patientLabOrdersListClinic.add(PatientLabOrdersList( + filterName: element.clinicDescription, + patientDoctorAppointment: element)); + } + + // doctor list sort via project + List patientLabOrdersHospital = + _patientLabOrdersListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (patientLabOrdersHospital.length != 0) { + _patientLabOrdersListHospital[_patientLabOrdersListHospital + .indexOf(patientLabOrdersHospital[0])] + .patientLabOrdersList + .add(element); + } else { + _patientLabOrdersListHospital.add(PatientLabOrdersList( + filterName: element.projectName, + patientDoctorAppointment: element)); + } + }); + + setState(ViewState.Idle); + } + } + } + + setFilterType(FilterType filterType) { + this.filterType = filterType; + notifyListeners(); + } + + List get patientLabSpecialResult => + _labsService.patientLabSpecialResult; + + List get labResultList => _labsService.labResultList; + + List labResultLists = List(); + + getLaboratoryResult( + {String projectID, + int clinicID, + String invoiceNo, + String orderNo}) async { + setState(ViewState.Busy); + await _labsService.getLaboratoryResult( + invoiceNo: invoiceNo, + orderNo: orderNo, + projectID: projectID, + clinicID: clinicID); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + getPatientLabResult({PatientLabOrders patientLabOrder}) async { + setState(ViewState.Busy); + await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + _labsService.labResultList.forEach((element) { + List patientLabOrdersClinic = labResultLists.where((elementClinic) => elementClinic.filterName == element.testCode).toList(); + + if (patientLabOrdersClinic.length != 0) { + + var value= labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList + .where((e) => e.sampleCollectedOn== element.sampleCollectedOn && e.resultValue ==element.resultValue ).toList(); + if(value.isEmpty) + labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList.add(element); + } else { + labResultLists.add(LabResultList(filterName: element.testCode, lab: element)); + } + }); + setState(ViewState.Idle); + } + } + + + getPatientLabOrdersResults({PatientLabOrders patientLabOrder,String procedure}) async { + setState(ViewState.Busy); + await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder,procedure: procedure); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + bool isShouldClear = false; + if(_labsService.labOrdersResultsList.length==1) + { + labOrdersResultsList.forEach((element) { + if(element.resultValue.contains('/') ||element.resultValue.contains('*' )|| element.resultValue.isEmpty ) + isShouldClear = true; + });} + if(isShouldClear) + _labsService.labOrdersResultsList.clear(); + setState(ViewState.Idle); + } + } + + sendLabReportEmail({PatientLabOrders patientLabOrder,String mes}) async { + await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); + if (_labsService.hasError) { + error = _labsService.error; + }else + AppToast.showSuccessToast(message: mes); + } +} diff --git a/lib/core/viewModels/medical/medical_view_model.dart b/lib/core/viewModels/medical/medical_view_model.dart new file mode 100644 index 00000000..52fd221a --- /dev/null +++ b/lib/core/viewModels/medical/medical_view_model.dart @@ -0,0 +1,25 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/service/medical/medical_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; + +class MedicalViewModel extends BaseViewModel { + MedicalService _medicalService = locator(); + + List get appoitmentAllHistoryResultList => + _medicalService.appoitmentAllHistoryResultList; + + getAppointmentHistory() async { + if (authenticatedUserObject.isLogin) { + setState(ViewState.Busy); + await _medicalService.getAppointmentHistory(); + if (_medicalService.hasError) { + error = _medicalService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/medical/my_balance_view_model.dart b/lib/core/viewModels/medical/my_balance_view_model.dart new file mode 100644 index 00000000..f9554d94 --- /dev/null +++ b/lib/core/viewModels/medical/my_balance_view_model.dart @@ -0,0 +1,162 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart'; +import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart'; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_advance_balance_amount.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; +import 'package:diplomaticquarterapp/core/service/blood/blood_details_servies.dart'; +import 'package:diplomaticquarterapp/core/service/blood/blood_donation_service.dart'; +import 'package:diplomaticquarterapp/core/service/hospital_service.dart'; +import 'package:diplomaticquarterapp/core/service/medical/my_balance_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +class MyBalanceViewModel extends BaseViewModel { + MyBalanceService _myBalanceService = locator(); + + HospitalService _hospitalService = locator(); + + List get hospitals => _hospitalService.hospitals; + + List get patientAdvanceBalanceAmountList => + _myBalanceService.patientAdvanceBalanceAmountList; + + //======================== + BloodDonationService _bloodDonationService = locator(); + + List get CitiesModelList => + _bloodDonationService.CitiesModelList; + BloodDetailsService _bloodDetailsService = locator(); + + List get BloodDetailsModelList => + _bloodDetailsService + .BloodModelList; //_bloodDonationService.CitiesModelList; + + //=========================== + + double get totalAdvanceBalanceAmount => + _myBalanceService.totalAdvanceBalanceAmount; + + GetAllSharedRecordsByStatusResponse get getAllSharedRecordsByStatusResponse => + _myBalanceService.getAllSharedRecordsByStatusResponse; + + List get patientInfoList => _myBalanceService.patientInfoList; + + PatientInfoAndMobileNumber get patientInfoAndMobileNumber => + _myBalanceService.patientInfoAndMobileNumber; + + String get logInTokenID => _myBalanceService.logInTokenID; + + String get verificationCode => _myBalanceService.verificationCode; + + getPatientAdvanceBalanceAmount() async { + setState(ViewState.Busy); + await _myBalanceService.getPatientAdvanceBalanceAmount(); + if (_myBalanceService.hasError) { + error = _myBalanceService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future getHospitals() async { + setState(ViewState.Busy); + await _hospitalService.getHospitals(); + if (_hospitalService.hasError) { + error = _hospitalService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + + Future getCities() async { + setState(ViewState.Busy); + await _bloodDonationService.getAllCitiesOrders(); + if (_bloodDonationService.hasError) { + error = _bloodDonationService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future getBlood() async { + setState(ViewState.Busy); + await _bloodDetailsService.getAllBloodOrders(); + if (_bloodDetailsService.hasError) { + error = _bloodDetailsService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + + Future getPatientInfoByPatientID({String id}) async { + setState(ViewState.Busy); + await _myBalanceService.getPatientInfoByPatientID(id: id); + if (_myBalanceService.hasError) { + error = _myBalanceService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else { + setState(ViewState.Idle); + } + } + + Future getPatientInfoByPatientIDAndMobileNumber(AdvanceModel advanceModel) async { + setState(ViewState.Busy); + await _myBalanceService + .getPatientInfoByPatientIDAndMobileNumber(advanceModel); + if (_myBalanceService.hasError) { + error = _myBalanceService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else { + setState(ViewState.Idle); + } + } + + Future sendActivationCodeForAdvancePayment( + {int patientID, int projectID}) async { + setState(ViewState.Busy); + await _myBalanceService.sendActivationCodeForAdvancePayment( + patientID: patientID, projectID: projectID); + if (_myBalanceService.hasError) { + error = _myBalanceService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else { + setState(ViewState.Idle); + } + } + + Future checkActivationCodeForAdvancePayment( + {String activationCode, String patientMobileNumber}) async { + setState(ViewState.Busy); + await _myBalanceService.checkActivationCodeForAdvancePayment( + activationCode: activationCode); + if (_myBalanceService.hasError) { + error = _myBalanceService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + Future getFamilyFiles() async { + setState(ViewState.Busy); + await _myBalanceService.getFamilyFiles(); + if (_myBalanceService.hasError) { + error = _myBalanceService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else { + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/medical/my_doctor_view_model.dart b/lib/core/viewModels/medical/my_doctor_view_model.dart new file mode 100644 index 00000000..266157ff --- /dev/null +++ b/lib/core/viewModels/medical/my_doctor_view_model.dart @@ -0,0 +1,98 @@ +import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/doctor/doctor_profile.dart'; +import 'package:diplomaticquarterapp/core/model/doctor/doctor_rating.dart'; +import 'package:diplomaticquarterapp/core/service/medical/my_doctor_service.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; + +import '../../../locator.dart'; +import '../base_view_model.dart'; + +class MyDoctorViewModel extends BaseViewModel { + FilterType filterType = FilterType.Clinic; + MyDoctorService _myDoctorService = locator(); + + List _patientDoctorAppointmentListClinic = + List(); + List _patientDoctorAppointmentListHospital = + List(); + + List get patientDoctorAppointmentList => + filterType == FilterType.Clinic + ? _patientDoctorAppointmentListClinic + : _patientDoctorAppointmentListHospital; + + DoctorList get doctorList=> _myDoctorService.doctorList; + + + DoctorProfile get doctorProfile => _myDoctorService.doctorProfile; + DoctorRating get doctorRating => _myDoctorService.doctorRating; + + void getMyDoctor() async { + setState(ViewState.Busy); + await _myDoctorService.getPatientDoctorAppointmentList(); + if (_myDoctorService.hasError) { + error = _myDoctorService.error; + setState(ViewState.Error); + } else { + _myDoctorService.patientDoctorAppointmentList.forEach((element) { + List doctorByClinic = + _patientDoctorAppointmentListClinic + .where((elementClinic) => + elementClinic.filterName == element.clinicName) + .toList(); + + if (doctorByClinic.length != 0) { + _patientDoctorAppointmentListClinic[ + _patientDoctorAppointmentListClinic + .indexOf(doctorByClinic[0])] + .patientDoctorAppointmentList + .add(element); + } else { + _patientDoctorAppointmentListClinic.add(PatientDoctorAppointmentList( + filterName: element.clinicName, + patientDoctorAppointment: element)); + } + + // doctor list sort via project + List doctorByHospital = + _patientDoctorAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + _patientDoctorAppointmentListHospital.add( + PatientDoctorAppointmentList( + filterName: element.projectName, + patientDoctorAppointment: element)); + } + }); + + setState(ViewState.Idle); + } + } + + setFilterType(FilterType filterType) { + this.filterType = filterType; + notifyListeners(); + } + + Future getDoctorProfileAndRating({int doctorId,int clinicID,int projectID }) async { + setState(ViewState.Busy); + await _myDoctorService.getDoctorProfileAndRating(doctorId: doctorId,clinicID: clinicID,projectID: projectID); + if (_myDoctorService.hasError) { + error = _myDoctorService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + +} diff --git a/lib/core/viewModels/medical/patient_sick_leave_view_model.dart b/lib/core/viewModels/medical/patient_sick_leave_view_model.dart new file mode 100644 index 00000000..6addf833 --- /dev/null +++ b/lib/core/viewModels/medical/patient_sick_leave_view_model.dart @@ -0,0 +1,42 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/sick_leave/sick_leave.dart'; +import 'package:diplomaticquarterapp/core/service/medical/PatientSickLeaveService.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +class PatientSickLeaveViewMode extends BaseViewModel { + PatientSickLeaveService _patientSickLeaveService = + locator(); + + List get sickLeaveList => _patientSickLeaveService.sickLeaveList; + + getSickLeave() async { + setState(ViewState.Busy); + await _patientSickLeaveService.getSickLeave(); + if (_patientSickLeaveService.hasError) { + error = _patientSickLeaveService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future sendSickLeaveEmail( + {String message, + int requestNo, + String projectName, + String doctorName,int projectID,String setupID}) async { + setState(ViewState.Busy); + await _patientSickLeaveService.sendSickLeaveEmail( + requestNo: requestNo, projectName: projectName, doctorName: doctorName,projectID: projectID,setupID: setupID); + if (_patientSickLeaveService.hasError) { + error = _patientSickLeaveService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else { + AppToast.showSuccessToast(message: message); + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/medical/prescriptions_view_model.dart b/lib/core/viewModels/medical/prescriptions_view_model.dart new file mode 100644 index 00000000..2c32a081 --- /dev/null +++ b/lib/core/viewModels/medical/prescriptions_view_model.dart @@ -0,0 +1,174 @@ +import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart'; +import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; +import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; +import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:flutter/cupertino.dart'; + +import '../../../core/enum/filter_type.dart'; +import '../../../core/enum/viewstate.dart'; +import '../../../core/model/prescriptions/Prescriptions.dart'; +import '../../../core/service/medical/prescriptions_service.dart'; +import '../../../locator.dart'; +import '../base_view_model.dart'; + +class PrescriptionsViewModel extends BaseViewModel { + FilterType filterType = FilterType.Clinic; + PrescriptionsService _prescriptionsService = locator(); + + List _prescriptionsOrderListClinic = List(); + List _prescriptionsOrderListHospital = List(); + + + List get prescriptionReportList => + _prescriptionsService.prescriptionReportList; + + List get prescriptionsList => + _prescriptionsService.prescriptionsList; + + List get prescriptionsHistory => _prescriptionsService.prescriptionsOrderList; + + List get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList ; + + + List get prescriptionsOrderList => + filterType == FilterType.Clinic + ? _prescriptionsOrderListClinic + : _prescriptionsOrderListHospital; + + getPrescriptions() async { + setState(ViewState.Busy); + await _prescriptionsService.getPrescriptions(); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.Error); + } else { + _filterList(); + await _getPrescriptionsOrders(); + setState(ViewState.Idle); + } + } + + void _filterList() { + _prescriptionsService.prescriptionsList.forEach((element) { + /// PrescriptionsList list sort clinic + List prescriptionsByClinic = + _prescriptionsOrderListClinic + .where((elementClinic) => + elementClinic.filterName == element.clinicDescription) + .toList(); + + if (prescriptionsByClinic.length != 0) { + _prescriptionsOrderListClinic[ + _prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])] + .prescriptionsList + .add(element); + } else { + _prescriptionsOrderListClinic.add(PrescriptionsList( + filterName: element.clinicDescription, prescriptions: element)); + } + + /// PrescriptionsList list sort via hospital + List prescriptionsByHospital = + _prescriptionsOrderListHospital + .where( + (elementClinic) => elementClinic.filterName == element.name, + ) + .toList(); + + if (prescriptionsByHospital.length != 0) { + _prescriptionsOrderListHospital[_prescriptionsOrderListHospital + .indexOf(prescriptionsByHospital[0])] + .prescriptionsList + .add(element); + } else { + _prescriptionsOrderListHospital.add(PrescriptionsList( + filterName: element.name, prescriptions: element)); + } + }); + } + + _getPrescriptionsOrders() async { + await _prescriptionsService.getPrescriptionsOrders(); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + setFilterType(FilterType filterType) { + this.filterType = filterType; + notifyListeners(); + } + + getPrescriptionReport({Prescriptions prescriptions}) async { + setState(ViewState.Busy); + await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + sendPrescriptionEmail( + {String appointmentDate, + int patientID, + String clinicName, + String doctorName, + String mes, + int projectID}) async { + setState(ViewState.BusyLocal); + await _prescriptionsService.sendPrescriptionEmail( + appointmentDate, patientID, clinicName, doctorName, projectID); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else { + AppToast.showSuccessToast(message: mes); + setState(ViewState.Idle); + } + } + + getListPharmacyForPrescriptions({int itemId}) async { + setState(ViewState.Busy); + await _prescriptionsService.getListPharmacyForPrescriptions(itemId: itemId); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + + List get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList; + + getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async { + setState(ViewState.Busy); + await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + + Future updatePressOrder({@required int presOrderID}) async { + setState(ViewState.Busy); + await _prescriptionsService.updatePressOrder(presOrderID: presOrderID); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.Error); + } else { + await getPrescriptions(); + } + } + +} diff --git a/lib/core/viewModels/medical/radiology_view_model.dart b/lib/core/viewModels/medical/radiology_view_model.dart new file mode 100644 index 00000000..076707dc --- /dev/null +++ b/lib/core/viewModels/medical/radiology_view_model.dart @@ -0,0 +1,101 @@ +import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; +import 'package:diplomaticquarterapp/core/service/medical/radiology_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +import '../../../locator.dart'; +import '../base_view_model.dart'; + +class RadiologyViewModel extends BaseViewModel { + FilterType filterType = FilterType.Clinic; + RadiologyService _radiologyService = locator(); + + List _finalRadiologyListClinic = List(); + List _finalRadiologyListHospital = List(); + + List get finalRadiologyList => + filterType == FilterType.Clinic + ? _finalRadiologyListClinic + : _finalRadiologyListHospital; + + void getPatientRadOrders() async { + setState(ViewState.Busy); + await _radiologyService.getPatientRadOrders(); + if (_radiologyService.hasError) { + error = _radiologyService.error; + setState(ViewState.Error); + } else { + _radiologyService.finalRadiologyList.forEach((element) { + List finalRadiologyListClinic = + _finalRadiologyListClinic + .where((elementClinic) => + elementClinic.filterName == element.clinicDescription) + .toList(); + + if (finalRadiologyListClinic.length != 0) { + _finalRadiologyListClinic[ + finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])] + .finalRadiologyList + .add(element); + } else { + _finalRadiologyListClinic.add(FinalRadiologyList( + filterName: element.clinicDescription, finalRadiology: element)); + } + + // FinalRadiologyList list sort via project + List finalRadiologyListHospital = + _finalRadiologyListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (finalRadiologyListHospital.length != 0) { + _finalRadiologyListHospital[finalRadiologyListHospital + .indexOf(finalRadiologyListHospital[0])] + .finalRadiologyList + .add(element); + } else { + _finalRadiologyListHospital.add(FinalRadiologyList( + filterName: element.projectName, finalRadiology: element)); + } + }); + + setState(ViewState.Idle); + } + } + + String get radImageURL => _radiologyService.url; + + getRadImageURL({int invoiceNo, int lineItem,int projectId}) async { + setState(ViewState.Busy); + await _radiologyService.getRadImageURL(invoiceNo: invoiceNo,lineItem: lineItem,projectId: projectId); + if (_radiologyService.hasError) { + error = _radiologyService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + sendRadReportEmail( + {FinalRadiology finalRadiology,String mes}) async { + setState(ViewState.BusyLocal); + await _radiologyService.sendRadReportEmail( + finalRadiology: finalRadiology + ); + if (_radiologyService.hasError) { + error = _radiologyService.error; + AppToast.showErrorToast(message: error); + } else { + AppToast.showSuccessToast(message: mes); + } + setState(ViewState.Idle); + } + + setFilterType(FilterType filterType) { + this.filterType = filterType; + notifyListeners(); + } +} diff --git a/lib/core/viewModels/medical/reports_monthly_view_model.dart b/lib/core/viewModels/medical/reports_monthly_view_model.dart new file mode 100644 index 00000000..3ae196f5 --- /dev/null +++ b/lib/core/viewModels/medical/reports_monthly_view_model.dart @@ -0,0 +1,46 @@ +import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +import '../../../core/enum/reportfilter_type.dart'; +import '../../../core/enum/viewstate.dart'; +import '../../../core/model/reports/Reports.dart'; +import '../../../core/service/medical/reports_service.dart'; +import '../../../locator.dart'; +import '../base_view_model.dart'; + +class ReportsMonthlyViewModel extends BaseViewModel { + ReportFilterType filterType = ReportFilterType.Requested; + + ReportsService _reportsService = locator(); + + + + String get userAgreementContent => _reportsService.userAgreementContent; + + getUserTermsAndConditions() async{ + setState(ViewState.Busy); + await _reportsService.getUserTermsAndConditions(); + if (_reportsService.hasError) { + error = _reportsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + updatePatientHealthSummaryReport({String message, bool isSummary})async{ + setState(ViewState.BusyLocal); + await _reportsService.updatePatientHealthSummaryReport(isSummary: isSummary); + if (_reportsService.hasError) { + error = _reportsService.error; + AppToast.showErrorToast(message: error); + setState(ViewState.ErrorLocal); + } else { + AppToast.showSuccessToast(message: message); + setState(ViewState.Idle); + } + } + + + +} diff --git a/lib/core/viewModels/medical/reports_view_model.dart b/lib/core/viewModels/medical/reports_view_model.dart new file mode 100644 index 00000000..271b5463 --- /dev/null +++ b/lib/core/viewModels/medical/reports_view_model.dart @@ -0,0 +1,84 @@ +import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +import '../../../core/enum/reportfilter_type.dart'; +import '../../../core/enum/viewstate.dart'; +import '../../../core/model/reports/Reports.dart'; +import '../../../core/service/medical/reports_service.dart'; +import '../../../locator.dart'; +import '../base_view_model.dart'; + +class ReportsViewModel extends BaseViewModel { + ReportFilterType filterType = ReportFilterType.Requested; + + ReportsService _reportsService = locator(); + + List reportsOrderRequestList = List(); + List reportsOrderReadyList = List(); + List reportsOrderCompletedList = List(); + List reportsOrderCanceledList = List(); + + List get appointHistoryList => + _reportsService.appointHistoryList; + + getReports() async { + setState(ViewState.Busy); + reportsOrderRequestList.clear(); + reportsOrderReadyList.clear(); + reportsOrderCompletedList.clear(); + reportsOrderCanceledList.clear(); + await _reportsService.getReports(); + if (_reportsService.hasError) { + error = _reportsService.error; + setState(ViewState.Error); + } else { + _filterList(); + setState(ViewState.Idle); + } + } + + getPatentAppointmentHistory() async { + setState(ViewState.Busy); + await _reportsService.getPatentAppointmentHistory(); + if (_reportsService.hasError) { + error = _reportsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + void _filterList() { + _reportsService.reportsList.forEach((report) { + switch (report.status) { + case 1: + reportsOrderRequestList.add(report); + break; + case 2: + reportsOrderReadyList.add(report); + break; + case 3: + reportsOrderCompletedList.add(report); + break; + case 4: + reportsOrderCanceledList.add(report); + break; + default: + } + }); + } + + + insertRequestForMedicalReport(AppointmentHistory appointmentHistory,String mes)async{ + setState(ViewState.Busy); + await _reportsService.insertRequestForMedicalReport(appointmentHistory); + if (_reportsService.hasError) { + error = _reportsService.error; + AppToast.showErrorToast(message: error); + setState(ViewState.ErrorLocal); + } else { + AppToast.showSuccessToast(message: mes); + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/medical/vital_sign_view_model.dart b/lib/core/viewModels/medical/vital_sign_view_model.dart new file mode 100644 index 00000000..b2110187 --- /dev/null +++ b/lib/core/viewModels/medical/vital_sign_view_model.dart @@ -0,0 +1,71 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; +import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; + +import '../../../locator.dart'; + +class VitalSignViewModel extends BaseViewModel { + VitalSignService _vitalSignService = locator(); + + List get vitalSignResModelList => + _vitalSignService.vitalSignResModelList; + + String heightCm = "0"; + String weightKg = "0"; + String bodyMax = "0"; + String temperatureCelcius = "0"; + String hartRat = "0"; + String respirationBeatPerMinute = "0"; + String bloodPressure = "0 / 0"; + + getPatientVitalSign({int appointmentNo, int projectID}) async { + setState(ViewState.Busy); + + if (appointmentNo != null && projectID != null) { + await _vitalSignService.getPatientRadOrders( + appointmentNo: appointmentNo, projectID: projectID); + } else { + await _vitalSignService.getPatientRadOrders(); + } + if (_vitalSignService.hasError) { + error = _vitalSignService.error; + setState(ViewState.Error); + } else { + _vitalSignService.vitalSignResModelList.forEach((element) { + if (heightCm == "0" || heightCm == null || heightCm == 'null') { + heightCm = element.heightCm.toString(); + } + if (weightKg == "0" || weightKg == null || weightKg == 'null') { + weightKg = element.weightKg.toString(); + } + if (bodyMax == "0" || + bodyMax == null || + bodyMax == 'null') { + bodyMax = element.bodyMassIndex.toString(); + } + if (temperatureCelcius == "0" || + temperatureCelcius == null || + temperatureCelcius == 'null') { + temperatureCelcius = element.temperatureCelcius.toString(); + } + if (hartRat == "0" || hartRat == null || hartRat == 'null') { + hartRat = element.pulseBeatPerMinute.toString(); + } + if (respirationBeatPerMinute == "0" || + respirationBeatPerMinute == null || + respirationBeatPerMinute == 'null') { + respirationBeatPerMinute = + element.respirationBeatPerMinute.toString(); + } + if (bloodPressure == "0 / 0" || + bloodPressure == null || + bloodPressure == 'null') { + bloodPressure = element.bloodPressure.toString(); + } + }); + + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/medical/weight_pressure_view_model.dart b/lib/core/viewModels/medical/weight_pressure_view_model.dart new file mode 100644 index 00000000..29095895 --- /dev/null +++ b/lib/core/viewModels/medical/weight_pressure_view_model.dart @@ -0,0 +1,113 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart'; +import 'package:diplomaticquarterapp/core/service/medical/BloodPressureService.dart'; +import 'package:diplomaticquarterapp/core/service/medical/BloodSugarService.dart'; +import 'package:diplomaticquarterapp/core/service/medical/WeightPressureService.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:charts_flutter/flutter.dart' as charts; + +import '../../../core/viewModels/base_view_model.dart'; + +class WeightPressureViewMode extends BaseViewModel { + WeightService weightService = locator(); + + List _weightWeeklyTimeSeriesSalesList = List(); + List _weightMonthlyTimeSeriesSalesList = List(); + List _weightYearTimeSeriesSalesList = List(); + + List get monthWeightMeasurementResult => + weightService.monthWeightMeasurementResult; + + List get weekWeightMeasurementResult => + weightService.weekWeightMeasurementResult; + + List get yearWeightMeasurementResult => + weightService.yearWeightMeasurementResult; + + Future getWeight() async { + setState(ViewState.Busy); + await weightService.getWeightAverage(); + await weightService.getWeightMeasurementResult(); + if (weightService.hasError) { + error = weightService.error; + setState(ViewState.Error); + } else { + weightService.weekWeightMeasurementResultAverage.forEach((element) { + _weightWeeklyTimeSeriesSalesList.add(WeekChartDate( + x: element.weightDate, y: element.dailyAverageResult)); + }); + + for (int index = 0; + index < weightService.monthWeightMeasurementResultAverage.length; + index++) { + _weightMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate( + x: index, + y: weightService.monthWeightMeasurementResultAverage[index].weekAverageResult)); + } + + weightService.yearWeightMeasurementResultAverage.forEach((element) { + _weightYearTimeSeriesSalesList + .add(WeekChartDate(x: element.date, y: element.monthAverageResult)); + }); + + setState(ViewState.Idle); + } + } + + List> getWeightWeeklySeries() { + return [ + charts.Series( + id: 'Diastolic', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _weightWeeklyTimeSeriesSalesList, + ), + ]; + } + + List> + getWeightMonthlyTimeSeriesSales() { + return [ + charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (YearMonthlyChartDate sales, _) => sales.x, + measureFn: (YearMonthlyChartDate sales, _) => sales.y, + data: _weightMonthlyTimeSeriesSalesList, + ), + ]; + } + + List> getWeightYearTimeSeriesSales() { + return [ + charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _weightYearTimeSeriesSalesList, + ), + ]; + } + + addWeightResult( + {String weightDate, String weightMeasured, int weightUnit}) async { + setState(ViewState.BusyLocal); + await weightService.addWeightResult( + weightDate: weightDate, + weightMeasured: weightMeasured, + weightUnit: weightUnit,); + if (weightService.hasError) { + error = weightService.error; + setState(ViewState.Error); + } else { + await getWeight(); + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/notifications_view_model.dart b/lib/core/viewModels/notifications_view_model.dart new file mode 100644 index 00000000..ac09e3b2 --- /dev/null +++ b/lib/core/viewModels/notifications_view_model.dart @@ -0,0 +1,40 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/notifications/mark_message_as_read_request_model.dart'; +import 'package:diplomaticquarterapp/core/service/notifications_service.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:flutter/material.dart'; + +import '../../locator.dart'; +import 'base_view_model.dart'; + +class NotificationViewModel extends BaseViewModel { + NotificationService _notificationService = locator(); + + List get notifications => + _notificationService.notificationsList; + + Future getNotifications( + GetNotificationsRequestModel getNotificationsRequestModel, BuildContext context) async { + if(getNotificationsRequestModel.currentPage == 0) + setState(ViewState.Busy); + + await _notificationService + .getAllNotifications(getNotificationsRequestModel); + if (_notificationService.hasError) { + error = _notificationService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future markAsRead(id) async { + // setState(ViewState.Busy); + MarkMessageAsReadRequestModel markMessageAsReadRequestModel = + new MarkMessageAsReadRequestModel(notificationPoolID: id); + await _notificationService.markAsRead(markMessageAsReadRequestModel); + setState(ViewState.Idle); + } +} \ No newline at end of file diff --git a/lib/core/viewModels/packages_offers/PackagesOffersViewModel.dart b/lib/core/viewModels/packages_offers/PackagesOffersViewModel.dart new file mode 100644 index 00000000..21df52bc --- /dev/null +++ b/lib/core/viewModels/packages_offers/PackagesOffersViewModel.dart @@ -0,0 +1,19 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart'; +import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferProductsResponseModel.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; +import 'package:diplomaticquarterapp/core/service/packages_offers/PackagesOffersServices.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:diplomaticquarterapp/locator.dart'; + +class OfferCategoriesViewModel extends BaseViewModel { + OffersAndPackagesServices service = locator(); + List get list => service.categoryList; +} + +class OfferProductsViewModel extends BaseViewModel { + OffersAndPackagesServices service = locator(); + List get list => service.productList; +} diff --git a/lib/core/viewModels/pharmacies_view_model.dart b/lib/core/viewModels/pharmacies_view_model.dart new file mode 100644 index 00000000..b9e162fc --- /dev/null +++ b/lib/core/viewModels/pharmacies_view_model.dart @@ -0,0 +1,42 @@ +import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_list_model.dart'; +import '../../locator.dart'; +import 'base_view_model.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_model.dart'; +import 'package:diplomaticquarterapp/core/service/pharmacies_service.dart'; + +class PharmacyViewModel extends BaseViewModel { + bool isFinished = true; + bool hasError = false; + String errorMsg = ''; + PharmacyService _pharmacyService = locator(); + + List get pharmacy => _pharmacyService.medicineItem; + List get pharmacyList => _pharmacyService.pharmaciesList; + + Future getPharmacies({int id}) async { + setState(ViewState.Busy); + + await _pharmacyService.getPharmaciesList(itemID: id); + if (_pharmacyService.hasError) { + error = _pharmacyService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + clearMedicineSearch(){ + _pharmacyService.clearMedicineList(); + } + Future getMedicine({String name}) async { + hasError = false; + _pharmacyService.clearMedicineList(); + setState(ViewState.BusyLocal); + await _pharmacyService.getMedicineList(drugName: name); + if (_pharmacyService.hasError) { + error = _pharmacyService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart b/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart new file mode 100644 index 00000000..00f4819b --- /dev/null +++ b/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart @@ -0,0 +1,8 @@ +import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart'; + +import '../../../locator.dart'; +import '../base_view_model.dart'; + +class OrderPreviewViewModel extends BaseViewModel { + OrderPreviewService _orderService = locator(); +} diff --git a/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart b/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart new file mode 100644 index 00000000..f8c574f7 --- /dev/null +++ b/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart @@ -0,0 +1,73 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; +import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; + +import '../../../locator.dart'; + +class PharmacyModuleViewModel extends BaseViewModel { + PharmacyModuleService _pharmacyService = locator(); + + List get bannerList => _pharmacyService.bannerItems; + + List get manufacturerList => _pharmacyService.manufacturerList; + + List get bestSellerProduct => + _pharmacyService.bestSellerProducts; + + List get lastVisitedProducts => + _pharmacyService.lastVisitedProducts; + + Future getPharmacyHomeData() async { + setState(ViewState.Busy); + await _pharmacyService.getBannerListList(); + if (_pharmacyService.hasError) { + error = _pharmacyService.error; + setState(ViewState.Error); + } else { + _getTopManufacturerList(); + } + } + + List getBannerImagesUrl() { + List images = List(); + images.add('assets/images/pharmacy_module/pharmacy_logo_green.png'); + _pharmacyService.bannerItems.forEach((element) { + images.add(element.src); + }); + + return images; + } + + _getTopManufacturerList() async { + await _pharmacyService.getTopManufacturerList(); + if (_pharmacyService.hasError) { + error = _pharmacyService.error; + setState(ViewState.Error); + } else { + _getBestSellerProducts(); + } + } + + _getBestSellerProducts() async { + await _pharmacyService.getBestSellerProducts(); + if (_pharmacyService.hasError) { + error = _pharmacyService.error; + setState(ViewState.Error); + } else { + _getLastVisitedProducts(); + } + } + + _getLastVisitedProducts() async { + await _pharmacyService.getLastVisitedProducts(); + if (_pharmacyService.hasError) { + error = _pharmacyService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart new file mode 100644 index 00000000..baaf6b5b --- /dev/null +++ b/lib/core/viewModels/project_view_model.dart @@ -0,0 +1,145 @@ +import 'dart:async'; + +import 'package:connectivity/connectivity.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; +import 'package:diplomaticquarterapp/core/service/privilege_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; + +class ProjectViewModel extends BaseViewModel { + // Platform Bridge + PlatformBridge platformBridge() { + return PlatformBridge.shared(); + } + + AppSharedPreferences sharedPref = AppSharedPreferences(); + Locale _appLocale = Locale('ar'); + String currentLanguage = 'ar'; + bool _isArabic = false; + bool isInternetConnection = true; + bool isLoading = false; + bool isError = false; + String error = ''; + dynamic searchvalue; + bool isLogin = false; + + dynamic get searchValue => searchvalue; + + Locale get appLocal => _appLocale; + + LocaleType get localeType => isArabic ? LocaleType.en : LocaleType.ar; + + bool get isArabic => _isArabic; + + + bool isLoginChild = false; + List privilegeRootUser = List(); + List privilegeChildUser = List(); + + List get privileges => + isLoginChild ? privilegeChildUser : privilegeChildUser; + + StreamSubscription subscription; + + ProjectViewModel() { + loadSharedPrefLanguage(); + subscription = Connectivity() + .onConnectivityChanged + .listen((ConnectivityResult result) { + switch (result) { + case ConnectivityResult.wifi: + isInternetConnection = true; + break; + case ConnectivityResult.mobile: + isInternetConnection = true; + break; + case ConnectivityResult.none: + isInternetConnection = false; + break; + } + notifyListeners(); + }); + } + + Future loadSharedPrefLanguage() async { + currentLanguage = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + _appLocale = Locale(currentLanguage); + _isArabic = currentLanguage == 'ar'; + notifyListeners(); + } + + void changeLanguage(String lan) { + if (lan != "en" && currentLanguage != lan) { + _appLocale = Locale("ar"); + _isArabic = true; + currentLanguage = 'ar'; + sharedPref.setString(APP_LANGUAGE, 'ar'); + } else if (lan != "ar" && currentLanguage != lan) { + _appLocale = Locale("en"); + _isArabic = false; + currentLanguage = 'en'; + sharedPref.setString(APP_LANGUAGE, 'en'); + } + + notifyListeners(); + } + + setPrivilegeModelList( + {List privilege}) { + this.isLoginChild = isLoginChild; + privilegeRootUser = privilege; + + notifyListeners(); + } + + setPrivilege({privilegeList, bool isLoginChild = false}) { + List privilege = List(); + + privilegeList['List'][0]['ListPrivilege'].forEach((item) { + privilege.add(PrivilegeModel.fromJson(item)); + }); + + this.isLoginChild = isLoginChild; + if (isLoginChild) + privilegeChildUser = privilege; + else + privilegeRootUser = privilege; + + notifyListeners(); + } + + setIsLoginChild({@required bool isLoginChild}){ + this.isLoginChild = isLoginChild; + notifyListeners(); + } + + bool havePrivilege(int id) { + bool isHavePrivilege = false; + if(isLoginChild) + privilegeChildUser.forEach((element) { + if (element.iD == id) isHavePrivilege = element.privilege; + }); + else{ + privilegeRootUser.forEach((element) { + if (element.iD == id) isHavePrivilege = element.privilege; + }); + } + return isHavePrivilege; + } + + @override + void dispose() { + if (subscription != null) subscription.cancel(); + super.dispose(); + } + + setSearchValue(data) { + searchvalue = data; + notifyListeners(); + } +} diff --git a/lib/core/viewModels/qr_view_model.dart b/lib/core/viewModels/qr_view_model.dart new file mode 100644 index 00000000..9833d6c8 --- /dev/null +++ b/lib/core/viewModels/qr_view_model.dart @@ -0,0 +1,56 @@ +import 'dart:convert'; +import 'package:barcode_scan_fix/barcode_scan.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/qr/qr_parking_model.dart'; +import 'package:diplomaticquarterapp/core/service/qr_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; + +import '../../locator.dart'; + +class QrViewModel extends BaseViewModel { + QrService _qrService = locator(); + bool isSavePark = false; + QRParkingModel qrParkingModel; + + readQr() async { + //TODO fix the barcode scan + String result = await BarcodeScanner.scan(); + var data = json.decode(result); + var qRParkingID = data['QRParkingID']; + setState(ViewState.BusyLocal); + await _qrService.getQRParkingByID(qRParkingID); + if (_qrService.hasError) { + error = _qrService.error; + setState(ViewState.ErrorLocal); + } else { + if (_qrService.qRParkingList.length > 0) { + qrParkingModel = _qrService.qRParkingList[0]; + await sharedPref.setObject(IS_GO_TO_PARKING, qrParkingModel); + isSavePark = true; + setState(ViewState.Idle); + } else { + error = "Invalid Qr Code"; + setState(ViewState.ErrorLocal); + } + } + } + + getIsSaveParking() async { + setState(ViewState.Busy); + var parking = await sharedPref.getObject(IS_GO_TO_PARKING); + if (parking != null) { + isSavePark = true; + qrParkingModel = QRParkingModel.fromJson(parking); + } + setState(ViewState.Busy); + } + + clearParking() async { + setState(ViewState.Busy); + await sharedPref.setObject(IS_GO_TO_PARKING, null); + isSavePark = false; + qrParkingModel = null; + setState(ViewState.Idle); + } +} diff --git a/lib/core/viewModels/vaccine_view_model.dart b/lib/core/viewModels/vaccine_view_model.dart new file mode 100644 index 00000000..9f8dfecf --- /dev/null +++ b/lib/core/viewModels/vaccine_view_model.dart @@ -0,0 +1,65 @@ +import 'package:diplomaticquarterapp/core/model/vaccine/vaccination_item.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +import 'base_view_model.dart'; +import '../../locator.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/vaccine/my_vaccine.dart'; +import 'package:diplomaticquarterapp/core/service/vaccine_service.dart'; + +class VaccineViewModel extends BaseViewModel { + bool hasError = false; + + VaccineService _vaccineService = locator(); + + List get vaccineList => _vaccineService.vaccineList; + List get vaccinationItemList => _vaccineService.vaccinationItemList; + + + Future getVaccine() async { + hasError = false; + setState(ViewState.Busy); + await _vaccineService.getMyVaccine(); + if (_vaccineService.hasError) { + error = _vaccineService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future getMyVaccinationItem() async { + hasError = false; + setState(ViewState.Busy); + await _vaccineService.getMyVaccinationItem(); + if (_vaccineService.hasError) { + error = _vaccineService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future getMyVaccinationOnHand({String pItemCode}) async { + hasError = false; + setState(ViewState.Busy); + await _vaccineService.getMyVaccinationOnHand(pItemCode: pItemCode); + if (_vaccineService.hasError) { + error = _vaccineService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future sendEmail({String message}) async { + hasError = false; + setState(ViewState.BusyLocal); + await _vaccineService.sendEmail(); + if (_vaccineService.hasError) { + error = _vaccineService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else { + AppToast.showSuccessToast(message: message); + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/weather/weather_view_model.dart b/lib/core/viewModels/weather/weather_view_model.dart new file mode 100644 index 00000000..bb201843 --- /dev/null +++ b/lib/core/viewModels/weather/weather_view_model.dart @@ -0,0 +1,31 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/er/projectavgerwaitingtime.dart'; +import 'package:diplomaticquarterapp/core/model/weahter/weather_model.dart'; + +import 'package:diplomaticquarterapp/core/service/er/er_service.dart'; +import 'package:diplomaticquarterapp/core/service/weather_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; + +import '../../../locator.dart'; + +class WeatherViewModel extends BaseViewModel { + WeatherService _weatherService = locator(); + List get weatherIndicatorData => + _weatherService.weatherIndicatorData; + getWeatherData() async { + setState(ViewState.Busy); + + // if (id != null && projectID != null) { + // await _erService.getProjectAvgERWaitingTimeOrders( + // id: id, projectID: projectID); + // } else { + await _weatherService.getWeatherData(); + // } + if (_weatherService.hasError) { + error = _weatherService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/d_q_icons_icons.dart b/lib/d_q_icons_icons.dart new file mode 100644 index 00000000..c3b64559 --- /dev/null +++ b/lib/d_q_icons_icons.dart @@ -0,0 +1,42 @@ +/// Flutter icons DQIcons +/// Copyright (C) 2020 by original authors @ fluttericon.com, fontello.com +/// This font was generated by FlutterIcon.com, which is derived from Fontello. +/// +/// To use this font, place it in your fonts/ directory and include the +/// following in your pubspec.yaml +/// +/// flutter: +/// fonts: +/// - family: DQIcons +/// fonts: +/// - asset: fonts/DQIcons.ttf +/// +/// +/// +import 'package:flutter/widgets.dart'; + +class DQIcons { + DQIcons._(); + + static const _kFontFam = 'DQIcons'; + static const _kFontPkg = null; + + static const IconData blood_pressure = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData blood = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData bmi = IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData heart = IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData height = IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData outline = IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData thermometer = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData weight_scale = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData parking_icon = IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData blood_type_icon = IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData height_icon = IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData online_payment_icon = IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_medicine_icon = IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData vital_sign_icon = IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData weight_icon = IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData my_medical_file = IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData family = IconData(0xe810, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData calendar__2_ = IconData(0xe811, fontFamily: _kFontFam, fontPackage: _kFontPkg); +} diff --git a/lib/generated/json/GeoZonesResponseModel_helper.dart b/lib/generated/json/GeoZonesResponseModel_helper.dart new file mode 100644 index 00000000..7cf3cc5f --- /dev/null +++ b/lib/generated/json/GeoZonesResponseModel_helper.dart @@ -0,0 +1,50 @@ +import 'package:diplomaticquarterapp/core/model/geofencing/responses/GeoZonesResponseModel.dart'; + +geoZonesResponseModelEntityFromJson(GeoZonesResponseModel data, Map json) { + if (json['GEOF_ID'] != null) { + data.geofId = json['GEOF_ID']?.toInt(); + } + if (json['Description'] != null) { + data.description = json['Description']?.toString(); + } + if (json['DescriptionN'] != null) { + data.descriptionN = json['DescriptionN']?.toString(); + } + if (json['Latitude'] != null) { + data.latitude = json['Latitude']?.toString(); + } + if (json['Longitude'] != null) { + data.longitude = json['Longitude']?.toString(); + } + if (json['Radius'] != null) { + data.radius = json['Radius']?.toInt(); + } + if (json['Type'] != null) { + data.type = json['Type']?.toInt(); + } + if (json['ProjectID'] != null) { + data.projectID = json['ProjectID']?.toInt(); + } + if (json['ImageURL'] != null) { + data.imageURL = json['ImageURL']?.toString(); + } + if (json['IsCity'] != null) { + data.isCity = json['IsCity']; + } + return data; +} + +Map geoZonesResponseModelEntityToJson(GeoZonesResponseModel entity) { + final Map data = new Map(); + data['GEOF_ID'] = entity.geofId; + data['Description'] = entity.description; + data['DescriptionN'] = entity.descriptionN; + data['Latitude'] = entity.latitude; + data['Longitude'] = entity.longitude; + data['Radius'] = entity.radius; + data['Type'] = entity.type; + data['ProjectID'] = entity.projectID; + data['ImageURL'] = entity.imageURL; + data['IsCity'] = entity.isCity; + return data; +} diff --git a/lib/generated/json/OfferCategoriesResponseModel_helper.dart b/lib/generated/json/OfferCategoriesResponseModel_helper.dart new file mode 100644 index 00000000..e5ebc914 --- /dev/null +++ b/lib/generated/json/OfferCategoriesResponseModel_helper.dart @@ -0,0 +1,172 @@ +import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart'; + +offerCategoriesResponseModelFromJson(OfferCategoriesResponseModel data, Map json) { + if (json['id'] != null) { + data.id = json['id']?.toString(); + } + if (json['name'] != null) { + data.name = json['name']?.toString(); + } + if (json['namen'] != null) { + data.namen = json['namen']?.toString(); + } + if (json['localized_names'] != null) { + data.localizedNames = new List(); + (json['localized_names'] as List).forEach((v) { + data.localizedNames.add(new OfferCategoriesResponseModelLocalizedName().fromJson(v)); + }); + } + if (json['description'] != null) { + data.description = json['description']; + } + if (json['category_template_id'] != null) { + data.categoryTemplateId = json['category_template_id']?.toInt(); + } + if (json['meta_keywords'] != null) { + data.metaKeywords = json['meta_keywords']?.toString(); + } + if (json['meta_description'] != null) { + data.metaDescription = json['meta_description']?.toString(); + } + if (json['meta_title'] != null) { + data.metaTitle = json['meta_title']?.toString(); + } + if (json['parent_category_id'] != null) { + data.parentCategoryId = json['parent_category_id']?.toInt(); + } + if (json['page_size'] != null) { + data.pageSize = json['page_size']?.toInt(); + } + if (json['page_size_options'] != null) { + data.pageSizeOptions = json['page_size_options']?.toString(); + } + if (json['price_ranges'] != null) { + data.priceRanges = json['price_ranges']; + } + if (json['show_on_home_page'] != null) { + data.showOnHomePage = json['show_on_home_page']; + } + if (json['include_in_top_menu'] != null) { + data.includeInTopMenu = json['include_in_top_menu']; + } + if (json['has_discounts_applied'] != null) { + data.hasDiscountsApplied = json['has_discounts_applied']; + } + if (json['published'] != null) { + data.published = json['published']; + } + if (json['deleted'] != null) { + data.deleted = json['deleted']; + } + if (json['display_order'] != null) { + data.displayOrder = json['display_order']?.toInt(); + } + if (json['created_on_utc'] != null) { + data.createdOnUtc = json['created_on_utc']?.toString(); + } + if (json['updated_on_utc'] != null) { + data.updatedOnUtc = json['updated_on_utc']?.toString(); + } + if (json['role_ids'] != null) { + data.roleIds = new List(); + data.roleIds.addAll(json['role_ids']); + } + if (json['discount_ids'] != null) { + data.discountIds = new List(); + data.discountIds.addAll(json['discount_ids']); + } + if (json['store_ids'] != null) { + data.storeIds = new List(); + data.storeIds.addAll(json['store_ids']); + } + if (json['image'] != null) { + data.image = new OfferCategoriesResponseModelImage().fromJson(json['image']); + } + if (json['se_name'] != null) { + data.seName = json['se_name']?.toString(); + } + if (json['is_leaf'] != null) { + data.isLeaf = json['is_leaf']; + } + return data; +} + +Map offerCategoriesResponseModelToJson(OfferCategoriesResponseModel entity) { + final Map data = new Map(); + data['id'] = entity.id; + data['name'] = entity.name; + data['namen'] = entity.namen; + if (entity.localizedNames != null) { + data['localized_names'] = entity.localizedNames.map((v) => v.toJson()).toList(); + } + data['description'] = entity.description; + data['category_template_id'] = entity.categoryTemplateId; + data['meta_keywords'] = entity.metaKeywords; + data['meta_description'] = entity.metaDescription; + data['meta_title'] = entity.metaTitle; + data['parent_category_id'] = entity.parentCategoryId; + data['page_size'] = entity.pageSize; + data['page_size_options'] = entity.pageSizeOptions; + data['price_ranges'] = entity.priceRanges; + data['show_on_home_page'] = entity.showOnHomePage; + data['include_in_top_menu'] = entity.includeInTopMenu; + data['has_discounts_applied'] = entity.hasDiscountsApplied; + data['published'] = entity.published; + data['deleted'] = entity.deleted; + data['display_order'] = entity.displayOrder; + data['created_on_utc'] = entity.createdOnUtc; + data['updated_on_utc'] = entity.updatedOnUtc; + if (entity.roleIds != null) { + data['role_ids'] = []; + } + if (entity.discountIds != null) { + data['discount_ids'] = []; + } + if (entity.storeIds != null) { + data['store_ids'] = []; + } + if (entity.image != null) { + data['image'] = entity.image.toJson(); + } + data['se_name'] = entity.seName; + data['is_leaf'] = entity.isLeaf; + return data; +} + +offerCategoriesResponseModelLocalizedNameFromJson(OfferCategoriesResponseModelLocalizedName data, Map json) { + if (json['language_id'] != null) { + data.languageId = json['language_id']?.toInt(); + } + if (json['localized_name'] != null) { + data.localizedName = json['localized_name']?.toString(); + } + return data; +} + +Map offerCategoriesResponseModelLocalizedNameToJson(OfferCategoriesResponseModelLocalizedName entity) { + final Map data = new Map(); + data['language_id'] = entity.languageId; + data['localized_name'] = entity.localizedName; + return data; +} + +offerCategoriesResponseModelImageFromJson(OfferCategoriesResponseModelImage data, Map json) { + if (json['src'] != null) { + data.src = json['src']?.toString(); + } + if (json['thumb'] != null) { + data.thumb = json['thumb']; + } + if (json['attachment'] != null) { + data.attachment = json['attachment']; + } + return data; +} + +Map offerCategoriesResponseModelImageToJson(OfferCategoriesResponseModelImage entity) { + final Map data = new Map(); + data['src'] = entity.src; + data['thumb'] = entity.thumb; + data['attachment'] = entity.attachment; + return data; +} diff --git a/lib/generated/json/OfferProductsResponseModel_helper.dart b/lib/generated/json/OfferProductsResponseModel_helper.dart new file mode 100644 index 00000000..dc0edeca --- /dev/null +++ b/lib/generated/json/OfferProductsResponseModel_helper.dart @@ -0,0 +1,569 @@ +import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferProductsResponseModel.dart'; + +offerProductsResponseModelFromJson(OfferProductsResponseModel data, Map json) { + if (json['id'] != null) { + data.id = json['id']?.toString(); + } + if (json['visible_individually'] != null) { + data.visibleIndividually = json['visible_individually']; + } + if (json['name'] != null) { + data.name = json['name']?.toString(); + } + if (json['namen'] != null) { + data.namen = json['namen']?.toString(); + } + if (json['localized_names'] != null) { + data.localizedNames = new List(); + (json['localized_names'] as List).forEach((v) { + data.localizedNames.add(new OfferProductsResponseModelLocalizedName().fromJson(v)); + }); + } + if (json['short_description'] != null) { + data.shortDescription = json['short_description']?.toString(); + } + if (json['short_descriptionn'] != null) { + data.shortDescriptionn = json['short_descriptionn']?.toString(); + } + if (json['full_description'] != null) { + data.fullDescription = json['full_description']?.toString(); + } + if (json['full_descriptionn'] != null) { + data.fullDescriptionn = json['full_descriptionn']?.toString(); + } + if (json['markas_new'] != null) { + data.markasNew = json['markas_new']; + } + if (json['show_on_home_page'] != null) { + data.showOnHomePage = json['show_on_home_page']; + } + if (json['meta_keywords'] != null) { + data.metaKeywords = json['meta_keywords']; + } + if (json['meta_description'] != null) { + data.metaDescription = json['meta_description']; + } + if (json['meta_title'] != null) { + data.metaTitle = json['meta_title']; + } + if (json['allow_customer_reviews'] != null) { + data.allowCustomerReviews = json['allow_customer_reviews']; + } + if (json['approved_rating_sum'] != null) { + data.approvedRatingSum = json['approved_rating_sum']?.toInt(); + } + if (json['not_approved_rating_sum'] != null) { + data.notApprovedRatingSum = json['not_approved_rating_sum']?.toInt(); + } + if (json['approved_total_reviews'] != null) { + data.approvedTotalReviews = json['approved_total_reviews']?.toInt(); + } + if (json['not_approved_total_reviews'] != null) { + data.notApprovedTotalReviews = json['not_approved_total_reviews']?.toInt(); + } + if (json['sku'] != null) { + data.sku = json['sku']?.toString(); + } + if (json['is_rx'] != null) { + data.isRx = json['is_rx']; + } + if (json['prescription_required'] != null) { + data.prescriptionRequired = json['prescription_required']; + } + if (json['rx_message'] != null) { + data.rxMessage = json['rx_message']; + } + if (json['rx_messagen'] != null) { + data.rxMessagen = json['rx_messagen']; + } + if (json['manufacturer_part_number'] != null) { + data.manufacturerPartNumber = json['manufacturer_part_number']; + } + if (json['gtin'] != null) { + data.gtin = json['gtin']; + } + if (json['is_gift_card'] != null) { + data.isGiftCard = json['is_gift_card']; + } + if (json['require_other_products'] != null) { + data.requireOtherProducts = json['require_other_products']; + } + if (json['automatically_add_required_products'] != null) { + data.automaticallyAddRequiredProducts = json['automatically_add_required_products']; + } + if (json['is_download'] != null) { + data.isDownload = json['is_download']; + } + if (json['unlimited_downloads'] != null) { + data.unlimitedDownloads = json['unlimited_downloads']; + } + if (json['max_number_of_downloads'] != null) { + data.maxNumberOfDownloads = json['max_number_of_downloads']?.toInt(); + } + if (json['download_expiration_days'] != null) { + data.downloadExpirationDays = json['download_expiration_days']; + } + if (json['has_sample_download'] != null) { + data.hasSampleDownload = json['has_sample_download']; + } + if (json['has_user_agreement'] != null) { + data.hasUserAgreement = json['has_user_agreement']; + } + if (json['is_recurring'] != null) { + data.isRecurring = json['is_recurring']; + } + if (json['recurring_cycle_length'] != null) { + data.recurringCycleLength = json['recurring_cycle_length']?.toInt(); + } + if (json['recurring_total_cycles'] != null) { + data.recurringTotalCycles = json['recurring_total_cycles']?.toInt(); + } + if (json['is_rental'] != null) { + data.isRental = json['is_rental']; + } + if (json['rental_price_length'] != null) { + data.rentalPriceLength = json['rental_price_length']?.toInt(); + } + if (json['is_ship_enabled'] != null) { + data.isShipEnabled = json['is_ship_enabled']; + } + if (json['is_free_shipping'] != null) { + data.isFreeShipping = json['is_free_shipping']; + } + if (json['ship_separately'] != null) { + data.shipSeparately = json['ship_separately']; + } + if (json['additional_shipping_charge'] != null) { + data.additionalShippingCharge = json['additional_shipping_charge']?.toDouble(); + } + if (json['is_tax_exempt'] != null) { + data.isTaxExempt = json['is_tax_exempt']; + } + if (json['is_telecommunications_or_broadcasting_or_electronic_services'] != null) { + data.isTelecommunicationsOrBroadcastingOrElectronicServices = json['is_telecommunications_or_broadcasting_or_electronic_services']; + } + if (json['use_multiple_warehouses'] != null) { + data.useMultipleWarehouses = json['use_multiple_warehouses']; + } + if (json['manage_inventory_method_id'] != null) { + data.manageInventoryMethodId = json['manage_inventory_method_id']?.toInt(); + } + if (json['stock_quantity'] != null) { + data.stockQuantity = json['stock_quantity']?.toInt(); + } + if (json['stock_availability'] != null) { + data.stockAvailability = json['stock_availability']?.toString(); + } + if (json['stock_availabilityn'] != null) { + data.stockAvailabilityn = json['stock_availabilityn']?.toString(); + } + if (json['display_stock_availability'] != null) { + data.displayStockAvailability = json['display_stock_availability']; + } + if (json['display_stock_quantity'] != null) { + data.displayStockQuantity = json['display_stock_quantity']; + } + if (json['min_stock_quantity'] != null) { + data.minStockQuantity = json['min_stock_quantity']?.toInt(); + } + if (json['notify_admin_for_quantity_below'] != null) { + data.notifyAdminForQuantityBelow = json['notify_admin_for_quantity_below']?.toInt(); + } + if (json['allow_back_in_stock_subscriptions'] != null) { + data.allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions']; + } + if (json['order_minimum_quantity'] != null) { + data.orderMinimumQuantity = json['order_minimum_quantity']?.toInt(); + } + if (json['order_maximum_quantity'] != null) { + data.orderMaximumQuantity = json['order_maximum_quantity']?.toInt(); + } + if (json['allowed_quantities'] != null) { + data.allowedQuantities = json['allowed_quantities']; + } + if (json['allow_adding_only_existing_attribute_combinations'] != null) { + data.allowAddingOnlyExistingAttributeCombinations = json['allow_adding_only_existing_attribute_combinations']; + } + if (json['disable_buy_button'] != null) { + data.disableBuyButton = json['disable_buy_button']; + } + if (json['disable_wishlist_button'] != null) { + data.disableWishlistButton = json['disable_wishlist_button']; + } + if (json['available_for_pre_order'] != null) { + data.availableForPreOrder = json['available_for_pre_order']; + } + if (json['pre_order_availability_start_date_time_utc'] != null) { + data.preOrderAvailabilityStartDateTimeUtc = json['pre_order_availability_start_date_time_utc']; + } + if (json['call_for_price'] != null) { + data.callForPrice = json['call_for_price']; + } + if (json['price'] != null) { + data.price = json['price']?.toDouble(); + } + if (json['old_price'] != null) { + data.oldPrice = json['old_price']?.toDouble(); + } + if (json['product_cost'] != null) { + data.productCost = json['product_cost']?.toDouble(); + } + if (json['special_price'] != null) { + data.specialPrice = json['special_price']; + } + if (json['special_price_start_date_time_utc'] != null) { + data.specialPriceStartDateTimeUtc = json['special_price_start_date_time_utc']; + } + if (json['special_price_end_date_time_utc'] != null) { + data.specialPriceEndDateTimeUtc = json['special_price_end_date_time_utc']; + } + if (json['customer_enters_price'] != null) { + data.customerEntersPrice = json['customer_enters_price']; + } + if (json['minimum_customer_entered_price'] != null) { + data.minimumCustomerEnteredPrice = json['minimum_customer_entered_price']?.toDouble(); + } + if (json['maximum_customer_entered_price'] != null) { + data.maximumCustomerEnteredPrice = json['maximum_customer_entered_price']?.toDouble(); + } + if (json['baseprice_enabled'] != null) { + data.basepriceEnabled = json['baseprice_enabled']; + } + if (json['baseprice_amount'] != null) { + data.basepriceAmount = json['baseprice_amount']?.toDouble(); + } + if (json['baseprice_base_amount'] != null) { + data.basepriceBaseAmount = json['baseprice_base_amount']?.toDouble(); + } + if (json['has_tier_prices'] != null) { + data.hasTierPrices = json['has_tier_prices']; + } + if (json['has_discounts_applied'] != null) { + data.hasDiscountsApplied = json['has_discounts_applied']; + } + if (json['discount_name'] != null) { + data.discountName = json['discount_name']; + } + if (json['discount_namen'] != null) { + data.discountNamen = json['discount_namen']; + } + if (json['discount_description'] != null) { + data.discountDescription = json['discount_description']; + } + if (json['discount_Descriptionn'] != null) { + data.discountDescriptionn = json['discount_Descriptionn']; + } + if (json['discount_percentage'] != null) { + data.discountPercentage = json['discount_percentage']; + } + if (json['currency'] != null) { + data.currency = json['currency']?.toString(); + } + if (json['currencyn'] != null) { + data.currencyn = json['currencyn']?.toString(); + } + if (json['weight'] != null) { + data.weight = json['weight']?.toDouble(); + } + if (json['length'] != null) { + data.length = json['length']?.toDouble(); + } + if (json['width'] != null) { + data.width = json['width']?.toDouble(); + } + if (json['height'] != null) { + data.height = json['height']?.toDouble(); + } + if (json['available_start_date_time_utc'] != null) { + data.availableStartDateTimeUtc = json['available_start_date_time_utc']; + } + if (json['available_end_date_time_utc'] != null) { + data.availableEndDateTimeUtc = json['available_end_date_time_utc']; + } + if (json['display_order'] != null) { + data.displayOrder = json['display_order']?.toInt(); + } + if (json['published'] != null) { + data.published = json['published']; + } + if (json['deleted'] != null) { + data.deleted = json['deleted']; + } + if (json['created_on_utc'] != null) { + data.createdOnUtc = json['created_on_utc']?.toString(); + } + if (json['updated_on_utc'] != null) { + data.updatedOnUtc = json['updated_on_utc']?.toString(); + } + if (json['product_type'] != null) { + data.productType = json['product_type']?.toString(); + } + if (json['parent_grouped_product_id'] != null) { + data.parentGroupedProductId = json['parent_grouped_product_id']?.toInt(); + } + if (json['role_ids'] != null) { + data.roleIds = new List(); + data.roleIds.addAll(json['role_ids']); + } + if (json['discount_ids'] != null) { + data.discountIds = new List(); + data.discountIds.addAll(json['discount_ids']); + } + if (json['store_ids'] != null) { + data.storeIds = new List(); + data.storeIds.addAll(json['store_ids']); + } + if (json['manufacturer_ids'] != null) { + data.manufacturerIds = json['manufacturer_ids']?.map((v) => v?.toInt())?.toList()?.cast(); + } + if (json['reviews'] != null) { + data.reviews = new List(); + data.reviews.addAll(json['reviews']); + } + if (json['images'] != null) { + data.images = new List(); + (json['images'] as List).forEach((v) { + data.images.add(new OfferProductsResponseModelImage().fromJson(v)); + }); + } + if (json['attributes'] != null) { + data.attributes = new List(); + data.attributes.addAll(json['attributes']); + } + if (json['specifications'] != null) { + data.specifications = new List(); + (json['specifications'] as List).forEach((v) { + data.specifications.add(new OfferProductsResponseModelSpecification().fromJson(v)); + }); + } + if (json['associated_product_ids'] != null) { + data.associatedProductIds = new List(); + data.associatedProductIds.addAll(json['associated_product_ids']); + } + if (json['tags'] != null) { + data.tags = new List(); + data.tags.addAll(json['tags']); + } + if (json['vendor_id'] != null) { + data.vendorId = json['vendor_id']?.toInt(); + } + if (json['se_name'] != null) { + data.seName = json['se_name']?.toString(); + } + return data; +} + +Map offerProductsResponseModelToJson(OfferProductsResponseModel entity) { + final Map data = new Map(); + data['id'] = entity.id; + data['visible_individually'] = entity.visibleIndividually; + data['name'] = entity.name; + data['namen'] = entity.namen; + if (entity.localizedNames != null) { + data['localized_names'] = entity.localizedNames.map((v) => v.toJson()).toList(); + } + data['short_description'] = entity.shortDescription; + data['short_descriptionn'] = entity.shortDescriptionn; + data['full_description'] = entity.fullDescription; + data['full_descriptionn'] = entity.fullDescriptionn; + data['markas_new'] = entity.markasNew; + data['show_on_home_page'] = entity.showOnHomePage; + data['meta_keywords'] = entity.metaKeywords; + data['meta_description'] = entity.metaDescription; + data['meta_title'] = entity.metaTitle; + data['allow_customer_reviews'] = entity.allowCustomerReviews; + data['approved_rating_sum'] = entity.approvedRatingSum; + data['not_approved_rating_sum'] = entity.notApprovedRatingSum; + data['approved_total_reviews'] = entity.approvedTotalReviews; + data['not_approved_total_reviews'] = entity.notApprovedTotalReviews; + data['sku'] = entity.sku; + data['is_rx'] = entity.isRx; + data['prescription_required'] = entity.prescriptionRequired; + data['rx_message'] = entity.rxMessage; + data['rx_messagen'] = entity.rxMessagen; + data['manufacturer_part_number'] = entity.manufacturerPartNumber; + data['gtin'] = entity.gtin; + data['is_gift_card'] = entity.isGiftCard; + data['require_other_products'] = entity.requireOtherProducts; + data['automatically_add_required_products'] = entity.automaticallyAddRequiredProducts; + data['is_download'] = entity.isDownload; + data['unlimited_downloads'] = entity.unlimitedDownloads; + data['max_number_of_downloads'] = entity.maxNumberOfDownloads; + data['download_expiration_days'] = entity.downloadExpirationDays; + data['has_sample_download'] = entity.hasSampleDownload; + data['has_user_agreement'] = entity.hasUserAgreement; + data['is_recurring'] = entity.isRecurring; + data['recurring_cycle_length'] = entity.recurringCycleLength; + data['recurring_total_cycles'] = entity.recurringTotalCycles; + data['is_rental'] = entity.isRental; + data['rental_price_length'] = entity.rentalPriceLength; + data['is_ship_enabled'] = entity.isShipEnabled; + data['is_free_shipping'] = entity.isFreeShipping; + data['ship_separately'] = entity.shipSeparately; + data['additional_shipping_charge'] = entity.additionalShippingCharge; + data['is_tax_exempt'] = entity.isTaxExempt; + data['is_telecommunications_or_broadcasting_or_electronic_services'] = entity.isTelecommunicationsOrBroadcastingOrElectronicServices; + data['use_multiple_warehouses'] = entity.useMultipleWarehouses; + data['manage_inventory_method_id'] = entity.manageInventoryMethodId; + data['stock_quantity'] = entity.stockQuantity; + data['stock_availability'] = entity.stockAvailability; + data['stock_availabilityn'] = entity.stockAvailabilityn; + data['display_stock_availability'] = entity.displayStockAvailability; + data['display_stock_quantity'] = entity.displayStockQuantity; + data['min_stock_quantity'] = entity.minStockQuantity; + data['notify_admin_for_quantity_below'] = entity.notifyAdminForQuantityBelow; + data['allow_back_in_stock_subscriptions'] = entity.allowBackInStockSubscriptions; + data['order_minimum_quantity'] = entity.orderMinimumQuantity; + data['order_maximum_quantity'] = entity.orderMaximumQuantity; + data['allowed_quantities'] = entity.allowedQuantities; + data['allow_adding_only_existing_attribute_combinations'] = entity.allowAddingOnlyExistingAttributeCombinations; + data['disable_buy_button'] = entity.disableBuyButton; + data['disable_wishlist_button'] = entity.disableWishlistButton; + data['available_for_pre_order'] = entity.availableForPreOrder; + data['pre_order_availability_start_date_time_utc'] = entity.preOrderAvailabilityStartDateTimeUtc; + data['call_for_price'] = entity.callForPrice; + data['price'] = entity.price; + data['old_price'] = entity.oldPrice; + data['product_cost'] = entity.productCost; + data['special_price'] = entity.specialPrice; + data['special_price_start_date_time_utc'] = entity.specialPriceStartDateTimeUtc; + data['special_price_end_date_time_utc'] = entity.specialPriceEndDateTimeUtc; + data['customer_enters_price'] = entity.customerEntersPrice; + data['minimum_customer_entered_price'] = entity.minimumCustomerEnteredPrice; + data['maximum_customer_entered_price'] = entity.maximumCustomerEnteredPrice; + data['baseprice_enabled'] = entity.basepriceEnabled; + data['baseprice_amount'] = entity.basepriceAmount; + data['baseprice_base_amount'] = entity.basepriceBaseAmount; + data['has_tier_prices'] = entity.hasTierPrices; + data['has_discounts_applied'] = entity.hasDiscountsApplied; + data['discount_name'] = entity.discountName; + data['discount_namen'] = entity.discountNamen; + data['discount_description'] = entity.discountDescription; + data['discount_Descriptionn'] = entity.discountDescriptionn; + data['discount_percentage'] = entity.discountPercentage; + data['currency'] = entity.currency; + data['currencyn'] = entity.currencyn; + data['weight'] = entity.weight; + data['length'] = entity.length; + data['width'] = entity.width; + data['height'] = entity.height; + data['available_start_date_time_utc'] = entity.availableStartDateTimeUtc; + data['available_end_date_time_utc'] = entity.availableEndDateTimeUtc; + data['display_order'] = entity.displayOrder; + data['published'] = entity.published; + data['deleted'] = entity.deleted; + data['created_on_utc'] = entity.createdOnUtc; + data['updated_on_utc'] = entity.updatedOnUtc; + data['product_type'] = entity.productType; + data['parent_grouped_product_id'] = entity.parentGroupedProductId; + if (entity.roleIds != null) { + data['role_ids'] = []; + } + if (entity.discountIds != null) { + data['discount_ids'] = []; + } + if (entity.storeIds != null) { + data['store_ids'] = []; + } + data['manufacturer_ids'] = entity.manufacturerIds; + if (entity.reviews != null) { + data['reviews'] = []; + } + if (entity.images != null) { + data['images'] = entity.images.map((v) => v.toJson()).toList(); + } + if (entity.attributes != null) { + data['attributes'] = []; + } + if (entity.specifications != null) { + data['specifications'] = entity.specifications.map((v) => v.toJson()).toList(); + } + if (entity.associatedProductIds != null) { + data['associated_product_ids'] = []; + } + if (entity.tags != null) { + data['tags'] = []; + } + data['vendor_id'] = entity.vendorId; + data['se_name'] = entity.seName; + return data; +} + +offerProductsResponseModelLocalizedNameFromJson(OfferProductsResponseModelLocalizedName data, Map json) { + if (json['language_id'] != null) { + data.languageId = json['language_id']?.toInt(); + } + if (json['localized_name'] != null) { + data.localizedName = json['localized_name']?.toString(); + } + return data; +} + +Map offerProductsResponseModelLocalizedNameToJson(OfferProductsResponseModelLocalizedName entity) { + final Map data = new Map(); + data['language_id'] = entity.languageId; + data['localized_name'] = entity.localizedName; + return data; +} + +offerProductsResponseModelImageFromJson(OfferProductsResponseModelImage data, Map json) { + if (json['id'] != null) { + data.id = json['id']?.toInt(); + } + if (json['position'] != null) { + data.position = json['position']?.toInt(); + } + if (json['src'] != null) { + data.src = json['src']?.toString(); + } + if (json['thumb'] != null) { + data.thumb = json['thumb']?.toString(); + } + if (json['attachment'] != null) { + data.attachment = json['attachment']?.toString(); + } + return data; +} + +Map offerProductsResponseModelImageToJson(OfferProductsResponseModelImage entity) { + final Map data = new Map(); + data['id'] = entity.id; + data['position'] = entity.position; + data['src'] = entity.src; + data['thumb'] = entity.thumb; + data['attachment'] = entity.attachment; + return data; +} + +offerProductsResponseModelSpecificationFromJson(OfferProductsResponseModelSpecification data, Map json) { + if (json['id'] != null) { + data.id = json['id']?.toInt(); + } + if (json['display_order'] != null) { + data.displayOrder = json['display_order']?.toInt(); + } + if (json['default_value'] != null) { + data.defaultValue = json['default_value']?.toString(); + } + if (json['default_valuen'] != null) { + data.defaultValuen = json['default_valuen']?.toString(); + } + if (json['name'] != null) { + data.name = json['name']?.toString(); + } + if (json['nameN'] != null) { + data.nameN = json['nameN']?.toString(); + } + return data; +} + +Map offerProductsResponseModelSpecificationToJson(OfferProductsResponseModelSpecification entity) { + final Map data = new Map(); + data['id'] = entity.id; + data['display_order'] = entity.displayOrder; + data['default_value'] = entity.defaultValue; + data['default_valuen'] = entity.defaultValuen; + data['name'] = entity.name; + data['nameN'] = entity.nameN; + return data; +} diff --git a/lib/generated/json/base/json_convert_content.dart b/lib/generated/json/base/json_convert_content.dart new file mode 100644 index 00000000..9fab946e --- /dev/null +++ b/lib/generated/json/base/json_convert_content.dart @@ -0,0 +1,128 @@ +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: camel_case_types +// ignore_for_file: prefer_single_quotes + +// This file is automatically generated. DO NOT EDIT, all your changes would be lost. +import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart'; +import 'package:diplomaticquarterapp/generated/json/OfferCategoriesResponseModel_helper.dart'; +import 'package:diplomaticquarterapp/core/model/geofencing/responses/LogGeoZoneResponseModel.dart'; +import 'package:diplomaticquarterapp/generated/json/log_geo_zone_response_model_entity_helper.dart'; +import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferProductsResponseModel.dart'; +import 'package:diplomaticquarterapp/generated/json/OfferProductsResponseModel_helper.dart'; +import 'package:diplomaticquarterapp/core/model/geofencing/responses/GeoZonesResponseModel.dart'; +import 'package:diplomaticquarterapp/generated/json/GeoZonesResponseModel_helper.dart'; + +class JsonConvert { + T fromJson(Map json) { + return _getFromJson(runtimeType, this, json); + } + + Map toJson() { + return _getToJson(runtimeType, this); + } + + static _getFromJson(Type type, data, json) { + switch (type) { + case OfferCategoriesResponseModel: + return offerCategoriesResponseModelFromJson(data as OfferCategoriesResponseModel, json) as T; + case OfferCategoriesResponseModelLocalizedName: + return offerCategoriesResponseModelLocalizedNameFromJson(data as OfferCategoriesResponseModelLocalizedName, json) as T; + case OfferCategoriesResponseModelImage: + return offerCategoriesResponseModelImageFromJson(data as OfferCategoriesResponseModelImage, json) as T; + case LogGeoZoneResponseModel: + return logGeoZoneResponseModelEntityFromJson(data as LogGeoZoneResponseModel, json) as T; + case OfferProductsResponseModel: + return offerProductsResponseModelFromJson(data as OfferProductsResponseModel, json) as T; + case OfferProductsResponseModelLocalizedName: + return offerProductsResponseModelLocalizedNameFromJson(data as OfferProductsResponseModelLocalizedName, json) as T; + case OfferProductsResponseModelImage: + return offerProductsResponseModelImageFromJson(data as OfferProductsResponseModelImage, json) as T; + case OfferProductsResponseModelSpecification: + return offerProductsResponseModelSpecificationFromJson(data as OfferProductsResponseModelSpecification, json) as T; + case GeoZonesResponseModel: + return geoZonesResponseModelEntityFromJson(data as GeoZonesResponseModel, json) as T; + } + return data as T; + } + + static _getToJson(Type type, data) { + switch (type) { + case OfferCategoriesResponseModel: + return offerCategoriesResponseModelToJson(data as OfferCategoriesResponseModel); + case OfferCategoriesResponseModelLocalizedName: + return offerCategoriesResponseModelLocalizedNameToJson(data as OfferCategoriesResponseModelLocalizedName); + case OfferCategoriesResponseModelImage: + return offerCategoriesResponseModelImageToJson(data as OfferCategoriesResponseModelImage); + case LogGeoZoneResponseModel: + return logGeoZoneResponseModelEntityToJson(data as LogGeoZoneResponseModel); + case OfferProductsResponseModel: + return offerProductsResponseModelToJson(data as OfferProductsResponseModel); + case OfferProductsResponseModelLocalizedName: + return offerProductsResponseModelLocalizedNameToJson(data as OfferProductsResponseModelLocalizedName); + case OfferProductsResponseModelImage: + return offerProductsResponseModelImageToJson(data as OfferProductsResponseModelImage); + case OfferProductsResponseModelSpecification: + return offerProductsResponseModelSpecificationToJson(data as OfferProductsResponseModelSpecification); + case GeoZonesResponseModel: + return geoZonesResponseModelEntityToJson(data as GeoZonesResponseModel); + } + return data as T; + } + + //Go back to a single instance by type + static _fromJsonSingle(json) { + String type = M.toString(); + if (type == (OfferCategoriesResponseModel).toString()) { + return OfferCategoriesResponseModel().fromJson(json); + } else if (type == (OfferCategoriesResponseModelLocalizedName).toString()) { + return OfferCategoriesResponseModelLocalizedName().fromJson(json); + } else if (type == (OfferCategoriesResponseModelImage).toString()) { + return OfferCategoriesResponseModelImage().fromJson(json); + } else if (type == (LogGeoZoneResponseModel).toString()) { + return LogGeoZoneResponseModel().fromJson(json); + } else if (type == (OfferProductsResponseModel).toString()) { + return OfferProductsResponseModel().fromJson(json); + } else if (type == (OfferProductsResponseModelLocalizedName).toString()) { + return OfferProductsResponseModelLocalizedName().fromJson(json); + } else if (type == (OfferProductsResponseModelImage).toString()) { + return OfferProductsResponseModelImage().fromJson(json); + } else if (type == (OfferProductsResponseModelSpecification).toString()) { + return OfferProductsResponseModelSpecification().fromJson(json); + } else if (type == (GeoZonesResponseModel).toString()) { + return GeoZonesResponseModel().fromJson(json); + } + return null; + } + + //list is returned by type + static M _getListChildType(List data) { + if (List() is M) { + return data.map((e) => OfferCategoriesResponseModel().fromJson(e)).toList() as M; + } else if (List() is M) { + return data.map((e) => OfferCategoriesResponseModelLocalizedName().fromJson(e)).toList() as M; + } else if (List() is M) { + return data.map((e) => OfferCategoriesResponseModelImage().fromJson(e)).toList() as M; + } else if (List() is M) { + return data.map((e) => LogGeoZoneResponseModel().fromJson(e)).toList() as M; + } else if (List() is M) { + return data.map((e) => OfferProductsResponseModel().fromJson(e)).toList() as M; + } else if (List() is M) { + return data.map((e) => OfferProductsResponseModelLocalizedName().fromJson(e)).toList() as M; + } else if (List() is M) { + return data.map((e) => OfferProductsResponseModelImage().fromJson(e)).toList() as M; + } else if (List() is M) { + return data.map((e) => OfferProductsResponseModelSpecification().fromJson(e)).toList() as M; + } else if (List() is M) { + return data.map((e) => GeoZonesResponseModel().fromJson(e)).toList() as M; + } + return null; + } + + static M fromJsonAsT(json) { + if (json is List) { + return _getListChildType(json); + } else { + return _fromJsonSingle(json) as M; + } + } +} diff --git a/lib/generated/json/base/json_field.dart b/lib/generated/json/base/json_field.dart new file mode 100644 index 00000000..bc92972b --- /dev/null +++ b/lib/generated/json/base/json_field.dart @@ -0,0 +1,21 @@ +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: camel_case_types +// ignore_for_file: prefer_single_quotes + +// This file is automatically generated. DO NOT EDIT, all your changes would be lost. + +class JSONField { + //Specify the parse field name + final String name; + + //Specify the time resolution format + final String format; + + //Whether to participate in toJson + final bool serialize; + + //Whether to participate in fromMap + final bool deserialize; + + const JSONField({this.name, this.format, this.serialize, this.deserialize}); +} diff --git a/lib/generated/json/log_geo_zone_response_model_entity_helper.dart b/lib/generated/json/log_geo_zone_response_model_entity_helper.dart new file mode 100644 index 00000000..28b8c996 --- /dev/null +++ b/lib/generated/json/log_geo_zone_response_model_entity_helper.dart @@ -0,0 +1,54 @@ +import 'package:diplomaticquarterapp/core/model/geofencing/responses/LogGeoZoneResponseModel.dart'; + +logGeoZoneResponseModelEntityFromJson(LogGeoZoneResponseModel data, Map json) { + if (json['LanguageID'] != null) { + data.languageID = json['LanguageID']?.toInt(); + } + if (json['ErrorCode'] != null) { + data.errorCode = json['ErrorCode']; + } + if (json['ErrorEndUserMessage'] != null) { + data.errorEndUserMessage = json['ErrorEndUserMessage']?.toString(); + } + if (json['ErrorEndUserMessageN'] != null) { + data.errorEndUserMessageN = json['ErrorEndUserMessageN']; + } + if (json['ErrorMessage'] != null) { + data.errorMessage = json['ErrorMessage']; + } + if (json['ErrorType'] != null) { + data.errorType = json['ErrorType']?.toInt(); + } + if (json['IsAuthenticated'] != null) { + data.isAuthenticated = json['IsAuthenticated']; + } + if (json['SuccessMsg'] != null) { + data.successMsg = json['SuccessMsg']; + } + if (json['SuccessMsgN'] != null) { + data.successMsgN = json['SuccessMsgN']; + } + if (json['statusCode'] != null) { + data.statusCode = json['statusCode']?.toInt(); + } + if (json['MessageStatus'] != null) { + data.messageStatus = json['MessageStatus']?.toInt(); + } + return data; +} + +Map logGeoZoneResponseModelEntityToJson(LogGeoZoneResponseModel entity) { + final Map data = new Map(); + data['LanguageID'] = entity.languageID; + data['ErrorCode'] = entity.errorCode; + data['ErrorEndUserMessage'] = entity.errorEndUserMessage; + data['ErrorEndUserMessageN'] = entity.errorEndUserMessageN; + data['ErrorMessage'] = entity.errorMessage; + data['ErrorType'] = entity.errorType; + data['IsAuthenticated'] = entity.isAuthenticated; + data['SuccessMsg'] = entity.successMsg; + data['SuccessMsgN'] = entity.successMsgN; + data['statusCode'] = entity.statusCode; + data['MessageStatus'] = entity.messageStatus; + return data; +} diff --git a/lib/locator.dart b/lib/locator.dart new file mode 100644 index 00000000..271bdf23 --- /dev/null +++ b/lib/locator.dart @@ -0,0 +1,208 @@ +import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart'; +import 'package:diplomaticquarterapp/core/service/qr_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; +import 'package:flutter_local_notifications/flutter_local_notifications.dart'; +import 'package:get_it/get_it.dart'; + +import 'core/service/AlHabibMedicalService/cmc_service.dart'; +import 'core/service/AlHabibMedicalService/e_referral_service.dart'; +import 'core/service/AlHabibMedicalService/home_health_care_service.dart'; +import 'core/service/AuthenticatedUserObject.dart'; +import 'core/service/appointment_rate_service.dart'; +import 'core/service/blood/blood_details_servies.dart'; +import 'core/service/blood/blood_donation_service.dart'; +import 'core/service/childvaccines/add_new_child_service.dart'; +import 'core/service/childvaccines/child_vaccines_service.dart'; +import 'core/service/childvaccines/delete_baby_service.dart'; +import 'core/service/childvaccines/user_information_service.dart'; +import 'core/service/childvaccines/vaccination_table_service.dart'; +import 'core/service/contactus/finadus_service.dart'; +import 'core/service/contactus/livechat_service.dart'; +import 'core/service/dashboard_service.dart'; +import 'core/service/er/am_service.dart'; +import 'core/service/er/er_service.dart'; +import 'core/service/feedback/feedback_service.dart'; +import 'core/service/geofencing/GeofencingServices.dart'; +import 'core/service/hospital_service.dart'; +import 'core/service/medical/ActiveMedicationsService.dart'; +import 'core/service/medical/AllergiesService.dart'; +import 'core/service/medical/BloodPressureService.dart'; +import 'core/service/medical/BloodSugarService.dart'; +import 'core/service/medical/EyeService.dart'; +import 'core/service/medical/PatientSickLeaveService.dart'; +import 'core/service/medical/WeightPressureService.dart'; +import 'core/service/medical/ask_doctor_services.dart'; +import 'core/service/medical/labs_service.dart'; +import 'core/service/medical/medical_service.dart'; +import 'core/service/medical/my_balance_service.dart'; +import 'core/service/medical/my_doctor_service.dart'; +import 'core/service/medical/prescriptions_service.dart'; +import 'core/service/medical/radiology_service.dart'; +import 'core/service/medical/reports_monthly_service.dart'; +import 'core/service/medical/vital_sign_service.dart'; +import 'core/service/packages_offers/PackagesOffersServices.dart'; +import 'core/service/parmacyModule/order-preview-service.dart'; +import 'core/service/notifications_service.dart'; +import 'core/service/privilege_service.dart'; +import 'core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'core/service/parmacyModule/parmacy_module_service.dart'; + +import 'core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; +import 'core/viewModels/appointment_rate_view_model.dart'; +import 'core/viewModels/blooddonation/blood_details_view_model.dart'; +import 'core/viewModels/blooddonation/booddonation_view_model.dart'; +import 'core/viewModels/child_vaccines/add_new_child_view_model.dart'; +import 'core/viewModels/child_vaccines/child_vaccines_view_model.dart'; +import 'core/viewModels/child_vaccines/vaccination_table_view_model.dart'; +import 'core/viewModels/contactus/findus_view_model.dart'; +import 'core/viewModels/contactus/livechat_view_model.dart'; +import 'core/viewModels/er/am_request_view_model.dart'; +import 'core/viewModels/er/near_hospital_view_model.dart'; +import 'core/viewModels/feedback/feedback_view_model.dart'; +import 'core/service/medical/reports_service.dart'; +import 'core/viewModels/hospital_view_model.dart'; +import 'core/viewModels/medical/ActiveMedicationsViewModel.dart'; +import 'core/viewModels/medical/AllergiesViewModel.dart'; +import 'core/viewModels/medical/EyeViewModel.dart'; +import 'core/viewModels/medical/ask_doctor_view_model.dart'; +import 'core/viewModels/medical/blood_pressure_view_model.dart'; +import 'core/viewModels/medical/labs_view_model.dart'; +import 'core/viewModels/medical/medical_view_model.dart'; +import 'core/viewModels/medical/my_balance_view_model.dart'; +import 'core/viewModels/medical/my_doctor_view_model.dart'; +import 'core/viewModels/medical/blood_sugar_view_model.dart'; +import 'core/viewModels/medical/patient_sick_leave_view_model.dart'; +import 'core/viewModels/medical/prescriptions_view_model.dart'; +import 'core/viewModels/medical/radiology_view_model.dart'; +import 'core/viewModels/medical/reports_monthly_view_model.dart'; +import 'core/viewModels/medical/vital_sign_view_model.dart'; +import 'core/viewModels/medical/reports_view_model.dart'; +import 'core/viewModels/medical/weight_pressure_view_model.dart'; +import 'core/viewModels/notifications_view_model.dart'; +import 'core/viewModels/packages_offers/PackagesOffersViewModel.dart'; +import 'core/viewModels/pharmacies_view_model.dart'; +import 'core/service/pharmacies_service.dart'; +import 'core/service/insurance_service.dart'; +import 'core/viewModels/insurance_card_View_model.dart'; +import 'core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; +import 'core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; +import 'core/viewModels/qr_view_model.dart'; +import 'core/viewModels/vaccine_view_model.dart'; +import 'core/service/vaccine_service.dart'; + +GetIt locator = GetIt.instance; + +///di +void setupLocator() { + /// Others + locator.registerLazySingleton(() => FlutterLocalNotificationsPlugin()); + + /// Services + locator.registerLazySingleton(() => AuthenticatedUserObject()); + locator.registerLazySingleton(() => HospitalService()); + locator.registerLazySingleton(() => PharmacyService()); + locator.registerLazySingleton(() => MyDoctorService()); + locator.registerLazySingleton(() => PrescriptionsService()); + locator.registerLazySingleton(() => LabsService()); + locator.registerLazySingleton(() => RadiologyService()); + locator.registerLazySingleton(() => FeedbackService()); + locator.registerLazySingleton(() => InsuranceCardService()); + locator.registerLazySingleton(() => VitalSignService()); + locator.registerLazySingleton(() => MedicalService()); + locator.registerLazySingleton(() => NavigationService()); + locator.registerLazySingleton(() => ReportsService()); + locator.registerLazySingleton(() => DashboardService()); + locator.registerLazySingleton(() => AppointmentRateService()); + locator.registerLazySingleton(() => QrService()); + locator.registerFactory(() => VaccineService()); + locator.registerLazySingleton(() => ReportsMonthlyService()); + locator.registerLazySingleton(() => ErService()); + locator.registerLazySingleton(() => AmService()); + locator.registerLazySingleton(() => EReferralService()); + locator.registerLazySingleton(() => HomeHealthCareService()); + locator.registerLazySingleton(() => CMCService()); + locator.registerLazySingleton(() => PatientSickLeaveService()); + locator.registerLazySingleton(() => MyBalanceService()); + locator.registerLazySingleton(() => BloodSugarService()); + locator.registerLazySingleton(() => BloodPressureService()); + locator.registerLazySingleton(() => WeightService()); + locator.registerLazySingleton(() => EyeService()); + locator.registerLazySingleton(() => ActiveMedicationsService()); + locator.registerLazySingleton(() => AskDoctorService()); + locator.registerLazySingleton(() => AllergiesService()); + locator.registerLazySingleton(() => FindusService()); + locator.registerLazySingleton(() => LiveChatService()); + locator.registerLazySingleton(() => H2OService()); + locator.registerLazySingleton(() => BloodDonationService()); + locator.registerLazySingleton(() => BloodDetailsService()); + locator.registerLazySingleton(() => ChildVaccinesService()); + locator.registerLazySingleton(() => UserInformationService()); + locator.registerLazySingleton(() => CreteNewBabyService()); + locator.registerLazySingleton(() => DeleteBabyService()); + + locator.registerLazySingleton(() => VaccinationTableService()); + locator.registerLazySingleton(() => NotificationService()); + locator.registerLazySingleton(() => PrivilegeService()); + locator.registerLazySingleton(() => PharmacyModuleService()); + locator.registerLazySingleton(() => OrderPreviewService()); + + /// View Model + locator.registerFactory(() => HospitalViewModel()); + locator.registerFactory(() => PharmacyViewModel()); + locator.registerFactory(() => MyDoctorViewModel()); + locator.registerFactory(() => PrescriptionsViewModel()); + locator.registerFactory(() => ReportsViewModel()); + locator.registerFactory(() => LabsViewModel()); + locator.registerFactory(() => RadiologyViewModel()); + locator.registerFactory(() => FeedbackViewModel()); + locator.registerFactory(() => VaccineViewModel()); + locator.registerFactory(() => VitalSignViewModel()); + locator.registerFactory(() => InsuranceViewModel()); + locator.registerFactory(() => MedicalViewModel()); + locator.registerFactory(() => DashboardViewModel()); + locator.registerFactory(() => AppointmentRateViewModel()); + locator.registerFactory(() => QrViewModel()); + locator.registerFactory(() => ReportsMonthlyViewModel()); + locator.registerFactory(() => NearHospitalViewModel()); + locator.registerFactory(() => AmRequestViewModel()); + locator.registerFactory(() => PatientSickLeaveViewMode()); + locator.registerFactory(() => MyBalanceViewModel()); + locator.registerFactory(() => EReferralViewModel()); + locator.registerFactory(() => FindusViewModel()); + locator.registerFactory(() => LiveChatViewModel()); + locator.registerFactory(() => BloodDonationViewModel()); + locator.registerFactory(() => BloodDeatailsViewModel()); + locator.registerFactory(() => ChildVaccinesViewModel()); + locator.registerFactory(() => UserInformationViewModel()); + locator.registerFactory(() => VaccinationTableViewModel()); + locator.registerFactory(() => AddNewChildViewModel()); + locator.registerFactory(() => H2OViewModel()); + locator.registerFactory(() => BloodSugarViewMode()); + locator.registerFactory(() => BloodPressureViewMode()); + locator.registerFactory(() => WeightPressureViewMode()); + locator.registerFactory(() => EyeViewModel()); + locator.registerFactory(() => ActiveMedicationsViewModel()); + locator.registerFactory(() => AskDoctorViewModel()); + + locator.registerFactory(() => AllergiesViewModel()); + locator.registerFactory(() => HomeHealthCareViewModel()); + locator.registerFactory(() => CMCViewModel()); + locator.registerFactory(() => NotificationViewModel()); + + locator.registerFactory(() => PharmacyModuleViewModel()); + locator.registerFactory(() => OrderPreviewViewModel()); + + // Offer And Packages + //---------------------- + locator.registerLazySingleton(() => OffersAndPackagesServices()); // offerPackagesServices Service + locator.registerFactory(() => OfferCategoriesViewModel()); // Categories View Model + locator.registerFactory(() => OfferProductsViewModel()); // Products View Model + + // Geofencing + // --------------------- + locator.registerLazySingleton(() => GeofencingServices()); // Geofencing Services +} diff --git a/lib/main.dart b/lib/main.dart index 42f2f024..9c415db5 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,19 +1,40 @@ -import 'package:diplomaticquarterapp/pages/home_page.dart'; -import 'package:diplomaticquarterapp/providers/project_provider.dart'; +import 'package:diplomaticquarterapp/theme/theme_notifier.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; +import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart'; +import 'package:diplomaticquarterapp/theme/theme_value.dart'; +import 'package:diplomaticquarterapp/uitl/HMG_Geofence.dart'; +import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; +import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; +import 'Constants.dart'; import 'config/size_config.dart'; +import 'core/model/geofencing/requests/GeoZonesRequestModel.dart'; +import 'core/service/geofencing/GeofencingServices.dart'; +import 'core/viewModels/project_view_model.dart'; +import 'locator.dart'; -void main() { - runApp(MyApp()); +void main() async { + setupLocator(); + runApp(ChangeNotifierProvider(create: (context) => ThemeNotifier(defaultTheme), child: MyApp())); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { + PlatformBridge.init(context); + LocalNotification.init(onNotificationClick: (payload){ + LocalNotification.getInstance().showNow(title: "Payload", subtitle: payload, payload: payload); + }); + + final themeNotifier = Provider.of(context); + precacheImage(AssetImage('assets/images/powerd-by.jpg'), context); return LayoutBuilder( builder: (context, constraints) { return OrientationBuilder( @@ -21,11 +42,20 @@ class MyApp extends StatelessWidget { SizeConfig().init(constraints, orientation); return MultiProvider( providers: [ - ChangeNotifierProvider( - create: (context) => ProjectProvider(), + ChangeNotifierProvider( + create: (context) => ProjectViewModel(), + ), + ChangeNotifierProvider(create: (context) => ToDoCountProviderModel()), + ChangeNotifierProvider(create: (context) => SearchProvider()), + ChangeNotifierProvider.value( + value: SearchProvider(), ), + StreamProvider.value( + value: RobotProvider().intStream(), + initialData: RobotProvider().setValue({}), + ) ], - child: Consumer( + child: Consumer( builder: (context, projectProvider, child) => MaterialApp( showSemanticsDebugger: false, title: 'Diplomatic Quarter App', @@ -34,12 +64,14 @@ class MyApp extends StatelessWidget { TranslationBaseDelegate(), GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, ], supportedLocales: [ const Locale('ar', ''), // Arabic const Locale('en', ''), // English ], theme: ThemeData( + fontFamily: projectProvider.isArabic ? 'Cairo' : 'WorkSans', primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, brightness: Brightness.light, @@ -52,16 +84,21 @@ class MyApp extends StatelessWidget { hintColor: Colors.grey[400], disabledColor: Colors.grey[300], errorColor: Color.fromRGBO(235, 80, 60, 1.0), + scaffoldBackgroundColor: Color(0xffE9E9E9), // Colors.grey[100], textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), - textSelectionHandleColor: Color.fromRGBO(80, 100, 253, 1.0), + textSelectionHandleColor: Colors.grey, canvasColor: Colors.white, backgroundColor: Color.fromRGBO(255, 255, 255, 1), highlightColor: Colors.grey[100].withOpacity(0.4), splashColor: Colors.transparent, - primaryColor: Color.fromRGBO(78, 62, 253, 1.0), - cursorColor: Color.fromRGBO(78, 62, 253, 1.0), + primaryColor: Colors.grey, + toggleableActiveColor: secondaryColor, + indicatorColor: secondaryColor, + bottomSheetTheme: BottomSheetThemeData(backgroundColor: HexColor('#E0E0E0')), + cursorColor: Colors.grey, + iconTheme: IconThemeData(), appBarTheme: AppBarTheme( - color: Color.fromRGBO(247, 248, 251, 1), + color: Colors.grey[700], brightness: Brightness.light, elevation: 0.0, actionsIconTheme: IconThemeData( @@ -69,12 +106,8 @@ class MyApp extends StatelessWidget { ), ), ), - initialRoute: '/', - routes: { - '/': (context) => MyHomePage( - title: 'Diplomatic Quarter App', - ) - }, + initialRoute: SPLASH, + routes: routes, debugShowCheckedModeBanner: false, ), ), diff --git a/lib/models/Appointments/AppoimentAllHistoryResultList.dart b/lib/models/Appointments/AppoimentAllHistoryResultList.dart new file mode 100644 index 00000000..045f759e --- /dev/null +++ b/lib/models/Appointments/AppoimentAllHistoryResultList.dart @@ -0,0 +1,294 @@ +class AppoitmentAllHistoryResultList { + String setupID; + int projectID; + int appointmentNo; + String appointmentDate; + dynamic appointmentDateN; + int appointmentType; + String bookDate; + int patientType; + int patientID; + int clinicID; + int doctorID; + String endDate; + String startTime; + String endTime; + int status; + int visitType; + int visitFor; + int patientStatusType; + int companyID; + int bookedBy; + String bookedOn; + dynamic confirmedBy; + dynamic confirmedOn; + dynamic arrivalChangedBy; + dynamic arrivedOn; + dynamic editedBy; + dynamic editedOn; + dynamic doctorName; + dynamic doctorNameN; + String statusDesc; + dynamic statusDescN; + bool vitalStatus; + dynamic vitalSignAppointmentNo; + int episodeID; + int actualDoctorRate; + String clinicName; + bool complainExists; + String doctorImageURL; + String doctorNameObj; + int doctorRate; + List doctorSpeciality; + String doctorTitle; + int gender; + String genderDescription; + bool iSAllowOnlineCheckedIN; + bool isActiveDoctor; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + int isFollowup; + bool isLiveCareAppointment; + bool isInOutPatient; + bool isMedicalReportRequested; + bool isOnlineCheckedIN; + String latitude; + dynamic listHISGetContactLensPerscription; + dynamic listHISGetGlassPerscription; + String longitude; + int nextAction; + int noOfPatientsRate; + int originalClinicID; + int originalProjectID; + String projectName; + String qR; + int remaniningHoursTocanPay; + bool sMSButtonVisable; + int serviceID; + + AppoitmentAllHistoryResultList( + {this.setupID, + this.projectID, + this.appointmentNo, + this.appointmentDate, + this.appointmentDateN, + this.appointmentType, + this.bookDate, + this.patientType, + this.patientID, + this.clinicID, + this.doctorID, + this.endDate, + this.startTime, + this.endTime, + this.status, + this.visitType, + this.visitFor, + this.patientStatusType, + this.companyID, + this.bookedBy, + this.bookedOn, + this.confirmedBy, + this.confirmedOn, + this.arrivalChangedBy, + this.arrivedOn, + this.editedBy, + this.editedOn, + this.doctorName, + this.doctorNameN, + this.statusDesc, + this.statusDescN, + this.vitalStatus, + this.vitalSignAppointmentNo, + this.episodeID, + this.actualDoctorRate, + this.clinicName, + this.complainExists, + this.doctorImageURL, + this.doctorNameObj, + this.doctorRate, + this.doctorSpeciality, + this.doctorTitle, + this.gender, + this.genderDescription, + this.iSAllowOnlineCheckedIN, + this.isActiveDoctor, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isFollowup, + this.isLiveCareAppointment, + this.isMedicalReportRequested, + this.isOnlineCheckedIN, + this.latitude, + this.listHISGetContactLensPerscription, + this.listHISGetGlassPerscription, + this.longitude, + this.nextAction, + this.noOfPatientsRate, + this.originalClinicID, + this.originalProjectID, + this.projectName, + this.qR, + this.remaniningHoursTocanPay, + this.sMSButtonVisable, + this.serviceID}); + + AppoitmentAllHistoryResultList.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + appointmentNo = json['AppointmentNo']; + appointmentDate = json['AppointmentDate']; + appointmentDateN = json['AppointmentDateN']; + appointmentType = json['AppointmentType']; + bookDate = json['BookDate']; + patientType = json['PatientType']; + patientID = json['PatientID']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + endDate = json['EndDate']; + startTime = json['StartTime']; + endTime = json['EndTime']; + status = json['Status']; + visitType = json['VisitType']; + visitFor = json['VisitFor']; + patientStatusType = json['PatientStatusType']; + companyID = json['CompanyID']; + bookedBy = json['BookedBy']; + bookedOn = json['BookedOn']; + confirmedBy = json['ConfirmedBy']; + confirmedOn = json['ConfirmedOn']; + arrivalChangedBy = json['ArrivalChangedBy']; + arrivedOn = json['ArrivedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + statusDesc = json['StatusDesc']; + statusDescN = json['StatusDescN']; + vitalStatus = json['VitalStatus']; + vitalSignAppointmentNo = json['VitalSignAppointmentNo']; + episodeID = json['EpisodeID']; + actualDoctorRate = json['ActualDoctorRate']; + clinicName = json['ClinicName']; + complainExists = json['ComplainExists']; + doctorImageURL = json['DoctorImageURL']; + doctorNameObj = json['DoctorNameObj']; + doctorRate = json['DoctorRate']; + doctorSpeciality = json['DoctorSpeciality'] != null + ? json['DoctorSpeciality'].cast() + : ["null"]; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + iSAllowOnlineCheckedIN = json['ISAllowOnlineCheckedIN']; + isActiveDoctor = json['IsActiveDoctor']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + isFollowup = json['IsFollowup']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + isInOutPatient = json['IsInOutPatient']; + isMedicalReportRequested = json['IsMedicalReportRequested']; + isOnlineCheckedIN = json['IsOnlineCheckedIN']; + latitude = json['Latitude']; + listHISGetContactLensPerscription = + json['List_HIS_GetContactLensPerscription']; + listHISGetGlassPerscription = json['List_HIS_GetGlassPerscription']; + longitude = json['Longitude']; + nextAction = json['NextAction']; + noOfPatientsRate = json['NoOfPatientsRate']; + originalClinicID = json['OriginalClinicID']; + originalProjectID = json['OriginalProjectID']; + projectName = json['ProjectName']; + qR = json['QR']; + remaniningHoursTocanPay = json['RemaniningHoursTocanPay']; + sMSButtonVisable = json['SMSButtonVisable']; + serviceID = json['ServiceID']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentDateN'] = this.appointmentDateN; + data['AppointmentType'] = this.appointmentType; + data['BookDate'] = this.bookDate; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['EndDate'] = this.endDate; + data['StartTime'] = this.startTime; + data['EndTime'] = this.endTime; + data['Status'] = this.status; + data['VisitType'] = this.visitType; + data['VisitFor'] = this.visitFor; + data['PatientStatusType'] = this.patientStatusType; + data['CompanyID'] = this.companyID; + data['BookedBy'] = this.bookedBy; + data['BookedOn'] = this.bookedOn; + data['ConfirmedBy'] = this.confirmedBy; + data['ConfirmedOn'] = this.confirmedOn; + data['ArrivalChangedBy'] = this.arrivalChangedBy; + data['ArrivedOn'] = this.arrivedOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['StatusDesc'] = this.statusDesc; + data['StatusDescN'] = this.statusDescN; + data['VitalStatus'] = this.vitalStatus; + data['VitalSignAppointmentNo'] = this.vitalSignAppointmentNo; + data['EpisodeID'] = this.episodeID; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['ClinicName'] = this.clinicName; + data['ComplainExists'] = this.complainExists; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorNameObj'] = this.doctorNameObj; + data['DoctorRate'] = this.doctorRate; + data['DoctorSpeciality'] = this.doctorSpeciality; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['ISAllowOnlineCheckedIN'] = this.iSAllowOnlineCheckedIN; + data['IsActiveDoctor'] = this.isActiveDoctor; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsFollowup'] = this.isFollowup; + data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + data['IsInOutPatient'] = this.isInOutPatient; + data['IsMedicalReportRequested'] = this.isMedicalReportRequested; + data['IsOnlineCheckedIN'] = this.isOnlineCheckedIN; + data['Latitude'] = this.latitude; + data['List_HIS_GetContactLensPerscription'] = + this.listHISGetContactLensPerscription; + data['List_HIS_GetGlassPerscription'] = this.listHISGetGlassPerscription; + data['Longitude'] = this.longitude; + data['NextAction'] = this.nextAction; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['OriginalClinicID'] = this.originalClinicID; + data['OriginalProjectID'] = this.originalProjectID; + data['ProjectName'] = this.projectName; + data['QR'] = this.qR; + data['RemaniningHoursTocanPay'] = this.remaniningHoursTocanPay; + data['SMSButtonVisable'] = this.sMSButtonVisable; + data['ServiceID'] = this.serviceID; + return data; + } +} + +class PatientAppointmentList { + String filterName = ""; + List patientDoctorAppointmentList = List(); + + PatientAppointmentList( + {this.filterName, + AppoitmentAllHistoryResultList patientDoctorAppointment}) { + patientDoctorAppointmentList.add(patientDoctorAppointment); + } +} diff --git a/lib/models/Appointments/DentalChiefComplaintsModel.dart b/lib/models/Appointments/DentalChiefComplaintsModel.dart new file mode 100644 index 00000000..c15b828a --- /dev/null +++ b/lib/models/Appointments/DentalChiefComplaintsModel.dart @@ -0,0 +1,48 @@ +class DentalChiefComplaintsModel { + List listDentalChiefComplain; + + DentalChiefComplaintsModel({this.listDentalChiefComplain}); + + DentalChiefComplaintsModel.fromJson(Map json) { + if (json['List_DentalChiefComplain'] != null) { + listDentalChiefComplain = new List(); + json['List_DentalChiefComplain'].forEach((v) { + listDentalChiefComplain.add(new ListDentalChiefComplain.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.listDentalChiefComplain != null) { + data['List_DentalChiefComplain'] = + this.listDentalChiefComplain.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ListDentalChiefComplain { + int projectID; + int iD; + String name; + String nameN; + + ListDentalChiefComplain({this.projectID, this.iD, this.name, this.nameN}); + + ListDentalChiefComplain.fromJson(Map json) { + projectID = json['ProjectID']; + iD = json['ID']; + name = json['Name']; + nameN = json['NameN']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['ID'] = this.iD; + data['Name'] = this.name; + data['NameN'] = this.nameN; + return data; + } +} diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart new file mode 100644 index 00000000..4c7241c8 --- /dev/null +++ b/lib/models/Appointments/DoctorListResponse.dart @@ -0,0 +1,182 @@ +class DoctorList { + int clinicID; + String clinicName; + String doctorTitle; + int iD; + String name; + int projectID; + String projectName; + int actualDoctorRate; + int clinicRoomNo; + dynamic date; + dynamic dayName; + int doctorID; + String doctorImageURL; + dynamic doctorProfile; + dynamic doctorProfileInfo; + int doctorRate; + int gender; + String genderDescription; + bool isAppointmentAllowed; + bool isDoctorAllowVedioCall; + bool isDoctorDummy; + bool isLiveCare; + String latitude; + String longitude; + String nationalityFlagURL; + String nationalityID; + String nationalityName; + dynamic nearestFreeSlot; + int noOfPatientsRate; + int originalClinicID; + int personRate; + dynamic projectDistanceInKiloMeters; + String qR; + dynamic qRString; + int rateNumber; + dynamic serviceID; + String setupID; + List speciality; + dynamic workingHours; + + DoctorList( + {this.clinicID, + this.clinicName, + this.doctorTitle, + this.iD, + this.name, + this.projectID, + this.projectName, + this.actualDoctorRate, + this.clinicRoomNo, + this.date, + this.dayName, + this.doctorID, + this.doctorImageURL, + this.doctorProfile, + this.doctorProfileInfo, + this.doctorRate, + this.gender, + this.genderDescription, + this.isAppointmentAllowed, + this.isDoctorAllowVedioCall, + this.isDoctorDummy, + this.isLiveCare, + this.latitude, + this.longitude, + this.nationalityFlagURL, + this.nationalityID, + this.nationalityName, + this.nearestFreeSlot, + this.noOfPatientsRate, + this.originalClinicID, + this.personRate, + this.projectDistanceInKiloMeters, + this.qR, + this.qRString, + this.rateNumber, + this.serviceID, + this.setupID, + this.speciality, + this.workingHours}); + + DoctorList.fromJson(Map json) { + clinicID = json['ClinicID']; + clinicName = json['ClinicName']; + doctorTitle = json['DoctorTitle']; + iD = json['ID']; + name = json['DoctorName']??json['Name']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + actualDoctorRate = json['ActualDoctorRate']; + clinicRoomNo = json['ClinicRoomNo']; + date = json['Date']; + dayName = json['DayName']; + doctorID = json['DoctorID']; + doctorImageURL = json['DoctorImageURL']; + doctorProfile = json['DoctorProfile']; + doctorProfileInfo = json['DoctorProfileInfo']; + doctorRate = json['DoctorRate']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isAppointmentAllowed = json['IsAppointmentAllowed']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isDoctorDummy = json['IsDoctorDummy']; + isLiveCare = json['IsLiveCare']; + latitude = json['Latitude']; + longitude = json['Longitude']; + nationalityFlagURL = json['NationalityFlagURL']; + nationalityID = json['NationalityID']; + nationalityName = json['NationalityName']; + nearestFreeSlot = json['NearestFreeSlot']; + noOfPatientsRate = json['NoOfPatientsRate']; + originalClinicID = json['OriginalClinicID']; + personRate = json['PersonRate']; + projectDistanceInKiloMeters = json['ProjectDistanceInKiloMeters']; + qR = json['QR']; + qRString = json['QRString']; + rateNumber = json['RateNumber']; + serviceID = json['ServiceID']; + setupID = json['SetupID']; + if (json.containsKey('Speciality') && json['Speciality']!=null) + speciality = json['Speciality'].cast(); + workingHours = json['WorkingHours']; + } + + Map toJson() { + final Map data = new Map(); + data['ClinicID'] = this.clinicID; + data['ClinicName'] = this.clinicName; + data['DoctorTitle'] = this.doctorTitle; + data['ID'] = this.iD; + data['Name'] = this.name; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['ClinicRoomNo'] = this.clinicRoomNo; + data['Date'] = this.date; + data['DayName'] = this.dayName; + data['DoctorID'] = this.doctorID; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorProfile'] = this.doctorProfile; + data['DoctorProfileInfo'] = this.doctorProfileInfo; + data['DoctorRate'] = this.doctorRate; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['IsAppointmentAllowed'] = this.isAppointmentAllowed; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsDoctorDummy'] = this.isDoctorDummy; + data['IsLiveCare'] = this.isLiveCare; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['NationalityFlagURL'] = this.nationalityFlagURL; + data['NationalityID'] = this.nationalityID; + data['NationalityName'] = this.nationalityName; + data['NearestFreeSlot'] = this.nearestFreeSlot; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['OriginalClinicID'] = this.originalClinicID; + data['PersonRate'] = this.personRate; + data['ProjectDistanceInKiloMeters'] = this.projectDistanceInKiloMeters; + data['QR'] = this.qR; + data['QRString'] = this.qRString; + data['RateNumber'] = this.rateNumber; + data['ServiceID'] = this.serviceID; + data['SetupID'] = this.setupID; + data['Speciality'] = this.speciality; + data['WorkingHours'] = this.workingHours; + return data; + } +} + +class PatientDoctorAppointmentList { + String filterName = ""; + String distanceInKMs = ""; + List patientDoctorAppointmentList = List(); + + PatientDoctorAppointmentList( + {this.filterName, + this.distanceInKMs, + DoctorList patientDoctorAppointment}) { + patientDoctorAppointmentList.add(patientDoctorAppointment); + } +} diff --git a/lib/models/Appointments/DoctorProfile.dart b/lib/models/Appointments/DoctorProfile.dart new file mode 100644 index 00000000..bfc8c189 --- /dev/null +++ b/lib/models/Appointments/DoctorProfile.dart @@ -0,0 +1,176 @@ +class DoctorProfileList { + int doctorID; + String doctorName; + Null doctorNameN; + int clinicID; + String clinicDescription; + Null clinicDescriptionN; + Null licenseExpiry; + int employmentType; + Null setupID; + int projectID; + String projectName; + String nationalityID; + String nationalityName; + Null nationalityNameN; + int gender; + String genderDescription; + Null genderDescriptionN; + Null doctorTitle; + Null projectNameN; + bool isAllowWaitList; + String titleDescription; + Null titleDescriptionN; + Null isRegistered; + Null isDoctorDummy; + bool isActive; + Null isDoctorAppointmentDisplayed; + bool doctorClinicActive; + Null isbookingAllowed; + String doctorCases; + Null doctorPicture; + String doctorProfileInfo; + List specialty; + int actualDoctorRate; + String doctorImageURL; + int doctorRate; + String doctorTitleForProfile; + bool isAppointmentAllowed; + String nationalityFlagURL; + int noOfPatientsRate; + String qR; + int serviceID; + + DoctorProfileList( + {this.doctorID, + this.doctorName, + this.doctorNameN, + this.clinicID, + this.clinicDescription, + this.clinicDescriptionN, + this.licenseExpiry, + this.employmentType, + this.setupID, + this.projectID, + this.projectName, + this.nationalityID, + this.nationalityName, + this.nationalityNameN, + this.gender, + this.genderDescription, + this.genderDescriptionN, + this.doctorTitle, + this.projectNameN, + this.isAllowWaitList, + this.titleDescription, + this.titleDescriptionN, + this.isRegistered, + this.isDoctorDummy, + this.isActive, + this.isDoctorAppointmentDisplayed, + this.doctorClinicActive, + this.isbookingAllowed, + this.doctorCases, + this.doctorPicture, + this.doctorProfileInfo, + this.specialty, + this.actualDoctorRate, + this.doctorImageURL, + this.doctorRate, + this.doctorTitleForProfile, + this.isAppointmentAllowed, + this.nationalityFlagURL, + this.noOfPatientsRate, + this.qR, + this.serviceID}); + + DoctorProfileList.fromJson(Map json) { + doctorID = json['DoctorID']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + clinicID = json['ClinicID']; + clinicDescription = json['ClinicDescription']; + clinicDescriptionN = json['ClinicDescriptionN']; + licenseExpiry = json['LicenseExpiry']; + employmentType = json['EmploymentType']; + setupID = json['SetupID']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + nationalityID = json['NationalityID']; + nationalityName = json['NationalityName']; + nationalityNameN = json['NationalityNameN']; + gender = json['Gender']; + genderDescription = json['Gender_Description']; + genderDescriptionN = json['Gender_DescriptionN']; + doctorTitle = json['DoctorTitle']; + projectNameN = json['ProjectNameN']; + isAllowWaitList = json['IsAllowWaitList']; + titleDescription = json['Title_Description']; + titleDescriptionN = json['Title_DescriptionN']; + isRegistered = json['IsRegistered']; + isDoctorDummy = json['IsDoctorDummy']; + isActive = json['IsActive']; + isDoctorAppointmentDisplayed = json['IsDoctorAppointmentDisplayed']; + doctorClinicActive = json['DoctorClinicActive']; + isbookingAllowed = json['IsbookingAllowed']; + doctorCases = json['DoctorCases']; + doctorPicture = json['DoctorPicture']; + doctorProfileInfo = json['DoctorProfileInfo']; + specialty = json['Specialty'].cast(); + actualDoctorRate = json['ActualDoctorRate']; + doctorImageURL = json['DoctorImageURL']; + doctorRate = json['DoctorRate']; + doctorTitleForProfile = json['DoctorTitleForProfile']; + isAppointmentAllowed = json['IsAppointmentAllowed']; + nationalityFlagURL = json['NationalityFlagURL']; + noOfPatientsRate = json['NoOfPatientsRate']; + qR = json['QR']; + serviceID = json['ServiceID']; + } + + Map toJson() { + final Map data = new Map(); + data['DoctorID'] = this.doctorID; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['ClinicID'] = this.clinicID; + data['ClinicDescription'] = this.clinicDescription; + data['ClinicDescriptionN'] = this.clinicDescriptionN; + data['LicenseExpiry'] = this.licenseExpiry; + data['EmploymentType'] = this.employmentType; + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['NationalityID'] = this.nationalityID; + data['NationalityName'] = this.nationalityName; + data['NationalityNameN'] = this.nationalityNameN; + data['Gender'] = this.gender; + data['Gender_Description'] = this.genderDescription; + data['Gender_DescriptionN'] = this.genderDescriptionN; + data['DoctorTitle'] = this.doctorTitle; + data['ProjectNameN'] = this.projectNameN; + data['IsAllowWaitList'] = this.isAllowWaitList; + data['Title_Description'] = this.titleDescription; + data['Title_DescriptionN'] = this.titleDescriptionN; + data['IsRegistered'] = this.isRegistered; + data['IsDoctorDummy'] = this.isDoctorDummy; + data['IsActive'] = this.isActive; + data['IsDoctorAppointmentDisplayed'] = this.isDoctorAppointmentDisplayed; + data['DoctorClinicActive'] = this.doctorClinicActive; + data['IsbookingAllowed'] = this.isbookingAllowed; + data['DoctorCases'] = this.doctorCases; + data['DoctorPicture'] = this.doctorPicture; + data['DoctorProfileInfo'] = this.doctorProfileInfo; + data['Specialty'] = this.specialty; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitleForProfile'] = this.doctorTitleForProfile; + data['IsAppointmentAllowed'] = this.isAppointmentAllowed; + data['NationalityFlagURL'] = this.nationalityFlagURL; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['QR'] = this.qR; + data['ServiceID'] = this.serviceID; + return data; + } +} diff --git a/lib/models/Appointments/DoctorRateDetails.dart b/lib/models/Appointments/DoctorRateDetails.dart new file mode 100644 index 00000000..b29a5db9 --- /dev/null +++ b/lib/models/Appointments/DoctorRateDetails.dart @@ -0,0 +1,32 @@ +class DoctorRateDetails { + dynamic doctorID; + dynamic projectID; + dynamic clinicID; + dynamic rate; + dynamic patientNumber; + + DoctorRateDetails( + {this.doctorID, + this.projectID, + this.clinicID, + this.rate, + this.patientNumber}); + + DoctorRateDetails.fromJson(Map json) { + doctorID = json['DoctorID']; + projectID = json['ProjectID']; + clinicID = json['ClinicID']; + rate = json['Rate']; + patientNumber = json['PatientNumber']; + } + + Map toJson() { + final Map data = new Map(); + data['DoctorID'] = this.doctorID; + data['ProjectID'] = this.projectID; + data['ClinicID'] = this.clinicID; + data['Rate'] = this.rate; + data['PatientNumber'] = this.patientNumber; + return data; + } +} diff --git a/lib/models/Appointments/FreeSlot.dart b/lib/models/Appointments/FreeSlot.dart new file mode 100644 index 00000000..46692982 --- /dev/null +++ b/lib/models/Appointments/FreeSlot.dart @@ -0,0 +1,12 @@ +class FreeSlot { + List event; + DateTime slot; + + + FreeSlot(this.slot, this.event); + + @override + String toString() { + return '{ ${this.slot}, ${this.event} }'; + } +} \ No newline at end of file diff --git a/lib/models/Appointments/InsertAppointmentRequest.dart b/lib/models/Appointments/InsertAppointmentRequest.dart new file mode 100644 index 00000000..383e2eb5 --- /dev/null +++ b/lib/models/Appointments/InsertAppointmentRequest.dart @@ -0,0 +1,20 @@ +import 'package:diplomaticquarterapp/models/Request.dart'; + +class InsertAppointmentRequest extends Request { + String AppointmentDate; // ???? "/Date(1577750400000)/" + int DoctorID; + int InitialSlotDuration; + String SelectedTime; + String StartTime; + String EndTime; + String TempValue; + int VisitFor; + int VisitType; + bool IsVirtual; + List GeneralProcedureList; + String DeviceToken; + bool IsForLiveCare; + String OriginalClinicID; + String OriginalProjectID; + +} diff --git a/lib/models/Appointments/PatientShareResposne.dart b/lib/models/Appointments/PatientShareResposne.dart new file mode 100644 index 00000000..40670990 --- /dev/null +++ b/lib/models/Appointments/PatientShareResposne.dart @@ -0,0 +1,212 @@ +class PatientShareResponse { + int advanceNumber; + dynamic appointmentDate; + int appointmentNo; + int cashPrice; + int cashPriceTax; + int cashPriceWithTax; + int clinicID; + dynamic clinicName; + int companyId; + dynamic companyName; + int companyShareWithTax; + dynamic doctorImageURL; + dynamic doctorNameObj; + int doctorID; + List doctorSpeciality; + dynamic errCode; + int groupID; + bool iSAllowOnlineCheckedIN; + dynamic insurancePolicyNo; + bool isExcludedForOnlineCheckin; + int isFollowup; + bool isLiveCareAppointment; + bool isOnlineCheckedIN; + dynamic message; + int nextAction; + dynamic patientCardID; + int patientID; + dynamic patientShare; + dynamic patientShareWithTax; + int patientStatusType; + dynamic patientTaxAmount; + dynamic patientType; + int paymentAmount; + dynamic paymentDate; + dynamic paymentMethodName; + dynamic paymentReferenceNumber; + int policyId; + dynamic policyName; + dynamic procedureName; + int projectID; + dynamic projectName; + dynamic setupID; + int sourceType; + dynamic startTime; + int status; + int statusCode; + dynamic statusDesc; + dynamic subPolicyNo; + int userID; + int serviceID; + + PatientShareResponse( + {this.advanceNumber, + this.appointmentDate, + this.appointmentNo, + this.cashPrice, + this.cashPriceTax, + this.cashPriceWithTax, + this.clinicID, + this.clinicName, + this.companyId, + this.companyName, + this.companyShareWithTax, + this.doctorID, + this.doctorImageURL, + this.doctorNameObj, + this.doctorSpeciality, + this.errCode, + this.groupID, + this.iSAllowOnlineCheckedIN, + this.insurancePolicyNo, + this.isExcludedForOnlineCheckin, + this.isFollowup, + this.isLiveCareAppointment, + this.isOnlineCheckedIN, + this.message, + this.nextAction, + this.patientCardID, + this.patientID, + this.patientShare, + this.patientShareWithTax, + this.patientStatusType, + this.patientTaxAmount, + this.patientType, + this.paymentAmount, + this.paymentDate, + this.paymentMethodName, + this.paymentReferenceNumber, + this.policyId, + this.policyName, + this.procedureName, + this.projectID, + this.projectName, + this.setupID, + this.sourceType, + this.startTime, + this.status, + this.statusCode, + this.statusDesc, + this.subPolicyNo, + this.userID, + this.serviceID}); + + PatientShareResponse.fromJson(Map json) { + advanceNumber = json['AdvanceNumber']; + appointmentDate = json['AppointmentDate']; + appointmentNo = json['AppointmentNo']; + cashPrice = json['CashPrice']; + cashPriceTax = json['CashPriceTax']; + cashPriceWithTax = json['CashPriceWithTax']; + clinicID = json['ClinicID']; + clinicName = json['ClinicName']; + companyId = json['CompanyId']; + companyName = json['CompanyName']; + companyShareWithTax = json['CompanyShareWithTax']; + doctorID = json['DoctorID']; + doctorImageURL = json['DoctorImageURL']; + doctorNameObj = json['DoctorNameObj']; +// doctorSpeciality = json['DoctorSpeciality'].cast(); + errCode = json['ErrCode']; + groupID = json['GroupID']; + iSAllowOnlineCheckedIN = json['ISAllowOnlineCheckedIN']; + insurancePolicyNo = json['InsurancePolicyNo']; + isExcludedForOnlineCheckin = json['IsExcludedForOnlineCheckin']; + isFollowup = json['IsFollowup']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + isOnlineCheckedIN = json['IsOnlineCheckedIN']; + message = json['Message']; + nextAction = json['NextAction']; + patientCardID = json['PatientCardID']; + patientID = json['PatientID']; + patientShare = json['PatientShare']; + patientShareWithTax = json['PatientShareWithTax']; + patientStatusType = json['PatientStatusType']; + patientTaxAmount = json['PatientTaxAmount']; + patientType = json['PatientType']; + paymentAmount = json['PaymentAmount']; + paymentDate = json['PaymentDate']; + paymentMethodName = json['PaymentMethodName']; + paymentReferenceNumber = json['PaymentReferenceNumber']; + policyId = json['PolicyId']; + policyName = json['PolicyName']; + procedureName = json['ProcedureName']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + setupID = json['SetupID']; + sourceType = json['SourceType']; + startTime = json['StartTime']; + status = json['Status']; + statusCode = json['StatusCode']; + statusDesc = json['StatusDesc']; + subPolicyNo = json['SubPolicyNo']; + userID = json['UserID']; + serviceID = json['ServiceID']; + } + + Map toJson() { + final Map data = new Map(); + data['AdvanceNumber'] = this.advanceNumber; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentNo'] = this.appointmentNo; + data['CashPrice'] = this.cashPrice; + data['CashPriceTax'] = this.cashPriceTax; + data['CashPriceWithTax'] = this.cashPriceWithTax; + data['ClinicID'] = this.clinicID; + data['ClinicName'] = this.clinicName; + data['CompanyId'] = this.companyId; + data['CompanyName'] = this.companyName; + data['CompanyShareWithTax'] = this.companyShareWithTax; + data['DoctorID'] = this.doctorID; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorNameObj'] = this.doctorNameObj; + data['DoctorSpeciality'] = this.doctorSpeciality; + data['ErrCode'] = this.errCode; + data['GroupID'] = this.groupID; + data['ISAllowOnlineCheckedIN'] = this.iSAllowOnlineCheckedIN; + data['InsurancePolicyNo'] = this.insurancePolicyNo; + data['IsExcludedForOnlineCheckin'] = this.isExcludedForOnlineCheckin; + data['IsFollowup'] = this.isFollowup; + data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + data['IsOnlineCheckedIN'] = this.isOnlineCheckedIN; + data['Message'] = this.message; + data['NextAction'] = this.nextAction; + data['PatientCardID'] = this.patientCardID; + data['PatientID'] = this.patientID; + data['PatientShare'] = this.patientShare; + data['PatientShareWithTax'] = this.patientShareWithTax; + data['PatientStatusType'] = this.patientStatusType; + data['PatientTaxAmount'] = this.patientTaxAmount; + data['PatientType'] = this.patientType; + data['PaymentAmount'] = this.paymentAmount; + data['PaymentDate'] = this.paymentDate; + data['PaymentMethodName'] = this.paymentMethodName; + data['PaymentReferenceNumber'] = this.paymentReferenceNumber; + data['PolicyId'] = this.policyId; + data['PolicyName'] = this.policyName; + data['ProcedureName'] = this.procedureName; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['SetupID'] = this.setupID; + data['SourceType'] = this.sourceType; + data['StartTime'] = this.startTime; + data['Status'] = this.status; + data['StatusCode'] = this.statusCode; + data['StatusDesc'] = this.statusDesc; + data['SubPolicyNo'] = this.subPolicyNo; + data['UserID'] = this.userID; + data['ServiceID'] = this.serviceID; + return data; + } +} diff --git a/lib/models/Appointments/SearchInfoModel.dart b/lib/models/Appointments/SearchInfoModel.dart new file mode 100644 index 00000000..f5500bca --- /dev/null +++ b/lib/models/Appointments/SearchInfoModel.dart @@ -0,0 +1,10 @@ +class SearchInfo { + int ProjectID; + int ClinicID; + String DoctorName; + String SelectedDate; + String SelectedTime; + String currentLat; + String currentLong; + DateTime date; +} diff --git a/lib/models/Appointments/appoDetailsButtons.dart b/lib/models/Appointments/appoDetailsButtons.dart new file mode 100644 index 00000000..adce8b93 --- /dev/null +++ b/lib/models/Appointments/appoDetailsButtons.dart @@ -0,0 +1,24 @@ +class AppoDetailsButton { + String title; + String subtitle; + String icon; + String caller; + + AppoDetailsButton({this.title, this.subtitle, this.icon, this.caller}); + + AppoDetailsButton.fromJson(Map json) { + title = json['title']; + subtitle = json['subtitle']; + icon = json['icon']; + caller = json['caller']; + } + + Map toJson() { + final Map data = new Map(); + data['title'] = this.title; + data['subtitle'] = this.subtitle; + data['icon'] = this.icon; + data['caller'] = this.caller; + return data; + } +} diff --git a/lib/models/Appointments/getClinicsRequest.dart b/lib/models/Appointments/getClinicsRequest.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/models/Appointments/timeSlot.dart b/lib/models/Appointments/timeSlot.dart new file mode 100644 index 00000000..58926fac --- /dev/null +++ b/lib/models/Appointments/timeSlot.dart @@ -0,0 +1,10 @@ +import 'package:flutter/cupertino.dart'; + +class TimeSlot { + String isoTime; + DateTime start; + DateTime end; + + TimeSlot({@required this.isoTime, @required this.start, @required this.end}); + +} diff --git a/lib/models/Appointments/toDoCountProviderModel.dart b/lib/models/Appointments/toDoCountProviderModel.dart new file mode 100644 index 00000000..e44a0ebb --- /dev/null +++ b/lib/models/Appointments/toDoCountProviderModel.dart @@ -0,0 +1,16 @@ +import 'package:flutter/cupertino.dart'; + +class ToDoCountProviderModel with ChangeNotifier { + int _count; + bool _isShowBadge = false; + + int get count => _count == null ? 0 : _count; + + bool get isShowBadge => _isShowBadge; + + void setState(int count, bool isShowBadge) { + _count = count; + _isShowBadge = isShowBadge; + notifyListeners(); + } +} diff --git a/lib/models/Authentication/authenticated_user.dart b/lib/models/Authentication/authenticated_user.dart new file mode 100644 index 00000000..4c7974a3 --- /dev/null +++ b/lib/models/Authentication/authenticated_user.dart @@ -0,0 +1,289 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class AuthenticatedUser { + String setupID; + int patientType; + int patientID; + String firstName; + String middleName; + String lastName; + String firstNameN; + String middleNameN; + String lastNameN; + int relationshipID; + int gender; + String dateofBirth; + DateTime dateofBirthDataTime; + dynamic dateofBirthN; + String nationalityID; + dynamic phoneResi; + dynamic phoneOffice; + String mobileNumber; + dynamic faxNumber; + String emailAddress; + dynamic bloodGroup; + dynamic rHFactor; + bool isEmailAlertRequired; + bool isSMSAlertRequired; + String preferredLanguage; + bool isPrivilegedMember; + dynamic memberID; + dynamic expiryDate; + dynamic isHmgEmployee; + dynamic employeeID; + dynamic emergencyContactName; + dynamic emergencyContactNo; + int patientPayType; + dynamic dHCCPatientRefID; + bool isPatientDummy; + int status; + dynamic isStatusCleared; + int patientIdentificationType; + String patientIdentificationNo; + int projectID; + int infoSourceID; + dynamic address; + int age; + String ageDesc; + int areaID; + int createdBy; + String genderDescription; + dynamic iR; + dynamic iSOCityID; + dynamic iSOCountryID; + List listPrivilege; + dynamic marital; + int outSA; + dynamic pOBox; + bool receiveHealthSummaryReport; + int sourceType; + dynamic strDateofBirth; + dynamic tempAddress; + dynamic zipCode; + dynamic isFamily; + // dynamic patientPayType; + // dynamic patientType; + // dynamic status; + + AuthenticatedUser({ + this.setupID, + this.patientType, + this.patientID, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.relationshipID, + this.gender, + this.dateofBirth, + this.dateofBirthN, + this.nationalityID, + this.phoneResi, + this.phoneOffice, + this.mobileNumber, + this.faxNumber, + this.emailAddress, + this.bloodGroup, + this.rHFactor, + this.isEmailAlertRequired, + this.isSMSAlertRequired, + this.preferredLanguage, + this.isPrivilegedMember, + this.memberID, + this.expiryDate, + this.isHmgEmployee, + this.employeeID, + this.emergencyContactName, + this.emergencyContactNo, + this.patientPayType, + this.dHCCPatientRefID, + this.isPatientDummy, + this.status, + this.isStatusCleared, + this.patientIdentificationType, + this.patientIdentificationNo, + this.projectID, + this.infoSourceID, + this.address, + this.age, + this.ageDesc, + this.areaID, + this.createdBy, + this.genderDescription, + this.iR, + this.iSOCityID, + this.iSOCountryID, + this.listPrivilege, + this.marital, + this.outSA, + this.pOBox, + this.receiveHealthSummaryReport, + this.sourceType, + this.strDateofBirth, + this.tempAddress, + this.zipCode, + this.isFamily + }); + + AuthenticatedUser.fromJson(Map json) { + setupID = json['SetupID']; + patientType = json['PatientType']; + patientID = json['PatientID']; + firstName = json['FirstName']; + middleName = json['MiddleName']; + lastName = json['LastName']; + firstNameN = json['FirstNameN']; + middleNameN = json['MiddleNameN']; + lastNameN = json['LastNameN']; + relationshipID = json['RelationshipID']; + gender = json['Gender']; + dateofBirth = json['DateofBirth']; + dateofBirthDataTime = DateUtil.convertStringToDate(json['DateofBirth']); + dateofBirthN = json['DateofBirthN']; + nationalityID = json['NationalityID']; + phoneResi = json['PhoneResi']; + phoneOffice = json['PhoneOffice']; + mobileNumber = json['MobileNumber']; + faxNumber = json['FaxNumber']; + emailAddress = json['EmailAddress']; + bloodGroup = json['BloodGroup']; + rHFactor = json['RHFactor']; + isEmailAlertRequired = json['IsEmailAlertRequired']; + isSMSAlertRequired = json['IsSMSAlertRequired']; + preferredLanguage = json['PreferredLanguage']; + isPrivilegedMember = json['IsPrivilegedMember']; + memberID = json['MemberID']; + expiryDate = json['ExpiryDate']; + isHmgEmployee = json['IsHmgEmployee']; + employeeID = json['EmployeeID']; + emergencyContactName = json['EmergencyContactName']; + emergencyContactNo = json['EmergencyContactNo']; + patientPayType = json['PatientPayType']; + dHCCPatientRefID = json['DHCCPatientRefID']; + isPatientDummy = json['IsPatientDummy']; + status = json['Status']; + isStatusCleared = json['IsStatusCleared']; + patientIdentificationType = json['PatientIdentificationType']; + patientIdentificationNo = json['PatientIdentificationNo']; + projectID = json['ProjectID']; + infoSourceID = json['InfoSourceID']; + address = json['Address']; + age = json['Age']; + ageDesc = json['AgeDesc']; + areaID = json['AreaID']; + createdBy = json['CreatedBy']; + genderDescription = json['GenderDescription']; + iR = json['IR']; + iSOCityID = json['ISOCityID']; + iSOCountryID = json['ISOCountryID']; + if (json['ListPrivilege'] != null) { + listPrivilege = new List(); + json['ListPrivilege'].forEach((v) { + listPrivilege.add(new ListPrivilege.fromJson(v)); + }); + } + marital = json['Marital']; + outSA = json['OutSA']; + pOBox = json['POBox']; + receiveHealthSummaryReport = json['ReceiveHealthSummaryReport']; + sourceType = json['SourceType']; + strDateofBirth = json['StrDateofBirth']; + tempAddress = json['TempAddress']; + zipCode = json['ZipCode']; + isFamily = json['IsFamily']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['FirstName'] = this.firstName; + data['MiddleName'] = this.middleName; + data['LastName'] = this.lastName; + data['FirstNameN'] = this.firstNameN; + data['MiddleNameN'] = this.middleNameN; + data['LastNameN'] = this.lastNameN; + data['RelationshipID'] = this.relationshipID; + data['Gender'] = this.gender; + data['DateofBirth'] = this.dateofBirth; + data['DateofBirthN'] = this.dateofBirthN; + data['NationalityID'] = this.nationalityID; + data['PhoneResi'] = this.phoneResi; + data['PhoneOffice'] = this.phoneOffice; + data['MobileNumber'] = this.mobileNumber; + data['FaxNumber'] = this.faxNumber; + data['EmailAddress'] = this.emailAddress; + data['BloodGroup'] = this.bloodGroup; + data['RHFactor'] = this.rHFactor; + data['IsEmailAlertRequired'] = this.isEmailAlertRequired; + data['IsSMSAlertRequired'] = this.isSMSAlertRequired; + data['PreferredLanguage'] = this.preferredLanguage; + data['IsPrivilegedMember'] = this.isPrivilegedMember; + data['MemberID'] = this.memberID; + data['ExpiryDate'] = this.expiryDate; + data['IsHmgEmployee'] = this.isHmgEmployee; + data['EmployeeID'] = this.employeeID; + data['EmergencyContactName'] = this.emergencyContactName; + data['EmergencyContactNo'] = this.emergencyContactNo; + data['PatientPayType'] = this.patientPayType; + data['DHCCPatientRefID'] = this.dHCCPatientRefID; + data['IsPatientDummy'] = this.isPatientDummy; + data['Status'] = this.status; + data['IsStatusCleared'] = this.isStatusCleared; + data['PatientIdentificationType'] = this.patientIdentificationType; + data['PatientIdentificationNo'] = this.patientIdentificationNo; + data['ProjectID'] = this.projectID; + data['InfoSourceID'] = this.infoSourceID; + data['Address'] = this.address; + data['Age'] = this.age; + data['AgeDesc'] = this.ageDesc; + data['AreaID'] = this.areaID; + data['CreatedBy'] = this.createdBy; + data['GenderDescription'] = this.genderDescription; + data['IR'] = this.iR; + data['ISOCityID'] = this.iSOCityID; + data['ISOCountryID'] = this.iSOCountryID; + if (this.listPrivilege != null) { + data['ListPrivilege'] = + this.listPrivilege.map((v) => v.toJson()).toList(); + } + data['Marital'] = this.marital; + data['OutSA'] = this.outSA; + data['POBox'] = this.pOBox; + data['ReceiveHealthSummaryReport'] = this.receiveHealthSummaryReport; + data['SourceType'] = this.sourceType; + data['StrDateofBirth'] = this.strDateofBirth; + data['TempAddress'] = this.tempAddress; + data['ZipCode'] = this.zipCode; + data['IsFamily'] = this.isFamily; + return data; + } +} + +class ListPrivilege { + int iD; + String serviceName; + bool previlege; + dynamic region; + + ListPrivilege({this.iD, this.serviceName, this.previlege, this.region}); + + ListPrivilege.fromJson(Map json) { + iD = json['ID']; + serviceName = json['ServiceName']; + previlege = json['Previlege']; + region = json['Region']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['ServiceName'] = this.serviceName; + data['Previlege'] = this.previlege; + data['Region'] = this.region; + return data; + } +} diff --git a/lib/models/Authentication/check_activation_code_request.dart b/lib/models/Authentication/check_activation_code_request.dart new file mode 100644 index 00000000..af139ba5 --- /dev/null +++ b/lib/models/Authentication/check_activation_code_request.dart @@ -0,0 +1,107 @@ +class CheckActivationCodeReq { + int patientMobileNumber; + String mobileNo; + String deviceToken; + bool projectOutSA; + int loginType; + String zipCode; + bool isRegister; + String logInTokenID; + int searchType; + int patientID; + String nationalID; + String patientIdentificationID; + String activationCode; + bool isSilentLogin; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + bool forRegisteration; + CheckActivationCodeReq( + {this.patientMobileNumber, + this.mobileNo, + this.deviceToken, + this.projectOutSA, + this.loginType, + this.zipCode, + this.isRegister, + this.logInTokenID, + this.searchType, + this.patientID, + this.nationalID, + this.patientIdentificationID, + this.activationCode, + this.isSilentLogin, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.forRegisteration}); + + CheckActivationCodeReq.fromJson(Map json) { + patientMobileNumber = json['PatientMobileNumber']; + mobileNo = json['MobileNo']; + deviceToken = json['DeviceToken']; + projectOutSA = json['ProjectOutSA']; + loginType = json['LoginType']; + zipCode = json['ZipCode']; + isRegister = json['isRegister']; + logInTokenID = json['LogInTokenID']; + searchType = json['SearchType']; + patientID = json['PatientID']; + nationalID = json['NationalID']; + patientIdentificationID = json['PatientIdentificationID']; + activationCode = json['activationCode']; + isSilentLogin = json['IsSilentLogin']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + forRegisteration = json['ForRegisteration']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMobileNumber'] = this.patientMobileNumber; + data['MobileNo'] = this.mobileNo; + data['DeviceToken'] = this.deviceToken; + data['ProjectOutSA'] = this.projectOutSA; + data['LoginType'] = this.loginType; + data['ZipCode'] = this.zipCode; + data['isRegister'] = this.isRegister; + data['LogInTokenID'] = this.logInTokenID; + data['SearchType'] = this.searchType; + data['PatientID'] = this.patientID; + data['NationalID'] = this.nationalID; + data['PatientIdentificationID'] = this.patientIdentificationID; + data['activationCode'] = this.activationCode; + data['IsSilentLogin'] = this.isSilentLogin; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['ForRegisteration'] = this.forRegisteration; + return data; + } +} diff --git a/lib/models/Authentication/check_activation_code_response.dart b/lib/models/Authentication/check_activation_code_response.dart new file mode 100644 index 00000000..3a0aed65 --- /dev/null +++ b/lib/models/Authentication/check_activation_code_response.dart @@ -0,0 +1,547 @@ +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; + +class CheckActivationCode { + dynamic date; + int languageID; + int serviceName; + dynamic time; + dynamic androidLink; + String authenticationTokenID; + dynamic data; + bool dataw; + int dietType; + dynamic errorCode; + dynamic errorEndUserMessage; + dynamic errorEndUserMessageN; + dynamic errorMessage; + int errorType; + int foodCategory; + dynamic iOSLink; + bool isAuthenticated; + int mealOrderStatus; + int mealType; + int messageStatus; + int numberOfResultRecords; + dynamic patientBlodType; + dynamic successMsg; + dynamic successMsgN; + dynamic doctorInformationList; + dynamic getAllPendingRecordsList; + dynamic getAllSharedRecordsByStatusList; + dynamic getResponseFileList; + bool isHMGPatient; + bool isLoginSuccessfully; + bool isNeedUpdateIdintificationNo; + bool kioskSendSMS; + AuthenticatedUser list; + dynamic listAskHabibMobileLoginInfo; + dynamic listAskHabibPatientFile; + dynamic listMergeFiles; + dynamic listMobileLoginInfo; + dynamic listPatientCount; + dynamic logInTokenID; + dynamic mohemmPrivilegeList; + int pateintID; + String patientBloodType; + bool patientHasFile; + dynamic patientMergedIDs; + bool patientOutSA; + int patientShareRequestID; + int patientType; + int projectIDOut; + dynamic returnMessage; + bool sMSLoginRequired; + dynamic servicePrivilegeList; + dynamic sharePatientName; + dynamic verificationCode; + dynamic email; + dynamic errorList; + bool hasFile; + bool isActiveCode; + bool isMerged; + bool isNeedUserAgreement; + bool isSMSSent; + dynamic memberList; + dynamic message; + int statusCode; + + CheckActivationCode( + {this.date, + this.languageID, + this.serviceName, + this.time, + this.androidLink, + this.authenticationTokenID, + this.data, + this.dataw, + this.dietType, + this.errorCode, + this.errorEndUserMessage, + this.errorEndUserMessageN, + this.errorMessage, + this.errorType, + this.foodCategory, + this.iOSLink, + this.isAuthenticated, + this.mealOrderStatus, + this.mealType, + this.messageStatus, + this.numberOfResultRecords, + this.patientBlodType, + this.successMsg, + this.successMsgN, + this.doctorInformationList, + this.getAllPendingRecordsList, + this.getAllSharedRecordsByStatusList, + this.getResponseFileList, + this.isHMGPatient, + this.isLoginSuccessfully, + this.isNeedUpdateIdintificationNo, + this.kioskSendSMS, + this.list, + this.listAskHabibMobileLoginInfo, + this.listAskHabibPatientFile, + this.listMergeFiles, + this.listMobileLoginInfo, + this.listPatientCount, + this.logInTokenID, + this.mohemmPrivilegeList, + this.pateintID, + this.patientBloodType, + this.patientHasFile, + this.patientMergedIDs, + this.patientOutSA, + this.patientShareRequestID, + this.patientType, + this.projectIDOut, + this.returnMessage, + this.sMSLoginRequired, + this.servicePrivilegeList, + this.sharePatientName, + this.verificationCode, + this.email, + this.errorList, + this.hasFile, + this.isActiveCode, + this.isMerged, + this.isNeedUserAgreement, + this.isSMSSent, + this.memberList, + this.message, + this.statusCode}); + + CheckActivationCode.fromJson(Map json) { + date = json['Date']; + languageID = json['LanguageID']; + serviceName = json['ServiceName']; + time = json['Time']; + androidLink = json['AndroidLink']; + authenticationTokenID = json['AuthenticationTokenID']; + data = json['Data']; + dataw = json['Dataw']; + dietType = json['DietType']; + errorCode = json['ErrorCode']; + errorEndUserMessage = json['ErrorEndUserMessage']; + errorEndUserMessageN = json['ErrorEndUserMessageN']; + errorMessage = json['ErrorMessage']; + errorType = json['ErrorType']; + foodCategory = json['FoodCategory']; + iOSLink = json['IOSLink']; + isAuthenticated = json['IsAuthenticated']; + mealOrderStatus = json['MealOrderStatus']; + mealType = json['MealType']; + messageStatus = json['MessageStatus']; + numberOfResultRecords = json['NumberOfResultRecords']; + patientBlodType = json['PatientBlodType']; + successMsg = json['SuccessMsg']; + successMsgN = json['SuccessMsgN']; + doctorInformationList = json['DoctorInformation_List']; + getAllPendingRecordsList = json['GetAllPendingRecordsList']; + getAllSharedRecordsByStatusList = json['GetAllSharedRecordsByStatusList']; + getResponseFileList = json['GetResponseFileList']; + isHMGPatient = json['IsHMGPatient']; + isLoginSuccessfully = json['IsLoginSuccessfully']; + isNeedUpdateIdintificationNo = json['IsNeedUpdateIdintificationNo']; + kioskSendSMS = json['KioskSendSMS']; + if (json['List'] != null) { + list = new AuthenticatedUser.fromJson(json['List'][0]); + } + listAskHabibMobileLoginInfo = json['List_AskHabibMobileLoginInfo']; + listAskHabibPatientFile = json['List_AskHabibPatientFile']; + listMergeFiles = json['List_MergeFiles']; + listMobileLoginInfo = json['List_MobileLoginInfo']; + listPatientCount = json['List_PatientCount']; + logInTokenID = json['LogInTokenID']; + mohemmPrivilegeList = json['MohemmPrivilege_List']; + pateintID = json['PateintID']; + patientBloodType = json['PatientBloodType']; + patientHasFile = json['PatientHasFile']; + patientMergedIDs = json['PatientMergedIDs']; + patientOutSA = json['PatientOutSA']; + patientShareRequestID = json['PatientShareRequestID']; + patientType = json['PatientType']; + projectIDOut = json['ProjectIDOut']; + returnMessage = json['ReturnMessage']; + sMSLoginRequired = json['SMSLoginRequired']; + servicePrivilegeList = json['ServicePrivilege_List']; + sharePatientName = json['SharePatientName']; + verificationCode = json['VerificationCode']; + email = json['email']; + errorList = json['errorList']; + hasFile = json['hasFile']; + isActiveCode = json['isActiveCode']; + isMerged = json['isMerged']; + isNeedUserAgreement = json['isNeedUserAgreement']; + isSMSSent = json['isSMSSent']; + memberList = json['memberList']; + message = json['message']; + statusCode = json['statusCode']; + } + + Map toJson() { + final Map data = new Map(); + data['Date'] = this.date; + data['LanguageID'] = this.languageID; + data['ServiceName'] = this.serviceName; + data['Time'] = this.time; + data['AndroidLink'] = this.androidLink; + data['AuthenticationTokenID'] = this.authenticationTokenID; + data['Data'] = this.data; + data['Dataw'] = this.dataw; + data['DietType'] = this.dietType; + data['ErrorCode'] = this.errorCode; + data['ErrorEndUserMessage'] = this.errorEndUserMessage; + data['ErrorEndUserMessageN'] = this.errorEndUserMessageN; + data['ErrorMessage'] = this.errorMessage; + data['ErrorType'] = this.errorType; + data['FoodCategory'] = this.foodCategory; + data['IOSLink'] = this.iOSLink; + data['IsAuthenticated'] = this.isAuthenticated; + data['MealOrderStatus'] = this.mealOrderStatus; + data['MealType'] = this.mealType; + data['MessageStatus'] = this.messageStatus; + data['NumberOfResultRecords'] = this.numberOfResultRecords; + data['PatientBlodType'] = this.patientBlodType; + data['SuccessMsg'] = this.successMsg; + data['SuccessMsgN'] = this.successMsgN; + data['DoctorInformation_List'] = this.doctorInformationList; + data['GetAllPendingRecordsList'] = this.getAllPendingRecordsList; + data['GetAllSharedRecordsByStatusList'] = + this.getAllSharedRecordsByStatusList; + data['GetResponseFileList'] = this.getResponseFileList; + data['IsHMGPatient'] = this.isHMGPatient; + data['IsLoginSuccessfully'] = this.isLoginSuccessfully; + data['IsNeedUpdateIdintificationNo'] = this.isNeedUpdateIdintificationNo; + data['KioskSendSMS'] = this.kioskSendSMS; + if (this.list != null) { + data['List'] = this.list; + } + data['List_AskHabibMobileLoginInfo'] = this.listAskHabibMobileLoginInfo; + data['List_AskHabibPatientFile'] = this.listAskHabibPatientFile; + data['List_MergeFiles'] = this.listMergeFiles; + data['List_MobileLoginInfo'] = this.listMobileLoginInfo; + data['List_PatientCount'] = this.listPatientCount; + data['LogInTokenID'] = this.logInTokenID; + data['MohemmPrivilege_List'] = this.mohemmPrivilegeList; + data['PateintID'] = this.pateintID; + data['PatientBloodType'] = this.patientBloodType; + data['PatientHasFile'] = this.patientHasFile; + data['PatientMergedIDs'] = this.patientMergedIDs; + data['PatientOutSA'] = this.patientOutSA; + data['PatientShareRequestID'] = this.patientShareRequestID; + data['PatientType'] = this.patientType; + data['ProjectIDOut'] = this.projectIDOut; + data['ReturnMessage'] = this.returnMessage; + data['SMSLoginRequired'] = this.sMSLoginRequired; + data['ServicePrivilege_List'] = this.servicePrivilegeList; + data['SharePatientName'] = this.sharePatientName; + data['VerificationCode'] = this.verificationCode; + data['email'] = this.email; + data['errorList'] = this.errorList; + data['hasFile'] = this.hasFile; + data['isActiveCode'] = this.isActiveCode; + data['isMerged'] = this.isMerged; + data['isNeedUserAgreement'] = this.isNeedUserAgreement; + data['isSMSSent'] = this.isSMSSent; + data['memberList'] = this.memberList; + data['message'] = this.message; + data['statusCode'] = this.statusCode; + return data; + } +} + +class List { + String setupID; + int patientType; + int patientID; + String firstName; + String middleName; + String lastName; + String firstNameN; + String middleNameN; + String lastNameN; + int relationshipID; + int gender; + String dateofBirth; + dynamic dateofBirthN; + String nationalityID; + dynamic phoneResi; + dynamic phoneOffice; + String mobileNumber; + dynamic faxNumber; + String emailAddress; + dynamic bloodGroup; + dynamic rHFactor; + bool isEmailAlertRequired; + bool isSMSAlertRequired; + String preferredLanguage; + bool isPrivilegedMember; + dynamic memberID; + dynamic expiryDate; + dynamic isHmgEmployee; + dynamic employeeID; + dynamic emergencyContactName; + dynamic emergencyContactNo; + int patientPayType; + dynamic dHCCPatientRefID; + bool isPatientDummy; + int status; + dynamic isStatusCleared; + int patientIdentificationType; + String patientIdentificationNo; + int projectID; + int infoSourceID; + dynamic address; + int age; + String ageDesc; + int areaID; + int createdBy; + String genderDescription; + dynamic iR; + dynamic iSOCityID; + dynamic iSOCountryID; + ListPrivilege listPrivilege; + dynamic marital; + int outSA; + dynamic pOBox; + bool receiveHealthSummaryReport; + int sourceType; + dynamic strDateofBirth; + dynamic tempAddress; + dynamic zipCode; + + List({ + this.setupID, + this.patientType, + this.patientID, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.relationshipID, + this.gender, + this.dateofBirth, + this.dateofBirthN, + this.nationalityID, + this.phoneResi, + this.phoneOffice, + this.mobileNumber, + this.faxNumber, + this.emailAddress, + this.bloodGroup, + this.rHFactor, + this.isEmailAlertRequired, + this.isSMSAlertRequired, + this.preferredLanguage, + this.isPrivilegedMember, + this.memberID, + this.expiryDate, + this.isHmgEmployee, + this.employeeID, + this.emergencyContactName, + this.emergencyContactNo, + this.patientPayType, + this.dHCCPatientRefID, + this.isPatientDummy, + this.status, + this.isStatusCleared, + this.patientIdentificationType, + this.patientIdentificationNo, + this.projectID, + this.infoSourceID, + this.address, + this.age, + this.ageDesc, + this.areaID, + this.createdBy, + this.genderDescription, + this.iR, + this.iSOCityID, + this.iSOCountryID, + this.listPrivilege, + this.marital, + this.outSA, + this.pOBox, + this.receiveHealthSummaryReport, + this.sourceType, + this.strDateofBirth, + this.tempAddress, + this.zipCode, + }); + + List.fromJson(Map json) { + setupID = json['SetupID']; + patientType = json['PatientType']; + patientID = json['PatientID']; + firstName = json['FirstName']; + middleName = json['MiddleName']; + lastName = json['LastName']; + firstNameN = json['FirstNameN']; + middleNameN = json['MiddleNameN']; + lastNameN = json['LastNameN']; + relationshipID = json['RelationshipID']; + gender = json['Gender']; + dateofBirth = json['DateofBirth']; + dateofBirthN = json['DateofBirthN']; + nationalityID = json['NationalityID']; + phoneResi = json['PhoneResi']; + phoneOffice = json['PhoneOffice']; + mobileNumber = json['MobileNumber']; + faxNumber = json['FaxNumber']; + emailAddress = json['EmailAddress']; + bloodGroup = json['BloodGroup']; + rHFactor = json['RHFactor']; + isEmailAlertRequired = json['IsEmailAlertRequired']; + isSMSAlertRequired = json['IsSMSAlertRequired']; + preferredLanguage = json['PreferredLanguage']; + isPrivilegedMember = json['IsPrivilegedMember']; + memberID = json['MemberID']; + expiryDate = json['ExpiryDate']; + isHmgEmployee = json['IsHmgEmployee']; + employeeID = json['EmployeeID']; + emergencyContactName = json['EmergencyContactName']; + emergencyContactNo = json['EmergencyContactNo']; + patientPayType = json['PatientPayType']; + dHCCPatientRefID = json['DHCCPatientRefID']; + isPatientDummy = json['IsPatientDummy']; + status = json['Status']; + isStatusCleared = json['IsStatusCleared']; + patientIdentificationType = json['PatientIdentificationType']; + patientIdentificationNo = json['PatientIdentificationNo']; + projectID = json['ProjectID']; + infoSourceID = json['InfoSourceID']; + address = json['Address']; + age = json['Age']; + ageDesc = json['AgeDesc']; + areaID = json['AreaID']; + createdBy = json['CreatedBy']; + genderDescription = json['GenderDescription']; + iR = json['IR']; + iSOCityID = json['ISOCityID']; + iSOCountryID = json['ISOCountryID']; + if (json['ListPrivilege'] != null) { + listPrivilege = ListPrivilege.fromJson(json['ListPrivilege']); + } + marital = json['Marital']; + outSA = json['OutSA']; + pOBox = json['POBox']; + receiveHealthSummaryReport = json['ReceiveHealthSummaryReport']; + sourceType = json['SourceType']; + strDateofBirth = json['StrDateofBirth']; + tempAddress = json['TempAddress']; + zipCode = json['ZipCode']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['FirstName'] = this.firstName; + data['MiddleName'] = this.middleName; + data['LastName'] = this.lastName; + data['FirstNameN'] = this.firstNameN; + data['MiddleNameN'] = this.middleNameN; + data['LastNameN'] = this.lastNameN; + data['RelationshipID'] = this.relationshipID; + data['Gender'] = this.gender; + data['DateofBirth'] = this.dateofBirth; + data['DateofBirthN'] = this.dateofBirthN; + data['NationalityID'] = this.nationalityID; + data['PhoneResi'] = this.phoneResi; + data['PhoneOffice'] = this.phoneOffice; + data['MobileNumber'] = this.mobileNumber; + data['FaxNumber'] = this.faxNumber; + data['EmailAddress'] = this.emailAddress; + data['BloodGroup'] = this.bloodGroup; + data['RHFactor'] = this.rHFactor; + data['IsEmailAlertRequired'] = this.isEmailAlertRequired; + data['IsSMSAlertRequired'] = this.isSMSAlertRequired; + data['PreferredLanguage'] = this.preferredLanguage; + data['IsPrivilegedMember'] = this.isPrivilegedMember; + data['MemberID'] = this.memberID; + data['ExpiryDate'] = this.expiryDate; + data['IsHmgEmployee'] = this.isHmgEmployee; + data['EmployeeID'] = this.employeeID; + data['EmergencyContactName'] = this.emergencyContactName; + data['EmergencyContactNo'] = this.emergencyContactNo; + data['PatientPayType'] = this.patientPayType; + data['DHCCPatientRefID'] = this.dHCCPatientRefID; + data['IsPatientDummy'] = this.isPatientDummy; + data['Status'] = this.status; + data['IsStatusCleared'] = this.isStatusCleared; + data['PatientIdentificationType'] = this.patientIdentificationType; + data['PatientIdentificationNo'] = this.patientIdentificationNo; + data['ProjectID'] = this.projectID; + data['InfoSourceID'] = this.infoSourceID; + data['Address'] = this.address; + data['Age'] = this.age; + data['AgeDesc'] = this.ageDesc; + data['AreaID'] = this.areaID; + data['CreatedBy'] = this.createdBy; + data['GenderDescription'] = this.genderDescription; + data['IR'] = this.iR; + data['ISOCityID'] = this.iSOCityID; + data['ISOCountryID'] = this.iSOCountryID; + if (this.listPrivilege != null) { + data['ListPrivilege'] = this.listPrivilege; + } + data['Marital'] = this.marital; + data['OutSA'] = this.outSA; + data['POBox'] = this.pOBox; + data['ReceiveHealthSummaryReport'] = this.receiveHealthSummaryReport; + data['SourceType'] = this.sourceType; + data['StrDateofBirth'] = this.strDateofBirth; + data['TempAddress'] = this.tempAddress; + data['ZipCode'] = this.zipCode; + + return data; + } +} + +class ListPrivilege { + int iD; + String serviceName; + bool previlege; + dynamic region; + + ListPrivilege({this.iD, this.serviceName, this.previlege, this.region}); + + ListPrivilege.fromJson(Map json) { + iD = json['ID']; + serviceName = json['ServiceName']; + previlege = json['Previlege']; + region = json['Region']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['ServiceName'] = this.serviceName; + data['Previlege'] = this.previlege; + data['Region'] = this.region; + return data; + } +} diff --git a/lib/models/Authentication/check_paitent_authentication_req.dart b/lib/models/Authentication/check_paitent_authentication_req.dart new file mode 100644 index 00000000..2846c1fc --- /dev/null +++ b/lib/models/Authentication/check_paitent_authentication_req.dart @@ -0,0 +1,76 @@ +class CheckPatientAuthenticationReq { + int patientMobileNumber; + String zipCode; + bool isRegister; + String tokenID; + int searchType; + String patientIdentificationID; + int patientID; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + + CheckPatientAuthenticationReq( + {this.patientMobileNumber, + this.zipCode, + this.isRegister, + this.tokenID, + this.searchType, + this.patientIdentificationID, + this.patientID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); + + CheckPatientAuthenticationReq.fromJson(Map json) { + patientMobileNumber = json['PatientMobileNumber']; + zipCode = json['ZipCode']; + isRegister = json['isRegister']; + tokenID = json['TokenID']; + searchType = json['SearchType']; + patientIdentificationID = json['PatientIdentificationID']; + patientID = json['PatientID']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMobileNumber'] = this.patientMobileNumber; + data['ZipCode'] = this.zipCode; + data['isRegister'] = this.isRegister; + data['TokenID'] = this.tokenID; + data['SearchType'] = this.searchType; + data['PatientIdentificationID'] = this.patientIdentificationID; + data['PatientID'] = this.patientID; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/models/Authentication/check_user_status_reponse.dart b/lib/models/Authentication/check_user_status_reponse.dart new file mode 100644 index 00000000..342eaad0 --- /dev/null +++ b/lib/models/Authentication/check_user_status_reponse.dart @@ -0,0 +1,316 @@ +class CheckUserStatusResponse { + Null date; + int languageID; + int serviceName; + Null time; + Null androidLink; + Null authenticationTokenID; + Null data; + bool dataw; + int dietType; + Null errorCode; + Null errorEndUserMessage; + Null errorEndUserMessageN; + Null errorMessage; + int errorType; + int foodCategory; + Null iOSLink; + bool isAuthenticated; + int mealOrderStatus; + int mealType; + int messageStatus; + int numberOfResultRecords; + Null patientBlodType; + Null successMsg; + Null successMsgN; + Null accessTokenObject; + int age; + Null clientIdentifierId; + int createdBy; + String dateOfBirth; + String firstNameAr; + String firstNameEn; + String gender; + Null genderAr; + Null genderEn; + String healthId; + String idNumber; + String idType; + bool isHijri; + int isInstertedOrUpdated; + int isNull; + int isPatientExistNHIC; + String lastNameAr; + String lastNameEn; + Null listActiveAccessToken; + String maritalStatus; + String maritalStatusCode; + String nationality; + String nationalityCode; + String occupation; + String patientStatus; + String placeofBirth; + Null practitionerStatusCode; + Null practitionerStatusDescAr; + Null practitionerStatusDescEn; + String secondNameAr; + String secondNameEn; + String thirdNameAr; + String thirdNameEn; + Null accessToken; + int categoryCode; + Null categoryNameAr; + Null categoryNameEn; + int constraintCode; + Null constraintNameAr; + Null constraintNameEn; + Null content; + Null licenseExpiryDate; + Null licenseIssuedDate; + Null licenseStatusCode; + Null licenseStatusDescAr; + Null licenseStatusDescEn; + Null organizations; + Null registrationNumber; + int specialtyCode; + Null specialtyNameAr; + Null specialtyNameEn; + + CheckUserStatusResponse( + {this.date, + this.languageID, + this.serviceName, + this.time, + this.androidLink, + this.authenticationTokenID, + this.data, + this.dataw, + this.dietType, + this.errorCode, + this.errorEndUserMessage, + this.errorEndUserMessageN, + this.errorMessage, + this.errorType, + this.foodCategory, + this.iOSLink, + this.isAuthenticated, + this.mealOrderStatus, + this.mealType, + this.messageStatus, + this.numberOfResultRecords, + this.patientBlodType, + this.successMsg, + this.successMsgN, + this.accessTokenObject, + this.age, + this.clientIdentifierId, + this.createdBy, + this.dateOfBirth, + this.firstNameAr, + this.firstNameEn, + this.gender, + this.genderAr, + this.genderEn, + this.healthId, + this.idNumber, + this.idType, + this.isHijri, + this.isInstertedOrUpdated, + this.isNull, + this.isPatientExistNHIC, + this.lastNameAr, + this.lastNameEn, + this.listActiveAccessToken, + this.maritalStatus, + this.maritalStatusCode, + this.nationality, + this.nationalityCode, + this.occupation, + this.patientStatus, + this.placeofBirth, + this.practitionerStatusCode, + this.practitionerStatusDescAr, + this.practitionerStatusDescEn, + this.secondNameAr, + this.secondNameEn, + this.thirdNameAr, + this.thirdNameEn, + this.accessToken, + this.categoryCode, + this.categoryNameAr, + this.categoryNameEn, + this.constraintCode, + this.constraintNameAr, + this.constraintNameEn, + this.content, + this.licenseExpiryDate, + this.licenseIssuedDate, + this.licenseStatusCode, + this.licenseStatusDescAr, + this.licenseStatusDescEn, + this.organizations, + this.registrationNumber, + this.specialtyCode, + this.specialtyNameAr, + this.specialtyNameEn}); + + CheckUserStatusResponse.fromJson(Map json) { + date = json['Date']; + languageID = json['LanguageID']; + serviceName = json['ServiceName']; + time = json['Time']; + androidLink = json['AndroidLink']; + authenticationTokenID = json['AuthenticationTokenID']; + data = json['Data']; + dataw = json['Dataw']; + dietType = json['DietType']; + errorCode = json['ErrorCode']; + errorEndUserMessage = json['ErrorEndUserMessage']; + errorEndUserMessageN = json['ErrorEndUserMessageN']; + errorMessage = json['ErrorMessage']; + errorType = json['ErrorType']; + foodCategory = json['FoodCategory']; + iOSLink = json['IOSLink']; + isAuthenticated = json['IsAuthenticated']; + mealOrderStatus = json['MealOrderStatus']; + mealType = json['MealType']; + messageStatus = json['MessageStatus']; + numberOfResultRecords = json['NumberOfResultRecords']; + patientBlodType = json['PatientBlodType']; + successMsg = json['SuccessMsg']; + successMsgN = json['SuccessMsgN']; + accessTokenObject = json['AccessTokenObject']; + age = json['Age']; + clientIdentifierId = json['ClientIdentifierId']; + createdBy = json['CreatedBy']; + dateOfBirth = json['DateOfBirth']; + firstNameAr = json['FirstNameAr']; + firstNameEn = json['FirstNameEn']; + gender = json['Gender']; + genderAr = json['GenderAr']; + genderEn = json['GenderEn']; + healthId = json['HealthId']; + idNumber = json['IdNumber']; + idType = json['IdType']; + isHijri = json['IsHijri']; + isInstertedOrUpdated = json['IsInstertedOrUpdated']; + isNull = json['IsNull']; + isPatientExistNHIC = json['IsPatientExistNHIC']; + lastNameAr = json['LastNameAr']; + lastNameEn = json['LastNameEn']; + listActiveAccessToken = json['List_ActiveAccessToken']; + maritalStatus = json['MaritalStatus']; + maritalStatusCode = json['MaritalStatusCode']; + nationality = json['Nationality']; + nationalityCode = json['NationalityCode']; + occupation = json['Occupation']; + patientStatus = json['PatientStatus']; + placeofBirth = json['PlaceofBirth']; + practitionerStatusCode = json['PractitionerStatusCode']; + practitionerStatusDescAr = json['PractitionerStatusDescAr']; + practitionerStatusDescEn = json['PractitionerStatusDescEn']; + secondNameAr = json['SecondNameAr']; + secondNameEn = json['SecondNameEn']; + thirdNameAr = json['ThirdNameAr']; + thirdNameEn = json['ThirdNameEn']; + accessToken = json['accessToken']; + categoryCode = json['categoryCode']; + categoryNameAr = json['categoryNameAr']; + categoryNameEn = json['categoryNameEn']; + constraintCode = json['constraintCode']; + constraintNameAr = json['constraintNameAr']; + constraintNameEn = json['constraintNameEn']; + content = json['content']; + licenseExpiryDate = json['licenseExpiryDate']; + licenseIssuedDate = json['licenseIssuedDate']; + licenseStatusCode = json['licenseStatusCode']; + licenseStatusDescAr = json['licenseStatusDescAr']; + licenseStatusDescEn = json['licenseStatusDescEn']; + organizations = json['organizations']; + registrationNumber = json['registrationNumber']; + specialtyCode = json['specialtyCode']; + specialtyNameAr = json['specialtyNameAr']; + specialtyNameEn = json['specialtyNameEn']; + } + + Map toJson() { + final Map data = new Map(); + data['Date'] = this.date; + data['LanguageID'] = this.languageID; + data['ServiceName'] = this.serviceName; + data['Time'] = this.time; + data['AndroidLink'] = this.androidLink; + data['AuthenticationTokenID'] = this.authenticationTokenID; + data['Data'] = this.data; + data['Dataw'] = this.dataw; + data['DietType'] = this.dietType; + data['ErrorCode'] = this.errorCode; + data['ErrorEndUserMessage'] = this.errorEndUserMessage; + data['ErrorEndUserMessageN'] = this.errorEndUserMessageN; + data['ErrorMessage'] = this.errorMessage; + data['ErrorType'] = this.errorType; + data['FoodCategory'] = this.foodCategory; + data['IOSLink'] = this.iOSLink; + data['IsAuthenticated'] = this.isAuthenticated; + data['MealOrderStatus'] = this.mealOrderStatus; + data['MealType'] = this.mealType; + data['MessageStatus'] = this.messageStatus; + data['NumberOfResultRecords'] = this.numberOfResultRecords; + data['PatientBlodType'] = this.patientBlodType; + data['SuccessMsg'] = this.successMsg; + data['SuccessMsgN'] = this.successMsgN; + data['AccessTokenObject'] = this.accessTokenObject; + data['Age'] = this.age; + data['ClientIdentifierId'] = this.clientIdentifierId; + data['CreatedBy'] = this.createdBy; + data['DateOfBirth'] = this.dateOfBirth; + data['FirstNameAr'] = this.firstNameAr; + data['FirstNameEn'] = this.firstNameEn; + data['Gender'] = this.gender; + data['GenderAr'] = this.genderAr; + data['GenderEn'] = this.genderEn; + data['HealthId'] = this.healthId; + data['IdNumber'] = this.idNumber; + data['IdType'] = this.idType; + data['IsHijri'] = this.isHijri; + data['IsInstertedOrUpdated'] = this.isInstertedOrUpdated; + data['IsNull'] = this.isNull; + data['IsPatientExistNHIC'] = this.isPatientExistNHIC; + data['LastNameAr'] = this.lastNameAr; + data['LastNameEn'] = this.lastNameEn; + data['List_ActiveAccessToken'] = this.listActiveAccessToken; + data['MaritalStatus'] = this.maritalStatus; + data['MaritalStatusCode'] = this.maritalStatusCode; + data['Nationality'] = this.nationality; + data['NationalityCode'] = this.nationalityCode; + data['Occupation'] = this.occupation; + data['PatientStatus'] = this.patientStatus; + data['PlaceofBirth'] = this.placeofBirth; + data['PractitionerStatusCode'] = this.practitionerStatusCode; + data['PractitionerStatusDescAr'] = this.practitionerStatusDescAr; + data['PractitionerStatusDescEn'] = this.practitionerStatusDescEn; + data['SecondNameAr'] = this.secondNameAr; + data['SecondNameEn'] = this.secondNameEn; + data['ThirdNameAr'] = this.thirdNameAr; + data['ThirdNameEn'] = this.thirdNameEn; + data['accessToken'] = this.accessToken; + data['categoryCode'] = this.categoryCode; + data['categoryNameAr'] = this.categoryNameAr; + data['categoryNameEn'] = this.categoryNameEn; + data['constraintCode'] = this.constraintCode; + data['constraintNameAr'] = this.constraintNameAr; + data['constraintNameEn'] = this.constraintNameEn; + data['content'] = this.content; + data['licenseExpiryDate'] = this.licenseExpiryDate; + data['licenseIssuedDate'] = this.licenseIssuedDate; + data['licenseStatusCode'] = this.licenseStatusCode; + data['licenseStatusDescAr'] = this.licenseStatusDescAr; + data['licenseStatusDescEn'] = this.licenseStatusDescEn; + data['organizations'] = this.organizations; + data['registrationNumber'] = this.registrationNumber; + data['specialtyCode'] = this.specialtyCode; + data['specialtyNameAr'] = this.specialtyNameAr; + data['specialtyNameEn'] = this.specialtyNameEn; + return data; + } +} diff --git a/lib/models/Authentication/check_user_status_req.dart b/lib/models/Authentication/check_user_status_req.dart new file mode 100644 index 00000000..40dd8b49 --- /dev/null +++ b/lib/models/Authentication/check_user_status_req.dart @@ -0,0 +1,60 @@ +class CheckUserStatusRequest { + String patientIdentificationID; + String dOB; + int isHijri; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + + CheckUserStatusRequest( + {this.patientIdentificationID, + this.dOB, + this.isHijri, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); + + CheckUserStatusRequest.fromJson(Map json) { + patientIdentificationID = json['PatientIdentificationID']; + dOB = json['DOB']; + isHijri = json['IsHijri']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientIdentificationID'] = this.patientIdentificationID; + data['DOB'] = this.dOB; + data['IsHijri'] = this.isHijri; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/models/Authentication/checkpatient_for_registration.dart b/lib/models/Authentication/checkpatient_for_registration.dart new file mode 100644 index 00000000..420b4adb --- /dev/null +++ b/lib/models/Authentication/checkpatient_for_registration.dart @@ -0,0 +1,72 @@ +class CheckPatientForRegistration { + int patientIdentificationID; + int patientMobileNumber; + String zipCode; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + String tokenID; + int patientID; + bool isRegister; + + CheckPatientForRegistration( + {this.patientIdentificationID, + this.patientMobileNumber, + this.zipCode, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.tokenID, + this.patientID, + this.isRegister}); + + CheckPatientForRegistration.fromJson(Map json) { + patientIdentificationID = json['PatientIdentificationID']; + patientMobileNumber = json['PatientMobileNumber']; + zipCode = json['ZipCode']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + tokenID = json['TokenID']; + patientID = json['PatientID']; + isRegister = json['isRegister']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientIdentificationID'] = this.patientIdentificationID; + data['PatientMobileNumber'] = this.patientMobileNumber; + data['ZipCode'] = this.zipCode; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['TokenID'] = this.tokenID; + data['PatientID'] = this.patientID; + data['isRegister'] = this.isRegister; + return data; + } +} diff --git a/lib/models/Authentication/get_mobile_info_request.dart b/lib/models/Authentication/get_mobile_info_request.dart new file mode 100644 index 00000000..51a58d88 --- /dev/null +++ b/lib/models/Authentication/get_mobile_info_request.dart @@ -0,0 +1,96 @@ +class GetMobileLoginInfoRequest { + int patientMobileNumber; + String mobileNo; + String deviceToken; + int projectOutSA; + int loginType; + String zipCode; + bool isRegister; + String logInTokenID; + int searchType; + int patientID; + String nationalID; + String patientIdentificationID; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + + GetMobileLoginInfoRequest( + {this.patientMobileNumber, + this.mobileNo, + this.deviceToken, + this.projectOutSA, + this.loginType, + this.zipCode, + this.isRegister, + this.logInTokenID, + this.searchType, + this.patientID, + this.nationalID, + this.patientIdentificationID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); + + GetMobileLoginInfoRequest.fromJson(Map json) { + patientMobileNumber = json['PatientMobileNumber']; + mobileNo = json['MobileNo']; + deviceToken = json['DeviceToken']; + projectOutSA = json['ProjectOutSA']; + loginType = json['LoginType']; + zipCode = json['ZipCode']; + isRegister = json['isRegister']; + logInTokenID = json['LogInTokenID']; + searchType = json['SearchType']; + patientID = json['PatientID']; + nationalID = json['NationalID']; + patientIdentificationID = json['PatientIdentificationID']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMobileNumber'] = this.patientMobileNumber; + data['MobileNo'] = this.mobileNo; + data['DeviceToken'] = this.deviceToken; + data['ProjectOutSA'] = this.projectOutSA; + data['LoginType'] = this.loginType; + data['ZipCode'] = this.zipCode; + data['isRegister'] = this.isRegister; + data['LogInTokenID'] = this.logInTokenID; + data['SearchType'] = this.searchType; + data['PatientID'] = this.patientID; + data['NationalID'] = this.nationalID; + data['PatientIdentificationID'] = this.patientIdentificationID; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/models/Authentication/get_mobile_info_response.dart b/lib/models/Authentication/get_mobile_info_response.dart new file mode 100644 index 00000000..562c82dd --- /dev/null +++ b/lib/models/Authentication/get_mobile_info_response.dart @@ -0,0 +1,292 @@ +class GetMobileLoginInfoResponse { + Null date; + int languageID; + int serviceName; + Null time; + Null androidLink; + Null authenticationTokenID; + Null data; + bool dataw; + int dietType; + Null errorCode; + Null errorEndUserMessage; + Null errorEndUserMessageN; + Null errorMessage; + int errorType; + int foodCategory; + Null iOSLink; + bool isAuthenticated; + int mealOrderStatus; + int mealType; + int messageStatus; + int numberOfResultRecords; + Null patientBlodType; + Null successMsg; + Null successMsgN; + Null doctorInformationList; + Null getAllPendingRecordsList; + Null getAllSharedRecordsByStatusList; + Null getResponseFileList; + bool isHMGPatient; + bool isLoginSuccessfully; + bool isNeedUpdateIdintificationNo; + bool kioskSendSMS; + Null list; + Null listAskHabibMobileLoginInfo; + Null listAskHabibPatientFile; + Null listMergeFiles; + List listMobileLoginInfo; + Null listPatientCount; + String logInTokenID; + Null mohemmPrivilegeList; + int pateintID; + Null patientBloodType; + bool patientHasFile; + Null patientMergedIDs; + bool patientOutSA; + int patientShareRequestID; + int patientType; + int projectIDOut; + Null returnMessage; + bool sMSLoginRequired; + Null servicePrivilegeList; + Null sharePatientName; + Null verificationCode; + Null email; + Null errorList; + bool hasFile; + bool isActiveCode; + bool isMerged; + bool isNeedUserAgreement; + bool isSMSSent; + Null memberList; + Null message; + int statusCode; + + GetMobileLoginInfoResponse( + {this.date, + this.languageID, + this.serviceName, + this.time, + this.androidLink, + this.authenticationTokenID, + this.data, + this.dataw, + this.dietType, + this.errorCode, + this.errorEndUserMessage, + this.errorEndUserMessageN, + this.errorMessage, + this.errorType, + this.foodCategory, + this.iOSLink, + this.isAuthenticated, + this.mealOrderStatus, + this.mealType, + this.messageStatus, + this.numberOfResultRecords, + this.patientBlodType, + this.successMsg, + this.successMsgN, + this.doctorInformationList, + this.getAllPendingRecordsList, + this.getAllSharedRecordsByStatusList, + this.getResponseFileList, + this.isHMGPatient, + this.isLoginSuccessfully, + this.isNeedUpdateIdintificationNo, + this.kioskSendSMS, + this.list, + this.listAskHabibMobileLoginInfo, + this.listAskHabibPatientFile, + this.listMergeFiles, + this.listMobileLoginInfo, + this.listPatientCount, + this.logInTokenID, + this.mohemmPrivilegeList, + this.pateintID, + this.patientBloodType, + this.patientHasFile, + this.patientMergedIDs, + this.patientOutSA, + this.patientShareRequestID, + this.patientType, + this.projectIDOut, + this.returnMessage, + this.sMSLoginRequired, + this.servicePrivilegeList, + this.sharePatientName, + this.verificationCode, + this.email, + this.errorList, + this.hasFile, + this.isActiveCode, + this.isMerged, + this.isNeedUserAgreement, + this.isSMSSent, + this.memberList, + this.message, + this.statusCode}); + + GetMobileLoginInfoResponse.fromJson(Map json) { + date = json['Date']; + languageID = json['LanguageID']; + serviceName = json['ServiceName']; + time = json['Time']; + androidLink = json['AndroidLink']; + authenticationTokenID = json['AuthenticationTokenID']; + data = json['Data']; + dataw = json['Dataw']; + dietType = json['DietType']; + errorCode = json['ErrorCode']; + errorEndUserMessage = json['ErrorEndUserMessage']; + errorEndUserMessageN = json['ErrorEndUserMessageN']; + errorMessage = json['ErrorMessage']; + errorType = json['ErrorType']; + foodCategory = json['FoodCategory']; + iOSLink = json['IOSLink']; + isAuthenticated = json['IsAuthenticated']; + mealOrderStatus = json['MealOrderStatus']; + mealType = json['MealType']; + messageStatus = json['MessageStatus']; + numberOfResultRecords = json['NumberOfResultRecords']; + patientBlodType = json['PatientBlodType']; + successMsg = json['SuccessMsg']; + successMsgN = json['SuccessMsgN']; + doctorInformationList = json['DoctorInformation_List']; + getAllPendingRecordsList = json['GetAllPendingRecordsList']; + getAllSharedRecordsByStatusList = json['GetAllSharedRecordsByStatusList']; + getResponseFileList = json['GetResponseFileList']; + isHMGPatient = json['IsHMGPatient']; + isLoginSuccessfully = json['IsLoginSuccessfully']; + isNeedUpdateIdintificationNo = json['IsNeedUpdateIdintificationNo']; + kioskSendSMS = json['KioskSendSMS']; + list = json['List']; + listAskHabibMobileLoginInfo = json['List_AskHabibMobileLoginInfo']; + listAskHabibPatientFile = json['List_AskHabibPatientFile']; + listMergeFiles = json['List_MergeFiles']; + if (json['List_MobileLoginInfo'] != null) { + listMobileLoginInfo = new List(); + json['List_MobileLoginInfo'].forEach((v) { + listMobileLoginInfo.add(new ListMobileLoginInfo.fromJson(v)); + }); + } + listPatientCount = json['List_PatientCount']; + logInTokenID = json['LogInTokenID']; + mohemmPrivilegeList = json['MohemmPrivilege_List']; + pateintID = json['PateintID']; + patientBloodType = json['PatientBloodType']; + patientHasFile = json['PatientHasFile']; + patientMergedIDs = json['PatientMergedIDs']; + patientOutSA = json['PatientOutSA']; + patientShareRequestID = json['PatientShareRequestID']; + patientType = json['PatientType']; + projectIDOut = json['ProjectIDOut']; + returnMessage = json['ReturnMessage']; + sMSLoginRequired = json['SMSLoginRequired']; + servicePrivilegeList = json['ServicePrivilege_List']; + sharePatientName = json['SharePatientName']; + verificationCode = json['VerificationCode']; + email = json['email']; + errorList = json['errorList']; + hasFile = json['hasFile']; + isActiveCode = json['isActiveCode']; + isMerged = json['isMerged']; + isNeedUserAgreement = json['isNeedUserAgreement']; + isSMSSent = json['isSMSSent']; + memberList = json['memberList']; + message = json['message']; + statusCode = json['statusCode']; + } + + Map toJson() { + final Map data = new Map(); + data['Date'] = this.date; + data['LanguageID'] = this.languageID; + data['ServiceName'] = this.serviceName; + data['Time'] = this.time; + data['AndroidLink'] = this.androidLink; + data['AuthenticationTokenID'] = this.authenticationTokenID; + data['Data'] = this.data; + data['Dataw'] = this.dataw; + data['DietType'] = this.dietType; + data['ErrorCode'] = this.errorCode; + data['ErrorEndUserMessage'] = this.errorEndUserMessage; + data['ErrorEndUserMessageN'] = this.errorEndUserMessageN; + data['ErrorMessage'] = this.errorMessage; + data['ErrorType'] = this.errorType; + data['FoodCategory'] = this.foodCategory; + data['IOSLink'] = this.iOSLink; + data['IsAuthenticated'] = this.isAuthenticated; + data['MealOrderStatus'] = this.mealOrderStatus; + data['MealType'] = this.mealType; + data['MessageStatus'] = this.messageStatus; + data['NumberOfResultRecords'] = this.numberOfResultRecords; + data['PatientBlodType'] = this.patientBlodType; + data['SuccessMsg'] = this.successMsg; + data['SuccessMsgN'] = this.successMsgN; + data['DoctorInformation_List'] = this.doctorInformationList; + data['GetAllPendingRecordsList'] = this.getAllPendingRecordsList; + data['GetAllSharedRecordsByStatusList'] = + this.getAllSharedRecordsByStatusList; + data['GetResponseFileList'] = this.getResponseFileList; + data['IsHMGPatient'] = this.isHMGPatient; + data['IsLoginSuccessfully'] = this.isLoginSuccessfully; + data['IsNeedUpdateIdintificationNo'] = this.isNeedUpdateIdintificationNo; + data['KioskSendSMS'] = this.kioskSendSMS; + data['List'] = this.list; + data['List_AskHabibMobileLoginInfo'] = this.listAskHabibMobileLoginInfo; + data['List_AskHabibPatientFile'] = this.listAskHabibPatientFile; + data['List_MergeFiles'] = this.listMergeFiles; + if (this.listMobileLoginInfo != null) { + data['List_MobileLoginInfo'] = + this.listMobileLoginInfo.map((v) => v.toJson()).toList(); + } + data['List_PatientCount'] = this.listPatientCount; + data['LogInTokenID'] = this.logInTokenID; + data['MohemmPrivilege_List'] = this.mohemmPrivilegeList; + data['PateintID'] = this.pateintID; + data['PatientBloodType'] = this.patientBloodType; + data['PatientHasFile'] = this.patientHasFile; + data['PatientMergedIDs'] = this.patientMergedIDs; + data['PatientOutSA'] = this.patientOutSA; + data['PatientShareRequestID'] = this.patientShareRequestID; + data['PatientType'] = this.patientType; + data['ProjectIDOut'] = this.projectIDOut; + data['ReturnMessage'] = this.returnMessage; + data['SMSLoginRequired'] = this.sMSLoginRequired; + data['ServicePrivilege_List'] = this.servicePrivilegeList; + data['SharePatientName'] = this.sharePatientName; + data['VerificationCode'] = this.verificationCode; + data['email'] = this.email; + data['errorList'] = this.errorList; + data['hasFile'] = this.hasFile; + data['isActiveCode'] = this.isActiveCode; + data['isMerged'] = this.isMerged; + data['isNeedUserAgreement'] = this.isNeedUserAgreement; + data['isSMSSent'] = this.isSMSSent; + data['memberList'] = this.memberList; + data['message'] = this.message; + data['statusCode'] = this.statusCode; + return data; + } +} + +class ListMobileLoginInfo { + int iD; + int loginType; + + ListMobileLoginInfo({this.iD, this.loginType}); + + ListMobileLoginInfo.fromJson(Map json) { + iD = json['ID']; + loginType = json['LoginType']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['LoginType'] = this.loginType; + return data; + } +} diff --git a/lib/models/Authentication/insert_device_imei_request.dart b/lib/models/Authentication/insert_device_imei_request.dart new file mode 100644 index 00000000..02e3b278 --- /dev/null +++ b/lib/models/Authentication/insert_device_imei_request.dart @@ -0,0 +1,72 @@ +class INSERTDeviceIMEIRequest { + String setupID; + int patientType; + int patientID; + String firstName; + String firstNameN; + String lastNameN; + int preferredLanguage; + String patientIdentificationNo; + bool outSA; + String identificationNo; + String mobileNo; + String tokenID; + String iMEI; + bool biometricEnabled; + int logInTypeID; + + INSERTDeviceIMEIRequest( + {this.setupID, + this.patientType, + this.patientID, + this.firstName, + this.firstNameN, + this.lastNameN, + this.preferredLanguage, + this.patientIdentificationNo, + this.outSA, + this.identificationNo, + this.mobileNo, + this.tokenID, + this.iMEI, + this.biometricEnabled, + this.logInTypeID}); + + INSERTDeviceIMEIRequest.fromJson(Map json) { + setupID = json['SetupID']; + patientType = json['PatientType']; + patientID = json['PatientID']; + firstName = json['FirstName']; + firstNameN = json['FirstNameN']; + lastNameN = json['LastNameN']; + preferredLanguage = json['PreferredLanguage']; + patientIdentificationNo = json['PatientIdentificationNo']; + outSA = json['OutSA']; + identificationNo = json['IdentificationNo']; + mobileNo = json['MobileNo']; + tokenID = json['TokenID']; + iMEI = json['IMEI']; + biometricEnabled = json['BiometricEnabled']; + logInTypeID = json['LogInTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['FirstName'] = this.firstName; + data['FirstNameN'] = this.firstNameN; + data['LastNameN'] = this.lastNameN; + data['PreferredLanguage'] = this.preferredLanguage; + data['PatientIdentificationNo'] = this.patientIdentificationNo; + data['OutSA'] = this.outSA; + data['IdentificationNo'] = this.identificationNo; + data['MobileNo'] = this.mobileNo; + data['TokenID'] = this.tokenID; + data['IMEI'] = this.iMEI; + data['BiometricEnabled'] = this.biometricEnabled; + data['LogInTypeID'] = this.logInTypeID; + return data; + } +} diff --git a/lib/models/Authentication/register_info_response.dart b/lib/models/Authentication/register_info_response.dart new file mode 100644 index 00000000..309a8aa9 --- /dev/null +++ b/lib/models/Authentication/register_info_response.dart @@ -0,0 +1,316 @@ +class RegisterInfoResponse { + Null date; + int languageID; + int serviceName; + Null time; + Null androidLink; + Null authenticationTokenID; + Null data; + bool dataw; + int dietType; + Null errorCode; + Null errorEndUserMessage; + Null errorEndUserMessageN; + Null errorMessage; + int errorType; + int foodCategory; + Null iOSLink; + bool isAuthenticated; + int mealOrderStatus; + int mealType; + int messageStatus; + int numberOfResultRecords; + Null patientBlodType; + Null successMsg; + Null successMsgN; + Null accessTokenObject; + int age; + Null clientIdentifierId; + int createdBy; + String dateOfBirth; + String firstNameAr; + String firstNameEn; + String gender; + Null genderAr; + Null genderEn; + String healthId; + String idNumber; + String idType; + bool isHijri; + int isInstertedOrUpdated; + int isNull; + int isPatientExistNHIC; + String lastNameAr; + String lastNameEn; + Null listActiveAccessToken; + String maritalStatus; + String maritalStatusCode; + String nationality; + String nationalityCode; + String occupation; + String patientStatus; + String placeofBirth; + Null practitionerStatusCode; + Null practitionerStatusDescAr; + Null practitionerStatusDescEn; + String secondNameAr; + String secondNameEn; + String thirdNameAr; + String thirdNameEn; + Null accessToken; + int categoryCode; + Null categoryNameAr; + Null categoryNameEn; + int constraintCode; + Null constraintNameAr; + Null constraintNameEn; + Null content; + Null licenseExpiryDate; + Null licenseIssuedDate; + Null licenseStatusCode; + Null licenseStatusDescAr; + Null licenseStatusDescEn; + Null organizations; + Null registrationNumber; + int specialtyCode; + Null specialtyNameAr; + Null specialtyNameEn; + + RegisterInfoResponse( + {this.date, + this.languageID, + this.serviceName, + this.time, + this.androidLink, + this.authenticationTokenID, + this.data, + this.dataw, + this.dietType, + this.errorCode, + this.errorEndUserMessage, + this.errorEndUserMessageN, + this.errorMessage, + this.errorType, + this.foodCategory, + this.iOSLink, + this.isAuthenticated, + this.mealOrderStatus, + this.mealType, + this.messageStatus, + this.numberOfResultRecords, + this.patientBlodType, + this.successMsg, + this.successMsgN, + this.accessTokenObject, + this.age, + this.clientIdentifierId, + this.createdBy, + this.dateOfBirth, + this.firstNameAr, + this.firstNameEn, + this.gender, + this.genderAr, + this.genderEn, + this.healthId, + this.idNumber, + this.idType, + this.isHijri, + this.isInstertedOrUpdated, + this.isNull, + this.isPatientExistNHIC, + this.lastNameAr, + this.lastNameEn, + this.listActiveAccessToken, + this.maritalStatus, + this.maritalStatusCode, + this.nationality, + this.nationalityCode, + this.occupation, + this.patientStatus, + this.placeofBirth, + this.practitionerStatusCode, + this.practitionerStatusDescAr, + this.practitionerStatusDescEn, + this.secondNameAr, + this.secondNameEn, + this.thirdNameAr, + this.thirdNameEn, + this.accessToken, + this.categoryCode, + this.categoryNameAr, + this.categoryNameEn, + this.constraintCode, + this.constraintNameAr, + this.constraintNameEn, + this.content, + this.licenseExpiryDate, + this.licenseIssuedDate, + this.licenseStatusCode, + this.licenseStatusDescAr, + this.licenseStatusDescEn, + this.organizations, + this.registrationNumber, + this.specialtyCode, + this.specialtyNameAr, + this.specialtyNameEn}); + + RegisterInfoResponse.fromJson(Map json) { + date = json['Date']; + languageID = json['LanguageID']; + serviceName = json['ServiceName']; + time = json['Time']; + androidLink = json['AndroidLink']; + authenticationTokenID = json['AuthenticationTokenID']; + data = json['Data']; + dataw = json['Dataw']; + dietType = json['DietType']; + errorCode = json['ErrorCode']; + errorEndUserMessage = json['ErrorEndUserMessage']; + errorEndUserMessageN = json['ErrorEndUserMessageN']; + errorMessage = json['ErrorMessage']; + errorType = json['ErrorType']; + foodCategory = json['FoodCategory']; + iOSLink = json['IOSLink']; + isAuthenticated = json['IsAuthenticated']; + mealOrderStatus = json['MealOrderStatus']; + mealType = json['MealType']; + messageStatus = json['MessageStatus']; + numberOfResultRecords = json['NumberOfResultRecords']; + patientBlodType = json['PatientBlodType']; + successMsg = json['SuccessMsg']; + successMsgN = json['SuccessMsgN']; + accessTokenObject = json['AccessTokenObject']; + age = json['Age']; + clientIdentifierId = json['ClientIdentifierId']; + createdBy = json['CreatedBy']; + dateOfBirth = json['DateOfBirth']; + firstNameAr = json['FirstNameAr']; + firstNameEn = json['FirstNameEn']; + gender = json['Gender']; + genderAr = json['GenderAr']; + genderEn = json['GenderEn']; + healthId = json['HealthId']; + idNumber = json['IdNumber']; + idType = json['IdType']; + isHijri = json['IsHijri']; + isInstertedOrUpdated = json['IsInstertedOrUpdated']; + isNull = json['IsNull']; + isPatientExistNHIC = json['IsPatientExistNHIC']; + lastNameAr = json['LastNameAr']; + lastNameEn = json['LastNameEn']; + listActiveAccessToken = json['List_ActiveAccessToken']; + maritalStatus = json['MaritalStatus']; + maritalStatusCode = json['MaritalStatusCode']; + nationality = json['Nationality']; + nationalityCode = json['NationalityCode']; + occupation = json['Occupation']; + patientStatus = json['PatientStatus']; + placeofBirth = json['PlaceofBirth']; + practitionerStatusCode = json['PractitionerStatusCode']; + practitionerStatusDescAr = json['PractitionerStatusDescAr']; + practitionerStatusDescEn = json['PractitionerStatusDescEn']; + secondNameAr = json['SecondNameAr']; + secondNameEn = json['SecondNameEn']; + thirdNameAr = json['ThirdNameAr']; + thirdNameEn = json['ThirdNameEn']; + accessToken = json['accessToken']; + categoryCode = json['categoryCode']; + categoryNameAr = json['categoryNameAr']; + categoryNameEn = json['categoryNameEn']; + constraintCode = json['constraintCode']; + constraintNameAr = json['constraintNameAr']; + constraintNameEn = json['constraintNameEn']; + content = json['content']; + licenseExpiryDate = json['licenseExpiryDate']; + licenseIssuedDate = json['licenseIssuedDate']; + licenseStatusCode = json['licenseStatusCode']; + licenseStatusDescAr = json['licenseStatusDescAr']; + licenseStatusDescEn = json['licenseStatusDescEn']; + organizations = json['organizations']; + registrationNumber = json['registrationNumber']; + specialtyCode = json['specialtyCode']; + specialtyNameAr = json['specialtyNameAr']; + specialtyNameEn = json['specialtyNameEn']; + } + + Map toJson() { + final Map data = new Map(); + data['Date'] = this.date; + data['LanguageID'] = this.languageID; + data['ServiceName'] = this.serviceName; + data['Time'] = this.time; + data['AndroidLink'] = this.androidLink; + data['AuthenticationTokenID'] = this.authenticationTokenID; + data['Data'] = this.data; + data['Dataw'] = this.dataw; + data['DietType'] = this.dietType; + data['ErrorCode'] = this.errorCode; + data['ErrorEndUserMessage'] = this.errorEndUserMessage; + data['ErrorEndUserMessageN'] = this.errorEndUserMessageN; + data['ErrorMessage'] = this.errorMessage; + data['ErrorType'] = this.errorType; + data['FoodCategory'] = this.foodCategory; + data['IOSLink'] = this.iOSLink; + data['IsAuthenticated'] = this.isAuthenticated; + data['MealOrderStatus'] = this.mealOrderStatus; + data['MealType'] = this.mealType; + data['MessageStatus'] = this.messageStatus; + data['NumberOfResultRecords'] = this.numberOfResultRecords; + data['PatientBlodType'] = this.patientBlodType; + data['SuccessMsg'] = this.successMsg; + data['SuccessMsgN'] = this.successMsgN; + data['AccessTokenObject'] = this.accessTokenObject; + data['Age'] = this.age; + data['ClientIdentifierId'] = this.clientIdentifierId; + data['CreatedBy'] = this.createdBy; + data['DateOfBirth'] = this.dateOfBirth; + data['FirstNameAr'] = this.firstNameAr; + data['FirstNameEn'] = this.firstNameEn; + data['Gender'] = this.gender; + data['GenderAr'] = this.genderAr; + data['GenderEn'] = this.genderEn; + data['HealthId'] = this.healthId; + data['IdNumber'] = this.idNumber; + data['IdType'] = this.idType; + data['IsHijri'] = this.isHijri; + data['IsInstertedOrUpdated'] = this.isInstertedOrUpdated; + data['IsNull'] = this.isNull; + data['IsPatientExistNHIC'] = this.isPatientExistNHIC; + data['LastNameAr'] = this.lastNameAr; + data['LastNameEn'] = this.lastNameEn; + data['List_ActiveAccessToken'] = this.listActiveAccessToken; + data['MaritalStatus'] = this.maritalStatus; + data['MaritalStatusCode'] = this.maritalStatusCode; + data['Nationality'] = this.nationality; + data['NationalityCode'] = this.nationalityCode; + data['Occupation'] = this.occupation; + data['PatientStatus'] = this.patientStatus; + data['PlaceofBirth'] = this.placeofBirth; + data['PractitionerStatusCode'] = this.practitionerStatusCode; + data['PractitionerStatusDescAr'] = this.practitionerStatusDescAr; + data['PractitionerStatusDescEn'] = this.practitionerStatusDescEn; + data['SecondNameAr'] = this.secondNameAr; + data['SecondNameEn'] = this.secondNameEn; + data['ThirdNameAr'] = this.thirdNameAr; + data['ThirdNameEn'] = this.thirdNameEn; + data['accessToken'] = this.accessToken; + data['categoryCode'] = this.categoryCode; + data['categoryNameAr'] = this.categoryNameAr; + data['categoryNameEn'] = this.categoryNameEn; + data['constraintCode'] = this.constraintCode; + data['constraintNameAr'] = this.constraintNameAr; + data['constraintNameEn'] = this.constraintNameEn; + data['content'] = this.content; + data['licenseExpiryDate'] = this.licenseExpiryDate; + data['licenseIssuedDate'] = this.licenseIssuedDate; + data['licenseStatusCode'] = this.licenseStatusCode; + data['licenseStatusDescAr'] = this.licenseStatusDescAr; + data['licenseStatusDescEn'] = this.licenseStatusDescEn; + data['organizations'] = this.organizations; + data['registrationNumber'] = this.registrationNumber; + data['specialtyCode'] = this.specialtyCode; + data['specialtyNameAr'] = this.specialtyNameAr; + data['specialtyNameEn'] = this.specialtyNameEn; + return data; + } +} diff --git a/lib/models/Authentication/register_user_requet.dart b/lib/models/Authentication/register_user_requet.dart new file mode 100644 index 00000000..7758ce5b --- /dev/null +++ b/lib/models/Authentication/register_user_requet.dart @@ -0,0 +1,163 @@ +class RegisterUserRequest { + Patientobject patientobject; + String patientIdentificationID; + int patientMobileNumber; + String logInTokenID; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + + RegisterUserRequest( + {this.patientobject, + this.patientIdentificationID, + this.patientMobileNumber, + this.logInTokenID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); + + RegisterUserRequest.fromJson(Map json) { + patientobject = json['Patientobject'] != null + ? new Patientobject.fromJson(json['Patientobject']) + : null; + patientIdentificationID = json['PatientIdentificationID']; + patientMobileNumber = json['PatientMobileNumber']; + logInTokenID = json['LogInTokenID']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + if (this.patientobject != null) { + data['Patientobject'] = this.patientobject.toJson(); + } + data['PatientIdentificationID'] = this.patientIdentificationID; + data['PatientMobileNumber'] = this.patientMobileNumber; + data['LogInTokenID'] = this.logInTokenID; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} + +class Patientobject { + bool tempValue; + int patientIdentificationType; + String patientIdentificationNo; + int mobileNumber; + int patientOutSA; + String firstName; + String middleName; + String lastName; + String firstNameN; + String middleNameN; + String lastNameN; + dynamic strDateofBirth; + String dateofBirth; + int gender; + String nationalityID; + String dateofBirthN; + String emailAddress; + String sourceType; + String preferredLanguage; + String marital; + + Patientobject( + {this.tempValue, + this.patientIdentificationType, + this.patientIdentificationNo, + this.mobileNumber, + this.patientOutSA, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.strDateofBirth, + this.dateofBirth, + this.gender, + this.nationalityID, + this.dateofBirthN, + this.emailAddress, + this.sourceType, + this.preferredLanguage, + this.marital}); + + Patientobject.fromJson(Map json) { + tempValue = json['TempValue']; + patientIdentificationType = json['PatientIdentificationType']; + patientIdentificationNo = json['PatientIdentificationNo']; + mobileNumber = json['MobileNumber']; + patientOutSA = json['PatientOutSA']; + firstName = json['FirstName']; + middleName = json['MiddleName']; + lastName = json['LastName']; + firstNameN = json['FirstNameN']; + middleNameN = json['MiddleNameN']; + lastNameN = json['LastNameN']; + strDateofBirth = json['StrDateofBirth']; + dateofBirth = json['DateofBirth']; + gender = json['Gender']; + nationalityID = json['NationalityID']; + dateofBirthN = json['DateofBirthN']; + emailAddress = json['EmailAddress']; + sourceType = json['SourceType']; + + preferredLanguage = json['PreferredLanguage']; + marital = json['Marital']; + } + + Map toJson() { + final Map data = new Map(); + data['TempValue'] = this.tempValue; + data['PatientIdentificationType'] = this.patientIdentificationType; + data['PatientIdentificationNo'] = this.patientIdentificationNo; + data['MobileNumber'] = this.mobileNumber; + data['PatientOutSA'] = this.patientOutSA; + data['FirstName'] = this.firstName; + data['MiddleName'] = this.middleName; + data['LastName'] = this.lastName; + data['FirstNameN'] = this.firstNameN; + data['MiddleNameN'] = this.middleNameN; + data['LastNameN'] = this.lastNameN; + data['StrDateofBirth'] = this.strDateofBirth; + data['DateofBirth'] = this.dateofBirth; + data['Gender'] = this.gender; + data['NationalityID'] = this.nationalityID; + data['DateofBirthN'] = this.dateofBirthN; + data['EmailAddress'] = this.emailAddress; + data['SourceType'] = this.sourceType; + + data['PreferredLanguage'] = this.preferredLanguage; + data['Marital'] = this.marital; + return data; + } +} diff --git a/lib/models/Authentication/registered_authenticated_user_req.dart b/lib/models/Authentication/registered_authenticated_user_req.dart new file mode 100644 index 00000000..c261d062 --- /dev/null +++ b/lib/models/Authentication/registered_authenticated_user_req.dart @@ -0,0 +1,104 @@ +class RegisteredAuthenticatedUserRequest { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + String voipToken; + int patientTypeID; + int patientType; + String deviceToken; + String deviceType; + String patientMobileNumber; + String nationalID; + int gender; + int loginType; + String mACAddress; + int latitude; + int longitude; + + RegisteredAuthenticatedUserRequest( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.voipToken, + this.patientTypeID, + this.patientType, + this.deviceToken, + this.deviceType, + this.patientMobileNumber, + this.nationalID, + this.gender, + this.loginType, + this.mACAddress, + this.latitude, + this.longitude}); + + RegisteredAuthenticatedUserRequest.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + voipToken = json['VoipToken']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + deviceToken = json['DeviceToken']; + deviceType = json['DeviceType']; + patientMobileNumber = json['PatientMobileNumber']; + nationalID = json['NationalID']; + gender = json['Gender']; + loginType = json['LoginType']; + mACAddress = json['MACAddress']; + latitude = json['Latitude']; + longitude = json['Longitude']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['VoipToken'] = this.voipToken; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['DeviceToken'] = this.deviceToken; + data['DeviceType'] = this.deviceType; + data['PatientMobileNumber'] = this.patientMobileNumber; + data['NationalID'] = this.nationalID; + data['Gender'] = this.gender; + data['LoginType'] = this.loginType; + data['MACAddress'] = this.mACAddress; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + return data; + } +} diff --git a/lib/models/Authentication/select_device_imei_res.dart b/lib/models/Authentication/select_device_imei_res.dart new file mode 100644 index 00000000..14444279 --- /dev/null +++ b/lib/models/Authentication/select_device_imei_res.dart @@ -0,0 +1,68 @@ +class SelectDeviceIMEIRES { + bool biometricEnabled; + String createdOn; + String editedOn; + int iD; + String iMEI; + String identificationNo; + int logInType; + String mobile; + String name; + String nameN; + bool outSA; + int patientID; + int patientType; + int preferredLanguage; + + SelectDeviceIMEIRES( + {this.biometricEnabled, + this.createdOn, + this.editedOn, + this.iD, + this.iMEI, + this.identificationNo, + this.logInType, + this.mobile, + this.name, + this.nameN, + this.outSA, + this.patientID, + this.patientType, + this.preferredLanguage}); + + SelectDeviceIMEIRES.fromJson(Map json) { + biometricEnabled = json['BiometricEnabled']; + createdOn = json['CreatedOn']; + editedOn = json['EditedOn']; + iD = json['ID']; + iMEI = json['IMEI']; + identificationNo = json['IdentificationNo']; + logInType = json['LogInType']; + mobile = json['Mobile']; + name = json['Name']; + nameN = json['NameN']; + outSA = json['OutSA']; + patientID = json['PatientID']; + patientType = json['PatientType']; + preferredLanguage = json['PreferredLanguage']; + } + + Map toJson() { + final Map data = new Map(); + data['BiometricEnabled'] = this.biometricEnabled; + data['CreatedOn'] = this.createdOn; + data['EditedOn'] = this.editedOn; + data['ID'] = this.iD; + data['IMEI'] = this.iMEI; + data['IdentificationNo'] = this.identificationNo; + data['LogInType'] = this.logInType; + data['Mobile'] = this.mobile; + data['Name'] = this.name; + data['NameN'] = this.nameN; + data['OutSA'] = this.outSA; + data['PatientID'] = this.patientID; + data['PatientType'] = this.patientType; + data['PreferredLanguage'] = this.preferredLanguage; + return data; + } +} diff --git a/lib/models/Authentication/send_activation_request.dart b/lib/models/Authentication/send_activation_request.dart new file mode 100644 index 00000000..b53e19b8 --- /dev/null +++ b/lib/models/Authentication/send_activation_request.dart @@ -0,0 +1,100 @@ +class SendActivationRequest { + int patientMobileNumber; + String mobileNo; + String deviceToken; + bool projectOutSA; + int loginType; + String zipCode; + bool isRegister; + String logInTokenID; + int searchType; + int patientID; + String nationalID; + String patientIdentificationID; + int oTPSendType; + int languageID; + double versionID; + int channel; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + + SendActivationRequest( + {this.patientMobileNumber, + this.mobileNo, + this.deviceToken, + this.projectOutSA, + this.loginType, + this.zipCode, + this.isRegister, + this.logInTokenID, + this.searchType, + this.patientID, + this.nationalID, + this.patientIdentificationID, + this.oTPSendType, + this.languageID, + this.versionID, + this.channel, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); + + SendActivationRequest.fromJson(Map json) { + patientMobileNumber = json['PatientMobileNumber']; + mobileNo = json['MobileNo']; + deviceToken = json['DeviceToken']; + projectOutSA = json['ProjectOutSA']; + loginType = json['LoginType']; + zipCode = json['ZipCode']; + isRegister = json['isRegister']; + logInTokenID = json['LogInTokenID']; + searchType = json['SearchType']; + patientID = json['PatientID']; + nationalID = json['NationalID']; + patientIdentificationID = json['PatientIdentificationID']; + oTPSendType = json['OTP_SendType']; + languageID = json['LanguageID']; + versionID = json['VersionID']; + channel = json['Channel']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMobileNumber'] = this.patientMobileNumber; + data['MobileNo'] = this.mobileNo; + data['DeviceToken'] = this.deviceToken; + data['ProjectOutSA'] = this.projectOutSA; + data['LoginType'] = this.loginType; + data['ZipCode'] = this.zipCode; + data['isRegister'] = this.isRegister; + data['LogInTokenID'] = this.logInTokenID; + data['SearchType'] = this.searchType; + data['PatientID'] = this.patientID; + data['NationalID'] = this.nationalID; + data['PatientIdentificationID'] = this.patientIdentificationID; + data['OTP_SendType'] = this.oTPSendType; + data['LanguageID'] = this.languageID; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/models/Clinics/ClinicListResponse.dart b/lib/models/Clinics/ClinicListResponse.dart new file mode 100644 index 00000000..cabb47b2 --- /dev/null +++ b/lib/models/Clinics/ClinicListResponse.dart @@ -0,0 +1,77 @@ +class ListClinicCentralized { + int clinicID; + String clinicDescription; + Null clinicDescriptionN; + int age; + int gender; + bool isLiveCareClinicAndOnline; + int liveCareClinicID; + int liveCareServiceID; + + ListClinicCentralized( + {this.clinicID, + this.clinicDescription, + this.clinicDescriptionN, + this.age, + this.gender, + this.isLiveCareClinicAndOnline, + this.liveCareClinicID, + this.liveCareServiceID}); + + ListClinicCentralized.fromJson(Map json) { + clinicID = json['ClinicID']; + clinicDescription = json['ClinicDescription']; + clinicDescriptionN = json['ClinicDescriptionN']; + age = json['Age']; + gender = json['Gender']; + isLiveCareClinicAndOnline = json['IsLiveCareClinicAndOnline']; + liveCareClinicID = json['LiveCareClinicID']; + liveCareServiceID = json['LiveCareServiceID']; + } + + Map toJson() { + final Map data = new Map(); + data['ClinicID'] = this.clinicID; + data['ClinicDescription'] = this.clinicDescription; + data['ClinicDescriptionN'] = this.clinicDescriptionN; + data['Age'] = this.age; + data['Gender'] = this.gender; + data['IsLiveCareClinicAndOnline'] = this.isLiveCareClinicAndOnline; + data['LiveCareClinicID'] = this.liveCareClinicID; + data['LiveCareServiceID'] = this.liveCareServiceID; + return data; + } +} + +class ListGetBookScheduleConfigsList { + int iD; + String description; + Null descriptionN; + bool value; + bool isActive; + + ListGetBookScheduleConfigsList( + {this.iD, + this.description, + this.descriptionN, + this.value, + this.isActive}); + + ListGetBookScheduleConfigsList.fromJson(Map json) { + iD = json['ID']; + description = json['Description']; + descriptionN = json['DescriptionN']; + value = json['Value']; + isActive = json['IsActive']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['Value'] = this.value; + data['IsActive'] = this.isActive; + return data; + } +} diff --git a/lib/models/CovidDriveThru/CovidPaymentInfoResponse.dart b/lib/models/CovidDriveThru/CovidPaymentInfoResponse.dart new file mode 100644 index 00000000..a1290e4d --- /dev/null +++ b/lib/models/CovidDriveThru/CovidPaymentInfoResponse.dart @@ -0,0 +1,96 @@ +class CovidPaymentInfoResponse { + dynamic propertyChanged; + dynamic cashPriceField; + dynamic cashPriceTaxField; + dynamic cashPriceWithTaxField; + dynamic companyIdField; + String companyNameField; + dynamic companyShareWithTaxField; + dynamic errCodeField; + dynamic groupIDField; + dynamic insurancePolicyNoField; + String messageField; + dynamic patientCardIDField; + dynamic patientShareField; + dynamic patientShareWithTaxField; + dynamic patientTaxAmountField; + dynamic policyIdField; + dynamic policyNameField; + String procedureNameField; + dynamic setupIDField; + dynamic statusCodeField; + dynamic subPolicyNoField; + + CovidPaymentInfoResponse( + {this.propertyChanged, + this.cashPriceField, + this.cashPriceTaxField, + this.cashPriceWithTaxField, + this.companyIdField, + this.companyNameField, + this.companyShareWithTaxField, + this.errCodeField, + this.groupIDField, + this.insurancePolicyNoField, + this.messageField, + this.patientCardIDField, + this.patientShareField, + this.patientShareWithTaxField, + this.patientTaxAmountField, + this.policyIdField, + this.policyNameField, + this.procedureNameField, + this.setupIDField, + this.statusCodeField, + this.subPolicyNoField}); + + CovidPaymentInfoResponse.fromJson(Map json) { + propertyChanged = json['PropertyChanged']; + cashPriceField = json['cashPriceField']; + cashPriceTaxField = json['cashPriceTaxField']; + cashPriceWithTaxField = json['cashPriceWithTaxField']; + companyIdField = json['companyIdField']; + companyNameField = json['companyNameField']; + companyShareWithTaxField = json['companyShareWithTaxField']; + errCodeField = json['errCodeField']; + groupIDField = json['groupIDField']; + insurancePolicyNoField = json['insurancePolicyNoField']; + messageField = json['messageField']; + patientCardIDField = json['patientCardIDField']; + patientShareField = json['patientShareField']; + patientShareWithTaxField = json['patientShareWithTaxField']; + patientTaxAmountField = json['patientTaxAmountField']; + policyIdField = json['policyIdField']; + policyNameField = json['policyNameField']; + procedureNameField = json['procedureNameField']; + setupIDField = json['setupIDField']; + statusCodeField = json['statusCodeField']; + subPolicyNoField = json['subPolicyNoField']; + } + + Map toJson() { + final Map data = new Map(); + data['PropertyChanged'] = this.propertyChanged; + data['cashPriceField'] = this.cashPriceField; + data['cashPriceTaxField'] = this.cashPriceTaxField; + data['cashPriceWithTaxField'] = this.cashPriceWithTaxField; + data['companyIdField'] = this.companyIdField; + data['companyNameField'] = this.companyNameField; + data['companyShareWithTaxField'] = this.companyShareWithTaxField; + data['errCodeField'] = this.errCodeField; + data['groupIDField'] = this.groupIDField; + data['insurancePolicyNoField'] = this.insurancePolicyNoField; + data['messageField'] = this.messageField; + data['patientCardIDField'] = this.patientCardIDField; + data['patientShareField'] = this.patientShareField; + data['patientShareWithTaxField'] = this.patientShareWithTaxField; + data['patientTaxAmountField'] = this.patientTaxAmountField; + data['policyIdField'] = this.policyIdField; + data['policyNameField'] = this.policyNameField; + data['procedureNameField'] = this.procedureNameField; + data['setupIDField'] = this.setupIDField; + data['statusCodeField'] = this.statusCodeField; + data['subPolicyNoField'] = this.subPolicyNoField; + return data; + } +} diff --git a/lib/models/CovidDriveThru/DriveThroughTestingCenterModel.dart b/lib/models/CovidDriveThru/DriveThroughTestingCenterModel.dart new file mode 100644 index 00000000..c85a06b3 --- /dev/null +++ b/lib/models/CovidDriveThru/DriveThroughTestingCenterModel.dart @@ -0,0 +1,68 @@ +class DriveThroughTestingCenterModel { + int rowID; + int iD; + int projectID; + String setupID; + double longitude; + double latitude; + int numberOfTracks; + bool isActive; + int createdBy; + String createdOn; + dynamic editedBy; + dynamic editedON; + dynamic projectName; + dynamic projectNameN; + + DriveThroughTestingCenterModel( + {this.rowID, + this.iD, + this.projectID, + this.setupID, + this.longitude, + this.latitude, + this.numberOfTracks, + this.isActive, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedON, + this.projectName, + this.projectNameN}); + + DriveThroughTestingCenterModel.fromJson(Map json) { + rowID = json['RowID']; + iD = json['ID']; + projectID = json['ProjectID']; + setupID = json['SetupID']; + longitude = json['Longitude']; + latitude = json['Latitude']; + numberOfTracks = json['NumberOfTracks']; + isActive = json['IsActive']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedON = json['EditedON']; + projectName = json['ProjectName']; + projectNameN = json['ProjectNameN']; + } + + Map toJson() { + final Map data = new Map(); + data['RowID'] = this.rowID; + data['ID'] = this.iD; + data['ProjectID'] = this.projectID; + data['SetupID'] = this.setupID; + data['Longitude'] = this.longitude; + data['Latitude'] = this.latitude; + data['NumberOfTracks'] = this.numberOfTracks; + data['IsActive'] = this.isActive; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedON'] = this.editedON; + data['ProjectName'] = this.projectName; + data['ProjectNameN'] = this.projectNameN; + return data; + } +} diff --git a/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart b/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart new file mode 100644 index 00000000..750cf0be --- /dev/null +++ b/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart @@ -0,0 +1,361 @@ +class GetAllSharedRecordsByStatusResponse { + dynamic date; + int languageID; + int serviceName; + dynamic time; + dynamic androidLink; + dynamic authenticationTokenID; + dynamic data; + bool dataw; + int dietType; + dynamic errorCode; + dynamic errorEndUserMessage; + dynamic errorEndUserMessageN; + dynamic errorMessage; + int errorType; + int foodCategory; + dynamic iOSLink; + bool isAuthenticated; + int mealOrderStatus; + int mealType; + int messageStatus; + int numberOfResultRecords; + dynamic patientBlodType; + dynamic successMsg; + dynamic successMsgN; + dynamic doctorInformationList; + List getAllPendingRecordsList; + List getAllSharedRecordsByStatusList = List(); + List getResponseFileList; + bool isHMGPatient; + bool isLoginSuccessfully; + bool isNeedUpdateIdintificationNo; + bool kioskSendSMS; + dynamic list; + dynamic listAskHabibMobileLoginInfo; + dynamic listAskHabibPatientFile; + dynamic listMergeFiles; + dynamic listMobileLoginInfo; + dynamic listPatientCount; + dynamic logInTokenID; + dynamic mohemmPrivilegeList; + int pateintID; + dynamic patientBloodType; + dynamic patientERDriverFile; + dynamic patientERDriverFileList; + bool patientHasFile; + dynamic patientMergedIDs; + bool patientOutSA; + int patientShareRequestID; + int patientType; + int projectIDOut; + dynamic returnMessage; + bool sMSLoginRequired; + dynamic servicePrivilegeList; + dynamic sharePatientName; + dynamic verificationCode; + dynamic email; + dynamic errorList; + bool hasFile; + bool isActiveCode; + bool isMerged; + bool isNeedUserAgreement; + bool isSMSSent; + dynamic memberList; + dynamic message; + int statusCode; + + GetAllSharedRecordsByStatusResponse( + {this.date, + this.languageID, + this.serviceName, + this.time, + this.androidLink, + this.authenticationTokenID, + this.data, + this.dataw, + this.dietType, + this.errorCode, + this.errorEndUserMessage, + this.errorEndUserMessageN, + this.errorMessage, + this.errorType, + this.foodCategory, + this.iOSLink, + this.isAuthenticated, + this.mealOrderStatus, + this.mealType, + this.messageStatus, + this.numberOfResultRecords, + this.patientBlodType, + this.successMsg, + this.successMsgN, + this.doctorInformationList, + this.getAllPendingRecordsList, + this.getAllSharedRecordsByStatusList , + this.getResponseFileList, + this.isHMGPatient, + this.isLoginSuccessfully, + this.isNeedUpdateIdintificationNo, + this.kioskSendSMS, + this.list, + this.listAskHabibMobileLoginInfo, + this.listAskHabibPatientFile, + this.listMergeFiles, + this.listMobileLoginInfo, + this.listPatientCount, + this.logInTokenID, + this.mohemmPrivilegeList, + this.pateintID, + this.patientBloodType, + this.patientERDriverFile, + this.patientERDriverFileList, + this.patientHasFile, + this.patientMergedIDs, + this.patientOutSA, + this.patientShareRequestID, + this.patientType, + this.projectIDOut, + this.returnMessage, + this.sMSLoginRequired, + this.servicePrivilegeList, + this.sharePatientName, + this.verificationCode, + this.email, + this.errorList, + this.hasFile, + this.isActiveCode, + this.isMerged, + this.isNeedUserAgreement, + this.isSMSSent, + this.memberList, + this.message, + this.statusCode}); + + GetAllSharedRecordsByStatusResponse.fromJson(Map json) { + try { + date = json['Date']; + languageID = json['LanguageID']; + serviceName = json['ServiceName']; + time = json['Time']; + androidLink = json['AndroidLink']; + authenticationTokenID = json['AuthenticationTokenID']; + data = json['Data']; + dataw = json['Dataw']; + dietType = json['DietType']; + errorCode = json['ErrorCode']; + errorEndUserMessage = json['ErrorEndUserMessage']; + errorEndUserMessageN = json['ErrorEndUserMessageN']; + errorMessage = json['ErrorMessage']; + errorType = json['ErrorType']; + foodCategory = json['FoodCategory']; + iOSLink = json['IOSLink']; + isAuthenticated = json['IsAuthenticated']; + mealOrderStatus = json['MealOrderStatus']; + mealType = json['MealType']; + messageStatus = json['MessageStatus']; + numberOfResultRecords = json['NumberOfResultRecords']; + patientBlodType = json['PatientBlodType']; + successMsg = json['SuccessMsg']; + successMsgN = json['SuccessMsgN']; + doctorInformationList = json['DoctorInformation_List']; +// getAllPendingRecordsList = json['GetAllPendingRecordsList']; + + if (json['GetAllPendingRecordsList'] != null) { + getAllSharedRecordsByStatusList = new List(); + json['GetAllPendingRecordsList'].forEach((v) { + getAllSharedRecordsByStatusList + .add(new GetAllSharedRecordsByStatusList.fromJson(v)); + }); + } + + if (json['GetAllSharedRecordsByStatusList'] != null) { + getAllSharedRecordsByStatusList = new List(); + json['GetAllSharedRecordsByStatusList'].forEach((v) { + getAllSharedRecordsByStatusList + .add(new GetAllSharedRecordsByStatusList.fromJson(v)); + }); + } + getResponseFileList = json['GetResponseFileList']; + isHMGPatient = json['IsHMGPatient']; + isLoginSuccessfully = json['IsLoginSuccessfully']; + isNeedUpdateIdintificationNo = json['IsNeedUpdateIdintificationNo']; + kioskSendSMS = json['KioskSendSMS']; + list = json['List']; + listAskHabibMobileLoginInfo = json['List_AskHabibMobileLoginInfo']; + listAskHabibPatientFile = json['List_AskHabibPatientFile']; + listMergeFiles = json['List_MergeFiles']; + listMobileLoginInfo = json['List_MobileLoginInfo']; + listPatientCount = json['List_PatientCount']; + logInTokenID = json['LogInTokenID']; + mohemmPrivilegeList = json['MohemmPrivilege_List']; + pateintID = json['PateintID']; + patientBloodType = json['PatientBloodType']; + patientERDriverFile = json['PatientER_DriverFile']; + patientERDriverFileList = json['PatientER_DriverFileList']; + patientHasFile = json['PatientHasFile']; + patientMergedIDs = json['PatientMergedIDs']; + patientOutSA = json['PatientOutSA']; + patientShareRequestID = json['PatientShareRequestID']; + patientType = json['PatientType']; + projectIDOut = json['ProjectIDOut']; + returnMessage = json['ReturnMessage']; + sMSLoginRequired = json['SMSLoginRequired']; + servicePrivilegeList = json['ServicePrivilege_List']; + sharePatientName = json['SharePatientName']; + verificationCode = json['VerificationCode']; + email = json['email']; + errorList = json['errorList']; + hasFile = json['hasFile']; + isActiveCode = json['isActiveCode']; + isMerged = json['isMerged']; + isNeedUserAgreement = json['isNeedUserAgreement']; + isSMSSent = json['isSMSSent']; + memberList = json['memberList']; + message = json['message']; + statusCode = json['statusCode']; + }catch (e){ + var asd =""; + print(e); + + } + } + + Map toJson() { + final Map data = new Map(); + data['Date'] = this.date; + data['LanguageID'] = this.languageID; + data['ServiceName'] = this.serviceName; + data['Time'] = this.time; + data['AndroidLink'] = this.androidLink; + data['AuthenticationTokenID'] = this.authenticationTokenID; + data['Data'] = this.data; + data['Dataw'] = this.dataw; + data['DietType'] = this.dietType; + data['ErrorCode'] = this.errorCode; + data['ErrorEndUserMessage'] = this.errorEndUserMessage; + data['ErrorEndUserMessageN'] = this.errorEndUserMessageN; + data['ErrorMessage'] = this.errorMessage; + data['ErrorType'] = this.errorType; + data['FoodCategory'] = this.foodCategory; + data['IOSLink'] = this.iOSLink; + data['IsAuthenticated'] = this.isAuthenticated; + data['MealOrderStatus'] = this.mealOrderStatus; + data['MealType'] = this.mealType; + data['MessageStatus'] = this.messageStatus; + data['NumberOfResultRecords'] = this.numberOfResultRecords; + data['PatientBlodType'] = this.patientBlodType; + data['SuccessMsg'] = this.successMsg; + data['SuccessMsgN'] = this.successMsgN; + data['DoctorInformation_List'] = this.doctorInformationList; + data['GetAllPendingRecordsList'] = this.getAllPendingRecordsList; + if (this.getAllSharedRecordsByStatusList != null) { + data['GetAllSharedRecordsByStatusList'] = + this.getAllSharedRecordsByStatusList.map((v) => v.toJson()).toList(); + } + data['GetResponseFileList'] = this.getResponseFileList; + data['IsHMGPatient'] = this.isHMGPatient; + data['IsLoginSuccessfully'] = this.isLoginSuccessfully; + data['IsNeedUpdateIdintificationNo'] = this.isNeedUpdateIdintificationNo; + data['KioskSendSMS'] = this.kioskSendSMS; + data['List'] = this.list; + data['List_AskHabibMobileLoginInfo'] = this.listAskHabibMobileLoginInfo; + data['List_AskHabibPatientFile'] = this.listAskHabibPatientFile; + data['List_MergeFiles'] = this.listMergeFiles; + data['List_MobileLoginInfo'] = this.listMobileLoginInfo; + data['List_PatientCount'] = this.listPatientCount; + data['LogInTokenID'] = this.logInTokenID; + data['MohemmPrivilege_List'] = this.mohemmPrivilegeList; + data['PateintID'] = this.pateintID; + data['PatientBloodType'] = this.patientBloodType; + data['PatientER_DriverFile'] = this.patientERDriverFile; + data['PatientER_DriverFileList'] = this.patientERDriverFileList; + data['PatientHasFile'] = this.patientHasFile; + data['PatientMergedIDs'] = this.patientMergedIDs; + data['PatientOutSA'] = this.patientOutSA; + data['PatientShareRequestID'] = this.patientShareRequestID; + data['PatientType'] = this.patientType; + data['ProjectIDOut'] = this.projectIDOut; + data['ReturnMessage'] = this.returnMessage; + data['SMSLoginRequired'] = this.sMSLoginRequired; + data['ServicePrivilege_List'] = this.servicePrivilegeList; + data['SharePatientName'] = this.sharePatientName; + data['VerificationCode'] = this.verificationCode; + data['email'] = this.email; + data['errorList'] = this.errorList; + data['hasFile'] = this.hasFile; + data['isActiveCode'] = this.isActiveCode; + data['isMerged'] = this.isMerged; + data['isNeedUserAgreement'] = this.isNeedUserAgreement; + data['isSMSSent'] = this.isSMSSent; + data['memberList'] = this.memberList; + data['message'] = this.message; + data['statusCode'] = this.statusCode; + return data; + } +} + +class GetAllSharedRecordsByStatusList { + int iD; + int patientID; + int responseID; + int regionID; + int status; + dynamic isActive; + String editedOn; + String createdOn; + String emaiLAddress; + String mobileNumber; + String patientIdenficationNumber; + String patientName; + String statusDescription; + + GetAllSharedRecordsByStatusList( + {this.iD, + this.patientID, + this.responseID, + this.regionID, + this.status, + this.isActive, + this.editedOn, + this.createdOn, + this.emaiLAddress, + this.mobileNumber, + this.patientIdenficationNumber, + this.patientName, + this.statusDescription}); + + GetAllSharedRecordsByStatusList.fromJson(Map json) { + iD = json['ID']; + patientID = json['PatientID']; + responseID = json['ResponseID']; + regionID = json['RegionID']; + status = json['Status']; + isActive = json['IsActive']; + editedOn = json['EditedOn']; + createdOn = json['CreatedOn']; + emaiLAddress = json['EmaiLAddress']; + mobileNumber = json['MobileNumber']; + patientIdenficationNumber = json['PatientIdenficationNumber']; + patientName = json['PatientName']; + statusDescription = json['StatusDescription']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['PatientID'] = this.patientID; + data['ResponseID'] = this.responseID; + data['RegionID'] = this.regionID; + data['Status'] = this.status; + data['IsActive'] = this.isActive; + data['EditedOn'] = this.editedOn; + data['CreatedOn'] = this.createdOn; + data['EmaiLAddress'] = this.emaiLAddress; + data['MobileNumber'] = this.mobileNumber; + data['PatientIdenficationNumber'] = this.patientIdenficationNumber; + data['PatientName'] = this.patientName; + data['StatusDescription'] = this.statusDescription; + return data; + } +} diff --git a/lib/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart b/lib/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart new file mode 100644 index 00000000..ac0adc34 --- /dev/null +++ b/lib/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart @@ -0,0 +1,68 @@ +class GetAllSharedRecordsByStatusReq { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int status; + + GetAllSharedRecordsByStatusReq( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.status}); + + GetAllSharedRecordsByStatusReq.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + status = json['Status']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['Status'] = this.status; + return data; + } +} diff --git a/lib/models/FamilyFiles/PatientERVirtualHistoryResponse.dart b/lib/models/FamilyFiles/PatientERVirtualHistoryResponse.dart new file mode 100644 index 00000000..11a8157c --- /dev/null +++ b/lib/models/FamilyFiles/PatientERVirtualHistoryResponse.dart @@ -0,0 +1,108 @@ +class PatientERVirtualHistoryResponse { + List erRequestHistoryList; + + PatientERVirtualHistoryResponse({this.erRequestHistoryList}); + + PatientERVirtualHistoryResponse.fromJson(Map json) { + if (json['ErRequestHistoryList'] != null) { + erRequestHistoryList = new List(); + json['ErRequestHistoryList'].forEach((v) { + erRequestHistoryList.add(new ErRequestHistoryList.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.erRequestHistoryList != null) { + data['ErRequestHistoryList'] = + this.erRequestHistoryList.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ErRequestHistoryList { + dynamic appointmentNo; + String arrivalTime; + int callDuration; + int callStatus; + String clientRequestID; + String doctorID; + String doctorName; + String doctorNameN; + String doctorTitle; + String exWaitingTime; + bool isAppointmentHaveRating; + int patCount; + int projectID; + String sArrivalTime; + int serviceID; + String stringCallStatus; + int vCID; + int watingtimeInteger; + + ErRequestHistoryList( + {this.appointmentNo, + this.arrivalTime, + this.callDuration, + this.callStatus, + this.clientRequestID, + this.doctorID, + this.doctorName, + this.doctorNameN, + this.doctorTitle, + this.exWaitingTime, + this.isAppointmentHaveRating, + this.patCount, + this.projectID, + this.sArrivalTime, + this.serviceID, + this.stringCallStatus, + this.vCID, + this.watingtimeInteger}); + + ErRequestHistoryList.fromJson(Map json) { + appointmentNo = json['AppointmentNo'] != null ? json['AppointmentNo'] : "0"; + arrivalTime = json['ArrivalTime']; + callDuration = json['CallDuration']; + callStatus = json['CallStatus']; + clientRequestID = json['ClientRequestID']; + doctorID = json['DoctorID']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + doctorTitle = json['DoctorTitle']; + exWaitingTime = json['Ex_WaitingTime']; + isAppointmentHaveRating = json['IsAppointmentHaveRating']; + patCount = json['Pat_Count']; + projectID = json['ProjectID']; + sArrivalTime = json['SArrivalTime']; + serviceID = json['ServiceID']; + stringCallStatus = json['StringCallStatus']; + vCID = json['VC_ID']; + watingtimeInteger = json['WatingtimeInteger']; + } + + Map toJson() { + final Map data = new Map(); + data['AppointmentNo'] = this.appointmentNo; + data['ArrivalTime'] = this.arrivalTime; + data['CallDuration'] = this.callDuration; + data['CallStatus'] = this.callStatus; + data['ClientRequestID'] = this.clientRequestID; + data['DoctorID'] = this.doctorID; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['DoctorTitle'] = this.doctorTitle; + data['Ex_WaitingTime'] = this.exWaitingTime; + data['IsAppointmentHaveRating'] = this.isAppointmentHaveRating; + data['Pat_Count'] = this.patCount; + data['ProjectID'] = this.projectID; + data['SArrivalTime'] = this.sArrivalTime; + data['ServiceID'] = this.serviceID; + data['StringCallStatus'] = this.stringCallStatus; + data['VC_ID'] = this.vCID; + data['WatingtimeInteger'] = this.watingtimeInteger; + return data; + } +} diff --git a/lib/models/LiveCare/ClinicsServiceTimingsResponse.dart b/lib/models/LiveCare/ClinicsServiceTimingsResponse.dart new file mode 100644 index 00000000..223b633f --- /dev/null +++ b/lib/models/LiveCare/ClinicsServiceTimingsResponse.dart @@ -0,0 +1,122 @@ +class ClinicsServiceTimingsResponse { + List + patientERGetClinicsServiceTimingsList; + + ClinicsServiceTimingsResponse({this.patientERGetClinicsServiceTimingsList}); + + ClinicsServiceTimingsResponse.fromJson(Map json) { + if (json['PatientER_GetClinicsServiceTimingsList'] != null) { + patientERGetClinicsServiceTimingsList = + new List(); + json['PatientER_GetClinicsServiceTimingsList'].forEach((v) { + patientERGetClinicsServiceTimingsList + .add(new PatientERGetClinicsServiceTimingsList.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.patientERGetClinicsServiceTimingsList != null) { + data['PatientER_GetClinicsServiceTimingsList'] = this + .patientERGetClinicsServiceTimingsList + .map((v) => v.toJson()) + .toList(); + } + return data; + } +} + +class PatientERGetClinicsServiceTimingsList { + int iD; + int serviceID; + Null shiftID; + int dayOfWeek; + String dayOfWeekStr; + Null startTime; + Null endTime; + bool isActive; + String createdOn; + String createdBy; + bool projectOutSA; + String dayOfWeekStrN; + List shiftTimings; + + PatientERGetClinicsServiceTimingsList( + {this.iD, + this.serviceID, + this.shiftID, + this.dayOfWeek, + this.dayOfWeekStr, + this.startTime, + this.endTime, + this.isActive, + this.createdOn, + this.createdBy, + this.projectOutSA, + this.dayOfWeekStrN, + this.shiftTimings}); + + PatientERGetClinicsServiceTimingsList.fromJson(Map json) { + iD = json['ID']; + serviceID = json['ServiceID']; + shiftID = json['ShiftID']; + dayOfWeek = json['DayOfWeek']; + dayOfWeekStr = json['DayOfWeekStr']; + startTime = json['StartTime']; + endTime = json['EndTime']; + isActive = json['IsActive']; + createdOn = json['CreatedOn']; + createdBy = json['CreatedBy']; + projectOutSA = json['ProjectOutSA']; + dayOfWeekStrN = json['DayOfWeekStrN']; + if (json['ShiftTimings'] != null) { + shiftTimings = new List(); + json['ShiftTimings'].forEach((v) { + shiftTimings.add(new ShiftTimings.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['ServiceID'] = this.serviceID; + data['ShiftID'] = this.shiftID; + data['DayOfWeek'] = this.dayOfWeek; + data['DayOfWeekStr'] = this.dayOfWeekStr; + data['StartTime'] = this.startTime; + data['EndTime'] = this.endTime; + data['IsActive'] = this.isActive; + data['CreatedOn'] = this.createdOn; + data['CreatedBy'] = this.createdBy; + data['ProjectOutSA'] = this.projectOutSA; + data['DayOfWeekStrN'] = this.dayOfWeekStrN; + if (this.shiftTimings != null) { + data['ShiftTimings'] = this.shiftTimings.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ShiftTimings { + String endTime; + int shiftID; + String startTime; + + ShiftTimings({this.endTime, this.shiftID, this.startTime}); + + ShiftTimings.fromJson(Map json) { + endTime = json['EndTime']; + shiftID = json['ShiftID']; + startTime = json['StartTime']; + } + + Map toJson() { + final Map data = new Map(); + data['EndTime'] = this.endTime; + data['ShiftID'] = this.shiftID; + data['StartTime'] = this.startTime; + return data; + } +} diff --git a/lib/models/LiveCare/ERAppointmentFeesResponse.dart b/lib/models/LiveCare/ERAppointmentFeesResponse.dart new file mode 100644 index 00000000..a6cc061a --- /dev/null +++ b/lib/models/LiveCare/ERAppointmentFeesResponse.dart @@ -0,0 +1,61 @@ +class ERAppointmentFeesResponse { + GetERAppointmentFeesList getERAppointmentFeesList; + + ERAppointmentFeesResponse({this.getERAppointmentFeesList}); + + ERAppointmentFeesResponse.fromJson(Map json) { + getERAppointmentFeesList = json['GetERAppointmentFeesList'] != null + ? new GetERAppointmentFeesList.fromJson( + json['GetERAppointmentFeesList']) + : null; + } + + Map toJson() { + final Map data = new Map(); + if (this.getERAppointmentFeesList != null) { + data['GetERAppointmentFeesList'] = this.getERAppointmentFeesList.toJson(); + } + return data; + } +} + +class GetERAppointmentFeesList { + String amount; + String companyName; + bool isInsured; + bool isShowInsuranceUpdateModule; + String tax; + String total; + String currency; + + GetERAppointmentFeesList( + {this.amount, + this.companyName, + this.isInsured, + this.isShowInsuranceUpdateModule, + this.tax, + this.total, + this.currency}); + + GetERAppointmentFeesList.fromJson(Map json) { + amount = json['Amount']; + companyName = json['CompanyName']; + isInsured = json['IsInsured']; + isShowInsuranceUpdateModule = json['IsShowInsuranceUpdateModule']; + tax = json['Tax']; + total = json['Total']; + currency = json['currency']; + } + + Map toJson() { + final Map data = new Map(); + data['Amount'] = this.amount; + data['CompanyName'] = this.companyName; + data['IsInsured'] = this.isInsured; + data['IsShowInsuranceUpdateModule'] = this.isShowInsuranceUpdateModule; + data['Tax'] = this.tax; + data['Total'] = this.total; + data['currency'] = this.currency; + return data; + } +} diff --git a/lib/models/LiveCare/IncomingCallData.dart b/lib/models/LiveCare/IncomingCallData.dart new file mode 100644 index 00000000..9234c876 --- /dev/null +++ b/lib/models/LiveCare/IncomingCallData.dart @@ -0,0 +1,104 @@ +class IncomingCallData { + String msgID; + String notfID; + String notificationForeground; + String count; + String message; + String appointmentNo; + String title; + String projectID; + String notificationType; + String background; + String doctorname; + String clinicname; + String speciality; + String appointmentdate; + String appointmenttime; + String type; + String sessionId; + String identity; + String name; + String videoUrl; + String picture; + String isCall; + String sound; + + IncomingCallData( + {this.msgID, + this.notfID, + this.notificationForeground, + this.count, + this.message, + this.appointmentNo, + this.title, + this.projectID, + this.notificationType, + this.background, + this.doctorname, + this.clinicname, + this.speciality, + this.appointmentdate, + this.appointmenttime, + this.type, + this.sessionId, + this.identity, + this.name, + this.videoUrl, + this.picture, + this.isCall, + this.sound}); + + IncomingCallData.fromJson(Map json) { + msgID = json['msgID']; + notfID = json['notfID']; + notificationForeground = json['notification_foreground']; + count = json['count']; + message = json['message']; + appointmentNo = json['AppointmentNo']; + title = json['title']; + projectID = json['ProjectID']; + notificationType = json['NotificationType']; + background = json['background']; + doctorname = json['doctorname']; + clinicname = json['clinicname']; + speciality = json['speciality']; + appointmentdate = json['appointmentdate']; + appointmenttime = json['appointmenttime']; + type = json['type']; + sessionId = json['session_id']; + identity = json['identity']; + name = json['name']; + videoUrl = json['videoUrl']; + picture = json['picture']; + isCall = json['is_call']; + sound = json['sound']; + } + + Map toJson() { + final Map data = new Map(); + data['msgID'] = this.msgID; + data['notfID'] = this.notfID; + data['notification_foreground'] = this.notificationForeground; + data['count'] = this.count; + data['message'] = this.message; + data['AppointmentNo'] = this.appointmentNo; + data['title'] = this.title; + data['ProjectID'] = this.projectID; + data['NotificationType'] = this.notificationType; + data['background'] = this.background; + data['doctorname'] = this.doctorname; + data['clinicname'] = this.clinicname; + data['speciality'] = this.speciality; + data['appointmentdate'] = this.appointmentdate; + data['appointmenttime'] = this.appointmenttime; + data['type'] = this.type; + data['session_id'] = this.sessionId; + data['identity'] = this.identity; + data['name'] = this.name; + data['videoUrl'] = this.videoUrl; + data['picture'] = this.picture; + data['is_call'] = this.isCall; + data['sound'] = this.sound; + return data; + } +} diff --git a/lib/models/LiveCare/LiveCareClinicsListResponse.dart b/lib/models/LiveCare/LiveCareClinicsListResponse.dart new file mode 100644 index 00000000..094fb1a5 --- /dev/null +++ b/lib/models/LiveCare/LiveCareClinicsListResponse.dart @@ -0,0 +1,129 @@ +class LiveCareClinicsListResponse { + List patientERGetClinicsList; + + LiveCareClinicsListResponse({this.patientERGetClinicsList}); + + LiveCareClinicsListResponse.fromJson(Map json) { + if (json['PatientER_GetClinicsList'] != null) { + patientERGetClinicsList = new List(); + json['PatientER_GetClinicsList'].forEach((v) { + patientERGetClinicsList.add(new PatientERGetClinicsList.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.patientERGetClinicsList != null) { + data['PatientER_GetClinicsList'] = + this.patientERGetClinicsList.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class PatientERGetClinicsList { + int iD; + int serviceID; + String serviceName; + String serviceNameN; + int clinicID; + int age; + bool isCheckAgeBelow; + int gender; + bool isActive; + String createdOn; + String createdBy; + int isOnline; + Null endTime; + bool projectOutSA; + List shiftTimings; + Null startTime; + + PatientERGetClinicsList( + {this.iD, + this.serviceID, + this.serviceName, + this.serviceNameN, + this.clinicID, + this.age, + this.isCheckAgeBelow, + this.gender, + this.isActive, + this.createdOn, + this.createdBy, + this.isOnline, + this.endTime, + this.projectOutSA, + this.shiftTimings, + this.startTime}); + + PatientERGetClinicsList.fromJson(Map json) { + iD = json['ID']; + serviceID = json['ServiceID']; + serviceName = json['ServiceName']; + serviceNameN = json['ServiceNameN']; + clinicID = json['ClinicID']; + age = json['Age']; + isCheckAgeBelow = json['IsCheckAgeBelow']; + gender = json['Gender']; + isActive = json['IsActive']; + createdOn = json['CreatedOn']; + createdBy = json['CreatedBy']; + isOnline = json['IsOnline']; + endTime = json['EndTime']; + projectOutSA = json['ProjectOutSA']; + if (json['ShiftTimings'] != null) { + shiftTimings = new List(); + json['ShiftTimings'].forEach((v) { + shiftTimings.add(new ShiftTimings.fromJson(v)); + }); + } + startTime = json['StartTime']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['ServiceID'] = this.serviceID; + data['ServiceName'] = this.serviceName; + data['ServiceNameN'] = this.serviceNameN; + data['ClinicID'] = this.clinicID; + data['Age'] = this.age; + data['IsCheckAgeBelow'] = this.isCheckAgeBelow; + data['Gender'] = this.gender; + data['IsActive'] = this.isActive; + data['CreatedOn'] = this.createdOn; + data['CreatedBy'] = this.createdBy; + data['IsOnline'] = this.isOnline; + data['EndTime'] = this.endTime; + data['ProjectOutSA'] = this.projectOutSA; + if (this.shiftTimings != null) { + data['ShiftTimings'] = this.shiftTimings.map((v) => v.toJson()).toList(); + } + data['StartTime'] = this.startTime; + return data; + } +} + +class ShiftTimings { + String endTime; + int shiftID; + String startTime; + + ShiftTimings({this.endTime, this.shiftID, this.startTime}); + + ShiftTimings.fromJson(Map json) { + endTime = json['EndTime']; + shiftID = json['ShiftID']; + startTime = json['StartTime']; + } + + Map toJson() { + final Map data = new Map(); + data['EndTime'] = this.endTime; + data['ShiftID'] = this.shiftID; + data['StartTime'] = this.startTime; + return data; + } +} diff --git a/lib/models/LiveCare/LiveCareScheduleClinicsListResponse.dart b/lib/models/LiveCare/LiveCareScheduleClinicsListResponse.dart new file mode 100644 index 00000000..8951370c --- /dev/null +++ b/lib/models/LiveCare/LiveCareScheduleClinicsListResponse.dart @@ -0,0 +1,64 @@ +class LiveCareScheduleClinicsListResponse { + List clinicsHaveScheduleList; + + LiveCareScheduleClinicsListResponse({this.clinicsHaveScheduleList}); + + LiveCareScheduleClinicsListResponse.fromJson(Map json) { + if (json['ClinicsHaveScheduleList'] != null) { + clinicsHaveScheduleList = new List(); + json['ClinicsHaveScheduleList'].forEach((v) { + clinicsHaveScheduleList.add(new ClinicsHaveScheduleList.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.clinicsHaveScheduleList != null) { + data['ClinicsHaveScheduleList'] = + this.clinicsHaveScheduleList.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ClinicsHaveScheduleList { + int clinicID; + int serviceID; + int projectID; + String clinicDesc; + String clinicDescN; + String projectDesc; + String projectDescN; + + ClinicsHaveScheduleList( + {this.clinicID, + this.serviceID, + this.projectID, + this.clinicDesc, + this.clinicDescN, + this.projectDesc, + this.projectDescN}); + + ClinicsHaveScheduleList.fromJson(Map json) { + clinicID = json['ClinicID']; + serviceID = json['ServiceID']; + projectID = json['ProjectID']; + clinicDesc = json['ClinicDesc']; + clinicDescN = json['ClinicDescN']; + projectDesc = json['ProjectDesc']; + projectDescN = json['ProjectDescN']; + } + + Map toJson() { + final Map data = new Map(); + data['ClinicID'] = this.clinicID; + data['ServiceID'] = this.serviceID; + data['ProjectID'] = this.projectID; + data['ClinicDesc'] = this.clinicDesc; + data['ClinicDescN'] = this.clinicDescN; + data['ProjectDesc'] = this.projectDesc; + data['ProjectDescN'] = this.projectDescN; + return data; + } +} diff --git a/lib/models/LiveCare/insertVIDARequest.dart b/lib/models/LiveCare/insertVIDARequest.dart new file mode 100644 index 00000000..938ca102 --- /dev/null +++ b/lib/models/LiveCare/insertVIDARequest.dart @@ -0,0 +1,92 @@ +class insertVIDARequest { + int patientID; + int acceptedBy; + int appointmentNo; + String deviceToken; + double latitude; + double longitude; + int serviceID; + int projectID; + int clinicID; + String deviceType; + String voipToken; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + + insertVIDARequest( + {this.patientID, + this.acceptedBy, + this.appointmentNo, + this.deviceToken, + this.latitude, + this.longitude, + this.serviceID, + this.projectID, + this.clinicID, + this.deviceType, + this.voipToken, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); + + insertVIDARequest.fromJson(Map json) { + patientID = json['PatientID']; + acceptedBy = json['AcceptedBy']; + appointmentNo = json['AppointmentNo']; + deviceToken = json['DeviceToken']; + latitude = json['Latitude']; + longitude = json['Longitude']; + serviceID = json['ServiceID']; + projectID = json['ProjectID']; + clinicID = json['ClinicID']; + deviceType = json['DeviceType']; + voipToken = json['VoipToken']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['AcceptedBy'] = this.acceptedBy; + data['AppointmentNo'] = this.appointmentNo; + data['DeviceToken'] = this.deviceToken; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['ServiceID'] = this.serviceID; + data['ProjectID'] = this.projectID; + data['ClinicID'] = this.clinicID; + data['DeviceType'] = this.deviceType; + data['VoipToken'] = this.voipToken; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/models/LiveCare/room_model.dart b/lib/models/LiveCare/room_model.dart new file mode 100644 index 00000000..6ab64d1d --- /dev/null +++ b/lib/models/LiveCare/room_model.dart @@ -0,0 +1,65 @@ +import 'package:diplomaticquarterapp/models/LiveCare/room_validators.dart'; +import 'package:diplomaticquarterapp/models/LiveCare/twilio_enums.dart'; + +class RoomModel with RoomValidators { + final String name; + final bool isLoading; + final bool isSubmitted; + final String token; + final String identity; + final TwilioRoomType type; + + RoomModel({ + this.name, + this.isLoading = false, + this.isSubmitted = false, + this.token, + this.identity, + this.type = TwilioRoomType.groupSmall, + }); + + static String getTypeText(TwilioRoomType type) { + switch (type) { + case TwilioRoomType.peerToPeer: + return 'peer 2 peer'; + break; + case TwilioRoomType.group: + return 'large (max 50 participants)'; + break; + case TwilioRoomType.groupSmall: + return 'small (max 4 participants)'; + break; + } + return ''; + } + + String get nameErrorText { + return isSubmitted && !nameValidator.isValid(name) ? invalidNameErrorText : null; + } + + String get typeText { + return RoomModel.getTypeText(type); + } + + bool get canSubmit { + return nameValidator.isValid(name); + } + + RoomModel copyWith({ + String name, + bool isLoading, + bool isSubmitted, + String token, + String identity, + TwilioRoomType type, + }) { + return RoomModel( + name: name ?? this.name, + token: token ?? this.token, + identity: identity ?? this.identity, + isLoading: isLoading ?? this.isLoading, + isSubmitted: isSubmitted ?? this.isSubmitted, + type: type ?? this.type, + ); + } +} diff --git a/lib/models/LiveCare/room_validators.dart b/lib/models/LiveCare/room_validators.dart new file mode 100644 index 00000000..44fe95f0 --- /dev/null +++ b/lib/models/LiveCare/room_validators.dart @@ -0,0 +1,6 @@ +import 'package:diplomaticquarterapp/models/LiveCare/validators.dart'; + +mixin RoomValidators { + final StringValidator nameValidator = NonEmptyStringValidator(); + final String invalidNameErrorText = 'Room name can\'t be empty'; +} diff --git a/lib/models/LiveCare/twilio_enums.dart b/lib/models/LiveCare/twilio_enums.dart new file mode 100644 index 00000000..4d4f6f69 --- /dev/null +++ b/lib/models/LiveCare/twilio_enums.dart @@ -0,0 +1,17 @@ +enum TwilioRoomType { + peerToPeer, + group, + groupSmall, +} + +enum TwilioRoomStatus { + completed, + inProgress, +} + +enum TwilioStatusCallbackMethod { + GET, + POST, +} + +enum TwilioVideoCodec { VP8, H264 } diff --git a/lib/models/LiveCare/validators.dart b/lib/models/LiveCare/validators.dart new file mode 100644 index 00000000..aa42f231 --- /dev/null +++ b/lib/models/LiveCare/validators.dart @@ -0,0 +1,13 @@ +abstract class StringValidator { + bool isValid(String value); +} + +class NonEmptyStringValidator implements StringValidator { + @override + bool isValid(String value) { + if (value == null) { + return false; + } + return value.isNotEmpty; + } +} diff --git a/lib/models/Request.dart b/lib/models/Request.dart new file mode 100644 index 00000000..a4cef77b --- /dev/null +++ b/lib/models/Request.dart @@ -0,0 +1,34 @@ +class Request { + var ClinicID; + var PatientOutSA; + var PatientID; + var ProjectID; + var LanguageID; + var DeviceTypeID; + var DeviceType; + var AppointmentNo; + var IPAdress; + var VersionID; + var Channel; + var PatientTypeID; + var PatientType; + var isDentalAllowedBackend; + var IsIrisPrescription; + var TokenID; + var SessionID; + var PatientIdentificationID; + var PatientMobileNumber; + var BookedBy; + var Latitude; + var Longitude; + var OutSA; + var Note; + var IsActiveAppointment; + var RequestType; + var InvoiceNo; + var EncounterType; + var generalid; + var ServiceID; + var StrAppointmentDate; + var SKU; +} \ No newline at end of file diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart new file mode 100644 index 00000000..45bf01b7 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart @@ -0,0 +1,104 @@ +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +// ignore: must_be_immutable +class ConfirmCancelOrderDialog extends StatefulWidget { + final CMCViewModel model; + final Function onTap; + + + ConfirmCancelOrderDialog( + {Key key, this.model, this.onTap}); + + @override + _ConfirmCancelOrderDialogState createState() => _ConfirmCancelOrderDialogState(); +} + +class _ConfirmCancelOrderDialogState extends State { + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), + title: Center( + child: Texts( + "Confirm", + color: Colors.black, + ), + ), + children: [ + Column( + children: [ + Divider(), + Center( + child: Texts( + "Are you sure!! want to cancel this order", + color: Colors.grey, + ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () async{ + widget.onTap(); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} + + + diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart new file mode 100644 index 00000000..532396cc --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart @@ -0,0 +1,346 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/material.dart'; +import 'package:geolocator/geolocator.dart'; + +import 'new_cmc_step_one_page.dart'; +import 'new_cmc_step_three_page.dart'; +import 'new_cmc_step_tow_page.dart'; + +class NewCMCPage extends StatefulWidget { + NewCMCPage({this.model}); + + final CMCViewModel model; + + @override + _NewCMCPageState createState() => + _NewCMCPageState(); +} + +class _NewCMCPageState extends State + with TickerProviderStateMixin { + PageController _controller; + int _currentIndex = 1; + + double _latitude; + double _longitude; + + CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel; + + @override + void initState() { + super.initState(); + PatientERCMCInsertServicesList patientERCMCInsertServicesList; + if (widget.model.cmcAllServicesList.length > 0) { + patientERCMCInsertServicesList = new PatientERCMCInsertServicesList( + price: widget.model.cmcAllServicesList[0].price, + serviceID: widget.model.cmcAllServicesList[0].serviceID.toString(), + selectedServiceName: widget.model.cmcAllServicesList[0].description, + selectedServiceNameAR: widget.model.cmcAllServicesList[0].description, + recordID: 1, + totalPrice: widget.model.cmcAllServicesList[0].totalPrice, + vAT: widget.model.cmcAllServicesList[0].vAT); + cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel( + patientERCMCInsertServicesList: [patientERCMCInsertServicesList]); + } + + cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel( + patientERCMCInsertServicesList: patientERCMCInsertServicesList != null + ? [patientERCMCInsertServicesList] + : []); + + _controller = new PageController(); + + _getCurrentLocation(); + } + + _getCurrentLocation() async { + await getLastKnownPosition().then((value) { + _latitude = value.latitude; + _longitude = value.longitude; + }).catchError((e) { + _longitude = 0; + _latitude = 0; + }); + } + + @override + void dispose() { + super.dispose(); + } + + changePageViewIndex(pageIndex) { + _controller.jumpToPage(pageIndex); + } + + @override + Widget build(BuildContext context) { + void showConfirmMessage( + CMCViewModel model, GetOrderDetailByOrderIDResponseModel order) { + showDialog( + context: context, + child: ConfirmCancelOrderDialog( + model: model, + onTap: () async { + UpdatePresOrderRequestModel updatePresOrderRequestModel = + UpdatePresOrderRequestModel( + presOrderID: order.presOrderID, + rejectionReason: "", + presOrderStatus: 4, editedBy: 3); + await model.updateCmcPresOrder(updatePresOrderRequestModel); + if (model.state == ViewState.ErrorLocal) { + Utils.showErrorToast(model.error); + } else { + AppToast.showSuccessToast(message: "Done Successfully"); + await model.getCmcAllPresOrders(); + } + }, + )); + } + return Scaffold( + body: SafeArea( + child: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 0.8, + child: Column( + children: [ + Container( + margin: EdgeInsets.only(left: MediaQuery.of(context).size.width*0.05, right: MediaQuery.of(context).size.width*0.05), + child: StepsWidget( + index: _currentIndex, + changeCurrentTab: changePageViewIndex, + ), + ), + Expanded( + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + widget.model.cmcAllOrderDetail.length != 0 + ? FractionallySizedBox( + heightFactor: 0.8, + widthFactor: 0.9, + child: Container( + width: double.infinity, + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + border: + Border.all(color: Colors.grey, width: 1), + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Request ID", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + widget.model.cmcAllOrderDetail[0].iD.toString(), + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Status", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + "Pending", + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Pickup Date", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate( + widget.model.cmcAllOrderDetail[0] + .createdOn)), + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Service Name", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + widget.model.cmcAllOrderDetail[0].description + .toString() ?? + widget.model.cmcAllOrderDetail[0] + .descriptionN + .toString(), + fontSize: 22, + ), + ], + ), + ), + SizedBox( + height: 12, + ), + Center( + child: Container( + width: MediaQuery + .of(context) + .size + .width * + 0.85, + child: SecondaryButton( + label: "Cancel".toUpperCase(), + onTap: () { + showConfirmMessage(widget.model, + widget.model.cmcAllOrderDetail[0]); + } + , + color: Colors.red[800], + disabled: false, + textColor: Theme + .of(context) + .backgroundColor), + ), + ), + SizedBox( + height: 12, + ), + ], + ), + ), + ) + : NewCMCStepOnePage( + changePageViewIndex: changePageViewIndex, + cMCInsertPresOrderRequestModel: + cMCInsertPresOrderRequestModel, + model: widget.model, + ), + NewCMCStepTowPage( + longitude: _longitude, + latitude: _latitude, + changePageViewIndex: changePageViewIndex, + cmcInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel, + model: widget.model, + ), NewCMCStepThreePage( + changePageViewIndex: changePageViewIndex, + cmcInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel, + model: widget.model, + ), + ], + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart new file mode 100644 index 00000000..02d099b4 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart @@ -0,0 +1,231 @@ +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class NewCMCStepOnePage extends StatefulWidget { + final CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel; + final Function changePageViewIndex; + final CMCViewModel model; + + const NewCMCStepOnePage( + {Key key, + this.cMCInsertPresOrderRequestModel, + this.model, + this.changePageViewIndex}) + : super(key: key); + + @override + _NewCMCStepOnePageState createState() => _NewCMCStepOnePageState(); +} + +class _NewCMCStepOnePageState extends State { + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: false, + baseViewModel: widget.model, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Center( + child: Column( + children: [ + FractionallySizedBox( + widthFactor: 0.94, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), + Texts( + "Select Home Health Care Services", + textAlign: TextAlign.center, + ), + Column( + children: + widget.model.cmcAllServicesList.map((service) { + return Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + border: + Border.all(color: Colors.grey, width: 1), + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + children: [ + Row( + children: [ + Radio( + value: service.serviceID, + activeColor: Colors.red[800], + onChanged: (newValue) async { + PatientERCMCInsertServicesList + patientERCMCInsertServicesList = + new PatientERCMCInsertServicesList( + price: service.price, + serviceID: service.serviceID + .toString(), + selectedServiceName: + service.description, + selectedServiceNameAR: + service.description, + recordID: 1, + totalPrice: + service.totalPrice, + vAT: service.vAT); + setState(() { + widget + .cMCInsertPresOrderRequestModel + .patientERCMCInsertServicesList = [ + patientERCMCInsertServicesList + ]; + }); + CMCGetItemsRequestModel + cMCGetItemsRequestModel = + new CMCGetItemsRequestModel( + checkupType: newValue); + await widget.model.getCheckupItems( + cMCGetItemsRequestModel: + cMCGetItemsRequestModel); + }, + groupValue: widget + .cMCInsertPresOrderRequestModel + .patientERCMCInsertServicesList + .length > + 0 + ? int.parse(widget + .cMCInsertPresOrderRequestModel + .patientERCMCInsertServicesList[ + 0] + .serviceID) + : 1), + Expanded( + child: Padding( + padding: const EdgeInsets.all(20.0), + child: Texts( + service.description, + fontSize: 15, + ), + ), + ), + ], + ), + ], + ), + ); + }).toList(), + ), + ], + ), + ), + SizedBox( + height: 30, + ), + Container( + color: Colors.white, + width: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: widget.model.checkupItems.map((item) { + return Center( + child: FractionallySizedBox( + widthFactor: 1, + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration(color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 5, top: 5), + decoration: BoxDecoration( + border: BorderDirectional( + bottom: BorderSide( + style: BorderStyle.solid, + width: 0.5, + color: Colors.grey)), + //borderRadius: , + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + item.itemName, + fontSize: 15, + ), + ], + ), + ), + SizedBox( + height: 12, + ), + ], + ), + ), + ), + ); + }).toList()), + ) + ], + ), + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + label: "Next", + textColor: Theme.of(context).backgroundColor, + onTap: () { + if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length = null) { + int index = widget.model.cmcAllServicesList.length; + PatientERCMCInsertServicesList + patientERCMCInsertServicesList = + new PatientERCMCInsertServicesList( + price: widget.model.cmcAllServicesList[index-1].price, + serviceID: widget.model.cmcAllServicesList[index-1].serviceID.toString(), + selectedServiceName: widget.model.cmcAllServicesList[index-1].description, + selectedServiceNameAR: widget.model.cmcAllServicesList[index-1].description, + recordID: 1, + totalPrice: widget.model.cmcAllServicesList[index-1].totalPrice, + vAT: widget.model.cmcAllServicesList[index-1].vAT); + + widget.cMCInsertPresOrderRequestModel + .patientERCMCInsertServicesList = [ + patientERCMCInsertServicesList + ]; + + widget.changePageViewIndex(1); + } + }, + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart new file mode 100644 index 00000000..e48bb5d5 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart @@ -0,0 +1,165 @@ +import 'dart:async'; + +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; + +class NewCMCStepThreePage extends StatefulWidget { + final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel; + final Function changePageViewIndex; + final CMCViewModel model; + + NewCMCStepThreePage( + {Key key, + this.changePageViewIndex, + this.model, + this.cmcInsertPresOrderRequestModel}); + + @override + _NewCMCStepThreePageState createState() => + _NewCMCStepThreePageState(); +} + +class _NewCMCStepThreePageState + extends State { + Completer _controller = Completer(); + + static CameraPosition _kGooglePlex = CameraPosition( + target: LatLng(37.42796133580664, -122.085749655962), + zoom: 14.4746, + ); + final Set markers = new Set(); + + @override + void initState() { + if (widget.cmcInsertPresOrderRequestModel.latitude != null) { + markers.clear(); + markers.add( + Marker( + markerId: MarkerId( + widget.cmcInsertPresOrderRequestModel.latitude.hashCode + .toString(), + ), + position: LatLng( + widget.cmcInsertPresOrderRequestModel.latitude, + widget.cmcInsertPresOrderRequestModel.longitude)), + ); + _kGooglePlex = CameraPosition( + target: LatLng(widget.cmcInsertPresOrderRequestModel.latitude, + widget.cmcInsertPresOrderRequestModel.longitude), + zoom: 14.4746, + ); + } + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowDecPage: false, + baseViewModel: widget.model, + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + height: 400, + width: double.maxFinite, + margin: EdgeInsets.only(left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Order Details'), + SizedBox( + height: 12, + ), + Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), + padding: EdgeInsets.all(8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Location :'), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + height: 200, + child: GoogleMap( + mapType: MapType.normal, + markers: markers, + initialCameraPosition: _kGooglePlex, + onMapCreated: (GoogleMapController controller) { + _controller.complete(controller); + }, + ), + ), + ), + SizedBox( + height: 12, + ), + Texts('Selected Service :'), + ...List.generate( + widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList.length, + (index) => Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Service Name :', + fontSize: 12, + ), + SizedBox( + height: 5, + ), + Texts( + widget + .cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList[index] + .selectedServiceName, + fontSize: 15, + bold: true, + ), + ], + ), + ), + ) + ], + ), + ) + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + label: "Confirm", + onTap: () async { + await widget.model.insertPresPresOrder(order: widget.cmcInsertPresOrderRequestModel); + if (widget.model.state != ViewState.ErrorLocal) { + widget.changePageViewIndex(0); + } + }, + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart new file mode 100644 index 00000000..27cddfe3 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart @@ -0,0 +1,113 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/close_back.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:provider/provider.dart'; + +class NewCMCStepTowPage extends StatefulWidget { + final Function(PickResult) onPick; + final double latitude; + final double longitude; + final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel; + final Function changePageViewIndex; + final CMCViewModel model; + + const NewCMCStepTowPage( + {Key key, + this.onPick, + this.latitude, + this.longitude, + this.cmcInsertPresOrderRequestModel, + this.changePageViewIndex, + this.model}) + : super(key: key); + + @override + _NewCMCStepTowPageState createState() => + _NewCMCStepTowPageState(); +} + +class _NewCMCStepTowPageState + extends State { + double latitude = 0; + double longitude = 0; + + @override + void initState() { + if (widget.cmcInsertPresOrderRequestModel.latitude == null) { + latitude = widget.latitude; + longitude = widget.longitude; + } else { + latitude = widget.cmcInsertPresOrderRequestModel.latitude; + longitude = widget.cmcInsertPresOrderRequestModel.longitude; + } + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( + isShowDecPage: false, + body: PlacePicker( + apiKey: GOOGLE_API_KEY, + enableMyLocationButton: true, + automaticallyImplyAppBarLeading: false, + autocompleteOnTrailingWhitespace: true, + selectInitialPosition: true, + autocompleteLanguage: projectViewModel.currentLanguage, + enableMapTypeButton: true, + onPlacePicked: (PickResult result) { + print(result.adrAddress); + widget.changePageViewIndex(3); + }, + selectedPlaceWidgetBuilder: + (_, selectedPlace, state, isSearchBarFocused) { + print("state: $state, isSearchBarFocused: $isSearchBarFocused"); + return isSearchBarFocused + ? Container() + : FloatingCard( + bottomPosition: 0.0, + leftPosition: 0.0, + rightPosition: 0.0, + width: 500, + borderRadius: BorderRadius.circular(12.0), + child: state == SearchingState.Searching + ? Center(child: CircularProgressIndicator()) + : Container( + margin: EdgeInsets.all(12), + child: SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + setState(() { + widget.cmcInsertPresOrderRequestModel + .latitude = + selectedPlace.geometry.location.lat; + widget.cmcInsertPresOrderRequestModel + .longitude = + selectedPlace.geometry.location.lng; + }); + widget.changePageViewIndex(3); + }, + label: TranslationBase.of(context).next, + ), + ), + ); + }, + initialPosition: LatLng(latitude, longitude), + useCurrentLocation: true, + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart new file mode 100644 index 00000000..e8e9eccc --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart @@ -0,0 +1,68 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'cmc_page.dart'; + +class CMCIndexPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).serviceInformation, + body: SingleChildScrollView( + padding: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + "CMC", + fontWeight: FontWeight.normal, + fontSize: 25, + color: Color(0xff60686b), + ), + SizedBox( + height: 12, + ), + Texts( + "This service is designed to help you to set drinking water goals and track the volume of water you are drinking on a daily basis. This service allows for schedule reminders and offers a basic statistical analysis of the amount of what you have consumed over the course of a day, week or month.", + fontWeight: FontWeight.normal, + fontSize: 17, + ), + SizedBox( + height: 22, + ), + Center( + child: Image.asset( + 'assets/images/AlHabibMedicalService/Wifi-AR.png')), + SizedBox( + height: 77, + ), + ], + )), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + onTap: () => Navigator.push( + context, + FadePage( + page: CMCPage(), + ), + ), + label: "CMC", + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + )); + } +} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart new file mode 100644 index 00000000..385d0da3 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart @@ -0,0 +1,130 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'NewCMC/new_cmc_page.dart'; +import 'orders_log_details_page.dart'; + +class CMCPage extends StatefulWidget { + @override + _CMCPageState createState() => _CMCPageState(); +} + +class _CMCPageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model){ + model.getCmcAllPresOrders(); + }, + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).homeHealthCare, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.7), + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + indicatorColor: Colors.red[800], + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.37, + child: Center( + child: Texts("CMC Service"), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.37, + child: Center( + child: Texts(TranslationBase.of(context).orderLog), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + NewCMCPage( + model: model, + ), + OrdersLogDetailsPage( + model: model, + ) + ], + ), + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart new file mode 100644 index 00000000..6c915a4c --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart @@ -0,0 +1,250 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +import 'Dialog/confirm_cancel_order_dialog.dart'; + +class OrdersLogDetailsPage extends StatelessWidget { + final CMCViewModel model; + + const OrdersLogDetailsPage({Key key, this.model}) : super(key: key); + + @override + Widget build(BuildContext context) { + void showConfirmMessage( + CMCViewModel model, GetHHCAllPresOrdersResponseModel order) { + showDialog( + context: context, + child: ConfirmCancelOrderDialog( + model: model, + onTap: () async { + UpdatePresOrderRequestModel updatePresOrderRequestModel = + UpdatePresOrderRequestModel( + presOrderID: order.iD, + rejectionReason: "", + presOrderStatus: 4, editedBy: 3); + await model.updateCmcPresOrder(updatePresOrderRequestModel); + if(model.state == ViewState.ErrorLocal) { + Utils.showErrorToast(model.error); + } else { + AppToast.showSuccessToast(message: "Done Successfully"); + await model.getCmcAllPresOrders(); + } + }, + )); + } + + return AppScaffold( + isShowAppBar: false, + baseViewModel: model, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.94, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 50, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: model.cmcAllPresOrders.map((order) { + return Container( + width: double.infinity, + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + border: + Border.all(color: Colors.grey, width: 1), + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Request ID", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + order.iD.toString(), + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Status", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + order.description, + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Pickup Date", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate( + order.createdOn)), + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Location", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + order.nearestProjectDescription + .toString() ?? + order.nearestProjectDescriptionN + .toString(), + fontSize: 22, + ), + ], + ), + ), + SizedBox( + height: 12, + ), + if (order.status == 1 ||order.status == 2 ) + Center( + child: Container( + width: MediaQuery + .of(context) + .size + .width * + 0.85, + child: SecondaryButton( + label: "Cancel".toUpperCase(), + onTap: () { + showConfirmMessage(model, order); + } + , + color: Colors.red[800], + disabled: false, + textColor: Theme + .of(context) + .backgroundColor), + ), + ), + SizedBox( + height: 12, + ), + ], + ), + ); + }).toList()) + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart new file mode 100644 index 00000000..fb2b94c6 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart @@ -0,0 +1,76 @@ +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart'; +import 'package:flutter/material.dart'; + +import 'new_e_referral_step_three_page.dart'; +import 'new_e_referral_step_two_page.dart'; + +class StartIndexForNewEReferral extends StatefulWidget { + StartIndexForNewEReferral(); + + @override + _StartIndexForNewEReferralState createState() => + _StartIndexForNewEReferralState(); +} + +class _StartIndexForNewEReferralState extends State + with TickerProviderStateMixin { + PageController _controller; + int _currentIndex = 1; + int pageSelected = 2; + + CreateEReferralRequestModel createEReferralRequestModel = + new CreateEReferralRequestModel(); + + @override + void initState() { + super.initState(); + _controller = new PageController(); + } + + @override + void dispose() { + super.dispose(); + } + + changePageViewIndex(pageIndex) { + _controller.jumpToPage(pageIndex); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: SafeArea( + child: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 0.9, + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + NewEReferralStepOnePage( + changePageViewIndex: changePageViewIndex, + createEReferralRequestModel: createEReferralRequestModel, + ), + NewEReferralStepTowPage( + changePageViewIndex: changePageViewIndex, + createEReferralRequestModel: createEReferralRequestModel, + ), + NewEReferralStepThreePage( + changePageViewIndex: changePageViewIndex, + createEReferralRequestModel: createEReferralRequestModel, + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart new file mode 100644 index 00000000..62799c6d --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart @@ -0,0 +1,308 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/send_activation_code_for_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; +import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + + +class NewEReferralStepOnePage extends StatefulWidget { + final CreateEReferralRequestModel createEReferralRequestModel; + final Function changePageViewIndex; + + const NewEReferralStepOnePage({Key key, this.createEReferralRequestModel, this.changePageViewIndex}) : super(key: key); + + @override + _NewEReferralStepOnePageState createState() => _NewEReferralStepOnePageState(); +} + +class _NewEReferralStepOnePageState extends State { + TextEditingController _nameTextController = TextEditingController(); + TextEditingController _mobileTextController = TextEditingController(); + GetAllRelationshipTypeResponseModel _selectedRelation; + String email; + AuthenticatedUser authenticatedUser; + GetAllSharedRecordsByStatusList selectedPatientFamily; + AdvanceModel advanceModel = AdvanceModel(); + + // todo create a model for Country + // todo use country from the json + dynamic _selectedCountry = { + "name": "Saudi Arabia", + "name_ar": "المملكة العربية السعودية", + "code": "+966", + "countryCode": "SA", + "pattern": "5xxxxxxxx", + "maxLength": 9 + }; + AppSharedPreferences sharedPref = AppSharedPreferences(); + AuthenticatedUser authUser; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + void showSMSDialog() { + showDialog( + context: context, + barrierDismissible: false, + child: EReferralConfirmSMSDialog( + phoneNumber: _selectedCountry['code']+_mobileTextController.text, + onSucces: (){ + Navigator.of(context).pop(); + widget.changePageViewIndex(1); + widget.createEReferralRequestModel.requesterName=_nameTextController.text; + widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString().substring(1)+_mobileTextController.text; + widget.createEReferralRequestModel.requesterRelationship=_selectedRelation.iD; + + + } + + + ), + ).then((value) { + print("dialog dismissed"); + print(value); + if (value != null && value) { + + } + }); + } + return BaseView( + onModelReady: (model) => model.getRelationTypes(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: false, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), + Center( + child: Texts( +// TranslationBase.of(context).advancePaymentLabel, + "Referral requester information", + textAlign: TextAlign.center, + ), + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: "Enter Referral Requester Name*", + controller: _nameTextController, + ), + SizedBox( + height: 12, + ), + InkWell( + onTap: () => confirmSelectCountryTypeDialog(), + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getCountryName()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + MobileNumberTextFiled( + controller: _mobileTextController, + code: _selectedCountry == null + ? "11" + : _selectedCountry["code"], + ), + SizedBox( + height: 12, + ), + Center( + child: Texts( +// TranslationBase.of(context).advancePaymentLabel, + "Requester Relationship", + textAlign: TextAlign.center, + ), + ), + SizedBox( + height: 12, + ), + InkWell( + onTap: () => confirmSelectRelationTypeDialog( + model.relationTypes), + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getRelationName()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + ], + ), + ), + ), + ), + ), + bottomSheet: Container( + height: MediaQuery + .of(context) + .size + .height * 0.1, + width: double.infinity, + padding: EdgeInsets.all(9), + child: SecondaryButton( + textColor: Colors.white, + label: "Next", + onTap: () async { + SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel = + SendActivationCodeForEReferralRequestModel( + zipCode: _selectedCountry['code'], + patientMobileNumber: int.parse( + _mobileTextController.text),); + await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel); + + showSMSDialog(); + }, + loading: model.state == ViewState.BusyLocal, + disabled: + _nameTextController.text.isEmpty || + _selectedRelation == null || + _mobileTextController.text.isEmpty, + ), + ))); + + + } + + void confirmSelectRelationTypeDialog( + List relations) { + showDialog( + context: context, + child: SelectRelationTypeDialog( + relationTypes: relations, + selectedRelation: _selectedRelation, + onValueSelected: (value) { + setState(() { + _selectedRelation = value; + }); + }, + ), + ); + } + + void confirmSelectCountryTypeDialog() { + showDialog( + context: context, + child: SelectCountryDialog( + selectedCountry: _selectedCountry, + onValueSelected: (value) { + setState(() { + _selectedCountry = value; + }); + }, + ), + ); + } + + String getRelationName() { + if (_selectedRelation != null) + return _selectedRelation.text; + else + return "Select Relationship" /*TranslationBase.of(context).selectHospital*/; + } + + String getCountryName() { + if (_selectedCountry != null) + return _selectedCountry["name"]; + else + return "Country"; + } +} + +class MobileNumberTextFiled extends StatelessWidget { + const MobileNumberTextFiled({ + Key key, + this.controller, + this.code + }) : super(key: key); + + + final TextEditingController controller; + final String code; + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.all(5), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), color: Colors.white), + child: Row(children: [ + Expanded( + flex: 1, + child: Icon( + Icons.phone, + color: Colors.red, + )), + Expanded( + flex: 1, + child: Text( + code.toString(), + overflow: TextOverflow.clip, + )), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(5), + child: TextField( + controller: controller, + keyboardType: TextInputType.phone, + decoration: InputDecoration( + border: InputBorder.none, hintText: '5xxxxxxxx'), + ), + ), + ) + ]), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart new file mode 100644 index 00000000..a823c154 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart @@ -0,0 +1,450 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +import '../dialogs/select_city_dialog.dart'; +import 'dart:io'; +class NewEReferralStepThreePage extends StatefulWidget { + final CreateEReferralRequestModel createEReferralRequestModel; + final Function changePageViewIndex; + + const NewEReferralStepThreePage( + {Key key, this.createEReferralRequestModel, this.changePageViewIndex}) + : super(key: key); + + @override + _NewEReferralStepThreePageState createState() => + _NewEReferralStepThreePageState(); +} + +class _NewEReferralStepThreePageState extends State { + TextEditingController _nameTextController = TextEditingController(); + TextEditingController _mobileTextController = TextEditingController(); + GetAllCitiesResponseModel _selectedCity; + + GetAllSharedRecordsByStatusList selectedPatientFamily; + List medicalReportImages = []; + List insuredPatientImages = []; + + bool isPatientInsured = false; + AppSharedPreferences sharedPref = AppSharedPreferences(); + AuthenticatedUser authUser; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, widget) => AppScaffold( + isShowAppBar: false, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.94, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), + Center( + child: Texts( +// TranslationBase.of(context).advancePaymentLabel, + "Other details", + textAlign: TextAlign.center, + ), + ), + SizedBox( + height: 12, + ), + Container( + padding: EdgeInsets.only(top: 10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + ), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 9), + child: Texts( + "Medical Report", + color: Colors.grey, + fontSize: 17, + ), + ), + ], + ), + InkWell( + onTap: () { + ImageOptions.showImageOptions(context, + (String image,File file) { + setState(() { + EReferralAttachment eReferralAttachment = + new EReferralAttachment( + fileName: + 'image ${medicalReportImages.length + 1}.png', + base64String: image); + medicalReportImages + .add(eReferralAttachment); + }); + }, ); + }, + child: Container( + margin: EdgeInsets.only( + left: 10, right: 10, top: 15), + height: 50, + decoration: BoxDecoration( + border: Border.all(color: Colors.grey), + borderRadius: BorderRadius.circular(7), + color: Colors.white, + shape: BoxShape.rectangle, + ), + child: Center( + child: Row( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Icon(Icons.attach_file), + Texts( + 'selected attachment', + variant: 'bodyText', + textAlign: TextAlign.center, + ), + ], + ), + ), + ), + ), + SizedBox( + height: 12, + ), + ...List.generate( + medicalReportImages.length, + (index) => Container( + margin: EdgeInsets.all(10), + padding: EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Icon( + FontAwesomeIcons.paperclip), + SizedBox( + width: 8, + ), + Texts( + medicalReportImages[index] + .fileName, + ), + ], + ), + InkWell( + onTap: () { + setState(() { + medicalReportImages.remove( + medicalReportImages[ + index]); + }); + }, + child: Icon( + FontAwesomeIcons.trashAlt, + color: Colors.red[300], + )) + ], + ), + )), + ], + ), + ), + SizedBox( + height: 12, + ), + Container( + padding: EdgeInsets.only(top: 10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 9), + child: Texts( + "Preferred Branch", + color: Colors.grey, + fontSize: 17, + ), + ), + ], + ), + InkWell( + onTap: () => + confirmSelectCityDialog(model.allCities), + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts(getRelationName()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + ], + ), + ), + SizedBox( + height: 12, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + children: [ + Checkbox( + value: isPatientInsured, + activeColor: Colors.black38, + onChanged: (bool newValue) { + setState(() { + isPatientInsured = newValue; + }); + }), + Padding( + padding: const EdgeInsets.all(20.0), + child: Texts( + "Insured Patient", + fontSize: 17, + ), + ), + ], + ), + ], + ), + ], + ), + ), + if (isPatientInsured) + SizedBox( + height: 12, + ), + Opacity( + opacity: isPatientInsured ? 1 : 0, + child: Container( + padding: EdgeInsets.only(top: 10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + ), + child: Column( + children: [ + InkWell( + onTap: () { + ImageOptions.showImageOptions(context, + (String image,File file) { + setState(() { + EReferralAttachment + eReferralAttachment = + new EReferralAttachment( + fileName: + 'image ${medicalReportImages.length + 1}.png', + base64String: image); + + insuredPatientImages = [ + eReferralAttachment + ]; + }); + }); + }, + child: Container( + margin: EdgeInsets.only( + left: 10, right: 10, top: 15), + height: 50, + decoration: BoxDecoration( + border: Border.all(color: Colors.grey), + borderRadius: BorderRadius.circular(7), + color: Colors.white, + shape: BoxShape.rectangle, + ), + child: Center( + child: Row( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Icon(Icons.attach_file), + Texts( + 'selected attachment', + variant: 'bodyText', + textAlign: TextAlign.center, + ), + ], + ), + ), + ), + ), + SizedBox( + height: 12, + ), + ...List.generate( + insuredPatientImages.length, + (index) => Container( + margin: EdgeInsets.all(10), + padding: EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Icon(FontAwesomeIcons + .paperclip), + SizedBox( + width: 8, + ), + Texts( + 'image ${index + 1}.png', + ), + ], + ), + InkWell( + onTap: () { + setState(() { + insuredPatientImages.remove( + insuredPatientImages[ + index]); + }); + }, + child: Icon( + FontAwesomeIcons.trashAlt, + color: Colors.red[300], + )) + ], + ), + )), + ], + ), + ), + ), + SizedBox( + height: 12, + ), + ], + ), + ), + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + padding: EdgeInsets.all(9), + child: SecondaryButton( + textColor: Colors.white, + label: "Submit", + onTap: () async { + this + .widget + .createEReferralRequestModel + .medicalReportAttachment = medicalReportImages; + this + .widget + .createEReferralRequestModel + .insuranceCardAttachment = + insuredPatientImages.length != 0 + ? insuredPatientImages[0] + : null; + this.widget.createEReferralRequestModel.isInsuredPatient = + isPatientInsured; + // ToDo make the preferred Branch info dynamic + this.widget.createEReferralRequestModel.preferredBranchCode = + 15; + this.widget.createEReferralRequestModel.preferredBranchName = + "Arryan Hospital"; + + // this.widget.createEReferralRequestModel.fullName= ""; + this.widget.createEReferralRequestModel.otherRelationship = + ""; + // this.widget.createEReferralRequestModel.; + // this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital"; + // this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital"; + + await model + .createEReferral(this.widget.createEReferralRequestModel); + }, + loading: model.state == ViewState.BusyLocal, + disabled: medicalReportImages.length == 0, + ), + ))); + } + + void confirmSelectCityDialog(List cities) { + showDialog( + context: context, + child: SelectCityDialog( + cities: cities, + selectedCity: _selectedCity, + onValueSelected: (value) { + setState(() { + _selectedCity = value; + }); + }, + ), + ); + } + + String getRelationName() { + if (_selectedCity != null) + return _selectedCity.description; + else + return "Select Relationship" /*TranslationBase.of(context).selectHospital*/; + } +} diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart new file mode 100644 index 00000000..5f85fe12 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart @@ -0,0 +1,294 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +import '../dialogs/select_city_dialog.dart'; + + +class NewEReferralStepTowPage extends StatefulWidget { + final CreateEReferralRequestModel createEReferralRequestModel; + final Function changePageViewIndex; + + const NewEReferralStepTowPage({Key key, this.createEReferralRequestModel, this.changePageViewIndex}) : super(key: key); + + @override + _NewEReferralStepTowPageState createState() => _NewEReferralStepTowPageState(); +} + +class _NewEReferralStepTowPageState extends State { + TextEditingController _patientNameTextController = TextEditingController(); + TextEditingController _patientIdentificationTextController = TextEditingController(); + TextEditingController _mobileTextController = TextEditingController(); + GetAllCitiesResponseModel _selectedCity ; + GetAllSharedRecordsByStatusList selectedPatientFamily; + + // todo create a model for Country + // todo use country from the json + dynamic _selectedCountry = { + "name": "Saudi Arabia", + "name_ar": "المملكة العربية السعودية", + "code": "+966", + "countryCode": "SA", + "pattern": "5xxxxxxxx", + "maxLength": 9 + }; + AppSharedPreferences sharedPref = AppSharedPreferences(); + AuthenticatedUser authUser; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getAllCities(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: false, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.94, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 30, + ), + Center( + child: Texts( +// TranslationBase.of(context).advancePaymentLabel, + "Patient information", + textAlign: TextAlign.center, + ), + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: "Enter Identification Number", + controller: _patientIdentificationTextController, + keyboardType:TextInputType.number , + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: "Enter Patient Name", + controller: _patientNameTextController, + ), + SizedBox( + height: 12, + ), + InkWell( + onTap: () => confirmSelectCountryTypeDialog(), + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getCountryName()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + MobileNumberTextFiled( + controller: _mobileTextController, + code: _selectedCountry == null + ? "11" + : _selectedCountry["code"], + ), + SizedBox( + height: 12, + ), + Center( + child: Texts( +// TranslationBase.of(context).advancePaymentLabel, + "Where the patient located", + textAlign: TextAlign.center, + ), + ), + SizedBox( + height: 12, + ), + InkWell( + onTap: () => confirmSelectCityDialog( + model.allCities), + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getRelationName()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + + SizedBox( + height: 12, + ), + ], + ), + ), + ), + ), + ), + bottomSheet: Container( + height: MediaQuery + .of(context) + .size + .height * 0.1, + width: double.infinity, + padding: EdgeInsets.all(9), + child: SecondaryButton( + textColor: Colors.white, + label: "Next", + onTap: () async { + this.widget.changePageViewIndex(2); + this.widget.createEReferralRequestModel.identificationNo = int.parse( _patientIdentificationTextController.text); + this.widget.createEReferralRequestModel.fullName = _patientNameTextController.text; + this.widget.createEReferralRequestModel.patientMobileNumber = _selectedCountry['code'].toString().substring(1)+_mobileTextController.text; + this.widget.createEReferralRequestModel.cityCode = _selectedCity.iD.toString(); + this.widget.createEReferralRequestModel.cityName = _selectedCity.description; + + + }, + loading: model.state == ViewState.BusyLocal, + disabled: + _patientNameTextController.text.isEmpty || _patientIdentificationTextController.text.isEmpty|| + _selectedCity == null || + _mobileTextController.text.isEmpty, + ), + ))); + + + } + + void confirmSelectCityDialog( + List cities) { + showDialog( + context: context, + child: SelectCityDialog( + cities: cities, + selectedCity: _selectedCity, + onValueSelected: (value) { + setState(() { + _selectedCity = value; + }); + }, + ), + ); + } + + void confirmSelectCountryTypeDialog() { + showDialog( + context: context, + child: SelectCountryDialog( + selectedCountry: _selectedCountry, + onValueSelected: (value) { + setState(() { + _selectedCountry = value; + }); + }, + ), + ); + } + + String getRelationName() { + if (_selectedCity != null) + return _selectedCity.description; + else + return "Select City" /*TranslationBase.of(context).selectHospital*/; + } + + String getCountryName() { + if (_selectedCountry != null) + return _selectedCountry["name"]; + else + return "Country"; + } +} + +class MobileNumberTextFiled extends StatelessWidget { + const MobileNumberTextFiled({ + Key key, + this.controller, + this.code + }) : super(key: key); + + + final TextEditingController controller; + final String code; + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.all(5), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), color: Colors.white), + child: Row(children: [ + Expanded( + flex: 1, + child: Icon( + Icons.phone, + color: Colors.red, + )), + Expanded( + flex: 1, + child: Text( + code.toString(), + overflow: TextOverflow.clip, + )), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(5), + child: TextField( + controller: controller, + keyboardType: TextInputType.phone, + decoration: InputDecoration( + border: InputBorder.none, hintText: 'Mobile No'), + ), + ), + ) + ]), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_city_dialog.dart b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_city_dialog.dart new file mode 100644 index 00000000..2fb7e41a --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_city_dialog.dart @@ -0,0 +1,129 @@ +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +// ignore: must_be_immutable +class SelectCityDialog extends StatefulWidget { + final List cities; + final Function(GetAllCitiesResponseModel) onValueSelected; + GetAllCitiesResponseModel selectedCity; + + SelectCityDialog( + {Key key, this.cities, this.onValueSelected, this.selectedCity}); + + @override + _SelectCityDialogState createState() => _SelectCityDialogState(); +} + +class _SelectCityDialogState extends State { + @override + void initState() { + super.initState(); + widget.selectedCity = widget.selectedCity ?? widget.cities[0]; + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + children: [ + Divider(), + ...List.generate( + widget.cities.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedCity = widget.cities[index]; + }); + }, + child: ListTile( + title: Text(widget.cities[index].description), + leading: Radio( + value: widget.cities[index], + groupValue: widget.selectedCity, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedCity = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedCity); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart new file mode 100644 index 00000000..f714bfb9 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart @@ -0,0 +1,1584 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +// ignore: must_be_immutable +class SelectCountryDialog extends StatefulWidget { + final Function(dynamic) onValueSelected; + dynamic selectedCountry; + + SelectCountryDialog( + {Key key, /*this.relationTypes,*/ this.onValueSelected, this.selectedCountry}); + + @override + _SelectCountryDialogState createState() => _SelectCountryDialogState(); +} + +class _SelectCountryDialogState extends State { + + // todo create a model for Country + List countryList = + [ + { + "name": "Saudi Arabia", + "name_ar":"المملكة العربية السعودية", + "code": "+966", + "countryCode": "SA", + "pattern": "5xxxxxxxx", + "maxLength": 9 + }, + { + "name": "United Arab Emirates", + "name_ar":"الإمارات العربية المتحدة", + "code": "+971", + "countryCode": "AE", + "pattern": "5xxxxxxxx", + "maxLength": 9 + }, + { + "name": "Bahrain", + "name_ar":"البحرين", + "code": "+973", + "countryCode": "BH", + "maxLength": 8 + }, + { + "name": "Kuwait", + "name_ar":"الكويت", + "code": "+965", + "countryCode": "KW" + }, + { + "name": "Afghanistan", + "name_ar":"أفغانستان", + "code": "+93", + "countryCode": "AF" + }, + { + "name": "Aland Islands", + "name_ar":"جزر آلاند", + "code": "+358", + "countryCode": "AX" + }, + { + "name": "Albania", + "name_ar":"ألبانيا", + "code": "+355", + "countryCode": "AL" + }, + { + "name": "Algeria", + "name_ar":"الجزائر", + "code": "+213", + "countryCode": "DZ" + }, + { + "name": "AmericanSamoa", + "name_ar":"ساموا الأمريكية", + "code": "+1 684", + "countryCode": "AS" + }, + { + "name": "Andorra", + "name_ar":"أندورا", + "code": "+376", + "countryCode": "AD" + }, + { + "name": "Angola", + "name_ar":"أنغولا", + "code": "+244", + "countryCode": "AO" + }, + { + "name": "Anguilla", + "name_ar":"أنغيلا", + "code": "+1 264", + "countryCode": "AI" + }, + { + "name": "Antarctica", + "name_ar":"القارة القطبية الجنوبية", + "code": "+672", + "countryCode": "AQ" + }, + { + "name": "Antigua and Barbuda", + "name_ar":"أنتيغوا وبربودا", + "code": "+1268", + "countryCode": "AG" + }, + { + "name": "Argentina", + "name_ar":"الأرجنتين", + "code": "+54", + "countryCode": "AR" + }, + { + "name": "Armenia", + "name_ar":"أرمينيا", + "code": "+374", + "countryCode": "AM" + }, + { + "name": "Aruba", + "name_ar":"أروبا", + "code": "+297", + "countryCode": "AW" + }, + { + "name": "Australia", + "name_ar":"أستراليا", + "code": "+61", + "countryCode": "AU" + }, + { + "name": "Austria", + "name_ar":"النمسا", + "code": "+43", + "countryCode": "AT" + }, + { + "name": "Azerbaijan", + "name_ar":"أذربيجان", + "code": "+994", + "countryCode": "AZ" + }, + { + "name": "Bahamas", + "name_ar":"الباهاما", + "code": "+1 242", + "countryCode": "BS" + }, + { + "name": "Bangladesh", + "name_ar":"بنغلاديش", + "code": "+880", + "countryCode": "BD" + }, + { + "name": "Barbados", + "name_ar":"بربادوس", + "code": "+1 246", + "countryCode": "BB" + }, + { + "name": "Belarus", + "name_ar":"روسيا البيضاء", + "code": "+375", + "countryCode": "BY" + }, + { + "name": "Belgium", + "name_ar":"بلجيكا", + "code": "+32", + "countryCode": "BE" + }, + { + "name": "Belize", + "name_ar":"بليز", + "code": "+501", + "countryCode": "BZ" + }, + { + "name": "Benin", + "name_ar":"بنين", + "code": "+229", + "countryCode": "BJ" + }, + { + "name": "Bermuda", + "name_ar":"برمودا", + "code": "+1 441", + "countryCode": "BM" + }, + { + "name": "Bhutan", + "name_ar":"بوتان", + "code": "+975", + "countryCode": "BT" + }, + { + "name": "Bolivia, Plurinational State of", + "name_ar":"دولة بوليفيا المتعددة القوميات", + "code": "+591", + "countryCode": "BO" + }, + { + "name": "Bosnia and Herzegovina", + "name_ar":"البوسنة والهرسك", + "code": "+387", + "countryCode": "BA" + }, + { + "name": "Botswana", + "name_ar":"بوتسوانا", + "code": "+267", + "countryCode": "BW" + }, + { + "name": "Brazil", + "name_ar":"البرازيل", + "code": "+55", + "countryCode": "BR" + }, + { + "name": "British Indian Ocean Territory", + "name_ar":"إقليم المحيط البريطاني الهندي", + "code": "+246", + "countryCode": "IO" + }, + { + "name": "Brunei Darussalam", + "name_ar":"بروناي دار السلام", + "code": "+673", + "countryCode": "BN" + }, + { + "name": "Bulgaria", + "name_ar":"بلغاريا", + "code": "+359", + "countryCode": "BG" + }, + { + "name": "Burkina Faso", + "name_ar":"بوركينا فاسو", + "code": "+226", + "countryCode": "BF" + }, + { + "name": "Burundi", + "name_ar":"بوروندي", + "code": "+257", + "countryCode": "BI" + }, + { + "name": "Cambodia", + "name_ar":"كمبوديا", + "code": "+855", + "countryCode": "KH" + }, + { + "name": "Cameroon", + "name_ar":"الكاميرون", + "code": "+237", + "countryCode": "CM" + }, + { + "name": "Canada", + "name_ar":"كندا", + "code": "+1", + "countryCode": "CA" + }, + { + "name": "Cape Verde", + "name_ar":"الرأس الأخضر", + "code": "+238", + "countryCode": "CV" + }, + { + "name": "Cayman Islands", + "name_ar":"جزر كايمان", + "code": "+345", + "countryCode": "KY" + }, + { + "name": "Central African Republic", + "name_ar":"جمهورية افريقيا الوسطى", + "code": "+236", + "countryCode": "CF" + }, + { + "name": "Chad", + "name_ar":"تشاد", + "code": "+235", + "countryCode": "TD" + }, + { + "name": "Chile", + "name_ar":"تشيلي", + "code": "+56", + "countryCode": "CL" + }, + { + "name": "China", + "name_ar":"الصين", + "code": "+86", + "countryCode": "CN" + }, + { + "name": "Christmas Island", + "name_ar":"جزيرة الكريسماس", + "code": "+61", + "countryCode": "CX" + }, + { + "name": "Cocos (Keeling) Islands", + "name_ar":"جزر كوكوس كيلينغ", + "code": "+61", + "countryCode": "CC" + }, + { + "name": "Colombia", + "name_ar":"كولومبيا", + "code": "+57", + "countryCode": "CO" + }, + { + "name": "Comoros", + "name_ar":"جزر القمر", + "code": "+269", + "countryCode": "KM" + }, + { + "name": "Congo", + "name_ar":"الكونغو", + "code": "+242", + "countryCode": "CG" + }, + { + "name": "Congo, The Democratic Republic of the Congo", + "name_ar":"الكونغو ، جمهورية الكونغو الديمقراطية", + "code": "+243", + "countryCode": "CD" + }, + { + "name": "Cook Islands", + "name_ar":"جزر كوك", + "code": "+682", + "countryCode": "CK" + }, + { + "name": "Costa Rica", + "name_ar":"كوستا ريكا", + "code": "+506", + "countryCode": "CR" + }, + { + "name": "Cote d'Ivoire", + "name_ar":"ساحل العاج", + "code": "+225", + "countryCode": "CI" + }, + { + "name": "Croatia", + "name_ar":"كرواتيا", + "code": "+385", + "countryCode": "HR" + }, + { + "name": "Cuba", + "name_ar":"كوبا", + "code": "+53", + "countryCode": "CU" + }, + { + "name": "Cyprus", + "name_ar":"قبرص", + "code": "+357", + "countryCode": "CY" + }, + { + "name": "Czech Republic", + "name_ar":"جمهورية التشيك", + "code": "+420", + "countryCode": "CZ" + }, + { + "name": "Denmark", + "name_ar":"الدنمارك", + "code": "+45", + "countryCode": "DK" + }, + { + "name": "Djibouti", + "name_ar":"جيبوتي", + "code": "+253", + "countryCode": "DJ" + }, + { + "name": "Dominica", + "name_ar":"دومينيكا", + "code": "+1 767", + "countryCode": "DM" + }, + { + "name": "Dominican Republic", + "name_ar":"جمهورية الدومنيكان", + "code": "+1 849", + "countryCode": "DO" + }, + { + "name": "Ecuador", + "name_ar":"الإكوادور", + "code": "+593", + "countryCode": "EC" + }, + { + "name": "Egypt", + "name_ar":"مصر", + "code": "+20", + "countryCode": "EG" + }, + { + "name": "El Salvador", + "name_ar":"السلفادور", + "code": "+503", + "countryCode": "SV" + }, + { + "name": "Equatorial Guinea", + "name_ar":"غينيا الإستوائية", + "code": "+240", + "countryCode": "GQ" + }, + { + "name": "Eritrea", + "name_ar":"إريتريا", + "code": "+291", + "countryCode": "ER" + }, + { + "name": "Estonia", + "name_ar":"استونيا", + "code": "+372", + "countryCode": "EE" + }, + { + "name": "Ethiopia", + "name_ar":"أثيوبيا", + "code": "+251", + "countryCode": "ET" + }, + { + "name": "Falkland Islands (Malvinas)", + "name_ar":"جزر فوكلاند مالفيناس", + "code": "+500", + "countryCode": "FK" + }, + { + "name": "Faroe Islands", + "name_ar":"جزر صناعية", + "code": "+298", + "countryCode": "FO" + }, + { + "name": "Fiji", + "name_ar":"فيجي", + "code": "+679", + "countryCode": "FJ" + }, + { + "name": "Finland", + "name_ar":"فنلندا", + "code": "+358", + "countryCode": "FI" + }, + { + "name": "France", + "name_ar":"فرنسا", + "code": "+33", + "countryCode": "FR" + }, + { + "name": "French Guiana", + "name_ar":"غيانا الفرنسية", + "code": "+594", + "countryCode": "GF" + }, + { + "name": "French Polynesia", + "name_ar":"بولينيزيا الفرنسية", + "code": "+689", + "countryCode": "PF" + }, + { + "name": "Gabon", + "name_ar":"الغابون", + "code": "+241", + "countryCode": "GA" + }, + { + "name": "Gambia", + "name_ar":"غامبيا", + "code": "+220", + "countryCode": "GM" + }, + { + "name": "Georgia", + "name_ar":"جورجيا", + "code": "+995", + "countryCode": "GE" + }, + { + "name": "Germany", + "name_ar":"ألمانيا", + "code": "+49", + "countryCode": "DE" + }, + { + "name": "Ghana", + "name_ar":"غانا", + "code": "+233", + "countryCode": "GH" + }, + { + "name": "Gibraltar", + "name_ar":"جبل طارق", + "code": "+350", + "countryCode": "GI" + }, + { + "name": "Greece", + "name_ar":"اليونان", + "code": "+30", + "countryCode": "GR" + }, + { + "name": "Greenland", + "name_ar":"الأرض الخضراء", + "code": "+299", + "countryCode": "GL" + }, + { + "name": "Grenada", + "name_ar":"غرينادا", + "code": "+1 473", + "countryCode": "GD" + }, + { + "name": "Guadeloupe", + "name_ar":"جوادلوب", + "code": "+590", + "countryCode": "GP" + }, + { + "name": "Guam", + "name_ar":"غوام", + "code": "+1 671", + "countryCode": "GU" + }, + { + "name": "Guatemala", + "name_ar":"غواتيمالا", + "code": "+502", + "countryCode": "GT" + }, + { + "name": "Guernsey", + "name_ar":"غيرنسي", + "code": "+44", + "countryCode": "GG" + }, + { + "name": "Guinea", + "name_ar":"غينيا", + "code": "+224", + "countryCode": "GN" + }, + { + "name": "Guinea-Bissau", + "name_ar":"غينيا بيساو", + "code": "+245", + "countryCode": "GW" + }, + { + "name": "Guyana", + "name_ar":"غيانا", + "code": "+595", + "countryCode": "GY" + }, + { + "name": "Haiti", + "name_ar":"هايتي", + "code": "+509", + "countryCode": "HT" + }, + { + "name": "Holy See (Vatican City State)", + "name_ar":"الكرسي الرسولي دولة الفاتيكان", + "code": "+379", + "countryCode": "VA" + }, + { + "name": "Honduras", + "name_ar":"هندوراس", + "code": "+504", + "countryCode": "HN" + }, + { + "name": "Hong Kong", + "name_ar":"هونج كونج", + "code": "+852", + "countryCode": "HK" + }, + { + "name": "Hungary", + "name_ar":"اليونان", + "code": "+36", + "countryCode": "HU" + }, + { + "name": "Iceland", + "name_ar":"أيسلندا", + "code": "+354", + "countryCode": "IS" + }, + { + "name": "India", + "name_ar":"الهند", + "code": "+91", + "countryCode": "IN" + }, + { + "name": "Indonesia", + "name_ar":"أندونيسيا", + "code": "+62", + "countryCode": "ID" + }, + { + "name": "Iran, Islamic Republic of Persian Gulf", + "name_ar":"جمهورية إيران الإسلامية الخليج الفارسي", + "code": "+98", + "countryCode": "IR" + }, + { + "name": "Iraq", + "name_ar":"العراق", + "code": "+964", + "countryCode": "IQ" + }, + { + "name": "Ireland", + "name_ar":"أيرلندا", + "code": "+353", + "countryCode": "IE" + }, + { + "name": "Isle of Man", + "name_ar":"جزيرة آيل أوف مان", + "code": "+44", + "countryCode": "IM" + }, + { + "name": "Israel", + "name_ar":"إسرائيل", + "code": "+972", + "countryCode": "IL" + }, + { + "name": "Italy", + "name_ar":"إيطاليا", + "code": "+39", + "countryCode": "IT" + }, + { + "name": "Jamaica", + "name_ar":"جامايكا", + "code": "+1 876", + "countryCode": "JM" + }, + { + "name": "Japan", + "name_ar":"اليابان", + "code": "+81", + "countryCode": "JP" + }, + { + "name": "Jersey", + "name_ar":"جيرسي", + "code": "+44", + "countryCode": "JE" + }, + { + "name": "Jordan", + "name_ar":"الأردن", + "code": "+962", + "countryCode": "JO" + }, + { + "name": "Kazakhstan", + "name_ar":"كازاخستان", + "code": "+77", + "countryCode": "KZ" + }, + { + "name": "Kenya", + "name_ar":"كينيا", + "code": "+254", + "countryCode": "KE" + }, + { + "name": "Kiribati", + "name_ar":"كيريباس", + "code": "+686", + "countryCode": "KI" + }, + { + "name": "Korea, Democratic People's Republic of Korea", + "name_ar":"جمهورية كوريا الديمقراطية الشعبية", + "code": "+850", + "countryCode": "KP" + }, + { + "name": "Korea, Republic of South Korea", + "name_ar":"جمهورية كوريا الديمقراطية الشعبية", + "code": "+82", + "countryCode": "KR" + }, + { + "name": "Kyrgyzstan", + "name_ar":"قرغيزستان", + "code": "+996", + "countryCode": "KG" + }, + { + "name": "Laos", + "name_ar":"لاوس", + "code": "+856", + "countryCode": "LA" + }, + { + "name": "Latvia", + "name_ar":"لاتفيا", + "code": "+371", + "countryCode": "LV" + }, + { + "name": "Lebanon", + "name_ar":"لبنان", + "code": "+961", + "countryCode": "LB" + }, + { + "name": "Lesotho", + "name_ar":"ليسوتو", + "code": "+266", + "countryCode": "LS" + }, + { + "name": "Liberia", + "name_ar":"ليبيريا", + "code": "+231", + "countryCode": "LR" + }, + { + "name": "Libyan Arab Jamahiriya", + "name_ar":"الجماهيرية العربية الليبية", + "code": "+218", + "countryCode": "LY" + }, + { + "name": "Liechtenstein", + "name_ar":"ليختنشتاين", + "code": "+423", + "countryCode": "LI" + }, + { + "name": "Lithuania", + "name_ar":"ليتوانيا", + "code": "+370", + "countryCode": "LT" + }, + { + "name": "Luxembourg", + "name_ar":"لوكسمبورغ", + "code": "+352", + "countryCode": "LU" + }, + { + "name": "Macao", + "name_ar":"ماكاو", + "code": "+853", + "countryCode": "MO" + }, + { + "name": "Macedonia", + "name_ar":"مقدونيا", + "code": "+389", + "countryCode": "MK" + }, + { + "name": "Madagascar", + "name_ar":"مدغشقر", + "code": "+261", + "countryCode": "MG" + }, + { + "name": "Malawi", + "name_ar":"مالاوي", + "code": "+265", + "countryCode": "MW" + }, + { + "name": "Malaysia", + "name_ar":"ماليزيا", + "code": "+60", + "countryCode": "MY" + }, + { + "name": "Maldives", + "name_ar":"جزر المالديف", + "code": "+960", + "countryCode": "MV" + }, + { + "name": "Mali", + "name_ar":"مالي", + "code": "+223", + "countryCode": "ML" + }, + { + "name": "Malta", + "name_ar":"مالطا", + "code": "+356", + "countryCode": "MT" + }, + { + "name": "Marshall Islands", + "name_ar":"جزر مارشال", + "code": "+692", + "countryCode": "MH" + }, + { + "name": "Martinique", + "name_ar":"مارتينيك", + "code": "+596", + "countryCode": "MQ" + }, + { + "name": "Mauritania", + "name_ar":"موريتانيا", + "code": "+222", + "countryCode": "MR" + }, + { + "name": "Mauritius", + "name_ar":"موريشيوس", + "code": "+230", + "countryCode": "MU" + }, + { + "name": "Mayotte", + "name_ar":"مايوت", + "code": "+262", + "countryCode": "YT" + }, + { + "name": "Mexico", + "name_ar":"المكسيك", + "code": "+52", + "countryCode": "MX" + }, + { + "name": "Micronesia, Federated States of Micronesia", + "name_ar":"ميكرونيزيا ، ولايات ميكرونيزيا الموحدة", + "code": "+691", + "countryCode": "FM" + }, + { + "name": "Moldova", + "name_ar":"مولدوفا", + "code": "+373", + "countryCode": "MD" + }, + { + "name": "Monaco", + "name_ar":"موناكو", + "code": "+377", + "countryCode": "MC" + }, + { + "name": "Mongolia", + "name_ar":"منغوليا", + "code": "+976", + "countryCode": "MN" + }, + { + "name": "Montenegro", + "name_ar":"الجبل الأسود", + "code": "+382", + "countryCode": "ME" + }, + { + "name": "Montserrat", + "name_ar":"مونتسيرات", + "code": "+1664", + "countryCode": "MS" + }, + { + "name": "Morocco", + "name_ar":"المغرب", + "code": "+212", + "countryCode": "MA" + }, + { + "name": "Mozambique", + "name_ar":"موزمبيق", + "code": "+258", + "countryCode": "MZ" + }, + { + "name": "Myanmar", + "name_ar":"ميانمار", + "code": "+95", + "countryCode": "MM" + }, + { + "name": "Namibia", + "name_ar":"ناميبيا", + "code": "+264", + "countryCode": "NA" + }, + { + "name": "Nauru", + "name_ar":"ناورو", + "code": "+674", + "countryCode": "NR" + }, + { + "name": "Nepal", + "name_ar":"نيبال", + "code": "+977", + "countryCode": "NP" + }, + { + "name": "Netherlands", + "name_ar":"هولندا", + "code": "+31", + "countryCode": "NL" + }, + { + "name": "Netherlands Antilles", + "name_ar":"جزر الأنتيل الهولندية", + "code": "+599", + "countryCode": "AN" + }, + { + "name": "New Caledonia", + "name_ar":"كاليدونيا الجديدة", + "code": "+687", + "countryCode": "NC" + }, + { + "name": "New Zealand", + "name_ar":"نيوزيلندا", + "code": "+64", + "countryCode": "NZ" + }, + { + "name": "Nicaragua", + "name_ar":"نيكاراغوا", + "code": "+505", + "countryCode": "NI" + }, + { + "name": "Niger", + "name_ar":"النيجر", + "code": "+227", + "countryCode": "NE" + }, + { + "name": "Nigeria", + "name_ar":"نيجيريا", + "code": "+234", + "countryCode": "NG" + }, + { + "name": "Niue", + "name_ar":"نيوي", + "code": "+683", + "countryCode": "NU" + }, + { + "name": "Norfolk Island", + "name_ar":"جزيرة نورفولك", + "code": "+672", + "countryCode": "NF" + }, + { + "name": "Northern Mariana Islands", + "name_ar":"جزر مريانا الشمالية", + "code": "+1 670", + "countryCode": "MP" + }, + { + "name": "Norway", + "name_ar":"النرويج", + "code": "+47", + "countryCode": "NO" + }, + { + "name": "Oman", + "name_ar":"سلطنة عمان", + "code": "+968", + "countryCode": "OM" + }, + { + "name": "Pakistan", + "name_ar":"باكستان", + "code": "+92", + "countryCode": "PK" + }, + { + "name": "Palau", + "name_ar":"بالاو", + "code": "+680", + "countryCode": "PW" + }, + { + "name": "Palestinian Territory, Occupied", + "name_ar":"الأراضي الفلسطينية المحتلة", + "code": "+970", + "countryCode": "PS" + }, + { + "name": "Panama", + "name_ar":"بناما", + "code": "+507", + "countryCode": "PA" + }, + { + "name": "Papua New Guinea", + "name_ar":"بابوا غينيا الجديدة", + "code": "+675", + "countryCode": "PG" + }, + { + "name": "Paraguay", + "name_ar":"باراغواي", + "code": "+595", + "countryCode": "PY" + }, + { + "name": "Peru", + "name_ar":"بيرو", + "code": "+51", + "countryCode": "PE" + }, + { + "name": "Philippines", + "name_ar":"الفلبين", + "code": "+63", + "countryCode": "PH" + }, + { + "name": "Pitcairn", + "name_ar":"بيتكيرن", + "code": "+872", + "countryCode": "PN" + }, + { + "name": "Poland", + "name_ar":"بولندا", + "code": "+48", + "countryCode": "PL" + }, + { + "name": "Portugal", + "name_ar":"البرتغال", + "code": "+351", + "countryCode": "PT" + }, + { + "name": "Puerto Rico", + "name_ar":"بورتوريكو", + "code": "+1 939", + "countryCode": "PR" + }, + { + "name": "Qatar", + "name_ar":"دولة قطر", + "code": "+974", + "countryCode": "QA" + }, + { + "name": "Romania", + "name_ar":"رومانيا", + "code": "+40", + "countryCode": "RO" + }, + { + "name": "Russia", + "name_ar":"روسيا", + "code": "+7", + "countryCode": "RU" + }, + { + "name": "Rwanda", + "name_ar":"رواندا", + "code": "+250", + "countryCode": "RW" + }, + { + "name": "Reunion", + "name_ar":"جمع شمل", + "code": "+262", + "countryCode": "RE" + }, + { + "name": "Saint Barthelemy", + "name_ar":"سانت بارتيليمي", + "code": "+590", + "countryCode": "BL" + }, + { + "name": "Saint Helena, Ascension and Tristan Da Cunha", + "name_ar":"سانت هيلانة ، أسنشن وتريستان دا كونها", + "code": "+290", + "countryCode": "SH" + }, + { + "name": "Saint Kitts and Nevis", + "name_ar":"سانت كيتس ونيفيس", + "code": "+1 869", + "countryCode": "KN" + }, + { + "name": "Saint Lucia", + "name_ar":"القديسة لوسيا", + "code": "+1 758", + "countryCode": "LC" + }, + { + "name": "Saint Martin", + "name_ar":"القديس مارتن", + "code": "+590", + "countryCode": "MF" + }, + { + "name": "Saint Pierre and Miquelon", + "name_ar":"سانت بيير وميكلون", + "code": "+508", + "countryCode": "PM" + }, + { + "name": "Saint Vincent and the Grenadines", + "name_ar":"سانت فنسنت وجزر غرينادين", + "code": "+1 784", + "countryCode": "VC" + }, + { + "name": "Samoa", + "name_ar":"ساموا", + "code": "+685", + "countryCode": "WS" + }, + { + "name": "San Marino", + "name_ar":"سان مارينو", + "code": "+378", + "countryCode": "SM" + }, + { + "name": "Sao Tome and Principe", + "name_ar":"ساو تومي وبرينسيبي", + "code": "+239", + "countryCode": "ST" + }, + { + "name": "Senegal", + "name_ar":"السنغال", + "code": "+221", + "countryCode": "SN" + }, + { + "name": "Serbia", + "name_ar":"صربيا", + "code": "+381", + "countryCode": "RS" + }, + { + "name": "Seychelles", + "name_ar":"سيشيل", + "code": "+248", + "countryCode": "SC" + }, + { + "name": "Sierra Leone", + "name_ar":"سيرا ليون", + "code": "+232", + "countryCode": "SL" + }, + { + "name": "Singapore", + "name_ar":"سنغافورة", + "code": "+65", + "countryCode": "SG" + }, + { + "name": "Slovakia", + "name_ar":"سلوفاكيا", + "code": "+421", + "countryCode": "SK" + }, + { + "name": "Slovenia", + "name_ar":"سلوفينيا", + "code": "+386", + "countryCode": "SI" + }, + { + "name": "Solomon Islands", + "name_ar":"جزر سليمان", + "code": "+677", + "countryCode": "SB" + }, + { + "name": "Somalia", + "name_ar":"الصومال", + "code": "+252", + "countryCode": "SO" + }, + { + "name": "South Africa", + "name_ar":"جنوب أفريقيا", + "code": "+27", + "countryCode": "ZA" + }, + { + "name": "South Georgia and the South Sandwich Islands", + "name_ar":"جورجيا الجنوبية وجزر ساندويتش الجنوبية", + "code": "+500", + "countryCode": "GS" + }, + { + "name": "Spain", + "name_ar":"إسبانيا", + "code": "+34", + "countryCode": "ES" + }, + { + "name": "Sri Lanka", + "name_ar":"سيريلانكا", + "code": "+94", + "countryCode": "LK" + }, + { + "name": "Sudan", + "name_ar":"سودان", + "code": "+249", + "countryCode": "SD" + }, + { + "name": "Suriname", + "name_ar":"سورينام", + "code": "+597", + "countryCode": "SR" + }, + { + "name": "Svalbard and Jan Mayen", + "name_ar":"سفالبارد وجان ماين", + "code": "+47", + "countryCode": "SJ" + }, + { + "name": "Swaziland", + "name_ar":"سوازيلاند", + "code": "+268", + "countryCode": "SZ" + }, + { + "name": "Sweden", + "name_ar":"السويد", + "code": "+46", + "countryCode": "SE" + }, + { + "name": "Switzerland", + "name_ar":"سويسرا", + "code": "+41", + "countryCode": "CH" + }, + { + "name": "Syrian Arab Republic", + "name_ar":"الجمهورية العربية السورية", + "code": "+963", + "countryCode": "SY" + }, + { + "name": "Taiwan", + "name_ar":"تايوان", + "code": "+886", + "countryCode": "TW" + }, + { + "name": "Tajikistan", + "name_ar":"طاجيكستان", + "code": "+992", + "countryCode": "TJ" + }, + { + "name": "Tanzania, United Republic of Tanzania", + "name_ar":"تنزانيا ، جمهورية تنزانيا المتحدة", + "code": "+255", + "countryCode": "TZ" + }, + { + "name": "Thailand", + "name_ar":"تايلاند", + "code": "+66", + "countryCode": "TH" + }, + { + "name": "Timor-Leste", + "name_ar":"تيمور الشرقية", + "code": "+670", + "countryCode": "TL" + }, + { + "name": "Togo", + "name_ar":"ليذهب", + "code": "+228", + "countryCode": "TG" + }, + { + "name": "Tokelau", + "name_ar":"توكيلاو", + "code": "+690", + "countryCode": "TK" + }, + { + "name": "Tonga", + "name_ar":"تونغا", + "code": "+676", + "countryCode": "TO" + }, + { + "name": "Trinidad and Tobago", + "name_ar":"ترينداد وتوباغو", + "code": "+1 868", + "countryCode": "TT" + }, + { + "name": "Tunisia", + "name_ar":"تونس", + "code": "+216", + "countryCode": "TN" + }, + { + "name": "Turkey", + "name_ar":"ديك رومي", + "code": "+90", + "countryCode": "TR" + }, + { + "name": "Turkmenistan", + "name_ar":"تركمانستان", + "code": "+993", + "countryCode": "TM" + }, + { + "name": "Turks and Caicos Islands", + "name_ar":"جزر تركس وكايكوس", + "code": "+1 649", + "countryCode": "TC" + }, + { + "name": "Tuvalu", + "name_ar":"توفالو", + "code": "+688", + "countryCode": "TV" + }, + { + "name": "Uganda", + "name_ar":"أوغندا", + "code": "+256", + "countryCode": "UG" + }, + { + "name": "Ukraine", + "name_ar":"أوكرانيا", + "code": "+380", + "countryCode": "UA" + }, + { + "name": "United Kingdom", + "name_ar":"المملكة المتحدة", + "code": "+44", + "countryCode": "GB" + }, + { + "name": "United States", + "name_ar":"الولايات المتحدة الامريكانية", + "code": "+1", + "countryCode": "US" + }, + { + "name": "Uruguay", + "name_ar":"أوروغواي", + "code": "+598", + "countryCode": "UY" + }, + { + "name": "Uzbekistan", + "name_ar":"أوزبكستان", + "code": "+998", + "countryCode": "UZ" + }, + { + "name": "Vanuatu", + "name_ar":"فانواتو", + "code": "+678", + "countryCode": "VU" + }, + { + "name": "Venezuela, Bolivarian Republic of Venezuela", + "name_ar":"فنزويلا ، جمهورية فنزويلا البوليفارية", + "code": "+58", + "countryCode": "VE" + }, + { + "name": "Vietnam", + "name_ar":"فيتنام", + "code": "+84", + "countryCode": "VN" + }, + { + "name": "Virgin Islands, British", + "name_ar":"جزر العذراء البريطانية", + "code": "+1 284", + "countryCode": "VG" + }, + { + "name": "Virgin Islands, U.S.", + "name_ar":"جزر فيرجن ، الولايات المتحدة", + "code": "+1 340", + "countryCode": "VI" + }, + { + "name": "Wallis and Futuna", + "name_ar":"واليس وفوتونا", + "code": "+681", + "countryCode": "WF" + }, + { + "name": "Yemen", + "name_ar":"اليمن", + "code": "+967", + "countryCode": "YE" + }, + { + "name": "Zambia", + "name_ar":"زامبيا", + "code": "+260", + "countryCode": "ZM" + }, + { + "name": "Zimbabwe", + "name_ar":"زيمبابوي", + "code": "+263", + "countryCode": "ZW" + } + ]; + + @override + void initState() { + super.initState(); + widget.selectedCountry = widget.selectedCountry ?? countryList[0]; + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + children: [ + Divider(), + ...List.generate( + countryList.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedCountry = countryList[index]; + }); + }, + child: ListTile( + title: Text(countryList[index]["name"]), + leading: Radio( + value: countryList[index], + groupValue: widget.selectedCountry, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedCountry = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedCountry); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart new file mode 100644 index 00000000..e8d4bb7d --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart @@ -0,0 +1,129 @@ +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +// ignore: must_be_immutable +class SelectRelationTypeDialog extends StatefulWidget { + final List relationTypes; + final Function(GetAllRelationshipTypeResponseModel) onValueSelected; + GetAllRelationshipTypeResponseModel selectedRelation; + + SelectRelationTypeDialog( + {Key key, this.relationTypes, this.onValueSelected, this.selectedRelation}); + + @override + _SelectRelationTypeDialogState createState() => _SelectRelationTypeDialogState(); +} + +class _SelectRelationTypeDialogState extends State { + @override + void initState() { + super.initState(); + widget.selectedRelation = widget.selectedRelation ?? widget.relationTypes[0]; + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + children: [ + Divider(), + ...List.generate( + widget.relationTypes.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedRelation = widget.relationTypes[index]; + }); + }, + child: ListTile( + title: Text(widget.relationTypes[index].text), + leading: Radio( + value: widget.relationTypes[index], + groupValue: widget.selectedRelation, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedRelation = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedRelation); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_search_criteria_dialog.dart b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_search_criteria_dialog.dart new file mode 100644 index 00000000..f4c8d989 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_search_criteria_dialog.dart @@ -0,0 +1,137 @@ +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_criteria_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +// ignore: must_be_immutable +class SelectSearchCriteriaDialog extends StatefulWidget { + List searchCriteria = [ + SearchCriteriaModel(name: "Identification Number",nameAr:"رقم المحول",value: 1), + SearchCriteriaModel(name: "Referral Number",nameAr:"رقم المحول",value: 2), + ]; + final Function(SearchCriteriaModel) onValueSelected; + SearchCriteriaModel selectedCriteria; + + SelectSearchCriteriaDialog( + {Key key, this.onValueSelected, this.selectedCriteria}); + + @override + _SelectSearchCriteriaDialogState createState() => _SelectSearchCriteriaDialogState(); +} + +class _SelectSearchCriteriaDialogState extends State { + @override + void initState() { + super.initState(); + widget.selectedCriteria = widget.selectedCriteria ?? widget.searchCriteria[0]; + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + children: [ + Texts(" Select Search Criteria", fontSize: 20,), + Divider(), + ...List.generate( + widget.searchCriteria.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedCriteria = widget.searchCriteria[index]; + }); + }, + child: ListTile( + title: Text(widget.searchCriteria[index].name), + leading: Radio( + value: widget.searchCriteria[index], + groupValue: widget.selectedCriteria, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedCriteria = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedCriteria); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} + + + + diff --git a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart new file mode 100644 index 00000000..ba9a123d --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart @@ -0,0 +1,380 @@ +import 'dart:async'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class EReferralConfirmSMSDialog extends StatefulWidget { + final String phoneNumber; + final Function onSucces; + // final AdvanceModel advanceModel; + // final PatientInfoAndMobileNumber patientInfoAndMobileNumber; + // final String selectedPaymentMethod; + + const EReferralConfirmSMSDialog( + {Key key, + this.phoneNumber, + this.onSucces + // this.advanceModel, + // this.selectedPaymentMethod, + // this.patientInfoAndMobileNumber + }) + : super(key: key); + + @override + _EReferralConfirmSMSDialogState createState() => _EReferralConfirmSMSDialogState(); +} + +class _EReferralConfirmSMSDialogState extends State { + final verifyAccountForm = GlobalKey(); + Map verifyAccountFormValue = { + 'digit1': null, + 'digit2': null, + 'digit3': null, + 'digit4': null, + }; + + TextEditingController digit1 = TextEditingController(text: ""); + TextEditingController digit2 = TextEditingController(text: ""); + TextEditingController digit3 = TextEditingController(text: ""); + TextEditingController digit4 = TextEditingController(text: ""); + + String timerText = (TIMER_MIN - 1).toString() + ':59'; + int min = TIMER_MIN - 1; + int sec = 59; + Timer _timer; + + resendCode() { + min = TIMER_MIN - 1; + sec = 59; + _timer = Timer.periodic(Duration(seconds: 1), (Timer timer) { + if (min <= 0 && sec <= 0) { + timer.cancel(); + } else { + setState(() { + sec = sec - 1; + if (sec == 0 && min == 0) { + Navigator.pop(context); + min = 0; + sec = 0; + } else if (sec == 0) { + min = min - 1; + sec = 59; + } + timerText = min.toString() + ':' + sec.toString(); + }); + } + }); + } + + FocusNode focusD1; + FocusNode focusD2; + FocusNode focusD3; + FocusNode focusD4; + + @override + void initState() { + super.initState(); + resendCode(); + focusD1 = FocusNode(); + focusD2 = FocusNode(); + focusD3 = FocusNode(); + focusD4 = FocusNode(); + } + + @override + void dispose() { + _timer.cancel(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => Dialog( + elevation: 0.6, + child: Container( + height: 520, + child: ListView( + children: [ + Container( + width: double.infinity, + height: 40, + color: Colors.grey[700], + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + flex: 4, + child: Center( + child: Texts( + 'SMS', + color: Colors.white, + textAlign: TextAlign.center, + ))), + Expanded( + flex: 1, + child: InkWell( + onTap: () => Navigator.pop(context), + child: Container( + decoration: BoxDecoration( + shape: BoxShape.circle, color: Colors.white), + child: Icon( + Icons.clear, + color: Colors.grey[900], + )), + ), + ) + ], + ), + ), + Image.asset( + 'assets/images/login/103.png', + height: MediaQuery.of(context).size.width * 0.25, + width: MediaQuery.of(context).size.width * 0.25, + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).pleaseEnterTheVerificationCode + + '[${widget.phoneNumber}]', + textAlign: TextAlign.center, + ), + ), + SizedBox( + height: 12, + ), + Form( + key: verifyAccountForm, + child: Container( + width: SizeConfig.realScreenWidth * 0.90, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 30, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Container( + width: 65, + child: TextFormField( + textInputAction: TextInputAction.next, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ), + focusNode: focusD1, + maxLength: 1, + controller: digit1, + textAlign: TextAlign.center, + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + onSaved: (val) { + verifyAccountFormValue['digit1'] = val; + }, + validator: validateCodeDigit, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusD2); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context).requestFocus(focusD2); + } + }, + ), + ), + Container( + width: 65, + child: TextFormField( + focusNode: focusD2, + controller: digit2, + textInputAction: TextInputAction.next, + maxLength: 1, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ), + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + validator: validateCodeDigit, + onSaved: (val) { + verifyAccountFormValue['digit2'] = val; + }, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusD3); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context).requestFocus(focusD3); + } + }, + ), + ), + Container( + width: 65, + child: TextFormField( + focusNode: focusD3, + controller: digit3, + textInputAction: TextInputAction.next, + maxLength: 1, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ), + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + validator: validateCodeDigit, + onSaved: (val) { + verifyAccountFormValue['digit3'] = val; + }, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD4); + } + }, + )), + Container( + width: 65, + child: TextFormField( + focusNode: focusD4, + controller: digit4, + maxLength: 1, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ), + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + validator: validateCodeDigit, + onSaved: (val) { + verifyAccountFormValue['digit4'] = val; + }, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusD4); + submit(model); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD4); + submit(model); + } + }), + ) + ], + ), + SizedBox( + height: 8, + ), + if (model.state == ViewState.ErrorLocal || + model.state == ViewState.Error) + Container( + margin: EdgeInsets.only(left: 8, right: 8), + width: double.maxFinite, + child: Texts( + model.error, + color: Colors.red, + ), + ), + SizedBox(height: 20), + // buildText(), + + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context) + .theVerificationCodeExpiresIn + + ' $timerText', + textAlign: TextAlign.center, + ), + ), + SizedBox(height: 20), + + Container( + width: double.maxFinite, + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + label: + TranslationBase.of(context).submit.toUpperCase(), + onTap: () { + submit(model); + }, + ), + ), + ], + ), + ), + ) + ], + ), + ), + ), + ); + } + + void submit(EReferralViewModel model) async { + if (verifyAccountForm.currentState.validate()) { + final activationCode = + digit1.text + digit2.text + digit3.text + digit4.text; + + + // ToDo call service + CheckActivationCodeForEReferralResponseModel checkActivationCodeForEReferralRequestModel= new CheckActivationCodeForEReferralResponseModel(activationCode: activationCode); + await model.checkActivationCodeForEReferral(checkActivationCodeForEReferralRequestModel); + if(model.state == ViewState.ErrorLocal) { + // Utils.showErrorToast(model.error); + } else { + widget.onSucces(); + // Navigator.push(context, FadePage(page: StartIndexForAddProduct())); + // Navigate to new page + } + } + } + + String validateCodeDigit(value) { + if (value.isEmpty) { + return ''; + } + return null; + } + + InputDecoration buildInputDecoration(BuildContext context) { + return InputDecoration( + // ts/images/password_icon.png + contentPadding: EdgeInsets.only(top: 20, bottom: 20), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5)), + borderSide: BorderSide(color: Colors.black), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + borderSide: BorderSide(color: Theme.of(context).primaryColor), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + borderSide: BorderSide(color: Theme.of(context).errorColor), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + borderSide: BorderSide(color: Theme.of(context).errorColor), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart new file mode 100644 index 00000000..c837bd2a --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart @@ -0,0 +1,79 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/qr_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/CarouselSlider.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import '../../../d_q_icons_icons.dart'; +import 'e_referral_page.dart'; + +class EReferralIndexPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).serviceInformation, + body: SingleChildScrollView( + padding: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + "E-Referral: ", + fontWeight: FontWeight.normal, + fontSize: 25, + color: HexColor("#60686b"), + ), + SizedBox( + height: 12, + ), + Texts( + "This service allows you to submit a Referral request from any health care providers either inside or outside the kingdom of Saudi Arabia to any of HMG Hospitals, By filling some of the patient's data and attaching the medical reports, moreover you can track the request status (Under process, Accepted or Rejected)", + fontWeight: FontWeight.normal, + fontSize: 17, + ), + SizedBox( + height: 22, + ), + Center( + child: SizedBox( + height: MediaQuery.of(context).size.height * 0.55, + width: MediaQuery.of(context).size.width * 0.50, + child: CarouselSlider( + imagesUrlList: [ + "https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/0.png", + "https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/1.png" + ], + ), + ), + ), + SizedBox( + height: 77, + ), + ], + )), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + onTap: () => Navigator.push( + context, FadePage(page: EReferralPage())), + label: "E-Referral", + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + )); + } +} diff --git a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart new file mode 100644 index 00000000..9f836860 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart @@ -0,0 +1,128 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class EReferralPage extends StatefulWidget { + @override + _EReferralPageState createState() => _EReferralPageState(); +} + +class _EReferralPageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: "E-Referral", + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.7), + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + indicatorColor: Colors.red[800], + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.37, + child: Center( + child: Texts("New Referral"), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.37, + child: Center( + child: Texts("Search for Referrals"), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + StartIndexForNewEReferral( + ), + SearchForReferralsPage( + ) + ], + ), + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart new file mode 100644 index 00000000..0b75705d --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart @@ -0,0 +1,227 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_criteria_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'New_E_Referral/new_e_referral_step_one_page.dart'; +import 'dialogs/select_country_ingo_Dialog.dart'; +import 'dialogs/select_search_criteria_dialog.dart'; + +class SearchForReferralsPage extends StatefulWidget { + SearchForReferralsPage({Key key}); + + @override + _SearchForReferralsPageState createState() => _SearchForReferralsPageState(); +} + +class _SearchForReferralsPageState extends State { + TextEditingController _searchTextController = TextEditingController(); + + TextEditingController _mobileTextController = TextEditingController(); + bool _isSubmitted = false; + + dynamic _selectedCountry = { + "name": "Saudi Arabia", + "name_ar": "المملكة العربية السعودية", + "code": "+966", + "countryCode": "SA", + "pattern": "5xxxxxxxx", + "maxLength": 9 + }; + + SearchCriteriaModel selectedCriteria = SearchCriteriaModel( + name: "Identification Number", nameAr: "رقم المحول", value: 1); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getAllCities(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: false, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.94, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 77, + ), + InkWell( + onTap: () => selectSearchCriteriaDialog(), + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getSearchCriteriaName()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: selectedCriteria.value == 1 + ? "Enter Patient Identification No" + : "Enter Referral Number", + controller: _searchTextController, + ), + SizedBox( + height: 12, + ), + InkWell( + onTap: () => confirmSelectCountryTypeDialog(), + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getCountryName()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + MobileNumberTextFiled( + controller: _mobileTextController, + code: _selectedCountry == null + ? "11" + : _selectedCountry["code"], + ), + SizedBox( + height: 12, + ), + if ((model.state == ViewState.Idle && + model.allReferral.length == 0)) + Text("There's No Referral To deliver"), + if (( + model.state == ViewState.ErrorLocal)) + AppEmbeddedError( error:model.error), + NetworkBaseView( + baseViewModel: model, + child: ListView.builder( + shrinkWrap: true, + scrollDirection: Axis.vertical, + itemCount: model.allReferral == null + ? 0 + : model.allReferral.length < 3 + ? model.allReferral.length + : 3, + itemBuilder: (BuildContext context, int index) { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 0.2), + child: Container( + child: Texts("TODO add referral info"), + ), + ); + }, + ), + ), + ], + ), + ), + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + padding: EdgeInsets.all(9), + child: SecondaryButton( + textColor: Colors.white, + label: "Search", + onTap: () async { + SearchEReferralRequestModel searchEReferralRequestModel = + new SearchEReferralRequestModel( + patientMobileNumber: + _selectedCountry['code'] + _mobileTextController.text, + ); + if (selectedCriteria.value == 1) { + searchEReferralRequestModel.identificationNo = + _searchTextController.text; + searchEReferralRequestModel.referralNumber = 0; + } else { + searchEReferralRequestModel.referralNumber = + int.parse(_searchTextController.text); + searchEReferralRequestModel.identificationNo = ''; + } + await model.getEReferrals(searchEReferralRequestModel); + setState(() { + _isSubmitted = true; + }); + }, + loading: model.state == ViewState.BusyLocal, + disabled: _searchTextController.text.isEmpty || + _mobileTextController.text.isEmpty, + ), + ))); + } + + void confirmSelectCountryTypeDialog() { + showDialog( + context: context, + child: SelectCountryDialog( + selectedCountry: _selectedCountry, + onValueSelected: (value) { + setState(() { + _selectedCountry = value; + }); + }, + ), + ); + } + + String getCountryName() { + if (_selectedCountry != null) + return _selectedCountry["name"]; + else + return "Country"; + } + + void selectSearchCriteriaDialog() { + showDialog( + context: context, + child: SelectSearchCriteriaDialog( + selectedCriteria: selectedCriteria, + onValueSelected: (value) { + setState(() { + selectedCriteria = value; + }); + }, + ), + ); + } + + String getSearchCriteriaName() { + return selectedCriteria.name; + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart new file mode 100644 index 00000000..17be8edd --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart @@ -0,0 +1,103 @@ +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +// ignore: must_be_immutable +class ConfirmCancelOrderDialog extends StatefulWidget { + final HomeHealthCareViewModel model; + final Function onTap; + + + ConfirmCancelOrderDialog( + {Key key, this.model, this.onTap}); + + @override + _ConfirmCancelOrderDialogState createState() => _ConfirmCancelOrderDialogState(); +} + +class _ConfirmCancelOrderDialogState extends State { + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), + title: Center( + child: Texts( + "Confirm", + color: Colors.black, + ), + ), + children: [ + Column( + children: [ + Divider(), + Center( + child: Texts( + "Are you sure!! want to cancel this order", + color: Colors.grey, + ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () async{ + widget.onTap(); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} + + + diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart new file mode 100644 index 00000000..1dbee1b5 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart @@ -0,0 +1,177 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/PatientERHHCInsertServicesList.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:geolocator/geolocator.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; + +class NewHomeHealthCareStepOnePage extends StatefulWidget { + final PatientERInsertPresOrderRequestModel + patientERInsertPresOrderRequestModel; + final Function changePageViewIndex; + final HomeHealthCareViewModel model; + + const NewHomeHealthCareStepOnePage( + {Key key, + this.patientERInsertPresOrderRequestModel, + this.model, + this.changePageViewIndex}) + : super(key: key); + + @override + _NewHomeHealthCareStepOnePageState createState() => + _NewHomeHealthCareStepOnePageState(); +} + +class _NewHomeHealthCareStepOnePageState extends State { + + PickResult _result; + + + @override + void initState() { + if (widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList == null) + widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList = []; + super.initState(); + } + + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: false, + baseViewModel: widget.model, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.only( + left: MediaQuery.of(context).size.width * 0.05, + right: MediaQuery.of(context).size.width * 0.05), + child: Center( + child: FractionallySizedBox( + widthFactor: 1, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Texts( + "Select Home Health Care Services", + textAlign: TextAlign.center, + ), + Column( + children: widget.model.hhcAllServicesList.map((service) { + return Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + border: Border.all(color: Colors.grey, width: 1), + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + children: [ + Row( + children: [ + Checkbox( + value: isServiceSelected(service.serviceID), + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() { + if (!isServiceSelected( + service.serviceID)) + widget + .patientERInsertPresOrderRequestModel + .patientERHHCInsertServicesList + .add(PatientERHHCInsertServicesList( + recordID: widget + .patientERInsertPresOrderRequestModel + .patientERHHCInsertServicesList + .length, + serviceID: service.serviceID, + serviceName: + service.description)); + else + removeSelected(service.serviceID); + // widget.patientERInsertPresOrderRequestModel + // isPatientInsured = newValue; + }); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.all(20.0), + child: Texts( + service.description, + fontSize: 15, + ), + ), + ), + ], + ), + ], + ), + ); + }).toList(), + ) + ], + ), + ), + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + label: "Next", + disabled: this + .widget + .patientERInsertPresOrderRequestModel + .patientERHHCInsertServicesList + .length == 0, + onTap: (){ + widget.changePageViewIndex(1); + }, + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + ), + ); + } + + isServiceSelected(int serviceId) { + Iterable patientERHHCInsertServicesList = + widget + .patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList + .where((element) => serviceId == element.serviceID); + if (patientERHHCInsertServicesList.length > 0) { + return true; + } + return false; + } + + removeSelected(int serviceId) { + Iterable patientERHHCInsertServicesList = + widget + .patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList + .where((element) => serviceId == element.serviceID); + + if (patientERHHCInsertServicesList.length > 0) + setState(() { + widget + .patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList + .remove(patientERHHCInsertServicesList.first); + }); + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart new file mode 100644 index 00000000..aca2f3c2 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart @@ -0,0 +1,172 @@ +import 'dart:async'; + +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; + +class NewHomeHealthCareStepThreePage extends StatefulWidget { + final PatientERInsertPresOrderRequestModel + patientERInsertPresOrderRequestModel; + final Function changePageViewIndex; + final HomeHealthCareViewModel model; + + NewHomeHealthCareStepThreePage( + {Key key, + this.patientERInsertPresOrderRequestModel, + this.changePageViewIndex, + this.model}); + + @override + _NewHomeHealthCareStepThreePageState createState() => + _NewHomeHealthCareStepThreePageState(); +} + +class _NewHomeHealthCareStepThreePageState + extends State { + Completer _controller = Completer(); + + static CameraPosition _kGooglePlex = CameraPosition( + target: LatLng(37.42796133580664, -122.085749655962), + zoom: 14.4746, + ); + final Set markers = new Set(); + + @override + void initState() { + if (widget.patientERInsertPresOrderRequestModel.latitude != null) { + markers.clear(); + markers.add( + Marker( + markerId: MarkerId( + widget.patientERInsertPresOrderRequestModel.latitude.hashCode + .toString(), + ), + position: LatLng( + widget.patientERInsertPresOrderRequestModel.latitude, + widget.patientERInsertPresOrderRequestModel.longitude)), + ); + _kGooglePlex = CameraPosition( + target: LatLng(widget.patientERInsertPresOrderRequestModel.latitude, + widget.patientERInsertPresOrderRequestModel.longitude), + zoom: 14.4746, + ); + } + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowDecPage: false, + baseViewModel: widget.model, + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + width: double.maxFinite, + margin: EdgeInsets.only(left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Order Details'), + SizedBox( + height: 12, + ), + Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), + padding: EdgeInsets.all(8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Location :'), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + height: 200, + child: GoogleMap( + mapType: MapType.normal, + markers: markers, + initialCameraPosition: _kGooglePlex, + onMapCreated: (GoogleMapController controller) { + _controller.complete(controller); + }, + ), + ), + ), + SizedBox( + height: 12, + ), + Texts('Selected Service :'), + ...List.generate( + widget.patientERInsertPresOrderRequestModel + .patientERHHCInsertServicesList.length, + (index) => Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Service Name :', + fontSize: 12, + ), + SizedBox( + height: 5, + ), + Texts( + widget + .patientERInsertPresOrderRequestModel + .patientERHHCInsertServicesList[index] + .serviceName, + fontSize: 15, + bold: true, + ), + ], + ), + ), + ) + ], + ), + ), + SizedBox( + height: 57, + ), + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + label: "Confirm", + disabled: widget.patientERInsertPresOrderRequestModel + .patientERHHCInsertServicesList.length == + 0, + onTap: () async { + await widget.model.insertPresPresOrder( + order: widget.patientERInsertPresOrderRequestModel); + if (widget.model.state != ViewState.ErrorLocal) { + widget.changePageViewIndex(0); + } + }, + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart new file mode 100644 index 00000000..3f522a1f --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart @@ -0,0 +1,112 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/close_back.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:provider/provider.dart'; + +class NewHomeHealthCareStepTowPage extends StatefulWidget { + final Function(PickResult) onPick; + final double latitude; + final double longitude; + final PatientERInsertPresOrderRequestModel + patientERInsertPresOrderRequestModel; + final Function changePageViewIndex; + final HomeHealthCareViewModel model; + + const NewHomeHealthCareStepTowPage( + {Key key, + this.onPick, + this.latitude, + this.longitude, + this.patientERInsertPresOrderRequestModel, + this.changePageViewIndex, + this.model}) + : super(key: key); + + @override + _NewHomeHealthCareStepTowPageState createState() => + _NewHomeHealthCareStepTowPageState(); +} + +class _NewHomeHealthCareStepTowPageState + extends State { + double latitude = 0; + double longitude = 0; + + @override + void initState() { + if (widget.patientERInsertPresOrderRequestModel.latitude == null) { + latitude = widget.latitude; + longitude = widget.longitude; + } else { + latitude = widget.patientERInsertPresOrderRequestModel.latitude; + longitude = widget.patientERInsertPresOrderRequestModel.longitude; + } + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( + isShowDecPage: false, + body: PlacePicker( + apiKey: GOOGLE_API_KEY, + enableMyLocationButton: true, + automaticallyImplyAppBarLeading: false, + autocompleteOnTrailingWhitespace: true, + selectInitialPosition: true, + autocompleteLanguage: projectViewModel.currentLanguage, + enableMapTypeButton: true, + onPlacePicked: (PickResult result) { + print(result.adrAddress); + widget.changePageViewIndex(3); + }, + selectedPlaceWidgetBuilder: + (_, selectedPlace, state, isSearchBarFocused) { + print("state: $state, isSearchBarFocused: $isSearchBarFocused"); + return isSearchBarFocused + ? Container() + : FloatingCard( + bottomPosition: 0.0, + leftPosition: 0.0, + rightPosition: 0.0, + width: 500, + borderRadius: BorderRadius.circular(12.0), + child: state == SearchingState.Searching + ? Center(child: CircularProgressIndicator()) + : Container( + margin: EdgeInsets.all(12), + child: SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + setState(() { + widget.patientERInsertPresOrderRequestModel + .latitude = + selectedPlace.geometry.location.lat; + widget.patientERInsertPresOrderRequestModel + .longitude = + selectedPlace.geometry.location.lng; + }); + widget.changePageViewIndex(3); + }, + label: TranslationBase.of(context).next, + ), + ), + ); + }, + initialPosition: LatLng(latitude, longitude), + useCurrentLocation: true, + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart new file mode 100644 index 00000000..87a33c6d --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart @@ -0,0 +1,325 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/material.dart'; +import 'package:geolocator/geolocator.dart'; + +import '../StepsWidget.dart'; +import 'new_Home_health_care_step_one_page.dart'; + +class NewHomeHealthCarePage extends StatefulWidget { + NewHomeHealthCarePage({this.model}); + + final HomeHealthCareViewModel model; + @override + _NewHomeHealthCarePageState createState() => _NewHomeHealthCarePageState(); +} + +class _NewHomeHealthCarePageState extends State + with TickerProviderStateMixin { + PageController _controller; + int _currentIndex = 1; + double _latitude; + double _longitude; + + PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel = + new PatientERInsertPresOrderRequestModel(); + + @override + void initState() { + super.initState(); + _controller = new PageController(); + _getCurrentLocation(); + } + + _getCurrentLocation() async { + await getLastKnownPosition().then((value) { + _latitude = value.latitude; + _longitude = value.longitude; + }).catchError((e) { + _longitude = 0; + _latitude = 0; + }); + } + + @override + void dispose() { + super.dispose(); + } + + _changeCurrentTab(int tab) { + setState(() { + _currentIndex = tab; + }); + _controller.animateToPage(tab, + duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart); + } + + @override + Widget build(BuildContext context) { + void showConfirmMessage(HomeHealthCareViewModel model, + GetOrderDetailByOrderIDResponseModel order) { + showDialog( + context: context, + child: ConfirmCancelOrderDialog( + model: model, + onTap: () async { + UpdatePresOrderRequestModel updatePresOrderRequestModel = + UpdatePresOrderRequestModel( + presOrderID: order.presOrderID, + rejectionReason: "", + presOrderStatus: 4, + editedBy: 3); + await model.updateHHCPresOrder(updatePresOrderRequestModel); + if (model.state == ViewState.ErrorLocal) { + Utils.showErrorToast(model.error); + } else { + AppToast.showSuccessToast(message: "Done Successfully"); + await model.getHHCAllPresOrders(); + // await model.getHHCAllServices(); + } + }, + )); + } + + return Scaffold( + body: SafeArea( + child: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 0.8, + child: Column( + children: [ + + Container( + margin: EdgeInsets.only(left: MediaQuery.of(context).size.width*0.05, right: MediaQuery.of(context).size.width*0.05), + child: StepsWidget( + index: _currentIndex, + changeCurrentTab: _changeCurrentTab, + ), + ), + Expanded( + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + widget.model.pendingOrder != null + ? FractionallySizedBox( + widthFactor: 0.9, + child: SingleChildScrollView( + child: Container( + width: double.infinity, + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + border: Border.all(color: Colors.grey, width: 1), + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + "Request ID", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + widget.model.pendingOrder.iD.toString(), + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + "Status", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + widget.model.pendingOrder.description, + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + "Pickup Date", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate(widget + .model.pendingOrder.createdOn)), + fontSize: 22, + ), + ], + ), + ), + ...List.generate( + widget.model.hhcAllOrderDetail.length, + (index) => Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Service Name", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + widget.model.hhcAllOrderDetail[index] + .description, + fontSize: 22, + bold: true, + ), + ], + ), + ), + ), + SizedBox( + height: 12, + ), + Center( + child: Container( + width: + MediaQuery.of(context).size.width * 0.85, + child: SecondaryButton( + label: "Cancel".toUpperCase(), + onTap: () { + showConfirmMessage(widget.model, + widget.model.hhcAllOrderDetail[0]); + }, + color: Colors.red[800], + disabled: false, + textColor: + Theme.of(context).backgroundColor), + ), + ), + SizedBox( + height: 12, + ), + ], + ), + ), + ), + ) + : NewHomeHealthCareStepOnePage( + changePageViewIndex: _changeCurrentTab, + patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, + model: widget.model, + ), + NewHomeHealthCareStepTowPage( + latitude: _latitude, + longitude: _longitude, + changePageViewIndex: _changeCurrentTab, + patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, + model: widget.model, + ), + NewHomeHealthCareStepThreePage( + changePageViewIndex: _changeCurrentTab, + patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, + model: widget.model, + ) + + ], + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart new file mode 100644 index 00000000..370544d0 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart @@ -0,0 +1,181 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class StepsWidget extends StatelessWidget { + final int index; + final Function changeCurrentTab; + + StepsWidget({Key key, this.index, this.changeCurrentTab}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return !projectViewModel.isArabic? Stack( + children: [ + Container( + height: 50, + width: MediaQuery.of(context).size.width, + color: Colors.transparent, + child: Center( + child: Divider( + color: Colors.grey, + height: 0.75, + thickness: 0.75, + ), + ), + ), + Positioned( + top: 10, + left: 0, + child: InkWell( + onTap: () => changeCurrentTab(0), + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75), + shape: BoxShape.circle, + color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white, + ), + child: Center( + child: Texts( + '1', + color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800], + ), + ), + ), + ), + ), + Positioned( + top: 10, + left: MediaQuery.of(context).size.width * 0.42, + child: InkWell( + onTap: () => index >= 2 ? changeCurrentTab(1) : null, + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75), + shape: BoxShape.circle, + color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white, + ), + child: Center( + child: Texts( + '2', + color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800], + ), + ), + ), + ), + ), + Positioned( + top: 10, + right: 0, + child: InkWell( + onTap: () => index == 2 ?changeCurrentTab(3) : null, + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all(color: Colors.black,width: 0.75), + color: index == 2 ? Colors.grey[800] : Colors.white, + ), + child: Center( + child: Texts( + '3', + color: index == 2 ? Colors.white : Colors.grey[800], + ), + ), + ), + ), + ), + + ], + ):Stack( + children: [ + Container( + height: 50, + width: MediaQuery.of(context).size.width, + color: Colors.transparent, + child: Center( + child: Divider( + color: Colors.grey, + height: 0.75, + thickness: 0.75, + ), + ), + ), + Positioned( + top: 10, + right: 0, + child: InkWell( + onTap: () => changeCurrentTab(0), + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75), + shape: BoxShape.circle, + color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white, + ), + child: Center( + child: Texts( + '1', + color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800], + ), + ), + ), + ), + ), + Positioned( + top: 10, + left: MediaQuery.of(context).size.width * 0.42, + child: InkWell( + onTap: () => index >= 2 ? changeCurrentTab(1) : null, + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75), + shape: BoxShape.circle, + color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white, + ), + child: Center( + child: Texts( + '2', + color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800], + ), + ), + ), + ), + ), + Positioned( + top: 10, + left: 0, + child: InkWell( + onTap: () => index == 2 ?changeCurrentTab(3) : null, + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all(color: Colors.black,width: 0.75), + color: index == 2 ? Colors.grey[800] : Colors.white, + ), + child: Center( + child: Texts( + '3', + color: index == 2 ? Colors.white : Colors.grey[800], + ), + ), + ), + ), + ), + ], + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart new file mode 100644 index 00000000..fa0799f9 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart @@ -0,0 +1,69 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import 'home_health_care_page.dart'; + +class HomeHealthCareIndexPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).serviceInformation, + body: SingleChildScrollView( + padding: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).homeHealthCare, + fontWeight: FontWeight.normal, + fontSize: 25, + color: Color(0xff60686b), + ), + SizedBox( + height: 12, + ), + Texts( + TranslationBase.of(context).homeHealthCareText, + fontWeight: FontWeight.normal, + fontSize: 17, + ), + SizedBox( + height: 22, + ), + Center( + child: Image.asset( + 'assets/images/AlHabibMedicalService/Wifi-AR.png')), + SizedBox( + height: 77, + ), + ], + )), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + onTap: () => Navigator.push( + context, + FadePage( + page: HomeHealthCarePage(), + ), + ), + label: TranslationBase.of(context).loginRegister, + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + )); + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart new file mode 100644 index 00000000..8f4821f6 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart @@ -0,0 +1,132 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'NewHomeHealthCare/new_home_health_care_page.dart'; +import 'orders_log_details_page.dart'; + +class HomeHealthCarePage extends StatefulWidget { + @override + _HomeHealthCarePageState createState() => _HomeHealthCarePageState(); +} + +class _HomeHealthCarePageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model){ + // model.getHHCAllServices(); + model.getHHCAllPresOrders(); + }, + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).homeHealthCare, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.7), + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + indicatorColor: Colors.red[800], + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.37, + child: Center( + child: Texts(TranslationBase.of(context).homeHealthCare), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.37, + child: Center( + child: Texts(TranslationBase.of(context).orderLog), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + NewHomeHealthCarePage( + model: model, + ), + OrdersLogDetailsPage( + model: model, + ) + ], + ), + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart new file mode 100644 index 00000000..0cfedb41 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart @@ -0,0 +1,251 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +import 'Dialog/confirm_cancel_order_dialog.dart'; + +class OrdersLogDetailsPage extends StatelessWidget { + final HomeHealthCareViewModel model; + + const OrdersLogDetailsPage({Key key, this.model}) : super(key: key); + + @override + Widget build(BuildContext context) { + void showConfirmMessage( + HomeHealthCareViewModel model, GetHHCAllPresOrdersResponseModel order) { + showDialog( + context: context, + child: ConfirmCancelOrderDialog( + model: model, + onTap: () async { + UpdatePresOrderRequestModel updatePresOrderRequestModel = + UpdatePresOrderRequestModel( + presOrderID: order.iD, + rejectionReason: "", + presOrderStatus: 4, editedBy: 3); + await model.updateHHCPresOrder(updatePresOrderRequestModel); + if(model.state == ViewState.ErrorLocal) { + Utils.showErrorToast(model.error); + } else { + AppToast.showSuccessToast(message: "Done Successfully"); + await model.getHHCAllPresOrders(); + // await model.getHHCAllServices(); + } + }, + )); + } + + return AppScaffold( + isShowAppBar: false, + baseViewModel: model, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.94, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 50, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: model.hhcAllPresOrders.map((order) { + return Container( + width: double.infinity, + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + border: + Border.all(color: Colors.grey, width: 1), + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Request ID", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + order.iD.toString(), + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Status", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + order.description, + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Pickup Date", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate( + order.createdOn)), + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Location", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + order.nearestProjectDescription + .toString() ?? + order.nearestProjectDescriptionN + .toString(), + fontSize: 22, + ), + ], + ), + ), + SizedBox( + height: 12, + ), + if (order.status == 1 ||order.status == 2 ) + Center( + child: Container( + width: MediaQuery + .of(context) + .size + .width * + 0.85, + child: SecondaryButton( + label: "Cancel".toUpperCase(), + onTap: () { + showConfirmMessage(model, order); + } + , + color: Colors.red[800], + disabled: false, + textColor: Theme + .of(context) + .backgroundColor), + ), + ), + SizedBox( + height: 12, + ), + ], + ), + ); + }).toList()) + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart new file mode 100644 index 00000000..1359ab8d --- /dev/null +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -0,0 +1,421 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/weather_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h2o_index_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_converter.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/my_web_view.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/parking_page.dart'; +import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; +import 'package:diplomaticquarterapp/pages/ChildVaccines/child_vaccines_page.dart'; +import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; +import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; +import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; +import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; +import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; +import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; +import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/services)contaniner.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:geolocator/geolocator.dart'; +import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class AllHabibMedicalService extends StatefulWidget { + //TODO + final Function goToMyProfile; + + AllHabibMedicalService({Key key, this.goToMyProfile}); + + @override + _AllHabibMedicalServiceState createState() => _AllHabibMedicalServiceState(); +} + +class _AllHabibMedicalServiceState extends State { + AppSharedPreferences sharedPref = AppSharedPreferences(); + AuthenticatedUser authUser = new AuthenticatedUser(); + LocationUtils locationUtils; + var weather = '--'; + WeatherService _weatherService = WeatherService(); + @override + void initState() { + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + locationUtils = + new LocationUtils(isShowConfirmDialog: true, context: context); + WidgetsBinding.instance.addPostFrameCallback((_) => { + Geolocator.getLastKnownPosition() + .then((value) => setLocation(value)) + }); + }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).alhabiServices, + isShowDecPage: false, + body: Column( + children: [ + Expanded( + child: ListView( + scrollDirection: Axis.vertical, + physics: AlwaysScrollableScrollPhysics(), + shrinkWrap: true, + children: [ + Container( + margin: EdgeInsets.all(8), + width: double.infinity, + height: 150, + decoration: BoxDecoration( + image: DecorationImage( + image: ExactAssetImage('assets/images/Weather_img.png'), + fit: BoxFit.cover, + ), + borderRadius: BorderRadius.circular(8.0)), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 10.0), + child: Row( + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context) + .healthWeatherIndicators, + color: Colors.white, + fontWeight: FontWeight.w600, + ), + Texts( + TranslationBase.of(context).healthTipsBasedOnCurrentWeather, + color: Colors.white, + fontSize: 14, + ), + ], + ), + Expanded( + flex: 2, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: HealthWeatherIndicator(), + ), + ); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/Weather_ico.png', + width: 60, + height: 60, + ), + Directionality( + textDirection: TextDirection.ltr, + child: AppText(weather, + fontSize: 22, + color: Colors.white)) + ], + ), + Texts( + TranslationBase.of(context).moreDetails, + color: Colors.white, + decoration: TextDecoration.underline, + ), + ], + )), + ) + ], + ), + ), + ), + ServicesContainer( + onTap: () { + Navigator.pop(context); + widget.goToMyProfile(); + }, + imageLocation: + 'assets/images/new-design/my_file_bottom_bar.png', + title: TranslationBase.of(context).myMedicalFile, + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: LiveCareHome(), + ), + ), + imageLocation: 'assets/images/new-design/liveCare_ar_bg.png', + title: TranslationBase.of(context).livecare, + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: BookingOptions( + isAppbar: true, + ), + ), + ), + imageLocation: + 'assets/images/new-design/booking_icon_active.png', + title: TranslationBase.of(context).bookAppo, + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: PaymentService(), + ), + ), + imageLocation: + 'assets/images/al-habib_online_payment_service_icon.png', + title: TranslationBase.of(context).onlinePaymentService, + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage(), + ), + imageLocation: + 'assets/images/al-habib_online_payment_service_icon.png', + title: 'Covid-19- Drive-Thru Test', + ), + ServicesContainer( + onTap: () { + Navigator.push( + context, + FadePage( + page: ErOptions( + isAppbar: true, + ), + ), + ); + }, + imageLocation: 'assets/images/emergency_service_image.png', + title: TranslationBase.of(context).emergencyService, + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: ParkingPage(), + ), + ), + imageLocation: 'assets/images/pharmacy_logo.png', + title: 'Pharmacy'), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: InsuranceUpdate(), + ), + ), + imageLocation: + 'assets/images/medical/insurance_card_icon.png', + title: TranslationBase.of(context).updateInsurance, + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: authUser.patientID == null + ? EReferralIndexPage() + : EReferralPage()), + ), + imageLocation: 'assets/images/ereferral_service_icon.png', + title: 'E-Referral', + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: MyFamily(), + ), + ), + imageLocation: + 'assets/images/new-design/family_menu_icon_red.png', + title: 'My Family', + ), + if(projectViewModel.havePrivilege(35)) + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage(page: ChildVaccinesPage()), + ), + imageLocation: + 'assets/images/new-design/children_vaccines_icon.png', + title: 'Child Vaccines', + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: ToDo(isShowAppBar: true), + ), + ), + imageLocation: + 'assets/images/new-design/upcoming_icon_bottom_bar.png', + title: TranslationBase.of(context).todoList, + ), + if(projectViewModel.havePrivilege(42)) + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage(page: SymptomInfo()), + ), + imageLocation: 'assets/images/new-design/body_icon.png', + title: 'Symptom Checker'), + if(projectViewModel.havePrivilege(36)) + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage(page: BloodDonationPage()), + ), + imageLocation: 'assets/images/new-design/blood_icon.png', + title: 'Blood Donation', + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: (HealthCalculators()), + ), + ), + imageLocation: + 'assets/images/new-design/health_calculator_icon.png', + title: 'Health Calculators', + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: HealthConverter(), + ), + ), + imageLocation: + 'assets/images/new-design/health_convertor_icon.png', + title: 'Health Converter', + ), + if(projectViewModel.havePrivilege(38)) + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: H2OPageIndexPage(), + ), + ), + imageLocation: 'assets/images/new-design/water_icon.png', + title: 'H2O', + ), + if(projectViewModel.havePrivilege(41)) + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage(), + ), + imageLocation: 'assets/images/new-design/smartwatch_icon.png', + title: TranslationBase.of(context).smartWatches, + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: ParkingPage(), + ), + ), + imageLocation: + 'assets/images/new-design/parking_system_icon.png', + title: TranslationBase.of(context).parking, + ), + ServicesContainer( + onTap: () => launch( + "https://hmgwebservices.com/vt_mobile/html/index.html"), + imageLocation: + 'assets/images/new-design/virtual_tour_icon.png', + title: TranslationBase.of(context).vTour, + ), + ServicesContainer( + onTap: () { + Navigator.of(context).push(MaterialPageRoute( + builder: (BuildContext context) => MyWebView( + title: "HMG News", + selectedUrl: + "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + ))); + }, + imageLocation: + 'assets/images/new-design/twitter_dashboard_icon.png', + title: 'Latest News', + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: FindUsPage(), + ), + ), + imageLocation: 'assets/images/new-design/find_us_icon.png', + title: TranslationBase.of(context).findUs, + ), + ], + ), + ), + ], + ), + ); + } + + getAuthUser() async { + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + setState(() { + authUser = data; + }); + } + var data = await this.sharedPref.getObject(WEATHER); + if (data == null) { + var d = await _weatherService.getWeatherData(); + print(d); + setState(() { + weather = d != null ? d.temperature.toString() + '\u2103' : '--'; + }); + } else { + setState(() { + weather = + data != null ? data['Temperature'].toString() + '\u2103' : '--'; + }); + } + } + + void setLocation(Position position) { + this.sharedPref.setDouble(USER_LAT, position.latitude ?? 0.0); + this.sharedPref.setDouble(USER_LONG, position.longitude ?? 0.0); + getAuthUser(); + } +} diff --git a/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart b/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart new file mode 100644 index 00000000..90386827 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart @@ -0,0 +1,107 @@ +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +// ignore: must_be_immutable +class ConfirmAddAmountDialog extends StatefulWidget { + final int amount; + final String unit; + final H2OViewModel model; + + + ConfirmAddAmountDialog( + {Key key, this.model,this.amount,this.unit ="ml"}); + + @override + _ConfirmAddAmountDialogState createState() => _ConfirmAddAmountDialogState(); +} + +class _ConfirmAddAmountDialogState extends State { + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), + title: Center( + child: Texts( + "Confirm", + color: Colors.black, + ), + ), + children: [ + Column( + children: [ + Divider(), + Center( + child: Texts( + "Are you sure you want to Add ${widget.amount} ${widget.unit} ?", + color: Colors.grey, + ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () async{ + InsertUserActivityRequestModel insertUserActivityRequestModel= InsertUserActivityRequestModel(quantityIntake:widget.amount ); + await widget.model.insertUserActivity(insertUserActivityRequestModel); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} + + + diff --git a/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart b/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart new file mode 100644 index 00000000..d70aec4e --- /dev/null +++ b/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart @@ -0,0 +1,157 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +// ignore: must_be_immutable +class SelectAmountDialog extends StatefulWidget { + List searchAmount = [ + AmountModel(name: "l",nameAr:"لتر",value: 1), + AmountModel(name: "ml",nameAr:"مم لتر",value: 2), + ]; + final Function(AmountModel) onValueSelected; + AmountModel selectedAmount; + + SelectAmountDialog( + {Key key, this.onValueSelected, this.selectedAmount}); + + @override + _SelectAmountDialogState createState() => _SelectAmountDialogState(); +} + +class _SelectAmountDialogState extends State { + @override + void initState() { + super.initState(); + widget.selectedAmount = widget.selectedAmount ?? widget.searchAmount[0]; + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + children: [ + Texts("Select the preferred unit", fontSize: 20,), + Divider(), + ...List.generate( + widget.searchAmount.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedAmount = widget.searchAmount[index]; + }); + }, + child: ListTile( + title: Text(widget.searchAmount[index].name), + leading: Radio( + value: widget.searchAmount[index], + groupValue: widget.selectedAmount, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedAmount = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedAmount); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} +class AmountModel { + String name; + String nameAr; + int value; + + AmountModel({this.name, this.nameAr, this.value}); + + AmountModel.fromJson(Map json) { + name = json['name']; + nameAr = json['nameAr']; + value = json['value']; + } + + Map toJson() { + final Map data = new Map(); + data['name'] = this.name; + data['nameAr'] = this.nameAr; + data['value'] = this.value; + return data; + } +} + + + + diff --git a/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart b/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart new file mode 100644 index 00000000..036ed186 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart @@ -0,0 +1,131 @@ +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'Dialog/select_amount_dialog.dart'; + +class AddCustomAmount extends StatefulWidget { + final H2OViewModel model; + final Function changePageViewIndex; + + const AddCustomAmount({Key key, this.model, this.changePageViewIndex}) + : super(key: key); + + @override + _AddCustomAmountState createState() => _AddCustomAmountState(); +} + +class _AddCustomAmountState extends State { + TextEditingController _nameTextController = TextEditingController(); + AmountModel selectedAmount; + + @override + void initState() { + setState(() { + _nameTextController.text = "0"; + }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: "Enter amount", + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.94, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + NewTextFields( + hintText: "Enter the amount of water:", + // type: "Number", + controller: _nameTextController, + ), + SizedBox( + height: 12, + ), + InkWell( + onTap: () => confirmAmountTypeDialog(), + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getAmountName()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + SecondaryButton( + textColor: Colors.white, + label: "OK", + onTap: () async { + Navigator.of(context).pop(); + showConfirmMessage (int.parse(_nameTextController.text), widget.model); + }, + // loading: model.state == ViewState.BusyLocal, + disabled: _nameTextController.text.isEmpty || selectedAmount == null), + SizedBox( + height: 12, + ), + ], + ), + ), + ), + ), + ), + ); + } + + +void confirmAmountTypeDialog() { + showDialog( + context: context, + child: SelectAmountDialog( + selectedAmount: selectedAmount, + onValueSelected: (value) { + setState(() { + selectedAmount = value; + }); + }, + ), + ); +} + + + String getAmountName() { + if (selectedAmount != null) + return selectedAmount.name; + else + return "Select unit"; + } + + + + void showConfirmMessage(int amount, H2OViewModel model) { + showDialog(context: context, child: ConfirmAddAmountDialog(model: model,amount:amount,)); + } +} diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart new file mode 100644 index 00000000..e6e05ee6 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart @@ -0,0 +1,69 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h2o_page.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class H2OPageIndexPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).serviceInformation, + body: SingleChildScrollView( + padding: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + "Water Tracker:", + fontWeight: FontWeight.normal, + fontSize: 25, + color: HexColor("#60686b"), + ), + SizedBox( + height: 12, + ), + Texts( + "This service is designed to help you to set drinking water goals and track the volume of water you are drinking on a daily basis. This service allows for schedule reminders and offers a basic statistical analysis of the amount of what you have consumed over the course of a day, week or month.", + fontWeight: FontWeight.normal, + fontSize: 17, + ), + SizedBox( + height: 22, + ), + Center( + child: Image.asset( + 'assets/images/AlHabibMedicalService/Wifi-AR.png')), + SizedBox( + height: 77, + ), + ], + )), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery + .of(context) + .size + .width * 0.9, + child: SecondaryButton( + onTap: () => + Navigator.push(context, FadePage(page: H2OPage())), + label: "Water Tracker", + textColor: Theme + .of(context) + .backgroundColor), + ), + ], + ), + ),); + } +} diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart new file mode 100644 index 00000000..ad2c6ece --- /dev/null +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart @@ -0,0 +1,120 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/month_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/today_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/week_page.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class H2OPage extends StatefulWidget { + @override + _H2OPageState createState() => _H2OPageState(); +} + +class _H2OPageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 3, vsync: this,); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: "Water Tracker", + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.9, + + child: Center( + child: TabBar( + isScrollable: false, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + indicatorColor: Colors.red[800], + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 10.0, right: 13.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.28, + child: Center( + child: Texts( + "Today"), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.28, + child: Center( + child: Texts("Week"), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.28, + child: Center( + child: Texts("Month"), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [TodayPage(), WeekPage(), MonthPage()], + ), + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/h2o/month_page.dart b/lib/pages/AlHabibMedicalService/h2o/month_page.dart new file mode 100644 index 00000000..f0baf34d --- /dev/null +++ b/lib/pages/AlHabibMedicalService/h2o/month_page.dart @@ -0,0 +1,27 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart'; +import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; +import 'package:flutter/cupertino.dart'; + +class MonthPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getUserProgressForMonthData(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: false, + appBarTitle: "Water Tracker", + baseViewModel:model , + body: SingleChildScrollView( + padding: EdgeInsets.symmetric(vertical: 12), + child: AppBarChart( + seriesList: model.userProgressForMonthDataSeries), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/h2o/today_page.dart b/lib/pages/AlHabibMedicalService/h2o/today_page.dart new file mode 100644 index 00000000..b92efc9e --- /dev/null +++ b/lib/pages/AlHabibMedicalService/h2o/today_page.dart @@ -0,0 +1,169 @@ +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:percent_indicator/circular_percent_indicator.dart'; + +class TodayPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getUserProgressForTodayData(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: false, + appBarTitle: "Water Tracker", + baseViewModel: model, + body: SingleChildScrollView( + padding: EdgeInsets.symmetric(vertical: 12), + child: Container( + margin: EdgeInsets.only(top: 60), + child: Column( + children: [ + Center( + child: CircularPercentIndicator( + radius: 180.0, + animation: true, + animationDuration: 1200, + lineWidth: 15.0, + percent: model.userProgressData == null + ? 0.0 + : (model.userProgressData.percentageConsumed / 100) >= 1 + ? 1 + : (model.userProgressData.percentageConsumed / 100), + //, + center: Center( + child: Column( + children: [ + SizedBox( + height: 40, + ), + Text( + "Consumed", + style: TextStyle(fontSize: 20.0), + ), + SizedBox( + height: 4, + ), + Text( + model.userProgressData == null + ? "0.0" + : model.userProgressData.quantityConsumed + .toString() + + 'ml', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20.0, + color: HexColor("#60BCF9")), + ), + SizedBox( + height: 4, + ), + SizedBox( + height: 5, + width: 50, + child: Container(), + ), + SizedBox( + height: 4, + ), + Text( + "Remaining", + style: TextStyle(fontSize: 20.0), + ), + SizedBox( + height: 4, + ), + Text( + model.userProgressData == null + ? "0.0" + : (model.userProgressData.quantityLimit - + model.userProgressData + .quantityConsumed) < + 0 + ? "0 ml" + : (model.userProgressData.quantityLimit - + model.userProgressData + .quantityConsumed) + .toString() + + ' ml', + style: TextStyle( + fontWeight: FontWeight.bold, fontSize: 18.0), + ), + ], + ), + ), + circularStrokeCap: CircularStrokeCap.butt, + backgroundColor: HexColor("#D1E3F6"), + progressColor: HexColor("#60BCF9"), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Center( + child: Container( + margin: EdgeInsets.only(left: 20), + height: 30, + width: 70, + decoration: BoxDecoration( + color: HexColor("#D1E3F6"), + borderRadius: + BorderRadius.all(Radius.circular(30))), + ), + ), + Text( + "Remaining % ", + style: TextStyle(fontSize: 20.0), + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Center( + child: Container( + margin: EdgeInsets.only(left: 20), + height: 30, + width: 70, + decoration: BoxDecoration( + color: HexColor("#60BCF9"), + borderRadius: + BorderRadius.all(Radius.circular(30))), + ), + ), + Text( + "Consumed % ", + style: TextStyle(fontSize: 20.0), + ) + ], + ) + ], + ), + SizedBox( + height: 30, + ), + SizedBox( + height: 0.5, + width: MediaQuery.of(context).size.width, + child: Container( + color: Colors.grey, + ), + ), + ], + ), + ), + ), + floatingActionButton: H20FloatingActionButton( + // controller: _controller, + model: model, + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/h2o/week_page.dart b/lib/pages/AlHabibMedicalService/h2o/week_page.dart new file mode 100644 index 00000000..e42eb19b --- /dev/null +++ b/lib/pages/AlHabibMedicalService/h2o/week_page.dart @@ -0,0 +1,30 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart'; +import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class WeekPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getUserProgressForWeekData(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: false, + appBarTitle: "Water Tracker", + baseViewModel: model, + body: SingleChildScrollView( + padding: EdgeInsets.symmetric(vertical: 12), + child: AppBarChart(seriesList: model.userProgressForWeekDataSeries), + ), + ), + ); + } +} + + + diff --git a/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart new file mode 100644 index 00000000..7eaed1a8 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart @@ -0,0 +1,200 @@ +import 'dart:math' as math; + +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; + +import '../add_custom_amount.dart'; + +class H20FloatingActionButton extends StatefulWidget { + const H20FloatingActionButton({ + Key key, + @required AnimationController controller, + @required this.model + + }) : + super(key: key); + + final H2OViewModel model; + + @override + _H20FloatingActionButtonState createState() => _H20FloatingActionButtonState(); +} + +class _H20FloatingActionButtonState extends State with TickerProviderStateMixin { + AnimationController _controller; + @override + void initState() { + _controller = new AnimationController( + vsync: this, + duration: const Duration(milliseconds: 500), + ); + super.initState(); + } + + @override + Widget build(BuildContext context) { + + void showConfirmMessage(int amount, H2OViewModel model) { + showDialog(context: context, child: ConfirmAddAmountDialog(model: model,amount:amount,)); + } + + return Container( + margin: EdgeInsets.only(left: 20), + child: new Column(mainAxisSize: MainAxisSize.min, children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + ActionButton( + controller: _controller, + text: "600ml", + onTap: () { + showConfirmMessage(600, widget.model); + }, + ), + ActionButton( + controller: _controller, + text: "330ml", + onTap: () { + showConfirmMessage(330, widget.model); + }, + ), + ActionButton( + controller: _controller, + text: "200ml", + onTap: () { + showConfirmMessage(200, widget.model); + }, + ), + ], + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + FloatingActionButton( + heroTag: null, + child: new AnimatedBuilder( + animation: _controller, + builder: (BuildContext context, Widget child) { + return new Transform( + transform: new Matrix4.rotationZ( + _controller.value * 0.5 * math.pi), + alignment: FractionalOffset.center, + child: new Icon( + _controller.isDismissed ? Icons.add : Icons.close), + ); + }, + ), + onPressed: () { + if (_controller.isDismissed) { + _controller.forward(); + } else { + _controller.reverse(); + } + }, + ), + new Container( + alignment: FractionalOffset.topCenter, + child: new ScaleTransition( + scale: new CurvedAnimation( + parent: _controller, + curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, + curve: Curves.easeOut), + ), + child: new FloatingActionButton( + backgroundColor: Colors.white, + heroTag: null, + mini: true, + child: Text( + "Custom", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 14.0, color: Colors.grey), + ), + onPressed: () { + Navigator.push( + context, + FadePage( + page: AddCustomAmount( + model: widget.model, + ), + ), + ); + }, + ), + ), + ), + new Container( + alignment: FractionalOffset.topCenter, + child: new ScaleTransition( + scale: new CurvedAnimation( + parent: _controller, + curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, + curve: Curves.easeOut), + ), + child: new FloatingActionButton( + backgroundColor: Colors.white, + heroTag: null, + mini: true, + child: Text( + "Undo", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 14.0, color: Colors.grey), + ), + onPressed: () {}, + ), + ), + ), + ], + ), + ]), + ); + } +} + +class ActionButton extends StatelessWidget { + const ActionButton( + {Key key, + @required AnimationController controller, + @required this.text, + this.onTap}) + : _controller = controller, + super(key: key); + + final AnimationController _controller; + final String text; + final Function onTap; + + @override + Widget build(BuildContext context) { + return Container( + alignment: FractionalOffset.topCenter, + child: new ScaleTransition( + scale: new CurvedAnimation( + parent: _controller, + curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), + ), + child: new FloatingActionButton( + heroTag: null, + backgroundColor: Colors.white, + mini: true, + child: Text( + text, + textAlign: TextAlign.center, + style: TextStyle(fontSize: 14.0, color: Colors.grey), + ), + onPressed: onTap + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart b/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart new file mode 100644 index 00000000..dbb46eee --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart @@ -0,0 +1,140 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/weather/weather_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:diplomaticquarterapp/widgets/weather_slider/weather_slider.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; + +class HealthWeatherIndicator extends StatefulWidget { + @override + _HospitalsPageState createState() => _HospitalsPageState(); +} + +class _HospitalsPageState extends State { + var data; + LocationUtils locationUtils; + AppSharedPreferences sharedPref = AppSharedPreferences(); + var weather = '--'; + @override + void initState() { + locationUtils = + new LocationUtils(isShowConfirmDialog: true, context: context); + WidgetsBinding.instance + .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); + getWeather(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getWeatherData(), + allowAny: true, + builder: (_, mode, widget) => AppScaffold( + isShowDecPage: false, + appBarTitle: TranslationBase.of(context).healthWeatherIndicators, + isShowAppBar: true, + body: mode.weatherIndicatorData.length > 0 + ? SingleChildScrollView( + child: Column(children: [ + Container( + margin: EdgeInsets.all(8), + width: double.infinity, + height: 150, + decoration: BoxDecoration( + image: DecorationImage( + image: + ExactAssetImage('assets/images/Weather_img.png'), + fit: BoxFit.cover, + ), + borderRadius: BorderRadius.circular(8.0)), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 10.0), + child: Row( + children: [ + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .healthWeatherIndicators, + color: Colors.white, + fontWeight: FontWeight.w600, + ), + AppText( + TranslationBase.of(context) + .healthTipsBasedOnCurrentWeather, + color: Colors.white, + fontSize: 14, + ), + ], + )), + Expanded( + flex: 2, + child: InkWell( + onTap: () {}, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/Weather_ico.png', + width: 60, + height: 60, + ), + Directionality( + textDirection: TextDirection.ltr, + child: AppText(weather, + fontSize: 22, + color: Colors.white)) + ], + ), + ], + )), + ) + ], + ), + ), + ), + Padding( + padding: EdgeInsets.all(15), + child: AppText( + projectViewModel.isArabic + ? mode.weatherIndicatorData[0].cityNameN + : mode.weatherIndicatorData[0].cityName, + fontSize: 24, + fontWeight: FontWeight.bold, + )), + Padding( + padding: EdgeInsets.all(15), + child: Column( + children: mode.weatherIndicatorData.map((data) { + return WeatherSlider(data); + }).toList())) + ])) + : Center(child: AppCircularProgressIndicator())), + ); + } + + getWeather() async { + var data = await this.sharedPref.getObject(WEATHER); + setState(() { + weather = data['Temperature'].toString() + '\u2103' ?? '--'; + }); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart new file mode 100644 index 00000000..c84053c5 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart @@ -0,0 +1,522 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'dart:math'; + +import 'result_page.dart'; + +const activeCardColor = Color(0xff70777A); +const inactiveCardColor = Color(0xffFAFAFd); + +class BMICalculator extends StatefulWidget { + @override + _BMICalculatorState createState() => _BMICalculatorState(); +} + +class _BMICalculatorState extends State { + TextEditingController textController = new TextEditingController(); + String textResult; + String msg; + double bmiResult; + int height = 150; + int weight = 40; + Color cmCard = activeCardColor; + Color ftCard = inactiveCardColor; + Color lbCard = inactiveCardColor; + Color kgCard = activeCardColor; + void updateColor(int type) { + //MG/DLT card + if (type == 1) { + if (cmCard == inactiveCardColor) { + cmCard = activeCardColor; + ftCard = inactiveCardColor; + } else { + cmCard = inactiveCardColor; + } + } + if (type == 2) { + if (ftCard == inactiveCardColor) { + ftCard = activeCardColor; + cmCard = inactiveCardColor; + } else { + ftCard = inactiveCardColor; + } + } + } + + void updateColorWeight(int type) { + //MG/DLT card + if (type == 1) { + if (kgCard == inactiveCardColor) { + kgCard = activeCardColor; + lbCard = inactiveCardColor; + } else { + kgCard = inactiveCardColor; + } + } + if (type == 2) { + if (lbCard == inactiveCardColor) { + lbCard = activeCardColor; + kgCard = inactiveCardColor; + } else { + lbCard = inactiveCardColor; + } + } + } + + double convertToCm(double number) { + return number * 30.48; + } + + double convertToKg(double number) { + return number / 2.205; + } + + double calculateBMI() { + if (ftCard == activeCardColor) { + convertToCm(height.toDouble()); + } + bmiResult = weight / pow(height / 100, 2); + + return bmiResult; + } + + void showTextResult() { + if (bmiResult >= 30) { + textResult = 'Obese'; + } else if (bmiResult < 30 && bmiResult >= 25) { + textResult = 'OverWeight'; + } else if (bmiResult < 25 && bmiResult >= 18.5) { + textResult = 'Healthy'; + } else if (bmiResult < 18.5) { + textResult = 'UnderWeight'; + } + } + + void showMsg() { + if (bmiResult >= 30) { + msg = + 'A BMI of over 30 indicates that are heavily overweight. Health may be at risk if not lose weight. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get started.'; + } else if (bmiResult < 30 && bmiResult >= 25) { + msg = + 'A BMI of 25 - 30 indicates that are slightly overweight. May be advised to lose some weight for health reasons. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get '; + } else if (bmiResult < 25 && bmiResult >= 18.5) { + msg = + 'A BMI of 18.5 - 25 indicates that are at a healthy weight for the height. By maintaining a healthy weight, lower the risk of developing severe health problems. To book an appointment, click below to get started.'; + } else if (bmiResult < 18.5) { + msg = + 'A BMI of less than 18.5 indicates that are underweight, so may need to put on some weight. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get started.'; + } + } + + @override + void initState() { + super.initState(); + textController.text = '0'; // Setting the initial value for the field. + } + + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'BMI Calculator', + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: Container( + width: 350.0, + child: Padding( + padding: EdgeInsets.symmetric(vertical: 15.0), + child: Text( + 'Calculate the BMI value and weight\n status to identify the healthy weight .\n Not appropriate for children and women\n who are pregnant or breastfeeding', + style: TextStyle(fontSize: 18.0), + ), + ), + ), + ), + Container( + height: 200.0, + width: 350.0, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12.0), + ), + child: Column( + children: [ + Row( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Texts('Height'), + ), + ], + ), + Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(height.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (height < 250) height++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (height > 120) height--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Slider( + value: height.toDouble(), + min: 120, + max: 250, + onChanged: (double newValue) { + setState(() { + height = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ], + ), + Row( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Texts('Select Unit'), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColor(1); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + color: cmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColor(2); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: ftCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('FT')), + ), + ), + ), + ], + ), + ], + ), + ), + SizedBox( + height: 25.0, + ), + Container( + height: 200.0, + width: 350.0, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12.0), + ), + child: Column( + children: [ + Row( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Texts('Weight'), + ), + ], + ), + Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(weight.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight < 250) weight++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight > 40) weight--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Slider( + value: weight.toDouble(), + min: 40, + max: 250, + onChanged: (double newValue) { + setState(() { + weight = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ], + ), + Row( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Texts('Select Unit'), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(1); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + color: kgCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('KG')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(2); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: lbCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('LB')), + ), + ), + ), + ], + ), + ], + ), + ), + SizedBox( + height: 25.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + calculateBMI(); + showTextResult(); + showMsg(); + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ResultPage( + finalResult: bmiResult, + textResult: textResult, + msg: msg, + )), + ); + } + }); + }, + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart new file mode 100644 index 00000000..bfbd10b7 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart @@ -0,0 +1,101 @@ +import 'dart:ffi'; + +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:percent_indicator/percent_indicator.dart'; + +class ResultPage extends StatelessWidget { + final double finalResult; + final String textResult; + final String msg; + + ResultPage({this.finalResult, this.textResult, this.msg}); + Color inductorColor; + double percent; + + Color colorInductor() { + if (finalResult >= 30) { + inductorColor = Color(0xffC70D00); + } else if (finalResult < 30 && finalResult >= 25) { + inductorColor = Color(0xffC25400); + } else if (finalResult < 25 && finalResult >= 18.5) { + inductorColor = Color(0xff36D600); + } else if (finalResult < 18.5) { + inductorColor = Color(0xff1BE0EE); + } + return inductorColor; + } + + double percentInductor() { + if (finalResult >= 30) { + percent = 1.0; + } else if (finalResult < 30 && finalResult >= 25) { + percent = 0.73; + } else if (finalResult < 25 && finalResult >= 18.5) { + percent = 0.5; + } else if (finalResult < 18.5) { + percent = 0.25; + } + return percent; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: "BMI Calculator", + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + SizedBox( + // height: 40.0, + ), + Center( + child: CircularPercentIndicator( + radius: 220.0, + lineWidth: 20.0, + percent: percentInductor(), + center: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + finalResult.toStringAsFixed(1), + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + height: 5.0, + ), + Text( + textResult, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + progressColor: colorInductor(), + backgroundColor: Colors.white, + ), + ), + Container( + height: 120, + width: 280.0, + child: Texts(msg), + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart new file mode 100644 index 00000000..1af0f949 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart @@ -0,0 +1,722 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; + +import 'bmr_result_page.dart'; + +const activeCardColorGender = Color(0xffC5272D); +const inactiveCardColorGender = Color(0xffFAFAFd); +const activeCardColor = Color(0xff70777A); +const inactiveCardColor = Color(0xffFAFAFd); + +class BmrCalculator extends StatefulWidget { + @override + _BmrCalculatorState createState() => _BmrCalculatorState(); +} + +class _BmrCalculatorState extends State { + bool isMale = false; + bool isHeightCm = true; + Color maleCard = activeCardColorGender; + Color femaleCard = inactiveCardColorGender; + Color kgCard = activeCardColor; + Color lbCard = inactiveCardColor; + Color cmCard = activeCardColor; + Color ftCard = inactiveCardColor; + int age = 0; + int height = 0; + int weight = 0; + double bmrResult = 0; + String dropdownValue = 'Lighty Active (1-3) days per week'; + double calories = 0; + + void updateColor(int type) { + //MG/DLT card + if (type == 1) { + if (maleCard == inactiveCardColorGender) { + maleCard = activeCardColorGender; + femaleCard = inactiveCardColorGender; + } else { + maleCard = inactiveCardColorGender; + } + } + if (type == 2) { + if (femaleCard == inactiveCardColorGender) { + femaleCard = activeCardColorGender; + maleCard = inactiveCardColorGender; + } else { + femaleCard = inactiveCardColorGender; + } + } + } + + void updateColorHeight(int type) { + //MG/DLT card + if (type == 1) { + if (cmCard == inactiveCardColor) { + cmCard = activeCardColor; + ftCard = inactiveCardColor; + } else { + cmCard = inactiveCardColor; + } + } + if (type == 2) { + if (ftCard == inactiveCardColor) { + ftCard = activeCardColor; + cmCard = inactiveCardColor; + } else { + ftCard = inactiveCardColor; + } + } + } + + void updateColorWeight(int type) { + //MG/DLT card + if (type == 1) { + if (kgCard == inactiveCardColor) { + kgCard = activeCardColor; + lbCard = inactiveCardColor; + } else { + kgCard = inactiveCardColor; + } + } + if (type == 2) { + if (lbCard == inactiveCardColor) { + lbCard = activeCardColor; + kgCard = inactiveCardColor; + } else { + lbCard = inactiveCardColor; + } + } + } + + void calculateBmr() { + if (isMale == true) { + bmrResult = 66.5 + (13.75 * weight) + (5.003 * height) - (6.755 * age); + } else if (isMale == false) { + bmrResult = + 655.0955 + (9.5634 * weight) + (1.850 * height) - (4.676 * age); + } + + bmrResult = bmrResult.roundToDouble(); + } + + void calculateCalories() { + if (dropdownValue == "Almost Inactive(Little or no exercises)") { + calories = bmrResult * 1.2; + } else if (dropdownValue == "Lighty Active (1-3) days per week") { + calories = bmrResult * 1.375; + } else if (dropdownValue == "very Active(6-7) days per week") { + calories = bmrResult * 1.55; + } else if (dropdownValue == "Super Active(very hard exercises)") { + calories = bmrResult * 1.725; + } else if (dropdownValue == "") { + calories = bmrResult * 10.725; + } + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Bmr Calculator', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), + child: SingleChildScrollView( + child: Container( + height: 850, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(10.0), + child: Texts( + 'Calculates the amount of energy that the person’s body expends in a day'), + ), + Divider( + thickness: 2.0, + ), + SizedBox( + height: 5.0, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Gender'), + SizedBox( + height: 5.0, + ), + Container( + width: 350, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(35.0), + color: Colors.white, + border: Border.all( + color: Colors.black45, + )), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColor(1); + isMale = false; + }); + }, + child: Container( + height: 55.0, + width: 170.0, + decoration: BoxDecoration( + color: maleCard, + borderRadius: BorderRadius.circular(35.0), + ), + child: Center(child: Texts('FEMALE')), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColor(2); + isMale = true; + }); + }, + child: Container( + height: 55.0, + width: 170.0, + decoration: BoxDecoration( + color: femaleCard, + borderRadius: BorderRadius.circular(35.0), + ), + child: Center(child: Texts('MALE')), + ), + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Texts( + 'The Age ( 11 - 120 ) yrs', + ), + SizedBox( + height: 10.0, + ), + Row( + children: [ + Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(age.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (age < 120) age++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (age > 0) age--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: age.toDouble(), + min: 0, + max: 120, + onChanged: (double newValue) { + setState(() { + age = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts( + 'Height', + ), + Row( + children: [ + Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(height.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (height < 250) + height++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (height > 0) height--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: height.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + height = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(1); + isHeightCm = true; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: cmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(2); + isHeightCm = false; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: ftCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 5.0, + ), + Texts( + 'Weight', + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(weight.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight < 250) + weight++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight > 0) weight--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: weight.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + weight = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(1); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: kgCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('KG')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(2); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: lbCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('LB')), + ), + ), + ), + ], + ), + SizedBox( + height: 45.0, + ), + Divider( + thickness: 2.0, + ), + SizedBox( + height: 5.0, + ), + Texts('Activity level'), + Container( + width: 300, + child: DropdownButton( + value: dropdownValue, + icon: Icon(Icons.arrow_downward), + iconSize: 24, + elevation: 16, + style: TextStyle(color: Colors.black87), + underline: Container( + height: 2, + color: Colors.black54, + ), + onChanged: (String newValue) { + setState(() { + dropdownValue = newValue; + }); + }, + items: [ + 'Almost Inactive(Little or no exercises)', + 'Lighty Active (1-3) days per week', + 'very Active(6-7) days per week', + 'Super Active(very hard exercises)' + ].map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), + ), + ), + SizedBox( + height: 30.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + calculateBmr(); + calculateCalories(); + + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => BmrResultPage( + bmrResult: bmrResult, + calories: calories, + )), + ); + } + }); + }, + ), + ), + ], + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.dart new file mode 100644 index 00000000..a3fdb5f7 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.dart @@ -0,0 +1,65 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:percent_indicator/circular_percent_indicator.dart'; + +class BmrResultPage extends StatelessWidget { + final double bmrResult; + final double calories; + BmrResultPage({this.bmrResult, this.calories}); + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'BMR Calculator', + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Center( + child: CircularPercentIndicator( + radius: 220.0, + lineWidth: 20.0, + percent: ((this.bmrResult > 3500) ? 100 : this.bmrResult / 3500), + center: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + bmrResult.toStringAsFixed(1), + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + height: 5.0, + ), + Text( + 'Calories/Day', + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + progressColor: Color(0xff3C3939), + ), + ), + Container( + height: 120, + width: 280.0, + child: Texts( + 'This means the body will burn ( ${bmrResult.toStringAsFixed(1)} ) calories each day, if engaged in no activity for the entire day.. Note: Daily calorie requirement is ( ${calories.toStringAsFixed(1)} ) calories, to maintain the current weight.'), + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart new file mode 100644 index 00000000..91847e37 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart @@ -0,0 +1,1017 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; + +import 'body_fat_result_page.dart'; + +const activeCardColorGender = Color(0xffC5272D); +const inactiveCardColorGender = Color(0xffFAFAFd); +const activeCardColor = Color(0xff70777A); +const inactiveCardColor = Color(0xffFAFAFd); + +class BodyFat extends StatefulWidget { + @override + _BodyFatState createState() => _BodyFatState(); +} + +class _BodyFatState extends State { + bool isMale = false; + bool isHeightCm = true; + Color maleCard = activeCardColorGender; + Color femaleCard = inactiveCardColorGender; + Color neckCmCard = activeCardColor; + Color neckFtCard = inactiveCardColor; + Color waistCmCard = activeCardColor; + Color waistFtCard = inactiveCardColor; + Color hipCmCard = activeCardColor; + Color hipFtCard = inactiveCardColor; + Color cmCard = activeCardColor; + Color ftCard = inactiveCardColor; + int neck = 10; + int heightCm = 0; + int heightFt = 0; + int hip = 5; + double heightInches; + double minRange; + double maxRange; + double overWeightBy; + int waist = 5; + double bodyFat = 0; + double fat = 0; + String dropdownValue; + double calories = 0; + String textResult = ''; + + void updateColorHeight(int type) { + //MG/DLT card + if (type == 1) { + if (cmCard == inactiveCardColor) { + cmCard = activeCardColor; + ftCard = inactiveCardColor; + } else { + cmCard = inactiveCardColor; + } + } + if (type == 2) { + if (ftCard == inactiveCardColor) { + ftCard = activeCardColor; + cmCard = inactiveCardColor; + } else { + ftCard = inactiveCardColor; + } + } + } + + void updateColorNeck(int type) { + //MG/DLT card + if (type == 1) { + if (neckCmCard == inactiveCardColor) { + neckCmCard = activeCardColor; + neckFtCard = inactiveCardColor; + } else { + neckCmCard = inactiveCardColor; + } + } + if (type == 2) { + if (neckFtCard == inactiveCardColor) { + neckFtCard = activeCardColor; + neckCmCard = inactiveCardColor; + } else { + neckFtCard = inactiveCardColor; + } + } + } + + void updateColorWaist(int type) { + //MG/DLT card + if (type == 1) { + if (waistCmCard == inactiveCardColor) { + waistCmCard = activeCardColor; + waistFtCard = inactiveCardColor; + } else { + waistCmCard = inactiveCardColor; + } + } + if (type == 2) { + if (waistFtCard == inactiveCardColor) { + waistFtCard = activeCardColor; + waistCmCard = inactiveCardColor; + } else { + waistFtCard = inactiveCardColor; + } + } + } + + void updateColorHip(int type) { + //MG/DLT card + if (type == 1) { + if (hipCmCard == inactiveCardColor) { + hipCmCard = activeCardColor; + hipFtCard = inactiveCardColor; + } else { + hipCmCard = inactiveCardColor; + } + } + if (type == 2) { + if (hipFtCard == inactiveCardColor) { + hipFtCard = activeCardColor; + hipCmCard = inactiveCardColor; + } else { + hipFtCard = inactiveCardColor; + } + } + } + + void updateColor(int type) { + //MG/DLT card + if (type == 1) { + if (maleCard == inactiveCardColorGender) { + maleCard = activeCardColorGender; + femaleCard = inactiveCardColorGender; + } else { + maleCard = inactiveCardColorGender; + } + } + if (type == 2) { + if (femaleCard == inactiveCardColorGender) { + femaleCard = activeCardColorGender; + maleCard = inactiveCardColorGender; + } else { + femaleCard = inactiveCardColorGender; + } + } + } + + void calculateBodyFat() { + if (isMale == true) { + bodyFat = 495 / + (1.0324 - + 0.19077 * (log(waist - neck) / ln10) + + 0.15456 * (log(heightCm) / ln10)) - + 450; + fat = (bodyFat * 10) / 10.round(); + } else if (isMale == false) { + bodyFat = 495 / + (1.29579 - + 0.35004 * (log(waist + hip - neck) / ln10) + + 0.22100 * (log(heightCm) / ln10)) - + 450; + fat = (bodyFat * 10) / 10.round(); + } + if (fat <= 0) { + fat = 0; + } + } + + void showTextResult() { + if (isMale == false) { + if (bodyFat > 9 && bodyFat <= 13) { + textResult = 'The category falls under essential'; + } else if (bodyFat > 13 && bodyFat <= 20) { + textResult = 'The category falls under athlete'; + } else if (bodyFat > 20 && bodyFat <= 24) { + textResult = 'The category falls under fitness'; + } else if (bodyFat > 24 && bodyFat <= 31) { + textResult = 'The category falls under acceptable'; + } else if (bodyFat > 31 && bodyFat <= 60) { + textResult = 'The category falls under obese'; + } else if (bodyFat > 60) { + textResult = + 'Please check the value you have entered, since the body fat percentage has crosed the limits.'; + } else if (bodyFat <= 9) { + textResult = + 'Please check the value you have entered, since the body fat percentage cannot be this low.'; + } + } else { + if (bodyFat > 5 && fat <= 13) { + textResult = 'The category falls under essential'; + } else if (bodyFat > 13 && bodyFat <= 17) { + textResult = 'The category falls under athlete'; + } else if (bodyFat > 17 && bodyFat <= 24) { + textResult = 'The category falls under fitness'; + } else if (bodyFat > 24 && bodyFat <= 45) { + textResult = 'The category falls under obese'; + } else if (bodyFat > 45) { + textResult = + 'Please check the value you have entered, since the body fat percentage has crosed the limits.'; + } else if (bodyFat <= 5) { + textResult = + 'Please check the value you have entered, since the body fat percentage cannot be this low.'; + } + } + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Body Fat', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), + child: SingleChildScrollView( + child: Container( + height: 1000.0, + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(10.0), + child: + Texts('Estimates the total body fat based on\n the size'), + ), + Divider( + thickness: 2.0, + ), + SizedBox( + height: 5.0, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Gender'), + SizedBox( + height: 5.0, + ), + Container( + width: 350, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(35.0), + color: Colors.white, + border: Border.all( + color: Colors.black45, + )), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColor(1); + isMale = false; + }); + }, + child: Container( + height: 55.0, + width: 170.0, + decoration: BoxDecoration( + color: maleCard, + borderRadius: BorderRadius.circular(35.0), + ), + child: Center(child: Texts('FEMALE')), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColor(2); + isMale = true; + }); + }, + child: Container( + height: 55.0, + width: 170.0, + decoration: BoxDecoration( + color: femaleCard, + borderRadius: BorderRadius.circular(35.0), + ), + child: Center(child: Texts('MALE')), + ), + ), + ], + ), + ), + Texts( + 'Height', + ), + Row( + children: [ + Expanded( + child: Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: + BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(heightCm.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (heightCm < 250) + heightCm++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (heightCm > 0) + heightCm--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: heightCm.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + heightCm = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(1); + isHeightCm = true; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: cmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(2); + isHeightCm = false; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: ftCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 10.0, + ), + Texts( + 'Neck', + ), + Row( + children: [ + Expanded( + child: Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: + BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(neck.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (neck < 60) neck++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (neck > 5) neck--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: neck.toDouble(), + min: 5, + max: 60, + onChanged: (double newValue) { + setState(() { + neck = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorNeck(1); + isHeightCm = true; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: neckCmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorNeck(2); + isHeightCm = false; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: neckFtCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 10.0, + ), + Texts( + 'Waist', + ), + Row( + children: [ + Expanded( + child: Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: + BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(waist.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (waist < 200) + waist++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (waist > 5) waist--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: waist.toDouble(), + min: 5, + max: 200, + onChanged: (double newValue) { + setState(() { + waist = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorWaist(1); + isHeightCm = true; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: waistCmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorWaist(2); + isHeightCm = false; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: waistFtCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 10.0, + ), + Texts( + 'Hip', + ), + Row( + children: [ + Expanded( + child: Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: + BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(hip.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (hip < 140) hip++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (hip > 5) hip--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: hip.toDouble(), + min: 5, + max: 140, + onChanged: (double newValue) { + setState(() { + hip = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorHip(1); + isHeightCm = true; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: hipCmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorHip(2); + isHeightCm = false; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: hipFtCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 35.0, + ), + ], + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + calculateBodyFat(); + showTextResult(); + + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => FatResult( + bodyFat: bodyFat, + fat: fat, + textResult: textResult, + )), + ); + } + }); + }, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart new file mode 100644 index 00000000..c8c5476e --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart @@ -0,0 +1,77 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:percent_indicator/circular_percent_indicator.dart'; + +class FatResult extends StatelessWidget { + final double bodyFat; + final double fat; + final String textResult; + + FatResult({this.bodyFat, this.fat, this.textResult = ''}); + Color inductorColor; + Color colorInductor() { + if (bodyFat >= 17) { + inductorColor = Color(0xffC70D00); + } else if (bodyFat < 20 && bodyFat >= 24) { + inductorColor = Color(0xffC25400); + } else if (bodyFat < 24 && bodyFat >= 31) { + inductorColor = Color(0xff36D600); + } else if (bodyFat > 45) { + inductorColor = Color(0xff1BE0EE); + } + return inductorColor; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Body Fat', + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + SizedBox( + // height: 40.0, + ), + Center( + child: CircularPercentIndicator( + radius: 220.0, + lineWidth: 20.0, + percent: ((fat > 70) ? 100 : fat / 100), + center: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + fat.toStringAsFixed(1) + '%', + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + height: 5.0, + ), + ], + ), + progressColor: inductorColor, + backgroundColor: Colors.white, + ), + ), + Container( + height: 120, + width: 280.0, + child: Texts(textResult), + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart new file mode 100644 index 00000000..4361425a --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart @@ -0,0 +1,677 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +import 'calorie_result_page.dart'; + +const activeCardColorGender = Color(0xffC5272D); +const inactiveCardColorGender = Color(0xffFAFAFd); +const activeCardColor = Color(0xff70777A); +const inactiveCardColor = Color(0xffFAFAFd); + +class CalorieCalculator extends StatefulWidget { + @override + _CalorieCalculatorState createState() => _CalorieCalculatorState(); +} + +class _CalorieCalculatorState extends State { + bool isMale = false; + Color maleCard = activeCardColorGender; + Color femaleCard = inactiveCardColorGender; + Color kgCard = activeCardColor; + Color lbCard = inactiveCardColor; + Color cmCard = activeCardColor; + Color ftCard = inactiveCardColor; + int age = 0; + int height = 0; + int weight = 0; + double calories; + String dropdownValue; + void updateColor(int type) { + //MG/DLT card + if (type == 1) { + if (maleCard == inactiveCardColorGender) { + maleCard = activeCardColorGender; + femaleCard = inactiveCardColorGender; + } else { + maleCard = inactiveCardColorGender; + } + } + if (type == 2) { + if (femaleCard == inactiveCardColorGender) { + femaleCard = activeCardColorGender; + maleCard = inactiveCardColorGender; + } else { + femaleCard = inactiveCardColorGender; + } + } + } + + void updateColorWeight(int type) { + //MG/DLT card + if (type == 1) { + if (kgCard == inactiveCardColor) { + kgCard = activeCardColor; + lbCard = inactiveCardColor; + } else { + kgCard = inactiveCardColor; + } + } + if (type == 2) { + if (lbCard == inactiveCardColor) { + lbCard = activeCardColor; + kgCard = inactiveCardColor; + } else { + lbCard = inactiveCardColor; + } + } + } + + void updateColorHeight(int type) { + //MG/DLT card + if (type == 1) { + if (cmCard == inactiveCardColor) { + cmCard = activeCardColor; + ftCard = inactiveCardColor; + } else { + cmCard = inactiveCardColor; + } + } + if (type == 2) { + if (ftCard == inactiveCardColor) { + ftCard = activeCardColor; + cmCard = inactiveCardColor; + } else { + ftCard = inactiveCardColor; + } + } + } + + void calculateCalories() { + if (isMale == true) { + calories = 66.5 + (13.75 * weight) + (5.003 * height) - (6.755 * age); + } else if (isMale == false) { + calories = + 655.0955 + (9.5634 * weight) + (1.850 * height) - (4.676 * age); + } + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Calorie Calculator', + body: Padding( + padding: const EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), + child: SingleChildScrollView( + child: Container( + height: 890.0, + child: Column( + //mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(10.0), + child: Texts( + 'Calculates daily calorie intake based on several factors, like height, weight, age, gender and daily physical activity rate', + ), + ), + Padding( + padding: + EdgeInsets.symmetric(horizontal: 10.0, vertical: 15.0), + child: Texts('Gender'), + ), + Container( + width: 350, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(35.0), + color: Colors.white, + border: Border.all( + color: Colors.black45, + )), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColor(1); + isMale = false; + }); + }, + child: Container( + height: 55.0, + width: 170.0, + decoration: BoxDecoration( + color: maleCard, + borderRadius: BorderRadius.circular(35.0), + ), + child: Center(child: Texts('FEMALE')), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColor(2); + isMale = true; + }); + }, + child: Container( + height: 55.0, + width: 170.0, + decoration: BoxDecoration( + color: femaleCard, + borderRadius: BorderRadius.circular(35.0), + ), + child: Center(child: Texts('MALE')), + ), + ), + ], + ), + ), + SizedBox( + height: 15.0, + ), + Texts( + 'The Age ( 11 - 120 ) yrs', + ), + SizedBox( + height: 10.0, + ), + Row( + children: [ + Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(age.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (age < 120) age++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (age > 0) age--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: age.toDouble(), + min: 0, + max: 120, + onChanged: (double newValue) { + setState(() { + age = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts( + 'Height', + ), + Row( + children: [ + Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(height.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (height < 250) height++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (height > 0) height--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: height.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + height = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(1); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + color: cmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(2); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: ftCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 5.0, + ), + Texts( + 'Weight', + ), + Row( + children: [ + Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(weight.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight < 250) weight++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight > 0) weight--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: weight.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + weight = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(1); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + color: kgCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('KG')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(2); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: lbCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('LB')), + ), + ), + ), + ], + ), + SizedBox( + height: 5.0, + ), + Texts('Activity level'), + Container( + width: 300, + child: DropdownButton( + value: dropdownValue, + icon: Icon(Icons.arrow_downward), + iconSize: 24, + elevation: 16, + style: TextStyle(color: Colors.black87), + underline: Container( + height: 2, + color: Colors.black54, + ), + onChanged: (String newValue) { + setState(() { + dropdownValue = newValue; + }); + }, + items: [ + 'Almost Inactive(Little or no exercises)', + 'Lighty Active (1-3) days per week', + 'very Active(6-7) days per week', + 'Super Active(very hard exercises)' + ].map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), + ), + ), + SizedBox( + height: 25.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + calculateCalories(); + print(calories); + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CalorieResultPage( + calorie: calories, + )), + ); + } + }); + }, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart new file mode 100644 index 00000000..5c52ecb0 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart @@ -0,0 +1,59 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:percent_indicator/circular_percent_indicator.dart'; + +class CalorieResultPage extends StatelessWidget { + final double calorie; + + CalorieResultPage({this.calorie}); + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: 'Calorie Calculator', + isShowAppBar: true, + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Center( + child: CircularPercentIndicator( + radius: 220.0, + lineWidth: 20.0, + percent: ((this.calorie > 3500) ? 100 : this.calorie / 3500), + center: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + calorie.toStringAsFixed(1), + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + height: 5.0, + ), + Texts('Calories'), + ], + ), + progressColor: Color(0xff3C3939), + backgroundColor: Colors.white, + ), + ), + Container( + child: + Texts('Daily intake is ${calorie.toStringAsFixed(1)} calories'), + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart new file mode 100644 index 00000000..e273b075 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart @@ -0,0 +1,367 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; +import 'package:flutter/services.dart'; + +import 'carbs_result_page.dart'; + +class Carbs extends StatefulWidget { + @override + _CarbsState createState() => _CarbsState(); +} + +class _CarbsState extends State { + TextEditingController textController = new TextEditingController(); + int calories; + String dropdownValue; + bool _visible = false; + int meals; + int protein; + int carbs; + + int fat; + double pCal; + double cCal; + double fCal; + double pCalGram; + double cCalGram; + double fCalGram; + double pCalMeal; + double cCalMeal; + double fCalMeal; + + void calculateDietRatios() { + if (dropdownValue == 'Very Low Carb') { + meals = 3; + protein = 45; + carbs = 10; + fat = 45; + } else if (dropdownValue == 'Low Carb') { + meals = 3; + protein = 40; + carbs = 30; + fat = 30; + } else if (dropdownValue == 'Moderate Carb') { + meals = 3; + protein = 25; + carbs = 50; + fat = 25; + } else if (dropdownValue == 'USDA Gudilines') { + meals = 3; + protein = 15; + carbs = 55; + fat = 30; + } else if (dropdownValue == 'Zone Diet') { + meals = 3; + protein = 30; + carbs = 40; + fat = 30; + } + } + + void calculate() { + pCal = (protein / 100.0) * int.parse(textController.text).ceil(); + cCal = (carbs / 100.0) * int.parse(textController.text); + ; + fCal = (fat / 100) * int.parse(textController.text); + ; + pCalGram = pCal / 4.0; + cCalGram = cCal / 4.0; + fCalGram = fCal / 9.0; + pCalMeal = pCalGram / meals.ceil(); + cCalMeal = cCalGram / meals.ceil(); + fCalMeal = fCalGram / meals.ceil(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Carb Protein Fat', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), + child: SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Calculates carbohydrate protein and fat\n ratio in calories and grams according to a\n pre-set ratio', + ), + SizedBox( + height: 15.0, + ), + Column( + children: [ + Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 300.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: TextFormField( + controller: textController, + inputFormatters: [ + FilteringTextInputFormatter + .digitsOnly + ], + keyboardType: TextInputType.number, + decoration: InputDecoration( + hintText: " The Calories per day ", + labelStyle: TextStyle( + color: Colors.black87, + ), + ), + ), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + int currentValue = int.parse( + textController.text); + currentValue++; + textController.text = + (currentValue).toString(); + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + int currentValue = int.parse( + textController.text); + currentValue--; + textController.text = + (currentValue).toString(); + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + SizedBox( + height: 20.0, + ), + Button( + backgroundColor: Color(0xffC5272D), + label: 'NOT SURE? CLICK HERE ', + onTap: () { + setState(() { + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CalorieCalculator()), + ); + } + }); + }, + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Select Diet Type'), + Container( + width: 400, + child: DropdownButton( + value: dropdownValue, + icon: Icon(Icons.arrow_downward), + iconSize: 24, + elevation: 16, + style: TextStyle(color: Colors.black87), + underline: Container( + height: 2, + color: Colors.black54, + ), + onChanged: (String newValue) { + setState(() { + dropdownValue = newValue; + calculateDietRatios(); + + dropdownValue == null + ? _visible = false + : _visible = true; + }); + }, + items: [ + 'Very Low Carb', + 'Low Carb', + 'Moderate Carb', + 'USDA Gudilines', + 'Zone Diet', + ].map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), + ), + ), + Visibility( + visible: _visible, + child: Container( + height: 170.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Texts( + 'Ratios are divided according to the selected diet'), + RichText( + text: TextSpan( + style: TextStyle(color: Colors.black), + children: [ + TextSpan(text: 'Meals Per Day '), + TextSpan( + text: '$meals', + style: TextStyle(color: Color(0xffC5272D)), + ), + ], + ), + ), + RichText( + text: TextSpan( + style: TextStyle(color: Colors.black), + children: [ + TextSpan( + text: 'Protein ', + ), + TextSpan( + text: '$protein%', + style: TextStyle(color: Color(0xffC5272D)), + ) + ], + ), + ), + RichText( + text: TextSpan( + style: TextStyle(color: Colors.black), + children: [ + TextSpan( + text: 'Carbohydrate ', + ), + TextSpan( + text: '$carbs%', + style: TextStyle(color: Color(0xffC5272D)), + ) + ], + ), + ), + RichText( + text: TextSpan( + style: TextStyle(color: Colors.black), + children: [ + TextSpan( + text: 'Fat ', + ), + TextSpan( + text: '$fat%', + style: TextStyle(color: Color(0xffC5272D)), + ) + ], + ), + ), + ], + ), + ), + ) + ], + ), + SizedBox( + height: 55.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + { + calculate(); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CarbsResult( + cCal: cCal, + pCal: pCal, + fCal: fCal, + pCalGram: pCalGram, + pCalMeal: pCalMeal, + fCalGram: fCalGram, + fCalMeal: fCalMeal, + cCalGram: cCalGram, + cCalMeal: cCalMeal, + )), + ); + } + }); + }, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart new file mode 100644 index 00000000..f8d0815a --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart @@ -0,0 +1,175 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; + +import 'package:flutter/painting.dart'; + +class CarbsResult extends StatelessWidget { + double pCal; + double cCal; + double fCal; + double pCalGram; + double cCalGram; + double fCalGram; + double pCalMeal; + double cCalMeal; + double fCalMeal; + + CarbsResult( + {this.pCal, + this.cCal, + this.fCal, + this.pCalGram, + this.cCalGram, + this.fCalGram, + this.fCalMeal, + this.cCalMeal, + this.pCalMeal}); + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Carb Protein Fat', + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: EdgeInsets.symmetric(vertical: 30.0, horizontal: 10.0), + child: Table( + border: TableBorder( + verticalInside: BorderSide(width: 1, color: Colors.black54), + bottom: BorderSide(width: 1, color: Colors.black54), + left: BorderSide(width: 1, color: Colors.black54), + right: BorderSide(width: 1, color: Colors.black54), + top: BorderSide(width: 1, color: Colors.black54), + ), + children: [ + TableRow( + decoration: BoxDecoration( + color: Colors.white, + ), + children: [ + TableCell( + child: Center( + child: Texts('Description'), + ), + ), + TableCell( + child: Center( + child: Texts('Protein'), + ), + ), + TableCell( + child: Center( + child: Texts( + 'Carbohydrate', + ), + ), + ), + TableCell( + child: Center( + child: Texts('Fat'), + ), + ), + ]), + TableRow(children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: TableCell( + child: Center( + child: Texts('Calories\n Per Day'), + ), + ), + ), + TableCell( + child: Center( + child: Texts(pCal.ceil().toString() + ' Cals'), + ), + ), + TableCell( + child: Center( + child: Texts(cCal.ceil().toString() + ' Cals'), + ), + ), + TableCell( + child: Center( + child: Texts(fCal.ceil().toString() + ' Cals'), + ), + ), + ]), + TableRow(children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: TableCell( + child: Center( + child: Texts('Grams Per\n Day'), + ), + ), + ), + TableCell( + child: Center( + child: Texts(pCalGram.ceil().toString() + ' gr'), + ), + ), + TableCell( + child: Center( + child: Texts(cCalGram.ceil().toString() + ' gr'), + ), + ), + TableCell( + child: Center( + child: Texts(fCalGram.ceil().toString() + ' gr'), + ), + ), + ]), + TableRow(children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: TableCell( + child: Center( + child: Texts('Grams Per\n Meal'), + ), + ), + ), + TableCell( + child: Center( + child: Texts(pCalMeal.ceil().toString() + ' gr'), + ), + ), + TableCell( + child: Center( + child: Texts(cCalMeal.ceil().toString() + ' gr'), + ), + ), + TableCell( + child: Center( + child: Texts(fCalMeal.ceil().toString() + ' gr'), + ), + ), + ]), + ], + ), + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + + // Texts(pCal.ceil().toString()), + // Texts(cCal.ceil().toString()), + // Texts(fCal.ceil().toString()), + // Texts(pCalGram.ceil().toString()), + // Texts(cCalGram.ceil().toString()), + // Texts(fCalGram.ceil().toString()), + // Texts(pCalMeal.ceil().toString()), + // Texts(cCalMeal.ceil().toString()), + // Texts(fCalMeal.ceil().toString()), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart new file mode 100644 index 00000000..c9993b95 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart @@ -0,0 +1,146 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:intl/intl.dart'; + +import 'delivery_due_result_page.dart'; + +class DeliveryDue extends StatefulWidget { + @override + _DeliveryDueState createState() => _DeliveryDueState(); +} + +class _DeliveryDueState extends State { + DateTime bloodSugarDate = DateTime.now(); + DateTime timeSugarDate = DateTime.now(); + var dateFrom = DateTime.now(); + var dateTo = DateTime.now(); + var conceivedDate = DateTime.now(); + var deliveryDue = DateTime.now(); + var firstTrimester = DateTime.now(); + var secondTrimester = DateTime.now(); + var thirdTrimester = DateTime.now(); + var dt = DateTime.now(); + var newFormat = DateFormat("yy-MM-dd"); + + String getDate() { + return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}"; + } + + String getTime() { + return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Delivery Due Date', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 35.0, vertical: 20.0), + child: SingleChildScrollView( + child: Container( + child: Column( + //mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Texts( + 'Congratulations, you are pregnant! Now when will the new baby arrive? To estimate the due date, enter the date when the last menstrual perios began (the first day), then click calculate.', + ), + Divider( + //height: 2, + thickness: 2, + ), + Column( + children: [ + Texts( + 'What was the date of the first day of the last period?', + ), + InkWell( + onTap: () { + DatePicker.showDatePicker( + context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now(), + onConfirm: (date) { + print('confirm $date'); + setState(() { + bloodSugarDate == date + ? null + : bloodSugarDate = DateTime.now(); + dateFrom = date.add(Duration(days: 10)); + + dateTo = date.add(Duration(days: 20)); + conceivedDate = date.add(Duration(days: 14)); + deliveryDue = date.add(Duration(days: 280)); + firstTrimester = date.add(Duration(days: 85)); + secondTrimester = date.add(Duration(days: 190)); + thirdTrimester = date.add(Duration(days: 280)); + }); + }, + currentTime: DateTime.now(), + ); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Icon(Icons.date_range), + Texts('Date'), + ], + ), + Texts(getDate()), + ], + ), + ), + ), + ], + ), + SizedBox( + height: 280.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => DeliveryDueResult( + conceivedDate: conceivedDate, + dateFrom: dateFrom, + dateTo: dateTo, + deliveryDue: deliveryDue, + firstTrimester: firstTrimester, + secondTrimester: secondTrimester, + thirdTrimester: thirdTrimester, + )), + ); + } + }); + }, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due_result_page.dart new file mode 100644 index 00000000..fc53b044 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due_result_page.dart @@ -0,0 +1,106 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; + +class DeliveryDueResult extends StatelessWidget { + var dateFrom; + var dateTo; + var conceivedDate; + var deliveryDue; + var firstTrimester; + var secondTrimester; + var thirdTrimester; + DeliveryDueResult( + {this.dateFrom, + this.dateTo, + this.conceivedDate, + this.deliveryDue, + this.firstTrimester, + this.secondTrimester, + this.thirdTrimester}); + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Delivery Due Date', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 12.0), + child: SingleChildScrollView( + child: Container( + height: 750.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Texts( + 'The next ovulation period is estimated to be:', + fontWeight: FontWeight.w400, + ), + Texts( + 'From:', + fontWeight: FontWeight.w400, + ), + Texts(DateFormat.yMMMEd().format(dateFrom), + fontWeight: FontWeight.w800, + fontSize: 21.0, + color: Color(0xffC5272D)), + Texts( + 'To:', + fontWeight: FontWeight.w400, + ), + Texts(DateFormat.yMMMEd().format(dateTo), + fontWeight: FontWeight.w800, + fontSize: 21.0, + color: Color(0xffC5272D)), + Texts( + 'You have conceived on:', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(conceivedDate), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'First Trimester Ends (12 weeks):', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(firstTrimester), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'Second Trimester Ends (27 weeks):', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(secondTrimester), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'Third Trimester, Estimated Due Date (40 weeks):', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(thirdTrimester), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart new file mode 100644 index 00000000..9bdbfb36 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart @@ -0,0 +1,557 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; + +import 'ideal_body_result_page.dart'; + +const activeCardColor = Color(0xff70777A); +const inactiveCardColor = Color(0xffFAFAFd); + +class IdealBody extends StatefulWidget { + @override + _IdealBodyState createState() => _IdealBodyState(); +} + +class _IdealBodyState extends State { + bool isMale = false; + bool isHeightCm = true; + + Color kgCard = activeCardColor; + Color lbCard = inactiveCardColor; + Color cmCard = activeCardColor; + Color ftCard = inactiveCardColor; + int age = 0; + int height = 0; + double heightInches; + double minRange; + double maxRange; + double overWeightBy; + int weight = 0; + double idealWeight = 0; + String dropdownValue = 'Medium(fingers touch)'; + double calories = 0; + String textResult = ''; + double maxIdealWeight; + double heightFeet; + + void updateColorHeight(int type) { + //MG/DLT card + if (type == 1) { + if (cmCard == inactiveCardColor) { + cmCard = activeCardColor; + ftCard = inactiveCardColor; + } else { + cmCard = inactiveCardColor; + } + } + if (type == 2) { + if (ftCard == inactiveCardColor) { + ftCard = activeCardColor; + cmCard = inactiveCardColor; + } else { + ftCard = inactiveCardColor; + } + } + } + + void updateColorWeight(int type) { + //MG/DLT card + if (type == 1) { + if (kgCard == inactiveCardColor) { + kgCard = activeCardColor; + lbCard = inactiveCardColor; + } else { + kgCard = inactiveCardColor; + } + } + if (type == 2) { + if (lbCard == inactiveCardColor) { + lbCard = activeCardColor; + kgCard = inactiveCardColor; + } else { + lbCard = inactiveCardColor; + } + } + } + + void calculateIdealWeight() { + heightInches = height * .39370078740157477; + heightFeet = heightInches / 12; + idealWeight = (50 + 2.3 * (heightInches - 60)); + if (dropdownValue == 'Small(fingers overlap)') { + idealWeight = idealWeight - 10; + } else if (dropdownValue == 'Medium(fingers touch)') { + idealWeight = idealWeight; + } else if (dropdownValue == 'Large(fingers don\'n touch)') { + idealWeight = idealWeight + 10; + } + + maxIdealWeight = (((idealWeight) * 1.1).round() * 100) / 100; + overWeightBy = weight - maxIdealWeight.roundToDouble(); + minRange = ((idealWeight / 1.1) * 10).round() / 10; + maxRange = maxIdealWeight; + idealWeight = idealWeight; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Ideal Body Weight', + body: Padding( + padding: EdgeInsets.symmetric(vertical: 15.0, horizontal: 25.0), + child: SingleChildScrollView( + child: Container( + height: 800.0, + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(10.0), + child: Texts( + 'Calculates the ideal body weight based on height, Weight, and Body Size', + ), + ), + Divider( + thickness: 2.0, + ), + SizedBox( + height: 5.0, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Height', + ), + Row( + children: [ + Expanded( + child: Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: + BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(height.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (height < 250) + height++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (height > 0) height--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: height.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + height = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(1); + isHeightCm = true; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: cmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(2); + isHeightCm = false; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: ftCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 45.0, + ), + Divider( + thickness: 2.0, + ), + Texts( + 'Weight', + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + child: Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: + BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(weight.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight < 250) + weight++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight > 0) weight--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: weight.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + weight = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(1); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: kgCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('KG')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(2); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: lbCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('LB')), + ), + ), + ), + ], + ), + SizedBox( + height: 45.0, + ), + Divider( + thickness: 2.0, + ), + SizedBox( + height: 5.0, + ), + Texts('Body Frame Size'), + Container( + width: 300, + child: DropdownButton( + value: dropdownValue, + icon: Icon(Icons.arrow_downward), + iconSize: 24, + elevation: 16, + style: TextStyle(color: Colors.black87), + underline: Container( + height: 2, + color: Colors.black54, + ), + onChanged: (String newValue) { + setState(() { + dropdownValue = newValue; + }); + }, + items: [ + 'Small(fingers overlap)', + 'Medium(fingers touch)', + 'Large(fingers don\'n touch)', + ].map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), + ), + ), + SizedBox( + height: 30.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + // calculateBmr(); + // calculateCalories(); + calculateIdealWeight(); + + print(idealWeight); + //print(overWeightBy); + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => IdealBodyResult( + idealBodyWeight: idealWeight, + minRange: minRange, + mixRange: maxRange, + overWeightBy: overWeightBy, + textResult: textResult, + )), + ); + } + }); + }, + ), + ), + ], + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.dart new file mode 100644 index 00000000..605e499a --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.dart @@ -0,0 +1,170 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; + +class IdealBodyResult extends StatelessWidget { + final double idealBodyWeight; + final double minRange; + final double mixRange; + final double overWeightBy; + final String textResult; + + IdealBodyResult( + {this.idealBodyWeight, + this.minRange, + this.mixRange, + this.overWeightBy, + this.textResult}); + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Ideal Body Weight', + body: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Texts( + 'Ideal weight range is', + fontSize: 23.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Row( + children: [ + Texts( + minRange.toStringAsFixed(1), + fontSize: 30.0, + ), + Padding( + padding: EdgeInsets.only(top: 8.0, left: 4.0), + child: Text( + 'Kg', + style: TextStyle(color: Colors.red), + ), + ), + ], + ), + Icon( + Icons.arrow_forward, + color: Colors.red, + size: 55.0, + ), + Row( + children: [ + Texts( + mixRange.toStringAsFixed(1), + fontSize: 30.0, + ), + Padding( + padding: EdgeInsets.only(top: 8.0, left: 4.0), + child: Text( + 'Kg', + style: TextStyle(color: Colors.red), + ), + ), + ], + ), + ], + ), + overWeightBy >= 0 && overWeightBy <= 10 + ? Column( + children: [ + Texts( + 'Congratulations! The current weight is\n perfect and considered healthy', + fontSize: 20.0, + ), + ], + ) + : overWeightBy > 10 && overWeightBy < 17 + ? Column( + children: [ + Texts( + 'This means that the weight is a little bit more than ideal weight by'), + Texts(overWeightBy.toStringAsFixed(1)), + Texts( + 'May wish to consult with the doctor for medical help. Click to view our list of Doctors'), + ], + ) + : overWeightBy >= 18 + ? Container( + height: 250.0, + width: 350, + child: Column( + children: [ + Texts( + 'Means that you suffer from excessive\n obesity by', + ), + SizedBox( + height: 55.0, + ), + Texts( + overWeightBy.toStringAsFixed(1), + fontSize: 40.0, + ), + SizedBox( + height: 25.0, + ), + Texts( + 'May wish to consult with the doctor for\n medical help. Click to view our list of\n Doctors'), + ], + ), + ) + : overWeightBy < -18 + ? Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + 'Under Weight', + fontSize: 18.0, + ), + ), + SizedBox( + height: 55.0, + ), + Texts( + overWeightBy.toStringAsFixed(1), + fontSize: 20.0, + ), + ], + ) + : Container( + height: 250.0, + width: 350.0, + child: Column( + children: [ + Texts( + 'under wheight', + fontSize: 20.0, + ), + SizedBox( + height: 55.0, + ), + Texts( + overWeightBy.toStringAsFixed(1), + fontSize: 20.0, + ), + SizedBox( + height: 25.0, + ), + Texts( + 'May wish to consult with the doctor for\n medical help. Click to view our list of\n Doctors'), + ], + ), + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart new file mode 100644 index 00000000..1a272c11 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart @@ -0,0 +1,351 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:intl/intl.dart'; + +import 'ovulation_result_page.dart'; + +class OvulationPeriod extends StatefulWidget { + @override + _OvulationPeriodState createState() => _OvulationPeriodState(); +} + +class _OvulationPeriodState extends State { + DateTime bloodSugarDate = DateTime.now(); + DateTime timeSugarDate = DateTime.now(); + int cycleLength = 0; + int lutealPhaseLength = 0; + String selectedDate; + var dateFrom = DateTime.now(); + var dateTo = DateTime.now(); + var conceivedDate = DateTime.now(); + var deliveryDue = DateTime.now(); + var dt = DateTime.now(); + var newFormat = DateFormat("yy-MM-dd"); + String updatedDt; + + String getTime() { + return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; + } + + String getDate() { + return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}"; + } + + // void calculate() {} + // + // void calculateFertility(DateTime selectedDate) {const diff = Date.} + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Ovulation Period', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), + child: SingleChildScrollView( + child: Container( + height: 700.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Calculates Ovulation Period'), + SizedBox( + height: 12.0, + ), + Divider( + //height: 2, + thickness: 2, + ), + SizedBox( + height: 12.0, + ), + InkWell( + onTap: () { + DatePicker.showDatePicker( + context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now(), + onConfirm: (date) { + print('confirm $date'); + setState(() { + bloodSugarDate = date; + dateFrom = date.add(Duration(days: 10)); + updatedDt = DateFormat.yMMMEd().format(dateFrom); + + dateTo = date.add(Duration(days: 20)); + conceivedDate = date.add(Duration(days: 14)); + deliveryDue = date.add(Duration(days: 280)); + }); + }, + currentTime: DateTime.now(), + ); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('Date'), + Texts(getDate()), + ], + ), + ), + ), + SizedBox( + height: 5.0, + ), + Texts( + 'Average Cycle Length (usually 28 days):', + fontWeight: FontWeight.w400, + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(cycleLength.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (cycleLength < 45) + cycleLength++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (cycleLength > 0) + cycleLength--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: cycleLength.toDouble(), + min: 0, + max: 45, + onChanged: (double newValue) { + setState(() { + cycleLength = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts( + 'Average Luteal Phase Length (usually 14 days):', + fontWeight: FontWeight.w400, + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: + Text(lutealPhaseLength.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (lutealPhaseLength < 15) + lutealPhaseLength++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (lutealPhaseLength > 0) + lutealPhaseLength--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: lutealPhaseLength.toDouble(), + min: 0, + max: 15, + onChanged: (double newValue) { + setState(() { + lutealPhaseLength = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + SizedBox( + height: 220.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => OvulationResult( + conceivedDate: conceivedDate, + dateFrom: dateFrom, + dateTo: dateTo, + deliveryDue: deliveryDue, + )), + ); + } + }); + }, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart new file mode 100644 index 00000000..6669bf75 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart @@ -0,0 +1,96 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; + +class OvulationResult extends StatelessWidget { + var dateFrom; + var dateTo; + var conceivedDate; + var deliveryDue; + OvulationResult( + {this.dateFrom, this.dateTo, this.deliveryDue, this.conceivedDate}); + //var newFormat = DateFormat("yy-MM-dd"); + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Ovulation Period', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 15.0), + child: SingleChildScrollView( + child: Container( + height: 750.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Texts( + 'The next ovulation period is estimated to be:', + fontWeight: FontWeight.w400, + ), + Texts( + 'From:', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(dateFrom), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'To:', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(dateTo), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'Useful Information:', + color: Color(0xffC5272D), + ), + Texts( + 'You have conceived on:', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(conceivedDate), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'The baby\'s age right now:', + fontWeight: FontWeight.w400, + ), + Texts( + '5 Weeks, 2', + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'The delivery due date is estimated to be on the: ', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(deliveryDue), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_converter.dart b/lib/pages/AlHabibMedicalService/health_converter.dart new file mode 100644 index 00000000..61ea406f --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_converter.dart @@ -0,0 +1,96 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; + +import 'health_converter/blood_cholesterol.dart'; +import 'health_converter/blood_sugar.dart'; +import 'health_converter/triglycerides.dart'; + +class HealthConverter extends StatefulWidget { + @override + _HealthConverterState createState() => _HealthConverterState(); +} + +class _HealthConverterState extends State { + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Health Converter', + body: Column( + children: [ + Container( + width: double.infinity, + height: 30, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage(page: BloodSugar()), + ); + }, + child: MedicalProfileItem( + title: 'Blood', + imagePath: 'blood_sugar_icon.png', + subTitle: 'Sugar', + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: BloodCholesterol(), + ), + ); + }, + child: MedicalProfileItem( + title: 'Blood', + imagePath: 'blood_cholesterol_icon.png', + subTitle: 'Cholesterol', + ), + ), + ), + ], + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: Triglycerides(), + ), + ); + }, + child: MedicalProfileItem( + title: 'Triglycerides', + imagePath: 'triglycerides_blood_icon.png', + subTitle: 'Fat in blood', + ), + ), + ), + Expanded( + flex: 1, + child: Container(), + ), + ], + ) + ], + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart b/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart new file mode 100644 index 00000000..58caee36 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart @@ -0,0 +1,277 @@ +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; + +import 'package:flutter/services.dart'; + +const activeCardColor = Color(0xff70777A); +const inactiveCardColor = Color(0xffFAFAFd); + +class BloodCholesterol extends StatefulWidget { + @override + _BloodCholesterolState createState() => _BloodCholesterolState(); +} + +class _BloodCholesterolState extends State { + Color cardMGColor = inactiveCardColor; + Color cardMMOLColor = inactiveCardColor; + + void updateColor(int type) { + //MG/DLT card + if (type == 1) { + if (cardMGColor == inactiveCardColor) { + cardMGColor = activeCardColor; + cardMMOLColor = inactiveCardColor; + } else { + cardMGColor = inactiveCardColor; + } + } + if (type == 2) { + if (cardMMOLColor == inactiveCardColor) { + cardMMOLColor = activeCardColor; + cardMGColor = inactiveCardColor; + } else { + cardMMOLColor = inactiveCardColor; + } + } + } + + void calculateBloodCholesterol() { + if (cardMGColor == activeCardColor) { + inputValue = double.parse(textController.text); + inputValue = inputValue / conversionConst; + unit = 'mmol/l'; + } else if (cardMMOLColor == activeCardColor) { + inputValue = double.parse(textController.text); + inputValue = inputValue * conversionConst; + unit = 'mg/dlt'; + } + } + + bool _visible = false; + TextEditingController textController = new TextEditingController(); + String finalValue; + + double inputValue = 0.0; + String unit; + double conversionConst = 38.67; + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Blood Cholesterol ', + body: Padding( + padding: const EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 0.7, + child: Column( + //crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 350.0, + child: Text( + 'Convert blood cholesterol from\n mmol/l to mg/dlt and vice versa.', + //textAlign: TextAlign.center, + style: TextStyle(fontSize: 20.0), + ), + ), + SizedBox( + height: 15.0, + ), + Container( + color: Colors.white, + height: 120.0, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + //crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 15.0), + child: Row( + children: [ + Texts( + 'Convert from', + ), + ], + ), + ), + SizedBox( + height: 9.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColor(1); + inputValue = + double.parse(textController.text); + inputValue = inputValue / conversionConst; + unit = 'mmol/l'; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: cardMGColor, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Texts('MG/DLt TO \nMMOL/L'), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColor(2); + inputValue = + double.parse(textController.text); + inputValue = inputValue * conversionConst; + unit = 'mg/dlt'; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: cardMMOLColor, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 16.0), + child: Texts('MG/DLt TO\n MMOL/L'), + ), + ), + ), + ], + ), + ], + ), + ), + ), + SizedBox( + height: 25.0, + ), + Container( + height: 65.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Colors.white, + ), + child: TextFormField( + controller: textController, + inputFormatters: [ +// FilteringTextInputFormatter.digitsOnly + ], + keyboardType: TextInputType.number, + decoration: InputDecoration( + border: OutlineInputBorder( + borderSide: BorderSide(color: Colors.black45)), + labelText: " Enter the reading value", + labelStyle: TextStyle( + color: Colors.black87, + ), + ), + ), + ), + SizedBox( + height: 25.0, + ), + Visibility( + visible: _visible, + child: Container( + height: 95.0, + width: 350.0, + decoration: BoxDecoration( + color: Colors.white, + border: Border.all(color: Colors.black), + borderRadius: BorderRadius.circular(15.0), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Texts('Result:'), + Row( + children: [ + Text( + inputValue.toStringAsFixed(3).toString(), + style: TextStyle(fontSize: 35.0), + ), + Padding( + padding: EdgeInsets.only(left: 4.0, top: 10.0), + child: Text( + unit.toString(), + style: TextStyle( + color: Color(0xffC5273A), + fontSize: 15.0, + fontWeight: FontWeight.w500, + ), + ), + ), + ], + ), + ], + ), + ), + ), + ), + SizedBox( + height: 15.0, + ), + Flexible( + child: Container( + height: 100.0, + width: 150.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + _visible == false + ? _visible = !_visible + : _visible = _visible; + calculateBloodCholesterol(); + }); + }, + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart b/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart new file mode 100644 index 00000000..f5d66ccf --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart @@ -0,0 +1,279 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +const activeCardColor = Color(0xff70777A); +const inactiveCardColor = Color(0xffFAFAFd); + +class BloodSugar extends StatefulWidget { + @override + _BloodSugarState createState() => _BloodSugarState(); +} + +Color color; + +class _BloodSugarState extends State { + Color cardMGColor = inactiveCardColor; + Color cardMMOLColor = inactiveCardColor; + + void updateColor(int type) { + //MG/DLT card + if (type == 1) { + if (cardMGColor == inactiveCardColor) { + cardMGColor = activeCardColor; + cardMMOLColor = inactiveCardColor; + } else { + cardMGColor = inactiveCardColor; + } + } + if (type == 2) { + if (cardMMOLColor == inactiveCardColor) { + cardMMOLColor = activeCardColor; + cardMGColor = inactiveCardColor; + } else { + cardMMOLColor = inactiveCardColor; + } + } + } + + void calculateBloodSugar() { + if (cardMGColor == activeCardColor) { + inputValue = double.parse(textController.text); + inputValue = inputValue / 15; + unit = 'mmol/l'; + } else if (cardMMOLColor == activeCardColor) { + inputValue = double.parse(textController.text); + inputValue = inputValue * 18; + unit = 'mg/dlt'; + } + } + + bool _visible = false; + TextEditingController textController = new TextEditingController(); + String finalValue; + + double inputValue = 0; + String unit; + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Blood Sugar Conversion', + body: Padding( + padding: const EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 0.7, + child: Column( + //crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 350.0, + child: Text( + 'Convert blood sugar/glucose from mmol/l (UK standard) to mg/dlt (US standard) and vice versa.', + //textAlign: TextAlign.center, + style: TextStyle(fontSize: 20.0), + ), + ), + SizedBox( + height: 15.0, + ), + Container( + color: Colors.white, + height: 120.0, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + //crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 15.0), + child: Row( + children: [ + Texts( + 'Convert from', + ) + ], + ), + ), + SizedBox( + height: 9.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColor(1); + inputValue = + double.parse(textController.text); + inputValue = inputValue / 15; + unit = 'mmol/l'; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: cardMGColor, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Texts('MG/DLt TO \nMMOL/L'), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColor(2); + inputValue = + double.parse(textController.text); + inputValue = inputValue * 18; + unit = 'mg/dlt'; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: cardMMOLColor, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 16.0), + child: Texts('MG/DLt TO\n MMOL/L'), + ), + ), + ), + ], + ), + ], + ), + ), + ), + SizedBox( + height: 25.0, + ), + Container( + height: 65.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Colors.white, + ), + child: TextFormField( + controller: textController, + inputFormatters: [ +// FilteringTextInputFormatter.digitsOnly + ], + keyboardType: TextInputType.number, + decoration: InputDecoration( + labelText: " Enter the reading value", + border: OutlineInputBorder( + borderSide: BorderSide(color: Colors.black45)), + labelStyle: TextStyle( + color: Colors.black87, + ), + ), + ), + ), + SizedBox( + height: 25.0, + ), + Visibility( + visible: _visible, + child: Container( + height: 95.0, + width: 350.0, + decoration: BoxDecoration( + color: Colors.white, + border: Border.all(color: Colors.black), + borderRadius: BorderRadius.circular(15.0), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Texts('Result:'), + Row( + children: [ + Text( + inputValue.toStringAsFixed(3), + style: TextStyle(fontSize: 35.0), + ), + Padding( + padding: EdgeInsets.only(left: 4.0, top: 10.0), + child: Text( + unit.toString(), + style: TextStyle( + color: Color(0xffC5273A), + fontSize: 15.0, + fontWeight: FontWeight.w500, + ), + ), + ), + ], + ), + ], + ), + ), + ), + ), + SizedBox( + height: 30.0, + ), + Flexible( + child: Container( + height: 100.0, + width: 150.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + _visible == false + ? _visible = !_visible + : _visible = _visible; + calculateBloodSugar(); + }); + }, + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart b/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart new file mode 100644 index 00000000..a86fdb88 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart @@ -0,0 +1,275 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; + +import 'package:flutter/services.dart'; + +const activeCardColor = Color(0xff70777A); +const inactiveCardColor = Color(0xffFAFAFd); + +class Triglycerides extends StatefulWidget { + @override + _TriglyceridesState createState() => _TriglyceridesState(); +} + +class _TriglyceridesState extends State { + Color cardMGColor = inactiveCardColor; + Color cardMMOLColor = inactiveCardColor; + int type; + void updateColor(type) { + //MG/DLT card + if (type == 1) { + if (cardMGColor == inactiveCardColor) { + cardMGColor = activeCardColor; + cardMMOLColor = inactiveCardColor; + } else { + cardMGColor = inactiveCardColor; + } + } + if (type == 2) { + if (cardMMOLColor == inactiveCardColor) { + cardMMOLColor = activeCardColor; + cardMGColor = inactiveCardColor; + } else { + cardMMOLColor = inactiveCardColor; + } + } + } + + void calculateTriglycerides() { + if (cardMGColor == activeCardColor) { + inputValue = double.parse(textController.text); + inputValue = inputValue / conversionConst; + unit = 'mmol/l'; + } else if (cardMMOLColor == activeCardColor) { + inputValue = double.parse(textController.text); + inputValue = inputValue * conversionConst; + unit = 'mg/dlt'; + } + } + + bool _visible = false; + TextEditingController textController = new TextEditingController(); + String finalValue; + + double inputValue = 0.0; + String unit; + double conversionConst = 88.57; + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Triglycerides', + body: Padding( + padding: const EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 0.7, + child: Column( + //crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 350.0, + child: Text( + 'Convert Triglycerides from mmol/l to\n mg/dlt and vice versa.', + //textAlign: TextAlign.center, + style: TextStyle(fontSize: 20.0), + ), + ), + SizedBox( + height: 15.0, + ), + Container( + color: Colors.white, + height: 120.0, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + //crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 15.0), + child: Row( + children: [Texts('Convert from')], + ), + ), + SizedBox( + height: 9.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColor(1); + inputValue = + double.parse(textController.text); + inputValue = inputValue / conversionConst; + unit = 'mmol/l'; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: cardMGColor, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Texts('MG/DLt TO \nMMOL/L'), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColor(2); + inputValue = + double.parse(textController.text); + inputValue = inputValue * conversionConst; + unit = 'mg/dlt'; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: cardMMOLColor, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 16.0), + child: Texts('MG/DLt TO\n MMOL/L'), + ), + ), + ), + ], + ), + ], + ), + ), + ), + SizedBox( + height: 25.0, + ), + Container( + height: 65.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Colors.white, + ), + child: TextFormField( + controller: textController, + inputFormatters: [ +// FilteringTextInputFormatter.digitsOnly + ], + keyboardType: TextInputType.number, + decoration: InputDecoration( + border: OutlineInputBorder( + borderSide: BorderSide(color: Colors.black45)), + labelText: " Enter the reading value", + labelStyle: TextStyle( + color: Colors.black87, + ), + ), + ), + ), + SizedBox( + height: 25.0, + ), + Visibility( + visible: _visible, + child: Container( + height: 95.0, + width: 350.0, + decoration: BoxDecoration( + color: Colors.white, + border: Border.all(color: Colors.black), + borderRadius: BorderRadius.circular(15.0), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Texts('Result:'), + Row( + children: [ + Text( + inputValue.toStringAsFixed(2), + style: TextStyle(fontSize: 35.0), + ), + Padding( + padding: EdgeInsets.only(left: 4.0, top: 10.0), + child: Text( + unit.toString(), + style: TextStyle( + color: Color(0xffC5273A), + fontSize: 15.0, + fontWeight: FontWeight.w500, + ), + ), + ), + ], + ), + ], + ), + ), + ), + ), + SizedBox( + height: 10.0, + ), + Flexible( + child: Container( + height: 100.0, + width: 250.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + _visible == false + ? _visible = !_visible + : _visible = _visible; + calculateTriglycerides(); + }); + }, + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/my_web_view.dart b/lib/pages/AlHabibMedicalService/my_web_view.dart new file mode 100644 index 00000000..59163c15 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/my_web_view.dart @@ -0,0 +1,37 @@ +import 'dart:async'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +import 'package:webview_flutter/webview_flutter.dart'; + +class MyWebView extends StatelessWidget { + final String title; + final String selectedUrl; + + final Completer _controller = + Completer(); + + MyWebView({ + @required this.title, + @required this.selectedUrl, + }); + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: title, + + body: + WebView( + initialUrl: selectedUrl, + javascriptMode: JavascriptMode.unrestricted, + onWebViewCreated: (WebViewController webViewController) { + _controller.complete(webViewController); + }, + ) + + + ); + } +} \ No newline at end of file diff --git a/lib/pages/AlHabibMedicalService/parking_page.dart b/lib/pages/AlHabibMedicalService/parking_page.dart new file mode 100644 index 00000000..82c390ea --- /dev/null +++ b/lib/pages/AlHabibMedicalService/parking_page.dart @@ -0,0 +1,210 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/qr_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:maps_launcher/maps_launcher.dart'; + +import '../../d_q_icons_icons.dart'; + +class ParkingPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getIsSaveParking(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).parking, + body: SingleChildScrollView( + padding: EdgeInsets.all(12), + child: !model.isSavePark + ? Column( + children: [ + Texts( + TranslationBase.of(context).parkingTitle, + fontWeight: FontWeight.normal, + fontSize: 15, + ), + SizedBox( + height: 12, + ), + Image.asset( + 'assets/images/timeline_bg.png', + width: double.infinity, + ) + ], + ) + : Column( + children: [ + Row( + children: [ + Expanded( + child: Container(child: Icon(/*Icons.landscape*/DQIcons.parking_icon,size: 130),), + ), + SizedBox( + width: 15, + ), + Expanded( + child: Container( + height: 150, + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + shape: BoxShape.rectangle), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Texts(model.qrParkingModel.parkingDescriptionN), + Divider( + height: 3, + ), + Texts(model.qrParkingModel.rowDescriptionN) + ], + ), + ), + ), + ], + ), + SizedBox( + height: 15, + ), + Container( + padding: EdgeInsets.all(8), + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + shape: BoxShape.rectangle), + height: 70, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(TranslationBase.of(context).showMyPark), + Texts(model.qrParkingModel.floorDescriptionN), + ], + ), + ), + SizedBox( + height: 15, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + shape: BoxShape.rectangle), + padding: EdgeInsets.all(8), + width: double.infinity, + height: 70, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(TranslationBase.of(context).gate), + Texts(model.qrParkingModel.gateDescriptionN), + ], + ), + ), + SizedBox( + height: 15, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + shape: BoxShape.rectangle), + padding: EdgeInsets.all(8), + width: double.infinity, + height: 70, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(TranslationBase.of(context).building), + Texts(model.qrParkingModel.buildingDescriptionN), + ], + ), + ), + SizedBox( + height: 15, + ), + Container( + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + shape: BoxShape.rectangle), + width: double.infinity, + height: 70, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(TranslationBase.of(context).branch), + Texts(model.qrParkingModel.branchDescriptionN), + ], + ), + ), + SizedBox( + height: 15, + ), + ], + ), + ), + bottomSheet: !model.isSavePark + ? Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + onTap: () async { + model.readQr(); + }, + label: TranslationBase.of(context).readBarcode, + loading: model.state == ViewState.BusyLocal, + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + ) + : Container( + height: MediaQuery.of(context).size.height * 0.15, + width: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + onTap: () async { + MapsLauncher.launchCoordinates( + model.qrParkingModel.latitude, + model.qrParkingModel.longitude, + ); + }, + disabled: model.qrParkingModel.longitude == 0, + label: TranslationBase.of(context).showMyPark, + textColor: Theme.of(context).backgroundColor), + ), + SizedBox( + height: 12, + ), + InkWell( + onTap: () => model.clearParking(), + child: Texts( + TranslationBase.of(context).clearMyData, + color: Colors.red, + decoration: TextDecoration.underline, + )) + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/​ health_calculators.dart b/lib/pages/AlHabibMedicalService/​ health_calculators.dart new file mode 100644 index 00000000..d3bd4bed --- /dev/null +++ b/lib/pages/AlHabibMedicalService/​ health_calculators.dart @@ -0,0 +1,283 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; + +import 'health_calculator/bmi_calculator/bmi_calculator.dart'; +import 'health_calculator/bmr_calculator/bmr_calculator.dart'; +import 'health_calculator/calorie_calculator/calorie_calculator.dart'; +import 'health_calculator/delivery_due/delivery_due.dart'; +import 'health_calculator/ideal_body/ideal_body.dart'; + +class HealthCalculators extends StatefulWidget { + @override + _HealthCalculatorsState createState() => _HealthCalculatorsState(); +} + +class _HealthCalculatorsState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Health Calculators', + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(70.0), + child: Stack( + children: [ + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 1.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 5.7, + ), + ), + color: Colors.white, + ), + child: Center( + child: TabBar( + controller: _tabController, + isScrollable: true, + indicatorWeight: 4.0, + indicatorColor: Colors.red, + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0), + unselectedLabelColor: Colors.grey, + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.35, + child: Center( + child: Texts('General Health'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.35, + child: Center( + child: Texts("Women's Health"), + ), + ), + ], + ), + ), + ), + ) + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + Container( + child: Column( + children: [ + Container( + width: double.infinity, + height: 80, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage(page: BMICalculator()), + ); + }, + child: MedicalProfileItem( + title: 'BMI', + imagePath: 'bmi_health_calculator.png', + subTitle: 'Calculators', + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: CalorieCalculator(), + ), + ); + }, + child: MedicalProfileItem( + title: 'Calories', + imagePath: 'calories-calculator.png', + subTitle: 'Calculators', + ), + ), + ), + ], + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: BmrCalculator(), + ), + ); + }, + child: MedicalProfileItem( + title: 'BMR', + imagePath: 'BMR_calculator.png', + subTitle: 'Calculators', + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: IdealBody(), + ), + ); + }, + child: MedicalProfileItem( + title: 'Ideal Body', + imagePath: 'body_weight.png', + subTitle: 'Weight', + ), + ), + ), + ], + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: BodyFat(), + ), + ); + }, + child: MedicalProfileItem( + title: 'Body', + imagePath: 'body_fat.png', + subTitle: 'Fat', + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: Carbs(), + ), + ); + }, + child: MedicalProfileItem( + title: 'Carbohydrate', + imagePath: 'carb_protein.png', + subTitle: 'Protein Fat', + ), + ), + ), + ], + ), + ], + ), + ), + Container( + child: Column( + children: [ + Container( + width: double.infinity, + height: 80, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage(page: OvulationPeriod()), + ); + }, + child: MedicalProfileItem( + title: 'Ovulation', + imagePath: 'ovulation_period_icon.png', + subTitle: 'Period', + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: DeliveryDue(), + ), + ); + }, + child: MedicalProfileItem( + title: 'Delivery', + imagePath: 'delivery_date_icon.png', + subTitle: 'Due Date', + ), + ), + ), + ], + ), + ], + ), + ), + ], + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/Blood/advance_payment_page.dart b/lib/pages/Blood/advance_payment_page.dart new file mode 100644 index 00000000..dd3ea666 --- /dev/null +++ b/lib/pages/Blood/advance_payment_page.dart @@ -0,0 +1,397 @@ +// import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +// import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +// import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +// import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; +// import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; +// import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +// import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +// import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +// import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; +// import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +// import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectHospitalDialog.dart'; +// import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +// import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +// import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +// import 'package:diplomaticquarterapp/uitl/utils.dart'; +// import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +// import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +// import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +// import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +// import 'package:flutter/cupertino.dart'; +// import 'package:flutter/material.dart'; +// import 'package:smart_progress_bar/smart_progress_bar.dart'; +// +// //import '../../../core/model/my_balance/AdvanceModel.dart'; +// import 'confirm_payment_page.dart'; +// import 'dialogs/SelectBeneficiaryDialog.dart'; +// import 'dialogs/SelectPatientFamilyDialog.dart'; +// import 'dialogs/SelectPatientInfoDialog.dart'; +// import 'new_text_Field.dart'; +// +// enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } +// +// class AdvancePaymentPage extends StatefulWidget { +// @override +// _AdvancePaymentPageState createState() => _AdvancePaymentPageState(); +// } +// +// class _AdvancePaymentPageState extends State { +// TextEditingController _fileTextController = TextEditingController(); +// TextEditingController _notesTextController = TextEditingController(); +// BeneficiaryType beneficiaryType = BeneficiaryType.NON; +// HospitalsModel _selectedHospital; +// String amount = ""; +// String email; +// PatientInfo _selectedPatientInfo; +// AuthenticatedUser authenticatedUser; +// GetAllSharedRecordsByStatusList selectedPatientFamily; +// AdvanceModel advanceModel = AdvanceModel(); +// +// AppSharedPreferences sharedPref = AppSharedPreferences(); +// AuthenticatedUser authUser; +// +// @override +// void initState() { +// super.initState(); +// getAuthUser(); +// } +// +// @override +// Widget build(BuildContext context) { +// return BaseView( +// onModelReady: (model) => model.getHospitals(), +// builder: (_, model, w) => AppScaffold( +// isShowAppBar: true, +// appBarTitle: TranslationBase.of(context).advancePayment, +// body: SingleChildScrollView( +// physics: ScrollPhysics(), +// child: Container( +// margin: EdgeInsets.all(12), +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Texts( +// TranslationBase.of(context).advancePaymentLabel, +// textAlign: TextAlign.center, +// ), +// SizedBox( +// height: 12, +// ), +// InkWell( +// onTap: () => confirmSelectBeneficiaryDialog(model), +// child: Container( +// padding: EdgeInsets.all(12), +// width: double.infinity, +// height: 65, +// decoration: BoxDecoration( +// borderRadius: BorderRadius.circular(12), +// color: Colors.white), +// child: Row( +// mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// Texts(getBeneficiaryType()), +// Icon(Icons.arrow_drop_down) +// ], +// ), +// ), +// ), +// if (beneficiaryType == BeneficiaryType.MyFamilyFiles) +// SizedBox( +// height: 12, +// ), +// if (beneficiaryType == BeneficiaryType.MyFamilyFiles) +// InkWell( +// onTap: () { +// model.getFamilyFiles().then((value) { +// confirmSelectFamilyDialog(model +// .getAllSharedRecordsByStatusResponse +// .getAllSharedRecordsByStatusList); +// }).showProgressBar( +// text: "Loading", +// backgroundColor: Colors.blue.withOpacity(0.6)); +// }, +// child: Container( +// padding: EdgeInsets.all(12), +// width: double.infinity, +// height: 65, +// decoration: BoxDecoration( +// borderRadius: BorderRadius.circular(12), +// color: Colors.white), +// child: Row( +// mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// Texts(getFamilyMembersName()), +// Icon(Icons.arrow_drop_down) +// ], +// ), +// ), +// ), +// SizedBox( +// height: 12, +// ), +// NewTextFields( +// hintText: TranslationBase.of(context).fileNumber, +// controller: _fileTextController, +// ), +// if (beneficiaryType == BeneficiaryType.OtherAccount) +// SizedBox( +// height: 12, +// ), +// if (beneficiaryType == BeneficiaryType.OtherAccount) +// InkWell( +// onTap: () { +// if (_fileTextController.text.isNotEmpty) +// model +// .getPatientInfoByPatientID( +// id: _fileTextController.text) +// .then((value) { +// confirmSelectPatientDialog(model.patientInfoList); +// }).showProgressBar( +// text: "Loading", +// backgroundColor: +// Colors.blue.withOpacity(0.6)); +// else +// AppToast.showErrorToast( +// message: 'Please Enter The File Number'); +// }, +// child: Container( +// padding: EdgeInsets.all(12), +// width: double.infinity, +// height: 65, +// decoration: BoxDecoration( +// borderRadius: BorderRadius.circular(12), +// color: Colors.white), +// child: Row( +// mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// Texts(getPatientName()), +// Icon(Icons.arrow_drop_down) +// ], +// ), +// ), +// ), +// SizedBox( +// height: 12, +// ), +// InkWell( +// onTap: () => confirmSelectHospitalDialog(model.hospitals), +// child: Container( +// padding: EdgeInsets.all(12), +// width: double.infinity, +// height: 65, +// decoration: BoxDecoration( +// borderRadius: BorderRadius.circular(12), +// color: Colors.white), +// child: Row( +// mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// Texts(getHospitalName()), +// Icon(Icons.arrow_drop_down) +// ], +// ), +// ), +// ), +// SizedBox( +// height: 12, +// ), +// NewTextFields( +// hintText: TranslationBase.of(context).amount, +// keyboardType: TextInputType.number, +// onChanged: (value) { +// setState(() { +// amount = value; +// }); +// }, +// ), +// SizedBox( +// height: 12, +// ), +// NewTextFields( +// hintText: TranslationBase.of(context).depositorEmail, +// initialValue: model.user.emailAddress, +// onChanged: (value) { +// email = value; +// }, +// ), +// SizedBox( +// height: 12, +// ), +// NewTextFields( +// hintText: TranslationBase.of(context).notes, +// controller: _notesTextController, +// ), +// SizedBox( +// height: MediaQuery.of(context).size.height * 0.15, +// ) +// ], +// ), +// ), +// ), +// bottomSheet: Container( +// height: MediaQuery.of(context).size.height * 0.1, +// width: double.infinity, +// padding: EdgeInsets.all(12), +// child: SecondaryButton( +// textColor: Colors.white, +// label: TranslationBase.of(context).submit, +// disabled: amount.isEmpty || +// _fileTextController.text.isEmpty || +// _selectedHospital == null, +// onTap: () { +// advanceModel.fileNumber = _fileTextController.text; +// advanceModel.hospitalsModel = _selectedHospital; +// advanceModel.note = _notesTextController.text; +// advanceModel.email = email ?? model.user.emailAddress; +// advanceModel.amount = amount; +// +// model.getPatientInfoByPatientIDAndMobileNumber().then((value) { +// if (model.state != ViewState.Error && +// model.state != ViewState.ErrorLocal) { +// Utils.hideKeyboard(context); +// Navigator.push( +// context, +// MaterialPageRoute( +// builder: (context) => PaymentMethod())).then( +// (value) { +// Navigator.push( +// context, +// FadePage( +// page: ConfirmPaymentPage( +// advanceModel: advanceModel, +// selectedPaymentMethod: value, +// patientInfoAndMobileNumber: +// model.patientInfoAndMobileNumber, +// authenticatedUser: authUser, +// ), +// ), +// ); +// }, +// ); +// } +// }).showProgressBar( +// text: "Loading", +// backgroundColor: Colors.blue.withOpacity(0.6)); +// }, +// ), +// )), +// ); +// } +// +// void confirmSelectBeneficiaryDialog(MyBalanceViewModel model) { +// showDialog( +// context: context, +// child: SelectBeneficiaryDialog( +// beneficiaryType: beneficiaryType, +// onValueSelected: (value) { +// setState(() { +// if (value == BeneficiaryType.MyAccount) { +// _fileTextController.text = model.user.patientID.toString(); +// advanceModel.depositorName = +// model.user.firstName + " " + model.user.lastName; +// } else +// _fileTextController.text = ""; +// +// beneficiaryType = value; +// }); +// }, +// ), +// ); +// } +// +// void confirmSelectHospitalDialog(List hospitals) { +// showDialog( +// context: context, +// child: SelectHospitalDialog( +// hospitals: hospitals, +// selectedHospital: _selectedHospital, +// onValueSelected: (value) { +// setState(() { +// _selectedHospital = value; +// }); +// }, +// ), +// ); +// } +// +// void confirmSelectPatientDialog(List patientInfoList) { +// showDialog( +// context: context, +// child: SelectPatientInfoDialog( +// patientInfoList: patientInfoList, +// selectedPatientInfo: _selectedPatientInfo, +// onValueSelected: (value) { +// setState(() { +// advanceModel.depositorName = value.fullName; +// _selectedPatientInfo = value; +// }); +// }, +// ), +// ); +// } +// +// void confirmSelectFamilyDialog( +// List getAllSharedRecordsByStatusList) { +// showDialog( +// context: context, +// child: SelectPatientFamilyDialog( +// getAllSharedRecordsByStatusList: getAllSharedRecordsByStatusList, +// selectedPatientFamily: selectedPatientFamily, +// onValueSelected: (value) { +// setState(() { +// selectedPatientFamily = value; +// _fileTextController.text = +// selectedPatientFamily.patientID.toString(); +// advanceModel.depositorName = value.patientName; +// }); +// }, +// ), +// ); +// } +// +// String getBeneficiaryType() { +// switch (beneficiaryType) { +// case BeneficiaryType.MyAccount: +// return TranslationBase.of(context).myAccount; +// case BeneficiaryType.MyFamilyFiles: +// return TranslationBase.of(context).myFamilyFiles; +// break; +// case BeneficiaryType.OtherAccount: +// return TranslationBase.of(context).otherAccount; +// break; +// case BeneficiaryType.NON: +// return TranslationBase.of(context).selectBeneficiary; +// } +// return TranslationBase.of(context).selectBeneficiary; +// } +// +// String getHospitalName() { +// if (_selectedHospital != null) +// return _selectedHospital.name; +// else +// return TranslationBase.of(context).selectHospital; +// } +// +// String getPatientName() { +// if (_selectedPatientInfo != null) +// return _selectedPatientInfo.fullName; +// else +// return TranslationBase.of(context).selectPatientName; +// } +// +// getAuthUser() async { +// if (await this.sharedPref.getObject(USER_PROFILE) != null) { +// var data = AuthenticatedUser.fromJson( +// await this.sharedPref.getObject(USER_PROFILE)); +// setState(() { +// authUser = data; +// }); +// } +// } +// +// String getFamilyMembersName() { +// if (selectedPatientFamily != null) +// return selectedPatientFamily.patientName; +// else +// return TranslationBase.of(context).selectFamilyPatientName; +// } +// } diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart new file mode 100644 index 00000000..99e5242e --- /dev/null +++ b/lib/pages/Blood/blood_donation.dart @@ -0,0 +1,684 @@ + +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart'; +import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart'; +//import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; +import 'package:diplomaticquarterapp/core/service/blood/blood_details_servies.dart'; +import 'package:diplomaticquarterapp/core/viewModels/blooddonation/blood_details_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectCiteisDialog.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectHospitalDialog.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:giffy_dialog/giffy_dialog.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +//import '../../../core/model/my_balance/AdvanceModel.dart'; +import 'confirm_payment_page.dart'; +import 'dialogs/SelectBeneficiaryDialog.dart'; +import 'dialogs/SelectBloodDialog.dart'; +import 'dialogs/SelectGenderDialog.dart'; +import 'dialogs/SelectPatientFamilyDialog.dart'; +import 'dialogs/SelectPatientInfoDialog.dart'; +import 'new_text_Field.dart'; + +enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } +enum Gender{Male,Female,NON} +enum Blood{Oplus,Ominus,Aplus,Aminus,Bplus,Bminus,ABplus,ABminus,NON} + +class BloodDonationPage extends StatefulWidget { + @override + _BloodDonationPageState createState() => _BloodDonationPageState(); +} + +class _BloodDonationPageState extends State { + TextEditingController _fileTextController = TextEditingController(); + TextEditingController _notesTextController = TextEditingController(); + BeneficiaryType beneficiaryType = BeneficiaryType.NON; + Gender gender = Gender.Male;//Gender.NON; + Blood blood = Blood.Aminus;//Blood.NON; + //HospitalsModel _selectedHospital; + CitiesModel _selectedHospital; + + String amount = ""; + String email; + PatientInfo _selectedPatientInfo; + AuthenticatedUser authenticatedUser; + GetAllSharedRecordsByStatusList selectedPatientFamily; + AdvanceModel advanceModel = AdvanceModel(); + List_BloodGroupDetailsModel bloodDetails=List_BloodGroupDetailsModel(); + AppSharedPreferences sharedPref = AppSharedPreferences(); + AuthenticatedUser authUser; + var checkedValue = false; + @override + void initState() { + super.initState(); + getAuthUser(); + } + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getCities(),//model.getHospitals(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: "Blood Donation",//TranslationBase.of(context).advancePayment, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + // TranslationBase.of(context).advancePaymentLabel, + "Enter the required information, In order to register for Blood Donation Service",//+model.user.firstName, + textAlign: TextAlign.center, + ), + SizedBox( + height: 12, + ), + InkWell( + onTap: () => confirmSelectHospitalDialog(model.CitiesModelList),//model.hospitals + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getHospitalName()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + InkWell( + //======Gender======== + onTap: () => confirmSelectGenderDialog(),//confirmSelectBeneficiaryDialog(model), + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + //Texts(getBeneficiaryType()), + Texts(getGender()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) + // SizedBox( + // height: 12, + // ), + // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) + // InkWell( + // onTap: () { + // model.getFamilyFiles().then((value) { + // confirmSelectFamilyDialog(model + // .getAllSharedRecordsByStatusResponse + // .getAllSharedRecordsByStatusList); + // }).showProgressBar( + // text: "Loading", + // backgroundColor: Colors.blue.withOpacity(0.6)); + // }, + // child: Container( + // padding: EdgeInsets.all(12), + // width: double.infinity, + // height: 65, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(12), + // color: Colors.white), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Texts(getFamilyMembersName()), + // Icon(Icons.arrow_drop_down) + // ], + // ), + // ), + // ), + SizedBox( + height: 12, + ), + InkWell( + //======Gender======== + onTap: () => confirmSelectBloodDialog(),//confirmSelectBeneficiaryDialog(model), + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + //Texts(getBeneficiaryType()), + Texts(getBlood()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) + // SizedBox( + // height: 12, + // ), + // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) + // InkWell( + // onTap: () { + // model.getFamilyFiles().then((value) { + // confirmSelectFamilyDialog(model + // .getAllSharedRecordsByStatusResponse + // .getAllSharedRecordsByStatusList); + // }).showProgressBar( + // text: "Loading", + // backgroundColor: Colors.blue.withOpacity(0.6)); + // }, + // child: Container( + // padding: EdgeInsets.all(12), + // width: double.infinity, + // height: 65, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(12), + // color: Colors.white), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Texts(getFamilyMembersName()), + // Icon(Icons.arrow_drop_down) + // ], + // ), + // ), + // ), + SizedBox( + height: 12, + ), + Row( + children: [ + Container( + child: Text(" To view the terms and conditions "), + ), + SizedBox( + width: MediaQuery.of(context).size.height * 0.10, + ), + InkWell( + onTap: () { + Navigator.of(context).push(MaterialPageRoute( + builder: (BuildContext context) => UserAgreementPage())); + }, + child: Container( + child: Texts(" Click here ",color: Colors.blue,), + ), + ) + ], + ), + SizedBox( + height: 12, + ), + Row( + children: [ + Checkbox( + onChanged: (bool value) { + setState(() { + checkedValue = value; + }); + }, + // tristate: checkedValue==true,//i == 1, + value: checkedValue, + activeColor: Colors.red,//Color(0xFF6200EE), + ), + SizedBox(height: 10,), + Row(children: [ + + ],), + SizedBox( + width: 10, + ), + Text( + 'I agree to the terms and conditions ', + style: Theme.of(context).textTheme.subtitle1.copyWith(color: checkedValue? Colors.red : Colors.black), + ), + ], + ), + // NewTextFields( + // hintText: TranslationBase.of(context).fileNumber, + // controller: _fileTextController, + // ), + // if (beneficiaryType == BeneficiaryType.OtherAccount) + // SizedBox( + // height: 12, + // ), + // if (beneficiaryType == BeneficiaryType.OtherAccount) + // InkWell( + // onTap: () { + // if (_fileTextController.text.isNotEmpty) + // model + // .getPatientInfoByPatientID( + // id: _fileTextController.text) + // .then((value) { + // confirmSelectPatientDialog(model.patientInfoList); + // }).showProgressBar( + // text: "Loading", + // backgroundColor: + // Colors.blue.withOpacity(0.6)); + // else + // AppToast.showErrorToast( + // message: 'Please Enter The File Number'); + // }, + // child: Container( + // padding: EdgeInsets.all(12), + // width: double.infinity, + // height: 65, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(12), + // color: Colors.white), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Texts(getPatientName()), + // Icon(Icons.arrow_drop_down) + // ], + // ), + // ), + // ), + // SizedBox( + // height: 12, + // ), + + // NewTextFields( + // hintText: TranslationBase.of(context).amount, + // keyboardType: TextInputType.number, + // onChanged: (value) { + // setState(() { + // amount = value; + // }); + // }, + // ), + // SizedBox( + // height: 12, + // ), + // NewTextFields( + // hintText: TranslationBase.of(context).depositorEmail, + // initialValue: model.user.emailAddress, + // onChanged: (value) { + // email = value; + // }, + // ), + // SizedBox( + // height: 12, + // ), + // NewTextFields( + // hintText: TranslationBase.of(context).notes, + // controller: _notesTextController, + // ), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: Container( + color: Colors.white, + width: 350, + child: InkWell( + onTap: () { + showDialog( + context: context, + builder: (_) => + AssetGiffyDialog( + title: Text( + "", + style: TextStyle( + fontSize: 22.0, + fontWeight: + FontWeight + .w600), + ), + image: Image.asset( + 'assets/images/BloodChrt_EN.png'), + buttonCancelText: + Text('cancel'), + buttonCancelColor: + Colors.grey, + onlyCancelButton: true, + )); + }, + child: Container( + width: 250, + height: 200, + child:Image.asset( + 'assets/images/BloodChrt_EN.png')), + ), + ), + ), + ], + ), + + SizedBox( + height: MediaQuery.of(context).size.height * 0.15, + ) + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), + label: "Save", + // + onTap: (){ + + bloodDetails.city=_selectedHospital.toString(); + + // bloodDetails. + }, + + + ), + )), + ); + } + //============== + void confirmSelectBeneficiaryDialog(MyBalanceViewModel model) { + showDialog( + context: context, + child: SelectBeneficiaryDialog( + beneficiaryType: beneficiaryType, + onValueSelected: (value) { + setState(() { + if (value == BeneficiaryType.MyAccount) { + _fileTextController.text = model.user.patientID.toString(); + advanceModel.depositorName = + model.user.firstName + " " + model.user.lastName; + } else + _fileTextController.text = ""; + + beneficiaryType = value; + }); + }, + ), + ); + } + void confirmSelectBloodDialog(){ + showDialog( + context: context, + child: SelectBloodDialog(bloodType: blood, + onValueSelected: (value) { + setState(() { + if (value == Blood.Oplus) { + bloodDetails.bloodGroup="O+"; + // _fileTextController.text = model.user.patientID.toString(); + // advanceModel.depositorName = + // model.user.firstName + " " + model.user.lastName; + }else + if (value == Blood.Ominus) { + // _fileTextController.text = model.user.patientID.toString(); + bloodDetails.bloodGroup="O-"; + // advanceModel.depositorName = + // model.user.firstName + " " + model.user.lastName; + }else + if (value == Blood.ABplus) { + bloodDetails.bloodGroup="AB+"; + // _fileTextController.text = model.user.patientID.toString(); + // advanceModel.depositorName = + // model.user.firstName + " " + model.user.lastName; + }else + if (value == Blood.ABminus) { + bloodDetails.bloodGroup="AB-"; + // _fileTextController.text = model.user.patientID.toString(); + // advanceModel.depositorName = + // model.user.firstName + " " + model.user.lastName; + }else + if (value == Blood.Aplus) { + bloodDetails.bloodGroup="A+"; + // _fileTextController.text = model.user.patientID.toString(); + // advanceModel.depositorName = + // model.user.firstName + " " + model.user.lastName; + }else + if (value == Blood.Aminus) { + bloodDetails.bloodGroup="A-"; + // _fileTextController.text = model.user.patientID.toString(); + // advanceModel.depositorName = + // model.user.firstName + " " + model.user.lastName; + }else + if (value == Blood.Bplus) { + bloodDetails.bloodGroup="B+"; + // _fileTextController.text = model.user.patientID.toString(); + // advanceModel.depositorName = + // model.user.firstName + " " + model.user.lastName; + }else + if (value == Blood.Bminus) { + bloodDetails.bloodGroup="B-"; + // _fileTextController.text = model.user.patientID.toString(); + // advanceModel.depositorName = + // model.user.firstName + " " + model.user.lastName; + } + + + else + _fileTextController.text = ""; + + // beneficiaryType = value; + blood=value; + } + + + + + ); + }, + ), + ); + } + void confirmSelectGenderDialog(){ + showDialog( + context: context, + child: SelectGenderDialog(beneficiaryType: gender, + onValueSelected: (value) { + setState(() { + if (value == Gender.Male) { + // _fileTextController.text = model.user.patientID.toString(); + bloodDetails.patientType=1; + // advanceModel.depositorName = + // model.user.firstName + " " + model.user.lastName; + } else + // _fileTextController.text = ""; + {bloodDetails.gender=2;} + + // beneficiaryType = value; + gender=value; + }); + }, + ), + ); + } + +//void confirmSelectHospitalDialog(List hospitals) { + void confirmSelectHospitalDialog(List hospitals) { + showDialog( + context: context, + child: SelectCiteisDialog( + hospitals: hospitals, + selectedHospital: _selectedHospital, + onValueSelected: (value) { + setState(() { + _selectedHospital = value; + }); + }, + ), + ); + } + + void confirmSelectPatientDialog(List patientInfoList) { + showDialog( + context: context, + child: SelectPatientInfoDialog( + patientInfoList: patientInfoList, + selectedPatientInfo: _selectedPatientInfo, + onValueSelected: (value) { + setState(() { + advanceModel.depositorName = value.fullName; + _selectedPatientInfo = value; + }); + }, + ), + ); + } + + void confirmSelectFamilyDialog( + List getAllSharedRecordsByStatusList) { + showDialog( + context: context, + child: SelectPatientFamilyDialog( + getAllSharedRecordsByStatusList: getAllSharedRecordsByStatusList, + selectedPatientFamily: selectedPatientFamily, + onValueSelected: (value) { + setState(() { + selectedPatientFamily = value; + _fileTextController.text = + selectedPatientFamily.patientID.toString(); + advanceModel.depositorName = value.patientName; + }); + }, + ), + ); + } + + String getBeneficiaryType() { + switch (beneficiaryType) { + case BeneficiaryType.MyAccount: + return TranslationBase.of(context).myAccount; + case BeneficiaryType.MyFamilyFiles: + return TranslationBase.of(context).myFamilyFiles; + break; + case BeneficiaryType.OtherAccount: + return TranslationBase.of(context).otherAccount; + break; + case BeneficiaryType.NON: + return "Select Gender";//TranslationBase.of(context).selectBeneficiary; + } + return "Select Gender";//TranslationBase.of(context).selectBeneficiary; + } + String getGender() { + switch (gender) { + case Gender.Male: + return "Male"; + case Gender.Female: + return "Female"; + break; + + case Gender.NON: + return "Select Gender";//TranslationBase.of(context).selectBeneficiary; + } + return "Select Gender";//TranslationBase.of(context).selectBeneficiary; + } + String getBlood() { + switch (blood) { + case Blood.Oplus: + return "O+"; + break; + case Blood.Ominus: + return "O-"; + break; + case Blood.ABplus: + return "AB+"; + break; + case Blood.ABminus: + return "AB-"; + break; + case Blood.Aplus: + return "A+"; + break; + case Blood.Aminus: + return "A-"; + break; + case Blood.Bplus: + return "B-"; + break; + case Blood.Bminus: + return "B-"; + break; + case Blood.Bplus: + return "B+"; + break; + + case Blood.NON: + return "Select Blood Type";//TranslationBase.of(context).selectBeneficiary; + } + return "Select Blood Type";//TranslationBase.of(context).selectBeneficiary; + } + + String getHospitalName() { + if (_selectedHospital != null) + return _selectedHospital.description; + else + return + "Riyadh"; + // return List_BloodGroupDetailsModel.fromJson(0).city.toString();//"Select City";//TranslationBase.of(context).selectHospital; + } + + String getPatientName() { + if (_selectedPatientInfo != null) + return _selectedPatientInfo.fullName; + else + return TranslationBase.of(context).selectPatientName; + } + + getAuthUser() async { + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + setState(() { + authUser = data; + }); + } + } + + String getFamilyMembersName() { + if (selectedPatientFamily != null) + return selectedPatientFamily.patientName; + else + return TranslationBase.of(context).selectFamilyPatientName; + } + + + //================ + + +} diff --git a/lib/pages/Blood/confirm_payment_page.dart b/lib/pages/Blood/confirm_payment_page.dart new file mode 100644 index 00000000..75282190 --- /dev/null +++ b/lib/pages/Blood/confirm_payment_page.dart @@ -0,0 +1,319 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; +import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'dialogs/ConfirmSMSDialog.dart'; +import 'new_text_Field.dart'; + +class ConfirmPaymentPage extends StatelessWidget { + final AdvanceModel advanceModel; + final PatientInfoAndMobileNumber patientInfoAndMobileNumber; + final String selectedPaymentMethod; + MyInAppBrowser browser; + AuthenticatedUser authenticatedUser; + AppSharedPreferences sharedPref = AppSharedPreferences(); + + ConfirmPaymentPage( + {this.advanceModel, + this.patientInfoAndMobileNumber, + this.selectedPaymentMethod, + this.authenticatedUser}); + + @override + Widget build(BuildContext context) { + void showSMSDialog() { + showDialog( + context: context, + barrierDismissible: false, + child: ConfirmSMSDialog( + phoneNumber: patientInfoAndMobileNumber.mobileNumber, + ), + ).then((value) { + print("dialog dismissed"); + print(value); + if (value != null && value) { + AppoitmentAllHistoryResultList appo = + new AppoitmentAllHistoryResultList(); + appo.projectID = patientInfoAndMobileNumber.projectID; + openPayment(selectedPaymentMethod, authenticatedUser, + double.parse(advanceModel.amount), appo); + } + }); + } + + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).advancePayment, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).confirmThePayment, + textAlign: TextAlign.center, + fontWeight: FontWeight.w500, + fontSize: 24, + ), + SizedBox( + height: 12, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + height: 100.0, + padding: EdgeInsets.all(7.0), + width: MediaQuery.of(context).size.width * 0.45, + child: Image.asset(getImagePath(selectedPaymentMethod)), + ), + Texts( + '${advanceModel.amount} SAR', + fontSize: 26, + bold: true, + ) + ], + ), + SizedBox( + height: 12, + ), + Row( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.all(3), + child: NewTextFields( + hintText: TranslationBase.of(context).fileNumber, + initialValue: advanceModel.fileNumber, + isEnabled: false, + ), + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.all(3), + child: NewTextFields( + hintText: TranslationBase.of(context).name, + initialValue: patientInfoAndMobileNumber.firstName, + isEnabled: false, + ), + ), + ), + ], + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: TranslationBase.of(context).mobileNumber, + initialValue: patientInfoAndMobileNumber.mobileNumber, + isEnabled: false, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: TranslationBase.of(context).depositorName, + initialValue: advanceModel.depositorName, + isEnabled: false, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: TranslationBase.of(context).notes, + initialValue: advanceModel.note, + isEnabled: false, + ), + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + label: TranslationBase.of(context).confirm.toUpperCase(), + disabled: model.state == ViewState.Busy, + onTap: () { + GifLoaderDialogUtils.showMyDialog(context); + model + .sendActivationCodeForAdvancePayment( + patientID: int.parse(advanceModel.fileNumber), + projectID: advanceModel.hospitalsModel.iD) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (model.state != ViewState.ErrorLocal && + model.state != ViewState.Error) showSMSDialog(); + }); + }, + ), + ), + ), + ); + } + + String getImagePath(String paymentMethod) { + switch (paymentMethod) { + case "MADA": + return 'assets/images/new-design/mada.png'; + break; + case "SADAD": + return 'assets/images/new-design/sadad.png'; + break; + case "VISA": + return 'assets/images/new-design/visa.png'; + break; + case "MASTERCARD": + return 'assets/images/new-design/mastercard.png'; + break; + case "Installment": + return 'assets/images/new-design/installment.png'; + break; + } + + return 'assets/images/new-design/mada.png'; + } + + openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, + double amount, AppoitmentAllHistoryResultList appo) { + browser = new MyInAppBrowser( + onExitCallback: onBrowserExit, + appo: appo, + onLoadStartCallback: onBrowserLoadStart); + + browser.openPaymentBrowser( + amount, + "Advance Payment", + Utils.getAdvancePaymentTransID( + authenticatedUser.projectID, authenticatedUser.patientID), + appo.projectID.toString(), + authenticatedUser.emailAddress, + paymentMethod, + authenticatedUser.patientType, + authenticatedUser.firstName, + authenticatedUser.patientID, + authenticatedUser, + browser); + } + + onBrowserLoadStart(String url) { + print("onBrowserLoadStart"); + print(url); + + MyInAppBrowser.successURLS.forEach((element) { + if (url.contains(element)) { + if (browser.isOpened()) browser.close(); + MyInAppBrowser.isPaymentDone = true; + return; + } + }); + + MyInAppBrowser.errorURLS.forEach((element) { + if (url.contains(element)) { + if (browser.isOpened()) browser.close(); + MyInAppBrowser.isPaymentDone = false; + return; + } + }); + } + + onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { + print("onBrowserExit Called!!!!"); + if (isPaymentMade) checkPaymentStatus(appo); + } + + checkPaymentStatus(AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(AppGlobal.context); + service + .checkPaymentStatus( + Utils.getAppointmentTransID( + appo.projectID, appo.clinicID, appo.appointmentNo), + AppGlobal.context) + .then((res) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + print("Printing Payment Status Reponse!!!!"); + print(res); + String paymentInfo = res['Response_Message']; + if (paymentInfo == 'Success') { + createAdvancePayment(res, appo); + } else { + AppToast.showErrorToast(message: res['Response_Message']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + String paymentReference = res['Fort_id'].toString(); + GifLoaderDialogUtils.showMyDialog(AppGlobal.context); + service + .createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], + res['PaymentMethod'], AppGlobal.context) + .then((res) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); + addAdvancedNumberRequest( + res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), + paymentReference, + appo.appointmentNo.toString(), + appo); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + addAdvancedNumberRequest(String advanceNumber, String paymentReference, + String appointmentID, AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(AppGlobal.context); + service + .addAdvancedNumberRequest( + advanceNumber, paymentReference, appointmentID, AppGlobal.context) + .then((res) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + print(res); + navigateToHome(AppGlobal.context); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + Future navigateToHome(context) async { + Navigator.of(context).pushNamed(HOME); + } + +} diff --git a/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart b/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart new file mode 100644 index 00000000..d165a895 --- /dev/null +++ b/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart @@ -0,0 +1,380 @@ +import 'dart:async'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +class ConfirmSMSDialog extends StatefulWidget { + final String phoneNumber; + final AdvanceModel advanceModel; + final PatientInfoAndMobileNumber patientInfoAndMobileNumber; + final String selectedPaymentMethod; + + const ConfirmSMSDialog( + {Key key, + this.phoneNumber, + this.advanceModel, + this.selectedPaymentMethod, + this.patientInfoAndMobileNumber}) + : super(key: key); + + @override + _ConfirmSMSDialogState createState() => _ConfirmSMSDialogState(); +} + +class _ConfirmSMSDialogState extends State { + final verifyAccountForm = GlobalKey(); + Map verifyAccountFormValue = { + 'digit1': null, + 'digit2': null, + 'digit3': null, + 'digit4': null, + }; + + TextEditingController digit1 = TextEditingController(text: ""); + TextEditingController digit2 = TextEditingController(text: ""); + TextEditingController digit3 = TextEditingController(text: ""); + TextEditingController digit4 = TextEditingController(text: ""); + + String timerText = (TIMER_MIN - 1).toString() + ':59'; + int min = TIMER_MIN - 1; + int sec = 59; + Timer _timer; + + resendCode() { + min = TIMER_MIN - 1; + sec = 59; + _timer = Timer.periodic(Duration(seconds: 1), (Timer timer) { + if (min <= 0 && sec <= 0) { + timer.cancel(); + } else { + setState(() { + sec = sec - 1; + if (sec == 0 && min == 0) { + Navigator.pop(context); + min = 0; + sec = 0; + } else if (sec == 0) { + min = min - 1; + sec = 59; + } + timerText = min.toString() + ':' + sec.toString(); + }); + } + }); + } + + FocusNode focusD1; + FocusNode focusD2; + FocusNode focusD3; + FocusNode focusD4; + + @override + void initState() { + super.initState(); + resendCode(); + focusD1 = FocusNode(); + focusD2 = FocusNode(); + focusD3 = FocusNode(); + focusD4 = FocusNode(); + } + + @override + void dispose() { + _timer.cancel(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + builder: (_, model, w) => Dialog( + elevation: 0.6, + child: Container( + height: 520, + child: ListView( + children: [ + Container( + width: double.infinity, + height: 40, + color: Theme.of(context).primaryColor, + child: Stack( + + children: [ + Center( + child: Texts( + 'SMS', + color: Colors.white, + textAlign: TextAlign.center, + ), + ), + Positioned(child: Container( + child: InkWell( + onTap: () => Navigator.pop(context), + child: Container( + decoration: BoxDecoration( + shape: BoxShape.circle, color: Colors.white), + child: Icon( + Icons.clear, + color: Colors.grey[900], + )), + ), + ), + left: projectViewModel.isArabic? 2:0, + right: projectViewModel.isArabic? 0:2, + ) + ], + + ), + ), + Image.asset( + 'assets/images/login/103.png', + height: MediaQuery.of(context).size.width * 0.25, + width: MediaQuery.of(context).size.width * 0.25, + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).pleaseEnterTheVerificationCode + + '[${widget.phoneNumber}]', + textAlign: TextAlign.center, + ), + ), + SizedBox( + height: 12, + ), + Form( + key: verifyAccountForm, + child: Container( + width: SizeConfig.realScreenWidth * 0.90, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 30, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Container( + width: 65, + child: TextFormField( + textInputAction: TextInputAction.next, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ), + focusNode: focusD1, + maxLength: 1, + controller: digit1, + textAlign: TextAlign.center, + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + onSaved: (val) { + verifyAccountFormValue['digit1'] = val; + }, + validator: validateCodeDigit, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusD2); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context).requestFocus(focusD2); + } + }, + ), + ), + Container( + width: 65, + child: TextFormField( + focusNode: focusD2, + controller: digit2, + textInputAction: TextInputAction.next, + maxLength: 1, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ), + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + validator: validateCodeDigit, + onSaved: (val) { + verifyAccountFormValue['digit2'] = val; + }, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusD3); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context).requestFocus(focusD3); + } + }, + ), + ), + Container( + width: 65, + child: TextFormField( + focusNode: focusD3, + controller: digit3, + textInputAction: TextInputAction.next, + maxLength: 1, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ), + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + validator: validateCodeDigit, + onSaved: (val) { + verifyAccountFormValue['digit3'] = val; + }, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD4); + } + }, + )), + Container( + width: 65, + child: TextFormField( + focusNode: focusD4, + controller: digit4, + maxLength: 1, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ), + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + validator: validateCodeDigit, + onSaved: (val) { + verifyAccountFormValue['digit4'] = val; + }, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusD4); + submit(model); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD4); + submit(model); + } + }), + ) + ], + ), + SizedBox( + height: 8, + ), + if (model.state == ViewState.ErrorLocal || + model.state == ViewState.Error) + Container( + margin: EdgeInsets.only(left: 8, right: 8), + width: double.maxFinite, + child: Texts( + model.error, + color: Colors.red, + ), + ), + SizedBox(height: 20), + // buildText(), + + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context) + .theVerificationCodeExpiresIn + + ' $timerText', + textAlign: TextAlign.center, + ), + ), + SizedBox(height: 20), + + Container( + width: double.maxFinite, + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + label: + TranslationBase.of(context).submit.toUpperCase(), + onTap: () { + submit(model); + }, + ), + ), + ], + ), + ), + ) + ], + ), + ), + ), + ); + } + + void submit(MyBalanceViewModel model) { + if (verifyAccountForm.currentState.validate()) { + final activationCode = + digit1.text + digit2.text + digit3.text + digit4.text; + model + .checkActivationCodeForAdvancePayment(activationCode: activationCode) + .then((value) {}) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + Navigator.pop(context, true); + }); + } + } + + String validateCodeDigit(value) { + if (value.isEmpty) { + return ''; + } + return null; + } + + InputDecoration buildInputDecoration(BuildContext context) { + return InputDecoration( + // ts/images/password_icon.png + contentPadding: EdgeInsets.only(top: 20, bottom: 20), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5)), + borderSide: BorderSide(color: Colors.black), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + borderSide: BorderSide(color: Theme.of(context).primaryColor), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + borderSide: BorderSide(color: Theme.of(context).errorColor), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + borderSide: BorderSide(color: Theme.of(context).errorColor), + ), + ); + } +} diff --git a/lib/pages/Blood/dialogs/SelectBeneficiaryDialog.dart b/lib/pages/Blood/dialogs/SelectBeneficiaryDialog.dart new file mode 100644 index 00000000..eae22f36 --- /dev/null +++ b/lib/pages/Blood/dialogs/SelectBeneficiaryDialog.dart @@ -0,0 +1,177 @@ +import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +//import '../advance_payment_page.dart'; + +class SelectBeneficiaryDialog extends StatefulWidget { + final BeneficiaryType beneficiaryType; + final Function(BeneficiaryType) onValueSelected; + + SelectBeneficiaryDialog( + {Key key, this.beneficiaryType, this.onValueSelected}); + + @override + _SelectBeneficiaryDialogState createState() => + _SelectBeneficiaryDialogState(this.beneficiaryType); +} + +class _SelectBeneficiaryDialogState extends State { + _SelectBeneficiaryDialogState(this.beneficiaryType); + + BeneficiaryType beneficiaryType; + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Container( + child: Column( + children: [ + Divider(), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + beneficiaryType = BeneficiaryType.MyAccount; + }); + }, + child: ListTile( + title: Text(TranslationBase.of(context).myAccount), + leading: Radio( + value: BeneficiaryType.MyAccount, + groupValue: beneficiaryType, + activeColor: Colors.red[800], + onChanged: (BeneficiaryType value) { + setState(() { + beneficiaryType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + beneficiaryType = BeneficiaryType.MyFamilyFiles; + }); + }, + child: ListTile( + title: Text(TranslationBase.of(context).myFamilyFiles), + leading: Radio( + value: BeneficiaryType.MyFamilyFiles, + groupValue: beneficiaryType, + activeColor: Colors.red[800], + onChanged: (BeneficiaryType value) { + setState(() { + beneficiaryType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + beneficiaryType = BeneficiaryType.OtherAccount; + }); + }, + child: ListTile( + title: Text(TranslationBase.of(context).otherAccount), + leading: Radio( + value: BeneficiaryType.OtherAccount, + groupValue: beneficiaryType, + activeColor: Colors.red[800], + onChanged: (BeneficiaryType value) { + setState(() { + beneficiaryType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(beneficiaryType); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + ), + ), + ), + ), + ), + ], + ) + ], + ), + ) + ], + ); + } +} diff --git a/lib/pages/Blood/dialogs/SelectBloodDialog.dart b/lib/pages/Blood/dialogs/SelectBloodDialog.dart new file mode 100644 index 00000000..23e9e753 --- /dev/null +++ b/lib/pages/Blood/dialogs/SelectBloodDialog.dart @@ -0,0 +1,328 @@ +import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + + +class SelectBloodDialog extends StatefulWidget { + + final Blood bloodType; + final Function(Blood) onValueSelected; + + SelectBloodDialog({Key key, this.bloodType, this.onValueSelected}); + + + + @override + _SelectBloodDialogState createState() => _SelectBloodDialogState(this.bloodType); +} + +class _SelectBloodDialogState extends State { + _SelectBloodDialogState(this.bloodType); + Blood bloodType; + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Container( + child: Column( + children: [ + Divider(), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + bloodType = Blood.Oplus; + }); + }, + child: ListTile( + title: Text("O+"), + leading: Radio( + value: Blood.Oplus, + groupValue: bloodType, + activeColor: Colors.red[800], + onChanged: (Blood value) { + setState(() { + bloodType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + bloodType = Blood.Ominus; + }); + }, + child: ListTile( + title: Text("O-"), + leading: Radio( + value: Blood.Ominus, + groupValue: bloodType, + activeColor: Colors.red[800], + onChanged: (Blood value) { + setState(() { + bloodType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + bloodType = Blood.ABminus; + }); + }, + child: ListTile( + title: Text("AB-"), + leading: Radio( + value: Blood.ABminus, + groupValue: bloodType, + activeColor: Colors.red[800], + onChanged: (Blood value) { + setState(() { + bloodType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + bloodType = Blood.ABplus; + }); + }, + child: ListTile( + title: Text("AB+"), + leading: Radio( + value: Blood.ABplus, + groupValue: bloodType, + activeColor: Colors.red[800], + onChanged: (Blood value) { + setState(() { + bloodType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + bloodType = Blood.Aplus; + }); + }, + child: ListTile( + title: Text("A+"), + leading: Radio( + value: Blood.Aplus, + groupValue: bloodType, + activeColor: Colors.red[800], + onChanged: (Blood value) { + setState(() { + bloodType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + bloodType = Blood.Aminus; + }); + }, + child: ListTile( + title: Text("A-"), + leading: Radio( + value: Blood.Aminus, + groupValue: bloodType, + activeColor: Colors.red[800], + onChanged: (Blood value) { + setState(() { + bloodType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + bloodType = Blood.Bplus; + }); + }, + child: ListTile( + title: Text("B+"), + leading: Radio( + value: Blood.Bplus, + groupValue: bloodType, + activeColor: Colors.red[800], + onChanged: (Blood value) { + setState(() { + bloodType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + bloodType = Blood.Bminus; + }); + }, + child: ListTile( + title: Text("B-"), + leading: Radio( + value: Blood.Bminus, + groupValue: bloodType, + activeColor: Colors.red[800], + onChanged: (Blood value) { + setState(() { + bloodType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(bloodType); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + ), + ), + ), + ), + ), + ], + ) + ], + ), + ) + ], + ); + } +} diff --git a/lib/pages/Blood/dialogs/SelectGenderDialog.dart b/lib/pages/Blood/dialogs/SelectGenderDialog.dart new file mode 100644 index 00000000..295c6dcd --- /dev/null +++ b/lib/pages/Blood/dialogs/SelectGenderDialog.dart @@ -0,0 +1,146 @@ +import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SelectGenderDialog extends StatefulWidget { + final Gender beneficiaryType; + final Function(Gender) onValueSelected; + + SelectGenderDialog({Key key, this.beneficiaryType, this.onValueSelected}); + + @override + _SelectGenderDialogState createState() => + _SelectGenderDialogState(this.beneficiaryType); +} + +class _SelectGenderDialogState extends State { + _SelectGenderDialogState(this.beneficiaryType); + Gender beneficiaryType; + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Container( + child: Column( + children: [ + Divider(), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + beneficiaryType = Gender.Male; + }); + }, + child: ListTile( + title: Text("Male"), + leading: Radio( + value: Gender.Male, + groupValue: beneficiaryType, + activeColor: Colors.red[800], + onChanged: (Gender value) { + setState(() { + beneficiaryType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + beneficiaryType = Gender.Female; + }); + }, + child: ListTile( + title: Text("Female"), + leading: Radio( + value: Gender.Female, + groupValue: beneficiaryType, + activeColor: Colors.red[800], + onChanged: (Gender value) { + setState(() { + beneficiaryType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(beneficiaryType); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + ), + ), + ), + ), + ), + ], + ) + ], + ), + ) + ], + ); + } +} diff --git a/lib/pages/Blood/dialogs/SelectHospitalDialog.dart b/lib/pages/Blood/dialogs/SelectHospitalDialog.dart new file mode 100644 index 00000000..9a4a359d --- /dev/null +++ b/lib/pages/Blood/dialogs/SelectHospitalDialog.dart @@ -0,0 +1,129 @@ +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SelectHospitalDialog extends StatefulWidget { + final List hospitals; + final Function(HospitalsModel) onValueSelected; + HospitalsModel selectedHospital; + + SelectHospitalDialog( + {Key key, this.hospitals, this.onValueSelected, this.selectedHospital}); + + @override + _SelectHospitalDialogState createState() => _SelectHospitalDialogState(); +} + +class _SelectHospitalDialogState extends State { + @override + void initState() { + super.initState(); + widget.selectedHospital = widget.selectedHospital ?? widget.hospitals[0]; + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + children: [ + Divider(), + ...List.generate( + widget.hospitals.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedHospital = widget.hospitals[index]; + }); + }, + child: ListTile( + title: Text(widget.hospitals[index].name + + ' ${widget.hospitals[index].distanceInKilometers} KM'), + leading: Radio( + value: widget.hospitals[index], + groupValue: widget.selectedHospital, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedHospital = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedHospital); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} diff --git a/lib/pages/Blood/dialogs/SelectPatientFamilyDialog.dart b/lib/pages/Blood/dialogs/SelectPatientFamilyDialog.dart new file mode 100644 index 00000000..5808aed8 --- /dev/null +++ b/lib/pages/Blood/dialogs/SelectPatientFamilyDialog.dart @@ -0,0 +1,130 @@ +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SelectPatientFamilyDialog extends StatefulWidget { + final List getAllSharedRecordsByStatusList; + final Function(GetAllSharedRecordsByStatusList) onValueSelected; + GetAllSharedRecordsByStatusList selectedPatientFamily; + + SelectPatientFamilyDialog({Key key, this.getAllSharedRecordsByStatusList, this.onValueSelected,this.selectedPatientFamily}); + + @override + _SelectPatientFamilyDialogState createState() => _SelectPatientFamilyDialogState(); +} + +class _SelectPatientFamilyDialogState extends State { + + @override + void initState() { + super.initState(); + widget.selectedPatientFamily = widget.selectedPatientFamily?? widget.getAllSharedRecordsByStatusList[0]; + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + children: [ + Divider(), + ...List.generate( + widget.getAllSharedRecordsByStatusList.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedPatientFamily = widget.getAllSharedRecordsByStatusList[index]; + }); + }, + child: ListTile( + title: Text(widget.getAllSharedRecordsByStatusList[index].patientName), + leading: Radio( + value: widget.getAllSharedRecordsByStatusList[index], + groupValue: widget.selectedPatientFamily, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedPatientFamily = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedPatientFamily); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} diff --git a/lib/pages/Blood/dialogs/SelectPatientInfoDialog.dart b/lib/pages/Blood/dialogs/SelectPatientInfoDialog.dart new file mode 100644 index 00000000..bea4f694 --- /dev/null +++ b/lib/pages/Blood/dialogs/SelectPatientInfoDialog.dart @@ -0,0 +1,130 @@ +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SelectPatientInfoDialog extends StatefulWidget { + final List patientInfoList ; + final Function(PatientInfo) onValueSelected; + PatientInfo selectedPatientInfo; + + SelectPatientInfoDialog({Key key, this.patientInfoList, this.onValueSelected,this.selectedPatientInfo}); + + @override + _SelectPatientInfoDialogState createState() => _SelectPatientInfoDialogState(); +} + +class _SelectPatientInfoDialogState extends State { + + @override + void initState() { + super.initState(); + widget.selectedPatientInfo = widget.selectedPatientInfo?? widget.patientInfoList[0]; + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + children: [ + Divider(), + ...List.generate( + widget.patientInfoList.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedPatientInfo = widget.patientInfoList[index]; + }); + }, + child: ListTile( + title: Text(widget.patientInfoList[index].fullName), + leading: Radio( + value: widget.patientInfoList[index], + groupValue: widget.selectedPatientInfo, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedPatientInfo = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedPatientInfo); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} diff --git a/lib/pages/Blood/my_balance_page.dart b/lib/pages/Blood/my_balance_page.dart new file mode 100644 index 00000000..26665c2b --- /dev/null +++ b/lib/pages/Blood/my_balance_page.dart @@ -0,0 +1,110 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import 'advance_payment_page.dart'; +import 'blood_donation.dart'; + +class MyBalancePage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getPatientAdvanceBalanceAmount(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).myBalances, + body: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).balanceAmount, + color: Colors.black, + bold: true, + ), + SizedBox( + height: 15, + ), + Container( + padding: EdgeInsets.all(8), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + color: HexColor('#B61422'), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(7), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + TranslationBase.of(context).totalBalance, + color: Colors.white, + ), + Texts( + '${model.totalAdvanceBalanceAmount ?? 0} SAR', + color: Colors.white, + bold: true, + ), + ], + ), + ), + SizedBox( + height: 9, + ), + ...List.generate( + model.patientAdvanceBalanceAmountList.length, + (index) => Container( + padding: EdgeInsets.all(8), + height: 65, + margin: EdgeInsets.only(top: 8), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(7), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(model.patientAdvanceBalanceAmountList[index] + .projectDescription), + Texts( + '${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} SAR', + bold: true, + ), + ], + ), + ), + ), + ], + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + padding: EdgeInsets.all(12), + child: SecondaryButton( + // color: Colors.grey[900], + textColor: Colors.white, + label: TranslationBase.of(context).createAdvancedPayment, + onTap: () { + Navigator.push( + context, + //FadePage(page: AdvancePaymentPage())); + FadePage(page: BloodDonationPage())); + }, + ), + ), + ), + ); + } +} diff --git a/lib/pages/Blood/new_text_Field.dart b/lib/pages/Blood/new_text_Field.dart new file mode 100644 index 00000000..ad9eb580 --- /dev/null +++ b/lib/pages/Blood/new_text_Field.dart @@ -0,0 +1,239 @@ +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +class NumberTextInputFormatter extends TextInputFormatter { + @override + TextEditingValue formatEditUpdate( + TextEditingValue oldValue, TextEditingValue newValue) { + final int newTextLength = newValue.text.length; + int selectionIndex = newValue.selection.end; + int usedSubstringIndex = 0; + final StringBuffer newText = StringBuffer(); + if (newTextLength >= 1) { + newText.write('('); + if (newValue.selection.end >= 1) selectionIndex++; + } + if (newTextLength >= 4) { + newText.write(newValue.text.substring(0, usedSubstringIndex = 3) + ') '); + if (newValue.selection.end >= 3) selectionIndex += 2; + } + if (newTextLength >= 7) { + newText.write(newValue.text.substring(3, usedSubstringIndex = 6) + '-'); + if (newValue.selection.end >= 6) selectionIndex++; + } + if (newTextLength >= 11) { + newText.write(newValue.text.substring(6, usedSubstringIndex = 10) + ' '); + if (newValue.selection.end >= 10) selectionIndex++; + } + // Dump the rest. + if (newTextLength >= usedSubstringIndex) + newText.write(newValue.text.substring(usedSubstringIndex)); + return TextEditingValue( + text: newText.toString(), + selection: TextSelection.collapsed(offset: selectionIndex), + ); + } +} + +final _mobileFormatter = NumberTextInputFormatter(); + +class NewTextFields extends StatefulWidget { + NewTextFields( + {Key key, + this.type, + this.hintText, + this.suffixIcon, + this.autoFocus, + this.onChanged, + this.initialValue, + this.minLines, + this.maxLines, + this.inputFormatters, + this.padding, + this.focus = false, + this.maxLengthEnforced = true, + this.suffixIconColor, + this.inputAction, + this.onSubmit, + this.keepPadding = true, + this.textCapitalization = TextCapitalization.none, + this.controller, + this.keyboardType, + this.validator, + this.borderOnlyError = false, + this.onSaved, + this.onSuffixTap, + this.readOnly: false, + this.maxLength, + this.prefixIcon, + this.bare = false, + this.onTap, + this.fontSize = 16.0, + this.fontWeight = FontWeight.w700, + this.autoValidate = false, + this.hintColor,this.isEnabled=true}) + : super(key: key); + + final String hintText; + + // final String initialValue; + final String type; + final bool autoFocus; + final IconData suffixIcon; + final Color suffixIconColor; + final Icon prefixIcon; + final VoidCallback onTap; + final TextEditingController controller; + final TextInputType keyboardType; + final FormFieldValidator validator; + final Function onSaved; + final Function onSuffixTap; + final Function onChanged; + final Function onSubmit; + final bool readOnly; + final int maxLength; + final int minLines; + final int maxLines; + final bool maxLengthEnforced; + final bool bare; + final bool isEnabled; + final TextInputAction inputAction; + final double fontSize; + final FontWeight fontWeight; + final bool keepPadding; + final TextCapitalization textCapitalization; + final List inputFormatters; + final bool autoValidate; + final EdgeInsets padding; + final bool focus; + final bool borderOnlyError; + final Color hintColor; + final String initialValue; + @override + _NewTextFieldsState createState() => _NewTextFieldsState(); +} + +class _NewTextFieldsState extends State { + final FocusNode _focusNode = FocusNode(); + bool focus = false; + bool view = false; + + @override + void initState() { + super.initState(); + _focusNode.addListener(() { + setState(() { + focus = _focusNode.hasFocus; + }); + }); + } + + @override + void didUpdateWidget(NewTextFields oldWidget) { + if (widget.focus) _focusNode.requestFocus(); + super.didUpdateWidget(oldWidget); + } + + @override + void dispose() { + _focusNode.dispose(); + super.dispose(); + } + + + bool _determineReadOnly() { + if (widget.readOnly != null && widget.readOnly) { + _focusNode.unfocus(); + return true; + } else { + return false; + } + } + + @override + Widget build(BuildContext context) { + return AnimatedContainer( + duration: Duration(milliseconds: 300), + decoration:BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Container( + margin: EdgeInsets.only(top: 8), + + child: TextFormField( + enabled: widget.isEnabled, + initialValue: widget.initialValue, + keyboardAppearance: Theme.of(context).brightness, + scrollPhysics: BouncingScrollPhysics(), + autovalidate: widget.autoValidate, + textCapitalization: widget.textCapitalization, + onFieldSubmitted: widget.inputAction == TextInputAction.next + ? (widget.onSubmit != null + ? widget.onSubmit + : (val) { + _focusNode.nextFocus(); + }) + : widget.onSubmit, + textInputAction: widget.inputAction, + minLines: widget.minLines ?? 1, + maxLines: widget.maxLines ?? 1, + maxLengthEnforced: widget.maxLengthEnforced, + onChanged: widget.onChanged, + focusNode: _focusNode, + maxLength: widget.maxLength ?? null, + controller: widget.controller, + keyboardType: widget.keyboardType, + readOnly: _determineReadOnly(), + obscureText: widget.type == "password" && !view ? true : false, + autofocus: widget.autoFocus ?? false, + validator: widget.validator, + onSaved: widget.onSaved, + + style: Theme.of(context) + .textTheme + .body2 + .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + inputFormatters: widget.keyboardType == TextInputType.phone + ? [ + WhitelistingTextInputFormatter.digitsOnly, + _mobileFormatter, + ] + : widget.inputFormatters, + decoration: InputDecoration( + labelText: widget.hintText, + labelStyle: TextStyle(color: Colors.black), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Theme.of(context) + .errorColor + .withOpacity(0.5), + width: 1.0), + borderRadius: BorderRadius.circular(12.0)), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Theme.of(context) + .errorColor + .withOpacity(0.5), + width: 1.0), + borderRadius: BorderRadius.circular(8.0)), + focusedBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12)), + disabledBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12)), + enabledBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/Blood/user_agreement_page.dart b/lib/pages/Blood/user_agreement_page.dart new file mode 100644 index 00000000..d05725b4 --- /dev/null +++ b/lib/pages/Blood/user_agreement_page.dart @@ -0,0 +1,55 @@ +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; + +class UserAgreementPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: "User Agreement", + + body: + Container( + child:ListView( + scrollDirection: Axis.vertical, + children: [ + /////////// + Column( + children: [ + SizedBox( + height: 20, + ), + Container( + child:Text("Communication via email, text messages and phone calls",textAlign: TextAlign.center,style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16)), + ), + SizedBox( + height: 20, + ), + Container( + child: + Text("I understand that the contact number or Email that \n I have provided on registration will be used for communication by HMG.\n I hereby agree to be notified by HMG through SMS, Email or any other method for appointments notifications, current HMG’s medical services, and any services introduced by the HMG in the future or any modifications made to the services offered by the HMG. And these messages may be submitted as evidence where the HMG has the right to use at any time whatsoever and as it sees fit.",textAlign: TextAlign.center,style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16)), + ), + SizedBox( + height: 20, + ), + Container( + child: + Text("I understand the risks of communicating by email and text messages, in particular the privacy risks. \nI understand that HMG cannot guarantee the security and confidentiality of email or text communication. HMG will not be responsible for messages that are not received or delivered due to technical failure, or for disclosure of confidential information unless caused by intentional misconduct.",textAlign: TextAlign.center,style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16)), + ), + SizedBox( + height: 20, + ), + Container( + child: + Text("\b I hereby agree to receive emails, text messages, phone calls for appointments notifications, special promotions and new features or products introduced by HMG or any third party.",textAlign: TextAlign.center,style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16)), + ), + ], + ) + /////////// + ]) + + + + )); + } +} diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart new file mode 100644 index 00000000..d7e08a66 --- /dev/null +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -0,0 +1,630 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:provider/provider.dart'; +import 'package:rating_bar/rating_bar.dart'; + +import 'BookSuccess.dart'; + +class BookConfirm extends StatefulWidget { + DoctorList doctor; + String selectedDate; + String selectedTime; + + String appoDateFormatted = ""; + String appoTimeFormatted = ""; + bool isLiveCareAppointment; + + BookConfirm( + {@required this.doctor, + @required this.selectedDate, + @required this.isLiveCareAppointment, + @required this.selectedTime}); + + DoctorsListService service; + PatientShareResponse patientShareResponse; + AuthenticatedUser authUser; + + @override + _BookConfirmState createState() => _BookConfirmState(); +} + +class _BookConfirmState extends State { + ToDoCountProviderModel toDoProvider; + + @override + void initState() { + widget.authUser = new AuthenticatedUser(); + getPatientData(); + widget.service = new DoctorsListService(); + widget.patientShareResponse = new PatientShareResponse(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + toDoProvider = Provider.of(context); + return AppScaffold( + appBarTitle: TranslationBase.of(context).bookAppo, + isShowAppBar: true, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(20.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + margin: EdgeInsets.only(bottom: 5.0), + alignment: Alignment.center, + child: Text(TranslationBase.of(context).confirmAppoHeading, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 22.0, + color: new Color(0xFF60686b), + letterSpacing: 0.9))), + Divider( + color: Colors.grey[400], + ), + Container( + margin: EdgeInsets.only(top: 15.0), + child: Text(TranslationBase.of(context).docInfo, + style: TextStyle( + fontSize: 22.0, + color: Colors.black, + letterSpacing: 0.9))), + Container( + child: Card( + color: Colors.white, + margin: EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 16.0), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: BorderSide(color: Colors.grey[400], width: 0.6)), + child: Container( + padding: EdgeInsets.all(7.0), + width: MediaQuery.of(context).size.width, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: Image.network(widget.doctor.doctorImageURL, + fit: BoxFit.fill, height: 70.0, width: 70.0), + ), + Container( + width: MediaQuery.of(context).size.width * 0.58, + margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.doctor.doctorTitle + + "" + + widget.doctor.name, + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700], + letterSpacing: 1.0)), + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(widget.doctor.clinicName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 3.0, bottom: 3.0), + child: Text( + getDoctorSpeciality( + widget.doctor.speciality) + .trim(), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: widget + .doctor.actualDoctorRate + .toDouble(), + size: 20.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ], + ), + ], + ), + ), + ], + ), + ), + ), + ), + Container( + margin: EdgeInsets.only(top: 15.0), + child: Text(TranslationBase.of(context).appoInfo, + style: TextStyle( + fontSize: 22.0, + color: Colors.black, + letterSpacing: 0.9))), + Container( + child: Card( + color: Colors.white, + margin: EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 16.0), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: BorderSide(color: Colors.grey[400], width: 0.6)), + child: Container( + padding: EdgeInsets.all(7.0), + width: MediaQuery.of(context).size.width, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0), + child: Image.asset( + "assets/images/new-design/icon_hospital.png"), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0), + child: Text( + TranslationBase.of(context).hospital + + ": " + + widget.doctor.projectName, + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700], + letterSpacing: 1.0)), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0), + child: Image.asset( + "assets/images/new-design/icon_hospital.png"), + ), + Container( + width: MediaQuery.of(context).size.width * 0.7, + margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0), + child: Text( + TranslationBase.of(context).clinic + + ": " + + widget.doctor.clinicName, + overflow: TextOverflow.clip, + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700], + letterSpacing: 1.0)), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + child: Icon( + Icons.today, + color: Colors.grey[700], + ), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), + child: Text( + TranslationBase.of(context).date + + ": " + + getDate(), + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700], + letterSpacing: 1.0)), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + child: Icon( + Icons.timer, + color: Colors.grey[700], + ), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0), + child: Text( + TranslationBase.of(context).time + + ": " + + widget.selectedTime, + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700], + letterSpacing: 1.0)), + ), + ], + ), + ], + ), + ), + ), + ), + Container( + margin: EdgeInsets.only(top: 15.0), + child: Text(TranslationBase.of(context).patientInfo, + style: TextStyle( + fontSize: 22.0, + color: Colors.black, + letterSpacing: 0.9))), + Container( + child: Card( + color: Colors.white, + margin: EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 16.0), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: BorderSide(color: Colors.grey[400], width: 0.6)), + child: Container( + padding: EdgeInsets.all(7.0), + width: MediaQuery.of(context).size.width, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.all(10.0), + child: Image.asset( + "assets/images/new-design/appointment_info.png", + fit: BoxFit.fill, + height: 60.0, + width: 60.0), + ), + Container( + width: MediaQuery.of(context).size.width * 0.58, + margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.authUser.firstName + + " " + + widget.authUser.lastName, + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[900], + letterSpacing: 1.0)), + Container( + margin: EdgeInsets.only(top: 5.0), + child: Text( + TranslationBase.of(context).gender + ": " + + widget.authUser.genderDescription, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 5.0, bottom: 3.0), + child: Text( + TranslationBase.of(context).age + ": " + widget.authUser.age.toString(), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + ], + ), + ), + ], + ), + ), + ), + ), + SizedBox( + height: 120.0, + ), + ], + ), + ), + ), + bottomSheet: Container( + width: MediaQuery.of(context).size.width, + height: 50.0, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + if (!widget.isLiveCareAppointment) { + insertAppointment(context, widget.doctor); + } else { + insertLiveCareScheduledAppointment(context, widget.doctor); + } + }, + child: Text(TranslationBase.of(context).bookNow, + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ); + } + + cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, + BuildContext context) { + ConfirmDialog.closeAlertDialog(context); + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service.cancelAppointment(appo, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + Future.delayed(new Duration(milliseconds: 1500), () { + if (!widget.isLiveCareAppointment) { + insertAppointment(context, widget.doctor); + } else { + insertLiveCareScheduledAppointment(context, widget.doctor); + } + }); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + GifLoaderDialogUtils.hideDialog(context); + }); + } + + insertAppointment(context, DoctorList docObject) { + GifLoaderDialogUtils.showMyDialog(context); + AppoitmentAllHistoryResultList appo; + widget.service + .insertAppointment( + docObject.doctorID, + docObject.clinicID, + docObject.projectID, + widget.selectedTime, + widget.selectedDate, + context) + .then((res) { + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); + print(res['AppointmentNo']); + + Future.delayed(new Duration(milliseconds: 500), () { + getPatientShare(context, res['AppointmentNo'], docObject.clinicID, + docObject.projectID, docObject); + getToDoCount(); + }); + } else { + GifLoaderDialogUtils.hideDialog(context); + appo = new AppoitmentAllHistoryResultList(); + appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo']; + appo.clinicID = res['SameClinicApptList'][0]['DoctorID']; + appo.projectID = res['SameClinicApptList'][0]['ProjectID']; + appo.endTime = res['SameClinicApptList'][0]['EndTime']; + appo.startTime = res['SameClinicApptList'][0]['StartTime']; + appo.doctorID = res['SameClinicApptList'][0]['DoctorID']; + appo.isLiveCareAppointment = false; + appo.originalClinicID = 0; + appo.originalProjectID = 0; + appo.appointmentDate = res['SameClinicApptList'][0]['AppointmentDate']; + + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: res['ErrorEndUserMessage'], + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => {cancelAppointment(docObject, appo, context)}, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + }).catchError((err) { + AppToast.showErrorToast(message: err); + print(err); + }); + } + + insertLiveCareScheduledAppointment(context, DoctorList docObject) { + GifLoaderDialogUtils.showMyDialog(context); + AppoitmentAllHistoryResultList appo; + widget.service + .insertLiveCareScheduleAppointment( + docObject.doctorID, + docObject.clinicID, + docObject.projectID, + docObject.serviceID, + widget.selectedTime, + widget.selectedDate, + context) + .then((res) { + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: "Appointment Booked Successfully"); + print(res['AppointmentNo']); + + Future.delayed(new Duration(milliseconds: 500), () { + getLiveCareAppointmentPatientShare(context, res['AppointmentNo'], + docObject.clinicID, docObject.projectID, docObject); + getToDoCount(); + }); + } else { + GifLoaderDialogUtils.hideDialog(context); + appo = new AppoitmentAllHistoryResultList(); + appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo']; + appo.clinicID = res['SameClinicApptList'][0]['DoctorID']; + appo.projectID = res['SameClinicApptList'][0]['ProjectID']; + appo.endTime = res['SameClinicApptList'][0]['EndTime']; + appo.startTime = res['SameClinicApptList'][0]['StartTime']; + appo.doctorID = res['SameClinicApptList'][0]['DoctorID']; + appo.isLiveCareAppointment = true; + appo.originalClinicID = 0; + appo.originalProjectID = 0; + appo.appointmentDate = res['SameClinicApptList'][0]['AppointmentDate']; + + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: res['ErrorEndUserMessage'], + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => {cancelAppointment(docObject, appo, context)}, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + getToDoCount() { + toDoProvider.setState(0, true); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + print(res['AppointmentActiveNumber']); + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber'], true); + } else {} + }).catchError((err) { + print(err); + }); + } + + getPatientShare(context, String appointmentNo, int clinicID, int projectID, + DoctorList docObject) { + widget.service + .getPatientShare(appointmentNo, clinicID, projectID, context) + .then((res) { + print(res); + widget.patientShareResponse = new PatientShareResponse.fromJson(res); + navigateToBookSuccess(context, docObject, widget.patientShareResponse); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + navigateToHome(context); + print(err); + }); + } + + getLiveCareAppointmentPatientShare(context, String appointmentNo, + int clinicID, int projectID, DoctorList docObject) { + GifLoaderDialogUtils.hideDialog(context); + widget.service + .getLiveCareAppointmentPatientShare( + appointmentNo, clinicID, projectID, context) + .then((res) { + print(res); + widget.patientShareResponse = new PatientShareResponse.fromJson(res); + navigateToBookSuccess(context, docObject, widget.patientShareResponse); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + navigateToHome(context); + print(err); + }); + } + + String getTime(DateTime dateTime) { + final DateFormat formatter = DateFormat('HH:mm'); + setState(() { + widget.appoTimeFormatted = formatter.format(dateTime); + print(widget.appoTimeFormatted); + }); + return widget.appoTimeFormatted; + } + + String getDate() { + var dateObj = new DateTime( + int.parse(widget.selectedDate.split("-")[0]), + int.parse(widget.selectedDate.split("-")[1]), + int.parse(widget.selectedDate.split("-")[2]), + 0, + 0, + 0, + 0); + + setState(() { + widget.appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString(); + }); + + return widget.appoDateFormatted; + } + + String getDoctorSpeciality(List docSpecial) { + String docSpeciality = ""; + docSpecial.forEach((v) { + docSpeciality = docSpeciality + v + "\n"; + }); + return docSpeciality; + } + + getPatientData() async { + AppSharedPreferences sharedPref = AppSharedPreferences(); + if (await sharedPref.getObject(USER_PROFILE) != null) { + var data = + AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + setState(() { + print(data); + widget.authUser = data; + }); + } + } + + Future navigateToHome(context) async { + Navigator.of(context).popAndPushNamed(HOME); + } + + Future navigateToBookSuccess(context, DoctorList docObject, + PatientShareResponse patientShareResponse) async { + GifLoaderDialogUtils.hideDialog(context); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => BookSuccess( + docObject: docObject, + patientShareResponse: patientShareResponse, + appoDateFormatted: widget.appoDateFormatted, + appoTimeFormatted: widget.selectedTime))); + } +} diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart new file mode 100644 index 00000000..f513c434 --- /dev/null +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -0,0 +1,938 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_inappwebview/flutter_inappwebview.dart'; + +import 'QRCode.dart'; + +class BookSuccess extends StatefulWidget { + PatientShareResponse patientShareResponse; + DoctorList docObject; + + MyInAppBrowser browser; + final ChromeSafariBrowser chromeBrowser = + new MyChromeSafariBrowser(new MyInAppBrowser()); + + String appoDateFormatted; + String appoTimeFormatted; + + BookSuccess( + {@required this.patientShareResponse, + @required this.docObject, + @required this.appoDateFormatted, + @required this.appoTimeFormatted}); + + @override + _BookSuccessState createState() => _BookSuccessState(); +} + +class _BookSuccessState extends State { + AppSharedPreferences sharedPref = AppSharedPreferences(); + AuthenticatedUser authUser; + + @override + Widget build(BuildContext context) { + return Scaffold( + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.only(bottom: 10.0), + color: new Color(0xFF20bc44), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + alignment: Alignment.center, + margin: EdgeInsets.only(top: 40.0), + child: Text(TranslationBase.of(context).bookSuccess, + style: TextStyle( + color: Colors.white, + fontSize: 18.0, + fontWeight: FontWeight.bold, + letterSpacing: 0.9)), + ), + Container( + margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 20.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.all(10.0), + child: Image.asset( + "assets/images/new-design/check-icon.png", + fit: BoxFit.fill, + height: 80.0, + width: 80.0), + ), + Container( + width: MediaQuery.of(context).size.width * 0.62, + margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Text(widget.docObject.projectName, + overflow: TextOverflow.clip, + style: _getTextStyling()), + Container( + margin: EdgeInsets.only(top: 5.0), + child: + Text("Insurance", style: _getTextStyling()), + ), + Container( + margin: EdgeInsets.only(top: 5.0, bottom: 3.0), + child: Text(widget.docObject.clinicName, + overflow: TextOverflow.clip, + style: _getTextStyling()), + ), + Container( + margin: EdgeInsets.only(top: 5.0, bottom: 3.0), + child: Text( + widget.appoDateFormatted + + ", " + + widget.appoTimeFormatted, + overflow: TextOverflow.clip, + style: _getTextStyling()), + ), + Container( + width: MediaQuery.of(context).size.width * 0.65, + margin: EdgeInsets.only(top: 5.0, bottom: 3.0), + child: Text( + widget.docObject.doctorTitle + + " " + + widget.docObject.name, + overflow: TextOverflow.clip, + style: _getTextStyling()), + ), + ], + ), + ), + ], + ), + ), + Container( + alignment: Alignment.center, + decoration: BoxDecoration( + border: Border.all(color: Colors.white, width: 0.5)), + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 10.0), + child: Table( + border: TableBorder( + verticalInside: + BorderSide(width: 0.5, color: Colors.white)), + children: [ + TableRow(children: [ + TableCell( + child: _getNormalText( + TranslationBase.of(context).patientShare)), + TableCell( + child: _getNormalText(TranslationBase.of(context) + .patientShareWithTax)), + ]), + TableRow(children: [ + TableCell( + child: _getHeadingText("SR " + + widget.patientShareResponse.patientShare + .toString())), + TableCell( + child: _getHeadingText("SR " + + widget + .patientShareResponse.patientShareWithTax + .toString())), + ]), + ], + ), + ), + ], + ), + ), + getNextActionWidget(), + ], + ), + ), + bottomNavigationBar: getBottomContainer(), + ); + } + + Widget getBottomContainer() { + switch (widget.patientShareResponse.nextAction) { + case 0: + return Container(); + break; + case 10: + return _getConfirmAppoButtons(); + break; + case 15: + return _getPaymentPendingAppo(); + break; + case 20: + return _getPayNowButtons(); + break; + case 30: + return _getQRButtons(); + break; + case 50: + return _getConfirmAppoButtons(); + break; + } + } + + Widget _getQRButtons() { + return Container( + alignment: Alignment.bottomCenter, + height: MediaQuery.of(context).size.height * 0.18, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { +// navigateToQR(context); + getAppoQR(context); + }, + child: Text(TranslationBase.of(context).viewQR.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ], + ), + ); + } + + Widget _getPayNowButtons() { + return Container( + alignment: Alignment.bottomCenter, + height: MediaQuery.of(context).size.height * 0.2, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + startPaymentProcess(); + }, + child: Text(TranslationBase.of(context).payNow.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF40ACC9), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + navigateToHome(context); + }, + child: Text(TranslationBase.of(context).payLater.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ], + ), + ); + } + + Widget _getConfirmAppoButtons() { + return Container( + alignment: Alignment.bottomCenter, + margin: EdgeInsets.only(bottom: 5.0), + height: MediaQuery.of(context).size.height * 0.15, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + AppoitmentAllHistoryResultList appo = + new AppoitmentAllHistoryResultList(); + appo.clinicID = widget.docObject.clinicID; + appo.projectID = widget.docObject.projectID; + appo.appointmentNo = widget.patientShareResponse.appointmentNo; + appo.serviceID = widget.patientShareResponse.serviceID; + appo.isLiveCareAppointment = + widget.patientShareResponse.isLiveCareAppointment; + appo.doctorID = widget.patientShareResponse.doctorID; + confirmAppointment(appo); + }, + child: Text( + widget.patientShareResponse.isLiveCareAppointment + ? TranslationBase.of(context) + .confirmLiveCare + .toUpperCase() + : TranslationBase.of(context).confirm.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF40ACC9), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + navigateToHome(context); + }, + child: Text( + TranslationBase.of(context).confirmLater.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ], + ), + ); + } + + Widget getNextActionWidget() { + switch (widget.patientShareResponse.nextAction) { + case 0: + return Container(); + break; + case 10: + return _getConfirmAppo(); + break; + case 15: + return _getPaymentPendingAppo(); + break; + case 20: + return _getPayNowAppo(); + break; + case 30: + return _getQRAppo(); + break; + case 50: + return _getConfirmAppo(); + break; + } + } + + String getNextAction() { + switch (widget.patientShareResponse.nextAction) { + case 0: + return 'No Action'; + break; + case 10: + return 'Confirm'; + break; + case 15: + return 'Payment Pending'; + break; + case 20: + return 'Pay Now'; + break; + case 30: + return 'QR Code'; + break; + case 50: + return 'Confirm LiveCare'; + break; + } + } + + Widget _getConfirmAppo() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + margin: EdgeInsets.only(top: 30.0, bottom: 40.0), + alignment: Alignment.center, + child: Text(TranslationBase.of(context).confirmAppo, + style: TextStyle(fontSize: 18.0, letterSpacing: 0.8)), + ), + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: Container( + padding: EdgeInsets.only(left: 10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + _getBulletPoint("1"), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Text(TranslationBase.of(context).upcomingConfirm, + overflow: TextOverflow.clip, + style: TextStyle(fontSize: 13.0)), + ), + ], + ), + ), + ), + ], + ), + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: Container( + padding: EdgeInsets.only(top: 20.0, left: 10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + _getBulletPoint("2"), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Text( + TranslationBase.of(context).upcomingConfirmMore, + overflow: TextOverflow.clip, + style: TextStyle(fontSize: 13.0)), + ), + ], + ), + ), + ), + ], + ), + Container( + margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0), + child: Image.asset("assets/images/new-design/payment-method.png"), + ), + ], + ); + } + + Widget _getPaymentPendingAppo() { + return Container(); + } + + confirmAppointment(AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); + service + .confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID, + appo.isLiveCareAppointment, context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + if (appo.isLiveCareAppointment) { + insertLiveCareVIDARequest(appo); + } else { + navigateToHome(context); + } + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); + service + .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, + appo.serviceID, appo.doctorID, context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + navigateToHome(context); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + Widget _getPayNowAppo() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + margin: EdgeInsets.only(top: 20.0, bottom: 0.0), + alignment: Alignment.center, + child: Text(TranslationBase.of(context).payNowBookSuccess, + style: TextStyle( + fontSize: 20.0, + letterSpacing: 0.8, + fontWeight: FontWeight.bold)), + ), + Container( + alignment: Alignment.center, + child: Image.asset("assets/images/new-design/no-wait-queue.png", + width: 120.0, height: 120.0), + ), + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: Container( + padding: EdgeInsets.only(left: 10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + _getBulletPoint("1"), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Text( + TranslationBase.of(context).payNowBookSuccesstext1, + overflow: TextOverflow.fade, + style: TextStyle(fontSize: 13.0)), + ), + ], + ), + ), + ), + ], + ), + Container( + margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0), + child: Image.asset("assets/images/new-design/payment-method.png"), + ), + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: Container( + padding: EdgeInsets.only(top: 0.0, left: 10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + _getBulletPoint("2"), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Text( + TranslationBase.of(context).payNowBookSuccesstext2, + overflow: TextOverflow.clip, + style: TextStyle(fontSize: 13.0)), + ), + ], + ), + ), + ), + ], + ), + ], + ); + } + + startPaymentProcess() { + navigateToPaymentMethod(context, widget.patientShareResponse); + } + + Future navigateToPaymentMethod( + context, PatientShareResponse patientShareResponse) async { + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + setState(() { + authUser = data; + }); + } + + AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); + appo.projectID = widget.patientShareResponse.projectID; + appo.clinicID = widget.patientShareResponse.clinicID; + appo.appointmentNo = widget.patientShareResponse.appointmentNo; + + Navigator.push( + context, MaterialPageRoute(builder: (context) => PaymentMethod())) + .then((value) { + print(value); + if (value != null) { + openPayment( + value, + authUser, + double.parse(patientShareResponse.patientShareWithTax.toString()), + patientShareResponse, + appo); + } + }); + } + + openPayment( + String paymentMethod, + AuthenticatedUser authenticatedUser, + double amount, + PatientShareResponse patientShareResponse, + AppoitmentAllHistoryResultList appo) async { + if (paymentMethod == "ApplePay") { + await widget.chromeBrowser.open( + url: "https://applepay-datatrans-sample.herokuapp.com/", + options: ChromeSafariBrowserClassOptions( + android: AndroidChromeCustomTabsOptions( + addDefaultShareMenuItem: false), + ios: IOSSafariOptions(barCollapsingEnabled: true))); + } else { + widget.browser = new MyInAppBrowser( + onExitCallback: onBrowserExit, + appo: appo, + onLoadStartCallback: onBrowserLoadStart); + + widget.browser.openPaymentBrowser( + amount, + "Appointment check in", + Utils.getAppointmentTransID( + appo.projectID, appo.clinicID, appo.appointmentNo), + appo.projectID.toString(), + authenticatedUser.emailAddress, + paymentMethod, + authenticatedUser.patientType, + authenticatedUser.firstName, + authenticatedUser.patientID, + authenticatedUser, + widget.browser); + } + } + + onBrowserLoadStart(String url) { + print("onBrowserLoadStart"); + print(url); + + MyInAppBrowser.successURLS.forEach((element) { + if (url.contains(element)) { + if (widget.browser.isOpened()) widget.browser.close(); + MyInAppBrowser.isPaymentDone = true; + return; + } + }); + + MyInAppBrowser.errorURLS.forEach((element) { + if (url.contains(element)) { + if (widget.browser.isOpened()) widget.browser.close(); + MyInAppBrowser.isPaymentDone = false; + return; + } + }); + } + + onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { + print("onBrowserExit Called!!!!"); + if (isPaymentMade) checkPaymentStatus(appo); + } + + checkPaymentStatus(AppoitmentAllHistoryResultList appo) { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service + .checkPaymentStatus( + Utils.getAppointmentTransID( + appo.projectID, appo.clinicID, appo.appointmentNo), + context) + .then((res) { + print("Printing Payment Status Reponse!!!!"); + print(res); + String paymentInfo = res['Response_Message']; + if (paymentInfo == 'Success') { + createAdvancePayment(res, appo); + } else { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: res['Response_Message']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + getApplePayAPQ(AppoitmentAllHistoryResultList appo) { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service + .checkPaymentStatus( + Utils.getAppointmentTransID( + appo.projectID, appo.clinicID, appo.appointmentNo), + context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + print("Printing Payment Status Reponse!!!!"); + print(res); + String paymentInfo = res['Response_Message']; + if (paymentInfo == 'Success') { + createAdvancePayment(res, appo); + } else { + AppToast.showErrorToast(message: res['Response_Message']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + String paymentReference = res['Fort_id'].toString(); + service + .createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], + res['Fort_id'], res['PaymentMethod'], context) + .then((res) { + print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); + addAdvancedNumberRequest( + res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), + paymentReference, + appo.appointmentNo.toString()); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + addAdvancedNumberRequest( + String advanceNumber, String paymentReference, String appointmentID) { + DoctorsListService service = new DoctorsListService(); + service + .addAdvancedNumberRequest( + advanceNumber, paymentReference, appointmentID, context) + .then((res) { + print(res); + getAppoQR(context); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + Widget _getQRAppo() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + margin: EdgeInsets.only(top: 30.0, bottom: 40.0), + alignment: Alignment.center, + child: Text(TranslationBase.of(context).noNeedToWaitInLine, + style: TextStyle(fontSize: 18.0, letterSpacing: 0.8)), + ), + Container( + alignment: Alignment.center, + child: Image.asset("assets/images/new-design/device_icon.png", + width: 120.0, height: 120.0), + ), + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: Container( + padding: EdgeInsets.only(left: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + margin: EdgeInsets.only(top: 15.0), + child: Row( + children: [ + _getBulletPoint("1"), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Text( + TranslationBase.of(context).useQRAppoAttend, + overflow: TextOverflow.fade, + style: TextStyle(fontSize: 13.0)), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 15.0), + child: Row( + children: [ + _getBulletPoint("2"), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Text( + TranslationBase.of(context).passQRAppoAttend, + overflow: TextOverflow.fade, + style: TextStyle(fontSize: 13.0)), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 15.0), + child: Row( + children: [ + _getBulletPoint("3"), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Text( + TranslationBase.of(context).sitWaitingQR, + overflow: TextOverflow.fade, + style: TextStyle(fontSize: 13.0)), + ), + ], + ), + ), + ], + ), + ), + ), + ], + ), +// Container( +// alignment: Alignment.bottomCenter, +// height: MediaQuery.of(context).size.height * 0.18, +// child: Column( +// mainAxisAlignment: MainAxisAlignment.end, +// children: [ +// ButtonTheme( +// shape: RoundedRectangleBorder( +// borderRadius: BorderRadius.circular(10.0), +// ), +// minWidth: MediaQuery.of(context).size.width * 0.7, +// height: 45.0, +// child: RaisedButton( +// color: new Color(0xFF60686b), +// textColor: Colors.white, +// disabledTextColor: Colors.white, +// disabledColor: new Color(0xFFbcc2c4), +// onPressed: () { +// // navigateToQR(context); +// getAppoQR(context); +// }, +// child: Text(TranslationBase.of(context).viewQR.toUpperCase(), +// style: TextStyle(fontSize: 18.0)), +// ), +// ), +// ], +// ), +// ), + ], + ); + } + + _getTextStyling() { + return TextStyle(fontSize: 14.0, color: Colors.white, letterSpacing: 0.7); + } + + _getBulletPoint(bulletPoint) { + return Container( + margin: EdgeInsets.only(left: 20.0, right: 20.0), + decoration: BoxDecoration(shape: BoxShape.circle, color: Colors.black), + width: 20.0, + height: 20.0, + child: Center( + child: Text(bulletPoint, + style: TextStyle( + color: Colors.white, + fontSize: 12.0, + )), + ), + ); + } + + _getHeadingText(text) { + return Container( + padding: EdgeInsets.only(bottom: 10.0), + child: Text(text, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 26.0, + fontFamily: 'Open-Sans', + letterSpacing: 0.5, + color: Colors.white))); + } + + Future navigateToHome(context) async { + Navigator.of(context).popAndPushNamed(HOME); + } + + getAppoQR(context) { + DoctorsListService service = new DoctorsListService(); + service + .generateAppointmentQR(widget.patientShareResponse, context) + .then((res) { + print(res); + GifLoaderDialogUtils.hideDialog(context); + navigateToQR(context, res['AppointmentQR']); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + Future navigateToQR(context, String appoQR) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => QRCode( + patientShareResponse: widget.patientShareResponse, + appoQR: appoQR, + ))); + } + + _getNormalText(text) { + return Container( + margin: EdgeInsets.only(top: 5.0), + padding: EdgeInsets.only(top: 5.0, bottom: 5.0), + child: Text(text, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 12, + fontFamily: 'Open-Sans', + letterSpacing: 0.5, + color: Colors.white)), + ); + } +} diff --git a/lib/pages/BookAppointment/BookingOptions.dart b/lib/pages/BookAppointment/BookingOptions.dart new file mode 100644 index 00000000..83af454f --- /dev/null +++ b/lib/pages/BookAppointment/BookingOptions.dart @@ -0,0 +1,76 @@ +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/CardCommon.dart'; +import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +import '../../uitl/translations_delegate_base.dart'; + +class BookingOptions extends StatefulWidget { + final bool isAppbar; + + BookingOptions({this.isAppbar = false}); + + @override + _BookingOptionsState createState() => _BookingOptionsState(); +} + +class _BookingOptionsState extends State { + LocationUtils locationUtils; + + @override + void initState() { + locationUtils = + new LocationUtils(isShowConfirmDialog: true, context: context); + WidgetsBinding.instance + .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); + + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: widget.isAppbar, + isShowDecPage: false, + appBarTitle: TranslationBase.of(context).bookAppo, + body: Container( + margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(TranslationBase.of(context).searchBy, + style: TextStyle( + fontSize: 24.0, + letterSpacing: 1.0, + fontWeight: FontWeight.bold, + color: new Color(0xFF60686b))), + Container( + margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: CardCommon( + image: 'assets/images/new-design/search_by_clinic.png', + text: TranslationBase.of(context).clinic, + subText: TranslationBase.of(context).name, + type: 0, + ), + ), + Expanded( + child: CardCommon( + image: 'assets/images/new-design/search_by_doctor.png', + text: TranslationBase.of(context).doctor, + subText: TranslationBase.of(context).name, + type: 1), + ) + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/BookAppointment/DentalComplaints.dart b/lib/pages/BookAppointment/DentalComplaints.dart new file mode 100644 index 00000000..34a7e1e1 --- /dev/null +++ b/lib/pages/BookAppointment/DentalComplaints.dart @@ -0,0 +1,82 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart'; +import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DentalComplaintCard.dart'; +import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +class DentalComplaints extends StatefulWidget { + SearchInfo searchInfo; + + DentalComplaints({@required this.searchInfo}); + + @override + _DentalComplaintsState createState() => _DentalComplaintsState(); +} + +class _DentalComplaintsState extends State { + List complaintsList = []; + AppSharedPreferences sharedPref = AppSharedPreferences(); + bool isDataLoaded = false; + var languageID; + + @override + void initState() { + WidgetsBinding.instance + .addPostFrameCallback((_) => getChiefComplaintsList()); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: "Symptoms", + body: Container( + margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), + child: ListView.builder( + itemCount: complaintsList.length, + itemBuilder: (BuildContext context, int index) { + return Container( + margin: EdgeInsets.only(bottom: 10.0), + child: DentalComplaintCard( + listDentalChiefComplain: complaintsList[index], + languageID: languageID, + ), + ); + }, + ), + ), + ); + } + + getLanguageID() async { + languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + } + + getChiefComplaintsList() { + getLanguageID(); + ClinicListService service = new ClinicListService(); + service + .getChiefComplaintsList( + widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context) + .then((res) { + if (res['MessageStatus'] == 1) { + print(res['List_DentalChiefComplain']); + setState(() { + res['List_DentalChiefComplain'].forEach((v) { + complaintsList.add(new ListDentalChiefComplain.fromJson(v)); + }); + print(complaintsList.length); + }); + } else {} + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } +} diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart new file mode 100644 index 00000000..392eb24c --- /dev/null +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -0,0 +1,538 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:rating_bar/rating_bar.dart'; + +import 'BookConfirm.dart'; +import 'components/DocAvailableAppointments.dart'; +import 'components/DocInfo.dart'; + +class DoctorProfile extends StatefulWidget { + DoctorList doctor; + DoctorProfileList docProfileList; + final bool isOpenAppt; + bool isLiveCareAppointment; + + DoctorProfile( + {@required this.doctor, + @required this.docProfileList, + @required this.isLiveCareAppointment, + this.isOpenAppt = false}); + + AuthenticatedUser authUser; + + @override + _DoctorProfileState createState() => _DoctorProfileState(); +} + +class _DoctorProfileState extends State + with TickerProviderStateMixin { + TabController _tabController; + bool showFooterButton = false; + var event = RobotProvider(); + + AppSharedPreferences sharedPref = AppSharedPreferences(); + + List doctorDetailsList = List(); + + @override + void initState() { + _tabController = new TabController( + length: 2, + vsync: this, + initialIndex: widget.isOpenAppt == true ? 1 : 0); + _tabController = new TabController(length: 2, vsync: this); + widget.authUser = new AuthenticatedUser(); + widget.doctor.speciality = widget.docProfileList.specialty; + getPatientData(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).bookAppo, + isShowAppBar: true, + isShowDecPage: false, + bottomSheet: showFooterButton + ? Container( + width: MediaQuery.of(context).size.width, + height: 50.0, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: goToBookConfirm, + child: Text(TranslationBase.of(context).bookNow, + style: TextStyle(fontSize: 18.0)), + ), + ), + ) + : null, + body: Container( + color: new Color(0xFFf6f6f6), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 20.0), + alignment: Alignment.center, + child: ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: Image.network(widget.doctor.doctorImageURL, + fit: BoxFit.fill, height: 120.0, width: 120.0), + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.center, + child: Text( + widget.doctor.doctorTitle + " " + widget.doctor.name, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 20.0, + color: Colors.grey[900], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.center, + child: Text(widget.doctor.clinicName, + style: TextStyle( + fontSize: 13.0, + color: Colors.grey[900], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: RatingBar.readOnly( + initialRating: + widget.doctor.actualDoctorRate.toDouble(), + size: 35.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + InkWell( + onTap: () { + getDoctorRatingsDetails(); + }, + child: Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: Text( + "(" + + widget.docProfileList.noOfPatientsRate.toString() + + " " + + TranslationBase.of(context).reviews + + ")", + style: TextStyle( + fontSize: 14.0, + color: Colors.blue[800], + letterSpacing: 1.0, + decoration: TextDecoration.underline, + )), + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Divider( + color: Colors.grey[500], + ), + ), + TabBar( + onTap: (index) { + setState(() { + index == 1 + ? showFooterButton = true + : showFooterButton = false; + print(showFooterButton); + }); + }, + tabs: [ + Tab( + child: Text(TranslationBase.of(context).docInfo, + style: TextStyle(color: Colors.black))), + Tab( + child: Text(TranslationBase.of(context).availableAppo, + style: TextStyle(color: Colors.black)), + ) + ], + controller: _tabController, + ), + ], + ), + ), + Container( + height: MediaQuery.of(context).size.height, + child: TabBarView( + physics: NeverScrollableScrollPhysics(), + children: [ + DoctorInformation(docProfileList: widget.docProfileList), + DocAvailableAppointments( + doctor: widget.doctor, + isLiveCareAppointment: widget.isLiveCareAppointment) + ], + controller: _tabController, + ), + ), + ], + ), + ), + ), + ); + } + + getDoctorRatings() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service.getDoctorsRating(widget.doctor.doctorID, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + print(res['NotesDoctorRatingList']); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + getDoctorRatingsDetails() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service + .getDoctorsRatingDetails(widget.doctor.doctorID, context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + doctorDetailsList.clear(); + res['DoctorRatingDetailsList'].forEach((v) { + doctorDetailsList.add(new DoctorRateDetails.fromJson(v)); + }); + showRatingDialog(doctorDetailsList); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + void showRatingDialog(List doctorDetailsList) { + showGeneralDialog( + barrierColor: Colors.black.withOpacity(0.5), + transitionBuilder: (context, a1, a2, widget) { + final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0; + return Transform( + transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), + child: Opacity( + opacity: a1.value, + child: Dialog( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + // height: 400.0, + width: MediaQuery.of(context).size.width * 0.8, + color: Colors.white, + child: Column( + children: [ + Container( + alignment: Alignment.center, + width: MediaQuery.of(context).size.width, + color: Theme.of(context).primaryColor, + margin: EdgeInsets.only(bottom: 5.0), + padding: EdgeInsets.all(10.0), + child: Text(TranslationBase.of(context).doctorRating, + style: TextStyle( + fontSize: 22.0, color: Colors.white))), + Container( + margin: EdgeInsets.only(top: 0.0), + child: Text( + this + .widget + .doctor + .actualDoctorRate + .ceilToDouble() + .toString(), + style: TextStyle( + fontSize: 32.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: RatingBar.readOnly( + initialRating: + this.widget.doctor.actualDoctorRate.toDouble(), + size: 35.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text( + this.widget.doctor.noOfPatientsRate.toString() + + " " + + TranslationBase.of(context).reviews, + style: TextStyle( + fontSize: 14.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context).excellent, + style: TextStyle( + fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[0].patientNumber), + height: 6.0, + child: Container( + color: Colors.green[700], + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).v_good, + style: TextStyle( + fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[1].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffB7B723), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).good, + style: TextStyle( + fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[2].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffEBA727), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).average, + style: TextStyle( + fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[3].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffEB7227), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context).below_average, + style: TextStyle( + fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[4].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffE20C0C), + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 40.0), child: Divider()), + Container( + margin: EdgeInsets.only(top: 0.0), + child: Align( + alignment: FractionalOffset.bottomCenter, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width, + height: 40.0, + child: RaisedButton( + elevation: 0.0, + color: Colors.white, + textColor: Colors.red, + hoverColor: Colors.transparent, + focusColor: Colors.transparent, + highlightColor: Colors.transparent, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(TranslationBase.of(context).cancel, + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ); + }, + transitionDuration: Duration(milliseconds: 500), + barrierDismissible: true, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) {}); + } + + double getRatingWidth(int patientNumber) { + var width = (patientNumber / this.widget.docProfileList.noOfPatientsRate) * 100; + return width; + } + + getPatientData() async { + if (await sharedPref.getObject(USER_PROFILE) != null) { + var data = + AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + setState(() { + print(data); + widget.authUser = data; + }); + } + } + + void goToBookConfirm() async { + if (DocAvailableAppointments.areSlotsAvailable) { + if (await sharedPref.getObject(USER_PROFILE) != null) { + navigateToBookConfirm(context); + } else { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: TranslationBase.of(context).loginToUseService, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => {navigateToLogin()}, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + } else + AppToast.showErrorToast(message: "Please select Time Slot to continue"); + } + + navigateToLogin() { + ConfirmDialog.closeAlertDialog(context); + Navigator.of(context).pushNamed( + WELCOME_LOGIN, + ); + } + + Future navigateToBookConfirm(context) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => BookConfirm( + doctor: widget.doctor, + isLiveCareAppointment: widget.isLiveCareAppointment, + selectedDate: DocAvailableAppointments.selectedDate, + selectedTime: DocAvailableAppointments.selectedTime))); + } +} diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart new file mode 100644 index 00000000..e92c2348 --- /dev/null +++ b/lib/pages/BookAppointment/QRCode.dart @@ -0,0 +1,303 @@ +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +class QRCode extends StatefulWidget { + PatientShareResponse patientShareResponse; + String appoQR; + AuthenticatedUser authUser; + AppSharedPreferences sharedPref = AppSharedPreferences(); + + QRCode({@required this.patientShareResponse, @required this.appoQR}); + + @override + _QRCodeState createState() => _QRCodeState(); +} + +class _QRCodeState extends State { + Uint8List _bytes; + + @override + void initState() { + // TODO: implement initState + _bytes = base64.decode(widget.appoQR.split(',').last); + widget.authUser = new AuthenticatedUser(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).attendRegisterCode, + isShowAppBar: true, + body: SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + margin: EdgeInsets.only(top: 30.0), + alignment: Alignment.center, + child: Image.memory(_bytes, scale: 0.5), + ), + Container( + margin: EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0), + child: Divider( + color: Colors.red[700], + thickness: 0.8, + ), + ), + Container( + child: Row( + children: [ + Container( + margin: + EdgeInsets.only(top: 10.0, left: 40.0, bottom: 10.0), + child: Image.asset( + "assets/images/new-design/device_icon.png", + width: 120.0, + height: 120.0), + ), + Container( + width: MediaQuery.of(context).size.width * 0.5, + margin: EdgeInsets.only( + top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text(TranslationBase.of(context).scanQRHospital, + style: TextStyle( + color: Colors.red[700], + fontSize: 20.0, + fontWeight: FontWeight.bold)), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + child: Divider( + color: Colors.red[700], + thickness: 0.8, + ), + ), + Container( + margin: EdgeInsets.only( + top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text(TranslationBase.of(context).appoInfo, + style: TextStyle( + fontSize: 18.0, + color: Colors.grey[700], + fontWeight: FontWeight.bold)), + ), + Container( + margin: EdgeInsets.only(left: 20.0, bottom: 20.0), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.grey[200], + boxShadow: [ + BoxShadow(color: Colors.grey, spreadRadius: 2), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only( + top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text(widget.patientShareResponse.doctorNameObj, + style: TextStyle( + fontSize: 18.0, + color: Colors.grey[700], + fontWeight: FontWeight.bold)), + ), + Container( + margin: EdgeInsets.only( + bottom: 10.0, left: 20.0, right: 20.0), + child: Text( + getDoctorSpeciality( + widget.patientShareResponse.doctorSpeciality), + style: TextStyle( + fontSize: 18.0, color: Colors.grey[700])), + ), + Container( + margin: EdgeInsets.only( + top: 0.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text(widget.patientShareResponse.projectName, + style: TextStyle( + fontSize: 18.0, color: Colors.grey[700])), + ), + Container( + margin: EdgeInsets.only( + top: 0.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text( + getDate(widget.patientShareResponse.appointmentDate), + style: TextStyle( + fontSize: 18.0, color: Colors.grey[700])), + ), + ], + ), + ), + Container( + margin: EdgeInsets.zero, + alignment: Alignment.bottomCenter, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { +// navigateToQR(context); +// getAppoQR(context); + sendEmail(); + }, + child: Text( + TranslationBase.of(context).sendEmail.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ], + ), + ), + Container( + alignment: Alignment.bottomCenter, + height: MediaQuery.of(context).size.height * 0.1, + margin: EdgeInsets.only(bottom: 20.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + navigateToHome(context); + }, + child: Text( + TranslationBase.of(context).close.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ); + } + + sendEmail() async { + DoctorsListService service = new DoctorsListService(); + + if (await widget.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await widget.sharedPref.getObject(USER_PROFILE)); + setState(() { + widget.authUser = data; + }); + } + + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: "Send a copy of this QR to the email " + + widget.authUser.emailAddress + + "?", + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () { + service + .sendAppointmentQREmail( + widget.authUser.emailAddress, + widget.patientShareResponse.appointmentDate, + widget.patientShareResponse.appointmentNo.toString(), + widget.patientShareResponse.doctorNameObj, + widget.patientShareResponse.projectName, + widget.appoQR, + getDoctorSpeciality( + widget.patientShareResponse.doctorSpeciality), + context) + .then((res) { + print(res); + ConfirmDialog.closeAlertDialog(context); + }).catchError((err) { + ConfirmDialog.closeAlertDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }).showProgressBar( + text: "Loading", + backgroundColor: Colors.blue.withOpacity(0.6)); + }, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + + Future navigateToHome(context) async { + Navigator.of(context).pushNamed(HOME); + } + + getPatientShare(context, String appointmentNo, int clinicID, int projectID, + DoctorList docObject) {} + + String getDate(String appoDate) { + var appoDateFormatted = ""; + + var dateObj = DateUtil.convertStringToDate(appoDate); + + setState(() { + appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString() + + ", " + + dateObj.hour.toString() + + ":" + + dateObj.minute.toString() + + ":00"; + }); + + return appoDateFormatted; + } + + String getDoctorSpeciality(List docSpecial) { + String docSpeciality = ""; + if (docSpecial != null && docSpecial.length != 0) { + docSpecial.forEach((v) { + docSpeciality = docSpeciality + v + "\n"; + }); + } + return docSpeciality; + } +} diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart new file mode 100644 index 00000000..94308c1c --- /dev/null +++ b/lib/pages/BookAppointment/Search.dart @@ -0,0 +1,73 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart'; +import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/arrow_back.dart'; +import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:geolocator/geolocator.dart'; + +import 'components/SearchByClinic.dart'; + +class Search extends StatefulWidget { + final int type; + final List clnicIds; + Search({this.type = 0, this.clnicIds}); + @override + _SearchState createState() => _SearchState(); +} + +class _SearchState extends State with TickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + _tabController = + new TabController(length: 2, vsync: this, initialIndex: widget.type); + + super.initState(); + } + + @override + Widget build(BuildContext context) { + AppGlobal.context = context; + return AppScaffold( + isShowAppBar: true, + isShowDecPage: false, + appBarTitle: TranslationBase.of(context).bookAppo, + body: Container( + child: Column( + children: [ + TabBar( + tabs: [ + Tab(text: TranslationBase.of(context).clinicName), + Tab( + text: TranslationBase.of(context).doctorName, + ) + ], + controller: _tabController, + ), + Divider( + color: Colors.grey[600], + thickness: 0.5, + ), + Expanded( + child: new TabBarView( + physics: NeverScrollableScrollPhysics(), + children: [ + SearchByClinic( + clnicIds: widget.clnicIds, + ), + SearchByDoctor() + ], + controller: _tabController, + ), + ) + ], + ), + )); + } +} diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart new file mode 100644 index 00000000..0c65a789 --- /dev/null +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -0,0 +1,67 @@ +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; +// import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class SearchResults extends StatefulWidget { + List doctorsList = []; + List patientDoctorAppointmentListHospital; + bool isLiveCareAppointment; + + SearchResults( + {@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment}); + + @override + _SearchResultsState createState() => _SearchResultsState(); +} + +class _SearchResultsState extends State { + // var event = RobotProvider(); + List tempList = []; + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).bookAppo, + isShowAppBar: true, + body: Container( + margin: EdgeInsets.all(10.0), + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + ...List.generate( + widget.patientDoctorAppointmentListHospital.length, + (index) => AppExpandableNotifier( + // isExpand: index == 0 ? true : false, + title: widget.patientDoctorAppointmentListHospital[index] + .filterName + + " - " + + widget.patientDoctorAppointmentListHospital[index] + .distanceInKMs + + " " + + TranslationBase.of(context).km, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: widget + .patientDoctorAppointmentListHospital[index] + .patientDoctorAppointmentList + .map((doctor) { + return DoctorView( + doctor: doctor, + isLiveCareAppointment: widget.isLiveCareAppointment, + ); + }).toList(), + )), + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart new file mode 100644 index 00000000..7caf1977 --- /dev/null +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -0,0 +1,420 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart'; +import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:table_calendar/table_calendar.dart'; + +import '../../../uitl/date_uitl.dart'; + +class DocAvailableAppointments extends StatefulWidget { + DoctorList doctor; + static bool areSlotsAvailable = false; + static DateTime selectedAppoDateTime; + static String selectedDate; + static String selectedTime; + bool isLiveCareAppointment; + + DocAvailableAppointments( + {@required this.doctor, @required this.isLiveCareAppointment}); + + @override + _DocAvailableAppointmentsState createState() => + _DocAvailableAppointmentsState(); +} + +class _DocAvailableAppointmentsState extends State + with TickerProviderStateMixin { + Map _events; + AnimationController _animationController; + CalendarController _calendarController; + + AppSharedPreferences sharedPref = new AppSharedPreferences(); + + var selectedDate = ""; + dynamic selectedDateJSON; + dynamic jsonFreeSlots; + + List docFreeSlots = []; + List dayEvents = []; + + int selectedButtonIndex = 0; + + dynamic freeSlotsResponse; + + ScrollController _scrollController; + + var language; + + @override + void initState() { + // TODO: implement initState + super.initState(); + final _selectedDay = DateTime.now(); + + _scrollController = new ScrollController(); + + _events = { + _selectedDay: ['Event A0'] + }; + + WidgetsBinding.instance.addPostFrameCallback((_) async { + getCurrentLanguage(); + if (widget.isLiveCareAppointment) + getDoctorScheduledFreeSlots(context, widget.doctor); + else { + getDoctorFreeSlots(context, widget.doctor); + } + }); + + _calendarController = CalendarController(); + _animationController = AnimationController( + vsync: this, + duration: const Duration(milliseconds: 50), + ); + + _animationController.forward(); + } + + @override + void dispose() { + _animationController.dispose(); + _calendarController.dispose(); + super.dispose(); + } + + void _onDaySelected(DateTime day, List events) { + final DateFormat formatter = DateFormat('yyyy-MM-dd'); + setState(() { + this.selectedDate = + DateUtil.getWeekDayMonthDayYearDateFormatted(day, language); + openTimeSlotsPickerForDate(day, docFreeSlots); + DocAvailableAppointments.selectedDate = formatter.format(day); + print(DocAvailableAppointments.selectedDate); + }); + } + + void _onVisibleDaysChanged( + DateTime first, DateTime last, CalendarFormat format) { + print('CALLBACK: _onVisibleDaysChanged'); + } + + void _onCalendarCreated( + DateTime first, DateTime last, CalendarFormat format) { + print('CALLBACK: _onCalendarCreated'); + } + + @override + Widget build(BuildContext context) { + return SingleChildScrollView( + child: Container( + decoration: BoxDecoration( + color: Colors.white, borderRadius: BorderRadius.circular(10.0)), + margin: EdgeInsets.all(20.0), + padding: EdgeInsets.only(bottom: 10.0, top: 10.0), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Text(selectedDate, + style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold)), + Container( + height: 50, + margin: EdgeInsets.all(20.0), + child: ListView.builder( + controller: _scrollController, + scrollDirection: Axis.horizontal, + itemCount: dayEvents.length, + itemBuilder: (context, index) { + return Container( + margin: EdgeInsets.only(right: 10.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(5.0), + side: BorderSide( + color: Colors.blue[400], //Color of the border + style: BorderStyle.solid, //Style of the border + width: 1.5, //width of the border + ), + ), + minWidth: MediaQuery.of(context).size.width * 0.2, + child: index == selectedButtonIndex + ? getSelectedButton(index) + : getNormalButton(index)), + ); + }, + ), + ), + _buildTableCalendarWithBuilders(), + ], + ), + ), + ); + } + + Widget _buildTableCalendarWithBuilders() { + return TableCalendar( + locale: language == "en" ? 'en_US' : 'ar_SA', + calendarController: _calendarController, + events: _events, + initialCalendarFormat: CalendarFormat.month, + startDay: DateTime.now(), + formatAnimation: FormatAnimation.slide, + startingDayOfWeek: StartingDayOfWeek.sunday, + weekendDays: [DateTime.friday, DateTime.saturday], + availableGestures: AvailableGestures.horizontalSwipe, + availableCalendarFormats: const { + CalendarFormat.month: '', + CalendarFormat.week: '', + }, + calendarStyle: CalendarStyle( + outsideDaysVisible: false, + weekendStyle: TextStyle().copyWith(color: Colors.blue[800]), + holidayStyle: TextStyle().copyWith(color: Colors.blue[800]), + ), + daysOfWeekStyle: DaysOfWeekStyle( + weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 14.0), + weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 14.0), + ), + headerStyle: HeaderStyle( + centerHeaderTitle: true, + formatButtonVisible: false, + ), + builders: CalendarBuilders( + selectedDayBuilder: (context, date, _) { + return FadeTransition( + opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController), + child: Container( + margin: const EdgeInsets.all(4.0), + padding: const EdgeInsets.only(top: 5.0, left: 5.0), + color: Colors.transparent, + width: 0, + height: 0, + child: Text( + '${date.day}', + style: TextStyle().copyWith(fontSize: 16.0), + ), + ), + ); + }, + todayDayBuilder: (context, date, _) { + return Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: _calendarController.isSelected(date) + ? Colors.green[400] + : _calendarController.isToday(date) + ? Colors.brown[300] + : Colors.blue[400], + ), + width: 40.0, + height: 40.0, + child: Center( + child: Text( + '${date.day}', + style: TextStyle().copyWith( + color: Colors.white, + fontSize: 14.0, + ), + ), + ), + ); + }, + markersBuilder: (context, date, events, _) { + final children = []; + if (events.isNotEmpty) { + children.add( + Positioned( + right: 4, + bottom: 4, + child: _buildEventsMarker(date, events), + ), + ); + } + + return children; + }, + ), + onDaySelected: (date, event, _) { + _onDaySelected(date, event); + _animationController.forward(from: 0.0); + }, + onVisibleDaysChanged: _onVisibleDaysChanged, + onCalendarCreated: _onCalendarCreated, + ); + } + + openTimeSlotsPickerForDate(DateTime dateStart, List freeSlots) { + dayEvents.clear(); + DateTime dateStartObj = new DateTime( + dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0); + + freeSlots.forEach((v) { + if (v.start == dateStartObj) dayEvents.add(v); + }); + + setState(() { + if (dayEvents.length != 0) + DocAvailableAppointments.areSlotsAvailable = true; + else + DocAvailableAppointments.areSlotsAvailable = false; + + selectedButtonIndex = 0; + + DocAvailableAppointments.selectedTime = + dayEvents[selectedButtonIndex].isoTime; + +// _scrollController.animateTo(0.0, duration: new Duration(seconds: 1), curve: Curves.ease); + }); + } + + Future> _getJSONSlots() async { + Map _eventsParsed; + List slotsList = []; + DateTime date; + final DateFormat formatter = DateFormat('HH:mm'); + final DateFormat dateFormatter = DateFormat('yyyy-MM-dd'); + for (var i = 0; i < freeSlotsResponse.length; i++) { + date = DateUtil.convertStringToDate(freeSlotsResponse[i]); + slotsList.add(FreeSlot(date, ['slot'])); + docFreeSlots.add(TimeSlot( + isoTime: formatter.format(date), + start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0), + end: date)); + } + _eventsParsed = + Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event); + setState(() { + DocAvailableAppointments.selectedDate = dateFormatter + .format(DateUtil.convertStringToDate(freeSlotsResponse[0])); + selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted( + DateUtil.convertStringToDate(freeSlotsResponse[0]), language); + selectedDateJSON = freeSlotsResponse[0]; + }); + openTimeSlotsPickerForDate( + DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots); + _calendarController + .setFocusedDay(DateUtil.convertStringToDate(selectedDateJSON)); + return _eventsParsed; + } + + Widget getNormalButton(int index) { + return RaisedButton( + color: Colors.white, + textColor: new Color(0xFF60686b), + onPressed: () { + setState(() { + selectedButtonIndex = index; + DocAvailableAppointments.selectedTime = dayEvents[index].isoTime; + print(DocAvailableAppointments.selectedTime); + }); + }, + child: Text(dayEvents[index].isoTime, + style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), + ); + } + + Widget getSelectedButton(int index) { + return RaisedButton( + color: Colors.blue[400], + textColor: Colors.white, + onPressed: () { + setState(() { + selectedButtonIndex = index; + DocAvailableAppointments.selectedTime = dayEvents[index].isoTime; + print(DocAvailableAppointments.selectedTime); + }); + }, + child: Text(dayEvents[index].isoTime, + style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), + ); + } + + getDoctorFreeSlots(context, DoctorList docObject) { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service + .getDoctorFreeSlots(docObject.doctorID, docObject.clinicID, + docObject.projectID, context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + if (res['FreeTimeSlots'].length != 0) { + freeSlotsResponse = res['FreeTimeSlots']; + print("res['FreeTimeSlots']"); + print(res['FreeTimeSlots'].length); + _getJSONSlots().then((value) => { + setState(() => {_events.clear(), _events = value}) + }); + } else {} + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }); + } + + getDoctorScheduledFreeSlots(context, DoctorList docObject) { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service + .getDoctorScheduledFreeSlots(docObject.doctorID, docObject.clinicID, + docObject.projectID, docObject.serviceID, context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + if (res['PatientER_DoctorFreeSlots'].length != 0) { + freeSlotsResponse = res['PatientER_DoctorFreeSlots']; + print("res['PatientER_DoctorFreeSlots']"); + print(res['PatientER_DoctorFreeSlots'].length); + _getJSONSlots().then((value) => { + setState(() => {_events.clear(), _events = value}) + }); + } else {} + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + getCurrentLanguage() async { + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + setState(() { + this.language = languageID; + }); + } + + Widget _buildEventsMarker(DateTime date, List events) { + return Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: _calendarController.isSelected(date) + ? Colors.green[400] + : _calendarController.isToday(date) + ? Colors.brown[300] + : Colors.blue[400], + ), + width: 40.0, + height: 40.0, + child: Center( + child: Text( + '${date.day}', + style: TextStyle().copyWith( + color: Colors.white, + fontSize: 14.0, + ), + ), + ), + ); + } +} diff --git a/lib/pages/BookAppointment/components/DocInfo.dart b/lib/pages/BookAppointment/components/DocInfo.dart new file mode 100644 index 00000000..89b9e4d0 --- /dev/null +++ b/lib/pages/BookAppointment/components/DocInfo.dart @@ -0,0 +1,156 @@ +import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class DoctorInformation extends StatelessWidget { + DoctorProfileList docProfileList; + + DoctorInformation({@required this.docProfileList}); + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + AppExpandableNotifier( + isExpand: true, + headerWidget: Container( + margin: EdgeInsets.all(10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SvgPicture.asset( + "assets/images/DQ/doctor_information_icon.svg"), + Container( + margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0), + child: Text(TranslationBase.of(context).docInfo, + style: TextStyle(fontSize: 16.0, letterSpacing: 0.8)), + ), + ], + ), + ), + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + padding: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 10.0), + child: Table( + children: [ + TableRow(children: [ + TableCell( + child: _getHeadingText( + TranslationBase.of(context).gender)), + TableCell( + child: _getHeadingText( + TranslationBase.of(context).nationality)), + ]), + TableRow(children: [ + TableCell( + child: _getNormalText( + docProfileList.genderDescription)), + TableCell( + child: _getNormalTextWithIcon( + docProfileList.nationalityName, + docProfileList.nationalityFlagURL)), + ]), + ], + ), + ), + Divider( + color: Colors.grey[400], + ), + Container( + margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _getHeadingText(TranslationBase.of(context).clinic), + _getNormalText(docProfileList.clinicDescription) + ], + ), + ) + ], + ), + ), + // ), + AppExpandableNotifier( + isExpand: true, + headerWidget: Container( + margin: EdgeInsets.all(10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SvgPicture.asset( + "assets/images/DQ/doctor_qualification_icon.svg"), + Container( + margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0), + child: Text(TranslationBase.of(context).docQualifications, + style: TextStyle(fontSize: 16.0, letterSpacing: 0.8)), + ), + ], + ), + ), + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 10.0, 5.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + _getNormalText(docProfileList.doctorProfileInfo) + ], + ), + ) + ], + ), + ), + ], + ), + ); + } + + _getHeadingText(text) { + return Text(text, + style: TextStyle( + fontSize: 13, + fontWeight: FontWeight.bold, + letterSpacing: 0.5, + color: Colors.grey[800])); + } + + _getNormalText(text) { + return Container( + margin: EdgeInsets.only(top: 5.0), + child: Text(text, + maxLines: 16, + style: TextStyle( + fontSize: 13, letterSpacing: 0.5, color: Colors.grey[700])), + ); + } + + _getNormalTextWithIcon(String text, icon) { + return Container( + margin: EdgeInsets.only(top: 5.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Text(text.trim(), + style: TextStyle( + fontSize: 13, letterSpacing: 0.5, color: Colors.grey[700])), + Container( + margin: EdgeInsets.only(left: 5.0, right: 5.0), + child: Image.network(icon, width: 18.0, height: 18.0), + ), + ], + ), + ); + } +} diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart new file mode 100644 index 00000000..01c9ee92 --- /dev/null +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -0,0 +1,332 @@ +import "dart:collection"; + +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; +import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +class SearchByClinic extends StatefulWidget { + final List clnicIds; + + SearchByClinic({this.clnicIds}); + + @override + _SearchByClinicState createState() => _SearchByClinicState(); +} + +class _SearchByClinicState extends State { + bool nearestAppo = false; + String dropdownValue; + String projectDropdownValue; + + // var event = RobotProvider(); + List clinicsList = []; + List projectsList = []; + bool isMobileAppDentalAllow = false; + bool isLoaded = false; + bool isProjectLoaded = false; + + @override + void initState() { + WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList()); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Checkbox( + activeColor: new Color(0xFF40ACC9), + value: nearestAppo, + onChanged: (bool value) { + setState(() { + nearestAppo = value; + print(nearestAppo); + if (nearestAppo) + getProjectsList(); + else + isProjectLoaded = false; + }); + }, + ), + Text(TranslationBase.of(context).nearestAppo, + style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)), + ], + ), + widget.clnicIds != null && + widget.clnicIds.length > 1 && + isLoaded == true + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: clinicsList.map((result) { + return RoundedContainer( + child: ListTile( + onTap: () { + // setState(() { + dropdownValue = result.clinicID.toString(); + setState(() { + if (!isDentalSelectedAndSupported()) { + projectDropdownValue = ""; + getDoctorsList(context); + } + }); + }, + title: Text(result.clinicDescription, + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700], + letterSpacing: 1.0)))); + }).toList()) + : Container( + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + border: Border.all( + color: Colors.grey[400], + width: 1.0, + ), + borderRadius: BorderRadius.circular(10), + ), + // margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0), + padding: EdgeInsets.all(8.0), + width: MediaQuery.of(context).size.width, + child: DropdownButtonHideUnderline( + child: DropdownButton( + hint: new Text(TranslationBase.of(context).selectClinic), + value: dropdownValue, + items: clinicsList.map((item) { + return new DropdownMenuItem( + value: item.clinicID.toString(), + child: new Text(item.clinicDescription), + ); + }).toList(), + onChanged: (newValue) { + setState(() { + dropdownValue = newValue; + if (!isDentalSelectedAndSupported() && !nearestAppo) { + projectDropdownValue = ""; + getDoctorsList(context); + } + }); + }, + ), + )), + isDentalSelectedAndSupported() == true || + (nearestAppo && isProjectLoaded) + ? Container( + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + border: Border.all( + color: Colors.grey[400], + width: 1.0, + ), + borderRadius: BorderRadius.circular(10), + ), + padding: EdgeInsets.all(8.0), + width: MediaQuery.of(context).size.width, + margin: EdgeInsets.only(top: 15.0), + child: DropdownButtonHideUnderline( + child: DropdownButton( + hint: new Text("Select Project"), + value: projectDropdownValue, + items: projectsList.map((item) { + return new DropdownMenuItem( + value: item.mainProjectID.toString(), + child: new Text(item.name), + ); + }).toList(), + onChanged: (newValue) { + setState(() { + projectDropdownValue = newValue; + getDoctorsList(context); + }); + }, + ), + )) + : Container(), + ], + ), + ); + } + + bool isDentalSelectedAndSupported() { + return dropdownValue != "" && + (dropdownValue == "17") && + isMobileAppDentalAllow; + } + + getClinicsList() { + GifLoaderDialogUtils.showMyDialog(context); + ClinicListService service = new ClinicListService(); + service.getClinicsList(context).then((res) { + if (res['MessageStatus'] == 1) { + setState(() { + isMobileAppDentalAllow = res['ISMobileAppDentalAllow']; + res['ListClinicCentralized'].forEach((v) { + clinicsList.add(new ListClinicCentralized.fromJson(v)); + }); + }); + getProjectsList(); + GifLoaderDialogUtils.hideDialog(context); + } else {} + }).catchError((err) { + print(err); + GifLoaderDialogUtils.hideDialog(context); + }); + } + + getProjectsList() { + ClinicListService service = new ClinicListService(); + List projectsListLocal = []; + service.getProjectsList(context).then((res) { + if (res['MessageStatus'] == 1) { + setState(() { + res['ListProject'].forEach((v) { + projectsListLocal.add(new HospitalsModel.fromJson(v)); + }); + projectsList = projectsListLocal; + }); + filterClinic(); + isProjectLoaded = true; + } else { + isProjectLoaded = false; + } + }).catchError((err) { + print(err); + }); + } + + getDoctorsList(BuildContext context) { + GifLoaderDialogUtils.showMyDialog(context); + SearchInfo searchInfo = new SearchInfo(); + if (dropdownValue == "17") { + searchInfo.ProjectID = int.parse(projectDropdownValue); + searchInfo.ClinicID = int.parse(dropdownValue); + searchInfo.date = DateTime.now(); + + GifLoaderDialogUtils.hideDialog(context); + navigateToDentalComplaints(context, searchInfo); + } else { + List doctorsList = []; + List arr = []; + List arrDistance = []; + List result; + int numAll; + List _patientDoctorAppointmentListHospital = + List(); + + DoctorsListService service = new DoctorsListService(); + service + .getDoctorsList( + int.parse(dropdownValue), + projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0, + nearestAppo, + context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + setState(() { + if (res['DoctorList'].length != 0) { + // print(res['DoctorList']); + doctorsList.clear(); + res['DoctorList'].forEach((v) { + doctorsList.add(new DoctorList.fromJson(v)); + }); + doctorsList.forEach((element) { + List doctorByHospital = + _patientDoctorAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + _patientDoctorAppointmentListHospital[ + _patientDoctorAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + _patientDoctorAppointmentListHospital.add( + PatientDoctorAppointmentList( + filterName: element.projectName, + distanceInKMs: + element.projectDistanceInKiloMeters.toString(), + patientDoctorAppointment: element)); + } + }); + } else {} + }); + + result = LinkedHashSet.from(arr).toList(); + numAll = result.length; + navigateToSearchResults( + context, doctorsList, _patientDoctorAppointmentListHospital); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + AppToast.showErrorToast(message: err); + }); + } + } + + Future navigateToDentalComplaints( + BuildContext context, SearchInfo searchInfo) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => DentalComplaints(searchInfo: searchInfo), + ), + ); + } + + Future navigateToSearchResults( + context, + List docList, + List + patientDoctorAppointmentListHospital) async { + isProjectLoaded = false; + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => SearchResults( + isLiveCareAppointment: false, + doctorsList: docList, + patientDoctorAppointmentListHospital: + patientDoctorAppointmentListHospital))).then((value) { + getProjectsList(); + }); + } + + filterClinic() { + setState(() { + if (widget.clnicIds != null && widget.clnicIds.length > 0) { + clinicsList = clinicsList + .where((i) => widget.clnicIds.indexOf(i.clinicID) > -1) + .toList(); + isLoaded = true; + } + }); + } +} diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart new file mode 100644 index 00000000..1e1945b5 --- /dev/null +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -0,0 +1,171 @@ +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +import '../SearchResults.dart'; + +class SearchByDoctor extends StatefulWidget { + @override + _SearchByDoctorState createState() => _SearchByDoctorState(); +} + +class _SearchByDoctorState extends State { + TextEditingController doctorNameController = new TextEditingController(); + bool _isButtonDisabled; + + @override + void initState() { + _isButtonDisabled = true; + } + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.all(20.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + margin: EdgeInsets.only(top: 10.0, bottom: 15.0), + child: Text(TranslationBase.of(context).searchByDocText, + style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)), + ), + Container( + decoration: BoxDecoration(color: Colors.white), + child: TextField( + controller: doctorNameController, + onChanged: (content) { + _onDocTextChanged(content); + }, + decoration: InputDecoration( + labelText: TranslationBase.of(context).enterDocName, + fillColor: Colors.white, + prefixIcon: Icon(Icons.search), + border: OutlineInputBorder())), + ), + Expanded( + child: Align( + alignment: FractionalOffset.bottomCenter, + child: _buildCounterButton(), + ), + ), + ], + ), + ); + } + + Widget _buildCounterButton() { + return new ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + if (_isButtonDisabled == false) { + _searchDoctor(context); + } + }, + child: Text(TranslationBase.of(context).search, + style: TextStyle(fontSize: 18.0)), + ), + ); + } + + getDoctorsList(BuildContext context) { + GifLoaderDialogUtils.showMyDialog(context); + List doctorsList = []; + DoctorsListService service = new DoctorsListService(); + + List _patientDoctorAppointmentListHospital = + List(); + + service + .getDoctorsListByName(doctorNameController.text, context) + .then((res) { + if (res['MessageStatus'] == 1) { + setState(() { + if (res['DoctorList'].length != 0) { + res['DoctorList'].forEach((v) { + doctorsList.add(new DoctorList.fromJson(v)); + }); + + doctorsList.forEach((element) { + List doctorByHospital = + _patientDoctorAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + _patientDoctorAppointmentListHospital[ + _patientDoctorAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + _patientDoctorAppointmentListHospital.add( + PatientDoctorAppointmentList( + filterName: element.projectName, + distanceInKMs: element.projectDistanceInKiloMeters.toString(), + patientDoctorAppointment: element)); + } + }); + } else {} + }); + GifLoaderDialogUtils.hideDialog(context); + navigateToSearchResults( + context, doctorsList, _patientDoctorAppointmentListHospital); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }); + } + + _onDocTextChanged(content) { + print(content); + if (content.length >= 3) { + setState(() { + _isButtonDisabled = false; + }); + } else { + setState(() { + _isButtonDisabled = true; + }); + } + print(_isButtonDisabled); + } + + _searchDoctor(BuildContext context) { + getDoctorsList(context); + } + + Future navigateToSearchResults( + context, + List docList, + List + patientDoctorAppointmentListHospital) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => SearchResults( + isLiveCareAppointment: false, + doctorsList: docList, + patientDoctorAppointmentListHospital: + patientDoctorAppointmentListHospital))); + } +} diff --git a/lib/pages/BookAppointment/widgets/BranchView.dart b/lib/pages/BookAppointment/widgets/BranchView.dart new file mode 100644 index 00000000..747775d5 --- /dev/null +++ b/lib/pages/BookAppointment/widgets/BranchView.dart @@ -0,0 +1,215 @@ +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; + +import 'DoctorView.dart'; + +class BranchView extends StatefulWidget { + final List doctorsList; + + final List result; + final List resultDistance; + final int num; + + const BranchView( + {Key key, this.doctorsList, this.result, this.resultDistance, this.num}) + : super(key: key); + + @override + _BranchViewState createState() => _BranchViewState(); +} + +class _BranchViewState extends State { + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).bookAppo, + isShowAppBar: true, + isShowDecPage: false, + isBottomBar: false, + body: new ListView.builder( + itemBuilder: (BuildContext context, int index) { + return new ExpandableListView( + isExpanded: index == 0 ? true : false, + result2: widget.result, + resultDistance: widget.resultDistance, + val: index, + doctorsList2: widget.doctorsList); + }, + itemCount: widget.num, //5, + ), + ); + } +} + +class ExpandableListView extends StatefulWidget { + final List result2; + final List resultDistance; + final List doctorsList2; + final val; + static int doctorListheight = 0; + final bool isExpanded; + const ExpandableListView( + {Key key, + this.result2, + this.resultDistance, + this.val, + this.doctorsList2, + this.isExpanded}) + : super(key: key); + + @override + _ExpandableListViewState createState() => new _ExpandableListViewState(); +} + +class _ExpandableListViewState extends State { + bool expandFlag = false; + @override + void initState() { + setState(() { + expandFlag = widget.isExpanded; + setDoctorViewHeight(widget.result2[widget.val].toString()); + }); + super.initState(); + } + @override + Widget build(BuildContext context) { + + return new Container( + width: MediaQuery.of(context).size.width * 0.6, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 0.0), + child: Card( + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + decoration: BoxDecoration(), + padding: EdgeInsets.all(5.0), + width: MediaQuery.of(context).size.width, + child: new Column( + children: [ + new Container( + margin: EdgeInsets.only(left: 5.0, right: 5.0), + color: Colors.white, + child: new Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + new Text( + widget.result2[widget.val].toString() + + " " + + getProjectDistance( + widget.resultDistance[widget.val].toString()), + style: new TextStyle( + fontWeight: FontWeight.bold, color: Colors.black), + ), + new IconButton( + icon: new Container( + height: 28.0, + width: 30.0, + decoration: new BoxDecoration( + color: Color(0xFF40ACC9), + shape: BoxShape.circle, + ), + child: new Center( + child: new Icon( + expandFlag + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.white, + size: 30.0, + ), + ), + ), + onPressed: () { + setState(() { + expandFlag = !expandFlag; + if (expandFlag == true) { + setDoctorViewHeight( + widget.result2[widget.val].toString()); + } + }); + }), + ], + ), + ), + // SizedBox(height: 15), + new ExpandableContainer( + expanded: expandFlag, + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + padding: EdgeInsets.all(0.0), + itemCount: widget.doctorsList2.length, + itemBuilder: (context, index) { + return widget.result2[widget.val].toString() == + widget.doctorsList2[index].projectName.toString() + ? DoctorView( + //AJ note + doctor: widget.doctorsList2[index], + isLiveCareAppointment: false, + // widget.doctorsList2[index] + ) + : Container(); + }, + ), + ) + ], + ), + ), + ), + ); + } + + setDoctorViewHeight(name) { + ExpandableListView.doctorListheight = + widget.doctorsList2.where((e) => e.projectName == name).toList().length; + } + + String getProjectDistance(String distance) { + if (distance != "0") + return " - " + distance + " " + TranslationBase.of(context).km; + else { + return ""; + } + } + + sortByProject() {} + sortByClinic() {} +} + +class ExpandableContainer extends StatelessWidget { + final bool expanded; + final double collapsedHeight; + final double expandedHeight; + final Widget child; + + ExpandableContainer({ + @required this.child, + this.collapsedHeight = 0.0, + this.expandedHeight = 300.0, + this.expanded = true, + }); + + @override + Widget build(BuildContext context) { + double screenWidth = MediaQuery.of(context).size.width; + return new AnimatedContainer( + duration: new Duration(milliseconds: 500), + curve: Curves.easeInOut, + width: screenWidth, + height: expanded + ? (ExpandableListView.doctorListheight * 160).toDouble() + : collapsedHeight, + child: new Container( + child: child, + padding: EdgeInsets.only(bottom: 30), + decoration: new BoxDecoration( + border: new Border.all(width: 1.0, color: Colors.white)), + ), + ); + } +} diff --git a/lib/pages/BookAppointment/widgets/CardBottom.dart b/lib/pages/BookAppointment/widgets/CardBottom.dart new file mode 100644 index 00000000..e982d854 --- /dev/null +++ b/lib/pages/BookAppointment/widgets/CardBottom.dart @@ -0,0 +1,75 @@ +import 'package:flutter/material.dart'; + +class CardBottom extends StatelessWidget { + final backgroundImage; + final text; + final subtext; + + const CardBottom( + {@required this.backgroundImage, + @required this.text, + @required this.subtext}); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () {}, + child: Container( + height: 110, + margin: EdgeInsets.all(4.0), + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey[300], + blurRadius: 3.0, + spreadRadius: 0.0, +// offset: Offset(2.0), // shadow direction: bottom right + ) + ], + image: DecorationImage( + image: AssetImage(this.backgroundImage), fit: BoxFit.fill), + borderRadius: BorderRadius.circular(5)), + child: Column( + children: [ + Container( + margin: EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 5.0), + child: null, + ), + Container( + width: MediaQuery.of(context).size.width * 0.48, + padding: EdgeInsets.fromLTRB(12.0, 0.0, 0.0, 0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(this.text, + textAlign: TextAlign.start, + overflow: TextOverflow.clip, + style: TextStyle( + color: Colors.white, + fontSize: 16.0, + fontWeight: FontWeight.bold)), + Container( + padding: EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 0.0), + child: Text(this.subtext, + textAlign: TextAlign.start, + overflow: TextOverflow.clip, + style: TextStyle(color: Colors.white, fontSize: 12.0)), + ), + Container( + padding: EdgeInsets.fromLTRB(0.0, 25.0, 0.0, 0.0), + child: Text("View All", + overflow: TextOverflow.clip, + style: TextStyle( + color: Colors.white, + fontSize: 16.0, + fontWeight: FontWeight.bold)), + ), + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/BookAppointment/widgets/CardCommon.dart b/lib/pages/BookAppointment/widgets/CardCommon.dart new file mode 100644 index 00000000..b03e9b24 --- /dev/null +++ b/lib/pages/BookAppointment/widgets/CardCommon.dart @@ -0,0 +1,66 @@ +import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; +import 'package:flutter/material.dart'; + +import '../../../Constants.dart'; + +class CardCommon extends StatelessWidget { + final image; + final text; + final subText; + final type; + const CardCommon( + {@required this.image, + @required this.text, + @required this.subText, + @required this.type}); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () { + navigateToSearch(context, this.type); + }, + child: Container( + margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0), + decoration: BoxDecoration(boxShadow: [ + BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0) + ], borderRadius: BorderRadius.circular(10), color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), + child: Text(this.text, + overflow: TextOverflow.clip, + style: TextStyle( + color: secondaryColor, + letterSpacing: 1.0, + fontSize: 20.0)), + ), + Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), + child: Text(this.subText, + overflow: TextOverflow.clip, + style: TextStyle( + color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)), + ), + Container( + alignment: Alignment.bottomRight, + margin: EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 8.0), + child: Image.asset(this.image, width: 60.0, height: 60.0), + ), + ], + ), + ), + ); + } + + Future navigateToSearch(context, type) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => Search( + type: type, + ))); + } +} diff --git a/lib/pages/BookAppointment/widgets/CardHome.dart b/lib/pages/BookAppointment/widgets/CardHome.dart new file mode 100644 index 00000000..551c9cf4 --- /dev/null +++ b/lib/pages/BookAppointment/widgets/CardHome.dart @@ -0,0 +1,55 @@ +import 'package:flutter/material.dart'; + +class CardHome extends StatelessWidget { + final image; + final backgroundImage; + final text; + final textColor; + + const CardHome( + {@required this.image, + @required this.backgroundImage, + @required this.text, + @required this.textColor}); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () {}, + child: Container( + height: 140.0, + margin: EdgeInsets.fromLTRB(9.0, 9.0, 8.0, 9.0), + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey[400], + blurRadius: 2.0, + spreadRadius: 0.0 + ) + ], + image: DecorationImage( + image: AssetImage(this.backgroundImage), fit: BoxFit.fill), + borderRadius: BorderRadius.circular(5)), + child: Column( + children: [ + Container( + margin: EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 5.0), + child: Image.asset(this.image, width: 60.0, height: 60.0), + ), + Container( + width: MediaQuery.of(context).size.width * 0.29, + padding: EdgeInsets.all(5.0), + child: Text(this.text, + textAlign: TextAlign.center, + overflow: TextOverflow.clip, + style: TextStyle( + color: this.textColor, + fontSize: 15.0, + fontWeight: FontWeight.w500)), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart new file mode 100644 index 00000000..27f37d0a --- /dev/null +++ b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart @@ -0,0 +1,135 @@ +import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +// ignore: must_be_immutable +class DentalComplaintCard extends StatefulWidget { + final ListDentalChiefComplain listDentalChiefComplain; + var languageID; + + DentalComplaintCard( + {@required this.listDentalChiefComplain, this.languageID}); + + @override + _DentalComplaintCardState createState() => _DentalComplaintCardState(); +} + +class _DentalComplaintCardState extends State { + @override + Widget build(BuildContext context) { + return Container( + child: InkWell( + onTap: () { + getChiefComplaintsList(); + }, + child: Card( + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.85, + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + child: Text(widget.listDentalChiefComplain.name, + style: + TextStyle(fontSize: 16.0, color: Colors.black)), + ), + ], + ), + ), + Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Icon(Icons.arrow_forward_ios, + size: 20.0, color: Colors.black54), + ], + ), + ), + ], + ), + ), + ), + ); + } + + getChiefComplaintsList() { + List doctorsList = []; + List _patientDoctorAppointmentListHospital = + List(); + + ClinicListService service = new ClinicListService(); + service + .getChiefComplaintDoctorList(widget.listDentalChiefComplain.iD, + widget.listDentalChiefComplain.projectID, context) + .then((res) { + if (res['MessageStatus'] == 1) { + print(res['List_DentalDoctorChiefComplaintMapping']); + setState(() { + doctorsList.clear(); + res['List_DentalDoctorChiefComplaintMapping'].forEach((v) { + doctorsList.add(new DoctorList.fromJson(v)); + }); + + doctorsList.forEach((element) { + List doctorByHospital = + _patientDoctorAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + _patientDoctorAppointmentListHospital[ + _patientDoctorAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + _patientDoctorAppointmentListHospital.add( + PatientDoctorAppointmentList( + filterName: element.projectName, + distanceInKMs: + element.projectDistanceInKiloMeters.toString(), + patientDoctorAppointment: element)); + } + }); + navigateToSearchResults( + context, doctorsList, _patientDoctorAppointmentListHospital); + }); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + Future navigateToSearchResults( + context, + List docList, + List + patientDoctorAppointmentListHospital) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => SearchResults( + doctorsList: docList, + patientDoctorAppointmentListHospital: + patientDoctorAppointmentListHospital))); + } +} diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart new file mode 100644 index 00000000..d419e4af --- /dev/null +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -0,0 +1,198 @@ +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:rating_bar/rating_bar.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +import '../DoctorProfile.dart'; + +class DoctorView extends StatelessWidget { + final DoctorList doctor; + bool isLiveCareAppointment; + + + + DoctorView({@required this.doctor, @required this.isLiveCareAppointment}); + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: () { + getDoctorsProfile(context, doctor); + }, + child: Card( + margin: EdgeInsets.fromLTRB(10.0, 16.0, 10.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + decoration: BoxDecoration(), + padding: EdgeInsets.all(7.0), + width: MediaQuery.of(context).size.width, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: Image.network(this.doctor.doctorImageURL, + fit: BoxFit.fill, height: 60.0, width: 60.0), + ), + ), + Expanded( + flex: 4, + child: Container( + width: MediaQuery.of(context).size.width * 0.55, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if(doctor.doctorTitle!=null) + Text(this.doctor.doctorTitle + " " + this.doctor.name, + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700], + letterSpacing: 1.0)), + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(this.doctor.clinicName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(this.doctor.projectName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + if(doctor.speciality!=null) + Container( + margin: EdgeInsets.only(top: 3.0, bottom: 3.0), + child: Text( + getDoctorSpeciality(this.doctor.speciality).trim(), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + this.doctor.nearestFreeSlot != null ? Container( + margin: EdgeInsets.only(top: 3.0, bottom: 3.0), + child: Text( + getDate(this.doctor.nearestFreeSlot), + style: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.bold, + color: Colors.green[600], + letterSpacing: 1.0)), + ) : Container(), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: + this.doctor.actualDoctorRate.toDouble(), + size: 20.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + Container( + child: Image.network(this.doctor.nationalityFlagURL, + width: 25.0, height: 25.0), + ), + ], + ), + ], + ), + ), + ), + ], + ), + ), + ), + ); + } + + String getDoctorSpeciality(List docSpecial) { + String docSpeciality = ""; + docSpecial.forEach((v) { + docSpeciality = docSpeciality + v + "\n"; + }); + return docSpeciality; + } + + getDoctorsProfile(context, DoctorList docObject, {isAppo}) { + GifLoaderDialogUtils.showMyDialog(context); + List docProfileList = []; + DoctorsListService service = new DoctorsListService(); + service + .getDoctorsProfile(docObject.doctorID, docObject.clinicID, + docObject.projectID, context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + if (res['DoctorProfileList'].length != 0) { + res['DoctorProfileList'].forEach((v) { + docProfileList.add(new DoctorProfileList.fromJson(v)); + }); + } else {} + navigateToDoctorProfile(context, docObject, docProfileList[0], + isAppo: isAppo); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }); + } + + String getDate(String date) { + DateTime dateObj = DateUtil.convertStringToDate(date); + return DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString() + + " " + + dateObj.hour.toString() + + ":" + + getMinute(dateObj); + } + + String getMinute(DateTime dateObj) { + if(dateObj.minute == 0) { + return dateObj.minute.toString() + "0"; + } else { + return dateObj.minute.toString(); + } + } + + Future navigateToDoctorProfile(context, docObject, docProfile, + {isAppo}) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => DoctorProfile( + doctor: docObject, + isLiveCareAppointment: isLiveCareAppointment, + docProfileList: docProfile, + isOpenAppt: isAppo, + ))); + } +} diff --git a/lib/pages/BookAppointment/widgets/TopCard.dart b/lib/pages/BookAppointment/widgets/TopCard.dart new file mode 100644 index 00000000..2d5bef61 --- /dev/null +++ b/lib/pages/BookAppointment/widgets/TopCard.dart @@ -0,0 +1,31 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class TopCard extends StatelessWidget { + TopCard({@required this.image, @required this.isSVG}); + + final String image; + final bool isSVG; + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () {}, + child: Card( + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white.withOpacity(0.3), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + height: 100.0, + padding: EdgeInsets.all(7.0), + width: MediaQuery.of(context).size.width * 0.45, + child: this.isSVG + ? SvgPicture.asset(this.image) + : Image.asset(this.image), + ), + ), + ); + } +} diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart new file mode 100644 index 00000000..51b89f98 --- /dev/null +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -0,0 +1,322 @@ +import 'package:device_calendar/device_calendar.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/create_new_user_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/add_new_child_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; +import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart'; +import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart'; +import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/active_medications/DayCheckBoxDialog.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +enum Gender { Male, Female, NON } +enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } + +class AddNewChildPage extends StatefulWidget { + final int frequency; + final int days; + final String itemDescription; + String dateAdd; + + List _scheduleList = List(); + List daysOfWeek = [ + DayOfWeek.Monday, + DayOfWeek.Tuesday, + DayOfWeek.Wednesday, + DayOfWeek.Thursday, + DayOfWeek.Friday, + DayOfWeek.Saturday, + DayOfWeek.Sunday + ]; + + DateTime startDay; + DateTime endDay; + + //AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) : super(key: key); + AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) { + startDay = DateTime.now(); + endDay = + DateTime.now(); //endDay = DateTime.now().add(Duration(days: days)); + int hour = 24; //(24 / frequency).round(); + int durations = 24 ~/ hour; + for (int count = 0; count < durations; count++) { + _scheduleList.add(DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day, (hour * count))); + } + } + + @override + _AddNewChildPageState createState() => _AddNewChildPageState(); +} + +class _AddNewChildPageState extends State { + int tappedIndex; + int checkedValue; + + @override + void initState() { + super.initState(); + tappedIndex = -1; + } + + TextEditingController _firstTextController = TextEditingController(); + TextEditingController _secondTextController = TextEditingController(); + TextEditingController _notesTextController = TextEditingController(); + BeneficiaryType beneficiaryType = BeneficiaryType.NON; + Gender gender = Gender.Male; + CreateNewUser_New newUserChild = CreateNewUser_New(); + + //ChildVaccinesViewModel addvancedModel = ChildVaccinesViewModel(); + List_BabyInformationModel addvancedModel = List_BabyInformationModel(); + CreateNewBaby newChild = CreateNewBaby(); + List_UserInformationModel informationModel = List_UserInformationModel(); + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: "Vaccintion", + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Column( + // crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 50, + ), + Texts( + "Add the child's information below to recieve the schedule of vaccinations.", + //+model.user.firstName, + textAlign: TextAlign.center, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: "First Name", + controller: _firstTextController, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: "Second Name", + controller: _secondTextController, + ), + SizedBox( + height: 12, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Gender:", + textAlign: TextAlign.end, + ), + ], + ), + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + padding: EdgeInsets.all(12), + + + child: Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: 175, + color: Colors.white, + child: SecondaryButton( + textColor: + checkedValue == 1 ? Colors.white : Colors.black, + color: checkedValue == 1 ? Colors.red : Colors.white, + + label: "Male", + // + onTap: () { + + setState(() { + checkedValue = 1; + print("checkedValue=" + checkedValue.toString()); + }); + + // bloodDetails. + }, + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: 175, + color: Colors.white, + child: SecondaryButton( + textColor: + checkedValue == 2 ? Colors.white : Colors.black, + color: checkedValue == 2 ? Colors.red : Colors.white, + label: "Female", + // + onTap: () { + setState(() { + checkedValue = 2; + print("checkedValue=" + checkedValue.toString()); + }); + // bloodDetails.city=_selectedHospital.toString(); + + // bloodDetails. + }, + ), + ) + ], + ), + ), + //========== + SizedBox( + height: 6, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Date Of Birth::", + textAlign: TextAlign.end, + ), + ], + ), + InkWell( + onTap: () { + DatePicker.showDatePicker( + context, + showTitleActions: true, + // minTime: DateTime( + // DateTime.now().year, DateTime.now().month - 1, 1), + minTime: DateTime(1, 1, 1), + maxTime: DateTime.now(), + onConfirm: (date) { + setState(() { + widget.startDay = date; + }); + }, + currentTime: widget.startDay, + // locale: projectViewModel.localeType + ); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(//getStartDay() + // DateUtil.yearMonthDay(DateTime.now()) + getStartDay()), + Icon( + Icons.calendar_today, + color: Colors.black, + ) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + padding: EdgeInsets.all(15), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue == false + ? Colors.white24 + : Color.fromRGBO( + 63, + 72, + 74, + 1, + ), + label: "Add", + // + onTap: () async{ + newChild.babyName = _firstTextController.text + " " + _secondTextController.text; + newChild.gender = checkedValue.toString(); + newChild.strDOB = getStartDay(); + newChild.tempValue = true; + newChild.isLogin = true; + + await model.createNewBabyOrders(newChild: newChild); + if(model.isAdded){ + AppToast.showSuccessToast(message: "Record Added"); + Navigator.pop(context,model.isAdded); + }else{ + + //TODO handling error + } + + }, + ), + ), + //========= + ], + ), + ), + ), + // bottomSheet: + ), + ); + } + + String getStartDay() { + return "${DateUtil.getMonth(widget.startDay.month)} ${widget.startDay.day}, ${widget.startDay.year}"; + } + + String getEndDay() { + return "${DateUtil.getMonth(widget.endDay.month)} ${widget.endDay.day}, ${widget.endDay.year}"; + } + + String getDateTime(DateTime dateTime) { + return '${dateTime.hour}:${dateTime.minute}'; + } + + String getDays() { + String days = ""; + widget.daysOfWeek.forEach((element) { + days += "${DateUtil.getDay(element)},"; + }); + return days; + } + + void confirmSelectDayDialog() { + showDialog( + context: context, + child: DayCheckBoxDialog( + title: 'Select Day', + selectedDaysOfWeek: widget.daysOfWeek, + onValueSelected: (value) { + setState(() { + widget.daysOfWeek = value; + }); + }, + ), + ); + } +} diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart new file mode 100644 index 00000000..806a5b71 --- /dev/null +++ b/lib/pages/ChildVaccines/child_page.dart @@ -0,0 +1,202 @@ +import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; +import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart'; +import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +import 'dialogs/delete_child.dart'; + +class ChildPage extends StatefulWidget { + @override + _ChildPageState createState() => _ChildPageState(); +} + +class _ChildPageState extends State + with SingleTickerProviderStateMixin { + + DeleteBaby deleteBaby = DeleteBaby(); + + @override + Widget build(BuildContext context) { + var checkedValue = true; + return BaseView( + onModelReady: (model) => model.getNewUserOrders(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: " Vaccination", + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 15, right: 15, top: 70), + child: Column( + children: [ + ...List.generate( + model.babyInformationModelList.length, + (index) => Container( + margin: EdgeInsets.only( + left: 0, right: 0, bottom: 20), + + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.white, width: 0.5), + borderRadius: + BorderRadius.all(Radius.circular(5)), + color: Colors.white, + ), + padding: EdgeInsets.all(12), + width: 200,//double.infinity, + child: Column( + children: [ + Row(children: [ + Texts("CHILD NAME"), + ]), + Row(children: [ + Texts(model + .babyInformationModelList[index] + .babyName + .trim()), + ]), + Row(children: [ + IconButton( + icon: Image.asset(model + .babyInformationModelList[ + index] + .gender == + 1 + ? 'assets/images/new-design/male.png' + : 'assets/images/new-design/female.png'), + tooltip: '', + onPressed: () { + setState(() { + // _volume += 10; + // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + }); + }, + ), + Texts(model + .babyInformationModelList[index] + .genderDescription), + IconButton( + icon: Icon( + Icons.remove_red_eye, + color: Colors.red, + ), + tooltip: '', + onPressed: () { + Navigator.push( + context, + FadePage( + + + page: VaccinationTablePage(), + + + ), + ); + + }, + ) + ]), + Row(children: [ + Texts("Birthday"), + ]), + Row(children: [ + IconButton( + icon: new Image.asset( + 'assets/images/new-design/calender-secondary.png'), + tooltip: '', + onPressed: () { + setState(() { + + }); + }, + ), + Texts(DateUtil.yearMonthDay(model + .babyInformationModelList[index] + .dOB)), + ]), + Row(children: [ + IconButton( + icon: new Image.asset( + 'assets/images/new-design/garbage.png'), + tooltip: '', + onPressed: ()async { + + //===================== + await model.deleteBabyOrders(newChild:deleteBaby ); + + + deleteBaby.babyID=model.babyInformationModelList[index] + .babyID; + + await model.deleteBabyOrders(newChild:deleteBaby ); + if(model.isDeleted){ + AppToast.showSuccessToast(message: "Record Deleted"); + Navigator.pop(context,model.isDeleted); + }else{ + + //TODO handling error + } + + + + + + }, + ), + Texts("Delete"), + ]), + SizedBox( + height: 12, + ), + ], + ), + + ), + + + ) + ], + )) + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + padding: EdgeInsets.all(15), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue == false + ? Colors.white24 + : Color.fromRGBO( + 63, + 72, + 74, + 1, + ), + label: "ADD NEW CHILD ", + // + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddNewChildPage(), + ), + ).then((value) { + if (value) model.getNewUserOrders(); + }); + }, + ), + ), + )); + } +} diff --git a/lib/pages/ChildVaccines/child_vaccines_page.dart b/lib/pages/ChildVaccines/child_vaccines_page.dart new file mode 100644 index 00000000..92f3a0be --- /dev/null +++ b/lib/pages/ChildVaccines/child_vaccines_page.dart @@ -0,0 +1,226 @@ + +import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + + + +class ChildVaccinesPage extends StatefulWidget { + @override + _ChildVaccinesPageState createState() => _ChildVaccinesPageState(); +} + +class _ChildVaccinesPageState extends State + with SingleTickerProviderStateMixin{ + TextEditingController titleController = TextEditingController(); + var checkedValue=false; + String addEmail=""; + @override + Widget build(BuildContext context) { + + return BaseView( + onModelReady: (model) => model.getUserInformationRequestOrders(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBarTitle: " Vaccination",//TranslationBase.of(context).advancePayment, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + SizedBox( + height: 20, + ), + + Padding( + padding: const EdgeInsets.all(10.0), + child:Container( + child: Texts("Welcome back",fontSize: 20,), + ) , + ), + Divider(color:Colors.black , indent: 10, + endIndent: 10,), + SizedBox( + height: 20, + ), + Padding( + padding: const EdgeInsets.all(10.0), + child:Container( + child: Texts("Please ensure that the email address is up-to-date and process to view the schedule",fontSize: 20,), + ) , + ), + + Divider(color:Colors.black , indent: 10, + endIndent: 10,), + Padding( + padding: const EdgeInsets.all(10.0), + child:Container( + + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + fillColor: Colors.red, + + hintText: model.user.emailAddress, + controller: titleController, + fontSize: 20, + hintColor: Colors.black, + fontWeight: FontWeight.w600, + onChanged: (text) { + addEmail=text; + model.user.emailAddress==addEmail?checkedValue=false:checkedValue=true; + + + }, + validator: (value) { + + if (value == null) + { + return model.user.emailAddress; + + } + else + + { + return model.user.emailAddress;} + }, + ), + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + + padding: EdgeInsets.all(15), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), + label: "UPDATE EMAIL", + // + onTap: (){ + model.user.emailAddress=addEmail.toString(); + AppToast.showSuccessToast( + message: "Email updated"); + // bloodDetails.city=_selectedHospital.toString(); + + // bloodDetails. + }, + + + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + + padding: EdgeInsets.all(15), + child: SecondaryButton( + textColor: Colors.white, + color: Color.fromRGBO(63, 72, 74, 1,), + label: " VIEW LIST OF CHILDREN", + // + onTap: () => Navigator.push( + context, + FadePage( + page: ChildPage(), + + + + ), + ), + + + ), + ), + + // Texts( + // // TranslationBase.of(context).advancePaymentLabel, + // model.user.emailAddress, + // textAlign: TextAlign.center, + // ), + SizedBox( + height: 12, + ), + SizedBox( + height: 12, + ), + SizedBox( + height: 12, + ), + + SizedBox( + height: 12, + ), + + SizedBox( + height: 12, + ), + + SizedBox( + height: 10, + ), + // Row( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Center( + // child: Container( + // color: Colors.white, + // width: 350, + // child: InkWell( + // onTap: () { + // showDialog( + // context: context, + // builder: (_) => + // AssetGiffyDialog( + // title: Text( + // "", + // style: TextStyle( + // fontSize: 22.0, + // fontWeight: + // FontWeight + // .w600), + // ), + // image: Image.asset( + // 'assets/images/BloodChrt_EN.png'), + // buttonCancelText: + // Text('cancel'), + // buttonCancelColor: + // Colors.grey, + // onlyCancelButton: true, + // )); + // }, + // child: Container( + // width: 250, + // height: 200, + // child:Image.asset( + // 'assets/images/BloodChrt_EN.png')), + // ), + // ), + // ), + // ], + // ), + + SizedBox( + height: MediaQuery.of(context).size.height * 0.15, + ) + ], + ), + + ), + ), + ); + } +} + diff --git a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart new file mode 100644 index 00000000..259bbdb7 --- /dev/null +++ b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart @@ -0,0 +1,111 @@ +import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SelectGenderDialog extends StatefulWidget { + final Email; + + const SelectGenderDialog({Key key, this.Email}) : super(key: key); + @override + _SelectGenderDialogState createState() => _SelectGenderDialogState(); +} + +class _SelectGenderDialogState extends State { + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Container( + child: Column( + children: [ + Divider(), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + //beneficiaryType = Gender.Male; + }); + }, + child: ListTile( + title: Text("Send the child's schedule to the email\n Tamer.dasdasdas@gmail.com "), + + + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + + SizedBox( + height: 5.0, + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + AppToast.showSuccessToast(message: "Email Sended"); + // widget.onValueSelected(beneficiaryType); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + ), + ), + ), + ), + ), + ], + ) + ], + ), + ) + ], + ); + } + + + +} diff --git a/lib/pages/ChildVaccines/dialogs/delete_child.dart b/lib/pages/ChildVaccines/dialogs/delete_child.dart new file mode 100644 index 00000000..250f40d3 --- /dev/null +++ b/lib/pages/ChildVaccines/dialogs/delete_child.dart @@ -0,0 +1,103 @@ +import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + + +class DeleteChild extends StatefulWidget { + @override + _DeleteChildState createState() => _DeleteChildState(); +} + +class _DeleteChildState extends State { + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Container( + child: Column( + children: [ + Divider(), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + //beneficiaryType = Gender.Male; + }); + }, + child: ListTile( + title: Text("Delete the child "), + + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + + SizedBox( + height: 5.0, + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + // widget.onValueSelected(beneficiaryType); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + ), + ), + ), + ), + ), + ], + ) + ], + ), + ) + ], + ); + } +} diff --git a/lib/pages/ChildVaccines/vaccinationtable_page.dart b/lib/pages/ChildVaccines/vaccinationtable_page.dart new file mode 100644 index 00000000..c160acfb --- /dev/null +++ b/lib/pages/ChildVaccines/vaccinationtable_page.dart @@ -0,0 +1,104 @@ +import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/vaccination_table_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; + +import 'dialogs/SelectGenderDialog.dart'; + +class VaccinationTablePage extends StatelessWidget { + @override + Widget build(BuildContext context) { + var checkedValue; + return BaseView( + onModelReady: (model) => model.getCreateVaccinationTable(),//getUserTermsAndConditions(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBarTitle: "Vaccination", + body: SingleChildScrollView( + child:Container( + margin: EdgeInsets.only(left: 15,right: 15,top: 70), + child: Column( + children: [//babyInformationModelList.length + ...List.generate(model.creteVaccinationTableModelList.length, (index) => + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.white, + + ), + padding: EdgeInsets.all(12), + width: double.infinity, + child: Column( + + children: [ + Row(children: [ + Text(model.creteVaccinationTableModelList[index].visit), + SizedBox(width: 10,), + + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Html( + // data:"
BCG
HEPATITIS B
"//model.creteVaccinationTableModelList[index].vaccinesDescription + data:model.creteVaccinationTableModelList[index].vaccinesDescription, + + ), + ],), + ), + Text(model.creteVaccinationTableModelList[index].givenAt), + + + ],), + Divider(color:Colors.black ,), + + ], + ) + + + ) + + ) + ], + ), + + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), + label: "Send Email ", + // + onTap: () { + //SelectGenderDialog(); +//=============== + showDialog( + context: context, + child: SelectGenderDialog( + ), + ); + //========= + } + + + ), + ), + ), + ); + } +} diff --git a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart new file mode 100644 index 00000000..d85971bb --- /dev/null +++ b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart @@ -0,0 +1,220 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/contactus/livechat_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import 'package:url_launcher/url_launcher.dart'; + +class HospitalsLiveChatPage extends StatefulWidget { + @override + _HospitalsLiveChatPageState createState() => _HospitalsLiveChatPageState(); +} + +class _HospitalsLiveChatPageState extends State { + int tappedIndex; + String chat; + + @override + void initState() { + super.initState(); + tappedIndex = -1; + chat = ""; + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getLiveChatRequestOrders(), + builder: (_, model, widget) => AppScaffold( + baseViewModel: model, + isShowDecPage: false, + body: SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 70, + ), + Container( + width: double.infinity, + height: 230, + decoration: BoxDecoration( + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/dashboard_top_bg.png'), + fit: BoxFit.cover), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: projectViewModel.isArabic? 10:20, + ), + Texts( + TranslationBase.of(context).instructions, + color: Colors.white, + textAlign: TextAlign.start, + ), + SizedBox( + height:projectViewModel.isArabic? 8:25, + ), + Texts( + TranslationBase.of(context) + .selectHospitalDec + + " :", + color: Colors.white, + fontWeight: FontWeight.w700, + textAlign: TextAlign.start, + ), + ], + ), + ), + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.85, + ), + SizedBox( + height: 100, + ), + ], + ), + Positioned( + left: 13, + right: 13, + top: 200, + child: Container( + width: double.maxFinite, + child: Column( + children: [ + ...List.generate( + model.LiveChatModelList.length, + (index) => Container( + margin: EdgeInsets.only( + left: 0, right: 0, bottom: 20), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all( + Radius.circular(5)), + color: tappedIndex == index + ? Theme.of(context).primaryColor + : Colors.white, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + InkWell( + onTap: () { + setState(() { + tappedIndex = index; + chat = "http://chat.dshmg.com:7788/hmgchatapp/hmgchattest/Index.aspx?Name=${model.user.firstName}&PatientID=${model.user.patientID}&MobileNo=${model.user.mobileNumber}&Language=${projectViewModel.currentLanguage}&WorkGroup=${model.LiveChatModelList[index].value}"; + }); + }, + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceAround, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + SizedBox( + width: 20, + ), + Expanded( + child: Container( + margin: + EdgeInsets.only( + left: 5, + right: 5), + child: Texts( + '${model.LiveChatModelList[index].projectName}', + color: + tappedIndex == + index + ? Colors + .white + : Colors + .black, + textAlign: TextAlign + .center, + ))), + //model.cOCItemList[index].cOCTitl + IconButton( + icon: Icon( + Icons.arrow_forward_ios, + color: + tappedIndex == index + ? Colors.white + : Colors.black, + ), + tooltip: '', + onPressed: () { + setState(() {}); + }, + ), + ], + ), + ) + ], + ), + ), + )), + ], + ), + ), + ), + ], + ), + Container( + height: MediaQuery.of(context).size.height * 0.20, + width: double.maxFinite, + ) + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + padding: EdgeInsets.all(8.0), + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.07, + width: MediaQuery.of(context).size.width * 0.8, + child: SecondaryButton( + label: TranslationBase.of(context).start, + loading: model.state == ViewState.BusyLocal, + textColor: Colors.white, + disabled: chat.isEmpty, + onTap: () { + launch(chat); + }, + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/ContactUs/LiveChat/livechat_page.dart b/lib/pages/ContactUs/LiveChat/livechat_page.dart new file mode 100644 index 00000000..a747db3d --- /dev/null +++ b/lib/pages/ContactUs/LiveChat/livechat_page.dart @@ -0,0 +1,129 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'hospitalsLivechat_page.dart'; + +class LiveChatPage extends StatefulWidget { + @override + _LiveChatPageState createState() => _LiveChatPageState(); +} + +class _LiveChatPageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + List imagesInfo = List(); + + @override + void initState() { + super.initState(); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/ar/0.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/ar/1.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/en/2.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/ar/2.png')); + + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + imagesInfo: imagesInfo, + title: TranslationBase.of(context).liveChat, + description: TranslationBase.of(context).infoChat, + appBarTitle: TranslationBase.of(context).service, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.92, // 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.9), //width: 0.7 + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.tab, + indicatorColor: Theme.of(context).primaryColor, + labelColor: Theme.of(context).primaryColor, + labelPadding: EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: Texts(TranslationBase.of(context).hospitals), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: Texts(TranslationBase.of(context).pharmacies), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + HospitalsLiveChatPage(), //SendFeedbackPage(), + PhamaciesLiveChatPage() + //StatusFeedbackPage() + ], + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart new file mode 100644 index 00000000..c5300b5d --- /dev/null +++ b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart @@ -0,0 +1,90 @@ +import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/contactus/livechat_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import 'package:url_launcher/url_launcher.dart'; + +class PhamaciesLiveChatPage extends StatefulWidget { + @override + _PhamaciesLiveChatPageState createState() => _PhamaciesLiveChatPageState(); +} + +class _PhamaciesLiveChatPageState extends State { + int tappedIndex; + String chat; + + @override + void initState() { + super.initState(); + tappedIndex = -1; + chat = ""; + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + builder: (_, model, widget) => AppScaffold( + baseViewModel: model, + isShowDecPage: false, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Column( + children: [ + SizedBox( + height: 20, + ), + Container( + width: double.infinity, + height: 200, + + child: Texts( + TranslationBase.of(context).instructionsPharmacies, + color: Colors.black, + textAlign: TextAlign.center, + ), + ), + /////////// + + SizedBox( + height: 100, + ), + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + padding: EdgeInsets.all(8.0), + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.87, + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + label: TranslationBase.of(context).start, + loading: model.state == ViewState.BusyLocal, + onTap: () { + print("chat=" + chat); + chat = + "http://chat.dshmg.com:7788/EPharmacyChat/EIndex.aspx?CustomerID=undefined&Name=${model.user.firstName}&MobileNo=${model.user.mobileNumber}&Language=${projectViewModel.isArabic? 1:2}"; + launch(chat); + }, + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/ContactUs/contact_us_page.dart b/lib/pages/ContactUs/contact_us_page.dart new file mode 100644 index 00000000..d301df3e --- /dev/null +++ b/lib/pages/ContactUs/contact_us_page.dart @@ -0,0 +1,87 @@ +import 'package:diplomaticquarterapp/pages/ContactUs/widgets/card_common_contat.dart'; +import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; + +import 'package:flutter/material.dart'; +import '../../uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart'; + +class ContactUsPage extends StatefulWidget { + @override + _ContactUsPageState createState() => _ContactUsPageState(); +} + +class _ContactUsPageState extends State { + + LocationUtils locationUtils; + + @override + void initState() { + locationUtils = + new LocationUtils(isShowConfirmDialog: true, context: context); + WidgetsBinding.instance + .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); + + super.initState(); + } + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).hMGServiceLabel, + isShowDecPage: false, + body: Container( + margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: CardCommonContact( + image: 'assets/images/new-design/find_us_icon.png', + text: TranslationBase.of(context).findUs, + subText: "", + type: 0, + + ), + ), + Expanded( + child: CardCommonContact( + image: 'assets/images/new-design/feedback_icon.png', + text: TranslationBase.of(context).feedback, + subText: "", + type: 1), + + ), + ], + ), + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: CardCommonContact( + image: 'assets/images/new-design/live_chat_icon.png', + text: TranslationBase.of(context).liveChat, + subText: TranslationBase.of(context).service, + type: 2, + + ), + ), + Expanded( + child: Container(), + + ), + ], + ), + ], + ), + ), + ); + } +} + diff --git a/lib/pages/ContactUs/findus/findus_page.dart b/lib/pages/ContactUs/findus/findus_page.dart new file mode 100644 index 00000000..5cf59e21 --- /dev/null +++ b/lib/pages/ContactUs/findus/findus_page.dart @@ -0,0 +1,133 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; +import 'package:diplomaticquarterapp/pages/ContactUs/findus/hospitrals_page.dart'; +import 'package:diplomaticquarterapp/pages/ContactUs/findus/pharmacies_page.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; + +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class FindUsPage extends StatefulWidget { + @override + _FindUsPageState createState() => _FindUsPageState(); +} + +class _FindUsPageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + @override + Widget build(BuildContext context) { + return BaseView( + allowAny: true, + onModelReady: (model) => model.getFindUsRequestOrders(), //model.getCOC(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + isShowDecPage: false, + appBarTitle: 'Locations', + baseViewModel: model, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.92, // 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.9), //width: 0.7 + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + //indicatorSize: TabBarIndicatorSize.label, + indicatorSize: TabBarIndicatorSize.tab, + + indicatorColor: Theme.of(context).primaryColor, + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: Texts(' Hospitals '), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: Texts(' Pharmacies '), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + HospitalsPage( + findusHospitalModelList: model.FindusHospitalModelList, + ), //SendFeedbackPage(), + PharmaciesPage( + findusPharmaciesModelList: + model.FindusPharmaciesModelList, + ) //StatusFeedbackPage() + ], + ), + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/ContactUs/findus/hospitrals_page.dart b/lib/pages/ContactUs/findus/hospitrals_page.dart new file mode 100644 index 00000000..308dbeca --- /dev/null +++ b/lib/pages/ContactUs/findus/hospitrals_page.dart @@ -0,0 +1,241 @@ +import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart'; +import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:giffy_dialog/giffy_dialog.dart'; +import 'package:url_launcher/url_launcher.dart'; +import 'package:maps_launcher/maps_launcher.dart'; + +class HospitalsPage extends StatefulWidget { + final List findusHospitalModelList; + + HospitalsPage({Key key, this.findusHospitalModelList}); + + @override + _HospitalsPageState createState() => _HospitalsPageState(); +} + +class _HospitalsPageState extends State { + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowDecPage: false, + body: SingleChildScrollView( + child: Container( + // margin: EdgeInsets.only(left: 15,right: 15,top: 70), + margin: EdgeInsets.only(left: 15, right: 15, top: 70), + child: Column( + children: [ + ...List.generate( + widget.findusHospitalModelList.length, + (index) => Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.white, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + InkWell( + onTap: () { + showDialog( + context: context, + builder: (_) => + AssetGiffyDialog( + title: Text( + widget + .findusHospitalModelList[ + index] + .locationName, + style: TextStyle( + fontSize: 22.0, + fontWeight: + FontWeight + .w600), + ), + image: Image.network( + widget + .findusHospitalModelList[ + index] + .projectImageURL + .toString(), + fit: BoxFit.cover, + ), + buttonCancelText: + Text('cancel'), + buttonCancelColor: + Colors.grey, + onlyCancelButton: true, + )); + }, + child: Container( + width: 70, + height: 70, + child: Image.network(widget + .findusHospitalModelList[ + index] + .projectImageURL + .toString())), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.only( + left: 5, + right: 5, + top: 10, + bottom: 1), + child: Texts( + '${widget.findusHospitalModelList[index].locationName}', + textAlign: TextAlign.center, + ))), //model.cOCItemList[index].cOCTitl + Expanded( + flex: 2, + child: Row( + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + IconButton( + icon: Icon(Icons.location_on,color: Theme.of(context).primaryColor,size: 35,), + // icon: new Image.asset( + // 'assets/images/new-design/navigate.png'), + tooltip: '', + onPressed: () { + setState(() { + MapsLauncher.launchCoordinates( + double.parse(widget + .findusHospitalModelList[ + index] + .latitude), + double.parse(widget + .findusHospitalModelList[ + index] + .longitude), + widget + .findusHospitalModelList[ + index] + .locationName); + }); + }, + ), + IconButton( + icon: Icon(Icons.phone,color: Theme.of(context).primaryColor,size: 35,), + // icon: new Image.asset( + // 'assets/images/new-design/call.png'), + tooltip: '', + onPressed: () { + setState(() { + // _volume += 10; + launch("tel://" + + widget + .findusHospitalModelList[ + index] + .phoneNumber); + }); + }, + ), + ], + ), + ), + ], + ), + ), + ], + ), + // Texts('${model.FindusHospitalModelList[index].locationName}'), + Divider( + height: 4.5, + color: Colors.grey[500], + ) + ], + ), + ), + )), + SizedBox( + height: 8, + ), + Container( + width: double.infinity, + height: 100, + color: Colors.white, + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + IconButton( + icon: new Image.asset( + 'assets/images/new-design/youtube.png'), + iconSize: 70, + tooltip: 'Youtube', + onPressed: () { + setState(() { + launch( + "https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); + }); + }, + ), + IconButton( + icon: new Image.asset( + 'assets/images/new-design/linkedin.png'), + tooltip: 'LinkedIn', + iconSize: 70, + onPressed: () { + setState(() { + launch( + "https://www.linkedin.com/company/drsulaiman-alhabib-medical-group"); + }); + }, + ), + IconButton( + icon: new Image.asset( + 'assets/images/new-design/twitter.png'), + tooltip: 'Twitter', + iconSize: 70, + onPressed: () { + setState(() { + launch("https://twitter.com/HMG"); + }); + }, + ), + IconButton( + icon: new Image.asset( + 'assets/images/new-design/facebook.png'), + tooltip: 'facebook', + iconSize: 70, + onPressed: () { + setState(() { + launch( + "https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/ContactUs/findus/pharmacies_page.dart b/lib/pages/ContactUs/findus/pharmacies_page.dart new file mode 100644 index 00000000..6cf94728 --- /dev/null +++ b/lib/pages/ContactUs/findus/pharmacies_page.dart @@ -0,0 +1,261 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart'; +import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:giffy_dialog/giffy_dialog.dart'; +import 'package:maps_launcher/maps_launcher.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class PharmaciesPage extends StatefulWidget { + final List findusPharmaciesModelList; + + PharmaciesPage({Key key, this.findusPharmaciesModelList}); + @override + _PharmaciesPageState createState() => _PharmaciesPageState(); +} + +class _PharmaciesPageState extends State { + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowDecPage: false, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 15, right: 15, top: 70), + child: Column( + children: [ + ...List.generate( + widget.findusPharmaciesModelList.length, + (index) => Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.white, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + InkWell( + onTap: () { + showDialog( + context: context, + builder: (_) => + AssetGiffyDialog( + title: Text( + widget + .findusPharmaciesModelList[ + index] + .locationName, + style: TextStyle( + fontSize: 22.0, + fontWeight: + FontWeight + .w600), + ), + image: widget + .findusPharmaciesModelList[ + index] + .projectImageURL != + null + ? Image.network( + widget + .findusPharmaciesModelList[ + index] + .projectImageURL, + fit: BoxFit.cover, + ) + : Image.network( + 'https://hmgwebservices.com/Images/Hospitals/15.jpg', + fit: BoxFit.cover, + ), + buttonCancelText: + Text('cancel'), + // buttonCancelText:Text(model.user.projectID) , + buttonCancelColor: + Colors.grey, + onlyCancelButton: true, + )); + }, + child: Container( + width: 70, + height: 70, + child: Image.network(widget + .findusPharmaciesModelList[ + index] + .projectImageURL != + null + ? widget + .findusPharmaciesModelList[ + index] + .projectImageURL + .toString() + : 'https://hmgwebservices.com/Images/Hospitals/15.jpg')), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.only( + left: 5, right: 5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + '${widget.findusPharmaciesModelList[index].locationName}', + textAlign: TextAlign.start, + ), + SizedBox( + height: 4, + ), + Texts( + '${widget.findusPharmaciesModelList[index].cityName}', + textAlign: TextAlign.center, + ), + ], + ), + ), + ), + //model.cOCItemList[index].cOCTitl + Expanded( + flex: 2, + child: Row( + children: [ + IconButton( + icon: Icon(Icons.location_on,color: Theme.of(context).primaryColor,size: 35,), + tooltip: '', + onPressed: () { + setState(() { + MapsLauncher.launchCoordinates( + double.parse(widget + .findusPharmaciesModelList[ + index] + .latitude), + double.parse(widget + .findusPharmaciesModelList[ + index] + .longitude), + widget + .findusPharmaciesModelList[ + index] + .locationName); + }); + }, + ), + IconButton( + icon: Icon(Icons.phone,color: Theme.of(context).primaryColor,size: 35,), + tooltip: 'I', + onPressed: () { + setState(() { + + launch("tel://" + + widget + .findusPharmaciesModelList[ + index] + .phoneNumber); + }); + }, + ), + ], + ), + ), + ], + ), + ), + ], + ), + Divider( + height: 4.5, + color: Colors.grey[500], + ) + ], + ), + ), + )), + SizedBox( + height: 8, + ), + Container( + width: double.infinity, + height: 100, + color: Colors.white, + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + IconButton( + icon: new Image.asset( + 'assets/images/new-design/youtube.png'), + iconSize: 70, + tooltip: 'Youtube', + onPressed: () { + setState(() { + // _volume += 10; + launch( + "https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); + }); + }, + ), + IconButton( + icon: new Image.asset( + 'assets/images/new-design/linkedin.png'), + tooltip: 'LinkedIn', + iconSize: 70, + onPressed: () { + setState(() { + launch( + "https://www.linkedin.com/company/drsulaiman-alhabib-medical-group"); + }); + }, + ), + IconButton( + icon: new Image.asset( + 'assets/images/new-design/twitter.png'), + tooltip: 'Twitter', + iconSize: 70, + onPressed: () { + setState(() { + launch("https://twitter.com/HMG"); + }); + }, + ), + IconButton( + icon: new Image.asset( + 'assets/images/new-design/facebook.png'), + tooltip: 'facebook', + iconSize: 70, + onPressed: () { + setState(() { + launch( + "https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/ContactUs/widgets/card_common_contat.dart b/lib/pages/ContactUs/widgets/card_common_contat.dart new file mode 100644 index 00000000..cfb9108b --- /dev/null +++ b/lib/pages/ContactUs/widgets/card_common_contat.dart @@ -0,0 +1,74 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/livechat_page.dart'; +import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; +import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class CardCommonContact extends StatelessWidget { + final image; + final text; + final subText; + final type; + const CardCommonContact( + {@required this.image, + @required this.text, + @required this.subText, + @required this.type}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return GestureDetector( + onTap: () { + navigateToSearch(context, this.type); + }, + child: Container( + margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0), + decoration: BoxDecoration(boxShadow: [ + BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0) + ], borderRadius: BorderRadius.circular(10), color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), + child: Texts(this.text, + // overflow: TextOverflow.clip, + color:Theme.of(context).primaryColor, + fontWeight: FontWeight.w700, + fontSize: 20.0), + ), + Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), + child: Texts(this.subText, + color: Colors.black, fontSize: 15.0), + ), + Align( + alignment: projectViewModel.isArabic? Alignment.bottomLeft:Alignment.bottomRight, + child: Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 8.0), + child: Image.asset(this.image, width: 60.0, height: 60.0), + ), + ), + ], + ), + ), + ); + } + + Future navigateToSearch(context, type) async { + + if (type == 0) { + Navigator.push(context, FadePage(page: FindUsPage())); + } else if (type == 1) { + Navigator.push(context, FadePage(page: FeedbackHomePage())); + } else if (type == 2) { + //LiveChatPage + Navigator.push(context, FadePage(page: LiveChatPage())); + + } + } +} diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart new file mode 100644 index 00000000..3e58b657 --- /dev/null +++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart @@ -0,0 +1,602 @@ +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart'; +import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart'; +import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-alert.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:intl/intl.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; +import 'package:table_calendar/table_calendar.dart'; + +class CovidTimeSlots extends StatefulWidget { + int projectID; + static bool areSlotsAvailable = false; + static DateTime selectedAppoDateTime; + static String selectedDate; + static String selectedTime; + + int selectedClinicID; + int selectedDoctorID; + + PatientShareResponse patientShareResponse; + + CovidTimeSlots({@required this.projectID}); + + @override + _CovidTimeSlotsState createState() => _CovidTimeSlotsState(); +} + +class _CovidTimeSlotsState extends State + with TickerProviderStateMixin { + Map _events; + AnimationController _animationController; + CalendarController _calendarController; + + AppSharedPreferences sharedPref = new AppSharedPreferences(); + + var selectedDate = ""; + dynamic selectedDateJSON; + dynamic jsonFreeSlots; + + List docFreeSlots = []; + List dayEvents = []; + + int selectedButtonIndex = 0; + + dynamic freeSlotsResponse; + + ScrollController _scrollController; + + @override + void initState() { + final _selectedDay = DateTime.now(); + + widget.patientShareResponse = new PatientShareResponse(); + + _scrollController = new ScrollController(); + + _events = { + _selectedDay: ['Event A0'] + }; + + WidgetsBinding.instance.addPostFrameCallback( + (_) => getCovidFreeSlots(context, widget.projectID)); + + _calendarController = CalendarController(); + _animationController = AnimationController( + vsync: this, + duration: const Duration(milliseconds: 50), + ); + + _animationController.forward(); + super.initState(); + } + + @override + void dispose() { + _animationController.dispose(); + _calendarController.dispose(); + super.dispose(); + } + + void _onDaySelected(DateTime day, List events) { + final DateFormat formatter = DateFormat('yyyy-MM-dd'); + setState(() { + this.selectedDate = DateUtil.getMonthDayYearDateFormatted(day); + openTimeSlotsPickerForDate(day, docFreeSlots); + CovidTimeSlots.selectedDate = formatter.format(day); + print(CovidTimeSlots.selectedDate); + }); + } + + void _onVisibleDaysChanged( + DateTime first, DateTime last, CalendarFormat format) { + print('CALLBACK: _onVisibleDaysChanged'); + } + + void _onCalendarCreated( + DateTime first, DateTime last, CalendarFormat format) { + print('CALLBACK: _onCalendarCreated'); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "COVID-19 TEST", + isShowAppBar: true, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 150.0, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage( + "assets/images/new-design/covid-19-big-banner-bg.png"), + fit: BoxFit.fill, + ), + color: Colors.white.withOpacity(0.3), + borderRadius: BorderRadius.all(Radius.circular(10))), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: + EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0), + child: SvgPicture.asset( + 'assets/images/new-design/covid-19-car.svg', + width: 90.0, + height: 90.0), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only( + left: 20.0, right: 20.0, top: 40.0), + child: Text("COVID-19 TEST", + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 24.0)), + ), + Container( + margin: EdgeInsets.only( + left: 20.0, right: 20.0, top: 10.0), + child: Text("Drive-Thru", + style: TextStyle( + color: Colors.white, fontSize: 24.0)), + ), + ], + ), + ], + ), + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.0), + color: Colors.white), + margin: EdgeInsets.fromLTRB(0.0, 20.0, 0.0, 5.0), + padding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 20.0), + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height * 0.65, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "Kindly select one of the available appointments from below: ", + style: + TextStyle(color: Colors.black, fontSize: 16.0)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.center, + child: Text(selectedDate, + style: TextStyle( + fontSize: 18.0, fontWeight: FontWeight.bold)), + ), + Container( + height: 50, + margin: EdgeInsets.all(20.0), + child: ListView.builder( + controller: _scrollController, + scrollDirection: Axis.horizontal, + itemCount: dayEvents.length, + itemBuilder: (context, index) { + return Container( + margin: EdgeInsets.only(right: 10.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(5.0), + side: BorderSide( + color: Colors.blue[400], + //Color of the border + style: BorderStyle.solid, + //Style of the border + width: 1.5, //width of the border + ), + ), + minWidth: + MediaQuery.of(context).size.width * 0.2, + child: index == selectedButtonIndex + ? getSelectedButton(index) + : getNormalButton(index)), + ); + }, + ), + ), + _buildTableCalendarWithBuilders(), + ], + ), + ), + SizedBox( + height: 100.0, + ), + ], + ), + ), + ), + bottomSheet: Container( + margin: EdgeInsets.all(10.0), + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.grey[500], + onPressed: () { + bookCovidTestAppointment(); + }, + child: Text("BOOK", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + ], + ), + ), + ); + } + + Widget _buildTableCalendarWithBuilders() { + return TableCalendar( + locale: 'en_US', + calendarController: _calendarController, + events: _events, + initialCalendarFormat: CalendarFormat.month, + startDay: DateTime.now(), + formatAnimation: FormatAnimation.slide, + startingDayOfWeek: StartingDayOfWeek.sunday, + weekendDays: [DateTime.friday, DateTime.saturday], + availableGestures: AvailableGestures.horizontalSwipe, + availableCalendarFormats: const { + CalendarFormat.month: '', + CalendarFormat.week: '', + }, + calendarStyle: CalendarStyle( + outsideDaysVisible: false, + weekendStyle: TextStyle().copyWith(color: Colors.blue[800]), + holidayStyle: TextStyle().copyWith(color: Colors.blue[800]), + ), + daysOfWeekStyle: DaysOfWeekStyle( + weekendStyle: TextStyle().copyWith(color: Colors.blue[600]), + ), + headerStyle: HeaderStyle( + centerHeaderTitle: true, + formatButtonVisible: false, + ), + builders: CalendarBuilders( + selectedDayBuilder: (context, date, _) { + return FadeTransition( + opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController), + child: Container( + margin: const EdgeInsets.all(4.0), + padding: const EdgeInsets.only(top: 5.0, left: 6.0), + color: Colors.transparent, + width: 0, + height: 0, + child: Text( + '${date.day}', + style: TextStyle().copyWith(fontSize: 16.0), + ), + ), + ); + }, + todayDayBuilder: (context, date, _) { + return Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: _calendarController.isSelected(date) + ? Colors.green[400] + : _calendarController.isToday(date) + ? Colors.brown[300] + : Colors.blue[400], + ), + width: 40.0, + height: 40.0, + child: Center( + child: Text( + '${date.day}', + style: TextStyle().copyWith( + color: Colors.white, + fontSize: 14.0, + ), + ), + ), + ); + }, + markersBuilder: (context, date, events, holidays) { + final children = []; + + if (events.isNotEmpty) { + children.add( + Positioned( + right: 4, + bottom: 4, + child: _buildEventsMarker(date, events), + ), + ); + } + + return children; + }, + ), + onDaySelected: (date, event, _) { + _onDaySelected( + date, + event, + ); + _animationController.forward(from: 0.0); + }, + onVisibleDaysChanged: _onVisibleDaysChanged, + onCalendarCreated: _onCalendarCreated, + ); + } + + openTimeSlotsPickerForDate(DateTime dateStart, List freeSlots) { + dayEvents.clear(); + DateTime dateStartObj = new DateTime( + dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0); + + freeSlots.forEach((v) { + if (v.start == dateStartObj) dayEvents.add(v); + }); + + setState(() { + if (dayEvents.length != 0) + CovidTimeSlots.areSlotsAvailable = true; + else + CovidTimeSlots.areSlotsAvailable = false; + + selectedButtonIndex = 0; + + CovidTimeSlots.selectedTime = dayEvents[selectedButtonIndex].isoTime; + }); + } + + Future> _getJSONSlots() async { + Map _eventsParsed; + List slotsList = []; + DateTime date; + final DateFormat formatter = DateFormat('HH:mm'); + final DateFormat dateFormatter = DateFormat('yyyy-MM-dd'); + for (var i = 0; i < freeSlotsResponse.length; i++) { + date = + DateUtil.convertStringToDate(freeSlotsResponse[i]['FreeTimeSlots']); + slotsList.add(FreeSlot(date, ['slot'])); + docFreeSlots.add(TimeSlot( + isoTime: formatter.format(date), + start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0), + end: date)); + } + _eventsParsed = + Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event); + setState(() { + CovidTimeSlots.selectedDate = dateFormatter.format( + DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots'])); + selectedDate = DateUtil.getMonthDayYearDateFormatted( + DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots'])); + selectedDateJSON = freeSlotsResponse[0]['FreeTimeSlots']; + }); + openTimeSlotsPickerForDate( + DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots); + _calendarController + .setFocusedDay(DateUtil.convertStringToDate(selectedDateJSON)); + return _eventsParsed; + } + + Widget _buildEventsMarker(DateTime date, List events) { + return Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: _calendarController.isSelected(date) + ? Colors.green[400] + : _calendarController.isToday(date) + ? Colors.brown[300] + : Colors.blue[400], + ), + width: 40.0, + height: 40.0, + child: Center( + child: Text( + '${date.day}', + style: TextStyle().copyWith( + color: Colors.white, + fontSize: 14.0, + ), + ), + ), + ); + } + + Widget getNormalButton(int index) { + return RaisedButton( + color: Colors.white, + textColor: new Color(0xFF60686b), + onPressed: () { + setState(() { + selectedButtonIndex = index; + CovidTimeSlots.selectedTime = dayEvents[index].isoTime; + print(CovidTimeSlots.selectedTime); + }); + }, + child: Text(dayEvents[index].isoTime, + style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), + ); + } + + Widget getSelectedButton(int index) { + return RaisedButton( + color: Colors.blue[400], + textColor: Colors.white, + onPressed: () { + setState(() { + selectedButtonIndex = index; + CovidTimeSlots.selectedTime = dayEvents[index].isoTime; + print(CovidTimeSlots.selectedTime); + }); + }, + child: Text(dayEvents[index].isoTime, + style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), + ); + } + + bookCovidTestAppointment() { +// Navigator.push(context, +// MaterialPageRoute(builder: (context) => CovidPaymentAlert())); + + DoctorList docObject = new DoctorList(); + docObject.doctorID = widget.selectedDoctorID; + docObject.clinicID = widget.selectedClinicID; + docObject.projectID = widget.projectID; + insertAppointmentCovidTest(context, docObject); + } + + insertAppointmentCovidTest(context, DoctorList docObject) { + DoctorsListService service = new DoctorsListService(); + AppoitmentAllHistoryResultList appo; + service + .insertAppointment( + docObject.doctorID, + docObject.clinicID, + docObject.projectID, + CovidTimeSlots.selectedTime, + CovidTimeSlots.selectedDate, + context) + .then((res) { + print(res); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: "Appointment Booked Successfully"); + Future.delayed(new Duration(milliseconds: 1800), () { + getPatientShare(context, res['AppointmentNo'], docObject.clinicID, + docObject.projectID, docObject); + }); + } else { + appo = new AppoitmentAllHistoryResultList(); + appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo']; + appo.clinicID = res['SameClinicApptList'][0]['DoctorID']; + appo.projectID = res['SameClinicApptList'][0]['ProjectID']; + appo.endTime = res['SameClinicApptList'][0]['EndTime']; + appo.startTime = res['SameClinicApptList'][0]['StartTime']; + appo.doctorID = res['SameClinicApptList'][0]['DoctorID']; + appo.isLiveCareAppointment = false; + appo.originalClinicID = 0; + appo.originalProjectID = 0; + appo.appointmentDate = res['SameClinicApptList'][0]['AppointmentDate']; + + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: res['ErrorEndUserMessage'], + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => {cancelAppointment(docObject, appo, context)}, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + }).catchError((err) { + AppToast.showErrorToast(message: err); + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, + BuildContext context) { + ConfirmDialog.closeAlertDialog(context); + DoctorsListService service = new DoctorsListService(); + service.cancelAppointment(appo, context).then((res) { + if (res['MessageStatus'] == 1) { + Future.delayed(new Duration(milliseconds: 1500), () { + insertAppointmentCovidTest(context, docObject); + }); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + getPatientShare(context, String appointmentNo, int clinicID, int projectID, + DoctorList docObject) { + DoctorsListService service = new DoctorsListService(); + service + .getPatientShare(appointmentNo, clinicID, projectID, context) + .then((res) { + print(res); + widget.patientShareResponse = new PatientShareResponse.fromJson(res); + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + navigateToPaymentAlert(); + }); + } + + navigateToPaymentAlert() { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CovidPaymentAlert( + patientShareResponse: widget.patientShareResponse))); + } + + getCovidFreeSlots(BuildContext context, int projectID) { + CovidDriveThruService service = new CovidDriveThruService(); + service.getCovidFreeSlots(context, projectID).then((res) { + print(res['COVID19_FreeTimeSlots']); + if (res['MessageStatus'] == 1) { + if (res['COVID19_FreeTimeSlots'].length != 0) { + freeSlotsResponse = res['COVID19_FreeTimeSlots']; + print(res['COVID19_FreeTimeSlots'].length); + _getJSONSlots().then((value) => { + setState(() => { + widget.selectedClinicID = + freeSlotsResponse[0]['ClinicID'], + widget.selectedDoctorID = + freeSlotsResponse[0]['DoctorID'], + _events.clear(), + _events = value + }) + }); + } else {} + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } +} diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart new file mode 100644 index 00000000..0563c4bd --- /dev/null +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -0,0 +1,305 @@ +import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; +import 'package:diplomaticquarterapp/models/CovidDriveThru/DriveThroughTestingCenterModel.dart'; +import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-details.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:maps_launcher/maps_launcher.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +class CovidDrivethruLocation extends StatefulWidget { + @override + _CovidDrivethruLocationState createState() => _CovidDrivethruLocationState(); +} + +class _CovidDrivethruLocationState extends State { + String projectDropdownValue; + List projectsList = []; + bool isLocationSelected = false; + String projectLat = ""; + String projectLong = ""; + String projectName = ""; + String projectID = ""; + + @override + void initState() { + WidgetsBinding.instance + .addPostFrameCallback((_) => getProjectsList(context)); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "COVID-19 TEST", + isShowAppBar: true, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), + child: Column( + children: [ + Container( + alignment: Alignment.centerLeft, + child: Text("Get The Result During 8 Hours", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 22.0, + color: Colors.black)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text( + "We are using the advance technology to test COVID-19, The sample for examination is taking between the nose and mouth (nasopharyngeal swab), the examination is done by ELITE In Genius of the company ELITECH GROUP MOLECULAR DIAGNOSTICS, Note that the device belongs to an Italian company and is manufactured in Japan with RC- PCR​", + style: TextStyle(fontSize: 16.0, color: Colors.black)), + ), + Container( + margin: EdgeInsets.only(top: 20.0), + alignment: Alignment.centerLeft, + child: Text("Select Location", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 18.0, + letterSpacing: 0.8, + color: Colors.grey[700])), + ), + Container( + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + border: Border.all( + color: Colors.grey[400], + width: 1.0, + ), + borderRadius: BorderRadius.circular(10), + ), + padding: EdgeInsets.all(8.0), + width: MediaQuery.of(context).size.width, + margin: EdgeInsets.only(top: 15.0), + child: DropdownButtonHideUnderline( + child: DropdownButton( + hint: new Text("Select Address"), + value: projectDropdownValue, + items: projectsList.map((item) { + return new DropdownMenuItem( + value: item.iD.toString(), + child: new Text(item.projectName), + ); + }).toList(), + onChanged: (newValue) { + setState(() { + projectDropdownValue = newValue; + setProjectLocation(newValue); + }); + }, + ), + )), + isLocationSelected + ? Container( + margin: EdgeInsets.only(top: 15.0), + alignment: Alignment.centerLeft, + child: Text("Selected Location", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 18.0, + letterSpacing: 0.8, + color: Colors.black)), + ) + : Container(), + isLocationSelected + ? Container( + margin: EdgeInsets.only(top: 5.0), + decoration: BoxDecoration( + border: Border.all(color: Colors.grey[400], width: 1.0), + ), + child: Image.network( + "https://maps.googleapis.com/maps/api/staticmap?center=" + + this.projectLat + + "," + + this.projectLong + + "&zoom=15&size=800x400&maptype=roadmap&markers=color:red%7C" + + this.projectLat + + "," + + this.projectLong + + "&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"), + ) + : Container(), + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.15, + width: double.infinity, + child: Column( + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.91, + height: 45.0, + child: RaisedButton( + color: new Color(0xFFc5272d), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.red[300], + onPressed: () { + getDirections(); + }, + child: + Text("GET DIRECTIONS", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + Container( + margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0), + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.grey[500], + onPressed: () { + back(); + }, + child: Text("BACK", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.grey[500], + onPressed: () { + next(); + }, + child: Text("NEXT", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ); + } + + getDirections() { + if (isLocationSelected) { + MapsLauncher.launchCoordinates(double.parse(projectLat), + double.parse(projectLong), this.projectName); + } else { + Utils.showErrorToast( + "Please select address from the dropdown menu to get directions"); + } + } + + next() { + if (isLocationSelected) { + getPaymentInfo(context, projectID); + } else { + Utils.showErrorToast( + "Please select address from the dropdown menu to continue"); + } + } + + back() { + Navigator.of(context).popAndPushNamed(HOME); + } + + setProjectLocation(newValue) { + print(newValue); + setState(() { + this.projectLat = + projectsList[(int.parse(newValue) - 1)].latitude.toString(); + this.projectLong = + projectsList[(int.parse(newValue) - 1)].longitude.toString(); + this.projectName = projectsList[(int.parse(newValue) - 1)].projectName; + this.projectID = + projectsList[(int.parse(newValue) - 1)].projectID.toString(); + isLocationSelected = true; + }); + } + + getPaymentInfo(BuildContext context, String projectID) { + CovidDriveThruService service = new CovidDriveThruService(); + + CovidPaymentInfoResponse covidPaymentInfoResponse = + new CovidPaymentInfoResponse(); + + service + .getCovidPaymentInformation(context, int.parse(projectID)) + .then((res) { + if (res['MessageStatus'] == 1) { + setState(() { + covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson( + res['COVID19_PatientShare']); + print(covidPaymentInfoResponse.procedureNameField); + }); + } else {} + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CovidPaymentDetails( + covidPaymentInfoResponse: covidPaymentInfoResponse, + projectID: int.parse(projectID), + ))); + }); + } + + getProjectsList(BuildContext context) { + CovidDriveThruService service = new CovidDriveThruService(); + service.getCovidProjectsList(context).then((res) { + print(res); + if (res['MessageStatus'] == 1) { + print(res); + setState(() { + res['List_COVID19_ProjectDriveThroughTestingCenter'].forEach((v) { + projectsList.add(new DriveThroughTestingCenterModel.fromJson(v)); + }); + }); + } else {} + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } +} diff --git a/lib/pages/Covid-DriveThru/covid-payment-alert.dart b/lib/pages/Covid-DriveThru/covid-payment-alert.dart new file mode 100644 index 00000000..ac5f45fc --- /dev/null +++ b/lib/pages/Covid-DriveThru/covid-payment-alert.dart @@ -0,0 +1,288 @@ +import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class CovidPaymentAlert extends StatefulWidget { + PatientShareResponse patientShareResponse; + + CovidPaymentAlert({@required this.patientShareResponse}); + + @override + _CovidPaymentAlertState createState() => _CovidPaymentAlertState(); +} + +class _CovidPaymentAlertState extends State { + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "COVID-19 TEST", + isShowAppBar: true, + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 200.0, + color: new Color(0xFFc5272d), + child: Row( + children: [ + Container( + margin: EdgeInsets.only(left: 50.0), + child: SvgPicture.asset( + 'assets/images/new-design/alert_icon.svg', + width: 80.0, + height: 80.0), + ), + Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.only(left: 30.0, right: 20.0), + child: Text("Alert", + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 24.0)), + ), + Container( + width: MediaQuery.of(context).size.width * 0.55, + margin: EdgeInsets.only( + left: 30.0, right: 20.0, top: 5.0), + child: Text( + "Pay With-in 15 mins to confirm the appointment", + overflow: TextOverflow.clip, + style: TextStyle( + color: Colors.white, fontSize: 20.0)), + ), + ], + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 30.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + alignment: Alignment.center, + child: Text("Pay With-in 15 mins", + overflow: TextOverflow.clip, + style: TextStyle( + color: new Color(0xFFc5272d), + fontSize: 24.0, + fontWeight: FontWeight.bold)), + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.only(top: 15.0), + child: Text( + "Payment for Covid-19 Test should Be made with-in 15 mins otherwise The system will Cancel the Scheduled appointment automatically​.", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.grey[700], + fontSize: 18.0, + letterSpacing: 0.8)), + ), + Container( + margin: EdgeInsets.only( + top: 40.0, bottom: 10.0, left: 0.0, right: 20.0), + child: Text(TranslationBase.of(context).appoInfo, + style: TextStyle( + fontSize: 18.0, + color: Colors.grey[700], + fontWeight: FontWeight.bold)), + ), + Container( + margin: EdgeInsets.only(left: 0.0, bottom: 20.0), + width: MediaQuery.of(context).size.width, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.grey[200], + boxShadow: [ + BoxShadow(color: Colors.grey, spreadRadius: 2), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only( + top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text("COVID-19 TEST", + style: TextStyle( + fontSize: 18.0, + color: Colors.black, + fontWeight: FontWeight.bold)), + ), + Container( + margin: EdgeInsets.only(bottom: 10.0), + child: Row( + children: [ + Container( + margin: + EdgeInsets.only(left: 20.0, right: 20.0), + child: Icon( + Icons.local_hospital, + size: 24, + color: Colors.grey[700], + )), + Container( + child: Text( + widget.patientShareResponse.projectName != + null + ? widget.patientShareResponse.projectName + : "NULL", + style: TextStyle( + fontSize: 18.0, color: Colors.grey[700])), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(bottom: 10.0), + child: Row( + children: [ + Container( + margin: + EdgeInsets.only(left: 20.0, right: 20.0), + child: Icon( + Icons.date_range, + size: 24, + color: Colors.grey[700], + )), + Container( + child: Text( + widget.patientShareResponse.appointmentDate != + null + ? getDate(widget.patientShareResponse + .appointmentDate) + .split(" ")[0] + : "NULL", + style: TextStyle( + fontSize: 18.0, color: Colors.grey[700])), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(bottom: 10.0), + child: Row( + children: [ + Container( + margin: + EdgeInsets.only(left: 20.0, right: 20.0), + child: Icon( + Icons.access_time, + size: 24, + color: Colors.grey[700], + )), + Container( + child: Text( + widget.patientShareResponse.appointmentDate != + null + ? getDate(widget.patientShareResponse + .appointmentDate) + .split(" ")[1] + : "NULL", + style: TextStyle( + fontSize: 18.0, color: Colors.grey[700])), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(bottom: 10.0), + child: Row( + children: [ + Container( + margin: + EdgeInsets.only(left: 20.0, right: 20.0), + child: SvgPicture.asset( + "assets/images/new-design/track_icon.svg", + width: 20.0, + height: 20.0)), + Container( + child: Text( + widget.patientShareResponse.doctorNameObj != + null + ? widget + .patientShareResponse.doctorNameObj + : "NULL", + style: TextStyle( + fontSize: 18.0, color: Colors.grey[700])), + ), + ], + ), + ), + ], + ), + ), + ], + ), + ), + ], + ), + ), + bottomSheet: Container( + margin: EdgeInsets.all(10.0), + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.grey[500], + onPressed: () { +// bookCovidTestAppointment(); + }, + child: Text("NEXT", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + ], + ), + ), + ); + } + + String getDate(String appoDate) { + var appoDateFormatted = ""; + + var dateObj = DateUtil.convertStringToDate(appoDate); + + setState(() { + appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString() + + " " + + dateObj.hour.toString() + + ":" + + dateObj.minute.toString() + + ":00"; + }); + return appoDateFormatted; + } +} diff --git a/lib/pages/Covid-DriveThru/covid-payment-details.dart b/lib/pages/Covid-DriveThru/covid-payment-details.dart new file mode 100644 index 00000000..1254997d --- /dev/null +++ b/lib/pages/Covid-DriveThru/covid-payment-details.dart @@ -0,0 +1,257 @@ +import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; +import 'package:diplomaticquarterapp/pages/Covid-DriveThru/Covid-TimeSlots.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class CovidPaymentDetails extends StatefulWidget { + CovidPaymentInfoResponse covidPaymentInfoResponse; + int projectID; + + CovidPaymentDetails( + {@required this.covidPaymentInfoResponse, @required this.projectID}); + + @override + _CovidPaymentDetailsState createState() => _CovidPaymentDetailsState(); +} + +class _CovidPaymentDetailsState extends State { + bool isAgree = false; + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "COVID-19 TEST", + isShowAppBar: true, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 150.0, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage( + "assets/images/new-design/covid-19-big-banner-bg.png"), + fit: BoxFit.fill, + ), + color: Colors.white.withOpacity(0.3), + borderRadius: BorderRadius.all(Radius.circular(10))), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: + EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0), + child: SvgPicture.asset( + 'assets/images/new-design/covid-19-car.svg', + width: 90.0, + height: 90.0), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only( + left: 20.0, right: 20.0, top: 40.0), + child: Text("COVID-19 TEST", + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 24.0)), + ), + Container( + margin: EdgeInsets.only( + left: 20.0, right: 20.0, top: 10.0), + child: Text("Drive-Thru", + style: TextStyle( + color: Colors.white, fontSize: 24.0)), + ), + ], + ), + ], + ), + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.0), + color: Colors.white), + margin: EdgeInsets.fromLTRB(0.0, 30.0, 0.0, 5.0), + padding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 20.0), + child: Column( + children: [ + Container( + alignment: Alignment.center, + margin: + EdgeInsets.only(left: 0.0, right: 20.0, top: 30.0), + child: Text("Test Fees", + style: TextStyle( + color: Colors.black, + fontSize: 22.0, + fontWeight: FontWeight.bold)), + ), + Table( + children: [ + TableRow(children: [ + TableCell( + child: _getNormalText(TranslationBase.of(context) + .patientShareToDo)), + TableCell( + child: _getNormalText(widget + .covidPaymentInfoResponse.patientShareField + .toString())), + ]), + TableRow(children: [ + TableCell( + child: _getNormalText( + TranslationBase.of(context).patientTaxToDo)), + TableCell( + child: _getNormalText(widget + .covidPaymentInfoResponse + .patientTaxAmountField + .toString())), + ]), + TableRow(children: [ + TableCell( + child: _getNormalText(TranslationBase.of(context) + .patientShareTotalToDo)), + TableCell( + child: _getNormalText(widget + .covidPaymentInfoResponse + .patientShareWithTaxField + .toString())), + ]), + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 5.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Checkbox( + value: isAgree, + onChanged: (value) { + setState(() { + isAgree = !isAgree; + }); + }, + activeColor: Colors.blue, + ), + Texts(TranslationBase.of(context) + .iAgreeToTheTermsAndConditions), + ], + ), + ), + Divider( + color: Colors.grey, + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 5.0), + child: Text("You can pay by following options: ", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + fontFamily: "Open-Sans")), + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 5.0), + child: Image.asset( + "assets/images/new-design/payment_options_invoice_confirmation.png", + width: 300), + ), + ], + ), + ), + ), + bottomSheet: Container( + margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 20.0), + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.grey[500], + onPressed: () { + cancel(); + }, + child: Text("CANCEL", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.grey[500], + onPressed: isAgree ? next : null, + child: Text("NEXT", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + ], + ), + ), + ); + } + + void next() { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CovidTimeSlots( + projectID: widget.projectID, + ))); + } + + cancel() { + Navigator.pop(context); + } + + _getNormalText(text) { + return Container( + margin: EdgeInsets.only(top: 20.0, right: 10.0), + child: Text(text, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 15, + fontFamily: 'Open-Sans', + letterSpacing: 0.5, + color: Colors.grey[700])), + ); + } +} diff --git a/lib/pages/DrawerPages/family/add-family-member.dart b/lib/pages/DrawerPages/family/add-family-member.dart new file mode 100644 index 00000000..35b19ccd --- /dev/null +++ b/lib/pages/DrawerPages/family/add-family-member.dart @@ -0,0 +1,244 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/model/family-file/add_family_file_request.dart'; +import 'package:diplomaticquarterapp/core/model/family-file/insert_share_file_request.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; +import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; +import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; + +import 'add-family_type.dart'; + +class AddMember extends StatefulWidget { + @override + _AddMember createState() => _AddMember(); +} + +class _AddMember extends State { + final util = Utils(); + final nationalIDorFile = TextEditingController(); + final int loginType = AddFamilyMemberType.loginType; + String mobileNo; + String countryCode = '966'; + bool isButtonDisabled = true; + var sharedPref = new AppSharedPreferences(); + final authService = new AuthProvider(); + bool isLoading = false; + var familyFileProvider = FamilyFilesProvider(); + + var patientShareRequestID; + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).myFamilyFiles, + isShowAppBar: true, + body: isLoading == true + ? AppCircularProgressIndicator() + : SingleChildScrollView( + child: Container( + padding: + EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), + height: SizeConfig.realScreenHeight * .9, + width: SizeConfig.realScreenWidth, + child: Column(children: [ + Expanded( + flex: 2, + child: AppText( + TranslationBase.of(context).enterNationalId, + fontSize: SizeConfig.textMultiplier * 3.5, + textAlign: TextAlign.left, + )), + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + MobileNo( + onNumberChange: (value) => + {mobileNo = value, validateForm()}, + onCountryChange: (value) => countryCode = value), + Container( + child: TextFields( + controller: nationalIDorFile, + onChanged: (value) => {validateForm()}, + prefixIcon: Icon( + loginType == 1 + ? Icons.chrome_reader_mode + : Icons.receipt, + color: Colors.red), + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + hintText: loginType == 1 + ? TranslationBase.of(context).nationalID + : TranslationBase.of(context).fileNo, + )) + ], + ), + ), + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).add, + () => {this.addMember()}, + color: isButtonDisabled == true + ? Colors.grey + : Colors.grey[900], + textColor: Colors.white, + )) + ], + ), + ], + )) + ]), + ))); + } + + void validateForm() { + if (util.validateIDBox(nationalIDorFile.text, loginType) == true && + mobileNo.length >= 9 && + util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) { + setState(() { + isButtonDisabled = false; + }); + } else { + setState(() { + isButtonDisabled = true; + }); + } + } + + addMember() { + var request = AddFamilyFileReq(); + if (this.loginType == 1) { + request.sharedPatientID = 0; + request.sharedPatientIdentificationID = this.nationalIDorFile.text; + } else if (this.loginType == 2) { + request.sharedPatientID = int.parse(this.nationalIDorFile.text); + request.sharedPatientIdentificationID = ''; + } + request.searchType = this.loginType; + request.sharedPatientMobileNumber = this.mobileNo; + request.zipCode = countryCode; + request.isRegister = false; + request.patientStatus = 2; + loading(true); + familyFileProvider + .addFamilyFile(request) + .then((value) => manageFamily(value)) + .catchError(() { + loading(false); + }); + } + + manageFamily(addMemberResult) { + loading(false); + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: addMemberResult['ShareFamilyFileObj']['Message'], + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => { + insertFamilyData(addMemberResult), + ConfirmDialog.closeAlertDialog(context) + }, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + + insertFamilyData(addMemberResult) { + var request = InsertSharePatientFileReq(); + request.responseID = addMemberResult['ShareFamilyFileObj']['ReponseID']; + request.shareFamilyPatientName = + addMemberResult['ShareFamilyFileObj']['SharedPatientName']; + request.status = 2; + if (request.patientOutSA == 1) { + request.regionID = 2; + } else { + request.regionID = 1; + } + loading(true); + familyFileProvider + .insertNewMember(request) + .then((value) => sendActivationCode(value)); + } + + sendActivationCode(result) { + // var request = this.getCommonRequest(); + loading(true); + patientShareRequestID = result['PatientShareRequestID']; + familyFileProvider + .sendActivationCode(mobileNo, countryCode, nationalIDorFile.text) + .then((result) => { + if (result != null && result['isSMSSent'] == true) + {this.startSMSService(1, result)} + // {loading(false), this.startSMSService(type)} + // else + // {loading(false)} + }); + } + + startSMSService(type, result) { + loading(false); + SMSOTP( + context, + type, + mobileNo, + (value) { + this.checkActivationCode(value, result); + }, + () => { + print('Faild..'), + }, + ).displayDialog(context); + } + + checkActivationCode(value, result) { + familyFileProvider + .checkActivationCode( + result['LogInTokenID'], value, nationalIDorFile.text, mobileNo) + .then((result) => { + SMSOTP.hideSMSBox(context), + handleFamilyRequests(this.patientShareRequestID, 3) + }); + } + + handleFamilyRequests(id, stauts) { + familyFileProvider + .acceptAndRejectRecievedRequests(id, stauts) + .then((result) => { + sharedPref.remove(FAMILY_FILE), + Navigator.of(context).pushNamed( + MY_FAMILIY, + ) + }); + } + + loading(flag) { + setState(() { + isLoading = flag; + }); + } +} diff --git a/lib/pages/DrawerPages/family/add-family_type.dart b/lib/pages/DrawerPages/family/add-family_type.dart new file mode 100644 index 00000000..33e39397 --- /dev/null +++ b/lib/pages/DrawerPages/family/add-family_type.dart @@ -0,0 +1,154 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/routes.dart'; + +class AddFamilyMemberType extends StatelessWidget { + static int loginType = 0; + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).myFamilyFiles, + isShowAppBar: true, + body: Padding( + padding: EdgeInsets.all(20), + child: Column( + children: [ + Expanded( + flex: 6, + child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + 'assets/images/DQ/dq_logo_icon.png', + height: 80, + width: 80, + ), + Padding( + padding: EdgeInsets.all(20), + child: AppText( + TranslationBase.of(context).registerInfoFamily, + fontSize: SizeConfig.textMultiplier * 3.5, + textAlign: TextAlign.left, + ), + ), + Padding( + padding: EdgeInsets.all(20), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: InkWell( + onTap: () => { + AddFamilyMemberType.loginType = 1, + Navigator.of(context) + .pushNamed(ADD_FAMILY_MEMBER) + }, + child: RoundedContainer( + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: EdgeInsets.fromLTRB( + 20, 10, 20, 10), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/id_card_icon.png', + height: SizeConfig + .imageSizeMultiplier * + 12, + width: SizeConfig + .imageSizeMultiplier * + 15, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context) + .nationalID, + fontSize: SizeConfig + .textMultiplier * + 2, + ) + ], + ), + )))), + Expanded( + child: InkWell( + onTap: () => { + AddFamilyMemberType.loginType = 2, + Navigator.of(context) + .pushNamed(ADD_FAMILY_MEMBER) + }, + child: RoundedContainer( + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: EdgeInsets.fromLTRB( + 25, 10, 25, 10), + child: Column( + children: [ + Image.asset( + 'assets/images/my_file_white_icon.png', + height: SizeConfig + .imageSizeMultiplier * + 12, + width: SizeConfig + .imageSizeMultiplier * + 15, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context) + .fileNo, + fontSize: SizeConfig + .textMultiplier * + 2, + ) + ], + ), + )))) + ], + )), + Divider( + color: Colors.grey, + height: 2, + ), + ]), + ), + // Expanded( + // flex: 2, + // child: Column( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // Row( + // children: [ + // Expanded( + // child: DefaultButton( + // TranslationBase.of(context).registerNow, + // () => { + // Navigator.of(context).pushNamed( + // REGISTER, + // ) + // }, + // )) + // ], + // ), + // ], + // )) + ], + ))); + } +} diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart new file mode 100644 index 00000000..2d7e4270 --- /dev/null +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -0,0 +1,793 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' + as list; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; +import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; +import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:provider/provider.dart'; + +class MyFamily extends StatefulWidget { + final bool isAppbarVisible; + + MyFamily({this.isAppbarVisible = true}); + + @override + _MyFamily createState() => _MyFamily(); +} + +class _MyFamily extends State with TickerProviderStateMixin { + List imagesInfo = List(); + final familyFileProvider = FamilyFilesProvider(); + AppSharedPreferences sharedPref = new AppSharedPreferences(); + var userID; + TabController _tabController; + int _tabIndex = 0; + AuthenticatedUserObject authenticatedUserObject = + locator(); + AppointmentRateViewModel appointmentRateViewModel = + locator(); + ProjectViewModel projectViewModel; + AuthenticatedUser user; + VitalSignService _vitalSignService = locator(); + var isVaiable = false; + @override + void initState() { + _tabController = new TabController(length: 2, vsync: this, initialIndex: 0); + checkUserData(); + super.initState(); + } + + bool expandFlag = false; + + Widget build(BuildContext context) { + imagesInfo.add( + ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'), + ); + + imagesInfo.add( + ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'), + ); + projectViewModel = Provider.of(context); + return AppScaffold( + appBarTitle: TranslationBase.of(context).myFamilyFiles, + isShowAppBar: widget.isAppbarVisible, + imagesInfo: imagesInfo, + description: TranslationBase.of(context).familyInfo, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.92, + // 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.9), //width: 0.7 + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + //indicatorSize: TabBarIndicatorSize.label, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: AppText(TranslationBase.of(context).family), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: AppText(TranslationBase.of(context).request), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: (user != null && projectViewModel.isLogin) + ? TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + myFamilyDetails(context), + myFamilyRequest(context) + ], + ) + : Container(child: AppText('Loading..')), + ) + ], + ), + ), + ); + + return AppScaffold( + appBarTitle: TranslationBase.of(context).myFamilyFiles, + isShowAppBar: widget.isAppbarVisible, + body: SingleChildScrollView( + child: Container( + height: SizeConfig.screenHeight * .9, + width: SizeConfig.realScreenWidth, + padding: EdgeInsets.all(20), + child: Stack( + children: [ + TabBar( + controller: _tabController, + indicatorColor: Colors.red, + tabs: [ + Tab( + // padding: EdgeInsets.all(6), + child: AppText(TranslationBase.of(context).family)), + Tab( + // padding: EdgeInsets.all(6), + child: + AppText(TranslationBase.of(context).request)), + ], + ), + TabBarView( + controller: _tabController, + children: [ + myFamilyDetails(context), + myFamilyRequest(context) + ], + ) + ], + )))); + } + + Widget myFamilyDetails(context) { + return Container( + height: MediaQuery.of(context).size.height, + margin: EdgeInsets.fromLTRB(20.0, 25.0, 20.0, 0.0), + child: Column( + children: [ + Expanded( + flex: 4, + child: FutureBuilder( + future: getFamilyFiles(), // async work + builder: (BuildContext context, + AsyncSnapshot + snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.waiting: + return Padding( + padding: EdgeInsets.only(top: 50), + child: Text('Loading....')); + default: + if (snapshot.hasError) + return Padding( + padding: EdgeInsets.all(10), + child: Text( + TranslationBase.of(context).noDataAvailable)); + else + return Padding( + padding: EdgeInsets.only(top: 50), + child: Column(children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 3, + child: Text( + TranslationBase.of(context).request)), + Expanded( + flex: 2, + child: Text( + TranslationBase.of(context).switchUser, + )), + Expanded( + flex: 1, + child: Text( + TranslationBase.of(context).deleteView, + )), + ], + ), + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: snapshot + .data.getAllSharedRecordsByStatusList + .map((result) { + return result.status == 3 + ? Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + flex: 3, + child: Text( + result.patientName)), + Expanded( + flex: 2, + child: IconButton( + icon: Icon(Icons.group), + color: Colors.black, + onPressed: () { + switchUser( + result, context); + }, + )), + Expanded( + flex: 1, + child: IconButton( + icon: Icon( + Icons.delete, + color: Colors.black, + ), + onPressed: () { + deleteFamily( + result, context); + }, + )), + ], + )) + : SizedBox(); + }).toList()) + ])); + } + }, + ), + ), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).addFamilyMember, + () => { + Navigator.of(context) + .pushNamed(ADD_FAMILY_MEMBER_TYPE) + }, + color: Colors.grey[900], + textColor: Colors.white, + )) + ], + ), + ], + ), + ) + ], + )); + } + + Widget myFamilyRequest(context) { + return //Padding( + // padding: const EdgeInsets.symmetric(horizontal: 10.0), + // child: + SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height, + margin: EdgeInsets.only(top: 65), + child: Column( + children: [ + RoundedContainer( + child: ExpansionTile( + title: Text( + TranslationBase.of(context).userViewRequest, + style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold), + ), + children: [ + FutureBuilder( + future: getUserViewRequest(), // async work + builder: (BuildContext context, + AsyncSnapshot snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.waiting: + return Padding( + padding: EdgeInsets.only(top: 50), + child: Text('Loading....')); + default: + if (snapshot.hasError) + return Padding( + padding: EdgeInsets.all(10), + child: Text(TranslationBase.of(context) + .noDataAvailable)); + else + return Column( + children: [ + // Padding(padding: EdgeInsets.only(left:10, right:10), + // child: + // Row( + // mainAxisAlignment: + // MainAxisAlignment.spaceBetween, + // children: [ + // Expanded( + // flex: 3, + // child: Text(TranslationBase.of(context) + // .request)), + // Expanded( + // flex: 2, + // child: Text( + // TranslationBase.of(context) + // .switchUser, + // )), + // Expanded( + // flex: 1, + // child: Text( + // TranslationBase.of(context) + // .deleteView, + // )), + // ], + // )), + Column(children: [ + Padding( + padding: EdgeInsets.only( + left: 10, right: 10), + child: Row(children: [ + Expanded( + flex: 3, + child: AppText( + TranslationBase.of(context) + .theName)), + Expanded( + flex: 1, + child: AppText( + TranslationBase.of(context) + .allowView)), + Expanded( + flex: 1, + child: AppText( + TranslationBase.of(context) + .rejectView)), + ])), + Column( + children: familyFileProvider + .allSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList + .map((result) { + return Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + flex: 3, + child: + Text(result.patientName)), + Expanded( + flex: 1, + child: IconButton( + icon: Icon( + Icons.check_circle, + color: Colors.black, + ), + onPressed: () { + acceptRemoveRequest( + result.iD, + 3, + context); + }, + )), + Expanded( + flex: 1, + child: IconButton( + icon: Icon( + Icons.delete, + color: Colors.black, + ), + onPressed: () { + acceptRemoveRequest( + result.iD, + 4, + context); + }, + )) + ], + )); + }).toList()) + ]) + ], + ); + } + }) + ], + ), + ), + RoundedContainer( + child: ExpansionTile( + title: Text( + TranslationBase.of(context).sentRequest, + style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold), + ), + children: [ + FutureBuilder( + future: getSentRequest(), // async work + builder: (BuildContext context, + AsyncSnapshot + snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.waiting: + return Padding( + padding: EdgeInsets.only(top: 50), + child: Text('Loading....')); + default: + if (snapshot.hasError) + return Padding( + padding: EdgeInsets.all(10), + child: Text(TranslationBase.of(context) + .noDataAvailable)); + else + return Container( + height: SizeConfig.screenHeight * .3, + child: SingleChildScrollView( + child: Column( + children: [ + Padding( + padding: EdgeInsets.only( + left: 10, right: 10), + child: Row(children: [ + Expanded( + flex: 3, + child: AppText( + TranslationBase.of(context) + .theName)) + ])), + Column( + children: snapshot + .data.getAllSharedRecordsByStatusList + .map((result) { + return Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + flex: 3, + child: Text( + result.patientName)), + Expanded( + flex: 2, + child: AppText( + result.statusDescription, + color: result.status == 3 + ? Colors.green + : result.status == 2 + ? Colors + .yellow[800] + : Colors.red, + )), + ], + )); + }).toList(), + ) + ], + ))); + } + }) + ], + )), + RoundedContainer( + child: ExpansionTile( + title: Text( + TranslationBase.of(context).userView, + style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold), + ), + children: [ + FutureBuilder( + future: getUserViewRequest(), // async work + builder: (BuildContext context, + AsyncSnapshot snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.waiting: + return Padding( + padding: EdgeInsets.only(top: 50), + child: Text('Loading....')); + default: + if (snapshot.hasError) + return Padding( + padding: EdgeInsets.all(10), + child: Text(TranslationBase.of(context) + .noDataAvailable)); + else + return Column( + children: [ + Column(children: [ + Padding( + padding: + EdgeInsets.only(left: 10, right: 10), + child: Row(children: [ + Expanded( + flex: 3, + child: AppText( + TranslationBase.of(context) + .theName)), + Expanded( + flex: 1, + child: AppText( + TranslationBase.of(context) + .deleteView)), + ])), + Column( + children: familyFileProvider + .allSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList + .map((result) { + return result.status == 3 + ? Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + flex: 3, + child: AppText( + result.patientName)), + Expanded( + flex: 1, + child: IconButton( + icon: Icon( + Icons.delete, + color: Colors.black, + ), + onPressed: () { + deactivateRequest( + result.iD, + 5, + context); + }, + )), + ], + )) + : Container( + child: AppText(isAvailable())); + }).toList()) + ]) + ], + ); + } + }) + ], + )) + ], + ), + ), + ); + } + + String isAvailable() { + if (isVaiable == false) { + this.isVaiable = true; + return TranslationBase.of(context).noDataAvailable; + } else { + return ""; + } + } + + Future getFamilyFiles() async { + if (user != null) { + if (await sharedPref.getObject(FAMILY_FILE) != null) { + // print(await sharedPref.getObject(FAMILY_FILE)); + return Future.value(GetAllSharedRecordsByStatusResponse.fromJson( + await sharedPref.getObject(FAMILY_FILE))); + } else { + return familyFileProvider.getSharedRecordByStatus(); + } + } + } + + Future getUserViewRequest() async { + var user = await sharedPref.getObject(USER_PROFILE); + return familyFileProvider.getUserViewRequest(user['PatientID']); + } + + Future getSentRequest() async { + // var user = await sharedPref.getObject(USER_PROFILE); + return familyFileProvider.getUserSentRequest(); + } + + deleteFamily(family, context) { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: TranslationBase.of(context).removeFamilyMember, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => { + removeFamily(family, context), + ConfirmDialog.closeAlertDialog(context) + }, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + + removeFamily(GetAllSharedRecordsByStatusList family, context) { + this.userID = family.iD; + Map request = {}; + request['ID'] = this.userID; + request['IsActive'] = false; + this + .familyFileProvider + .deativateActivateMemberFile(request) + .then((value) => refreshFamily(context)); + } + + refreshFamily(context) { + //sharedPref.remove(FAMILY_FILE); + setState(() { + sharedPref.remove(FAMILY_FILE); + }); + } + + switchUser(user, context) { + GifLoaderDialogUtils.showMyDialog(context); + // this + // .familyFileProvider + // .silentLoggin(user) + // .then((value) => loginAfter(value, context)); + + // Utils.showProgressDialog(context); + this + .familyFileProvider + .silentLoggin(user is AuthenticatedUser ? null : user, + mainUser: user is AuthenticatedUser) + .then((value) { + _vitalSignService.heightCm = ""; + _vitalSignService.weightKg = ""; + loginAfter(value, context); + }).catchError((err) { + print(err); + AppToast.showErrorToast(message: err); + Navigator.of(context).pop(); + }); + } + + loginAfter(result, context) async { + //GifLoaderDialogUtils.hideDialog(context); + Provider.of(context, listen: false).setPrivilege(privilegeList: result,isLoginChild: true); + var currentLang = await sharedPref.getString(APP_LANGUAGE); + result = list.CheckActivationCode.fromJson(result); + var familyFile = await sharedPref.getObject(FAMILY_FILE); + var mainUser = await sharedPref.getObject(MAIN_USER); + var bloodType = await sharedPref.getString(BLOOD_TYPE); + this.sharedPref.clear(); + if (mainUser["PatientID"] != result.list.patientID) { + result.list.isFamily = true; + } + this.sharedPref.setString(APP_LANGUAGE, currentLang); + this.sharedPref.setObject(MAIN_USER, mainUser); + this.sharedPref.setString(BLOOD_TYPE, bloodType); + this.sharedPref.setObject(USER_PROFILE, result.list); + this.sharedPref.setObject(FAMILY_FILE, familyFile); + this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); + this.sharedPref.setString(TOKEN, result.authenticationTokenID); + await authenticatedUserObject.getUser(getUser: true); + Provider.of(context, listen: false).user = + authenticatedUserObject.user; + Provider.of(context, listen: false) + .setUser(authenticatedUserObject.user); + appointmentRateViewModel + .getIsLastAppointmentRatedList() + .then((value) => { + //getToDoCount(), + // Utils.hideProgressDialog(), + if (appointmentRateViewModel.isHaveAppointmentNotRate) + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: RateAppointmentDoctor(), + ), + (r) => false) + } + else + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: LandingPage(), + ), + (r) => false) + } + }) + .catchError((err) { + print(err); + // Utils.hideProgressDialog(); + // GifLoaderDialogUtils.hideDialog(context); + }); + } + + deactivateRequest(ID, status, context) { + GifLoaderDialogUtils.showMyDialog(context); + Map request = {}; + request["ID"] = ID; + request["Status"] = status; + this.familyFileProvider.deactivateFamily(request).then((value) => + {GifLoaderDialogUtils.hideDialog(context), refreshFamily(context)}); + } + + acceptRemoveRequest(ID, status, context) { + GifLoaderDialogUtils.showMyDialog(context); + Map request = {}; + request["ID"] = ID; + request["Status"] = status; + this.familyFileProvider.acceptRejectFamily(request).then((value) => + {GifLoaderDialogUtils.hideDialog(context), refreshFamily(context)}); + } + + checkUserData() async { + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + + var data2 = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(MAIN_USER)); + print(data2); + setState(() { + this.user = data; + }); + } + } +} diff --git a/lib/pages/DrawerPages/notifications/notification_details_page.dart b/lib/pages/DrawerPages/notifications/notification_details_page.dart new file mode 100644 index 00000000..3858c940 --- /dev/null +++ b/lib/pages/DrawerPages/notifications/notification_details_page.dart @@ -0,0 +1,103 @@ +import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_response_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/notifications_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; +import 'package:flutter/material.dart'; + +class NotificationsDetailsPage extends StatelessWidget { + final GetNotificationsResponseModel notification; + + NotificationsDetailsPage({this.notification}); + + getDateForm(String date) { + DateTime d = DateUtil.convertStringToDate(date); + String monthName = DateUtil.getMonth(d.month).toString(); + TimeOfDay timeOfDay = TimeOfDay(hour: d.hour, minute: d.minute); + String minute = timeOfDay.minute < 10 + ? timeOfDay.minute.toString().padLeft(2, '0') + : timeOfDay.minute.toString(); + + String hour = '${timeOfDay.hourOfPeriod}:$minute'; + if (timeOfDay.period == DayPeriod.am) { + hour = hour + "AM"; + } else { + { + hour = hour + "PM"; + } + } + return monthName + ',${d.day},${d.year}, $hour'; + } + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).notificationDetails, + body: SingleChildScrollView( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + SizedBox( + height: 25, + ), + Container( + // margin: EdgeInsets.only(left: 30), + width: double.infinity, + color: Colors.grey[400], + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + getDateForm(notification.createdOn), + fontSize: 16, + ), + ), + ), + SizedBox( + height: 15, + ), + if (notification.messageTypeData.length != 0) + FractionallySizedBox( + widthFactor: 0.9, + child: Image.network(notification.messageTypeData, + loadingBuilder: (BuildContext context, Widget child, + ImageChunkEvent loadingProgress) { + if (loadingProgress == null) return child; + return Center( + child: SizedBox( + width: 40.0, + height: 40.0, + child: AppCircularProgressIndicator(), + ), + ); + }, + fit: BoxFit + .fill) //Image.network(notification.messageTypeData), + ), + SizedBox( + height: 15, + ), + Row( + children: [ + Expanded( + child: Center( + child: Texts(notification.message), + ), + ), + ], + ), + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/DrawerPages/notifications/notifications_page.dart b/lib/pages/DrawerPages/notifications/notifications_page.dart new file mode 100644 index 00000000..53aad843 --- /dev/null +++ b/lib/pages/DrawerPages/notifications/notifications_page.dart @@ -0,0 +1,148 @@ +import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/notifications_view_model.dart'; +import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notification_details_page.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +// ignore: must_be_immutable +class NotificationsPage extends StatelessWidget { + getDateForm(String date) { + DateTime d = DateUtil.convertStringToDate(date); + String monthName = DateUtil.getMonth(d.month).toString(); + TimeOfDay timeOfDay = TimeOfDay(hour: d.hour, minute: d.minute); + String minute = timeOfDay.minute < 10 + ? timeOfDay.minute.toString().padLeft(2, '0') + : timeOfDay.minute.toString(); + + String hour = '${timeOfDay.hourOfPeriod}:$minute'; + if (timeOfDay.period == DayPeriod.am) { + hour = hour + "AM"; + } else { + { + hour = hour + "PM"; + } + } + + //DayPeriod.am + return monthName + ',${d.day},${d.year}, $hour'; + } + + int currentIndex = 0; + + @override + Widget build(BuildContext context) { + var prescriptionReport; + return BaseView( + onModelReady: (model) { + GetNotificationsRequestModel getNotificationsRequestModel = + new GetNotificationsRequestModel( + currentPage: currentIndex, + pagingSize: 14, + notificationStatusID: 2); + + model.getNotifications(getNotificationsRequestModel, context); + }, + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).notifications, + baseViewModel: model, + body: ListView( + children: model.notifications + .map( + (notification) => InkWell( + onTap: () async { + if(!notification.isRead) + model.markAsRead(notification.id); + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + NotificationsDetailsPage( + notification: notification, + ))); + }, + child: Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 5, left: 10, right: 10, bottom: 5), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: notification.isRead + ? Colors.grey[200] + : Theme.of(context).primaryColor, + width: 0.5), + ), + child: Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(getDateForm(notification.createdOn)), + SizedBox( + height: 5, + ), + Row( + children: [ + Expanded( + child: Texts(notification.message)), + if (notification.messageType == "image") + Icon(FontAwesomeIcons.images) + ], + ), + SizedBox( + height: 5, + ), + ], + ), + ), + ), + SizedBox( + width: 15, + ), + ], + ), + ), + ), + ) + .toList() + ..add( + InkWell( + onTap: () async { + GifLoaderDialogUtils.showMyDialog( + context); + currentIndex++; + GetNotificationsRequestModel + getNotificationsRequestModel = + new GetNotificationsRequestModel( + currentPage: currentIndex, + pagingSize: 14, + notificationStatusID: 2); + + await model.getNotifications(getNotificationsRequestModel,context); + GifLoaderDialogUtils.hideDialog( + context); + + }, + child: Center( + child: Image.asset('assets/images/notf.png'), + ), + ), + )), + ), + ); + } +} diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart new file mode 100644 index 00000000..1690254a --- /dev/null +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -0,0 +1,144 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/others/OrderLogItem.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'dart:ui'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; + +import 'AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart'; +import 'OrderLogPage.dart'; + +class AmbulanceReq extends StatefulWidget { + @override + _AmbulanceReqState createState() => _AmbulanceReqState(); +} + +class _AmbulanceReqState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + List imagesInfo = List(); + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/Ambulance/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/Ambulance/ar/0.png')); + + return BaseView( + onModelReady: (model) => model.getAmRequestOrders(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).transportationService, + description: TranslationBase.of(context).infoAmbulance, + imagesInfo: imagesInfo, + baseViewModel: model, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.93, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.7), + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + indicatorColor: Colors.red[800], + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.40, + child: Center( + child: Texts(TranslationBase.of(context).transportationService), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: Texts("Orders Log"), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + AmbulanceRequestIndexPage( + amRequestViewModel: model, + ), + OrderLogPage( + amRequestViewModel: model, + ) + ], + ), + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart new file mode 100644 index 00000000..5f303846 --- /dev/null +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart @@ -0,0 +1,169 @@ +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; +import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; +import 'package:diplomaticquarterapp/pages/ErService/widgets/StepsWidget.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/others/OrderLogItem.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'BillAmount.dart'; +import 'PickupLocation.dart'; +import 'SelectTransportationMethod.dart'; +import 'Summary.dart'; + +class AmbulanceRequestIndexPage extends StatefulWidget { + final AmRequestViewModel amRequestViewModel; + + AmbulanceRequestIndexPage({Key key, this.amRequestViewModel}); + + @override + _AmbulanceRequestIndexPageState createState() => + _AmbulanceRequestIndexPageState(); +} + +class _AmbulanceRequestIndexPageState extends State { + int currentIndex = 0; + PageController pageController; + PatientER _patientER = PatientER(); + + _changeCurrentTab(int tab) { + setState(() { + currentIndex = tab; + }); + pageController.animateToPage(tab, + duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart); + } + + @override + void initState() { + super.initState(); + pageController = new PageController(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: widget.amRequestViewModel.pickUpRequestPresOrder != null + ? Column( + children: [ + SizedBox( + height: 80, + ), + Container( + margin: EdgeInsets.only(left: 18, right: 18), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(2), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + OrderLogItem( + title: 'Request ID', + value: widget.amRequestViewModel.pickUpRequestPresOrder + .presOrderID + .toString(), + ), + OrderLogItem( + title: 'Status', + value: widget.amRequestViewModel.pickUpRequestPresOrder + .ambulateDescription, + ), + OrderLogItem( + title: 'Last edit time', + value: DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate(widget + .amRequestViewModel + .pickUpRequestPresOrder + .lastEditDate)), + ), + OrderLogItem( + title: 'Pickup Location', + value: widget.amRequestViewModel.pickUpRequestPresOrder + .pickupLocationName, + ), + OrderLogItem( + title: 'Drop off Location', + value: widget.amRequestViewModel.pickUpRequestPresOrder + .dropoffLocationName, + ), + OrderLogItem( + title: 'Trasfaer way', + value: widget + .amRequestViewModel.pickUpRequestPresOrder.title, + ), + Container( + padding: EdgeInsets.all(10), + width: double.maxFinite, + margin: EdgeInsets.only(bottom: 4, left: 4, right: 4), + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(12), + bottomLeft: Radius.circular(12), + ), + color: Colors.white), + child: SecondaryButton( + color: Colors.red[900], + textColor: Colors.white, + label: TranslationBase.of(context).cancel, + onTap: () { + widget.amRequestViewModel.updatePressOrder( + presOrderID: widget.amRequestViewModel + .pickUpRequestPresOrder.presOrderID); + }, + ), + ) + ], + ), + ), + ], + ) + : Column( + children: [ + SizedBox( + height: 80, + ), + Container( + margin: EdgeInsets.only(left: 12, right: 12), + child: StepsWidget( + index: currentIndex, + changeCurrentTab: _changeCurrentTab, + ), + ), + Expanded( + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: pageController, + children: [ + //Container(), + SelectTransportationMethod( + changeCurrentTab: _changeCurrentTab, + patientER: _patientER, + amRequestViewModel: widget.amRequestViewModel, + ), + PickupLocation( + changeCurrentTab: _changeCurrentTab, + patientER: _patientER, + amRequestViewModel: widget.amRequestViewModel, + ), + BillAmount( + changeCurrentTab: _changeCurrentTab, + patientER: _patientER, + amRequestViewModel: widget.amRequestViewModel, + ), + Summary( + changeCurrentTab: _changeCurrentTab, + patientER: _patientER, + amRequestViewModel: widget.amRequestViewModel, + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart new file mode 100644 index 00000000..cc6af0f2 --- /dev/null +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart @@ -0,0 +1,351 @@ +import 'package:diplomaticquarterapp/core/enum/Ambulate.dart'; +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; +import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; +import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + + +class BillAmount extends StatefulWidget { + final Function changeCurrentTab; + final PatientER patientER; + final AmRequestViewModel amRequestViewModel; + + BillAmount( + {Key key, + this.changeCurrentTab, + this.patientER, + this.amRequestViewModel}); + + @override + _BillAmountState createState() => _BillAmountState(); +} + +class _BillAmountState extends State { + Ambulate _ambulate = Ambulate.None; + String note =""; + + + @override + void initState() { + + if(widget.patientER.ambulate!=null) + { + setState(() { + _ambulate = widget.patientER.ambulate; + note = widget.patientER.requesterNote; + }); + } + super.initState(); + } + + + @override + Widget build(BuildContext context) { + return SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.only(left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Bill Amount '), + SizedBox( + height: 10, + ), + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 1.0, color: Colors.grey[300]), + outside: BorderSide(width: 1.0, color: Colors.grey[300])), + children: [ + TableRow( + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.09, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + 'Amount before tax: ', + textAlign: TextAlign.start, + color: Colors.black, + fontSize: 15, + ), + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.09, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + 'SR ${widget.patientER.patientERTransportationMethod.price}', + color: Colors.black, + textAlign: TextAlign.start, + fontSize: 15, + ), + ), + ), + ], + ), + TableRow( + children: [ + Container( + color: Colors.white, + height: MediaQuery.of(context).size.height * 0.09, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + 'Tax amount :', + color: Colors.black, + fontSize: 15, + textAlign: TextAlign.start, + ), + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.09, + color: Colors.white, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + 'SR ${widget.patientER.patientERTransportationMethod.vAT}', + color: Colors.black, + fontSize: 15, + textAlign: TextAlign.start, + ), + ), + ), + ], + ), + TableRow( + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.09, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(10.0), + ), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + 'Total amount payable', + color: Colors.black, + fontSize: 15, + textAlign: TextAlign.start, + bold: true, + ), + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.09, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(10.0), + ), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + 'SR ${widget.patientER.patientERTransportationMethod.totalPrice}', + color: Colors.black, + fontSize: 15, + textAlign: TextAlign.start, + ), + ), + ), + ], + ), + ], + ), + SizedBox( + height: 10, + ), + Texts('Select Ambulate',bold: true,), + SizedBox(height: 5,), + Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + setState(() { + _ambulate = Ambulate.Wheelchair; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text('Wheelchair'), + leading: Radio( + value: Ambulate.Wheelchair, + groupValue: _ambulate, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _ambulate = value; + }); + }, + ), + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + setState(() { + _ambulate = Ambulate.Walker; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text('Walker'), + leading: Radio( + value: Ambulate.Walker, + groupValue: _ambulate, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _ambulate = value; + }); + }, + ), + ), + ), + ), + ), + ], + ), + SizedBox(height: 5,), + Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + setState(() { + _ambulate = Ambulate.Stretcher; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text('Stretcher'), + leading: Radio( + value: Ambulate.Stretcher, + groupValue: _ambulate, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _ambulate = value; + }); + }, + ), + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + setState(() { + _ambulate = Ambulate.None; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text('None'), + leading: Radio( + value: Ambulate.None, + groupValue: _ambulate, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _ambulate = value; + }); + }, + ), + ), + ), + ), + ), + ], + ), + SizedBox(height: 12,), + NewTextFields( + hintText: 'Note', + initialValue: note, + onChanged: (value){ + setState(() { + note = value; + }); + }, + ), + + SizedBox( + height: 15, + ), + Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 76, + child: SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + setState(() { + widget.patientER.ambulate = _ambulate; + widget.patientER.requesterNote = note; + widget.patientER.selectedAmbulate = _ambulate.selectAmbulateNumber(); + widget.changeCurrentTab(3); + }); + }, + label: 'Next', + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart new file mode 100644 index 00000000..b99596c8 --- /dev/null +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart @@ -0,0 +1,504 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/pages/Blood/dialogs/SelectHospitalDialog.dart'; +import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart'; +import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; +import 'package:diplomaticquarterapp/uitl/ProgressDialog.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:geolocator/geolocator.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; + +import '../AmbulanceReq.dart'; +import '../AvailableAppointmentsPage.dart'; + +enum HaveAppointment { YES, NO } + +class PickupLocation extends StatefulWidget { + final Function changeCurrentTab; + final PatientER patientER; + final AmRequestViewModel amRequestViewModel; + + PickupLocation( + {Key key, + this.changeCurrentTab, + this.patientER, + this.amRequestViewModel}); + + @override + _PickupLocationState createState() => _PickupLocationState(); +} + +class _PickupLocationState extends State { + bool _isInsideHome = false; + HaveAppointment _haveAppointment = HaveAppointment.NO; + double _latitude; + double _longitude; + AppoitmentAllHistoryResultList myAppointment; + HospitalsModel _selectedHospital; + PickResult _result; + + @override + void initState() { + super.initState(); + _getCurrentLocation(); + } + + _getCurrentLocation() async { + await getLastKnownPosition().then((value) { + _latitude = value.latitude; + _longitude = value.longitude; + }).catchError((e) { + _longitude = 0; + _latitude = 0; + }); + } + + @override + Widget build(BuildContext context) { + return SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.only(left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (widget.patientER.direction == 1) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Pickup Location'), + SizedBox( + height: 15, + ), + InkWell( + onTap: (){ + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PickupLocationFromMap( + latitude: _latitude, + longitude: _longitude, + onPick: (value) { + setState(() { + _result = value; + }); + }, + ), + ), + ); + }, + child: Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getSelectFromMapName()), + Icon( + FontAwesomeIcons.mapMarkerAlt, + size: 24, + color: Colors.black, + ) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + Texts('Pickup Spot'), + SizedBox( + height: 5, + ), + InkWell( + onTap: () { + setState(() { + _isInsideHome = !_isInsideHome; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Texts('Inside Home'), + leading: Checkbox( + activeColor: Colors.red[800], + value: _isInsideHome, + onChanged: (value) { + setState(() { + _isInsideHome = value; + }); + }, + ), + ), + ), + ), + SizedBox( + height: 12, + ), + Texts('Do you have an appointment ?'), + SizedBox( + height: 5, + ), + Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + if (myAppointment == null) { + getAppointment(); + setState(() { + _haveAppointment = HaveAppointment.YES; + }); + } + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text('Yes'), + leading: Radio( + value: HaveAppointment.YES, + groupValue: _haveAppointment, + activeColor: Colors.red[800], + onChanged: (value) { + if (myAppointment == null) { + getAppointment(); + setState(() { + _haveAppointment = value; + }); + } + }, + ), + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + setState(() { + _haveAppointment = HaveAppointment.NO; + myAppointment = null; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text('No'), + leading: Radio( + value: HaveAppointment.NO, + groupValue: _haveAppointment, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _haveAppointment = value; + myAppointment = null; + }); + }, + ), + ), + ), + ), + ), + ], + ), + if (myAppointment != null) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + AppointmentCard( + appointment: myAppointment, + ) + ], + ), + SizedBox( + height: 12, + ), + Texts('Drop off Location'), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + confirmSelectHospitalDialog( + widget.amRequestViewModel.hospitals); + }, + child: Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getHospitalName('Pickup Location')), + Icon( + Icons.arrow_drop_down, + size: 24, + color: Colors.black, + ) + ], + ), + ), + ), + ], + ), + if (widget.patientER.direction == 0) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Pickup Location'), + SizedBox( + height: 15, + ), + InkWell( + onTap: () { + confirmSelectHospitalDialog( + widget.amRequestViewModel.hospitals); + }, + child: Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getHospitalName('Pickup Location')), + Icon( + Icons.arrow_drop_down, + size: 24, + color: Colors.black, + ) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + Texts('Drop off Location'), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PickupLocationFromMap( + latitude: _latitude, + longitude: _longitude, + onPick: (value) { + setState(() { + _result = value; + }); + }, + ), + ), + ); + }, + child: Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getSelectFromMapName()), + Icon( + FontAwesomeIcons.mapMarkerAlt, + size: 24, + color: Colors.black, + ) + ], + ), + ), + ), + ], + ), + + SizedBox( + height: 45, + ), + Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 76, + child: SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + if (_result == null || _selectedHospital == null) + AppToast.showErrorToast( + message: 'please select all fields'); + else + setState(() { + widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; + if (widget.patientER.direction == 0) { + widget.patientER.pickupLocationLattitude = _result.geometry.location.lat.toString(); + widget.patientER.pickupLocationLongitude = _result.geometry.location.lng.toString(); + widget.patientER.dropoffLocationLattitude = _selectedHospital.latitude; + widget.patientER.dropoffLocationLongitude = _selectedHospital.longitude; + } else { + widget.patientER.pickupLocationLattitude = _selectedHospital.latitude; + widget.patientER.pickupLocationLongitude = _selectedHospital.longitude; + widget.patientER.dropoffLocationLattitude = _result.geometry.location.lat.toString(); + widget.patientER.dropoffLocationLongitude = _result.geometry.location.lng.toString(); + } + + widget.patientER.latitude = widget.patientER.pickupLocationLattitude; + widget.patientER.longitude = widget.patientER.pickupLocationLongitude; + widget.patientER.dropoffLocationName = _selectedHospital.name; + widget.patientER.createdBy = widget.amRequestViewModel.user.patientID; + widget.patientER.isOutPatient = widget.amRequestViewModel.user.outSA; + widget.patientER.patientIdentificationID = widget.amRequestViewModel.user.patientIdentificationNo; + widget.patientER.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now()); + widget.patientER.pickupLocationName = _result.formattedAddress; + widget.patientER.projectID = widget.amRequestViewModel.user.projectID; + widget.patientER.requesterFileNo = widget.amRequestViewModel.user.patientID; + widget.patientER.requesterIsOutSA = false; + widget.patientER.lineItemNo =0; + widget.patientER.requesterMobileNo = widget.amRequestViewModel.user.mobileNumber; + + if (_haveAppointment == HaveAppointment.YES) { + widget.patientER.appointmentNo = myAppointment.appointmentNo.toString(); + widget.patientER.appointmentClinicName = myAppointment.clinicName; + widget.patientER.appointmentDoctorName = myAppointment.doctorNameObj; + widget.patientER.appointmentBranch = myAppointment.projectName; + widget.patientER.appointmentTime = myAppointment.appointmentDate; + widget.patientER.haveAppointment = true; + } else { + widget.patientER.appointmentNo = "0"; + widget.patientER.appointmentClinicName = null; + widget.patientER.appointmentDoctorName = null; + widget.patientER.appointmentBranch = null; + widget.patientER.appointmentTime = null; + widget.patientER.haveAppointment = false; + } + + widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; + widget.changeCurrentTab(2); + }); + }, + label: 'Next', + ), + ) + ], + ), + ), + ); + } + + void confirmSelectHospitalDialog(List hospitals) { + showDialog( + context: context, + child: SelectHospitalDialog( + hospitals: hospitals, + selectedHospital: _selectedHospital, + onValueSelected: (value) { + setState(() { + _selectedHospital = value; + }); + }, + ), + ); + } + + String getHospitalName(String title) { + return _selectedHospital == null ? title : _selectedHospital.name; + } + + String getSelectFromMapName() { + return _result != null ? _result.formattedAddress : 'Select From Map'; + } + + getAppointment() { + ProgressDialogUtil.showProgressDialog(context); + widget.amRequestViewModel.getAppointmentHistory().then((value) { + if (widget.amRequestViewModel.state == ViewState.Error || + widget.amRequestViewModel.state == ViewState.ErrorLocal) { + AppToast.showErrorToast(message: widget.amRequestViewModel.error); + } else if (widget + .amRequestViewModel.appoitmentAllHistoryResultList.length > + 0) { + ProgressDialogUtil.hideProgressDialog(context); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AvailableAppointmentsPage( + appointmentsAllHistoryList: + widget.amRequestViewModel.appoitmentAllHistoryResultList, + ), + ), + ).then((value) { + if (value != null) + setState(() { + myAppointment = value; + }); + else { + ProgressDialogUtil.hideProgressDialog(context); + setState(() { + _haveAppointment = HaveAppointment.NO; + }); + } + }); + } else { + ProgressDialogUtil.hideProgressDialog(context); + setState(() { + _haveAppointment = HaveAppointment.NO; + }); + AppToast.showErrorToast(message: 'You don\'t have any appointment'); + } + }).catchError((e) { + ProgressDialogUtil.hideProgressDialog(context); + AppToast.showErrorToast(message: e); + }); + } +} diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart new file mode 100644 index 00000000..01683b55 --- /dev/null +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart @@ -0,0 +1,309 @@ +import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; +import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; +import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; +import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; +import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +enum Direction { ToHospital, FromHospital } +enum Way { OneWay, TwoWays } + +class SelectTransportationMethod extends StatefulWidget { + final Function changeCurrentTab; + final PatientER patientER; + final AmRequestViewModel amRequestViewModel; + + SelectTransportationMethod( + {Key key, + this.changeCurrentTab, + this.patientER, + this.amRequestViewModel}); + + @override + _SelectTransportationMethodState createState() => + _SelectTransportationMethodState(); +} + +class _SelectTransportationMethodState + extends State { + PatientERTransportationMethod _erTransportationMethod = + PatientERTransportationMethod(); + Direction _direction = Direction.FromHospital; + Way _way = Way.OneWay; + + OrderService _orderService = OrderService.AMBULANCE; + + @override + void initState() { + super.initState(); + if (widget.patientER.direction != null) { + _direction = widget.patientER.direction == 0 + ? Direction.ToHospital + : Direction.FromHospital; + _way = widget.patientER.tripType == 1 ? Way.OneWay : Way.TwoWays; + _erTransportationMethod = widget.amRequestViewModel + .amRequestModeList[(widget.patientER.selectedAmbulate - 1)]; + } else { + if (widget.amRequestViewModel.amRequestModeList.length != 0) + _erTransportationMethod = widget.amRequestViewModel.amRequestModeList[ + widget.amRequestViewModel.amRequestModeList.length - 1]; + } + } + + @override + Widget build(BuildContext context) { + return SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.only(left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Texts('Select Transportation Method'), + ...List.generate( + widget.amRequestViewModel.amRequestModeList.length, + (index) => InkWell( + onTap: () { + setState(() { + _erTransportationMethod = + widget.amRequestViewModel.amRequestModeList[index]; + }); + }, + child: Container( + margin: EdgeInsets.all(5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + children: [ + Expanded( + flex: 3, + child: ListTile( + title: Text(widget.amRequestViewModel + .amRequestModeList[index].title), + leading: Radio( + value: widget + .amRequestViewModel.amRequestModeList[index], + groupValue: _erTransportationMethod, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _erTransportationMethod = value; + }); + }, + ), + ), + ), + Expanded( + flex: 1, + child: Texts( + 'SR ${widget.amRequestViewModel.amRequestModeList[index].price}'), + ) + ], + ), + ), + ), + ), + SizedBox( + height: 12, + ), + Texts('Select Direction'), + SizedBox( + height: 5, + ), + Container( + width: double.maxFinite, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: InkWell( + onTap: () { + setState(() { + _direction = Direction.ToHospital; + }); + }, + child: Container( + width: double.maxFinite, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text('To Hospital'), + leading: Radio( + value: Direction.ToHospital, + groupValue: _direction, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _direction = value; + }); + }, + ), + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + setState(() { + _direction = Direction.FromHospital; + }); + }, + child: Container( + width: double.maxFinite, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text('Form Hospital'), + leading: Radio( + value: Direction.FromHospital, + groupValue: _direction, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _direction = value; + }); + }, + ), + ), + ), + ), + ), + ], + ), + ), + if (_direction == Direction.ToHospital) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 8, + ), + Texts('Select Direction'), + SizedBox( + height: 5, + ), + Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + setState(() { + _way = Way.OneWay; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text('One Way'), + leading: Radio( + value: Way.OneWay, + groupValue: _way, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _way = value; + }); + }, + ), + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + setState(() { + _way = Way.TwoWays; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text('Two Ways'), + leading: Radio( + value: Way.TwoWays, + groupValue: _way, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _way = value; + }); + }, + ), + ), + ), + ), + ), + ], + ), + ], + ), + SizedBox( + height: 15, + ), + Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 76, + child: SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + setState(() { + widget.patientER.transportationMethodId =(widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); + widget.patientER.direction = _direction == Direction.ToHospital ? 1 : 0; + widget.patientER.tripType = _way == Way.TwoWays ? 0 : 1; + widget.patientER.selectedAmbulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); + widget.patientER.patientERTransportationMethod = _erTransportationMethod; + widget.patientER.orderServiceID = _orderService.getIdOrderService(); + widget.patientER.pickupUrgency = 1; + widget.patientER.lineItemNo = 1; + widget.patientER.cost = _erTransportationMethod.price; + widget.patientER.vAT = _erTransportationMethod.vAT ?? 0; + widget.patientER.totalPrice = _erTransportationMethod.totalPrice; + widget.changeCurrentTab(1); + }); + }, + label: 'Next', + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart new file mode 100644 index 00000000..7696dd09 --- /dev/null +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart @@ -0,0 +1,107 @@ +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; +import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/core/enum/Ambulate.dart'; + +class Summary extends StatefulWidget { + final Function changeCurrentTab; + final PatientER patientER; + final AmRequestViewModel amRequestViewModel; + + Summary({Key key, this.changeCurrentTab, this.patientER, this.amRequestViewModel}); + + @override + _SummaryState createState() => _SummaryState(); +} + +//TODO it should be dynamic +class _SummaryState extends State { + @override + Widget build(BuildContext context) { + return SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Summary'), + SizedBox(height: 5,), + Container( + width: double.infinity, + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Transportation Method',color: Colors.grey,), + Texts('${widget.patientER.patientERTransportationMethod.title}',bold: true,), + SizedBox(height: 8,), + + Texts('Direction',color: Colors.grey,), + Texts('From Hospital',bold: true,), + SizedBox(height: 8,), + + Texts('Pickup Location',color: Colors.grey,), + Texts('SZR Medical Center',bold: true,), + SizedBox(height: 8,), + + Texts('Drop off location',color: Colors.grey,), + Texts('6199, Al Ameen wlfn nif',bold: true,), + SizedBox(height: 8,), + + Texts('Select Ambulate',color: Colors.grey,), + Texts('${widget.patientER.ambulate.getAmbulateTitle(context)}',bold: true,), + SizedBox(height: 8,), + + Texts('Note',color: Colors.grey,), + Texts('${widget.patientER.requesterNote?? '---'}',bold: true,), + SizedBox(height: 8,), + ], + ), + ), + SizedBox(height: 20,), + Texts('Bill Amount',textAlign: TextAlign.start,), + SizedBox(height: 5,), + Container( + height: 55, + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8) + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('Total amount payable:'), + Texts('SR ${widget.patientER.patientERTransportationMethod.totalPrice}') + ], + ), + ), + + SizedBox(height: 45,), + Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 76, + child:SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + label: 'Send', + onTap: () async { + await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER); + + } + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/ErService/AvailableAppointmentsPage.dart b/lib/pages/ErService/AvailableAppointmentsPage.dart new file mode 100644 index 00000000..7180d5dd --- /dev/null +++ b/lib/pages/ErService/AvailableAppointmentsPage.dart @@ -0,0 +1,45 @@ +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class AvailableAppointmentsPage extends StatelessWidget { + final List appointmentsAllHistoryList; + + const AvailableAppointmentsPage({Key key, this.appointmentsAllHistoryList}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Available Appointments', + body: SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Texts('Available Appointments'), + SizedBox( + height: 12, + ), + ...List.generate( + appointmentsAllHistoryList.length, + (index) => InkWell( + onTap: (){ + Navigator.pop(context, appointmentsAllHistoryList[index]); + }, + child: AppointmentCard(appointment: appointmentsAllHistoryList[index],), + ), + ) + ], + ), + ), + ), + ); + } +} + + diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart new file mode 100644 index 00000000..886d47d2 --- /dev/null +++ b/lib/pages/ErService/ErOptions.dart @@ -0,0 +1,73 @@ +import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; + +import 'package:flutter/material.dart'; +import '../../uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart'; + +class ErOptions extends StatefulWidget { + final bool isAppbar; + + const ErOptions({Key key, this.isAppbar}) : super(key: key); + + + @override + _ErOptionsState createState() => _ErOptionsState(); +} + +class _ErOptionsState extends State { + LocationUtils locationUtils; + + @override + void initState() { + locationUtils = + new LocationUtils(isShowConfirmDialog: true, context: context); + WidgetsBinding.instance + .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); + + super.initState(); + } + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: widget.isAppbar, + appBarTitle: TranslationBase.of(context).bookAppo, + body: Container( + margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + Container( + margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: CardCommonEr( + image: 'assets/images/new-design/AM.PNG', + text: TranslationBase.of(context).ambulancerequest, + subText: TranslationBase.of(context).requestA, + type: 0, + + ), + ), + Expanded( + child: CardCommonEr( + image: 'assets/images/new-design/emergency_icon.png', + text: TranslationBase.of(context).nearester, + subText: TranslationBase.of(context).locationa, + type: 1), + + ) + ], + ), + ), + ], + ), + ), + ); + } +} + diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart new file mode 100644 index 00000000..227cfb3b --- /dev/null +++ b/lib/pages/ErService/NearestEr.dart @@ -0,0 +1,350 @@ +import 'package:diplomaticquarterapp/core/viewModels/er/near_hospital_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import '../../uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart'; +import 'widgets/card_position.dart'; + +class NearestEr extends StatelessWidget { + static const String _url = "assets/images/"; + + int appointmentNo; + int projectID; + + NearestEr({this.appointmentNo, this.projectID}); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: appointmentNo != null && projectID != null + ? (model) => model.getProjectAvgERWaitingTimeOrders( + id: appointmentNo, projectID: projectID) + : (model) => model.getProjectAvgERWaitingTimeOrders(), + builder: (_, mode, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Nearest ER', + baseViewModel: mode, + body: mode.ProjectAvgERWaitingTimeModeList.length > 0 + ? Container( + child: ListView( + children: [ + Text( + "\nThis service Displays nearest branch\n among all the branches of All Habib \n medical Group based on your current Location", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 18.0, + letterSpacing: 1.0, + fontWeight: FontWeight.w900, + color: new Color(0xFF60686b))), + Container( + margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Container( + child: CardPosition( + text: mode + .ProjectAvgERWaitingTimeModeList[0] + .projectName + .toString(), + image: + 'assets/images/new-design/find_us_icon.png', + subText: mode + .ProjectAvgERWaitingTimeModeList[0] + .distanceInKilometers + .toString(), + type: mode + .ProjectAvgERWaitingTimeModeList[0].iD + .toString(), + telephone: mode + .ProjectAvgERWaitingTimeModeList[0] + .phoneNumber + .toString(), + networkImage: mode + .ProjectAvgERWaitingTimeModeList[0] + .projectImageURL + .toString(), + latitude: mode + .ProjectAvgERWaitingTimeModeList[0] + .latitude, + longitude: mode + .ProjectAvgERWaitingTimeModeList[0] + .longitude, + projectname: mode + .ProjectAvgERWaitingTimeModeList[0] + .projectName, + ), + ), + + ), + Expanded( + child: Container( + child: CardPosition( + text: mode + .ProjectAvgERWaitingTimeModeList[1] + .projectName + .toString(), + image: + 'assets/images/new-design/find_us_icon.png', + subText: mode + .ProjectAvgERWaitingTimeModeList[1] + .distanceInKilometers + .toString(), + type: mode + .ProjectAvgERWaitingTimeModeList[1].iD + .toString(), + telephone: mode + .ProjectAvgERWaitingTimeModeList[1] + .phoneNumber + .toString(), + networkImage: mode + .ProjectAvgERWaitingTimeModeList[1] + .projectImageURL + .toString(), + latitude: mode + .ProjectAvgERWaitingTimeModeList[1] + .latitude, + longitude: mode + .ProjectAvgERWaitingTimeModeList[1] + .longitude, + projectname: mode + .ProjectAvgERWaitingTimeModeList[1] + .projectName, + ), + ), + + ) + ], + ), + Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Container( + child: CardPosition( + + text: mode + .ProjectAvgERWaitingTimeModeList[2] + .projectName + .toString(), + image: + 'assets/images/new-design/find_us_icon.png', + + subText: mode + .ProjectAvgERWaitingTimeModeList[2] + .distanceInKilometers + .toString(), + type: mode + .ProjectAvgERWaitingTimeModeList[2].iD + .toString(), + telephone: mode + .ProjectAvgERWaitingTimeModeList[2] + .phoneNumber + .toString(), + networkImage: mode + .ProjectAvgERWaitingTimeModeList[2] + .projectImageURL + .toString(), + latitude: mode + .ProjectAvgERWaitingTimeModeList[2] + .latitude, + longitude: mode + .ProjectAvgERWaitingTimeModeList[2] + .longitude, + projectname: mode + .ProjectAvgERWaitingTimeModeList[2] + .projectName, + ), + ), + + ), + Expanded( + child: Container( + child: CardPosition( + + text: mode + .ProjectAvgERWaitingTimeModeList[3] + .projectName + .toString(), + image: + 'assets/images/new-design/find_us_icon.png', + + subText: mode + .ProjectAvgERWaitingTimeModeList[3] + .distanceInKilometers + .toString(), + type: mode + .ProjectAvgERWaitingTimeModeList[3].iD + .toString(), + telephone: mode + .ProjectAvgERWaitingTimeModeList[3] + .phoneNumber + .toString(), + networkImage: mode + .ProjectAvgERWaitingTimeModeList[3] + .projectImageURL + .toString(), + latitude: mode + .ProjectAvgERWaitingTimeModeList[3] + .latitude, + longitude: mode + .ProjectAvgERWaitingTimeModeList[3] + .longitude, + projectname: mode + .ProjectAvgERWaitingTimeModeList[3] + .projectName, + ), + ), + flex: 0, + ) + ], + ), + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Container( + child: CardPosition( + + text: mode + .ProjectAvgERWaitingTimeModeList[4] + .projectName + .toString(), + image: + 'assets/images/new-design/find_us_icon.png', + + subText: mode + .ProjectAvgERWaitingTimeModeList[4] + .distanceInKilometers + .toString(), + type: mode + .ProjectAvgERWaitingTimeModeList[4].iD + .toString(), + telephone: mode + .ProjectAvgERWaitingTimeModeList[4] + .phoneNumber + .toString(), + networkImage: mode + .ProjectAvgERWaitingTimeModeList[4] + .projectImageURL + .toString(), + latitude: mode + .ProjectAvgERWaitingTimeModeList[4] + .latitude, + longitude: mode + .ProjectAvgERWaitingTimeModeList[4] + .longitude, + projectname: mode + .ProjectAvgERWaitingTimeModeList[4] + .projectName, + ), + ), + + ), + Expanded( + child: Container( + child: CardPosition( + text: mode + .ProjectAvgERWaitingTimeModeList[5] + .projectName + .toString(), + image: + 'assets/images/new-design/find_us_icon.png', + subText: mode + .ProjectAvgERWaitingTimeModeList[5] + .distanceInKilometers + .toString(), + type: mode + .ProjectAvgERWaitingTimeModeList[5].iD + .toString(), + telephone: mode + .ProjectAvgERWaitingTimeModeList[5] + .phoneNumber + .toString(), + networkImage: mode + .ProjectAvgERWaitingTimeModeList[5] + .projectImageURL + .toString(), + latitude: mode + .ProjectAvgERWaitingTimeModeList[5] + .latitude, + longitude: mode + .ProjectAvgERWaitingTimeModeList[5] + .longitude, + projectname: mode + .ProjectAvgERWaitingTimeModeList[5] + .projectName, + ), + ), + + ) + ], + ), + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Container( + child: CardPosition( + text: mode + .ProjectAvgERWaitingTimeModeList[6] + .projectName + .toString(), + image: + 'assets/images/new-design/find_us_icon.png', + subText: mode + .ProjectAvgERWaitingTimeModeList[6] + .distanceInKilometers + .toString(), + type: mode + .ProjectAvgERWaitingTimeModeList[6].iD + .toString(), + telephone: mode + .ProjectAvgERWaitingTimeModeList[6] + .phoneNumber + .toString(), + networkImage: mode + .ProjectAvgERWaitingTimeModeList[6] + .projectImageURL + .toString(), + latitude: mode + .ProjectAvgERWaitingTimeModeList[6] + .latitude, + longitude: mode + .ProjectAvgERWaitingTimeModeList[6] + .longitude, + projectname: mode + .ProjectAvgERWaitingTimeModeList[6] + .projectName, + ), + ), + flex: 0, + ), + ], + ), + ], + )), + ], + ), + ) + : Center( + child: Texts('No Data'), + ), + ), + ); + } +} + diff --git a/lib/pages/ErService/OrderLogPage.dart b/lib/pages/ErService/OrderLogPage.dart new file mode 100644 index 00000000..6929cd0b --- /dev/null +++ b/lib/pages/ErService/OrderLogPage.dart @@ -0,0 +1,86 @@ +import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart'; +import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/OrderLogItem.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class OrderLogPage extends StatelessWidget { + final AmRequestViewModel amRequestViewModel; + + OrderLogPage({Key key, @required this.amRequestViewModel}); + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.all(10), + padding: EdgeInsets.all(8), + child: ListView.builder( + itemCount: amRequestViewModel.patientAllPresOrdersList.length, + itemBuilder: (context, index) => Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(2), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + OrderLogItem( + title: 'Request ID', + value: amRequestViewModel.patientAllPresOrdersList[index].iD + .toString(), + ), + OrderLogItem( + title: 'Status', + value: amRequestViewModel + .patientAllPresOrdersList[index].description, + ), + OrderLogItem( + title: 'Pickup Date', + value: DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate(amRequestViewModel + .patientAllPresOrdersList[index].createdOn)), + ), + OrderLogItem( + title: 'Pickup Location', + value: amRequestViewModel + .patientAllPresOrdersList[index].pickupLocationName, + ), + OrderLogItem( + title: 'Drop off Location', + value: amRequestViewModel + .patientAllPresOrdersList[index].dropoffLocationName, + ), + if(amRequestViewModel.patientAllPresOrdersList[index].status==1) + Container( + padding: EdgeInsets.all(10), + width: double.maxFinite, + margin: EdgeInsets.only(bottom: 4,left: 4,right: 4), + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(12), + bottomLeft: Radius.circular(12), + ), + color: Colors.white + ), + child: SecondaryButton( + color: Colors.red[900], + textColor: Colors.white, + label: TranslationBase.of(context).cancel, + onTap: () { + amRequestViewModel.updatePressOrder(presOrderID:amRequestViewModel.pickUpRequestPresOrder.presOrderID ); + + }, + ), + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/ErService/widgets/AppointmentCard.dart b/lib/pages/ErService/widgets/AppointmentCard.dart new file mode 100644 index 00000000..0437c32f --- /dev/null +++ b/lib/pages/ErService/widgets/AppointmentCard.dart @@ -0,0 +1,47 @@ +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class AppointmentCard extends StatelessWidget { + final AppoitmentAllHistoryResultList appointment; + + const AppointmentCard({Key key, this.appointment}) : super(key: key); + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + margin: EdgeInsets.all(8), + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + child: Row( + children: [ + LargeAvatar( + url: appointment.doctorImageURL, + name: appointment.doctorNameObj, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(appointment.doctorNameObj,bold: true,), + SizedBox(height: 4,), + Texts(appointment.projectName), + Texts(appointment.clinicName), + Texts(DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appointment.bookDate))), + ], + ), + ), + ) + ], + ), + ); + } +} diff --git a/lib/pages/ErService/widgets/StepsWidget.dart b/lib/pages/ErService/widgets/StepsWidget.dart new file mode 100644 index 00000000..c5864710 --- /dev/null +++ b/lib/pages/ErService/widgets/StepsWidget.dart @@ -0,0 +1,226 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class StepsWidget extends StatelessWidget { + final int index; + final Function changeCurrentTab; + + StepsWidget({Key key, this.index, this.changeCurrentTab}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return projectViewModel.isArabic? Stack( + children: [ + Container( + height: 50, + width: MediaQuery.of(context).size.width, + color: Colors.transparent, + child: Center( + child: Divider( + color: Colors.grey, + height: 0.75, + thickness: 0.75, + ), + ), + ), + Positioned( + top: 10, + left: 0, + child: InkWell( + onTap: () => changeCurrentTab(0), + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75), + shape: BoxShape.circle, + color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white, + ), + child: Center( + child: Texts( + '1', + color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800], + ), + ), + ), + ), + ), + Positioned( + top: 10, + left: MediaQuery.of(context).size.width * 0.3, + child: InkWell( + onTap: () => index >= 2 ? changeCurrentTab(1) : null, + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75), + shape: BoxShape.circle, + color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white, + ), + child: Center( + child: Texts( + '2', + color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800], + ), + ), + ), + ), + ), + Positioned( + top: 10, + left: MediaQuery.of(context).size.width * 0.6, + child: InkWell( + onTap: () => index >= 3 ? changeCurrentTab(2) : null, + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: index > 2 ? null:Border.all(color: Colors.black,width: 0.75), + color: index == 2 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white, + ), + child: Center( + child: Texts( + '3', + color: index == 2? Colors.white : index > 1 ?Colors.white: Colors.grey[800], + ), + ), + ), + ), + ), + Positioned( + top: 10, + right: 0, + child: InkWell( + onTap: () => index == 2 ?changeCurrentTab(3):null, + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + border: Border.all(color: Colors.black,width: 0.75), + + shape: BoxShape.circle, + color: index == 3 ? Colors.grey[800] : Colors.white, + ), + child: Center( + child: Texts( + '4', + color: index == 3 ? Colors.white : Colors.grey[800], + ), + ), + ), + ), + ), + ], + ):Stack( + children: [ + Container( + height: 50, + width: MediaQuery.of(context).size.width, + color: Colors.transparent, + child: Center( + child: Divider( + color: Colors.grey, + height: 0.75, + thickness: 0.75, + ), + ), + ), + Positioned( + top: 10, + right: 0, + child: InkWell( + onTap: () => changeCurrentTab(0), + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75), + shape: BoxShape.circle, + color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white, + ), + child: Center( + child: Texts( + '1', + color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800], + ), + ), + ), + ), + ), + Positioned( + top: 10, + right: MediaQuery.of(context).size.width * 0.3, + child: InkWell( + onTap: () => index >= 2 ? changeCurrentTab(1) : null, + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75), + shape: BoxShape.circle, + color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white, + ), + child: Center( + child: Texts( + '2', + color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800], + ), + ), + ), + ), + ), + Positioned( + top: 10, + right: MediaQuery.of(context).size.width * 0.6, + child: InkWell( + onTap: () => index >= 3 ? changeCurrentTab(2) : null, + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: index > 2 ? null:Border.all(color: Colors.black,width: 0.75), + color: index == 2 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white, + ), + child: Center( + child: Texts( + '3', + color: index == 2? Colors.white : index > 1 ?Colors.white: Colors.grey[800], + ), + ), + ), + ), + ), + Positioned( + top: 10, + left: 0, + child: InkWell( + onTap: () => index == 2 ?changeCurrentTab(3):null, + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + border: Border.all(color: Colors.black,width: 0.75), + + shape: BoxShape.circle, + color: index == 3 ? Colors.grey[800] : Colors.white, + ), + child: Center( + child: Texts( + '4', + color: index == 3 ? Colors.white : Colors.grey[800], + ), + ), + ), + ), + ), + ], + ); + } +} diff --git a/lib/pages/ErService/widgets/card_common.dart b/lib/pages/ErService/widgets/card_common.dart new file mode 100644 index 00000000..35ece966 --- /dev/null +++ b/lib/pages/ErService/widgets/card_common.dart @@ -0,0 +1,83 @@ +//import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; + +import '../AmbulanceReq.dart'; +import '../NearestEr.dart'; + +class CardCommonEr extends StatelessWidget { + final image; + final text; + final subText; + final type; + const CardCommonEr( + {@required this.image, + @required this.text, + @required this.subText, + @required this.type}); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () { + navigateToSearch(context, this.type); + + }, + child: Container( + margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0), + decoration: BoxDecoration(boxShadow: [ + BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0) + ], borderRadius: BorderRadius.circular(10), color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), + child: Text(this.text, + overflow: TextOverflow.clip, + style: TextStyle( + color: new Color(0xFFc5272d), + letterSpacing: 1.0, + fontSize: 20.0)), + ), + Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), + child: Text(this.subText, + overflow: TextOverflow.clip, + style: TextStyle( + color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)), + ), + Container( + alignment: Alignment.bottomRight, + margin: EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 8.0), + child: Image.asset(this.image, width: 60.0, height: 60.0), + ), + ], + ), + ), + ); + } + + Future navigateToSearch(context, type) async { +//===Switch case=== + if(type==0) + { + + Navigator.push( + context, + FadePage( + page: AmbulanceReq())); + } + else{ + + Navigator.push( + context, + FadePage( + page: NearestEr())); + + } + + + } +} diff --git a/lib/pages/ErService/widgets/card_position.dart b/lib/pages/ErService/widgets/card_position.dart new file mode 100644 index 00000000..8647ad62 --- /dev/null +++ b/lib/pages/ErService/widgets/card_position.dart @@ -0,0 +1,108 @@ +//import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; +import 'package:flutter/material.dart'; +import 'package:giffy_dialog/giffy_dialog.dart'; +import 'package:url_launcher/url_launcher.dart'; +import 'package:maps_launcher/maps_launcher.dart'; + + +import '../NearestEr.dart'; + +class CardPosition extends StatelessWidget { + final image; + final text; + final subText; + final type; + final telephone; + final networkImage; + final latitude; + final longitude; + final projectname; + const CardPosition( + { + @required this.image, + @required this.text, + @required this.subText, + @required this.type, + @required this.telephone, + @required this.networkImage , + @required this.latitude, + @required this.longitude, + @required this.projectname , + }); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () { + navigateToSearch(context, this.type,this.telephone,this.networkImage,this.latitude,this.longitude,this.projectname); + + }, + child: Container( + width:MediaQuery.of(context).size.width * 0.47,//165, + margin: EdgeInsets.fromLTRB(7.0, 7.0, 7.0, 7.0), + decoration: BoxDecoration(boxShadow: [ + BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0) + ], borderRadius: BorderRadius.circular(10), color: Colors.white), + child: Column( + + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), + child: Text(this.text, + overflow: TextOverflow.clip, + style: TextStyle( + color: Colors.black, + letterSpacing: 1.0, + fontSize: 2 * SizeConfig.textMultiplier)), + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 8.0), + child: Image.asset(this.image, width: 60.0, height: 60.0), + ), + Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), + child: Text(this.subText, + overflow: TextOverflow.clip, + style: TextStyle( + color: Color(0xFFc5272d), letterSpacing: 1.0, fontSize: 15.0)), + ), + + ], + ), + ), + ); + } + + Future navigateToSearch(context, type,telephone,networkImage,latitude,longitude,projectname) async { + + + + + showDialog( + context: context,builder: (_) => AssetGiffyDialog( + title: Text(projectname, + style: TextStyle( + fontSize: 22.0, fontWeight: FontWeight.w600), + ),image:Image.network(networkImage, fit: BoxFit.cover,), + + buttonOkText:Text("LOCATION"), + buttonOkColor: Colors.grey, + buttonCancelText:Text('CAll') , + buttonCancelColor: Colors.grey, + onOkButtonPressed: () { MapsLauncher.launchCoordinates(double.parse(latitude),double.parse(longitude),projectname);}, + onCancelButtonPressed :() {launch("tel://" +telephone);} + + + + + ) ); + + } + + } + + diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart new file mode 100644 index 00000000..17b6d57b --- /dev/null +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -0,0 +1,548 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:rating_bar/rating_bar.dart'; + +import 'widgets/AppointmentActions.dart'; + +class AppointmentDetails extends StatefulWidget { + AppoitmentAllHistoryResultList appo; + static bool isLoading = false; + + static bool showFooterButton = false; + + AppointmentDetails({@required this.appo}); + + @override + _AppointmentDetailsState createState() => _AppointmentDetailsState(); +} + +class _AppointmentDetailsState extends State + with SingleTickerProviderStateMixin { + static TabController _tabController; + + List doctorDetailsList = List(); + + @override + void initState() { + _tabController = new TabController(length: 2, vsync: this); + AppointmentDetails.showFooterButton = false; + super.initState(); + } + + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + AppointmentDetails.showFooterButton = false; + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( + appBarTitle: widget.appo.doctorNameObj, + isShowAppBar: true, + bottomSheet: AppointmentDetails.showFooterButton + ? Container( + width: MediaQuery.of(context).size.width, + height: 50.0, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: goToBookConfirm, + child: Text(TranslationBase.of(context).bookNow, + style: TextStyle(fontSize: 18.0)), + ), + ), + ) + : null, + body: Container( + color: new Color(0xFFf6f6f6), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 20.0), + alignment: Alignment.center, + child: ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: Image.network(widget.appo.doctorImageURL, + fit: BoxFit.fill, height: 120.0, width: 120.0), + ), + ), + Container( + margin: + EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), + alignment: Alignment.center, + child: Text( + widget.appo.doctorTitle + + " " + + widget.appo.doctorNameObj, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 20.0, + color: Colors.grey[900], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.center, + child: Text(getDoctorSpeciality(widget.appo.doctorSpeciality), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[900], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: RatingBar.readOnly( + initialRating: widget.appo.actualDoctorRate.toDouble(), + size: 35.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + InkWell( + onTap: () { + getDoctorRatingsDetails(); + }, + child: Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: Text( + "(" + + widget.appo.noOfPatientsRate.toString() + + " " + + TranslationBase.of(context).reviews + + ")", + style: TextStyle( + fontSize: 14.0, + color: Colors.blue[800], + letterSpacing: 1.0, + decoration: TextDecoration.underline, + )), + ), + ), + Container( + alignment: Alignment.center, + child: Text(DateUtil.getWeekDayMonthDayYearDateFormatted( + DateUtil.convertStringToDate( + widget.appo.appointmentDate), + projectViewModel.isArabic ? "ar" : "en")), + ), + Container( + alignment: Alignment.center, + child: Text(widget.appo.startTime.substring(0, 5)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Divider( + color: Colors.grey[500], + ), + ), + TabBar( + onTap: (index) { + setState(() { + index == 1 + ? AppointmentDetails.showFooterButton = true + : AppointmentDetails.showFooterButton = false; + print(AppointmentDetails.showFooterButton); + }); + }, + tabs: [ + Tab( + child: Text(TranslationBase.of(context).appoActions, + style: TextStyle(color: Colors.black))), + Tab( + child: Text(TranslationBase.of(context).availableAppo, + style: TextStyle(color: Colors.black)), + ) + ], + controller: _tabController, + ), + ], + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.87, + child: TabBarView( + physics: NeverScrollableScrollPhysics(), + children: [ + AppointmentActions( + appo: widget.appo, + tabController: _tabController, + enableFooterButton: enableFooterButton), + DocAvailableAppointments( + doctor: getDoctorObject(), + isLiveCareAppointment: + widget.appo.isLiveCareAppointment) + ], + controller: _tabController, + ), + ), + ], + ), + ), + ), + ); + } + + void enableFooterButton() { + setState(() { + AppointmentDetails.showFooterButton = true; + }); + } + + void goToBookConfirm() { + if (DocAvailableAppointments.areSlotsAvailable) + navigateToBookConfirm(context); + else + AppToast.showErrorToast(message: "Please select Time Slot to continue"); + } + + Future navigateToBookConfirm(context) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => BookConfirm( + doctor: getDoctorObject(), + selectedDate: DocAvailableAppointments.selectedDate, + selectedTime: DocAvailableAppointments.selectedTime))); + } + + getDoctorRatingsDetails() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service.getDoctorsRatingDetails(widget.appo.doctorID, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + doctorDetailsList.clear(); + res['DoctorRatingDetailsList'].forEach((v) { + doctorDetailsList.add(new DoctorRateDetails.fromJson(v)); + }); + showRatingDialog(doctorDetailsList); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + void showRatingDialog(List doctorDetailsList) { + showGeneralDialog( + barrierColor: Colors.black.withOpacity(0.5), + transitionBuilder: (context, a1, a2, widget) { + final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0; + return Transform( + transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), + child: Opacity( + opacity: a1.value, + child: Dialog( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + // height: 400.0, + width: MediaQuery.of(context).size.width * 0.8, + color: Colors.white, + child: Column( + children: [ + Container( + alignment: Alignment.center, + width: MediaQuery.of(context).size.width, + color: Theme.of(context).primaryColor, + margin: EdgeInsets.only(bottom: 5.0), + padding: EdgeInsets.all(10.0), + child: Text( + TranslationBase.of(context).doctorRating, + style: TextStyle( + fontSize: 22.0, color: Colors.white))), + Container( + margin: EdgeInsets.only(top: 0.0), + child: Text( + this + .widget + .appo + .actualDoctorRate + .ceilToDouble() + .toString(), + style: TextStyle( + fontSize: 32.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: RatingBar.readOnly( + initialRating: + this.widget.appo.actualDoctorRate.toDouble(), + size: 35.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text( + this.widget.appo.noOfPatientsRate.toString() + + " " + + TranslationBase.of(context).reviews, + style: TextStyle( + fontSize: 14.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context).excellent, + style: TextStyle( + fontSize: 13.0, + color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[0].patientNumber), + height: 6.0, + child: Container( + color: Colors.green[700], + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context).v_good, + style: TextStyle( + fontSize: 13.0, + color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[1].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffB7B723), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context).good, + style: TextStyle( + fontSize: 13.0, + color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[2].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffEBA727), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context).average, + style: TextStyle( + fontSize: 13.0, + color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[3].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffEB7227), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context) + .below_average, + style: TextStyle( + fontSize: 13.0, + color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[4].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffE20C0C), + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 40.0), + child: Divider()), + Container( + margin: EdgeInsets.only(top: 0.0), + child: Align( + alignment: FractionalOffset.bottomCenter, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width, + height: 40.0, + child: RaisedButton( + elevation: 0.0, + color: Colors.white, + textColor: Colors.red, + hoverColor: Colors.transparent, + focusColor: Colors.transparent, + highlightColor: Colors.transparent, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text( + TranslationBase.of(context).cancel, + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ); + }, + transitionDuration: Duration(milliseconds: 500), + barrierDismissible: true, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) {}); + } + + double getRatingWidth(int patientNumber) { + var width = (patientNumber / this.widget.appo.noOfPatientsRate) * 100; + return width; + } + + String getDate(String date) { + DateTime dateObj = DateUtil.convertStringToDate(date); + return DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString(); + } + + String getDoctorSpeciality(List docSpecial) { + String docSpeciality = ""; + docSpecial.forEach((v) { + docSpeciality = docSpeciality + v + " "; + }); + return docSpeciality; + } + + DoctorList getDoctorObject() { + DoctorList docObj = new DoctorList(); + docObj.doctorID = widget.appo.doctorID; + docObj.clinicID = widget.appo.clinicID; + docObj.projectID = widget.appo.projectID; + docObj.doctorTitle = widget.appo.doctorTitle; + docObj.name = widget.appo.doctorNameObj; + docObj.clinicName = widget.appo.clinicName; + docObj.speciality = widget.appo.doctorSpeciality; + docObj.actualDoctorRate = widget.appo.actualDoctorRate; + docObj.projectName = widget.appo.projectName; + docObj.originalClinicID = widget.appo.originalClinicID; + docObj.doctorImageURL = widget.appo.doctorImageURL; + return docObj; + } +} diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart new file mode 100644 index 00000000..a49149b5 --- /dev/null +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -0,0 +1,595 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/AppointmentCardView.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class MyAppointments extends StatefulWidget { + List appoList = []; + + List bookedAppoList = []; + List confirmedAppoList = []; + List arrivedAppoList = []; + + List _patientBookedAppointmentListHospital = List(); + List _patientConfirmedAppointmentListHospital = + List(); + List _patientArrivedAppointmentListHospital = List(); + + List _patientBookedAppointmentListClinic = List(); + List _patientConfirmedAppointmentListClinic = List(); + List _patientArrivedAppointmentListClinic = List(); + + @override + _MyAppointmentsState createState() => _MyAppointmentsState(); +} + +class _MyAppointmentsState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + bool isDataLoaded = false; + var sharedPref = new AppSharedPreferences(); + AuthenticatedUserObject authenticatedUserObject = + locator(); + + List imagesInfo = List(); + + FilterType filterType; + + @override + void initState() { + _tabController = new TabController(length: 3, vsync: this); + filterType = FilterType.Clinic; + WidgetsBinding.instance.addPostFrameCallback((_) { + if (Provider.of(context, listen: false).isLogin) + getPatientAppointmentHistory(); + }); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/en/1.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/ar/1.png')); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).myAppointments, + isShowAppBar: true, + imagesInfo: imagesInfo, + description: TranslationBase.of(context).infoMyAppointments, + body: Container( + child: Column(children: [ + TabBar( + tabs: [ + Tab(text: TranslationBase.of(context).booked), + Tab(text: TranslationBase.of(context).confirmed), + Tab(text: TranslationBase.of(context).arrived), + ], + controller: _tabController, + ), + Divider( + color: Colors.grey[600], + thickness: 0.5, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () => setFilterType(FilterType.Clinic), + child: ListTile( + title: Text(TranslationBase.of(context).clinic), + leading: Radio( + value: FilterType.Clinic, + groupValue: filterType, + activeColor: Theme.of(context).primaryColor, + onChanged: (FilterType value) { + setFilterType(value); + }, + ), + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => setFilterType(FilterType.Hospital), + child: ListTile( + title: Text(TranslationBase.of(context).hospital), + leading: Radio( + value: FilterType.Hospital, + groupValue: filterType, + activeColor: Theme.of(context).primaryColor, + onChanged: (FilterType value) => setFilterType(value), + ), + ), + ), + ) + ], + ), + isDataLoaded + ? Expanded( + child: new TabBarView( + physics: NeverScrollableScrollPhysics(), + children: [ + getBookedAppointments(), + getConfirmedAppointments(), + getArrivedAppointments() + ], + controller: _tabController, + ), + ) + : Container(), + ]), + ), + ); + } + + getPatientAppointmentHistory() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + widget.appoList.clear(); + widget.bookedAppoList.clear(); + widget.confirmedAppoList.clear(); + widget.arrivedAppoList.clear(); + + widget._patientBookedAppointmentListHospital.clear(); + widget._patientConfirmedAppointmentListHospital.clear(); + widget._patientArrivedAppointmentListHospital.clear(); + + widget._patientBookedAppointmentListClinic.clear(); + widget._patientConfirmedAppointmentListClinic.clear(); + widget._patientArrivedAppointmentListClinic.clear(); + + service.getPatientAppointmentHistory(false, context).then((res) { + print(res['AppoimentAllHistoryResultList'].length); + GifLoaderDialogUtils.hideDialog(context); + setState(() { + if (res['MessageStatus'] == 1) { + // setState(() { + if (res['AppoimentAllHistoryResultList'].length != 0) { + // isDataLoaded = true; + res['AppoimentAllHistoryResultList'].forEach((v) { + widget.appoList + .add(new AppoitmentAllHistoryResultList.fromJson(v)); + }); + sortAppointmentList(); + } else {} + // }); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + isDataLoaded = true; + }); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + AppToast.showErrorToast(message: err); + Navigator.of(context).pop(); + }); + } + + bool isConfirmed(AppoitmentAllHistoryResultList appo) { + return AppointmentType.isConfirmed(appo); + } + + bool isArrived(AppoitmentAllHistoryResultList appo) { + return AppointmentType.isArrived(appo); + } + + bool isBooked(AppoitmentAllHistoryResultList appo) { + return AppointmentType.isBooked(appo); + } + + sortAppointmentList() { + widget.appoList.forEach((v) { + if (isBooked(v)) { + widget.bookedAppoList.add(v); + } + + if (isConfirmed(v)) { + widget.confirmedAppoList.add(v); + } + + if (isArrived(v)) { + widget.arrivedAppoList.add(v); + } + }); + + widget.bookedAppoList.forEach((element) { + List doctorByClinic = + widget._patientBookedAppointmentListClinic + .where( + (elementClinic) => + elementClinic.filterName == element.clinicName, + ) + .toList(); + + if (doctorByClinic.length != 0) { + widget + ._patientBookedAppointmentListClinic[widget + ._patientBookedAppointmentListClinic + .indexOf(doctorByClinic[0])] + .patientDoctorAppointmentList + .add(element); + } else { + widget._patientBookedAppointmentListClinic.add(PatientAppointmentList( + filterName: element.clinicName, patientDoctorAppointment: element)); + } + + List doctorByHospital = + widget._patientBookedAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + widget + ._patientBookedAppointmentListHospital[widget + ._patientBookedAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + widget._patientBookedAppointmentListHospital.add(PatientAppointmentList( + filterName: element.projectName, + patientDoctorAppointment: element)); + } + }); + + widget.confirmedAppoList.forEach((element) { + List doctorByClinic = + widget._patientConfirmedAppointmentListClinic + .where( + (elementClinic) => + elementClinic.filterName == element.clinicName, + ) + .toList(); + + if (doctorByClinic.length != 0) { + widget + ._patientConfirmedAppointmentListClinic[widget + ._patientConfirmedAppointmentListClinic + .indexOf(doctorByClinic[0])] + .patientDoctorAppointmentList + .add(element); + } else { + widget._patientConfirmedAppointmentListClinic.add( + PatientAppointmentList( + filterName: element.clinicName, + patientDoctorAppointment: element)); + } + + List doctorByHospital = + widget._patientConfirmedAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + widget + ._patientConfirmedAppointmentListHospital[widget + ._patientConfirmedAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + widget._patientConfirmedAppointmentListHospital.add( + PatientAppointmentList( + filterName: element.projectName, + patientDoctorAppointment: element)); + } + }); + + widget.arrivedAppoList.forEach((element) { + List doctorByClinic = + widget._patientArrivedAppointmentListClinic + .where( + (elementClinic) => + elementClinic.filterName == element.clinicName, + ) + .toList(); + + if (doctorByClinic.length != 0) { + widget + ._patientArrivedAppointmentListClinic[widget + ._patientArrivedAppointmentListClinic + .indexOf(doctorByClinic[0])] + .patientDoctorAppointmentList + .add(element); + } else { + widget._patientArrivedAppointmentListClinic.add(PatientAppointmentList( + filterName: element.clinicName, patientDoctorAppointment: element)); + } + + List doctorByHospital = + widget._patientArrivedAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + widget + ._patientArrivedAppointmentListHospital[widget + ._patientArrivedAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + widget._patientArrivedAppointmentListHospital.add( + PatientAppointmentList( + filterName: element.projectName, + patientDoctorAppointment: element)); + } + + openAppointmentsTab(); + }); + } + + openAppointmentsTab() async { + var flag = await this.sharedPref.getInt(IS_SEARCH_APPO); + + if (flag == 1) { + _tabController.index = 0; + } else if (flag == 2) { + _tabController.index = 1; + } else if (flag == 3) { + _tabController.index = 2; + } else { + if (widget._patientBookedAppointmentListClinic.length != 0) { + _tabController.index = 0; + } else if (widget._patientConfirmedAppointmentListClinic.length != 0) { + _tabController.index = 1; + } else if (widget._patientArrivedAppointmentListClinic.length != 0) { + _tabController.index = 2; + return; + } + } + } + + Widget getBookedAppointments() { + return Container( + child: Container( + child: widget.bookedAppoList.length != 0 + ? SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + ...List.generate( + filterType == FilterType.Clinic + ? widget._patientBookedAppointmentListClinic.length + : widget._patientBookedAppointmentListHospital.length, + (index) => AppExpandableNotifier( + title: filterType == FilterType.Clinic + ? widget + ._patientBookedAppointmentListClinic[index] + .filterName + : widget + ._patientBookedAppointmentListHospital[index] + .filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: filterType == FilterType.Clinic + ? widget + ._patientBookedAppointmentListClinic[index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList() + : widget + ._patientBookedAppointmentListHospital[ + index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList(), + )), + ) + ], + ), + ) + : Container( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/images/new-design/noAppointmentIcon.png"), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(TranslationBase.of(context).noBookedAppo, + style: TextStyle( + fontSize: 16.0, + )), + ), + ], + ), + ), + ), + ), + ); + } + + Widget getConfirmedAppointments() { + return widget.confirmedAppoList.length != 0 + ? Container( + margin: EdgeInsets.only(top: 10.0), + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + ...List.generate( + filterType == FilterType.Clinic + ? widget._patientConfirmedAppointmentListClinic.length + : widget + ._patientConfirmedAppointmentListHospital.length, + (index) => AppExpandableNotifier( + title: filterType == FilterType.Clinic + ? widget + ._patientConfirmedAppointmentListClinic[index] + .filterName + : widget + ._patientConfirmedAppointmentListHospital[index] + .filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: filterType == FilterType.Clinic + ? widget + ._patientConfirmedAppointmentListClinic[index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList() + : widget + ._patientConfirmedAppointmentListHospital[ + index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList(), + )), + ) + ], + ), + ), + ) + : Container( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset("assets/images/new-design/noAppointmentIcon.png"), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(TranslationBase.of(context).noConfirmedAppo, + style: TextStyle( + fontSize: 16.0, + )), + ), + ], + ), + ), + ); + } + + Widget getArrivedAppointments() { + return widget.arrivedAppoList.length != 0 + ? Container( + margin: EdgeInsets.only(top: 10.0), + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + ...List.generate( + filterType == FilterType.Clinic + ? widget._patientArrivedAppointmentListClinic.length + : widget._patientArrivedAppointmentListHospital.length, + (index) => AppExpandableNotifier( + title: filterType == FilterType.Clinic + ? widget._patientArrivedAppointmentListClinic[index] + .filterName + : widget._patientArrivedAppointmentListHospital[index] + .filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: filterType == FilterType.Clinic + ? widget._patientArrivedAppointmentListClinic[index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList() + : widget + ._patientArrivedAppointmentListHospital[index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList(), + ), + ), + ) + ], + ), + ), + ) + : Container( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset("assets/images/new-design/noAppointmentIcon.png"), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(TranslationBase.of(context).noArrivedAppo, + style: TextStyle( + fontSize: 16.0, + )), + ), + ], + ), + ), + ); + } + + setFilterType(FilterType filterType) { + setState(() { + this.filterType = filterType; + }); + } +} diff --git a/lib/pages/MyAppointments/VisitTicket.dart b/lib/pages/MyAppointments/VisitTicket.dart new file mode 100644 index 00000000..6f1dbdf8 --- /dev/null +++ b/lib/pages/MyAppointments/VisitTicket.dart @@ -0,0 +1,74 @@ +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; +import 'package:flutter/material.dart'; + +class VisitTicket extends StatefulWidget { + List appoList = []; + + @override + _VisitTicketState createState() => _VisitTicketState(); +} + +class _VisitTicketState extends State { + bool isLoading = false; + + @override + void initState() { + getPatientAppointmentCurfewHistory(context); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).todoList, + body: isLoading == false + ? SingleChildScrollView( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + padding: EdgeInsets.all(0.0), + itemCount: widget.appoList.length, + itemBuilder: (context, index) { + return DoctorView( + doctor: widget.appoList[index], + ); + }, + ), + ) + : AppCircularProgressIndicator(), + ); + } + + getPatientAppointmentCurfewHistory(BuildContext context) { + DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); + service.getPatientAppointmentHistory(true, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res['AppoimentAllHistoryResultList']); + if (res['MessageStatus'] == 1) { + setState(() { + if (res['AppoimentAllHistoryResultList'].length != 0) { + widget.appoList.clear(); + res['AppoimentAllHistoryResultList'].forEach((v) { + widget.appoList.add(new DoctorList.fromJson(v)); + }); + } else {} + }); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } +} diff --git a/lib/pages/MyAppointments/models/AppointmentModel.dart b/lib/pages/MyAppointments/models/AppointmentModel.dart new file mode 100644 index 00000000..304ae7ed --- /dev/null +++ b/lib/pages/MyAppointments/models/AppointmentModel.dart @@ -0,0 +1,84 @@ +//Appointment Model to be used in all the appointment based pages & components + +class AppointmentModel { + + static var SHARED_DATA = 'appointment-model'; + static var PATIENT_DATA = 'patient-model'; + var DoctorSpeciality = []; + + var List_HIS_GetContactLensPerscription = []; + var List_HIS_GetGlassPerscription = []; + var SetupID; + var ProjectID; + var AppointmentNo; + var AppointmentDate; + var AppointmentDateN; + var AppointmentType; + var BookDate; + var PatientType; + var PatientID; + var ClinicID; + var DoctorID; + var EndDate; + var StartTime; + var EndTime; + var Status; + var VisitType; + var VisitFor; + var PatientStatusType; + var CompanyID; + var BookedBy; + var BookedOn; + var ConfirmedBy; + var ConfirmedOn; + var ArrivalChangedBy; + var ArrivedOn; + var EditedBy; + var EditedOn; + var DoctorName; + var DoctorNameN; + var StatusDesc; + var StatusDescN; + var VitalStatus; + var VitalSignAppointmentNo; + var ClinicName; + var ComplainExists; + var DoctorImageURL; + var DoctorNameObj; + var DoctorRate; + var DoctorTitle; + var Gender; + var GenderDescription; + var IsActiveDoctor; + var IsActiveDoctorProfile; + var IsExecludeDoctor; + var IsMedicalReportRequested; + var ProjectName; + var QR; + var SMSButtonVisable; + var DoctorRatingDetailsList; + var AvgDoctorRatingList; + var IsLiveCareAppointment; + var OriginalClinicID; + var OriginalProjectID; + var StrAppointmentDate; + /* + the check in parameters + */ + // if onlince checked in mean user paid the appointment + var IsOnlineCheckedIN; + + // if user is allowed to pay for the appointment + var ISAllowOnlineCheckedIN; + + var PatientShare; + var CompanyName; + var PatientTaxAmount; + var PatientShareWithTax; + var IsFollowup; + var IsDoctorAllowVedioCall; + + static String getAppointmentTransID(appo) { + return appo.ProjectID + '-' + appo.ClinicID + '-' + appo.AppointmentNo; + } +} \ No newline at end of file diff --git a/lib/pages/MyAppointments/models/AppointmentType.dart b/lib/pages/MyAppointments/models/AppointmentType.dart new file mode 100644 index 00000000..1d0cc3d3 --- /dev/null +++ b/lib/pages/MyAppointments/models/AppointmentType.dart @@ -0,0 +1,42 @@ +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; + +class AppointmentType { + static var BOOKED = 0; + static const BOOKED_STR = 'booked'; + static var CONFIRMED = 42; + static const CONFIRMED_STR = 'confirmed'; + static var ARRIVED = 43; + static const ARRIVED_STR = 'arrived'; + + static bool isConfirmed(AppoitmentAllHistoryResultList appo) { + return AppointmentType.isValid(appo) && + appo.patientStatusType == AppointmentType.CONFIRMED; + } + + static bool isBooked(AppoitmentAllHistoryResultList appo) { + return AppointmentType.isValid(appo) && + appo.patientStatusType == AppointmentType.BOOKED; + } + + static bool isArrived(AppoitmentAllHistoryResultList appo) { + return AppointmentType.isValid(appo) && + appo.patientStatusType == AppointmentType.ARRIVED; + } + + static isValid(appo) { + return appo != null && appo.patientStatusType != null; + } + + static int getType(typeName) { + switch (typeName) { + case AppointmentType.BOOKED_STR: + return AppointmentType.BOOKED; + case AppointmentType.ARRIVED_STR: + return AppointmentType.ARRIVED; + case AppointmentType.CONFIRMED_STR: + return AppointmentType.CONFIRMED; + default: + return AppointmentType.BOOKED; + } + } +} diff --git a/lib/pages/MyAppointments/models/ArrivedButtons.dart b/lib/pages/MyAppointments/models/ArrivedButtons.dart new file mode 100644 index 00000000..136bd30f --- /dev/null +++ b/lib/pages/MyAppointments/models/ArrivedButtons.dart @@ -0,0 +1,55 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; + +class ArrivedButtons { + var buttons = [ + { + "title": TranslationBase.of(AppGlobal.context).medicines, + "subtitle": TranslationBase.of(AppGlobal.context).medicinesSubtitle, + "icon": "assets/images/new-design/medicine_prescriptions_icon.png", + "caller": "prescriptions" + }, + { + "title": TranslationBase.of(AppGlobal.context).radiology, + "subtitle": TranslationBase.of(AppGlobal.context).radiologySubtitle, + "icon": "assets/images/new-design/radiology_service_icon.png", + "caller": "radiology" + }, + { + "title": TranslationBase.of(AppGlobal.context).lab, + "subtitle": TranslationBase.of(AppGlobal.context).labSubtitle, + "icon": "assets/images/new-design/lab_result_icon.png", + "caller": "labResult" + }, + { + "title": TranslationBase.of(AppGlobal.context).vitalSigns, + "subtitle": TranslationBase.of(AppGlobal.context).vitalSignsSubtitle, + "icon": "assets/images/new-design/vital_signs.png", + "caller": "VitalSigns" + }, + { + "title": TranslationBase.of(AppGlobal.context).raise, + "subtitle": TranslationBase.of(AppGlobal.context).complaint, + "icon": "assets/images/new-design/Complaint_icon.png", + "caller": "insertComplaint" + }, + { + "title": TranslationBase.of(AppGlobal.context).insuranceApproval, + "subtitle": TranslationBase.of(AppGlobal.context).insuranceSubtitle, + "icon": "assets/images/new-design/insurance_approvals_icon.png", + "caller": "Insurance" + }, + { + "title": TranslationBase.of(AppGlobal.context).askDoctor, + "subtitle": TranslationBase.of(AppGlobal.context).askYourSubtitle, + "icon": "assets/images/new-design/ask_doctor_icon.png", + "caller": "askDoc" + }, + { + "title": TranslationBase.of(AppGlobal.context).appoSurvey, + "subtitle": TranslationBase.of(AppGlobal.context).service, + "icon": "assets/images/new-design/survey.png", + "caller": "Survey" + } + ]; +} \ No newline at end of file diff --git a/lib/pages/MyAppointments/models/ArrivedButtonsAllowCheckIn.dart b/lib/pages/MyAppointments/models/ArrivedButtonsAllowCheckIn.dart new file mode 100644 index 00000000..de9bc564 --- /dev/null +++ b/lib/pages/MyAppointments/models/ArrivedButtonsAllowCheckIn.dart @@ -0,0 +1,61 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; + +class ArrivedButtons { + static var buttons = [ + { + "title": "Arrived", + "subtitle": "Status", + "icon": "assets/images/new-design/waiting-room.png", + "caller": "openReschedule" + }, + { + "title": "Medicines", + "subtitle": "Prescriptions", + "icon": "assets/images/new-design/medicine_prescriptions_icon.png", + "caller": "prescriptions" + }, + { + "title": "Radiology", + "subtitle": "Services", + "icon": "assets/images/new-design/radiology_service_icon.png", + "caller": "radiology" + }, + { + "title": "Lab", + "subtitle": "Result", + "icon": "assets/images/new-design/lab_result_icon.png", + "caller": "addReminder" + }, + { + "title": "Vital Signs", + "subtitle": "Values", + "icon": "assets/images/new-design/vital_signs.png", + "caller": "VitalSigns" + }, + { + "title": TranslationBase.of(AppGlobal.context).raise, + "subtitle": TranslationBase.of(AppGlobal.context).complaint, + "icon": "assets/images/new-design/Complaint_icon.png", + "caller": "insertComplaint" + }, + { + "title": "Insurance", + "subtitle": "Approvals", + "icon": "assets/images/new-design/insurance_approvals_icon.png", + "caller": "Insurance" + }, + { + "title": "Ask Your", + "subtitle": "Doctor", + "icon": "assets/images/new-design/ask_doctor_icon.png", + "caller": "goToTodoList" + }, + { + "title": "Survey", + "subtitle": "Service", + "icon": "assets/images/new-design/survey.png", + "caller": "Survey" + } + ]; +} diff --git a/lib/pages/MyAppointments/models/AskDocRequestTypeModel.dart b/lib/pages/MyAppointments/models/AskDocRequestTypeModel.dart new file mode 100644 index 00000000..6b276ef0 --- /dev/null +++ b/lib/pages/MyAppointments/models/AskDocRequestTypeModel.dart @@ -0,0 +1,92 @@ +class AskDocRequestType { + String setupID; + int parameterGroup; + int parameterType; + int parameterCode; + String description; + String descriptionN; + String alias; + String aliasN; + String prefix; + String suffix; + String isColorCodingRequired; + String backColor; + String foreColor; + bool isBuiltIn; + bool isActive; + int createdBy; + String createdOn; + String editedBy; + String editedOn; + String rowVer; + + AskDocRequestType( + {this.setupID, + this.parameterGroup, + this.parameterType, + this.parameterCode, + this.description, + this.descriptionN, + this.alias, + this.aliasN, + this.prefix, + this.suffix, + this.isColorCodingRequired, + this.backColor, + this.foreColor, + this.isBuiltIn, + this.isActive, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.rowVer}); + + AskDocRequestType.fromJson(Map json) { + setupID = json['SetupID']; + parameterGroup = json['ParameterGroup']; + parameterType = json['ParameterType']; + parameterCode = json['ParameterCode']; + description = json['Description']; + descriptionN = json['DescriptionN']; + alias = json['Alias']; + aliasN = json['AliasN']; + prefix = json['Prefix']; + suffix = json['Suffix']; + isColorCodingRequired = json['IsColorCodingRequired']; + backColor = json['BackColor']; + foreColor = json['ForeColor']; + isBuiltIn = json['IsBuiltIn']; + isActive = json['IsActive']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + rowVer = json['RowVer']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ParameterGroup'] = this.parameterGroup; + data['ParameterType'] = this.parameterType; + data['ParameterCode'] = this.parameterCode; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['Alias'] = this.alias; + data['AliasN'] = this.aliasN; + data['Prefix'] = this.prefix; + data['Suffix'] = this.suffix; + data['IsColorCodingRequired'] = this.isColorCodingRequired; + data['BackColor'] = this.backColor; + data['ForeColor'] = this.foreColor; + data['IsBuiltIn'] = this.isBuiltIn; + data['IsActive'] = this.isActive; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['RowVer'] = this.rowVer; + return data; + } +} diff --git a/lib/pages/MyAppointments/models/BookedButtons.dart b/lib/pages/MyAppointments/models/BookedButtons.dart new file mode 100644 index 00000000..709b3b1f --- /dev/null +++ b/lib/pages/MyAppointments/models/BookedButtons.dart @@ -0,0 +1,43 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; + +class BookedButtons { + var buttons = [ + { + "title": TranslationBase.of(AppGlobal.context).confirm, + "subtitle": TranslationBase.of(AppGlobal.context).appointment, + "icon": "assets/images/new-design/confirm_icon.png", + "caller": "confirmAppointment" + }, + { + "title": TranslationBase.of(AppGlobal.context).reschedule, + "subtitle": TranslationBase.of(AppGlobal.context).appointment, + "icon": "assets/images/new-design/reschedule_icon.png", + "caller": "openReschedule" + }, + { + "title": TranslationBase.of(AppGlobal.context).cancel_nocaps, + "subtitle": TranslationBase.of(AppGlobal.context).appointment, + "icon": "assets/images/new-design/cancel_icon.png", + "caller": "onCancelAppointment" + }, + { + "title": TranslationBase.of(AppGlobal.context).raise, + "subtitle": TranslationBase.of(AppGlobal.context).complaint, + "icon": "assets/images/new-design/Complaint_icon.png", + "caller": "insertComplaint" + }, + { + "title": TranslationBase.of(AppGlobal.context).add, + "subtitle": TranslationBase.of(AppGlobal.context).reminder, + "icon": "assets/images/new-design/reminder_icon.png", + "caller": "addReminder" + }, + { + "title": TranslationBase.of(AppGlobal.context).hospital, + "subtitle": TranslationBase.of(AppGlobal.context).location, + "icon": "assets/images/new-design/location_icon.png", + "caller": "navigateToProject" + } + ]; +} diff --git a/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart b/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart new file mode 100644 index 00000000..9548b7c8 --- /dev/null +++ b/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart @@ -0,0 +1,49 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; + +class BookedButtonsAllowCheckIn { + var buttons = [ + { + "title": TranslationBase.of(AppGlobal.context).confirm, + "subtitle": TranslationBase.of(AppGlobal.context).appointment, + "icon": "assets/images/new-design/confirm_icon.png", + "caller": "confirmAppointment" + }, + { + "title": TranslationBase.of(AppGlobal.context).reschedule, + "subtitle": TranslationBase.of(AppGlobal.context).appointment, + "icon": "assets/images/new-design/reschedule_icon.png", + "caller": "openReschedule" + }, + { + "title": TranslationBase.of(AppGlobal.context).cancel_nocaps, + "subtitle": TranslationBase.of(AppGlobal.context).appointment, + "icon": "assets/images/new-design/cancel_icon.png", + "caller": "onCancelAppointment" + }, + { + "title": TranslationBase.of(AppGlobal.context).raise, + "subtitle": TranslationBase.of(AppGlobal.context).complaint, + "icon": "assets/images/new-design/Complaint_icon.png", + "caller": "insertComplaint" + }, + { + "title": TranslationBase.of(AppGlobal.context).add, + "subtitle": TranslationBase.of(AppGlobal.context).reminder, + "icon": "assets/images/new-design/reminder_icon.png", + "caller": "addReminder" + }, + { + "title": TranslationBase.of(AppGlobal.context).hospital, + "subtitle": TranslationBase.of(AppGlobal.context).location, + "icon": "assets/images/new-design/location_icon.png", + "caller": "navigateToProject" + }, + { + "title": TranslationBase.of(AppGlobal.context).online, + "subtitle": TranslationBase.of(AppGlobal.context).payment, + "icon": "assets/images/new-design/check-in.png", + "caller": "goToTodoList" + } + ]; +} diff --git a/lib/pages/MyAppointments/models/ConfirmedButtons.dart b/lib/pages/MyAppointments/models/ConfirmedButtons.dart new file mode 100644 index 00000000..b02021c7 --- /dev/null +++ b/lib/pages/MyAppointments/models/ConfirmedButtons.dart @@ -0,0 +1,49 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; + +class ConfirmedButtons { + var buttons = [ + { + "title": TranslationBase.of(AppGlobal.context).reschedule, + "subtitle": TranslationBase.of(AppGlobal.context).appointment, + "icon": "assets/images/new-design/reschedule_icon.png", + "caller": "openReschedule" + }, + { + "title": TranslationBase.of(AppGlobal.context).cancel_nocaps, + "subtitle": TranslationBase.of(AppGlobal.context).appointment, + "icon": "assets/images/new-design/cancel_icon.png", + "caller": "onCancelAppointment" + }, + { + "title": TranslationBase.of(AppGlobal.context).raise, + "subtitle": TranslationBase.of(AppGlobal.context).complaint, + "icon": "assets/images/new-design/Complaint_icon.png", + "caller": "insertComplaint" + }, + { + "title": TranslationBase.of(AppGlobal.context).add, + "subtitle": TranslationBase.of(AppGlobal.context).reminder, + "icon": "assets/images/new-design/reminder_icon.png", + "caller": "addReminder" + }, + { + "title": TranslationBase.of(AppGlobal.context).hospital, + "subtitle": TranslationBase.of(AppGlobal.context).location, + "icon": "assets/images/new-design/location_icon.png", + "caller": "navigateToProject" + }, +// { +// "title": "Generate", +// "subtitle": "Visit Ticket", +// "icon": "assets/images/new-design/generate_visit_ticket.png", +// "caller": "visitTicket" +// }, + { + "title": TranslationBase.of(AppGlobal.context).online, + "subtitle": TranslationBase.of(AppGlobal.context).payment, + "icon": "assets/images/new-design/check-in.png", + "caller": "goToTodoList" + } + ]; +} diff --git a/lib/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart b/lib/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart new file mode 100644 index 00000000..07ba333e --- /dev/null +++ b/lib/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart @@ -0,0 +1,43 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; + +class ConfirmedButtonsAllowCheckIn { + var buttons = [ + { + "title": TranslationBase.of(AppGlobal.context).reschedule, + "subtitle": TranslationBase.of(AppGlobal.context).appointment, + "icon": "assets/images/new-design/reschedule_icon.png", + "caller": "openReschedule" + }, + { + "title": TranslationBase.of(AppGlobal.context).cancel_nocaps, + "subtitle": TranslationBase.of(AppGlobal.context).appointment, + "icon": "assets/images/new-design/cancel_icon.png", + "caller": "onCancelAppointment" + }, + { + "title": TranslationBase.of(AppGlobal.context).raise, + "subtitle": TranslationBase.of(AppGlobal.context).complaint, + "icon": "assets/images/new-design/Complaint_icon.png", + "caller": "insertComplaint" + }, + { + "title": TranslationBase.of(AppGlobal.context).add, + "subtitle": TranslationBase.of(AppGlobal.context).reminder, + "icon": "assets/images/new-design/reminder_icon.png", + "caller": "addReminder" + }, + { + "title": TranslationBase.of(AppGlobal.context).hospital, + "subtitle": TranslationBase.of(AppGlobal.context).location, + "icon": "assets/images/new-design/location_icon.png", + "caller": "navigateToProject" + }, + { + "title": TranslationBase.of(AppGlobal.context).online, + "subtitle": TranslationBase.of(AppGlobal.context).payment, + "icon": "assets/images/new-design/check-in.png", + "caller": "goToTodoList" + } + ]; +} diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart new file mode 100644 index 00000000..60035ee1 --- /dev/null +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -0,0 +1,686 @@ +import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; +import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; +import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/models/BookedButtons.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtons.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/PrescriptionReport.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart'; +import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; +import 'package:diplomaticquarterapp/pages/medical/labs/laboratory_result_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class AppointmentActions extends StatefulWidget { + AppoitmentAllHistoryResultList appo; + TabController tabController; + final Function enableFooterButton; + MyInAppBrowser browser; + + AppointmentActions( + {@required this.appo, + @required this.tabController, + @required this.enableFooterButton}); + + @override + _AppointmentActionsState createState() => _AppointmentActionsState(); +} + +class _AppointmentActionsState extends State { + List appoButtonsList = []; + + ToDoCountProviderModel toDoProvider; + + @override + void initState() { + _getAppointmentActionButtons(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + toDoProvider = Provider.of(context); + var size = MediaQuery.of(context).size; + final double itemHeight = projectViewModel.isArabic + ? ((size.height - kToolbarHeight - 24) * 0.5) / 2 + : ((size.height - kToolbarHeight - 24) * 0.45) / 2; + final double itemWidth = size.width / 2; + + return Container( + margin: EdgeInsets.all(5.0), + child: CustomScrollView( + primary: false, + physics: NeverScrollableScrollPhysics(), + slivers: [ + SliverPadding( + padding: const EdgeInsets.fromLTRB(15, 0, 15, 0), + sliver: SliverGrid.count( + crossAxisCount: 2, + childAspectRatio: (itemWidth / itemHeight), + children: appoButtonsList + .map((e) => GestureDetector( + onTap: () { + _handleButtonClicks(e); + }, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Container( + // height: 100.0, + margin: EdgeInsets.all(7.0), + padding: EdgeInsets.only(bottom: 4.0), + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey[400], + blurRadius: 2.0, + spreadRadius: 0.0) + ], + borderRadius: BorderRadius.circular(10), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + margin: + EdgeInsets.fromLTRB(5.0, 5.0, 5.0, 0.0), + child: Text(e.title, + overflow: TextOverflow.clip, + style: TextStyle( + color: new Color(0xFF40ACC9), + letterSpacing: 1.0, + fontSize: 18.0)), + ), + Container( + margin: + EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0), + child: Text(e.subtitle, + overflow: TextOverflow.clip, + style: TextStyle( + color: Colors.black, + letterSpacing: 1.0, + fontSize: 15.0)), + ), + Container( + alignment: projectViewModel.isArabic + ? Alignment.bottomLeft + : Alignment.bottomRight, + margin: projectViewModel.isArabic + ? EdgeInsets.fromLTRB( + 10.0, 7.0, 0.0, 8.0) + : EdgeInsets.fromLTRB( + 0.0, 7.0, 10.0, 8.0), + child: Image.asset(e.icon, + width: 45.0, height: 45.0), + ), + ], + ), + ), + ], + ), + )) + .toList(), + ), + ), + ], + ), + ); + } + + _handleButtonClicks(AppoDetailsButton) { + print(AppoDetailsButton.caller); + + switch (AppoDetailsButton.caller) { + case "openReschedule": + widget.tabController.animateTo((widget.tabController.index + 1) % 2); + setState(() { + print("Reschedule"); + widget.enableFooterButton(); + }); + break; + + case "onCancelAppointment": + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: TranslationBase.of(context).cancelAppoMsg, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => {cancelAppointment()}, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + break; + + case "confirmAppointment": + confirmAppointment(); + break; + + case "navigateToProject": + openMap(double.parse(widget.appo.latitude), + double.parse(widget.appo.longitude)); + break; + + case "addReminder": + showReminderDialog(widget.appo); + break; + + case "goToTodoList": + Navigator.of(context).pop(); + break; + + case "askDoc": + askYourDoc(); + break; + + case "radiology": + openAppointmentRadiology(); + break; + + case "labResult": + openAppointmentLabResults(); + break; + + case "prescriptions": + openPrescriptionReport(); + break; + + case "Survey": + rateAppointment(); + break; + + case "Insurance": + navigateToInsuranceApprovals(widget.appo.appointmentNo); + break; + + case "VitalSigns": + navigateToVitalSigns(widget.appo.appointmentNo, widget.appo.projectID); + break; + + case "insertComplaint": + navigateToInsertComplaint(); + break; + } + } + + _getAppointmentActionButtons() { + if (widget.appo != null) { + if (isConfirmed()) { + if (widget.appo.isOnlineCheckedIN) { + _getConfirmedCheckInAppoActionsList(); + } else { + _getConfirmedAppoActionsList(); + } + } else { + print("isConfirmed Null"); + } + if (isBooked()) { + if (widget.appo.isOnlineCheckedIN) { + _getBookedCheckInAppoActionsList(); + } else { + _getBookedAppoActionsList(); + } + } else { + print("isBooked Null"); + } + if (isArrived()) { + if (widget.appo.clinicID == 17) { + _getArrivedInvoiceAppoActionsList(); + } else { + _getArrivedAppoActionsList(); + } + } else { + print("isArrived Null"); + } + } else { + print("Appo Null"); + } + } + + bool isConfirmed() { + return AppointmentType.isConfirmed(widget.appo); + } + + bool isArrived() { + return AppointmentType.isArrived(widget.appo); + } + + bool isCheckedIn() { + return widget.appo.isOnlineCheckedIN; + } + + bool isBooked() { + return AppointmentType.isBooked(widget.appo); + } + + Future> _getBookedAppoActionsList() async { + print("_getBookedAppoActionsList"); + BookedButtons bookedButtons = new BookedButtons(); + print(bookedButtons.buttons); + List buttonsList = []; + for (var i = 0; i < bookedButtons.buttons.length; i++) { + buttonsList.add(AppoDetailsButton( + title: bookedButtons.buttons[i]['title'], + subtitle: bookedButtons.buttons[i]['subtitle'], + icon: bookedButtons.buttons[i]['icon'], + caller: bookedButtons.buttons[i]['caller'], + )); + } + setState(() { + appoButtonsList = buttonsList; + }); + } + + Future> _getBookedCheckInAppoActionsList() async { + print("_getBookedCheckInAppoActionsList"); + BookedButtonsAllowCheckIn bookedButtonsAllowCheckIn = + new BookedButtonsAllowCheckIn(); + print(bookedButtonsAllowCheckIn.buttons); + List buttonsList = []; + for (var i = 0; i < bookedButtonsAllowCheckIn.buttons.length; i++) { + buttonsList.add(AppoDetailsButton( + title: bookedButtonsAllowCheckIn.buttons[i]['title'], + subtitle: bookedButtonsAllowCheckIn.buttons[i]['subtitle'], + icon: bookedButtonsAllowCheckIn.buttons[i]['icon'], + caller: bookedButtonsAllowCheckIn.buttons[i]['caller'], + )); + } + setState(() { + appoButtonsList = buttonsList; + }); + } + + Future> _getConfirmedAppoActionsList() async { + print("_getConfirmedAppoActionsList"); + ConfirmedButtons confirmedButtons = new ConfirmedButtons(); + print(confirmedButtons.buttons); + List buttonsList = []; + for (var i = 0; i < confirmedButtons.buttons.length; i++) { + buttonsList.add(AppoDetailsButton( + title: confirmedButtons.buttons[i]['title'], + subtitle: confirmedButtons.buttons[i]['subtitle'], + icon: confirmedButtons.buttons[i]['icon'], + caller: confirmedButtons.buttons[i]['caller'], + )); + } + setState(() { + appoButtonsList = buttonsList; + }); + } + + Future> _getConfirmedCheckInAppoActionsList() async { + print("_getConfirmedAllowCheckInAppoActionsList"); + ConfirmedButtonsAllowCheckIn confirmedButtonsAllowCheckIn = + new ConfirmedButtonsAllowCheckIn(); + print(confirmedButtonsAllowCheckIn.buttons); + List buttonsList = []; + for (var i = 0; i < confirmedButtonsAllowCheckIn.buttons.length; i++) { + buttonsList.add(AppoDetailsButton( + title: confirmedButtonsAllowCheckIn.buttons[i]['title'], + subtitle: confirmedButtonsAllowCheckIn.buttons[i]['subtitle'], + icon: confirmedButtonsAllowCheckIn.buttons[i]['icon'], + caller: confirmedButtonsAllowCheckIn.buttons[i]['caller'], + )); + } + setState(() { + appoButtonsList = buttonsList; + }); + } + + Future> _getArrivedAppoActionsList() async { + print("_getArrivedAppoActionsList"); + ArrivedButtons arrivedButtons = new ArrivedButtons(); + print(arrivedButtons.buttons); + List buttonsList = []; + for (var i = 0; i < arrivedButtons.buttons.length; i++) { + buttonsList.add(AppoDetailsButton( + title: arrivedButtons.buttons[i]['title'], + subtitle: arrivedButtons.buttons[i]['subtitle'], + icon: arrivedButtons.buttons[i]['icon'], + caller: arrivedButtons.buttons[i]['caller'], + )); + } + setState(() { + appoButtonsList = buttonsList; + }); + } + + Future> _getArrivedInvoiceAppoActionsList() async { + print("_getArrivedInvoiceAppoActionsList"); + ArrivedButtons arrivedButtons = new ArrivedButtons(); + List buttonsList = []; + for (var i = 0; i < arrivedButtons.buttons.length; i++) { + buttonsList.add(AppoDetailsButton( + title: arrivedButtons.buttons[i]['title'], + subtitle: arrivedButtons.buttons[i]['subtitle'], + icon: arrivedButtons.buttons[i]['icon'], + caller: arrivedButtons.buttons[i]['caller'], + )); + } + setState(() { + appoButtonsList = buttonsList; + }); + } + + cancelAppointment() { + ConfirmDialog.closeAlertDialog(context); + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service.cancelAppointment(widget.appo, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res); + if (res['MessageStatus'] == 1) { + getToDoCount(); + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + Navigator.of(context).pop(); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + getToDoCount() { + toDoProvider.setState(0, true); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + print(res['AppointmentActiveNumber']); + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber'], true); + } else {} + }).catchError((err) { + print(err); + }); + } + + openAppointmentLabResults() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + PatientLabOrders patientLabOrders = new PatientLabOrders(); + service + .getPatientLabOrdersByAppoNo(widget.appo.appointmentNo, + widget.appo.projectID, widget.appo.clinicID, context) + .then((res) { + print(res['ListLabResultsByAppNo']); + GifLoaderDialogUtils.hideDialog(context); + if (res['ListLabResultsByAppNo'] != null) { + patientLabOrders.orderNo = + res['ListLabResultsByAppNo'][0]['OrderNo'].toString(); + patientLabOrders.invoiceNo = + res['ListLabResultsByAppNo'][0]['InvoiceNo'].toString(); + patientLabOrders.clinicID = widget.appo.clinicID; + patientLabOrders.projectID = widget.appo.projectID.toString(); + print(patientLabOrders.invoiceNo); + print(patientLabOrders.orderNo); + navigateToLabResults(patientLabOrders); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + AppToast.showErrorToast(message: err); + }); + } + + openAppointmentRadiology() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + FinalRadiology finalRadiology = new FinalRadiology(); + service + .getPatientRadOrders(widget.appo.appointmentNo.toString(), context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['FinalRadiologyList'] != null) { + print(res['FinalRadiologyList']); + finalRadiology = + new FinalRadiology.fromJson(res['FinalRadiologyList'][0]); + print(finalRadiology.reportData); + navigateToRadiologyDetails(finalRadiology); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + AppToast.showErrorToast(message: err); + }); + } + + openPrescriptionReport() { + GifLoaderDialogUtils.showMyDialog(context); + List prescriptionReportEnhList = List(); + DoctorsListService service = new DoctorsListService(); + service.getPatientPrescriptionReports(widget.appo, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['ListPRM'].length != 0) { + res['ListPRM'].forEach((report) { + prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(report)); + }); + print(prescriptionReportEnhList.length); + navigateToMedicinePrescriptionReport( + prescriptionReportEnhList, res['ListPRM']); + } else { + AppToast.showErrorToast(message: TranslationBase.of(context).noRecords); + } + }).catchError((err) { + print(err); + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + }); + } + + Future navigateToMedicinePrescriptionReport( + List prescriptionReportEnhList, + dynamic listPres) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PrescriptionReportPage( + prescriptionReportEnhList: prescriptionReportEnhList, + listPres: listPres, + appo: widget.appo))); + } + + Future navigateToLabResults(PatientLabOrders patientLabOrders) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + LaboratoryResultPage(patientLabOrders: patientLabOrders))) + .then((value) {}); + } + + Future navigateToRadiologyDetails(FinalRadiology finalRadiology) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + RadiologyDetailsPage(finalRadiology: finalRadiology))) + .then((value) {}); + } + + static Future openMap(double latitude, double longitude) async { + String googleUrl = + 'https://www.google.com/maps/search/?api=1&query=$latitude,$longitude'; + if (await canLaunch(googleUrl)) { + await launch(googleUrl); + } else { + throw 'Could not open the map.'; + } + } + + showReminderDialog(AppoitmentAllHistoryResultList appo) { + showGeneralDialog( + barrierColor: Colors.black.withOpacity(0.5), + transitionBuilder: (context, a1, a2, widget) { + final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0; + return Transform( + transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), + child: Opacity( + opacity: a1.value, + child: ReminderDialog(appo: appo), + ), + ); + }, + transitionDuration: Duration(milliseconds: 500), + barrierDismissible: true, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) {}); + } + + askYourDoc() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service.isAllowedToAskDoctor(widget.appo.doctorID, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res['PatientDoctorAppointmentResultList']); + if (res['PatientDoctorAppointmentResultList'].length != 0) { + getCallRequestType(); + } else { + AppToast.showErrorToast( + message: TranslationBase.of(context).askDocNotAllowed); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + AppToast.showErrorToast(message: err); + }); + } + + getCallRequestType() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service.getCallRequestType(context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + List requestData = new List(); + res['ListReqTypes'].forEach((element) { + requestData.add(new AskDocRequestType.fromJson(element)); + }); + Future.delayed(const Duration(milliseconds: 400), () { + showAskDocRequestDialog(requestData); + }); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + showAskDocRequestDialog(List requestData) { + showGeneralDialog( + barrierColor: Colors.black.withOpacity(0.5), + transitionBuilder: (context, a1, a2, widget) { + final curvedValue = + Curves.easeInOutBack.transform(a1.value) - 1.0; + return Transform( + transform: + Matrix4.translationValues(0.0, curvedValue * 200, 0.0), + child: Opacity( + opacity: a1.value, + child: AskDocDialog(requestData: requestData), + ), + ); + }, + transitionDuration: Duration(milliseconds: 500), + barrierDismissible: true, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) {}) + .then((value) { + print("Dialog Closed"); + print(value); + if (value != null) { + sendAskDocRequest(value); + } + }); + } + + sendAskDocRequest(int requestType) { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service + .sendAskDocCallRequest(widget.appo, requestType.toString(), context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: "Request Sent Successfully"); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + AppToast.showErrorToast(message: err); + }); + } + + confirmAppointment() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service + .confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID, + widget.appo.projectID, widget.appo.isLiveCareAppointment, context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + Navigator.of(context).pop(); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + navigateToInsuranceApprovals(int appoNo) { + Navigator.push( + context, FadePage(page: InsuranceApproval(appointmentNo: appoNo))); + } + + navigateToVitalSigns(int appoNo, int projectID) { + Navigator.push( + context, + FadePage( + page: VitalSignDetailsScreen( + appointmentNo: appoNo, projectID: projectID,isNotOneAppointment: false,))); + } + + navigateToInsertComplaint() { + Navigator.push(context, FadePage(page: FeedbackHomePage())); + } + + rateAppointment() { + widget.browser = new MyInAppBrowser(); + widget.browser.openBrowser('http://hmg.com/SitePages/pso.aspx?p=' + + widget.appo.projectID.toString() + + '.' + + widget.appo.appointmentNo.toString() + + '&c=1'); + } +} diff --git a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart new file mode 100644 index 00000000..c4299e33 --- /dev/null +++ b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart @@ -0,0 +1,246 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_countdown_timer/countdown_timer_controller.dart'; +import 'package:flutter_countdown_timer/current_remaining_time.dart'; +import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; +import 'package:provider/provider.dart'; +import 'package:rating_bar/rating_bar.dart'; + +import '../AppointmentDetails.dart'; + +class AppointmentCard extends StatefulWidget { + AppoitmentAllHistoryResultList appo; + final Function onReloadAppointmentHistory; + + AppointmentCard( + {@required this.appo, @required this.onReloadAppointmentHistory}); + + @override + _ApointmentCardState createState() => _ApointmentCardState(); +} + +class _ApointmentCardState extends State { + CountdownTimerController controller; + + @override + void initState() { + super.initState(); + int endTime = DateTime.now().millisecondsSinceEpoch + 1000 * 30; + controller = CountdownTimerController( + endTime: endTime, + ); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return InkWell( + onTap: () { + navigateToAppointmentDetails(context, widget.appo); + }, + child: Card( + // margin: EdgeInsets.fromLTRB(10.0, 16.0, 10.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + decoration: BoxDecoration(), + padding: EdgeInsets.all(7.0), + width: MediaQuery.of(context).size.width, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: projectViewModel.isArabic ? 27 : 20, + height: projectViewModel.isArabic ? 165 : 140, + decoration: BoxDecoration( + //Colors.red[900] Color(0xff404545) + color: widget.appo.isLiveCareAppointment + ? Color(0xff404545) + : !widget.appo.isInOutPatient + ? Colors.red[900] + : Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic + ? Radius.circular(0) + : Radius.circular(8), + bottomLeft: projectViewModel.isArabic + ? Radius.circular(0) + : Radius.circular(8), + topRight: projectViewModel.isArabic + ? Radius.circular(8) + : Radius.circular(0), + bottomRight: projectViewModel.isArabic + ? Radius.circular(8) + : Radius.circular(0), + ), + ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + widget.appo.isLiveCareAppointment + ? TranslationBase.of(context) + .liveCare + .toUpperCase() + : !widget.appo.isInOutPatient + ? TranslationBase.of(context) + .inPatient + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), + style: TextStyle(color: Colors.white), + ), + )), + ), + SizedBox(width: 8,), + ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: Image.network(widget.appo.doctorImageURL, + fit: BoxFit.fill, height: 60.0, width: 60.0), + ), + Expanded( + child: Container( + width: MediaQuery.of(context).size.width * 0.61, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.appo.doctorTitle + + " " + + widget.appo.doctorNameObj, + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700], + letterSpacing: 1.0)), + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(widget.appo.clinicName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(widget.appo.projectName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 3.0, bottom: 3.0), + child: Text( + DateUtil.getWeekDayMonthDayYearDateFormatted( + DateUtil.convertStringToDate( + widget.appo.appointmentDate), + projectViewModel.isArabic ? "ar" : "en") + .trim(), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: + widget.appo.actualDoctorRate.toDouble(), + size: 20.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + Container( + transform: + Matrix4.translationValues(15.0, -40.0, 0.0), + child: projectViewModel.isArabic + ? Image.asset( + "assets/images/new-design/arrow_menu_black-ar.png", + width: 25.0, + height: 25.0) + : Image.asset( + "assets/images/new-design/arrow_menu_black-en.png", + width: 25.0, + height: 25.0), + ), + ], + ), + (widget.appo.patientStatusType == AppointmentType.BOOKED || + widget.appo.patientStatusType == + AppointmentType.CONFIRMED) + ? Container( + child: CountdownTimer( + controller: new CountdownTimerController( + endTime: + DateTime.now().millisecondsSinceEpoch + + (widget.appo.remaniningHoursTocanPay * + 1000) * + 60), + widgetBuilder: (_, CurrentRemainingTime time) { + return time != null + ? Text( + '${time.days}:${time.hours}:${time.min}:${time.sec} ' + + TranslationBase.of(context) + .upcomingTimeLeft, + style: TextStyle( + fontSize: 12.0, + color: Color(0xff40ACC9))) + : Container(); + }, + ), + ) + : Container(), + ], + ), + ), + ), + ], + ), + ), + ), + ); + } + + String getDate(String date) { + DateTime dateObj = DateUtil.convertStringToDate(date); + return DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString(); + } + + String getDoctorSpeciality(List docSpecial) { + String docSpeciality = ""; + docSpecial.forEach((v) { + docSpeciality = docSpeciality + v + "\n"; + }); + return docSpeciality; + } + + Future navigateToAppointmentDetails(context, appo) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AppointmentDetails(appo: appo))) + .then((value) { + widget.onReloadAppointmentHistory(); + }); + } +} diff --git a/lib/pages/MyAppointments/widgets/PrescriptionReport.dart b/lib/pages/MyAppointments/widgets/PrescriptionReport.dart new file mode 100644 index 00000000..213e28e1 --- /dev/null +++ b/lib/pages/MyAppointments/widgets/PrescriptionReport.dart @@ -0,0 +1,160 @@ +import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; +import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; + +class PrescriptionReportPage extends StatefulWidget { + List prescriptionReportEnhList; + dynamic listPres; + AppoitmentAllHistoryResultList appo; + + PrescriptionReportPage( + {@required this.prescriptionReportEnhList, + @required this.listPres, + @required this.appo}); + + @override + _PrescriptionReportState createState() => _PrescriptionReportState(); +} + +class _PrescriptionReportState extends State { + @override + void initState() { + print(widget.prescriptionReportEnhList.length); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Items', + body: Container( + height: MediaQuery.of(context).size.height * 0.8, + child: ListView.builder( + itemBuilder: (context, index) => InkWell( + onTap: () { + navigateToPrescriptionDetails( + widget.prescriptionReportEnhList[index]); + }, + child: Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all(color: Colors.grey[200], width: 0.5), + ), + child: Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5)), + child: Image.network( + widget.prescriptionReportEnhList[index].imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts(widget + .prescriptionReportEnhList[index].itemDescription)), + )), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) + ], + ), + ), + ), + itemCount: widget.prescriptionReportEnhList.length, + ), + ), + bottomSheet: Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.2, + color: Colors.grey[100], + child: Column( + children: [ + Divider(), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + label: 'Send Copy', + onTap: () { + sendPrescriptionReportEmail(); + }, + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + label: 'Resend order & deliver', + backgroundColor: Colors.green[200], + )) + ], + ), + ), + ); + } + + sendPrescriptionReportEmail() { + DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); + service + .sendPrescriptionEmail(widget.appo.appointmentDate, widget.appo.setupID, + widget.listPres, context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showSuccessToast(message: 'A copy has been sent to the e-mail'); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + AppToast.showErrorToast(message: err); + }); + } + + navigateToPrescriptionDetails(PrescriptionReportEnh prescriptionReportEnh) { + final PrescriptionReport prescriptionReport = new PrescriptionReport(); + + prescriptionReport.imageSRCUrl = prescriptionReportEnh.imageSRCUrl; + prescriptionReport.itemDescription = prescriptionReportEnh.itemDescription; + prescriptionReport.itemID = prescriptionReportEnh.itemID; + + prescriptionReport.routeN = prescriptionReportEnh.route; + prescriptionReport.route = prescriptionReportEnh.route; + + prescriptionReport.frequency = prescriptionReportEnh.frequency; + prescriptionReport.frequencyN = prescriptionReportEnh.frequency; + + prescriptionReport.doseDailyQuantity = + prescriptionReportEnh.doseDailyQuantity; + + prescriptionReport.days = prescriptionReportEnh.days; + + Navigator.push( + context, + FadePage( + page: PrescriptionDetailsPage( + prescriptionReport: prescriptionReport, + ), + ), + ); + } +} diff --git a/lib/pages/MyAppointments/widgets/askDocDialog.dart b/lib/pages/MyAppointments/widgets/askDocDialog.dart new file mode 100644 index 00000000..15af9ae7 --- /dev/null +++ b/lib/pages/MyAppointments/widgets/askDocDialog.dart @@ -0,0 +1,93 @@ +import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; + +import 'custom_radio.dart'; + +class AskDocDialog extends StatefulWidget { + + List requestData; + + static int selectedParameterCode = 0; + + AskDocDialog({@required this.requestData}); + + @override + _AskDocDialogState createState() => _AskDocDialogState(); +} + +class _AskDocDialogState extends State { + @override + Widget build(BuildContext context) { + return Container( + child: Dialog( + shape: + RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)), + child: Container( + height: MediaQuery.of(context).size.height * 0.77, + width: 450.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + margin: EdgeInsets.all(20.0), + child: Text(TranslationBase.of(context).requestType, + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + fontFamily: "Open-Sans-Bold")), + ), + Container( + transform: Matrix4.translationValues(0.0, -30.0, 0.0), + child: CustomRadio(requestData: widget.requestData), + ), + Container( + width: MediaQuery.of(context).size.width, + height: 40.0, + margin: EdgeInsets.only(left: 30.0, top: 0.0, right: 30.0), + child: RaisedButton( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + side: BorderSide(color: Colors.blue)), + color: Colors.blue, + onPressed: () { + if(AskDocDialog.selectedParameterCode != 0) + Navigator.pop(context, AskDocDialog.selectedParameterCode); + else + AppToast.showErrorToast(message: "Please select request type to continue"); + }, + child: Text(TranslationBase.of(context).confirm, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontFamily: 'Open-Sans-Bold')), + ), + ), + Container( + width: MediaQuery.of(context).size.width, + margin: EdgeInsets.only(left: 100.0, top: 20.0, right: 100.0), + child: OutlineButton( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0)), + color: Colors.red, + borderSide: BorderSide(color: Colors.red), + highlightColor: Colors.red, + highlightedBorderColor: Colors.red, + onPressed: () { + Navigator.pop(context, null); + }, + child: Text(TranslationBase.of(context).cancel_nocaps, + style: TextStyle( + color: Colors.red, + fontWeight: FontWeight.bold, + fontFamily: 'Open-Sans-Bold')), + ), + ), + ]), + ), + ), + ); + } +} diff --git a/lib/pages/MyAppointments/widgets/custom_radio.dart b/lib/pages/MyAppointments/widgets/custom_radio.dart new file mode 100644 index 00000000..b21e34ec --- /dev/null +++ b/lib/pages/MyAppointments/widgets/custom_radio.dart @@ -0,0 +1,121 @@ +import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; + +class CustomRadio extends StatefulWidget { + List requestData; + + CustomRadio({this.requestData}); + + @override + createState() { + return new CustomRadioState(); + } +} + +class CustomRadioState extends State { + List sampleData = new List(); + + @override + void initState() { + super.initState(); + + WidgetsBinding.instance.addPostFrameCallback((_) { + if (widget.requestData != null) { + widget.requestData.forEach((element) { + sampleData.add(new RadioModel( + false, element.description, element.parameterCode)); + }); + } else { + sampleData.add(new RadioModel( + false, TranslationBase.of(context).appoReminder30, 30)); + sampleData.add(new RadioModel( + false, TranslationBase.of(context).appoReminder60, 60)); + sampleData.add(new RadioModel( + false, TranslationBase.of(context).appoReminder90, 90)); + sampleData.add(new RadioModel( + false, TranslationBase.of(context).appoReminder120, 120)); + } + }); + } + + @override + Widget build(BuildContext context) { + return Column( + children: [ + ListView.builder( + shrinkWrap: true, + itemCount: sampleData.length, + itemBuilder: (BuildContext context, int index) { + return new InkWell( + //highlightColor: Colors.red, + splashColor: Colors.transparent, + onTap: () { + setState(() { + sampleData.forEach((element) => element.isSelected = false); + sampleData[index].isSelected = true; + if (widget.requestData != null) { + AskDocDialog.selectedParameterCode = + sampleData[index].duration; + print(AskDocDialog.selectedParameterCode); + } else { + ReminderDialog.selectedDuration = + sampleData[index].duration * 60000; + } + }); + }, + child: new RadioItem(sampleData[index]), + ); + }, + ), + ], + ); + } +} + +class RadioItem extends StatelessWidget { + final RadioModel _item; + + RadioItem(this._item); + + @override + Widget build(BuildContext context) { + return new Container( + margin: new EdgeInsets.all(15.0), + child: new Row( + mainAxisSize: MainAxisSize.max, + children: [ + new Container( + height: 30.0, + width: 30.0, + child: new Center( + child: Image.asset("assets/images/new-design/check_icon.png", + width: 15.0, height: 15.0), + ), + decoration: new BoxDecoration( + color: _item.isSelected ? Colors.blue : Colors.transparent, + border: new Border.all( + width: 1.0, + color: _item.isSelected ? Colors.blue : Colors.grey), + borderRadius: const BorderRadius.all(const Radius.circular(50.0)), + ), + ), + new Container( + margin: new EdgeInsets.only(left: 15.0, right: 15.0), + child: new Text(_item.text, style: TextStyle(fontSize: 16.0)), + ), + ], + ), + ); + } +} + +class RadioModel { + bool isSelected; + final String text; + final int duration; + + RadioModel(this.isSelected, this.text, this.duration); +} diff --git a/lib/pages/MyAppointments/widgets/reminder_dialog.dart b/lib/pages/MyAppointments/widgets/reminder_dialog.dart new file mode 100644 index 00000000..b8803469 --- /dev/null +++ b/lib/pages/MyAppointments/widgets/reminder_dialog.dart @@ -0,0 +1,131 @@ +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/custom_radio.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; +import 'package:manage_calendar_events/manage_calendar_events.dart'; + +class ReminderDialog extends StatefulWidget { + static var selectedDuration; + + AppoitmentAllHistoryResultList appo; + + ReminderDialog({@required this.appo}); + + @override + _ReminderDialogState createState() => _ReminderDialogState(); +} + +class _ReminderDialogState extends State { + final CalendarPlugin _myPlugin = CalendarPlugin(); + + @override + Widget build(BuildContext context) { + return Container( + child: Dialog( + shape: + RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)), + child: Container( + // height: MediaQuery.of(context).size.height * 0.57, + width: 450.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Container( + margin: EdgeInsets.all(20.0), + child: Text(TranslationBase.of(context).setReminder, + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold)), + ), + Container( + transform: Matrix4.translationValues(0.0, -30.0, 0.0), + child: CustomRadio(), + ), + Container( + width: MediaQuery.of(context).size.width, + height: 40.0, + margin: EdgeInsets.only(left: 30.0, top: 0.0, right: 30.0), + child: RaisedButton( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + side: BorderSide(color: Colors.blue)), + color: Colors.blue, + onPressed: () { + print(ReminderDialog.selectedDuration); + createCalendarEvent(); + }, + child: Text(TranslationBase.of(context).confirm, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold)), + ), + ), + Container( + width: MediaQuery.of(context).size.width, + margin: EdgeInsets.only(left: 100.0, top: 20.0, right: 100.0, bottom: 20.0), + child: OutlineButton( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0)), + color: Colors.red, + borderSide: BorderSide(color: Colors.red), + highlightColor: Colors.red, + highlightedBorderColor: Colors.red, + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(TranslationBase.of(context).cancel_nocaps, + style: TextStyle( + color: Colors.red, + fontWeight: FontWeight.bold)), + ), + ), + ]), + ), + ), + ); + } + + createCalendarEvent() { + _myPlugin.hasPermissions().then((value) { + if (!value) { + _myPlugin.requestPermissions(); + } else { + _myPlugin.getCalendars().then((value) => {print(value.length)}); + } + }); + + CalendarEvent calendarEvent = new CalendarEvent( + eventId: widget.appo.appointmentNo.toString(), + title: "Doctor Appointment", + description: "You have an appointment with " + + widget.appo.doctorTitle + + " " + + widget.appo.doctorNameObj, + startDate: DateUtil.convertStringToDate(widget.appo.appointmentDate) + .subtract( + new Duration(microseconds: ReminderDialog.selectedDuration)), + endDate: DateUtil.convertStringToDate(widget.appo.appointmentDate), + location: widget.appo.projectName, + duration: new Duration(minutes: 15).inMinutes, + isAllDay: false, + hasAlarm: true); + + _myPlugin + .createEvent(calendarId: "207749556", event: calendarEvent) + .then((value) { + print("Cal event"); + print(value); + if (int.parse(value) == widget.appo.appointmentNo) { + AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); + } + Navigator.of(context).pop(); + }).catchError((err) { + print("Cal Error"); + print(err); + Navigator.of(context).pop(); + }); + } +} diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart new file mode 100644 index 00000000..1066ca15 --- /dev/null +++ b/lib/pages/ToDoList/ToDo.dart @@ -0,0 +1,851 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_countdown_timer/countdown_timer_controller.dart'; +import 'package:flutter_countdown_timer/current_remaining_time.dart'; +import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:provider/provider.dart'; +import 'package:rating_bar/rating_bar.dart'; + +class ToDo extends StatefulWidget { + PatientShareResponse patientShareResponse; + List appoList = []; + var languageID; + MyInAppBrowser browser; + + bool isShowAppBar = true; + + ToDo({@required this.isShowAppBar}); + + @override + _ToDoState createState() => _ToDoState(); +} + +class _ToDoState extends State { + AppSharedPreferences sharedPref = AppSharedPreferences(); + + AuthenticatedUser authUser; + AuthenticatedUserObject authenticatedUserObject = + locator(); + + List imagesInfo = List(); + + ToDoCountProviderModel toDoProvider; + CountdownTimerController controller; + + @override + void initState() { + widget.patientShareResponse = new PatientShareResponse(); + WidgetsBinding.instance.addPostFrameCallback((_) { + if (authenticatedUserObject.isLogin) getPatientData(); + }); + super.initState(); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/ar/0.png')); + int endTime = DateTime.now().millisecondsSinceEpoch + 1000 * 30; + controller = CountdownTimerController(endTime: endTime); + } + + @override + Widget build(BuildContext context) { + toDoProvider = Provider.of(context); + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( + appBarTitle: TranslationBase.of(context).todoList, + imagesInfo: imagesInfo, + isShowAppBar: widget.isShowAppBar, + isShowDecPage: true, + description: TranslationBase.of(context).infoTodo, + body: SingleChildScrollView( + child: Column( + children: [ + Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + padding: EdgeInsets.all(0.0), + itemCount: widget.appoList.length, + itemBuilder: (context, index) { + return Container( + margin: EdgeInsets.all(10.0), + child: Card( + margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Row( + children: [ + Image.asset( + "assets/images/new-design/time_icon.png", + width: 20.0, + height: 20.0), + Container( + margin: + EdgeInsets.only(left: 10.0, right: 10.0), + child: Text( + DateUtil.getWeekDayMonthDayYearDateFormatted( + DateUtil.convertStringToDate( + widget.appoList[index] + .appointmentDate), + projectViewModel.isArabic + ? "ar" + : "en") + + " " + + widget.appoList[index].startTime + .substring(0, 5), + style: TextStyle(fontSize: 10.0)), + ), + widget.appoList[index].isLiveCareAppointment + ? SvgPicture.asset( + "assets/images/new-design/liveCare_logo_icon.svg", + width: 20.0, + height: 20.0) + : Image.asset( + "assets/images/new-design/hospital_address_icon.png", + width: 20.0, + height: 20.0), + Container( + margin: + EdgeInsets.only(left: 5.0, right: 5.0), + child: widget + .appoList[index].isLiveCareAppointment + ? Text( + TranslationBase.of(context) + .liveCareAppo, + style: TextStyle(fontSize: 12.0)) + : Text( + widget.appoList[index].projectName != + null + ? widget + .appoList[index].projectName + : "-", + overflow: TextOverflow.clip, + maxLines: 2, + style: TextStyle(fontSize: 10.0)), + ), + ], + ), + Container( + margin: EdgeInsets.only(top: 5.0), + child: Divider( + color: Colors.grey[500], + ), + ), + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 1, + child: Container( + height: MediaQuery.of(context).size.height * + 0.1, + margin: EdgeInsets.only(top: 5.0), + child: ClipRRect( + borderRadius: + BorderRadius.circular(100.0), + child: Image.network( + widget.appoList[index].doctorImageURL, + fit: BoxFit.fill), + ), + ), + ), + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 10.0, left: 20.0, right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + widget.appoList[index].doctorTitle + + " " + + widget.appoList[index] + .doctorNameObj, + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + fontWeight: FontWeight.bold, + letterSpacing: 1.0)), + Container( + margin: EdgeInsets.only( + top: 3.0, bottom: 3.0), + child: Text( + getDoctorSpeciality(widget + .appoList[index] + .doctorSpeciality) + .trim(), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: widget + .appoList[index] + .actualDoctorRate + .toDouble(), + size: 20.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ], + ), + Container( + child: CountdownTimer( + controller: new CountdownTimerController( + endTime: DateTime.now() + .millisecondsSinceEpoch + + (widget.appoList[index] + .remaniningHoursTocanPay * + 1000) * + 60), + widgetBuilder: + (_, CurrentRemainingTime time) { + return time != null + ? Text( + '${time.days}:${time.hours}:${time.min}:${time.sec} ' + + TranslationBase.of( + context) + .upcomingTimeLeft, + style: TextStyle( + fontSize: 12.0, + color: Color( + 0xff40ACC9))) + : Container(); + }, + ), + ), + ], + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => performNextAction( + widget.appoList[index]), + child: Container( + margin: EdgeInsets.only(top: 20.0), + child: Column( + children: [ + Image.asset( + getNextActionImage(widget + .appoList[index].nextAction), + width: 50.0, + height: 50.0), + Container( + margin: EdgeInsets.only(top: 5.0), + child: Text( + getNextActionText(widget + .appoList[index] + .nextAction), + textAlign: TextAlign.center, + style: + TextStyle(fontSize: 12.0)), + ) + ], + ), + ), + ), + ) + ], + ), + Divider( + color: Colors.grey[500], + ), + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 2, + child: Container( + child: Text( + getNextActionDescription( + widget.appoList[index].nextAction), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[700])), + ), + ), + Expanded( + flex: 1, + child: GestureDetector( + onTap: () { + navigateToAppointmentDetails( + context, widget.appoList[index]); + }, + child: Container( + child: Text( + TranslationBase.of(context) + .upcomingDetails, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 12.0, + color: new Color(0xFF40ACC9), + decoration: + TextDecoration.underline)), + ), + ), + ) + ], + ), + ], + ), + ), + ), + ); + }, + ), + ), + SizedBox( + height: 120.0, + ), + ], + ), + ), + ); + } + + String getNextActionImage(nextAction) { + switch (nextAction) { + case 0: + return "No Action"; + break; + case 10: + return "assets/images/new-design/confirm_button.png"; + break; + + case 15: + return widget.languageID == 'ar' + ? "assets/images/new-design/pay_online_button_arabic_disabled.png" + : "assets/images/new-design/pay_online_button_disabled.png"; + break; + + case 20: + return widget.languageID == 'ar' + ? "assets/images/new-design/pay_online_button_arabic.png" + : "assets/images/new-design/pay_online_button.png"; + break; + + case 30: + return "assets/images/new-design/qr_code_button.png"; + break; + + case 40: + return "assets/images/new-design/video_call_instruction.png"; + break; + + case 50: + return "assets/images/new-design/confirm_button.png"; + break; + + case 60: + return "assets/images/new-design/waiting_for_doctor.png"; + break; + + default: + return ""; + } + } + + performNextAction(AppoitmentAllHistoryResultList appo) { + switch (appo.nextAction) { + case 10: + confirmAppointment(appo); + break; + case 20: + getPatientShare(context, appo); + break; + case 30: + getAppoQR(context, appo); + break; + case 50: + confirmAppointment(appo); + break; + case 60: + break; + } + } + + String getNextActionText(nextAction) { + switch (nextAction) { + case 0: + return "No Action"; + break; + case 10: + return TranslationBase.of(context).confirm; + break; + + case 15: + return TranslationBase.of(context).pendingPayment; + break; + + case 20: + return TranslationBase.of(context).payNow; + break; + + case 30: + return TranslationBase.of(context).viewQR; + break; + + case 40: + return TranslationBase.of(context).instruction; + break; + + case 50: + return TranslationBase.of(context).confirmLiveCare; + break; + + case 60: + return TranslationBase.of(context).waitingForDoctor; + break; + + default: + return ""; + } + } + + String getNextActionDescription(nextAction) { + switch (nextAction) { + case 0: + return "No Action"; + break; + case 10: + return TranslationBase.of(context).upcomingConfirm; + break; + + case 15: + return TranslationBase.of(context).upcomingPaymentPending; + break; + + case 20: + return TranslationBase.of(context).upcomingPaymentNow; + break; + + case 30: + return TranslationBase.of(context).upcomingQR; + break; + + case 40: + return TranslationBase.of(context).upcomingVirtual; + break; + + case 50: + return TranslationBase.of(context).upcomingLivecare; + break; + + case 60: + return TranslationBase.of(context).waitingForDoctor; + break; + + default: + return ""; + } + } + + getLanguageID() async { + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + setState(() { + widget.languageID = languageID; + }); + } + + String getDate(String date) { + DateTime dateObj = DateUtil.convertStringToDate(date); + return DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString() + + " " + + dateObj.hour.toString() + + ":" + + getMinute(dateObj); + } + + String getMinute(DateTime dateObj) { + if (dateObj.minute == 0) { + return dateObj.minute.toString() + "0"; + } else { + return dateObj.minute.toString(); + } + } + + String getDoctorSpeciality(List docSpecial) { + String docSpeciality = ""; + docSpecial.forEach((v) { + docSpeciality = docSpeciality + v + "\n"; + }); + return docSpeciality; + } + + Future navigateToAppointmentDetails(context, appo) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AppointmentDetails(appo: appo))) + .then((value) { + getPatientAppointmentHistory(); + }); + } + + getPatientAppointmentHistory() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service.getPatientAppointmentHistory(true, context).then((res) { + widget.appoList.clear(); + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + setState(() { + if (res['AppoimentAllHistoryResultList'].length != 0) { + widget.appoList.clear(); + res['AppoimentAllHistoryResultList'].forEach((v) { + widget.appoList + .add(new AppoitmentAllHistoryResultList.fromJson(v)); + }); + } else { + Navigator.of(context).popAndPushNamed(HOME); + } + }); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + GifLoaderDialogUtils.hideDialog(context); + err != null ?? AppToast.showErrorToast(message: err); + }); + } + + getPatientShare(context, AppoitmentAllHistoryResultList appo) { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service + .getPatientShare(appo.appointmentNo.toString(), appo.clinicID, + appo.projectID, context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + widget.patientShareResponse = new PatientShareResponse.fromJson(res); + openPaymentDialog(appo, widget.patientShareResponse); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + getAppoQR(context, AppoitmentAllHistoryResultList appo) { + GifLoaderDialogUtils.showMyDialog(context); + PatientShareResponse patientShareResponse = new PatientShareResponse(); + + patientShareResponse.doctorNameObj = appo.doctorNameObj; + patientShareResponse.doctorSpeciality = appo.doctorSpeciality; + patientShareResponse.projectName = appo.projectName; + patientShareResponse.appointmentDate = appo.appointmentDate; + patientShareResponse.appointmentNo = appo.appointmentNo; + patientShareResponse.clinicID = appo.clinicID; + patientShareResponse.projectID = appo.projectID; + patientShareResponse.isFollowup = appo.isFollowup; + + DoctorsListService service = new DoctorsListService(); + service.generateAppointmentQR(patientShareResponse, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res); + navigateToQR(context, res['AppointmentQR'], patientShareResponse); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + Future navigateToQR( + context, String appoQR, PatientShareResponse patientShareResponse) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => QRCode( + patientShareResponse: patientShareResponse, + appoQR: appoQR, + ))).then((value) { + getPatientAppointmentHistory(); + }); + } + + openPaymentDialog(AppoitmentAllHistoryResultList appo, + PatientShareResponse patientShareResponse) { + showGeneralDialog( + barrierColor: Colors.black.withOpacity(0.5), + transitionBuilder: (context, a1, a2, widget) { + final curvedValue = + Curves.easeInOutBack.transform(a1.value) - 1.0; + return Transform( + transform: + Matrix4.translationValues(0.0, curvedValue * 200, 0.0), + child: Opacity( + opacity: a1.value, + child: PaymentDialog( + appo: appo, patientShareResponse: patientShareResponse), + ), + ); + }, + transitionDuration: Duration(milliseconds: 500), + barrierDismissible: false, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) {}) + .then((value) { + print(value); + + if (value != null) { + navigateToPaymentMethod(context, value, appo); + } + }); + } + + openPayment( + String paymentMethod, + AuthenticatedUser authenticatedUser, + double amount, + PatientShareResponse patientShareResponse, + AppoitmentAllHistoryResultList appo) { + widget.browser = new MyInAppBrowser( + onExitCallback: onBrowserExit, + appo: appo, + onLoadStartCallback: onBrowserLoadStart); + + widget.browser.openPaymentBrowser( + amount, + "Appointment check in", + Utils.getAppointmentTransID( + appo.projectID, appo.clinicID, appo.appointmentNo), + appo.projectID.toString(), + authenticatedUser.emailAddress, + paymentMethod, + authenticatedUser.patientType, + authenticatedUser.firstName, + authenticatedUser.patientID, + authenticatedUser, + widget.browser); + } + + onBrowserLoadStart(String url) { + print("onBrowserLoadStart"); + print(url); + + MyInAppBrowser.successURLS.forEach((element) { + if (url.contains(element)) { + if (widget.browser.isOpened()) widget.browser.close(); + MyInAppBrowser.isPaymentDone = true; + return; + } + }); + + MyInAppBrowser.errorURLS.forEach((element) { + if (url.contains(element)) { + if (widget.browser.isOpened()) widget.browser.close(); + MyInAppBrowser.isPaymentDone = false; + return; + } + }); + } + + onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { + print("onBrowserExit Called!!!!"); + if (isPaymentMade) checkPaymentStatus(appo); + } + + checkPaymentStatus(AppoitmentAllHistoryResultList appo) { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service + .checkPaymentStatus( + Utils.getAppointmentTransID( + appo.projectID, appo.clinicID, appo.appointmentNo), + context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + String paymentInfo = res['Response_Message']; + if (paymentInfo == 'Success') { + createAdvancePayment(res, appo); + } else { + AppToast.showErrorToast(message: res['Response_Message']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + String paymentReference = res['Fort_id'].toString(); + service + .createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], + res['Fort_id'], res['PaymentMethod'], context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); + addAdvancedNumberRequest( + res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), + paymentReference, + appo.appointmentNo.toString(), + appo); + }).catchError((err) { + print(err); + GifLoaderDialogUtils.hideDialog(context); + }); + } + + addAdvancedNumberRequest(String advanceNumber, String paymentReference, + String appointmentID, AppoitmentAllHistoryResultList appo) { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service + .addAdvancedNumberRequest( + advanceNumber, paymentReference, appointmentID, context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res); + getAppoQR(context, appo); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + getPatientData() async { + AppSharedPreferences sharedPref = AppSharedPreferences(); + if (await sharedPref.getObject(USER_PROFILE) != null) { + var data = + AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + setState(() { + print(data); + authUser = data; + }); + getPatientAppointmentHistory(); + } + } + + Future navigateToPaymentMethod( + context, + PatientShareResponse patientShareResponse, + AppoitmentAllHistoryResultList appo) async { + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + setState(() { + authUser = data; + }); + } + + Navigator.push( + context, MaterialPageRoute(builder: (context) => PaymentMethod())) + .then((value) { + print(value); + getPatientAppointmentHistory(); + + if (value != null) { + openPayment( + value, + authUser, + double.parse(patientShareResponse.patientShareWithTax.toString()), + patientShareResponse, + appo); + } + }); + } + + confirmAppointment(AppoitmentAllHistoryResultList appo) { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service + .confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID, + appo.isLiveCareAppointment, context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + if (appo.isLiveCareAppointment) { + insertLiveCareVIDARequest(appo); + } else { + getPatientAppointmentHistory(); + } + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service + .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, + appo.serviceID, appo.doctorID, context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + getPatientAppointmentHistory(); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + GifLoaderDialogUtils.hideDialog(context); + }); + } +} diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart new file mode 100644 index 00000000..3a0734dc --- /dev/null +++ b/lib/pages/ToDoList/payment_method_select.dart @@ -0,0 +1,244 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class PaymentMethod extends StatefulWidget { + @override + _PaymentMethodState createState() => _PaymentMethodState(); +} + +class _PaymentMethodState extends State { + String selectedPaymentMethod = "MADA"; + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).paymentMethod, + isShowAppBar: true, + body: Container( + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + child: SingleChildScrollView( + child: Container( + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0), + alignment: Alignment.center, + child: Text("Select Payment Method", + style: TextStyle( + fontSize: 26.0, fontWeight: FontWeight.bold)), + ), + Container( + margin: EdgeInsets.only(top: 25.0), + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: Container( + child: InkWell( + onTap: () { + updateSelectedPaymentMethod("MADA"); + }, + child: Card( + elevation: 3.0, + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: selectedPaymentMethod == "MADA" + ? BorderSide( + color: Colors.green, width: 5.0) + : BorderSide( + color: Colors.transparent, width: 0.0), + ), + child: Container( + height: 120.0, + padding: EdgeInsets.all(7.0), + width: MediaQuery.of(context).size.width * 0.45, + child: Image.asset( + "assets/images/new-design/mada.png"), + ), + ), + ), + ), + ), + Expanded( + child: Container( + child: InkWell( + onTap: () { + updateSelectedPaymentMethod("VISA"); + }, + child: Card( + elevation: 3.0, + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: selectedPaymentMethod == "VISA" + ? BorderSide( + color: Colors.green, width: 5.0) + : BorderSide( + color: Colors.transparent, width: 0.0), + ), + child: Container( + height: 120.0, + padding: EdgeInsets.all(7.0), + width: MediaQuery.of(context).size.width * 0.45, + child: Image.asset( + "assets/images/new-design/visa.png"), + ), + ), + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 25.0), + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: Container( + child: InkWell( + onTap: () { + updateSelectedPaymentMethod("MASTERCARD"); + }, + child: Card( + elevation: 3.0, + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: selectedPaymentMethod == "MASTERCARD" + ? BorderSide( + color: Colors.green, width: 5.0) + : BorderSide( + color: Colors.transparent, width: 0.0), + ), + child: Container( + height: 120.0, + padding: EdgeInsets.all(7.0), + width: MediaQuery.of(context).size.width * 0.45, + child: Image.asset( + "assets/images/new-design/mastercard.png"), + ), + ), + ), + ), + ), + Expanded( + child: Container( + child: InkWell( + onTap: () { + updateSelectedPaymentMethod("Installment"); + }, + child: Card( + elevation: 3.0, + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: selectedPaymentMethod == "Installment" + ? BorderSide( + color: Colors.green, width: 5.0) + : BorderSide( + color: Colors.transparent, width: 0.0), + ), + child: Container( + height: 120.0, + padding: EdgeInsets.all(7.0), + width: MediaQuery.of(context).size.width * 0.45, + child: Image.asset( + "assets/images/new-design/installment.png"), + ), + ), + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 25.0), + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: Container( + child: InkWell( + onTap: () { + updateSelectedPaymentMethod("ApplePay"); + }, + child: Card( + elevation: 3.0, + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: selectedPaymentMethod == "ApplePay" + ? BorderSide( + color: Colors.green, width: 5.0) + : BorderSide( + color: Colors.transparent, width: 0.0), + ), + child: Container( + height: 120.0, + padding: EdgeInsets.all(20.0), + child: SvgPicture.asset( + "assets/images/new-design/applepay.svg"), + ), + ), + ), + ), + ), + Expanded( + child: Container(), + ), + ], + ), + ), + SizedBox( + height: 150.0, + ), + ], + ), + ), + ), + ), + bottomSheet: Container( + width: MediaQuery.of(context).size.width, + height: 50.0, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.height * 0.1, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + Navigator.pop(context, selectedPaymentMethod); + }, + child: Text(TranslationBase.of(context).confirm, + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ); + } + + updateSelectedPaymentMethod(String selectedMethod) { + setState(() { + selectedPaymentMethod = selectedMethod; + }); + } +} diff --git a/lib/pages/ToDoList/widgets/paymentDialog.dart b/lib/pages/ToDoList/widgets/paymentDialog.dart new file mode 100644 index 00000000..7c461815 --- /dev/null +++ b/lib/pages/ToDoList/widgets/paymentDialog.dart @@ -0,0 +1,227 @@ +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; + +class PaymentDialog extends StatefulWidget { + AppoitmentAllHistoryResultList appo; + PatientShareResponse patientShareResponse; + + final Function onPaymentMethodSelected; + + PaymentDialog({@required this.appo, @required this.onPaymentMethodSelected, this.patientShareResponse}); + + @override + _PaymentDialogState createState() => _PaymentDialogState(); +} + +class _PaymentDialogState extends State { + @override + Widget build(BuildContext context) { + return Container( + child: Dialog( + shape: + RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)), + child: Container( + height: 550.0, + width: 450.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), + child: Text("Invoice Detail", + style: TextStyle( + fontSize: 25.0, + fontWeight: FontWeight.bold, + fontFamily: "Open-Sans-Bold")), + ), + Divider( + color: Colors.grey, + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), + child: Text("Appointment Details", + style: TextStyle( + fontSize: 15.0, + fontWeight: FontWeight.bold, + fontFamily: "Open-Sans-Bold")), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), + child: Text( + widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, + style: TextStyle( + color: Colors.grey[700], + fontSize: 15.0, + fontWeight: FontWeight.bold, + fontFamily: "Open-Sans-Bold")), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), + child: Text(getDate(widget.appo.appointmentDate), + style: getTextStyle()), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), + child: Text(widget.appo.projectName, style: getTextStyle()), + ), + Divider( + color: Colors.grey, + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 5.0), + child: Table( + children: [ + TableRow(children: [ + TableCell( + child: _getNormalText( + TranslationBase.of(context).patientShareToDo)), + TableCell( + child: _getNormalText(widget + .patientShareResponse.patientShare + .toString())), + ]), + TableRow(children: [ + TableCell( + child: _getNormalText( + TranslationBase.of(context).patientTaxToDo)), + TableCell( + child: _getNormalText(widget + .patientShareResponse.patientTaxAmount + .toString())), + ]), + TableRow(children: [ + TableCell( + child: _getNormalText(TranslationBase.of(context) + .patientShareTotalToDo)), + TableCell( + child: _getNormalText(widget + .patientShareResponse.patientShareWithTax + .toString())), + ]), + ], + ), + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), + child: Text("You can pay by following options: ", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + fontFamily: "Open-Sans")), + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 5.0), + child: Image.asset( + "assets/images/new-design/payment_options_invoice_confirmation.png", + width: 300), + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 15.0), + child: Text( + "Are You Sure You Want To Make payment for this Appointment?", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 14.0, + color: Colors.red[700], + fontFamily: "Open-Sans")), + ), + Divider( + color: Colors.grey, + ), + Container( + alignment: Alignment.center, + height: 40.0, + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: InkWell( + onTap: () { + Navigator.pop(context, null); + }, + child: Container( + child: Text("Cancel", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 18.0, color: Colors.red[700])), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + Navigator.pop(context, widget.patientShareResponse); +// widget.onPaymentMethodSelected(); + }, + child: Container( + child: Text("Ok", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 18.0, + )), + ), + ), + ), + ], + ), + ), + ]), + ), + ), + ); + } + + _getNormalText(text) { + return Container( + margin: EdgeInsets.only(top: 10.0, right: 10.0), + child: Text(text, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 15, + fontFamily: 'Open-Sans', + letterSpacing: 0.5, + color: Colors.grey[700])), + ); + } + + TextStyle getTextStyle() { + return TextStyle( + color: Colors.grey[700], fontSize: 15.0, fontFamily: "Open-Sans-Bold"); + } + +// Future navigateToPaymentMethod(context) async { +// Navigator.push( +// context, MaterialPageRoute(builder: (context) => PaymentMethod())); +// } + + String getDate(String date) { + DateTime dateObj = DateUtil.convertStringToDate(date); + return DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString() + + " " + + dateObj.hour.toString() + + ":" + + getMinute(dateObj); + } + + String getMinute(DateTime dateObj) { + if (dateObj.minute == 0) { + return dateObj.minute.toString() + "0"; + } else { + return dateObj.minute.toString(); + } + } +} diff --git a/lib/pages/ToDoList/widgets/upcomingCard.dart b/lib/pages/ToDoList/widgets/upcomingCard.dart new file mode 100644 index 00000000..04930e59 --- /dev/null +++ b/lib/pages/ToDoList/widgets/upcomingCard.dart @@ -0,0 +1,356 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:rating_bar/rating_bar.dart'; + +class TodoListCard extends StatefulWidget { + AppoitmentAllHistoryResultList appo; + var languageID; + final VoidCallback onListUpdated; + + TodoListCard({@required this.appo, this.onListUpdated}); + + @override + _TodoListCardState createState() => _TodoListCardState(); +} + +class _TodoListCardState extends State { + AppSharedPreferences sharedPref = AppSharedPreferences(); + + @override + void initState() { +// widget.onListUpdated(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.all(10.0), + child: Card( + margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Row( + children: [ + Image.asset("assets/images/new-design/time_icon.png", + width: 20.0, height: 20.0), + Container( + margin: EdgeInsets.only(left: 10.0, right: 30.0), + child: Text(getDate(widget.appo.appointmentDate), + style: TextStyle(fontSize: 12.0)), + ), + widget.appo.isLiveCareAppointment + ? SvgPicture.asset( + "assets/images/new-design/liveCare_logo_icon.svg", + width: 20.0, + height: 20.0) + : Image.asset( + "assets/images/new-design/hospital_address_icon.png", + width: 20.0, + height: 20.0), + Container( + margin: EdgeInsets.only(left: 10.0, right: 10.0), + child: widget.appo.isLiveCareAppointment + ? Text(TranslationBase.of(context).upcomingLivecare, + style: TextStyle(fontSize: 12.0)) + : Text(widget.appo.projectName, + style: TextStyle(fontSize: 12.0)), + ), + ], + ), + Container( + margin: EdgeInsets.only(top: 5.0), + child: Divider( + color: Colors.grey[500], + ), + ), + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 1, + child: Container( + height: MediaQuery.of(context).size.height * 0.1, + margin: EdgeInsets.only(top: 5.0), + child: ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: Image.network(widget.appo.doctorImageURL, + fit: BoxFit.fill), + ), + ), + ), + Expanded( + flex: 3, + child: Container( + margin: + EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.appo.doctorTitle + + " " + + widget.appo.doctorNameObj, + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + fontWeight: FontWeight.bold, + letterSpacing: 1.0)), + Container( + margin: EdgeInsets.only(top: 3.0, bottom: 3.0), + child: Text( + getDoctorSpeciality( + widget.appo.doctorSpeciality) + .trim(), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: 4.0, + size: 20.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ], + ), + ], + ), + ), + ), + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.only(top: 20.0), + child: Column( + children: [ + Image.asset( + getNextActionImage(widget.appo.nextAction), + width: 50.0, + height: 50.0), + Container( + margin: EdgeInsets.only(top: 5.0), + child: Text( + getNextActionText(widget.appo.nextAction), + textAlign: TextAlign.center, + style: TextStyle(fontSize: 12.0)), + ) + ], + ), + ), + ) + ], + ), + Divider( + color: Colors.grey[500], + ), + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 2, + child: Container( + child: Text( + getNextActionDescription(widget.appo.nextAction), + style: TextStyle( + fontSize: 12.0, color: Colors.grey[700])), + ), + ), + Expanded( + flex: 1, + child: GestureDetector( + onTap: () { + navigateToAppointmentDetails(context); + }, + child: Container( + child: Text(TranslationBase.of(context).upcomingDetails, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 12.0, + color: new Color(0xFF40ACC9), + decoration: TextDecoration.underline)), + ), + ), + ) + ], + ) + ], + ), + ), + ), + ); + } + + String getNextActionImage(nextAction) { + switch (nextAction) { + case 0: + return "No Action"; + break; + case 10: + return "assets/images/new-design/confirm_button.png"; + break; + + case 15: + return widget.languageID == 'ar' + ? "assets/images/new-design/pay_online_button_arabic_disabled.png" + : "assets/images/new-design/pay_online_button_disabled.png"; + break; + + case 20: + return widget.languageID == 'ar' + ? "assets/images/new-design/pay_online_button_arabic.png" + : "assets/images/new-design/pay_online_button.png"; + break; + + case 30: + return "assets/images/new-design/qr_code_button.png"; + break; + + case 40: + return "assets/images/new-design/video_call_instruction.png"; + break; + + case 50: + return "assets/images/new-design/liveCare_logo_icon.png"; + break; + + default: + return ""; + } + } + + String getNextActionText(nextAction) { + switch (nextAction) { + case 0: + return "No Action"; + break; + case 10: + return TranslationBase.of(context).confirm; + break; + + case 15: + return TranslationBase.of(context).pendingPayment; + break; + + case 20: + return TranslationBase.of(context).payNow; + break; + + case 30: + return TranslationBase.of(context).viewQR; + break; + + case 40: + return TranslationBase.of(context).instruction; + break; + + case 50: + return TranslationBase.of(context).livecare; + break; + + default: + return ""; + } + } + + String getNextActionDescription(nextAction) { + switch (nextAction) { + case 0: + return "No Action"; + break; + case 10: + return TranslationBase.of(context).upcomingConfirm; + break; + + case 15: + return TranslationBase.of(context).upcomingPaymentPending; + break; + + case 20: + return TranslationBase.of(context).upcomingPaymentNow; + break; + + case 30: + return TranslationBase.of(context).upcomingQR; + break; + + case 40: + return TranslationBase.of(context).upcomingVirtual; + break; + + case 50: + return TranslationBase.of(context).upcomingLivecare; + break; + + default: + return ""; + } + } + + getLanguageID() async { + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + setState(() { + widget.languageID = languageID; + }); + } + + String getDate(String date) { + DateTime dateObj = DateUtil.convertStringToDate(date); + return DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString() + + " " + + dateObj.hour.toString() + + ":" + + getMinute(dateObj); + } + + String getMinute(DateTime dateObj) { + if (dateObj.minute == 0) { + return dateObj.minute.toString() + "0"; + } else { + return dateObj.minute.toString(); + } + } + + String getDoctorSpeciality(List docSpecial) { + String docSpeciality = ""; + docSpecial.forEach((v) { + docSpeciality = docSpeciality + v + "\n"; + }); + return docSpeciality; + } + + Future navigateToAppointmentDetails(context) async { + Navigator.push( + context, MaterialPageRoute(builder: (context) => AppointmentDetails())); + } +} diff --git a/lib/pages/base/base_view.dart b/lib/pages/base/base_view.dart new file mode 100644 index 00000000..5977e97e --- /dev/null +++ b/lib/pages/base/base_view.dart @@ -0,0 +1,66 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../../locator.dart'; + +AppSharedPreferences sharedPref = AppSharedPreferences(); + +class BaseView extends StatefulWidget { + final Widget Function(BuildContext context, T model, Widget child) builder; + final Function(T) onModelReady; + final bool allowAny; + + BaseView({ + this.builder, + this.onModelReady, + this.allowAny = false, + }); + + @override + _BaseViewState createState() => _BaseViewState(); +} + +class _BaseViewState extends State> { + T model = locator(); + AuthenticatedUserObject authenticatedUserObject = + locator(); + bool isLogin = false; + + @override + void initState() { + if(widget.allowAny && widget.onModelReady != null){ + widget.onModelReady(model); + } + else if (widget.onModelReady != null && Provider.of(context, listen: false).isLogin) { + widget.onModelReady(model); + } + super.initState(); + } + + getUser() async { + var userData = await sharedPref.getObject(USER_PROFILE); + this.isLogin = userData != null; + } + + @override + Widget build(BuildContext context) { + return ChangeNotifierProvider( + create: (BuildContext context) => model, + child: Consumer(builder: widget.builder), + ); + } + + @override + void dispose() { + if (model != null) { + model = null; + } + + super.dispose(); + } +} diff --git a/lib/pages/conference/clipped_video.dart b/lib/pages/conference/clipped_video.dart new file mode 100644 index 00000000..1c01c27c --- /dev/null +++ b/lib/pages/conference/clipped_video.dart @@ -0,0 +1,37 @@ +import 'package:flutter/material.dart'; + +class ClippedVideo extends StatefulWidget { + final double width; + final double height; + final Widget child; + + const ClippedVideo({ + Key key, + @required this.width, + @required this.height, + @required this.child, + }) : super(key: key); + + @override + _ClippedVideoState createState() => _ClippedVideoState(); +} + +class _ClippedVideoState extends State { + @override + Widget build(BuildContext context) { + return Container( + width: widget.width, + height: widget.height, + decoration: BoxDecoration( + borderRadius: const BorderRadius.all(Radius.circular(20)), + border: Border.all( + color: Colors.white24, + ), + ), + child: ClipRRect( + child: widget.child, + borderRadius: const BorderRadius.all(Radius.circular(20)), + ), + ); + } +} diff --git a/lib/pages/conference/conference_button_bar.dart b/lib/pages/conference/conference_button_bar.dart new file mode 100644 index 00000000..d49c4e4a --- /dev/null +++ b/lib/pages/conference/conference_button_bar.dart @@ -0,0 +1,238 @@ +import 'dart:async'; + +import 'package:after_layout/after_layout.dart'; +import 'package:diplomaticquarterapp/pages/conference/widgets/circle_button.dart'; +import 'package:flutter/material.dart'; + +class ConferenceButtonBar extends StatefulWidget { + final VoidCallback onVideoEnabled; + final VoidCallback onAudioEnabled; + final VoidCallback onHangup; + final VoidCallback onSwitchCamera; + final VoidCallback onPersonAdd; + final VoidCallback onPersonRemove; + final void Function(double) onHeight; + final VoidCallback onHide; + final VoidCallback onShow; + final Stream videoEnabled; + final Stream audioEnabled; + + const ConferenceButtonBar({ + Key key, + this.onVideoEnabled, + this.onAudioEnabled, + this.onHangup, + this.onSwitchCamera, + this.onPersonAdd, + this.onPersonRemove, + @required this.videoEnabled, + @required this.audioEnabled, + this.onHeight, + this.onHide, + this.onShow, + }) : assert(videoEnabled != null), + assert(audioEnabled != null), + super(key: key); + + @override + _ConferenceButtonBarState createState() => _ConferenceButtonBarState(); +} + +class _ConferenceButtonBarState extends State with AfterLayoutMixin { + var _bottom = -100.0; + Timer _timer; + int _remaining; + var _videoEnabled = true; + var _audioEnabled = true; + double _hidden; + double _visible; + final _keyButtonBarHeight = GlobalKey(); + + final Duration timeout = const Duration(seconds: 5); + final Duration ms = const Duration(milliseconds: 1); + final Duration periodicDuration = const Duration(milliseconds: 100); + + Timer startTimeout([int milliseconds]) { + final duration = milliseconds == null ? timeout : ms * milliseconds; + _remaining = duration.inMilliseconds; + return Timer.periodic(periodicDuration, (Timer timer) { + _remaining -= periodicDuration.inMilliseconds; + if (_remaining <= 0) { + timer.cancel(); + _toggleBar(); + } + }); + } + + void _pauseTimer() { + if (_timer == null) { + return; + } + _timer.cancel(); + _timer = null; + } + + void _resumeTimer() { + // resume the timer only when there is no timer active or when + // the bar is not already hidden. + if ((_timer != null && _timer.isActive) || _bottom == _hidden) { + return; + } + _timer = startTimeout(_remaining); + } + + void _toggleBar() { + setState(() { + _bottom = _bottom == _visible ? _hidden : _visible; + if (_bottom == _visible && widget.onShow != null) { + widget.onShow(); + } + if (_bottom == _hidden && widget.onHide != null) { + widget.onHide(); + } + }); + } + + void _toggleBarOnEnd() { + if (_timer != null) { + if (_timer.isActive) { + _timer.cancel(); + } + _timer = null; + } + if (_bottom == 0) { + _timer = startTimeout(); + } + } + + @override + void initState() { + super.initState(); + _timer = startTimeout(); + } + + @override + void didChangeDependencies() { + _visible = MediaQuery.of(context).viewPadding.bottom; + super.didChangeDependencies(); + } + + @override + void afterFirstLayout(BuildContext context) { + final RenderBox renderBoxButtonBar = _keyButtonBarHeight.currentContext.findRenderObject(); + final heightButtonBar = renderBoxButtonBar.size.height; + // Because the `didChangeDependencies` fires before the `afterFirstLayout`, we can use the `_visible` property here. + _hidden = -(heightButtonBar + _visible); + widget.onHeight(heightButtonBar); + _toggleBar(); + } + + @override + void dispose() { + super.dispose(); + if (_timer != null && _timer.isActive) { + _timer.cancel(); + _timer = null; + } + } + + @override + Widget build(BuildContext context) { + return Positioned( + top: 0, + left: 0, + right: 0, + bottom: 0, + child: GestureDetector( + key: Key('show-hide-button-bar-gesture'), + behavior: HitTestBehavior.translucent, + onTapDown: (_) => _pauseTimer(), + onTapUp: (_) => _toggleBar(), + onTapCancel: () => _resumeTimer(), + child: Stack( + children: [ + AnimatedPositioned( + key: Key('button-bar'), + bottom: _bottom, + left: 0, + right: 0, + duration: const Duration(milliseconds: 300), + curve: Curves.linear, + child: _buildRow(context), + onEnd: _toggleBarOnEnd, + ), + ], + ), + ), + ); + } + + void _onPressed(VoidCallback callback) { + if (callback != null) { + callback(); + } + if (_timer != null && _timer.isActive) { + _timer.cancel(); + } + _timer = startTimeout(); + } + + Widget _buildRow(BuildContext context) { + return Padding( + key: _keyButtonBarHeight, + padding: const EdgeInsets.only(bottom: 8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + CircleButton( + child: StreamBuilder( + stream: widget.videoEnabled, + initialData: _videoEnabled, + builder: (context, snapshot) { + _videoEnabled = snapshot.data; + return Icon( + _videoEnabled ? Icons.videocam : Icons.videocam_off, + color: Colors.white, + ); + }), + key: Key('camera-button'), + onPressed: () => _onPressed(widget.onVideoEnabled), + ), + CircleButton( + child: StreamBuilder( + stream: widget.audioEnabled, + initialData: _audioEnabled, + builder: (context, snapshot) { + _audioEnabled = snapshot.data; + return Icon( + _audioEnabled ? Icons.mic : Icons.mic_off, + color: Colors.white, + ); + }), + key: Key('microphone-button'), + onPressed: () => _onPressed(widget.onAudioEnabled), + ), + CircleButton( + child: const Icon(Icons.switch_camera, color: Colors.white), + key: Key('switch-camera-button'), + onPressed: () => _onPressed(widget.onSwitchCamera), + ), + CircleButton( + radius: 35, + child: const RotationTransition( + turns: AlwaysStoppedAnimation(135 / 360), + child: Icon( + Icons.phone, + color: Colors.white, + size: 40, + ), + ), + color: Colors.red.withAlpha(200), + key: Key('hangup-button'), + onPressed: () => _onPressed(widget.onHangup), + ), + ], + ), + ); + } +} diff --git a/lib/pages/conference/conference_page.dart b/lib/pages/conference/conference_page.dart new file mode 100644 index 00000000..7848d4f7 --- /dev/null +++ b/lib/pages/conference/conference_page.dart @@ -0,0 +1,388 @@ +import 'dart:async'; + +import 'package:diplomaticquarterapp/models/LiveCare/room_model.dart'; +import 'package:diplomaticquarterapp/pages/conference/conference_button_bar.dart'; +import 'package:diplomaticquarterapp/pages/conference/conference_room.dart'; +import 'package:diplomaticquarterapp/pages/conference/draggable_publisher.dart'; +import 'package:diplomaticquarterapp/pages/conference/participant_widget.dart'; +import 'package:diplomaticquarterapp/pages/conference/widgets/noise_box.dart'; +import 'package:diplomaticquarterapp/pages/conference/widgets/platform_alert_dialog.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:wakelock/wakelock.dart'; + +class ConferencePage extends StatefulWidget { + final RoomModel roomModel; + + const ConferencePage({Key key, this.roomModel}) : super(key: key); + + @override + _ConferencePageState createState() => _ConferencePageState(); +} + +class _ConferencePageState extends State { + final StreamController _onButtonBarVisibleStreamController = StreamController.broadcast(); + final StreamController _onButtonBarHeightStreamController = StreamController.broadcast(); + ConferenceRoom _conferenceRoom; + StreamSubscription _onConferenceRoomException; + + @override + void initState() { + super.initState(); + _lockInPortrait(); + _connectToRoom(); + _wakeLock(true); + } + + void _connectToRoom() async { + try { + final conferenceRoom = ConferenceRoom( + name: widget.roomModel.name, + token: widget.roomModel.token, + identity: widget.roomModel.identity, + ); + await conferenceRoom.connect(); + setState(() { + _conferenceRoom = conferenceRoom; + _onConferenceRoomException = _conferenceRoom.onException.listen((err) async { + await PlatformAlertDialog( + title: err is PlatformException ? err.message : 'An error occured', + content: err is PlatformException ? err.details : err.toString(), + defaultActionText: 'OK', + ).show(context); + }); + _conferenceRoom.addListener(_conferenceRoomUpdated); + }); + } catch (err) { + print(err); + await PlatformAlertDialog( + title: err is PlatformException ? err.message : 'An error occured', + content: err is PlatformException ? err.details : err.toString(), + defaultActionText: 'OK', + ).show(context); + + Navigator.of(context).pop(); + } + } + + Future _lockInPortrait() async { + await SystemChrome.setPreferredOrientations([ + DeviceOrientation.portraitUp, + DeviceOrientation.portraitDown, + ]); + } + + @override + void dispose() { + _freePortraitLock(); + _wakeLock(false); + _disposeStreamsAndSubscriptions(); + if (_conferenceRoom != null) _conferenceRoom.removeListener(_conferenceRoomUpdated); + super.dispose(); + } + + Future _freePortraitLock() async { + await SystemChrome.setPreferredOrientations([ + DeviceOrientation.landscapeRight, + DeviceOrientation.landscapeLeft, + DeviceOrientation.portraitUp, + DeviceOrientation.portraitDown, + ]); + } + + Future _disposeStreamsAndSubscriptions() async { + if (_onButtonBarVisibleStreamController != null) await _onButtonBarVisibleStreamController.close(); + if (_onButtonBarHeightStreamController != null) await _onButtonBarHeightStreamController.close(); + if (_onConferenceRoomException != null) await _onConferenceRoomException.cancel(); + } + + @override + Widget build(BuildContext context) { + return WillPopScope( + onWillPop: () async => false, + child: Scaffold( + backgroundColor: Colors.black, + body: _conferenceRoom == null ? showProgress() : buildLayout(), + ), + ); + } + + LayoutBuilder buildLayout() { + return LayoutBuilder( + builder: (BuildContext context, BoxConstraints constraints) { + return Stack( + children: [ + _buildParticipants(context, constraints.biggest, _conferenceRoom), + ConferenceButtonBar( + audioEnabled: _conferenceRoom.onAudioEnabled, + videoEnabled: _conferenceRoom.onVideoEnabled, + onAudioEnabled: _conferenceRoom.toggleAudioEnabled, + onVideoEnabled: _conferenceRoom.toggleVideoEnabled, + onHangup: _onHangup, + onSwitchCamera: _conferenceRoom.switchCamera, + onPersonAdd: _onPersonAdd, + onPersonRemove: _onPersonRemove, + onHeight: _onHeightBar, + onShow: _onShowBar, + onHide: _onHideBar, + ), + ], + ); + }, + ); + } + + Widget showProgress() { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center(child: CircularProgressIndicator()), + SizedBox( + height: 10, + ), + Text( + 'Connecting to the call...', + style: TextStyle(color: Colors.white), + ), + ], + ); + } + + Future _onHangup() async { + print('onHangup'); + await _conferenceRoom.disconnect(); + Navigator.of(context).pop(); + } + + void _onPersonAdd() { + print('onPersonAdd'); + try { + _conferenceRoom.addDummy( + child: Stack( + children: [ + const Placeholder(), + Center( + child: Text( + (_conferenceRoom.participants.length + 1).toString(), + style: const TextStyle( + shadows: [ + Shadow( + blurRadius: 3.0, + color: Color.fromARGB(255, 0, 0, 0), + ), + Shadow( + blurRadius: 8.0, + color: Color.fromARGB(255, 255, 255, 255), + ), + ], + fontSize: 80, + ), + ), + ), + ], + ), + ); + } on PlatformException catch (err) { + PlatformAlertDialog( + title: err.message, + content: err.details, + defaultActionText: 'OK', + ).show(context); + } + } + + void _onPersonRemove() { + print('onPersonRemove'); + _conferenceRoom.removeDummy(); + } + + Widget _buildParticipants(BuildContext context, Size size, ConferenceRoom conferenceRoom) { + final children = []; + final length = conferenceRoom.participants.length; + + if (length <= 2) { + _buildOverlayLayout(context, size, children); + return Stack(children: children); + } + + void buildInCols(bool removeLocalBeforeChunking, bool moveLastOfEachRowToNextRow, int columns) { + _buildLayoutInGrid( + context, + size, + children, + removeLocalBeforeChunking: removeLocalBeforeChunking, + moveLastOfEachRowToNextRow: moveLastOfEachRowToNextRow, + columns: columns, + ); + } + +// if (length <= 3) { +// buildInCols(true, false, 1); +// } else if (length == 5) { +// buildInCols(false, true, 2); +// } else if (length <= 6 || length == 8) { +// buildInCols(false, false, 2); +// } else if (length == 7 || length == 9) { +// buildInCols(true, false, 2); +// } else if (length == 10) { +// buildInCols(false, true, 3); +// } else if (length == 13 || length == 16) { +// buildInCols(true, false, 3); +// } else if (length <= 18) { +// buildInCols(false, false, 3); +// } + + return Column( + children: children, + ); + } + + void _buildOverlayLayout(BuildContext context, Size size, List children) { + final participants = _conferenceRoom.participants; + if (participants.length == 1) { + children.add(_buildNoiseBox()); + } else { + final remoteParticipant = participants.firstWhere((ParticipantWidget participant) => participant.isRemote, orElse: () => null); + if (remoteParticipant != null) { + children.add(remoteParticipant); + } + } + + final localParticipant = participants.firstWhere((ParticipantWidget participant) => !participant.isRemote, orElse: () => null); + if (localParticipant != null) { + children.add(DraggablePublisher( + key: Key('publisher'), + child: localParticipant, + availableScreenSize: size, + onButtonBarVisible: _onButtonBarVisibleStreamController.stream, + onButtonBarHeight: _onButtonBarHeightStreamController.stream, + )); + } + } + + void _buildLayoutInGrid( + BuildContext context, + Size size, + List children, { + bool removeLocalBeforeChunking = false, + bool moveLastOfEachRowToNextRow = false, + int columns = 2, + }) { + final participants = _conferenceRoom.participants; + ParticipantWidget localParticipant; + if (removeLocalBeforeChunking) { + localParticipant = participants.firstWhere((ParticipantWidget participant) => !participant.isRemote, orElse: () => null); + if (localParticipant != null) { + participants.remove(localParticipant); + } + } + final chunkedParticipants = chunk(array: participants, size: columns); + if (localParticipant != null) { + chunkedParticipants.last.add(localParticipant); + participants.add(localParticipant); + } + + if (moveLastOfEachRowToNextRow) { + for (var i = 0; i < chunkedParticipants.length - 1; i++) { + var participant = chunkedParticipants[i].removeLast(); + chunkedParticipants[i + 1].insert(0, participant); + } + } + + for (final participantChunk in chunkedParticipants) { + final rowChildren = []; + for (final participant in participantChunk) { + rowChildren.add( + Container( + width: size.width / participantChunk.length, + height: size.height / chunkedParticipants.length, + child: participant, + ), + ); + } + children.add( + Container( + height: size.height / chunkedParticipants.length, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: rowChildren, + ), + ), + ); + } + } + + NoiseBox _buildNoiseBox() { + return NoiseBox( + density: NoiseBoxDensity.xLow, + backgroundColor: Colors.grey.shade900, + child: Center( + child: Container( + color: Colors.black54, + width: double.infinity, + height: 40, + child: Center( + child: Text( + 'Waiting for another participant to connect to the call...', + key: Key('text-wait'), + textAlign: TextAlign.center, + style: TextStyle(color: Colors.white), + ), + ), + ), + ), + ); + } + + List> chunk({@required List array, @required int size}) { + final result = >[]; + if (array.isEmpty || size <= 0) { + return result; + } + var first = 0; + var last = size; + final totalLoop = array.length % size == 0 ? array.length ~/ size : array.length ~/ size + 1; + for (var i = 0; i < totalLoop; i++) { + if (last > array.length) { + result.add(array.sublist(first, array.length)); + } else { + result.add(array.sublist(first, last)); + } + first = last; + last = last + size; + } + return result; + } + + void _onHeightBar(double height) { + _onButtonBarHeightStreamController.add(height); + } + + void _onShowBar() { + setState(() { + SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom, SystemUiOverlay.top]); + }); + _onButtonBarVisibleStreamController.add(true); + } + + void _onHideBar() { + setState(() { + SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]); + }); + _onButtonBarVisibleStreamController.add(false); + } + + Future _wakeLock(bool enable) async { + try { + return await (enable ? Wakelock.enable() : Wakelock.disable()); + } catch (err) { + print('Unable to change the Wakelock and set it to $enable'); + print(err); + } + } + + void _conferenceRoomUpdated() { + setState(() {}); + } +} diff --git a/lib/pages/conference/conference_room.dart b/lib/pages/conference/conference_room.dart new file mode 100644 index 00000000..9c8c1c9a --- /dev/null +++ b/lib/pages/conference/conference_room.dart @@ -0,0 +1,530 @@ +import 'dart:async'; +import 'dart:typed_data'; + +import 'package:diplomaticquarterapp/pages/conference/participant_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:twilio_programmable_video/twilio_programmable_video.dart'; + +class ConferenceRoom with ChangeNotifier { + final String name; + final String token; + final String identity; + + final StreamController _onAudioEnabledStreamController = StreamController.broadcast(); + Stream onAudioEnabled; + final StreamController _onVideoEnabledStreamController = StreamController.broadcast(); + Stream onVideoEnabled; + final StreamController _onExceptionStreamController = StreamController.broadcast(); + Stream onException; + + final Completer _completer = Completer(); + + final List _participants = []; + final List _participantBuffer = []; + final List _streamSubscriptions = []; + final List _dataTracks = []; + final List _messages = []; + + CameraCapturer _cameraCapturer; + Room _room; + Timer _timer; + + ConferenceRoom({ + @required this.name, + @required this.token, + @required this.identity, + }) { + onAudioEnabled = _onAudioEnabledStreamController.stream; + onVideoEnabled = _onVideoEnabledStreamController.stream; + onException = _onExceptionStreamController.stream; + } + + List get participants { + return [..._participants]; + } + + Future connect() async { + print('ConferenceRoom.connect()'); + try { + await TwilioProgrammableVideo.debug(dart: true, native: true); + await TwilioProgrammableVideo.setSpeakerphoneOn(true); + + _cameraCapturer = CameraCapturer(CameraSource.FRONT_CAMERA); + var connectOptions = ConnectOptions( + token, + roomName: name, + preferredAudioCodecs: [OpusCodec()], + audioTracks: [LocalAudioTrack(true)], + dataTracks: [LocalDataTrack()], + videoTracks: [LocalVideoTrack(true, _cameraCapturer)], + enableDominantSpeaker: true, + ); + + _room = await TwilioProgrammableVideo.connect(connectOptions); + + _streamSubscriptions.add(_room.onConnected.listen(_onConnected)); + _streamSubscriptions.add(_room.onConnectFailure.listen(_onConnectFailure)); + + return _completer.future; + } catch (err) { + print(err); + rethrow; + } + } + + Future disconnect() async { + print('ConferenceRoom.disconnect()'); + if (_timer != null) { + _timer.cancel(); + } + await _room.disconnect(); + } + + @override + void dispose() { + print('ConferenceRoom.dispose()'); + _disposeStreamsAndSubscriptions(); + super.dispose(); + } + + Future _disposeStreamsAndSubscriptions() async { + await _onAudioEnabledStreamController.close(); + await _onVideoEnabledStreamController.close(); + await _onExceptionStreamController.close(); + for (var streamSubscription in _streamSubscriptions) { + await streamSubscription.cancel(); + } + } + + Future sendMessage(String message) async { + final tracks = _room.localParticipant.localDataTracks; + final localDataTrack = tracks.isEmpty ? null : tracks[0].localDataTrack; + if (localDataTrack == null || _messages.isNotEmpty) { + print('ConferenceRoom.sendMessage => Track is not available yet, buffering message.'); + _messages.add(message); + return; + } + await localDataTrack.send(message); + } + + Future sendBufferMessage(ByteBuffer message) async { + final tracks = _room.localParticipant.localDataTracks; + final localDataTrack = tracks.isEmpty ? null : tracks[0].localDataTrack; + if (localDataTrack == null) { + return; + } + await localDataTrack.sendBuffer(message); + } + + Future toggleVideoEnabled() async { + final tracks = _room.localParticipant.localVideoTracks; + final localVideoTrack = tracks.isEmpty ? null : tracks[0].localVideoTrack; + if (localVideoTrack == null) { + print('ConferenceRoom.toggleVideoEnabled() => Track is not available yet!'); + return; + } + await localVideoTrack.enable(!localVideoTrack.isEnabled); + + var index = _participants.indexWhere((ParticipantWidget participant) => !participant.isRemote); + if (index < 0) { + return; + } + var participant = _participants[index]; + _participants.replaceRange( + index, + index + 1, + [ + participant.copyWith(videoEnabled: localVideoTrack.isEnabled), + ], + ); + print('ConferenceRoom.toggleVideoEnabled() => ${localVideoTrack.isEnabled}'); + _onVideoEnabledStreamController.add(localVideoTrack.isEnabled); + notifyListeners(); + } + + Future toggleAudioEnabled() async { + final tracks = _room.localParticipant.localAudioTracks; + final localAudioTrack = tracks.isEmpty ? null : tracks[0].localAudioTrack; + if (localAudioTrack == null) { + print('ConferenceRoom.toggleAudioEnabled() => Track is not available yet!'); + return; + } + await localAudioTrack.enable(!localAudioTrack.isEnabled); + + var index = _participants.indexWhere((ParticipantWidget participant) => !participant.isRemote); + if (index < 0) { + return; + } + var participant = _participants[index]; + _participants.replaceRange( + index, + index + 1, + [ + participant.copyWith(audioEnabled: localAudioTrack.isEnabled), + ], + ); + print('ConferenceRoom.toggleAudioEnabled() => ${localAudioTrack.isEnabled}'); + _onAudioEnabledStreamController.add(localAudioTrack.isEnabled); + notifyListeners(); + } + + Future switchCamera() async { + print('ConferenceRoom.switchCamera()'); + try { + await _cameraCapturer.switchCamera(); + } on FormatException catch (e) { + print( + 'ConferenceRoom.switchCamera() failed because of FormatException with message: ${e.message}', + ); + } + } + + void addDummy({Widget child}) { + print('ConferenceRoom.addDummy()'); + if (_participants.length >= 18) { + throw PlatformException( + code: 'ConferenceRoom.maximumReached', + message: 'Maximum reached', + details: 'Currently the lay-out can only render a maximum of 18 participants', + ); + } + _participants.insert( + 0, + ParticipantWidget( + id: (_participants.length + 1).toString(), + child: child, + isRemote: true, + audioEnabled: true, + videoEnabled: true, + isDummy: true, + ), + ); + notifyListeners(); + } + + void removeDummy() { + print('ConferenceRoom.removeDummy()'); + var dummy = _participants.firstWhere((participant) => participant.isDummy, orElse: () => null); + if (dummy != null) { + _participants.remove(dummy); + notifyListeners(); + } + } + + void _onConnected(Room room) { + print('ConferenceRoom._onConnected => state: ${room.state}'); + + // When connected for the first time, add remote participant listeners + _streamSubscriptions.add(_room.onParticipantConnected.listen(_onParticipantConnected)); + _streamSubscriptions.add(_room.onParticipantDisconnected.listen(_onParticipantDisconnected)); + _streamSubscriptions.add(_room.onDominantSpeakerChange.listen(_onDominantSpeakerChanged)); + // Only add ourselves when connected for the first time too. + _participants.add( + _buildParticipant( + child: room.localParticipant.localVideoTracks[0].localVideoTrack.widget(), + id: identity, + audioEnabled: true, + videoEnabled: true, + ), + ); + for (final remoteParticipant in room.remoteParticipants) { + var participant = _participants.firstWhere((participant) => participant.id == remoteParticipant.sid, orElse: () => null); + if (participant == null) { + print('Adding participant that was already present in the room ${remoteParticipant.sid}, before I connected'); + _addRemoteParticipantListeners(remoteParticipant); + } + } + // We have to listen for the [onDataTrackPublished] event on the [LocalParticipant] in + // order to be able to use the [send] method. + _streamSubscriptions.add(room.localParticipant.onDataTrackPublished.listen(_onLocalDataTrackPublished)); + notifyListeners(); + _completer.complete(room); + + _timer = Timer.periodic(const Duration(minutes: 1), (_) { + // Let's see if we can send some data over the DataTrack API + sendMessage('And another minute has passed since I connected...'); + // Also try the ByteBuffer way of sending data + final list = 'This data has been sent over the ByteBuffer channel of the DataTrack API'.codeUnits; + var bytes = Uint8List.fromList(list); + sendBufferMessage(bytes.buffer); + }); + } + + void _onLocalDataTrackPublished(LocalDataTrackPublishedEvent event) { + // Send buffered messages, if any... + while (_messages.isNotEmpty) { + var message = _messages.removeAt(0); + print('Sending buffered message: $message'); + event.localDataTrackPublication.localDataTrack.send(message); + } + } + + void _onConnectFailure(RoomConnectFailureEvent event) { + print('ConferenceRoom._onConnectFailure: ${event.exception}'); + _completer.completeError(event.exception); + } + + void _onDominantSpeakerChanged(DominantSpeakerChangedEvent event) { + print('ConferenceRoom._onDominantSpeakerChanged: ${event.remoteParticipant.identity}'); + var oldDominantParticipant = _participants.firstWhere((p) => p.isDominant, orElse: () => null); + if (oldDominantParticipant != null) { + var oldDominantParticipantIndex = _participants.indexOf(oldDominantParticipant); + _participants.replaceRange(oldDominantParticipantIndex, oldDominantParticipantIndex + 1, [oldDominantParticipant.copyWith(isDominant: false)]); + } + + var newDominantParticipant = _participants.firstWhere((p) => p.id == event.remoteParticipant.sid); + var newDominantParticipantIndex = _participants.indexOf(newDominantParticipant); + _participants.replaceRange(newDominantParticipantIndex, newDominantParticipantIndex + 1, [newDominantParticipant.copyWith(isDominant: true)]); + notifyListeners(); + } + + void _onParticipantConnected(RoomParticipantConnectedEvent event) { + print('ConferenceRoom._onParticipantConnected, ${event.remoteParticipant.sid}'); + _addRemoteParticipantListeners(event.remoteParticipant); + } + + void _onParticipantDisconnected(RoomParticipantDisconnectedEvent event) { + print('ConferenceRoom._onParticipantDisconnected: ${event.remoteParticipant.sid}'); + _participants.removeWhere((ParticipantWidget p) => p.id == event.remoteParticipant.sid); + notifyListeners(); + } + + ParticipantWidget _buildParticipant({ + @required Widget child, + @required String id, + @required bool audioEnabled, + @required bool videoEnabled, + RemoteParticipant remoteParticipant, + }) { + return ParticipantWidget( + id: remoteParticipant?.sid, + isRemote: remoteParticipant != null, + child: child, + audioEnabled: audioEnabled, + videoEnabled: videoEnabled, + ); + } + + void _addRemoteParticipantListeners(RemoteParticipant remoteParticipant) { + print('ConferenceRoom._addRemoteParticipantListeners() => Adding listeners to remoteParticipant ${remoteParticipant.sid}'); + _streamSubscriptions.add(remoteParticipant.onAudioTrackDisabled.listen(_onAudioTrackDisabled)); + _streamSubscriptions.add(remoteParticipant.onAudioTrackEnabled.listen(_onAudioTrackEnabled)); + _streamSubscriptions.add(remoteParticipant.onAudioTrackPublished.listen(_onAudioTrackPublished)); + _streamSubscriptions.add(remoteParticipant.onAudioTrackSubscribed.listen(_onAudioTrackSubscribed)); + _streamSubscriptions.add(remoteParticipant.onAudioTrackSubscriptionFailed.listen(_onAudioTrackSubscriptionFailed)); + _streamSubscriptions.add(remoteParticipant.onAudioTrackUnpublished.listen(_onAudioTrackUnpublished)); + _streamSubscriptions.add(remoteParticipant.onAudioTrackUnsubscribed.listen(_onAudioTrackUnsubscribed)); + + _streamSubscriptions.add(remoteParticipant.onDataTrackPublished.listen(_onDataTrackPublished)); + _streamSubscriptions.add(remoteParticipant.onDataTrackSubscribed.listen(_onDataTrackSubscribed)); + _streamSubscriptions.add(remoteParticipant.onDataTrackSubscriptionFailed.listen(_onDataTrackSubscriptionFailed)); + _streamSubscriptions.add(remoteParticipant.onDataTrackUnpublished.listen(_onDataTrackUnpublished)); + _streamSubscriptions.add(remoteParticipant.onDataTrackUnsubscribed.listen(_onDataTrackUnsubscribed)); + + _streamSubscriptions.add(remoteParticipant.onVideoTrackDisabled.listen(_onVideoTrackDisabled)); + _streamSubscriptions.add(remoteParticipant.onVideoTrackEnabled.listen(_onVideoTrackEnabled)); + _streamSubscriptions.add(remoteParticipant.onVideoTrackPublished.listen(_onVideoTrackPublished)); + _streamSubscriptions.add(remoteParticipant.onVideoTrackSubscribed.listen(_onVideoTrackSubscribed)); + _streamSubscriptions.add(remoteParticipant.onVideoTrackSubscriptionFailed.listen(_onVideoTrackSubscriptionFailed)); + _streamSubscriptions.add(remoteParticipant.onVideoTrackUnpublished.listen(_onVideoTrackUnpublished)); + _streamSubscriptions.add(remoteParticipant.onVideoTrackUnsubscribed.listen(_onVideoTrackUnsubscribed)); + } + + void _onAudioTrackDisabled(RemoteAudioTrackEvent event) { + print('ConferenceRoom._onAudioTrackDisabled(), ${event.remoteParticipant.sid}, ${event.remoteAudioTrackPublication.trackSid}, isEnabled: ${event.remoteAudioTrackPublication.isTrackEnabled}'); + _setRemoteAudioEnabled(event); + } + + void _onAudioTrackEnabled(RemoteAudioTrackEvent event) { + print('ConferenceRoom._onAudioTrackEnabled(), ${event.remoteParticipant.sid}, ${event.remoteAudioTrackPublication.trackSid}, isEnabled: ${event.remoteAudioTrackPublication.isTrackEnabled}'); + _setRemoteAudioEnabled(event); + } + + void _onAudioTrackPublished(RemoteAudioTrackEvent event) { + print('ConferenceRoom._onAudioTrackPublished(), ${event.remoteParticipant.sid}}'); + } + + void _onAudioTrackSubscribed(RemoteAudioTrackSubscriptionEvent event) { + print('ConferenceRoom._onAudioTrackSubscribed(), ${event.remoteParticipant.sid}, ${event.remoteAudioTrackPublication.trackSid}'); + _addOrUpdateParticipant(event); + } + + void _onAudioTrackSubscriptionFailed(RemoteAudioTrackSubscriptionFailedEvent event) { + print('ConferenceRoom._onAudioTrackSubscriptionFailed(), ${event.remoteParticipant.sid}, ${event.remoteAudioTrackPublication.trackSid}'); + _onExceptionStreamController.add( + PlatformException( + code: 'ConferenceRoom.audioTrackSubscriptionFailed', + message: 'AudioTrack Subscription Failed', + details: event.exception.toString(), + ), + ); + } + + void _onAudioTrackUnpublished(RemoteAudioTrackEvent event) { + print('ConferenceRoom._onAudioTrackUnpublished(), ${event.remoteParticipant.sid}, ${event.remoteAudioTrackPublication.trackSid}'); + } + + void _onAudioTrackUnsubscribed(RemoteAudioTrackSubscriptionEvent event) { + print('ConferenceRoom._onAudioTrackUnsubscribed(), ${event.remoteParticipant.sid}, ${event.remoteAudioTrack.sid}'); + } + + void _onDataTrackPublished(RemoteDataTrackEvent event) { + print('ConferenceRoom._onDataTrackPublished(), ${event.remoteParticipant.sid}}'); + } + + void _onDataTrackSubscribed(RemoteDataTrackSubscriptionEvent event) { + print('ConferenceRoom._onDataTrackSubscribed(), ${event.remoteParticipant.sid}, ${event.remoteDataTrackPublication.trackSid}'); + final dataTrack = event.remoteDataTrackPublication.remoteDataTrack; + _dataTracks.add(dataTrack); + _streamSubscriptions.add(dataTrack.onMessage.listen(_onMessage)); + _streamSubscriptions.add(dataTrack.onBufferMessage.listen(_onBufferMessage)); + } + + void _onDataTrackSubscriptionFailed(RemoteDataTrackSubscriptionFailedEvent event) { + print('ConferenceRoom._onDataTrackSubscriptionFailed(), ${event.remoteParticipant.sid}, ${event.remoteDataTrackPublication.trackSid}'); + _onExceptionStreamController.add( + PlatformException( + code: 'ConferenceRoom.dataTrackSubscriptionFailed', + message: 'DataTrack Subscription Failed', + details: event.exception.toString(), + ), + ); + } + + void _onDataTrackUnpublished(RemoteDataTrackEvent event) { + print('ConferenceRoom._onDataTrackUnpublished(), ${event.remoteParticipant.sid}, ${event.remoteDataTrackPublication.trackSid}'); + } + + void _onDataTrackUnsubscribed(RemoteDataTrackSubscriptionEvent event) { + print('ConferenceRoom._onDataTrackUnsubscribed(), ${event.remoteParticipant.sid}, ${event.remoteDataTrack.sid}'); + } + + void _onVideoTrackDisabled(RemoteVideoTrackEvent event) { + print('ConferenceRoom._onVideoTrackDisabled(), ${event.remoteParticipant.sid}, ${event.remoteVideoTrackPublication.trackSid}, isEnabled: ${event.remoteVideoTrackPublication.isTrackEnabled}'); + _setRemoteVideoEnabled(event); + } + + void _onVideoTrackEnabled(RemoteVideoTrackEvent event) { + print('ConferenceRoom._onVideoTrackEnabled(), ${event.remoteParticipant.sid}, ${event.remoteVideoTrackPublication.trackSid}, isEnabled: ${event.remoteVideoTrackPublication.isTrackEnabled}'); + _setRemoteVideoEnabled(event); + } + + void _onVideoTrackPublished(RemoteVideoTrackEvent event) { + print('ConferenceRoom._onVideoTrackPublished(), ${event.remoteParticipant.sid}, ${event.remoteVideoTrackPublication.trackSid}'); + } + + void _onVideoTrackSubscribed(RemoteVideoTrackSubscriptionEvent event) { + print('ConferenceRoom._onVideoTrackSubscribed(), ${event.remoteParticipant.sid}, ${event.remoteVideoTrack.sid}'); + _addOrUpdateParticipant(event); + } + + void _onVideoTrackSubscriptionFailed(RemoteVideoTrackSubscriptionFailedEvent event) { + print('ConferenceRoom._onVideoTrackSubscriptionFailed(), ${event.remoteParticipant.sid}, ${event.remoteVideoTrackPublication.trackSid}'); + _onExceptionStreamController.add( + PlatformException( + code: 'ConferenceRoom.videoTrackSubscriptionFailed', + message: 'VideoTrack Subscription Failed', + details: event.exception.toString(), + ), + ); + } + + void _onVideoTrackUnpublished(RemoteVideoTrackEvent event) { + print('ConferenceRoom._onVideoTrackUnpublished(), ${event.remoteParticipant.sid}, ${event.remoteVideoTrackPublication.trackSid}'); + } + + void _onVideoTrackUnsubscribed(RemoteVideoTrackSubscriptionEvent event) { + print('ConferenceRoom._onVideoTrackUnsubscribed(), ${event.remoteParticipant.sid}, ${event.remoteVideoTrack.sid}'); + } + + void _onMessage(RemoteDataTrackStringMessageEvent event) { + print('onMessage => ${event.remoteDataTrack.sid}, ${event.message}'); + } + + void _onBufferMessage(RemoteDataTrackBufferMessageEvent event) { + print('onBufferMessage => ${event.remoteDataTrack.sid}, ${String.fromCharCodes(event.message.asUint8List())}'); + } + + void _setRemoteAudioEnabled(RemoteAudioTrackEvent event) { + if (event.remoteAudioTrackPublication == null) { + return; + } + var index = _participants.indexWhere((ParticipantWidget participant) => participant.id == event.remoteParticipant.sid); + if (index < 0) { + return; + } + var participant = _participants[index]; + _participants.replaceRange( + index, + index + 1, + [ + participant.copyWith(audioEnabled: event.remoteAudioTrackPublication.isTrackEnabled), + ], + ); + notifyListeners(); + } + + void _setRemoteVideoEnabled(RemoteVideoTrackEvent event) { + if (event.remoteVideoTrackPublication == null) { + return; + } + var index = _participants.indexWhere((ParticipantWidget participant) => participant.id == event.remoteParticipant.sid); + if (index < 0) { + return; + } + var participant = _participants[index]; + _participants.replaceRange( + index, + index + 1, + [ + participant.copyWith(videoEnabled: event.remoteVideoTrackPublication.isTrackEnabled), + ], + ); + notifyListeners(); + } + + void _addOrUpdateParticipant(RemoteParticipantEvent event) { + print('ConferenceRoom._addOrUpdateParticipant(), ${event.remoteParticipant.sid}'); + final participant = _participants.firstWhere( + (ParticipantWidget participant) => participant.id == event.remoteParticipant.sid, + orElse: () => null, + ); + if (participant != null) { + print('Participant found: ${participant.id}, updating A/V enabled values'); + _setRemoteVideoEnabled(event); + _setRemoteAudioEnabled(event); + } else { + final bufferedParticipant = _participantBuffer.firstWhere( + (ParticipantBuffer participant) => participant.id == event.remoteParticipant.sid, + orElse: () => null, + ); + if (bufferedParticipant != null) { + _participantBuffer.remove(bufferedParticipant); + } else if (event is RemoteAudioTrackEvent) { + print('Audio subscription came first, waiting for the video subscription...'); + _participantBuffer.add( + ParticipantBuffer( + id: event.remoteParticipant.sid, + audioEnabled: event.remoteAudioTrackPublication?.remoteAudioTrack?.isEnabled ?? true, + ), + ); + return; + } + if (event is RemoteVideoTrackSubscriptionEvent) { + print('New participant, adding: ${event.remoteParticipant.sid}'); + _participants.insert( + 0, + _buildParticipant( + child: event.remoteVideoTrack.widget(), + id: event.remoteParticipant.sid, + remoteParticipant: event.remoteParticipant, + audioEnabled: bufferedParticipant?.audioEnabled ?? true, + videoEnabled: event.remoteVideoTrackPublication?.remoteVideoTrack?.isEnabled ?? true, + ), + ); + } + notifyListeners(); + } + } +} diff --git a/lib/pages/conference/draggable_publisher.dart b/lib/pages/conference/draggable_publisher.dart new file mode 100644 index 00000000..a1a0b142 --- /dev/null +++ b/lib/pages/conference/draggable_publisher.dart @@ -0,0 +1,173 @@ +import 'dart:async'; +import 'dart:io'; + +import 'package:diplomaticquarterapp/pages/conference/clipped_video.dart'; +import 'package:flutter/material.dart'; + +class DraggablePublisher extends StatefulWidget { + final Size availableScreenSize; + final Widget child; + final double scaleFactor; + final Stream onButtonBarVisible; + final Stream onButtonBarHeight; + + const DraggablePublisher({ + Key key, + @required this.availableScreenSize, + this.child, + @required this.onButtonBarVisible, + @required this.onButtonBarHeight, + + /// The portion of the screen the DraggableWidget should use. + this.scaleFactor = .25, + }) : assert(scaleFactor != null && scaleFactor > 0 && scaleFactor <= .4), + assert(availableScreenSize != null), + assert(onButtonBarVisible != null), + assert(onButtonBarHeight != null), + super(key: key); + + @override + _DraggablePublisherState createState() => _DraggablePublisherState(); +} + +class _DraggablePublisherState extends State { + bool _isButtonBarVisible = true; + double _buttonBarHeight = 0; + double _width; + double _height; + double _top; + double _left; + double _viewPaddingTop; + double _viewPaddingBottom; + final double _padding = 8.0; + final Duration _duration300ms = const Duration(milliseconds: 300); + final Duration _duration0ms = const Duration(milliseconds: 0); + Duration _duration; + StreamSubscription _streamSubscription; + StreamSubscription _streamHeightSubscription; + + @override + void initState() { + super.initState(); + _duration = _duration300ms; + _width = widget.availableScreenSize.width * widget.scaleFactor; + _height = _width * (widget.availableScreenSize.height / widget.availableScreenSize.width); + _top = widget.availableScreenSize.height - (_buttonBarHeight + _padding) - _height; + _left = widget.availableScreenSize.width - _padding - _width; + + _streamSubscription = widget.onButtonBarVisible.listen(_buttonBarVisible); + _streamHeightSubscription = widget.onButtonBarHeight.listen(_getButtonBarHeight); + } + + @override + void didChangeDependencies() { + final mediaQuery = MediaQuery.of(context); + _viewPaddingTop = mediaQuery.viewPadding.top; + _viewPaddingBottom = mediaQuery.viewPadding.bottom; + super.didChangeDependencies(); + } + + @override + void dispose() { + _streamSubscription.cancel(); + _streamHeightSubscription.cancel(); + super.dispose(); + } + + void _getButtonBarHeight(double height) { + setState(() { + _buttonBarHeight = height; + _positionWidget(); + }); + } + + void _buttonBarVisible(bool visible) { + if (!mounted) { + return; + } + setState(() { + _isButtonBarVisible = visible; + if (_duration == _duration300ms) { + // only position the widget when we are not currently dragging it around + _positionWidget(); + } + }); + } + + @override + Widget build(BuildContext context) { + return AnimatedPositioned( + top: _top, + left: _left, + width: _width, + height: _height, + duration: _duration, + child: Listener( + onPointerDown: (_) => _duration = _duration0ms, + onPointerMove: (PointerMoveEvent event) { + setState(() { + _left = (_left + event.delta.dx).roundToDouble(); + _top = (_top + event.delta.dy).roundToDouble(); + }); + }, + onPointerUp: (_) => _positionWidget(), + onPointerCancel: (_) => _positionWidget(), + child: ClippedVideo( + height: _height, + width: _width, + child: widget.child, + ), + ), + ); + } + + double _getCurrentStatusBarHeight() { + if (_isButtonBarVisible) { + return _viewPaddingTop; + } + final _defaultViewPaddingTop = Platform.isIOS ? 20.0 : Platform.isAndroid ? 24.0 : 0.0; + if (_viewPaddingTop > _defaultViewPaddingTop) { + // There must be a hardware notch in the display. + return _viewPaddingTop; + } + return 0.0; + } + + double _getCurrentButtonBarHeight() { + if (_isButtonBarVisible) { + return _buttonBarHeight + _viewPaddingBottom; + } + return _viewPaddingBottom; + } + + void _positionWidget() { + // Determine the center of the object being dragged so we can decide + // in which corner the object should be placed. + var dx = (_width / 2) + _left; + dx = dx < 0 ? 0 : dx >= widget.availableScreenSize.width ? widget.availableScreenSize.width - 1 : dx; + var dy = (_height / 2) + _top; + dy = dy < 0 ? 0 : dy >= widget.availableScreenSize.height ? widget.availableScreenSize.height - 1 : dy; + final draggableCenter = Offset(dx, dy); + + setState(() { + _duration = _duration300ms; + if (Rect.fromLTRB(0, 0, widget.availableScreenSize.width / 2, widget.availableScreenSize.height / 2).contains(draggableCenter)) { + // Top-left + _top = _getCurrentStatusBarHeight() + _padding; + _left = _padding; + } else if (Rect.fromLTRB(widget.availableScreenSize.width / 2, 0, widget.availableScreenSize.width, widget.availableScreenSize.height / 2).contains(draggableCenter)) { + // Top-right + _top = _getCurrentStatusBarHeight() + _padding; + _left = widget.availableScreenSize.width - _padding - _width; + } else if (Rect.fromLTRB(0, widget.availableScreenSize.height / 2, widget.availableScreenSize.width / 2, widget.availableScreenSize.height).contains(draggableCenter)) { + // Bottom-left + _top = widget.availableScreenSize.height - (_getCurrentButtonBarHeight() + _padding) - _height; + _left = _padding; + } else if (Rect.fromLTRB(widget.availableScreenSize.width / 2, widget.availableScreenSize.height / 2, widget.availableScreenSize.width, widget.availableScreenSize.height).contains(draggableCenter)) { + // Bottom-right + _top = widget.availableScreenSize.height - (_getCurrentButtonBarHeight() + _padding) - _height; + _left = widget.availableScreenSize.width - _padding - _width; + } + }); + } +} diff --git a/lib/pages/conference/participant_widget.dart b/lib/pages/conference/participant_widget.dart new file mode 100644 index 00000000..5b8d1ff2 --- /dev/null +++ b/lib/pages/conference/participant_widget.dart @@ -0,0 +1,197 @@ +import 'dart:ui'; + +import 'package:flutter/material.dart'; + +class ParticipantBuffer { + final bool audioEnabled; + final String id; + + ParticipantBuffer({ + @required this.audioEnabled, + @required this.id, + }) : assert(audioEnabled != null), + assert(id != null); +} + +class ParticipantWidget extends StatelessWidget { + final Widget child; + final String id; + final bool audioEnabled; + final bool videoEnabled; + final bool isRemote; + final bool isDummy; + final bool isDominant; + + const ParticipantWidget({ + Key key, + @required this.child, + @required this.audioEnabled, + @required this.videoEnabled, + @required this.id, + @required this.isRemote, + this.isDominant = false, + this.isDummy = false, + }) : assert(child != null), + assert(audioEnabled != null), + assert(videoEnabled != null), + assert(isRemote != null), + assert(isDominant != null), + assert(isDummy != null), + super(key: key); + + ParticipantWidget copyWith({ + Widget child, + bool audioEnabled, + bool videoEnabled, + bool isDominant, + }) { + return ParticipantWidget( + id: id, + child: child ?? this.child, + audioEnabled: audioEnabled ?? this.audioEnabled, + videoEnabled: videoEnabled ?? this.videoEnabled, + isDominant: isDominant ?? this.isDominant, + isRemote: isRemote, + ); + } + + @override + Widget build(BuildContext context) { + final children = []; + final icons = []; + if (!videoEnabled) { + icons.add(_buildVideoEnabledIcon()); + children.add( + ClipRect( + // Need to clip this BackdropFilter, otherwise it will blur the entire screen + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + decoration: BoxDecoration(color: Colors.black.withOpacity(.1)), + child: child, + ), + ), + ), + ); + } else { + children.add(child); + } + children.add(Padding( + padding: const EdgeInsets.all(8.0), + child: AnimatedOpacity( + duration: Duration(milliseconds: 500), + opacity: isDominant ? 1 : 0, + child: Icon( + Icons.volume_up, + color: Colors.white, + ), + ), + )); + if (!audioEnabled) { + icons.add(_buildAudioEnabledIcon()); + } + if (icons.isNotEmpty) { + if (isRemote) { + final rows = []; + rows.add(_buildRow(icons)); + if (!audioEnabled && !videoEnabled) { + rows.add(_buildRow(_fitText('The camera and microphone are off', Colors.white24))); + } else if (!audioEnabled) { + rows.add(_buildRow(_fitText('The microphone is off', Colors.black26))); + } else if (!videoEnabled) { + rows.add(_buildRow(_fitText('The camera is off', Colors.white24))); + } + children.add( + Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: rows, + ), + ); + } else { + children.add(Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: icons, + )); + } + } + + return Stack( + children: children, + ); + } + + List _fitText(String text, Color color) { + return [ + Flexible( + child: FittedBox( + fit: BoxFit.scaleDown, + child: Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Text(text, maxLines: 1, style: _buildTextStyle(color)), + ), + ), + ), + ]; + } + + TextStyle _buildTextStyle(Color color) { + return TextStyle( + color: color, + shadows: [ + Shadow( + blurRadius: 1.0, + color: Color.fromARGB(255, 0, 0, 0), + ), + Shadow( + blurRadius: 1.0, + color: Color.fromARGB(24, 255, 255, 255), + ), + ], + fontSize: 15, + ); + } + + Widget _buildRow(List children) { + return Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: children, + ); + } + + Widget _buildAudioEnabledIcon() { + return Padding( + padding: const EdgeInsets.all(8), + child: CircleAvatar( + maxRadius: 15, + child: FittedBox( + child: Icon( + Icons.mic_off, + color: Colors.black, + key: Key('microphone-off-icon'), + ), + ), + backgroundColor: Colors.white24, + ), + ); + } + + Widget _buildVideoEnabledIcon() { + return Padding( + padding: const EdgeInsets.all(8), + child: CircleAvatar( + maxRadius: 15, + child: FittedBox( + child: Icon( + Icons.videocam_off, + color: Colors.black, + key: Key('videocam-off-icon'), + ), + ), + backgroundColor: Colors.white24, + ), + ); + } +} diff --git a/lib/pages/conference/widgets/button_to_progress.dart b/lib/pages/conference/widgets/button_to_progress.dart new file mode 100644 index 00000000..2879dc60 --- /dev/null +++ b/lib/pages/conference/widgets/button_to_progress.dart @@ -0,0 +1,106 @@ +import 'dart:async'; +import 'dart:math' as math; + +import 'package:flutter/material.dart'; + +class ButtonToProgress extends StatefulWidget { + final double height; + final double progressHeight; + final String loadingText; + final Duration duration; + final TextStyle loadingTextStyle; + final VoidCallback onPressed; + final Stream onLoading; + final Widget child; + + const ButtonToProgress({ + Key key, + this.height = 40.0, + this.progressHeight = 5.0, + this.loadingText, + this.duration = const Duration(milliseconds: 300), + this.loadingTextStyle, + this.onPressed, + this.onLoading, + @required this.child, + }) : assert(child != null), + assert(height != null && height > 0), + assert(progressHeight != null && progressHeight > 0 && progressHeight <= height), + super(key: key); + + @override + _ButtonToProgressState createState() => _ButtonToProgressState(); +} + +class _ButtonToProgressState extends State { + double _height; + double _opacity = 0; + bool _isLoading = false; + + StreamSubscription _subscription; + + @override + void initState() { + super.initState(); + _height = widget.height; + if (widget.onLoading != null) { + _subscription = widget.onLoading.listen((bool isLoading) { + setState(() { + _isLoading = isLoading; + _height = isLoading ? widget.progressHeight : widget.height; + _opacity = isLoading ? 1 : 0; + }); + }); + } + } + + @override + void dispose() { + if (_subscription != null) { + _subscription.cancel(); + } + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Container( + height: widget.height, + child: Stack( + children: [ + if (widget.loadingText == null) + Container() + else + Padding( + padding: EdgeInsets.only(bottom: widget.progressHeight), + child: AnimatedOpacity( + child: Center( + child: FittedBox( + child: Text( + widget.loadingText, + style: widget.loadingTextStyle, + ), + ), + ), + opacity: _opacity, + duration: Duration(milliseconds: widget.duration.inMilliseconds + 200), + curve: Curves.easeInCubic, + ), + ), + AnimatedPadding( + duration: widget.duration, + padding: EdgeInsets.only( + top: math.max(widget.height - _height, 0), + ), + child: AnimatedContainer( + duration: widget.duration, + height: _height, + width: double.infinity, + child: _isLoading ? const LinearProgressIndicator() : widget.child, + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/conference/widgets/circle_button.dart b/lib/pages/conference/widgets/circle_button.dart new file mode 100644 index 00000000..37702c29 --- /dev/null +++ b/lib/pages/conference/widgets/circle_button.dart @@ -0,0 +1,103 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:native_device_orientation/native_device_orientation.dart'; + +class CircleButton extends StatefulWidget { + final VoidCallback onLongPress; + final VoidCallback onPressed; + final GestureTapDownCallback onTapDown; + final VoidCallback onTapCancel; + final Widget child; + final Color color; + final double radius; + + const CircleButton({ + Key key, + this.onLongPress, + this.onPressed, + this.child, + this.color, + this.radius = 25.0, + this.onTapCancel, + this.onTapDown, + }) : assert(radius != null), + super(key: key); + + @override + _CircleButtonState createState() => _CircleButtonState(); +} + +class _CircleButtonState extends State { + double _rotationAngle = 0.0; + + final Stream _orientationStream = NativeDeviceOrientationCommunicator().onOrientationChanged(useSensor: true); + StreamSubscription _orientationSubscription; + + void _handleOrientationChange(NativeDeviceOrientation orientation) { + var targetAngle = 0.0; + switch (orientation) { + case NativeDeviceOrientation.unknown: + case NativeDeviceOrientation.portraitUp: + targetAngle = 0.0; + break; + case NativeDeviceOrientation.portraitDown: + targetAngle = 180.0; + break; + case NativeDeviceOrientation.landscapeLeft: + targetAngle = 90.0; + break; + case NativeDeviceOrientation.landscapeRight: + targetAngle = 270.0; + break; + } + setState(() { + _rotationAngle = targetAngle; + }); + } + + @override + void initState() { + super.initState(); + _orientationSubscription = _orientationStream.listen( + _handleOrientationChange, + onError: (dynamic err) => print(err), + ); + } + + @override + void dispose() { + super.dispose(); + _orientationSubscription.cancel(); + } + + @override + Widget build(BuildContext context) { + final size = 2 * widget.radius; + + return Container( + width: size, + height: size, + decoration: BoxDecoration( + color: (widget.color ?? Colors.blue).withAlpha(200), + borderRadius: BorderRadius.all( + Radius.circular(widget.radius), + ), + ), + child: GestureDetector( + onLongPress: widget.onLongPress, + onTapDown: widget.onTapDown, + onTapCancel: widget.onTapCancel, + child: RawMaterialButton( + onPressed: widget.onPressed, + child: RotationTransition( + child: widget.child, + turns: AlwaysStoppedAnimation(_rotationAngle / 360), + ), + elevation: 0, + shape: const CircleBorder(), + ), + ), + ); + } +} diff --git a/lib/pages/conference/widgets/noise_box.dart b/lib/pages/conference/widgets/noise_box.dart new file mode 100644 index 00000000..5087415f --- /dev/null +++ b/lib/pages/conference/widgets/noise_box.dart @@ -0,0 +1,146 @@ +import 'dart:math' as math; +import 'dart:ui'; +import 'package:flutter/material.dart'; + +enum NoiseBoxDensity { + high, + medium, + low, + xHigh, + xLow, +} + +class NoiseBox extends StatefulWidget { + final NoiseBoxDensity density; + final Color backgroundColor; + final Widget child; + + const NoiseBox({ + Key key, + this.backgroundColor, + this.child, + this.density = NoiseBoxDensity.medium, + }) : assert(density != null), + super(key: key); + + @override + _NoiseBoxState createState() => _NoiseBoxState(); +} + +class _NoiseBoxState extends State with TickerProviderStateMixin { + AnimationController _animationController; + int _density; + + @override + void initState() { + super.initState(); + _animationController = AnimationController( + vsync: this, + duration: const Duration(seconds: 60), + ); + _animationController.repeat(); + switch (widget.density) { + case NoiseBoxDensity.high: + _density = 5; + break; + case NoiseBoxDensity.medium: + _density = 7; + break; + case NoiseBoxDensity.low: + _density = 10; + break; + case NoiseBoxDensity.xHigh: + _density = 3; + break; + case NoiseBoxDensity.xLow: + _density = 12; + break; + } + } + + @override + void dispose() { + _animationController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return LayoutBuilder( + builder: (BuildContext context, BoxConstraints constraints) => Container( + color: widget.backgroundColor, + width: constraints.biggest.width, + height: constraints.biggest.height, + child: AnimatedBuilder( + animation: _animationController, + builder: (BuildContext context, Widget w) { + final children = [ + CustomPaint( + painter: NoisePainter( + width: constraints.biggest.width, + height: constraints.biggest.height, + density: _density, + ), + ), + ]; + if (widget.child != null) { + children.add(widget.child); + } + return Stack( + children: children, + ); + }, + ), + ), + ); + } +} + +class NoisePainter extends CustomPainter { + final double width; + final double height; + final int density; + + NoisePainter({ + @required this.width, + @required this.height, + @required this.density, + }) : assert(width != null), + assert(height != null), + assert(density != null && + density >= 3 && + density < math.min(width, height)); + + List colors = [ + Colors.black, + Colors.grey, + Colors.blueGrey, + Colors.red, + Colors.green, + Colors.blue, + Colors.white, + ]; + + @override + void paint(Canvas canvas, Size size) { + final random = math.Random(); + for (var w = 0; w < width; w += density) { + for (var h = 0; h < height; h += density) { + final offset = Offset( + random.nextDouble() * width, + random.nextDouble() * height, + ); + final paint = Paint(); + paint.color = colors[random.nextInt(colors.length)]; + paint.strokeWidth = random.nextDouble() * 2; + + canvas.drawPoints(PointMode.points, [offset], paint); + } + } + } + + @override + bool shouldRepaint(CustomPainter oldDelegate) { + return true; + } +} diff --git a/lib/pages/conference/widgets/platform_alert_dialog.dart b/lib/pages/conference/widgets/platform_alert_dialog.dart new file mode 100644 index 00000000..1adaa223 --- /dev/null +++ b/lib/pages/conference/widgets/platform_alert_dialog.dart @@ -0,0 +1,98 @@ +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:flutter/cupertino.dart'; + +import './platform_widget.dart'; + +class PlatformAlertDialog extends PlatformWidget { + PlatformAlertDialog({@required this.title, @required this.content, @required this.defaultActionText, this.cancelActionText}) + : assert(title != null), + assert(content != null), + assert(defaultActionText != null); + + final String title; + final String content; + final String defaultActionText; + final String cancelActionText; + + Future show(BuildContext context) async { + return Platform.isIOS + ? await showCupertinoDialog( + context: context, + builder: (BuildContext context) => this, + ) + : await showDialog( + context: context, + barrierDismissible: false, + builder: (BuildContext context) => this, + ); + } + + @override + Widget buildCupertinoWidget(BuildContext context) { + return CupertinoAlertDialog( + title: Text(title), + content: Text(content), + actions: _buildActions(context), + ); + } + + @override + Widget buildMaterialWidget(BuildContext context) { + return AlertDialog( + title: Text(title), + content: Text(content), + actions: _buildActions(context), + ); + } + + List _buildActions(BuildContext context) { + final actions = []; + if (cancelActionText != null) { + actions.add( + PlatformAlertDialogAction( + child: Text(cancelActionText), + onPressed: () { + Navigator.of(context).pop(false); + }, + ), + ); + } + actions.add( + PlatformAlertDialogAction( + child: Text(defaultActionText), + onPressed: () { + Navigator.of(context).pop(true); + }, + ), + ); + return actions; + } +} + +class PlatformAlertDialogAction extends PlatformWidget { + PlatformAlertDialogAction({ + this.child, + this.onPressed, + }); + + final Widget child; + final VoidCallback onPressed; + + @override + Widget buildCupertinoWidget(BuildContext context) { + return CupertinoDialogAction( + child: child, + onPressed: onPressed, + ); + } + + @override + Widget buildMaterialWidget(BuildContext context) { + return FlatButton( + child: child, + onPressed: onPressed, + ); + } +} diff --git a/lib/pages/conference/widgets/platform_exception_alert_dialog.dart b/lib/pages/conference/widgets/platform_exception_alert_dialog.dart new file mode 100644 index 00000000..931a6e10 --- /dev/null +++ b/lib/pages/conference/widgets/platform_exception_alert_dialog.dart @@ -0,0 +1,22 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import './platform_alert_dialog.dart'; + +class PlatformExceptionAlertDialog extends PlatformAlertDialog { + PlatformExceptionAlertDialog({ + String title = 'An error occurred', + @required Exception exception, + }) : super( + title: title, + content: exception is PlatformException ? _message(exception) : exception.toString(), + defaultActionText: 'OK', + ); + + static String _message(PlatformException exception) { + return _errors[exception.code] ?? (exception.details != null ? (exception.details['message'] ?? exception.message) : exception.message); + } + + static final Map _errors = { + 'ERROR_CODE': 'Error description...', + }; +} diff --git a/lib/pages/conference/widgets/platform_widget.dart b/lib/pages/conference/widgets/platform_widget.dart new file mode 100644 index 00000000..5773190f --- /dev/null +++ b/lib/pages/conference/widgets/platform_widget.dart @@ -0,0 +1,16 @@ +import 'dart:io'; +import 'package:flutter/material.dart'; + +abstract class PlatformWidget extends StatelessWidget { + Widget buildCupertinoWidget(BuildContext context); + + Widget buildMaterialWidget(BuildContext context); + + @override + Widget build(BuildContext context) { + if (Platform.isIOS) { + return buildCupertinoWidget(context); + } + return buildMaterialWidget(context); + } +} diff --git a/lib/pages/conference/widgets/responsive_save_area.dart b/lib/pages/conference/widgets/responsive_save_area.dart new file mode 100644 index 00000000..f9a85467 --- /dev/null +++ b/lib/pages/conference/widgets/responsive_save_area.dart @@ -0,0 +1,31 @@ +import 'package:flutter/material.dart'; + +typedef ResponsiveBuilder = Widget Function( + BuildContext context, + Size size, +); + +class ResponsiveSafeArea extends StatelessWidget { + const ResponsiveSafeArea({ + @required ResponsiveBuilder builder, + Key key, + }) : responsiveBuilder = builder, + assert(builder != null), + super(key: key); + + final ResponsiveBuilder responsiveBuilder; + + @override + Widget build(BuildContext context) { + return SafeArea( + child: LayoutBuilder( + builder: (BuildContext context, BoxConstraints constraints) { + return responsiveBuilder( + context, + constraints.biggest, + ); + }, + ), + ); + } +} diff --git a/lib/pages/feedback/appointment_history.dart b/lib/pages/feedback/appointment_history.dart new file mode 100644 index 00000000..a1dcdd33 --- /dev/null +++ b/lib/pages/feedback/appointment_history.dart @@ -0,0 +1,276 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class AppointmentHistory { + String setupID; + int projectID; + int appointmentNo; + DateTime appointmentDate; + Null appointmentDateN; + int appointmentType; + String bookDate; + int patientType; + int patientID; + int clinicID; + int doctorID; + String endDate; + String startTime; + String endTime; + int status; + int visitType; + int visitFor; + int patientStatusType; + int companyID; + int bookedBy; + String bookedOn; + int confirmedBy; + String confirmedOn; + int arrivalChangedBy; + DateTime arrivedOn; + Null editedBy; + Null editedOn; + Null doctorName; + Null doctorNameN; + String statusDesc; + Null statusDescN; + bool vitalStatus; + Null vitalSignAppointmentNo; + int episodeID; + int actualDoctorRate; + String clinicName; + bool complainExists; + String doctorImageURL; + String doctorNameObj; + int doctorRate; + List doctorSpeciality; + String doctorTitle; + int gender; + String genderDescription; + bool iSAllowOnlineCheckedIN; + bool isActiveDoctor; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + int isFollowup; + bool isLiveCareAppointment; + bool isMedicalReportRequested; + bool isOnlineCheckedIN; + String latitude; + Null listHISGetContactLensPerscription; + Null listHISGetGlassPerscription; + String longitude; + int nextAction; + int noOfPatientsRate; + int originalClinicID; + int originalProjectID; + String projectName; + String qR; + int remaniningHoursTocanPay; + bool sMSButtonVisable; + + AppointmentHistory( + {this.setupID, + this.projectID, + this.appointmentNo, + this.appointmentDate, + this.appointmentDateN, + this.appointmentType, + this.bookDate, + this.patientType, + this.patientID, + this.clinicID, + this.doctorID, + this.endDate, + this.startTime, + this.endTime, + this.status, + this.visitType, + this.visitFor, + this.patientStatusType, + this.companyID, + this.bookedBy, + this.bookedOn, + this.confirmedBy, + this.confirmedOn, + this.arrivalChangedBy, + this.arrivedOn, + this.editedBy, + this.editedOn, + this.doctorName, + this.doctorNameN, + this.statusDesc, + this.statusDescN, + this.vitalStatus, + this.vitalSignAppointmentNo, + this.episodeID, + this.actualDoctorRate, + this.clinicName, + this.complainExists, + this.doctorImageURL, + this.doctorNameObj, + this.doctorRate, + this.doctorSpeciality, + this.doctorTitle, + this.gender, + this.genderDescription, + this.iSAllowOnlineCheckedIN, + this.isActiveDoctor, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isFollowup, + this.isLiveCareAppointment, + this.isMedicalReportRequested, + this.isOnlineCheckedIN, + this.latitude, + this.listHISGetContactLensPerscription, + this.listHISGetGlassPerscription, + this.longitude, + this.nextAction, + this.noOfPatientsRate, + this.originalClinicID, + this.originalProjectID, + this.projectName, + this.qR, + this.remaniningHoursTocanPay, + this.sMSButtonVisable}); + + AppointmentHistory.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + appointmentNo = json['AppointmentNo']; + appointmentDate = DateUtil.convertStringToDate(json['AppointmentDate']); + appointmentDateN = json['AppointmentDateN']; + appointmentType = json['AppointmentType']; + bookDate = json['BookDate']; + patientType = json['PatientType']; + patientID = json['PatientID']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + endDate = json['EndDate']; + startTime = json['StartTime']; + endTime = json['EndTime']; + status = json['Status']; + visitType = json['VisitType']; + visitFor = json['VisitFor']; + patientStatusType = json['PatientStatusType']; + companyID = json['CompanyID']; + bookedBy = json['BookedBy']; + bookedOn = json['BookedOn']; + confirmedBy = json['ConfirmedBy']; + confirmedOn = json['ConfirmedOn']; + arrivalChangedBy = json['ArrivalChangedBy']; + arrivedOn = DateUtil.convertStringToDate(json['ArrivedOn']); + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + statusDesc = json['StatusDesc']; + statusDescN = json['StatusDescN']; + vitalStatus = json['VitalStatus']; + vitalSignAppointmentNo = json['VitalSignAppointmentNo']; + episodeID = json['EpisodeID']; + actualDoctorRate = json['ActualDoctorRate']; + clinicName = json['ClinicName']; + complainExists = json['ComplainExists']; + doctorImageURL = json['DoctorImageURL']; + doctorNameObj = json['DoctorNameObj']; + doctorRate = json['DoctorRate']; +// doctorSpeciality = json['DoctorSpeciality'].cast(); + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + iSAllowOnlineCheckedIN = json['ISAllowOnlineCheckedIN']; + isActiveDoctor = json['IsActiveDoctor']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + isFollowup = json['IsFollowup']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + isMedicalReportRequested = json['IsMedicalReportRequested']; + isOnlineCheckedIN = json['IsOnlineCheckedIN']; + latitude = json['Latitude']; + listHISGetContactLensPerscription = + json['List_HIS_GetContactLensPerscription']; + listHISGetGlassPerscription = json['List_HIS_GetGlassPerscription']; + longitude = json['Longitude']; + nextAction = json['NextAction']; + noOfPatientsRate = json['NoOfPatientsRate']; + originalClinicID = json['OriginalClinicID']; + originalProjectID = json['OriginalProjectID']; + projectName = json['ProjectName']; + qR = json['QR']; + remaniningHoursTocanPay = json['RemaniningHoursTocanPay']; + sMSButtonVisable = json['SMSButtonVisable']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentDateN'] = this.appointmentDateN; + data['AppointmentType'] = this.appointmentType; + data['BookDate'] = this.bookDate; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['EndDate'] = this.endDate; + data['StartTime'] = this.startTime; + data['EndTime'] = this.endTime; + data['Status'] = this.status; + data['VisitType'] = this.visitType; + data['VisitFor'] = this.visitFor; + data['PatientStatusType'] = this.patientStatusType; + data['CompanyID'] = this.companyID; + data['BookedBy'] = this.bookedBy; + data['BookedOn'] = this.bookedOn; + data['ConfirmedBy'] = this.confirmedBy; + data['ConfirmedOn'] = this.confirmedOn; + data['ArrivalChangedBy'] = this.arrivalChangedBy; + data['ArrivedOn'] = this.arrivedOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['StatusDesc'] = this.statusDesc; + data['StatusDescN'] = this.statusDescN; + data['VitalStatus'] = this.vitalStatus; + data['VitalSignAppointmentNo'] = this.vitalSignAppointmentNo; + data['EpisodeID'] = this.episodeID; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['ClinicName'] = this.clinicName; + data['ComplainExists'] = this.complainExists; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorNameObj'] = this.doctorNameObj; + data['DoctorRate'] = this.doctorRate; + data['DoctorSpeciality'] = this.doctorSpeciality; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['ISAllowOnlineCheckedIN'] = this.iSAllowOnlineCheckedIN; + data['IsActiveDoctor'] = this.isActiveDoctor; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsFollowup'] = this.isFollowup; + data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + data['IsMedicalReportRequested'] = this.isMedicalReportRequested; + data['IsOnlineCheckedIN'] = this.isOnlineCheckedIN; + data['Latitude'] = this.latitude; + data['List_HIS_GetContactLensPerscription'] = + this.listHISGetContactLensPerscription; + data['List_HIS_GetGlassPerscription'] = this.listHISGetGlassPerscription; + data['Longitude'] = this.longitude; + data['NextAction'] = this.nextAction; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['OriginalClinicID'] = this.originalClinicID; + data['OriginalProjectID'] = this.originalProjectID; + data['ProjectName'] = this.projectName; + data['QR'] = this.qR; + data['RemaniningHoursTocanPay'] = this.remaniningHoursTocanPay; + data['SMSButtonVisable'] = this.sMSButtonVisable; + return data; + } +} diff --git a/lib/pages/feedback/feedback_home_page.dart b/lib/pages/feedback/feedback_home_page.dart new file mode 100644 index 00000000..309b5713 --- /dev/null +++ b/lib/pages/feedback/feedback_home_page.dart @@ -0,0 +1,117 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/pages/feedback/send_feedback_page.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'status_feedback_page.dart'; + +class FeedbackHomePage extends StatefulWidget { + @override + _FeedbackHomePageState createState() => _FeedbackHomePageState(); +} + +class _FeedbackHomePageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + isBottomBar: false, + isShowDecPage: false, + appBarTitle: TranslationBase.of(context).feedbackTitle, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, width: 0.7), + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + indicatorColor: Colors.red[800], + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: Texts(TranslationBase.of(context).send), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: Texts(TranslationBase.of(context).status), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [SendFeedbackPage(), StatusFeedbackPage()], + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart new file mode 100644 index 00000000..4d511452 --- /dev/null +++ b/lib/pages/feedback/send_feedback_page.dart @@ -0,0 +1,735 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; +import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'dart:convert'; +import 'dart:io'; +import 'appointment_history.dart'; + +class SendFeedbackPage extends StatefulWidget { + @override + _SendFeedbackPageState createState() => _SendFeedbackPageState(); +} + +class _SendFeedbackPageState extends State { + TextEditingController titleController = TextEditingController(); + TextEditingController messageController = TextEditingController(); + List images = []; + String title; + AppointmentHistory appointHistory; + bool isShowListAppointHistory = true; + String message; + final formKey = GlobalKey(); + MessageType messageType = MessageType.NON; + + + String getSelected(BuildContext context) { + switch (messageType) { + case MessageType.ComplaintOnAnAppointment: + return TranslationBase.of(context).complainAppo; + break; + case MessageType.ComplaintWithoutAppointment: + return TranslationBase.of(context).complainWithoutAppo; + break; + case MessageType.Question: + return TranslationBase.of(context).question; + break; + case MessageType.Compliment: + return TranslationBase.of(context).compliment; + break; + case MessageType.Suggestion: + return TranslationBase.of(context).suggestion; + break; + case MessageType.NON: + return TranslationBase.of(context).notClassified; + break; + } + return TranslationBase.of(context).notClassified; + } + + + + setMessageType(MessageType messageType) { + setState(() { + this.messageType = messageType; + }); + + } + + @override + Widget build(BuildContext context) { + return BaseView( + allowAny: true, + builder: (_, model, widget) => AppScaffold( + baseViewModel: model, + isShowDecPage: false, + body: Container( + height: MediaQuery.of(context).size.height * 0.8, + child: SingleChildScrollView( + child: Form( + key: formKey, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 65, + ), + Container( + margin: EdgeInsets.only(left: 20, right: 20, top: 8), + child: Texts( + TranslationBase.of(context).likeToHear, + textAlign: TextAlign.center, + ), + ), + InkWell( + onTap: () { + confirmBox(model); + }, + child: Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + height: 50, + decoration: BoxDecoration( + border: Border.all(color: Colors.grey), + borderRadius: BorderRadius.circular(7), + color: Colors.white, + shape: BoxShape.rectangle, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + child: Texts( + getSelected(context), + variant: 'bodyText', + ), + margin: EdgeInsets.only(left: 10,right: 10), + ), + Icon( + Icons.arrow_drop_down, + size: 22, + color: Colors.grey, + ) + ], + ), + ), + ), + if (appointHistory != null && messageType == + MessageType.ComplaintOnAnAppointment) + InkWell( + onTap: () { + setState(() { + isShowListAppointHistory = true; + }); + }, + child: Container( + margin: EdgeInsets.all(8.0), + color: Colors.white, + child: Row( + children: [ + Expanded( + flex: 4, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(10.0), + child: Row( + children: [ + Expanded( + flex: 1, + child: LargeAvatar( + name: appointHistory.doctorNameObj, + url: appointHistory.doctorImageURL, + ), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + appointHistory.doctorNameObj, + bold: true, + ), + Texts( + DateUtil + .getMonthDayYearDateFormatted( + appointHistory + .appointmentDate), + variant: 'caption3', + ), + StarRating( + totalAverage: appointHistory + .doctorRate + .toDouble(), + forceStars: true), + ], + ), + ), + ), + ], + ), + ), + ], + ), + ), + Expanded( + flex: 1, + child: Center( + child: Icon( + Icons.arrow_forward_ios, + size: 15, + ), + ), + ) + ], + ), + ), + ), + if (messageType == MessageType.ComplaintOnAnAppointment && model.appointHistoryList.length != 0 && + isShowListAppointHistory) + Container( + height: model.appointHistoryList.length>2?MediaQuery.of(context).size.height * 0.25:MediaQuery.of(context).size.height * 0.15, + child: ListView.builder( + itemCount: model.appointHistoryList.length, + itemBuilder: (context, index) => InkWell( + onTap: () { + setState(() { + appointHistory = model.appointHistoryList[index]; + isShowListAppointHistory = false; + }); + }, + child: Container( + margin: EdgeInsets.only(left: 8, right: 8), + color: Colors.white, + child: Column( + children: [ + Row( + children: [ + Expanded( + flex: 4, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(10.0), + child: Row( + children: [ + Expanded( + flex: 1, + child: LargeAvatar( + name: model + .appointHistoryList[ + index] + .doctorNameObj, + url: model + .appointHistoryList[ + index] + .doctorImageURL, + ), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Texts( + model + .appointHistoryList[ + index] + .doctorNameObj, + bold: true, + ), + Texts( + DateUtil.getMonthDayYearDateFormatted(model + .appointHistoryList[ + index] + .appointmentDate), + variant: 'caption3', + ), + StarRating( + totalAverage: model + .appointHistoryList[ + index] + .doctorRate + .toDouble(), + forceStars: true), + ], + ), + ), + ), + ], + ), + ), + ], + ), + ), + Expanded( + flex: 1, + child: Center( + child: Icon( + Icons.arrow_forward_ios, + size: 15, + ), + ), + ) + ], + ), + SizedBox( + height: 5, + ), + Divider( + height: 0.5, + color: Colors.grey[400], + ) + ], + ), + ), + ), + ), + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: TranslationBase.of(context).subject, + controller: titleController, + fontSize: 13.5, + hintColor: Colors.black, + fontWeight: FontWeight.w600, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context).emptySubject; + else + return null; + }, + ), + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: TranslationBase.of(context).message, + fontSize: 13.5, + hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 13, + controller: messageController, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context).emptyMessage; + else + return null; + }), + ), + InkWell( + onTap: () { + ImageOptions.showImageOptions(context, (String image,File file) { + setState(() { + images.add(image); + }); + } ); + }, + child: Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + height: 50, + decoration: BoxDecoration( + border: Border.all(color: Colors.grey), + borderRadius: BorderRadius.circular(7), + color: Colors.white, + shape: BoxShape.rectangle, + ), + child: Center( + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(Icons.attach_file), + Texts( + TranslationBase.of(context).selectAttachment, + variant: 'bodyText', + textAlign: TextAlign.center, + ), + ], + ), + ), + ), + ), + ...List.generate( + images.length, + (index) => Container( + margin: EdgeInsets.all(10), + padding: EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Icon(FontAwesomeIcons.paperclip), + SizedBox( + width: 8, + ), + Texts( + 'image ${index + 1}.png', + ), + ], + ), + InkWell( + onTap: () { + setState(() { + images.remove(images[index]); + }); + }, + child: Icon( + FontAwesomeIcons.trashAlt, + color: Colors.red[300], + )) + ], + ), + )), + SizedBox( + height: 45, + ), + ], + ), + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.13, + width: double.infinity, + padding: EdgeInsets.all(8.0), + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.1, + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + label: TranslationBase.of(context).send, + loading: model.state == ViewState.BusyLocal, + onTap: () { + final form = formKey.currentState; + if (form.validate()) if (messageType != MessageType.NON) + model + .sendCOCItem( + title: titleController.text, + attachment: images.length > 0 ? images[0] : "", + details: messageController.text, + cOCTypeName: getCOCName(), + appointHistory:messageType == + MessageType.ComplaintOnAnAppointment + ? appointHistory + : null) + .then((value) { + if (value) { + setState(() { + titleController.text = ""; + messageController.text = ""; + images = []; + }); + setMessageType(MessageType.NON); + AppToast.showSuccessToast( + message: TranslationBase.of(context).yourFeedback); + } else { + AppToast.showErrorToast(message: model.error); + } + }); + else { + AppToast.showErrorToast(message: TranslationBase.of(context).selectPart); + } + }, + ), + ), + ), + ), + ), + ); + } + + String getCOCName() { + switch (messageType) { + case MessageType.ComplaintOnAnAppointment: + return "1"; + break; + case MessageType.ComplaintWithoutAppointment: + return "2"; + break; + case MessageType.Question: + return "3"; + break; + case MessageType.Compliment: + return "4"; + break; + case MessageType.Suggestion: + return "5"; + break; + case MessageType.NON: + return ""; + break; + } + return ""; + } + + // Show Dialog function + void confirmBox(FeedbackViewModel model) { + showDialog( + context: context, + child: FeedbackTypeDialog( + messageTypeDialog: messageType, + onValueSelected: (MessageType value) { + if (value == MessageType.ComplaintOnAnAppointment) { + GifLoaderDialogUtils.showMyDialog(context); + model.getPatentAppointmentHistory().then((value) { + GifLoaderDialogUtils.hideDialog(context); + setState(() { + appointHistory = null; + }); + }); + } + setMessageType(value); + }, + )); + } +} + +class FeedbackTypeDialog extends StatefulWidget { + final Function(MessageType) onValueSelected; + final MessageType messageTypeDialog; + + const FeedbackTypeDialog({Key key, this.onValueSelected, this.messageTypeDialog=MessageType.NON}) : super(key: key); + + @override + State createState() => new FeedbackTypeDialogState(); +} + +class FeedbackTypeDialogState extends State { + + + MessageType messageTypeDialog = MessageType.NON; + + setMessageDialogType(MessageType messageType) { + setState(() { + messageTypeDialog = messageType; + }); + } + @override + void initState() { + messageTypeDialog = widget.messageTypeDialog; + super.initState(); + } + + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, widge) => SimpleDialog( + title: Text( + TranslationBase.of(context).messageType, + textAlign: TextAlign.center, + ), + children: [ + Container( + // padding: const EdgeInsets.all(10.0), + child: Column( + children: [ + Divider( + height: 2.5, + color: Colors.grey[500], + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () => setMessageDialogType( + MessageType.ComplaintOnAnAppointment), + child: ListTile( + title: Texts(TranslationBase.of(context).complainAppo), + leading: Radio( + value: MessageType.ComplaintOnAnAppointment, + groupValue: messageTypeDialog, + activeColor: Theme.of(context).primaryColor, + onChanged: (MessageType value) => + setMessageDialogType(value), + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () => setMessageDialogType( + MessageType.ComplaintWithoutAppointment), + child: ListTile( + title: Texts(TranslationBase.of(context).complainWithoutAppo), + leading: Radio( + value: MessageType.ComplaintWithoutAppointment, + groupValue: messageTypeDialog, + activeColor: Theme.of(context).primaryColor, + onChanged: (MessageType value) => + setMessageDialogType(value), + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () => + setMessageDialogType(MessageType.Question), + child: ListTile( + title: Texts(TranslationBase.of(context).question), + leading: Radio( + value: MessageType.Question, + groupValue: messageTypeDialog, + activeColor: Theme.of(context).primaryColor, + onChanged: (MessageType value) => + setMessageDialogType(value), + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () => + setMessageDialogType(MessageType.Compliment), + child: ListTile( + title: Texts(TranslationBase.of(context).compliment), + leading: Radio( + value: MessageType.Compliment, + groupValue: messageTypeDialog, + activeColor: Theme.of(context).primaryColor, + onChanged: (MessageType value) => + setMessageDialogType(value), + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () => + setMessageDialogType(MessageType.Suggestion), + child: ListTile( + title: Texts(TranslationBase.of(context).suggestion), + leading: Radio( + value: MessageType.Suggestion, + groupValue: messageTypeDialog, + activeColor: Theme.of(context).primaryColor, + onChanged: (MessageType value) => setMessageDialogType(value), + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Divider( + height: 2.5, + color: Colors.grey[500], + ), + SizedBox( + height: 5, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel, + color: Theme.of(context).primaryColor, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(messageTypeDialog); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + )), + ], + ) + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/feedback/status_feedback_page.dart b/lib/pages/feedback/status_feedback_page.dart new file mode 100644 index 00000000..59d68fa2 --- /dev/null +++ b/lib/pages/feedback/status_feedback_page.dart @@ -0,0 +1,106 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class StatusFeedbackPage extends StatefulWidget { + @override + _StatusFeedbackPageState createState() => _StatusFeedbackPageState(); +} + +class _StatusFeedbackPageState extends State { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getCOC(), + builder: (_, model, widget) => AppScaffold( + baseViewModel: model, + isShowDecPage: false, + body: model.cOCItemList.isNotEmpty + ? Container( + margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0), + padding: EdgeInsets.all(15.0), + child: ListView.builder( + itemCount: model.cOCItemList.length, + itemBuilder: (context, index) => Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.white, + ), + margin: EdgeInsets.all(4), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + '${model.cOCItemList[index].cOCTitle}'), + Texts( + TranslationBase.of(context).number + + ' : ${model.cOCItemList[index].itemID}', + variant: 'overline', + ), + ], + ), + ), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + '${model.cOCItemList[index].status}'), + Texts( + '${model.cOCItemList[index].date}', + variant: 'overline', + ), + ], + ), + ), + ], + ), + Texts('${model.cOCItemList[index].formType}'), + Divider( + height: 4.5, + color: Colors.grey[500], + ) + ], + ), + ), + )), + ) + : Container( + child: Center( + child: Column( + children: [ + SizedBox(height: MediaQuery.of(context).size.height*0.4,), + Image.asset('assets/images/comments.png',width: 80,height: 80,), + SizedBox(height: 15,), + Texts(TranslationBase.of(context).noSearchResult), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart deleted file mode 100644 index f76f7321..00000000 --- a/lib/pages/home_page.dart +++ /dev/null @@ -1,49 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class MyHomePage extends StatefulWidget { - MyHomePage({Key key, this.title}) : super(key: key); - - final String title; - - @override - _MyHomePageState createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { - int _counter = 0; - - void _incrementCounter() { - setState(() { - _counter++; - }); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text(widget.title), - ), - body: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - 'You have pushed the button this many times:', - ), - Text( - '$_counter', - style: Theme.of(context).textTheme.headline4, - ), - ], - ), - ), - floatingActionButton: FloatingActionButton( - onPressed: _incrementCounter, - tooltip: 'Increment', - child: Icon(Icons.add), - ), // This trailing comma makes auto-formatting nicer for build methods. - ); - } -} \ No newline at end of file diff --git a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart new file mode 100644 index 00000000..20e17593 --- /dev/null +++ b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart @@ -0,0 +1,147 @@ +import 'dart:io'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class AttachInsuranceCardImageDialog extends StatefulWidget { + final String name; + final String fileNo; + final Function(File file, String image) image; + + const AttachInsuranceCardImageDialog( + {Key key, this.name, this.fileNo, this.image}) + : super(key: key); + + @override + _AttachInsuranceCardImageDialogState createState() => + _AttachInsuranceCardImageDialogState(); +} + +class _AttachInsuranceCardImageDialogState + extends State { + @override + void initState() { + super.initState(); + } + + String image; + File file; + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Texts(TranslationBase.of(context).attachInsuraceImage), + Divider(), + Texts(widget.name), + SizedBox( + height: 3, + ), + Texts(TranslationBase.of(context).fileNo + " " + widget.fileNo), + SizedBox( + height: 5.0, + ), + InkWell( + onTap: () { + ImageOptions.showImageOptions(context, (String image,File file) { + setState(() { + this.image = image; + this.file = file; + }); + }); + }, + child: image == null + ? Padding( + padding: const EdgeInsets.all(18.0), + child: Container( + width: double.maxFinite, + height: 250, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + border: Border.all(color: Colors.grey, width: 1.5)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + // mainAxisAlignment: MainAxisAlignment., + children: [ + SizedBox(height: 25,), + Icon( + Icons.camera_enhance_rounded, + size: 85, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(Icons.attach_file), + Texts(TranslationBase.of(context).selectAttachment.toUpperCase()) + ], + ), + ], + ), + ), + ) + : Image.file( + file, + fit: BoxFit.fill, + height: 250, + ), + ), + SizedBox( + height: 25.0, + ), + Divider(), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + widget.image(file, image); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} diff --git a/lib/pages/insurance/insurance_approval_screen.dart b/lib/pages/insurance/insurance_approval_screen.dart new file mode 100644 index 00000000..d81e704e --- /dev/null +++ b/lib/pages/insurance/insurance_approval_screen.dart @@ -0,0 +1,436 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../base/base_view.dart'; + +class InsuranceApproval extends StatefulWidget { + int appointmentNo; + + InsuranceApproval({this.appointmentNo}); + + @override + _InsuranceApprovalState createState() => _InsuranceApprovalState(); +} + +class _InsuranceApprovalState extends State { + List imagesInfo = List(); + + @override + Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/1.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/1.png')); + return BaseView( + onModelReady: widget.appointmentNo != null + ? (model) => + model.getInsuranceApproval(appointmentNo: widget.appointmentNo) + : (model) => model.getInsuranceApproval(), + builder: (BuildContext context, InsuranceViewModel model, Widget child) => + AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBarTitle: TranslationBase.of(context).approvals, + description: TranslationBase.of(context).infoApprovals, + infoList: TranslationBase.of(context).infoApprovalPoints, + imagesInfo: imagesInfo, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only( + left: SizeConfig.screenWidth * 0.004, + right: SizeConfig.screenWidth * 0.004, + top: SizeConfig.screenWidth * 0.04, + ), + child: Column( + children: [ + Container( + width: double.infinity, + height: SizeConfig.screenHeight * 0.09, + color: Color(0xffEEEEEE), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Texts( + TranslationBase.of(context).totalApproval, + color: Color(0xff60688B), + fontSize: 19.0, + fontWeight: FontWeight.w600, + ), + if (model.insuranceApproval.length > 0) + Container( + width: 60, + height: 40, + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.circular(19.0)), + child: Center( + child: Texts( + model.insuranceApproval[0].unUsedCount + .toString(), + color: Colors.white, fontSize: 17.0, + ), + )) + ], + )), + ...List.generate( + model.insuranceApproval.length, + (index) => RoundedContainer( + backgroundColor: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ExpansionTile( + title: Container( + //height: 120.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + model.insuranceApproval[index].patientDescription == "In Patient" + ? Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: + BorderRadius.circular( + 16.0)), + width: 115.0, + padding: + EdgeInsets.only(left: 11.5), + child: Center( + child: Texts( + TranslationBase.of(context).inPatient, + color: Colors.white, + ), + ), + ) + : Container( + decoration: BoxDecoration( + color: Color(0xff505A5D), + borderRadius: + BorderRadius.circular( + 16.0)), + width: 115.0, + padding: + EdgeInsets.only(left: 11.5), + child: Center( + child: Texts( + TranslationBase.of(context).outpatient, + color: Colors.white, + ), + ), + ), + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0), + child: Texts( + model.insuranceApproval[index] + .clinicName, + fontSize: 20.0, + color: Color(0xff60686B), + fontWeight: FontWeight.w600, + ), + ), + Texts( + model.insuranceApproval[index] + .doctorName, + fontSize: 17.0, + ), + ], + ), + ), + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 12.0, horizontal: 12.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + Texts( + TranslationBase.of(context).approvalNo, + fontSize: 18.0, + ), + Texts(model.insuranceApproval[index].approvalNo.toString(), + fontSize: 18.0, + fontWeight: FontWeight.w600,), + ], + ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), + Row( + children: [ + Texts( + TranslationBase.of(context).procedureStatus , + fontSize: 17.5, + ), + SizedBox(width: 12,), + Texts( + model.insuranceApproval[index].approvalStatusDescption, + fontWeight: FontWeight.w600, + fontSize: 17.5, + ), + ], + ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), + Row( + children: [ + Texts( + TranslationBase.of(context).unusedCount, + fontSize: 17.5, + ), + Texts( + model.insuranceApproval[index].unUsedCount.toString(), + fontSize: 17.5, + fontWeight: FontWeight.w600, + ), + ], + ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), +// Text( +// 'Company Name: ' + +// model.insuranceApproval[index] +// .companyName == +// null +// ? '000' +// : model +// .insuranceApproval[index].companyName, +// style: TextStyle( +// fontSize: 17.5, +// fontWeight: FontWeight.w600), +// ), + Texts( + TranslationBase.of(context).companyName, + fontWeight: FontWeight.w600, + fontSize: 17.5, + ), + + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), + Row( + children: [ + Texts( + TranslationBase.of(context).receiptOn , + fontSize: 17.5, + fontWeight: FontWeight.w600, + + ), + Texts( + convertDateFormat(model.insuranceApproval[index].rceiptOn), + fontSize: 17.5, + fontWeight: FontWeight.w600, + + ), + ], + ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), + Row( + children: [ + Texts( + TranslationBase.of(context).expiryDate, + fontSize: 17.5, + fontWeight: FontWeight.w600, + + ), + Texts( + convertDateFormat(model.insuranceApproval[index].expiryDate), + fontSize: 17.5, + fontWeight: FontWeight.w600, + + ), + ], + ), + Divider( + color: Colors.black, + height: 55.0, + thickness: 1.2, + ), + IntrinsicHeight( + child: Row( + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Expanded( + flex: 1, + child: Column( + children: [ + Text(TranslationBase.of( + context) + .procedureName), + Padding( + padding: EdgeInsets.only( + top: SizeConfig + .heightMultiplier * + 3.0), + child: Text( + model + .insuranceApproval[ + index] + .approvalDetails == + null + ? '' + : model + .insuranceApproval[ + index] + .approvalDetails + .procedureName, + style: TextStyle( + fontWeight: + FontWeight.w600, + fontSize: 15.5), + ), + ), + ], + ), + ), + VerticalDivider( + width: 10.0, + thickness: 1.2, + color: Colors.black, + ), + Expanded( + flex: 1, + child: Column( + children: [ + Text(TranslationBase.of( + context) + .procedureStatus), + Padding( + padding: EdgeInsets.only( + top: SizeConfig + .heightMultiplier * + 3.0), + child: Text( + model + .insuranceApproval[ + index] + .approvalDetails == + null + ? '' + : model + .insuranceApproval[ + index] + .approvalDetails + .status, + style: TextStyle( + fontSize: 17.5, + fontWeight: + FontWeight + .w600), + ), + ), + ], + ), + ), + VerticalDivider( + width: 2.3, + thickness: 1.2, + color: Colors.black, + ), + Expanded( + flex: 1, + child: Column( + children: [ + Text(TranslationBase.of( + context) + .usageStatus), + Padding( + padding: EdgeInsets.only( + top: SizeConfig + .heightMultiplier * + 3.0), + child: Text( + model + .insuranceApproval[ + index] + .approvalDetails == + null + ? '' + : model + .insuranceApproval[ + index] + .approvalDetails + .isInvoicedDesc, + style: TextStyle( + fontWeight: + FontWeight.w600, + fontSize: 17.5), + ), + ), + ], + ), + ), + ], + ), + ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), + ], + ), + ), + ], + ), + ], + ), + )), + ], + ), + ), + ), + ), + ); + } + + convertDateFormat(String Date) { + const start = "/Date("; + const end = "+0300)"; + + final startIndex = Date.indexOf(start); + final endIndex = Date.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(Date.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + + "-" + + date.month.toString().padLeft(2, '0') + + "-" + + date.day.toString().padLeft(2, '0'); + + return newDate.toString(); + } +} diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart new file mode 100644 index 00000000..42efc179 --- /dev/null +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -0,0 +1,223 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_details.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../base/base_view.dart'; + +class InsuranceCard extends StatefulWidget { + int appointmentNo; + + InsuranceCard({this.appointmentNo}); + + @override + _InsuranceCardState createState() => _InsuranceCardState(); +} + +class _InsuranceCardState extends State { + InsuranceCardService _insuranceCardService = locator(); + List imagesInfo = List(); + + @override + Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png')); + + return BaseView( + onModelReady: (model) => model.getInsurance(), + builder: (BuildContext context, InsuranceViewModel model, Widget child) => + AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBarTitle: TranslationBase.of(context).insuranceCards, + description: TranslationBase.of(context).infoInsuranceCards, + infoList: TranslationBase.of(context).infoInsuranceCardsPoints, + imagesInfo: imagesInfo, + body: Container( + margin: EdgeInsets.only( + left: SizeConfig.screenWidth * 0.004, + right: SizeConfig.screenWidth * 0.004, + top: SizeConfig.screenWidth * 0.04), + child: ListView.builder( + itemCount: model.insurance == null ? 0 : model.insurance.length, + itemBuilder: (BuildContext context, int index) { + return RoundedContainer( + backgroundColor: Colors.white, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ExpansionTile( + title: Container( + height: 65.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.symmetric(vertical: 15.0), + child: Texts( + model.insurance[index].groupName, + ), + ), + ], + ), + ), + children: [ + Container( + padding: EdgeInsets.all(14), + width: double.infinity, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.grey, width: 0.2), + borderRadius: + BorderRadius.all(Radius.circular(2)), + boxShadow: [ + BoxShadow( + color: Colors.white70, + ), + ]), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).companyName + + model.insurance[index].companyName, + fontSize: 20.0, + fontWeight: FontWeight.w700, + ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 0.5, + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + Texts( + TranslationBase.of(context).category +": "+ + model.insurance[index] + .subCategoryDesc, + fontSize: 18.5, + ), + Row( + children: [ + Texts( + TranslationBase.of(context) + .expirationDate +": "+ + convertDateFormat(model + .insurance[index].cardValidTo), + fontSize: 18.5, + ), + Expanded( + child: Column( + children: [ + model.insurance[index].isActive == true + ? Texts( + TranslationBase.of(context) + .activeInsurence, + color: Colors.green, + fontWeight: FontWeight.w900, + fontSize: 17.9) + : Texts( + TranslationBase.of(context) + .notActive, + color: Colors.red, + fontWeight: FontWeight.w900, + fontSize: 17.9) + ], + ), + ), + ], + ), + Texts( + TranslationBase.of(context) + .patientCard +": "+ + model + .insurance[index].patientCardID, + fontSize: 18.5, + ), + Texts( + TranslationBase.of(context) + .policyNumber +" "+ + model.insurance[index] + .insurancePolicyNumber, + fontSize: 18.5, + ), + ], + ), + SizedBox( + height: 14.5, + ), + if (model.insurance[index].isActive == true) + Container( + color: Colors.transparent, + child: SecondaryButton( + onTap: () => { + getDetails(model.insurance[index]) + }, + label: TranslationBase.of(context) + .seeDetails, + textColor: Colors.white, + ), + width: double.infinity, + ), + ], + ), + ), + ], + ), + ], + ), + ), + ); + }), + ), + ), + ); + } + + convertDateFormat(String exDate) { + const start = "/Date("; + const end = "+0300)"; + + final startIndex = exDate.indexOf(start); + final endIndex = exDate.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(exDate.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + + "-" + + date.month.toString().padLeft(2, '0') + + "-" + + date.day.toString().padLeft(2, '0'); + + return newDate.toString(); + } + + getDetails(data) { + GifLoaderDialogUtils.showMyDialog(context); + _insuranceCardService.getInsuranceDetails(data).then((value) => { + GifLoaderDialogUtils.hideDialog(context), + Navigator.push(context, + FadePage(page: InsuranceCardDetails(data: value[0]['CheckList']))) + }); + } +} diff --git a/lib/pages/insurance/insurance_card_update_details.dart b/lib/pages/insurance/insurance_card_update_details.dart new file mode 100644 index 00000000..5e9db38a --- /dev/null +++ b/lib/pages/insurance/insurance_card_update_details.dart @@ -0,0 +1,346 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/insurance/Insurance_card_details.dart'; +import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'AttachInsuranceCardImageDialog.dart'; + +class InsuranceCardUpdateDetails extends StatelessWidget { + final List insuranceCardDetailsModel; + final String patientIdentificationID; + final int patientID; + final String name; + + const InsuranceCardUpdateDetails( + {Key key, + this.insuranceCardDetailsModel, + this.patientIdentificationID, + this.patientID, + this.name}) + : super(key: key); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + builder: (context, model, w) => AppScaffold( + isShowAppBar: true, + isShowDecPage: false, + appBarTitle: TranslationBase.of(context).cardDetail, + body: SingleChildScrollView( + child: Column( + children: [ + ...List.generate( + insuranceCardDetailsModel.length, + (index) => Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + width: double.maxFinite, + margin: EdgeInsets.only(left: 8, right: 8, top: 8), + height: projectViewModel.isArabic ? 320 : 240, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(25), + color: Color(0xff515B5D), + ), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + insuranceCardDetailsModel[index].memberID, + textScaleFactor: 2.1, + style: TextStyle( + color: Colors.white, + letterSpacing: 8.0, + fontWeight: FontWeight.w400, + fontSize: 15), + ), + SizedBox( + height: 5, + ), + Texts( + insuranceCardDetailsModel[index].companyName, + fontSize: 14, + color: Colors.white, + ), + SizedBox( + height: 25, + ), + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).policyHolder, + color: Colors.white, + fontSize: 14, + ), + Texts( + insuranceCardDetailsModel[index] + .memberName, + color: Colors.white, + fontSize: 14, + ), + ], + ), + ), + Expanded( + child: Column( + children: [ + Texts(TranslationBase.of(context).policyNo, + color: Colors.white), + Texts( + insuranceCardDetailsModel[index] + .policyNumber, + color: Colors.white), + ], + ), + ), + ], + ), + SizedBox( + height: 25, + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context) + .expiryDateTitle, + color: Colors.white, + fontSize: 12, + ), + Texts( + insuranceCardDetailsModel[index].dOB, + color: Colors.white, + fontSize: 12, + ), + ], + ), + ), + Expanded( + child: Column( + children: [ + Texts( + TranslationBase.of(context).classTitle, + color: Colors.white, + fontSize: 12, + ), + Texts( + insuranceCardDetailsModel[index] + .subCategory, + color: Colors.white, + fontSize: 12, + ), + ], + ), + ), + Expanded( + child: Column( + children: [ + Texts( + TranslationBase.of(context).approval, + color: Colors.white, + fontSize: 12, + ), + Texts( + insuranceCardDetailsModel[index] + .approvalLimit + .toString(), + color: Colors.white, + fontSize: 12, + ), + ], + ), + ), + ], + ) + ], + ), + ), + ), + ), + ), + if(insuranceCardDetailsModel.isEmpty) + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.all(10.0), + child: Card( + margin: EdgeInsets.fromLTRB( + 8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10), + ), + child: Container( + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, + left: 10.0, + right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Texts( + name, + fontSize: 14, + color: Colors.black, + fontWeight: + FontWeight.w500, + ), + SizedBox( + height: 8, + ), + Texts( + TranslationBase.of( + context) + .fileno + + ": " +patientID.toString(), + fontSize: 14, + color: Colors.black, + fontWeight: + FontWeight.w500, + ) + ], + ), + ), + ), + ], + ), + ), + ), + ), + SizedBox(height: 150,), + Image.asset('assets/images/no-data-found.png',width: 80,height: 80,), + SizedBox(height: 8,), + Texts(TranslationBase.of(context).noDataAvailable) + ], + ) + ], + ), + ), + bottomSheet: Container( + width: double.infinity, + height:insuranceCardDetailsModel.isEmpty? MediaQuery.of(context).size.height * 0.14:MediaQuery.of(context).size.height * 0.21, + child: Container( + margin: EdgeInsets.only(left: 8, right: 8), + child: Column( + children: [ + SizedBox( + height: 8, + ), + if(insuranceCardDetailsModel.isEmpty) + SecondaryButton( + textColor: Colors.white, + label: TranslationBase.of(context).scanNow.toUpperCase(), + color: Theme.of(context).primaryColor, + onTap: () async { + confirmAttachInsuranceCardImageDialogDialog( + context: context, + name: name, + fileNo: patientID.toString(), + model: model); + }, + ), + if(insuranceCardDetailsModel.isNotEmpty) + SecondaryButton( + textColor: Colors.white, + label: TranslationBase.of(context).agree.toUpperCase(), + color: Theme.of(context).primaryColor, + onTap: () async { + GifLoaderDialogUtils.showMyDialog(context); + await model.uploadInsuranceCard( + patientIdentificationID: patientIdentificationID, + patientID: patientID); + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + AppToast.showErrorToast(message: model.error); + } else { + AppToast.showSuccessToast( + message: TranslationBase.of(context).requestSent); + } + }, + ),if(insuranceCardDetailsModel.isNotEmpty) + SizedBox( + height: 12, + ),if(insuranceCardDetailsModel.isNotEmpty) + SecondaryButton( + textColor: Colors.white, + label: TranslationBase.of(context).disagree.toUpperCase(), + color: Colors.grey[800], + onTap: () async { + confirmAttachInsuranceCardImageDialogDialog( + context: context, + name: name, + fileNo: patientID.toString(), + model: model); + }, + ) + ], + ), + ), + ), + ), + ); + } + + void confirmAttachInsuranceCardImageDialogDialog( + {BuildContext context, + String name, + String fileNo, + InsuranceViewModel model}) { + showDialog( + context: context, + child: AttachInsuranceCardImageDialog( + fileNo: fileNo, + name: name, + image: (file, image) async { + GifLoaderDialogUtils.showMyDialog(context); + await model.uploadInsuranceCard( + patientIdentificationID: patientIdentificationID, + patientID: patientID, + image: image); + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal || + model.state == ViewState.Error) { + AppToast.showErrorToast(message: model.error); + } else { + AppToast.showSuccessToast( + message: TranslationBase.of(context).requestSent); + } + Navigator.pop(context); + }, + ), + ); + } +} diff --git a/lib/pages/insurance/insurance_details.dart b/lib/pages/insurance/insurance_details.dart new file mode 100644 index 00000000..16745e9e --- /dev/null +++ b/lib/pages/insurance/insurance_details.dart @@ -0,0 +1,29 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter_html/flutter_html.dart'; +import 'package:html/dom.dart' as dom; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class InsuranceCardDetails extends StatelessWidget { + final String data; + + InsuranceCardDetails({this.data}); + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).cardDetail, + body: Center( + child: SingleChildScrollView( + child: Html( + data: data, + ), + ), + ), + ); + } +} diff --git a/lib/pages/insurance/insurance_page.dart b/lib/pages/insurance/insurance_page.dart new file mode 100644 index 00000000..f938d9e5 --- /dev/null +++ b/lib/pages/insurance/insurance_page.dart @@ -0,0 +1,261 @@ +import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../../locator.dart'; +import 'insurance_card_update_details.dart'; + +class InsurancePage extends StatelessWidget { + final InsuranceViewModel model; + InsuranceCardService _insuranceCardService = locator(); + + InsurancePage({Key key, this.model}) : super(key: key); + @override + Widget build(BuildContext context) { + return SingleChildScrollView( + child: Column( + children: [ + SizedBox( + height: 65, + ), + Container( + margin: EdgeInsets.all(10.0), + color: Colors.white, + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + if (model.user != null) + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, + left: 10.0, + right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + model.user.firstName ?? '' + " " + model.user.lastName ?? '', + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w500, + ), + SizedBox( + height: 8, + ), + Texts( + TranslationBase.of(context) + .fileno + + ": " + + model.user.patientID + .toString(), + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w500, + ) + ], + ), + ), + ), + Expanded( + flex: 2, + child: Container( + margin: EdgeInsets.only(top: 2.0), + child: Column( + children: [ + Container( + child: SecondaryButton( + label: TranslationBase.of( + context) + .fetchData, + small: true, + textColor: Colors.white, + onTap: () { + getDetails( + setupID: '010266', + projectID: 15, + patientIdentificationID: + model.user + .patientIdentificationNo, + patientID: model + .user.patientID, + name: model.user + .firstName + + " " + + model + .user.lastName,context: context); + }, + ), + ), + ], + ), + ), + ) + ], + ), + ), + if(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList != null ?? false) + ...List.generate(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length, (index) => + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3 + ? Container( + margin: EdgeInsets.all(10.0), + child: Card( + margin: EdgeInsets.fromLTRB( + 8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10), + ), + child: Container( + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, + left: 10.0, + right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Texts( + model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientName, + fontSize: 14, + color: Colors.black, + fontWeight: + FontWeight.w500, + ), + SizedBox( + height: 8, + ), + Texts( + TranslationBase.of( + context) + .fileno + + ": " + + model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientID + .toString(), + fontSize: 14, + color: Colors.black, + fontWeight: + FontWeight.w500, + ) + ], + ), + ), + ), + Expanded( + flex: 2, + child: Container( + margin: + EdgeInsets.only(top: 2.0), + child: Column( + children: [ + Container( + child: SecondaryButton( + label: TranslationBase + .of(context) + .fetchData, + small: true, + textColor: + Colors.white, + onTap: () { + getDetails( + projectID: 15, + patientIdentificationID: model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientIdenficationNumber, + setupID: + '010266', + patientID: model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .responseID, + name: model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index].patientName,context: context); + }, + ), + ), + ], + ), + ), + ) + ], + ), + ), + ), + ) + : Container() + ), + + ], + ), + ); + } + + getDetails( + {String setupID, + int projectID, + String patientIdentificationID, + int patientID, + String name,BuildContext context}) { + GifLoaderDialogUtils.showMyDialog(context); + _insuranceCardService + .getPatientInsuranceDetails( + setupID: setupID, + projectID: projectID, + patientID: patientID, + patientIdentificationID: patientIdentificationID) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) { + Navigator.push( + context, + FadePage( + page: InsuranceCardUpdateDetails( + insuranceCardDetailsModel: _insuranceCardService.insuranceCardDetailsList, + patientID: patientID, + patientIdentificationID: patientIdentificationID, + name: name, + ))); + } else { + AppToast.showErrorToast(message: _insuranceCardService.error); + } + }); + } +} diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart new file mode 100644 index 00000000..36b424a8 --- /dev/null +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -0,0 +1,232 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_details.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/cupertino.dart'; +import '../base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; + +import 'insurance_card_update_details.dart'; +import 'insurance_page.dart'; + +class InsuranceUpdate extends StatefulWidget { + @override + _InsuranceUpdateState createState() => _InsuranceUpdateState(); +} + +class _InsuranceUpdateState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + List imagesInfo = List(); + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png')); + } + + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getInsuranceUpdated(), + builder: (BuildContext context, InsuranceViewModel model, Widget child) => + AppScaffold( + appBarTitle: TranslationBase.of(context).insurCards, + description: TranslationBase.of(context).infoInsurCards, + infoList: TranslationBase.of(context).infoPrescriptionsPoints, + imagesInfo: imagesInfo, + isShowAppBar: true, + isShowDecPage: true, + baseViewModel: model, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(70.0), + child: Stack( + children: [ + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 1.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 5.7, + ), + ), + color: Colors.white, + ), + child: Center( + child: TabBar( + controller: _tabController, + isScrollable: true, + indicatorWeight: 4.0, + indicatorColor: Theme.of(context).primaryColor, + labelColor: Theme.of(context).primaryColor, + labelPadding: EdgeInsets.symmetric( + horizontal: 13.0, vertical: 2.0), + unselectedLabelColor: Colors.grey, + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.35, + child: Center( + child: Texts(TranslationBase.of(context) + .updateInsuranceSubtitle), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.35, + child: Center( + child: Texts(TranslationBase.of(context).history), + ), + ), + ], + ), + ), + ), + ) + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + InsurancePage(model:model), + Container( + child: ListView.builder( + itemCount: model.insuranceUpdate == null + ? 0 + : model.insuranceUpdate.length, + itemBuilder: (BuildContext context, int index) { + return Container( + margin: EdgeInsets.all(10.0), + child: Card( + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, + left: 10.0, + right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + model.user.firstName + + " " + + model.user.lastName, + fontSize: 14, + fontWeight: FontWeight.w500, + color: Colors.black, + ), + SizedBox( + height: 8, + ), + Texts( + TranslationBase.of(context) + .fileno + + ": " + + model + .insuranceUpdate[ + index] + .patientID + .toString(), + fontSize: 14, + fontWeight: FontWeight.w500, + color: Colors.black, + ), + SizedBox( + height: 8, + ), + Texts( + model.insuranceUpdate[index] + .createdOn, + fontSize: 14, + fontWeight: FontWeight.w500, + color: Colors.black, + ), + ], + ), + ), + ), + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.only(top: 20.0), + child: Column( + children: [ + Image.asset( + "assets/images/new-design/confirm_button.png", + width: 30.0, + height: 30.0), + Container( + margin: EdgeInsets.only( + top: 13.5, left: 2.0), + child: Texts( + model.insuranceUpdate[index] + .statusDescription, + textAlign: TextAlign.center, + fontSize: 12, + color: Colors.black, + ), + ), + ], + ), + ), + ) + ], + ), + ], + ), + ), + ), + ); + }), + ), + ], + )) + ], + ), + ), + ), + ); + } + + +} diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart new file mode 100644 index 00000000..3d49d707 --- /dev/null +++ b/lib/pages/landing/home_page.dart @@ -0,0 +1,842 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; +import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart'; +import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart'; +import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; +import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +class HomePage extends StatefulWidget { + final Function goToMyProfile; + + HomePage({Key key, this.goToMyProfile}); + + @override + _HomePageState createState() => _HomePageState(); +} + +class _HomePageState extends State { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getPatientRadOrders(), + builder: (_, model, wi) => AppScaffold( + isShowDecPage: false, + body: Container( + width: double.infinity, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack( + children: [ + Column( + children: [ + Container( + width: double.infinity, + height: 210, + decoration: BoxDecoration( + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/dashboard_top_bg.png'), + fit: BoxFit.cover), + ), + child: Stack( + children: [ + Positioned( + top: 15, + left: 5, + right: 5, + child: Container( + width: + MediaQuery.of(context).size.width * 0.8, + child: Row( + children: [ + Expanded( + child: Container( + height: 120, + padding: EdgeInsets.all(5), + margin: EdgeInsets.all(5), + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage( + "assets/images/new-design/covid_bg_transparent.png"), + fit: BoxFit.fill, + ), + color: + Colors.white.withOpacity(0.3), + borderRadius: BorderRadius.all( + Radius.circular(5))), + child: Container( + margin: EdgeInsets.only(top: 10.0), + child: Column( + children: [ + Text("COVID-19 TEST", + style: TextStyle( + color: Colors.white, + fontWeight: + FontWeight.bold, + fontSize: 18.0)), + Row( + children: [ + Container( + margin: EdgeInsets.only( + top: 15.0, left: 3.5, right: 3.5), + child: SvgPicture.asset( + 'assets/images/new-design/covid-19-car.svg', + width: 45.0, + height: 45.0), + ), + Container( + margin: EdgeInsets.only( + left: 10.0, + top: 10.0), + child: Column( + children: [ + Text("Drive-Thru", + style: TextStyle( + color: Colors + .white, + fontWeight: + FontWeight + .bold, + fontSize: + 16.0)), + ButtonTheme( + shape: + RoundedRectangleBorder( + borderRadius: + BorderRadius + .circular( + 5.0), + ), + minWidth: MediaQuery.of( + context) + .size + .width * + 0.15, + height: 25.0, + child: RaisedButton( + color: Colors + .red[800], + textColor: + Colors.white, + disabledTextColor: + Colors.white, + disabledColor: + new Color( + 0xFFbcc2c4), + onPressed: () { + navigateToCovidDriveThru(); + }, + child: Text( + "BOOK NOW", + style: TextStyle( + fontSize: + 12.0)), + ), + ), + ], + ), + ), + ], + ), + ], + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () => Navigator.push(context, + FadePage(page: LiveCareHome())), + child: Container( + height: 120, + padding: EdgeInsets.all(15), + margin: EdgeInsets.all(5), + decoration: BoxDecoration( + color: Colors.white + .withOpacity(0.3), + borderRadius: BorderRadius.all( + Radius.circular(5))), + child: SvgPicture.asset( + projectViewModel.isArabic + ? 'assets/images/new-design/livecare_arabic_logo.svg' + : 'assets/images/new-design/liveCare_white_logo.svg', + ), + ), + ), + ), + ], + ), + ), + ) + ], + ), + ), + Container(width: double.infinity, height: 80) + ], + ), + Positioned( + top: 155, + left: MediaQuery.of(context).size.width * + (MediaQuery.of(context).orientation == + Orientation.landscape + ? 0.02 + : 0.03), + right: MediaQuery.of(context).size.width * + (MediaQuery.of(context).orientation == + Orientation.landscape + ? 0.02 + : 0.03), + child: (!model.isLogin && projectViewModel.user == null) + ? Container( + width: double.infinity, + height: 125, + decoration: BoxDecoration( + color: HexColor('#A59E9E'), + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.transparent, width: 0.5), + borderRadius: + BorderRadius.all(Radius.circular(9)), + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/bg_graphic.png'), + fit: BoxFit.cover)), + child: Container( + margin: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 8, + ), + Texts( + TranslationBase.of(context).myMedicalFile, + color: Colors.black87, + bold: true, + fontSize: 23, + ), + SizedBox( + height: 5, + ), + Texts( + TranslationBase.of(context) + .myMedicalFileSubTitle, + color: Colors.black, + fontSize: 16, + ), + Align( + alignment: projectViewModel.isArabic + ? Alignment.bottomRight + : Alignment.bottomLeft, + child: InkWell( + onTap: () { + widget.goToMyProfile(); + }, + child: Container( + margin: EdgeInsets.all(2), + width: 90, + height: 30, + decoration: BoxDecoration( + color: HexColor('#D81A2E'), + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.transparent, + width: 0.5), + borderRadius: BorderRadius.all( + Radius.circular(9)), + ), + child: Center( + child: Texts( + TranslationBase.of(context) + .viewMore, + color: Colors.white, + fontSize: 12, + ), + ), + ), + ), + ) + ], + ), + ), + ) + : Container( + width: double.infinity, + height: 130, + decoration: BoxDecoration( + color: HexColor('#A59E9E'), + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.transparent, width: 0.5), + borderRadius: + BorderRadius.all(Radius.circular(9)), + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/bg_graphic.png'), + fit: BoxFit.cover), + ), + child: Container( + margin: EdgeInsets.all(5), + child: Column( + children: [ + Row( + children: [ + if (model.user != null) + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 8, + ), + Texts( + model.user.firstName + + " " + + model.user.lastName, + color: Colors.grey[100], + bold: true, + fontSize: 15, + ), + Texts( + '${model.user.patientID}', + color: Colors.white, + fontSize: 14, + ), + SizedBox( + height: 5, + ), + Texts( + '${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.genderDescription} ${model.user.ageDesc}', + color: Colors.grey[100], + fontWeight: FontWeight.normal, + fontSize: 14, + ), + ], + ), + ), + InkWell( + onTap: () { + widget.goToMyProfile(); + }, + child: Container( + margin: EdgeInsets.all(2), + width: 90, + height: 30, + decoration: BoxDecoration( + color: HexColor('#D81A2E'), + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.transparent, + width: 0.5), + borderRadius: BorderRadius.all( + Radius.circular(5), + ), + ), + child: Center( + child: Texts( + TranslationBase.of(context) + .viewMore, + color: Colors.white, + fontSize: 12, + ), + ), + ), + ) + ], + ), + Row( + //crossAxisAlignment: CrossAxisAlignment.center, + //mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Image.asset( + 'assets/images/height_icon.png', + width: 35, + height: 40, + ), + Texts( + "${model.heightCm}", + color: Colors.white, + ) + ], + ), + ), + SizedBox( + width: 3, + ), + Expanded( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Image.asset( + 'assets/images/weight_icon.png', + width: 25, + height: 40, + ), + Texts( + '${model.weightKg}', + color: Colors.white, + ) + ], + ), + ), + SizedBox( + width: 3, + ), + Expanded( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Image.asset( + 'assets/images/blood_icon.png', + width: 35, + height: 40, + ), + Texts( + '${model.booldType}', + color: Colors.white, + ) + ], + ), + ), + ], + ) + ], + ), + ), + ), + ), + ], + ), + if(projectViewModel.havePrivilege(64)||projectViewModel.havePrivilege(65)||projectViewModel.havePrivilege(67)) + Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + if(projectViewModel.havePrivilege(64)) + DashboardItem( + onTap: () { + Navigator.push( + context, + FadePage( + page: HomeHealthCareIndexPage(), + ), + ); + }, + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/home_health_care_icon.png', + width: 50, + height: 50, + ), + SizedBox( + height: 3, + ), + Texts( + TranslationBase.of(context) + .homeHealthCareService, + textAlign: TextAlign.center, + color: Colors.white, + bold: true, + fontSize: SizeConfig.textMultiplier * 1.7, + ) + ], + ), + ), + ), + height: MediaQuery.of(context).size.width * 0.4, + imageName: 'home_healthcare_service_bg.png', + opacity: 0.5, + ), + if(projectViewModel.havePrivilege(65)) + DashboardItem( + onTap: () => Navigator.push(context, FadePage(page: PharmacyPage())), + + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/pharmacy_logo.png', + width: 40, + height: 40, + ), + SizedBox( + height: 20, + ), + Texts( + TranslationBase.of(context).onlinePharmacy, + textAlign: TextAlign.center, + color: Colors.white, + bold: true, + fontSize: SizeConfig.textMultiplier * 1.7, + ) + ], + ), + ), + ), + height: MediaQuery.of(context).size.width * 0.4, + imageName: 'al-habib_onlne_pharmacy_bg.png', + ), + if(projectViewModel.havePrivilege(67)) + DashboardItem( + onTap: (){ + Navigator.push( + context, + FadePage( + page: CMCIndexPage(), + ), + ); + }, + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/comprehensive_medical_checkup_logo.png', + width: 50, + height: 50, + ), + SizedBox( + height: 3, + ), + Texts( + TranslationBase.of(context).emergencyService, + textAlign: TextAlign.center, + color: Colors.white, + bold: true, + fontSize: SizeConfig.textMultiplier * 1.7, + ) + ], + ), + ), + ), + height: MediaQuery.of(context).size.width * 0.4, + color: HexColor("#747C80"), + imageName: 'emergency_service_image.png', + ), + ], + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () => + Navigator.push(context, FadePage(page: PaymentService())), + child: Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.29, + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/al-habib_online_payment_service_icon.png', + height: 55, + ), + SizedBox( + height: 5, + ), + Texts( + TranslationBase.of(context) + .onlinePaymentService, + textAlign: TextAlign.center, + color: Colors.black87, + bold: false, + fontSize: SizeConfig.textMultiplier * 1.7, + ) + ], + ), + ), + ), + height: MediaQuery.of(context).size.width * 0.4, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Colors.white, + ), + ), + Container( + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/ereferral_service_icon.png', + width: 50, + height: 55, + ), + SizedBox( + height: 10, + ), + Texts( + TranslationBase.of(context) + .offersAndPackages, + textAlign: TextAlign.center, + color: Colors.black87, + bold: false, + fontSize: SizeConfig.textMultiplier * 1.7, + ) + ], + ), + ), + ), + width: MediaQuery.of(context).size.width * 0.29, + height: MediaQuery.of(context).size.width * 0.4, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Colors.white, + )), + if(projectViewModel.havePrivilege(60)) + Container( + width: MediaQuery.of(context).size.width * 0.29, + child: InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: ErOptions( + isAppbar: true, + ))), + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/Dr_Schedule_report.png', + width: 50, + height: 50, + ), + SizedBox( + height: 10, + ), + Texts( + TranslationBase.of(context) + .emergencyServices, + textAlign: TextAlign.center, + color: Colors.black87, + bold: false, + fontSize: SizeConfig.textMultiplier * 1.7, + ) + ], + ), + ), + ), + ), + height: MediaQuery.of(context).size.width * 0.4, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Colors.white, + ), + ), + ], + ), + ), + ), + SizedBox( + height: 5, + ), + Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + DashboardItem( + child: Container( + width: double.infinity, + padding: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).hMGService, + color: Colors.white, + fontWeight: FontWeight.normal, + ), + Texts( + TranslationBase.of(context) + .viewAllHabibMedicalService, + color: Colors.white, + fontWeight: FontWeight.normal, + fontSize: 10, + ), + Expanded( + child: Container(), + ), + Texts( + TranslationBase.of(context).viewMore, + color: Colors.white, + //fontWeight: FontWeight.normal, + ) + ], + ), + ), + height: 100, + imageName: 'contact_us_bg.png', + opacity: 0.5, + color: Colors.grey[700], + width: MediaQuery.of(context).size.width * 0.45, + onTap: () => Navigator.push( + context, FadePage(page: AllHabibMedicalService())), + ), + DashboardItem( + onTap: () { + // Navigator.push( + // context, FadePage(page: FeedbackHomePage())); + Navigator.push( + context, FadePage(page: ContactUsPage())); + }, + child: Container( + width: double.infinity, + padding: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).contactUs, + color: Colors.white, + fontWeight: FontWeight.normal, + ), + Texts( + TranslationBase.of(context).viewAllWaysReachUs, + color: Colors.white, + fontWeight: FontWeight.normal, + fontSize: 10, + ), + Expanded( + child: Container(), + ), + Texts( + TranslationBase.of(context).viewMore, + color: Colors.white, + fontWeight: FontWeight.normal, + ) + ], + ), + ), + height: 100, + imageName: 'contact_us_bg.png', + opacity: 0.5, + color: Colors.grey[700], + width: MediaQuery.of(context).size.width * 0.45, + ), + ], + ), + ), + SizedBox( + height: 120, + ) + ], + ), + ), + ), + ), + ); + } + + navigateToCovidDriveThru() { + Navigator.push(context, + MaterialPageRoute(builder: (context) => CovidDrivethruLocation())); + } +} + +class DashboardItem extends StatelessWidget { + const DashboardItem( + {this.hasBorder = false, + this.imageName, + @required this.child, + this.onTap, + Key key, + this.width, + this.height, + this.color, + this.opacity = 0.4, + this.hasColorFilter = true}) + : super(key: key); + final bool hasBorder; + final String imageName; + final Widget child; + final Function onTap; + final double width; + final double height; + final Color color; + final double opacity; + final bool hasColorFilter; + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: onTap, + child: Container( + width: width != null ? width : MediaQuery.of(context).size.width * 0.29, + height: height != null + ? height + : MediaQuery.of(context).orientation == Orientation.portrait + ? MediaQuery.of(context).size.height * 0.19 + : MediaQuery.of(context).size.height * 0.35, + decoration: BoxDecoration( + color: !hasBorder + ? color != null + ? color + : HexColor('#050705').withOpacity(opacity) + : Colors.white, + borderRadius: BorderRadius.circular(6.0), + border: hasBorder + ? Border.all(width: 1.0, color: const Color(0xffcccccc)) + : Border.all(width: 0.0, color: Colors.transparent), + image: imageName != null + ? DecorationImage( + image: ExactAssetImage('assets/images/$imageName'), + fit: BoxFit.cover, + colorFilter: hasColorFilter ? new ColorFilter.mode( + Colors.black.withOpacity(0.2), BlendMode.dstIn) : null, + ) + : null, + ), + child: Center( + child: child, + ), + ), + ); + } +} diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart new file mode 100644 index 00000000..e1dd6b63 --- /dev/null +++ b/lib/pages/landing/landing_page.dart @@ -0,0 +1,630 @@ +import 'dart:io'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/geofencing/requests/GeoZonesRequestModel.dart'; +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/service/geofencing/GeofencingServices.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; +import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; +import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; +import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart'; +import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' + as family; +import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; +import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; +import 'package:diplomaticquarterapp/uitl/HMGNetworkConnectivity.dart'; +import 'package:diplomaticquarterapp/uitl/HMG_Geofence.dart'; +import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; +import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; +import 'package:firebase_messaging/firebase_messaging.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_local_notifications/flutter_local_notifications.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'package:provider/provider.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import '../../locator.dart'; +import '../../routes.dart'; +import 'home_page.dart'; + +class LandingPage extends StatefulWidget { + static bool isOpenCallPage = false; + + static IncomingCallData incomingCallData = new IncomingCallData(); + + @override + _LandingPageState createState() => _LandingPageState(); +} + +class _LandingPageState extends State with WidgetsBindingObserver { + var authProvider = new AuthProvider(); + + int currentTab = 0; + PageController pageController; + ProjectViewModel projectViewModel; + var notificationCount = ''; + var themeNotifier; + + ///inject the user data + AuthenticatedUserObject authenticatedUserObject = locator< + AuthenticatedUserObject>(); + + final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); + final authService = new AuthProvider(); + var event = RobotProvider(); + var familyFileProvider = family.FamilyFilesProvider(); + + void _requestIOSPermissions() { + flutterLocalNotificationsPlugin + .resolvePlatformSpecificImplementation< + IOSFlutterLocalNotificationsPlugin>() + ?.requestPermissions( + alert: true, + badge: true, + sound: true, + ); + } + + bool isPageNavigated = false; + LocationUtils locationUtils; + + _changeCurrentTab(int tab) { + setState(() { + currentTab = tab; + pageController.jumpToPage(tab); + }); + } + + @override + void didChangeAppLifecycleState(AppLifecycleState state) { + super.didChangeAppLifecycleState(state); + + var route = ModalRoute.of(context); + + if (route != null) { + print(route.settings.name); + } + + //setState(() { + print("didChangeAppLifecycleState"); + print('state = $state'); + AppGlobal.context = context; + if (state == AppLifecycleState.resumed) { + print(LandingPage.isOpenCallPage); + if (LandingPage.isOpenCallPage) { + if (!isPageNavigated) { + isPageNavigated = true; + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + IncomingCall( + incomingCallData: LandingPage.incomingCallData))) + .then((value) { + isPageNavigated = false; + }); + } + } + } + + if (state == AppLifecycleState.paused) { + isPageNavigated = false; + } + + if (state == AppLifecycleState.inactive) { + isPageNavigated = false; + } + //}); + } + + @override + void dispose() { + WidgetsBinding.instance.removeObserver(this); + super.dispose(); + } + + @override + void initState() { + super.initState(); + WidgetsBinding.instance.addObserver(this); + //setState(() { + AppGlobal.context = context; + // }); + _requestIOSPermissions(); + pageController = PageController(keepPage: true); + _firebaseMessaging.setAutoInitEnabled(true); + + // HMG (Guest/Internet) Wifi Access [Zohaib Kambrani] + HMGNetworkConnectivity(context, () { + GifLoaderDialogUtils.showMyDialog(context); + PlatformBridge().connectHMGGuestWifi().then((value) => + { + GifLoaderDialogUtils.hideDialog(context) + }); + }).checkAndConnectIfNoInternet(); + + if (Platform.isIOS) { + _firebaseMessaging.requestNotificationPermissions(); + } + + // Flip Permission Checks [Zohaib Kambrani] + requestPermissions().then((results) { + if (results[Permission.notification].isGranted) + _firebaseMessaging.getToken().then((String token) { + sharedPref.setString(PUSH_TOKEN, token); + if (token != null && DEVICE_TOKEN == "") { + DEVICE_TOKEN = token; + checkUserStatus(token); + } + }); + + if (results[Permission.location].isGranted); + if (results[Permission.storage].isGranted); + if (results[Permission.camera].isGranted); + if (results[Permission.photos].isGranted); + if (results[Permission.accessMediaLocation].isGranted); + if (results[Permission.calendar].isGranted); + }); + requestPermissions(); + // }); + // + // //_firebase Background message handler + // _firebaseMessaging.configure( + // // onMessage: (Map message) async { + // // showDialog("onMessage: $message"); + // // print("onMessage: $message"); + // // print(message); + // // print(message['name']); + // // print(message['appointmentdate']); + // // + // // if (Platform.isIOS) { + // // if (message['is_call'] == "true") { + // // var route = ModalRoute.of(context); + // // + // // if (route != null) { + // // print(route.settings.name); + // // } + // // + // // Map myMap = new Map.from(message); + // // print(myMap); + // // LandingPage.isOpenCallPage = true; + // // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + // // if (!isPageNavigated) { + // // isPageNavigated = true; + // // Navigator.push( + // // context, + // // MaterialPageRoute( + // // builder: (context) => IncomingCall( + // // incomingCallData: LandingPage.incomingCallData))) + // // .then((value) { + // // isPageNavigated = false; + // // }); + // // } + // // } else { + // // print("Is Call Not Found iOS"); + // // } + // // } else { + // // print("Is Call Not Found iOS"); + // // } + // // + // // if (Platform.isAndroid) { + // // if (message['data'].containsKey("is_call")) { + // // var route = ModalRoute.of(context); + // // + // // if (route != null) { + // // print(route.settings.name); + // // } + // // + // // Map myMap = + // // new Map.from(message['data']); + // // print(myMap); + // // LandingPage.isOpenCallPage = true; + // // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + // // if (!isPageNavigated) { + // // isPageNavigated = true; + // // Navigator.push( + // // context, + // // MaterialPageRoute( + // // builder: (context) => IncomingCall( + // // incomingCallData: LandingPage.incomingCallData))) + // // .then((value) { + // // isPageNavigated = false; + // // }); + // // } + // // } else { + // // print("Is Call Not Found Android"); + // // } + // // } else { + // // print("Is Call Not Found Android"); + // // } + // // }, + // // onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, + // // onLaunch: (Map message) async { + // // print("onLaunch: $message"); + // // showDialog("onLaunch: $message"); + // // }, + // // onResume: (Map message) async { + // // print("onResume: $message"); + // // print(message); + // // print(message['name']); + // // print(message['appointmentdate']); + // // + // // showDialog("onResume: $message"); + // // + // // if (Platform.isIOS) { + // // if (message['is_call'] == "true") { + // // var route = ModalRoute.of(context); + // // + // // if (route != null) { + // // print(route.settings.name); + // // } + // // + // // Map myMap = + // // new Map.from(message); + // // print(myMap); + // // LandingPage.isOpenCallPage = true; + // // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + // // if (!isPageNavigated) { + // // isPageNavigated = true; + // // Navigator.push( + // // context, + // // MaterialPageRoute( + // // builder: (context) => IncomingCall( + // // incomingCallData: LandingPage.incomingCallData))) + // // .then((value) { + // // isPageNavigated = false; + // // }); + // // } + // // } else { + // // print("Is Call Not Found iOS"); + // // } + // // } else { + // // print("Is Call Not Found iOS"); + // // } + // // }, + // ); + } + + showDialogs(String message) { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: message, + okText: TranslationBase + .of(context) + .confirm, + cancelText: TranslationBase + .of(context) + .cancel_nocaps, + okFunction: () => {}, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + + Future> requestPermissions() async { + var permissionResults = [ + Permission.location, + Permission.locationAlways, + Permission.storage, + Permission.camera, + Permission.photos, + Permission.notification, + Permission.accessMediaLocation, + Permission.calendar, + ].request(); + + var permissionsGranted = await deviceCalendarPlugin.hasPermissions(); + if (permissionsGranted.isSuccess && !permissionsGranted.data) { + permissionsGranted = await deviceCalendarPlugin.requestPermissions(); + if (!permissionsGranted.isSuccess || !permissionsGranted.data) {} + } + return permissionResults; + } + + setTheme() async { + // + // defaultTheme = + // ThemeData( + // fontFamily:projectViewModel.isArabic ? 'Cairo' : 'WorkSans', + // primarySwatch: Colors.blue, + // visualDensity: VisualDensity.adaptivePlatformDensity, + // brightness: Brightness.light, + // pageTransitionsTheme: const PageTransitionsTheme( + // builders: { + // TargetPlatform.android: ZoomPageTransitionsBuilder(), + // TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), + // }, + // ), + // hintColor: Colors.grey[400], + // disabledColor: Colors.grey[300], + // errorColor: Color.fromRGBO(235, 80, 60, 1.0), + // scaffoldBackgroundColor: Color(0xffEEEEEE), + // textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), + // textSelectionHandleColor: Colors.grey, + // canvasColor: Colors.white, + // backgroundColor: Colors.white, + // highlightColor: Colors.grey[100].withOpacity(0.4), + // splashColor: Colors.transparent, + // primaryColor: Color(0xff40ACC9), + // bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), + // cursorColor: Colors.grey, + // cardColor: Colors.white, + // iconTheme: IconThemeData(), + // appBarTheme: AppBarTheme( + // color: Color(0xff40ACC9), + // brightness: Brightness.dark, + // elevation: 10.0, + // actionsIconTheme: IconThemeData( + // color: Color(0xff40ACC9), + // ), + // ), + // ); + // themeNotifier.setTheme(defaultTheme); + } + + void checkUserStatus(token, {isLoader = true}) async { + if (isLoader) + //GifLoaderDialogUtils.showMyDialog(context); + authService + .selectDeviceImei(token) + .then((SelectDeviceIMEIRES value) => setUserValues(value)) + .catchError((err) { + //GifLoaderDialogUtils.hideDialog(context); + }); + } + + static Future myBackgroundMessageHandler( + Map message) async { + Map myMap = new Map.from(message['data']); + if (message.containsKey('data')) { + print("myBackgroundMessageHandler Inside"); + LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + print(LandingPage.incomingCallData.doctorname); + LandingPage.isOpenCallPage = true; + } + + if (message.containsKey('notification')) { + final dynamic notification = message['notification']; + print(notification); + } + } + + void setUserValues(value) async { + if (value != null) sharedPref.setObject(IMEI_USER_DATA, value); + } + + Future getUserInformation() async { + var userInfoJson = sharedPref.getObject(IMEI_USER_DATA); + return userInfoJson; + } + + checkValue(projectProvider) { + if (projectProvider.searchValue != null) { + _changeCurrentTab(2); + } + } + + registerGeofences() async { + await locator().getAllGeoZones(GeoZonesRequestModel()); + + void doIt() { + getUserInformation().then((value) { + if (value != null) projectViewModel.platformBridge() + .registerHmgGeofences(); + }); + } + + if (await Permission.location.isGranted) { + doIt(); + } else { + [Permission.location].request().then((value) async { + if (await Permission.location.isGranted) { + doIt(); + } + }); + } + + requestPermissions().then((results) {}); + } + + login() async { + var data = await sharedPref.getObject(IMEI_USER_DATA); + sharedPref.remove(REGISTER_DATA_FOR_LOGIIN); + if (data != null) { + Navigator.of(context).pushNamed(CONFIRM_LOGIN); + } else { + GifLoaderDialogUtils.showMyDialog(context); + authService + .selectDeviceImei(DEVICE_TOKEN) + .then((SelectDeviceIMEIRES value) { + GifLoaderDialogUtils.hideDialog(context); + if (value != null) { + setUserValues(value); + Navigator.of(context).pushNamed(CONFIRM_LOGIN); + } else { + Navigator.of(context).pushNamed( + WELCOME_LOGIN, + ); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + Navigator.of(context).pushNamed( + WELCOME_LOGIN, + ); + }); + } + } + + getNotificationCount(token) async { + if (await sharedPref.getObject(USER_PROFILE) != null) { + var data = + AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + if (data != null) { + authService + .registeredAuthenticatedUser(data, token, 0, 0) + .then((res) => {print(res)}); + authService.getDashboard().then((value) => + { + setState(() { + notificationCount = value['List_PatientDashboard'][0] + ['UnreadPatientNotificationCount'] > + 99 + ? '99+' + : value['List_PatientDashboard'][0] + ['UnreadPatientNotificationCount'] + .toString(); + + sharedPref.setString(NOTIFICATION_COUNT, notificationCount); + }) + }); + familyFileProvider.getSharedRecordByStatus(); + } + } + } + + + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + + return Scaffold( + appBar: AppBar( + elevation: 0, + textTheme: TextTheme( + headline6: TextStyle( + color: Colors.white, fontWeight: FontWeight.bold), + ), + title: Text( + getText(currentTab).toUpperCase(), + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.white, + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), + // bold: true, + // color: Colors.white, + ), + leading: Builder( + builder: (BuildContext context) { + return new Stack( + children: [ + IconButton( + icon: Icon(Icons.menu), + color: Colors.white, + onPressed: () => Scaffold.of(context).openDrawer(), + ), + notificationCount != '' + ? new Positioned( + right: projectViewModel.isArabic ? 35 : 0, + top: 5, + child: new Container( + padding: EdgeInsets.all(4), + decoration: new BoxDecoration( + color: Colors.red, + borderRadius: BorderRadius.circular(20), + ), + constraints: BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: new Text( + notificationCount, + style: new TextStyle( + color: Colors.white, + fontSize: projectViewModel.isArabic ? 8 : 9, + ), + textAlign: TextAlign.center, + ), + ), + ) + : SizedBox() + ], + ); + }, + ), + actions: [ + IconButton( + //iconSize: 70, + icon: Icon( + projectViewModel.isLogin ? Icons.settings : Icons.login, + color: Colors.white, + ), + onPressed: () { + if (projectViewModel.isLogin) + Navigator.of(context).pushNamed( + SETTINGS, + ); + else + login(); + }, //do something, + ) + ], + centerTitle: true, + ), + drawer: SafeArea(child: AppDrawer()), + extendBody: true, + body: PageView( + physics: NeverScrollableScrollPhysics(), + controller: pageController, + children: [ + HomePage( + goToMyProfile: () { + _changeCurrentTab(1); + }, + ), + MedicalProfilePage(), + BookingOptions(), + MyFamily(isAppbarVisible: false), + ToDo(isShowAppBar: false), + ], // Please do not remove the BookingOptions from this array + ), + bottomNavigationBar: BottomNavBar( + changeIndex: _changeCurrentTab, + index: currentTab, + ), + floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, + floatingActionButton: currentTab == 0 + ? FloatingButton( + elevation: true, + onTap: () { + _changeCurrentTab(2); + }) + : null); + } + + triggerRobot() { + event.setValue({"isRobot": 'true'}); + } + + getText(currentTab) { + switch (currentTab) { + case 0: + return TranslationBase.of(context).home; + case 1: + return TranslationBase.of(context).medicalProfile; + case 2: + return TranslationBase.of(context).bookAppo; + case 3: + return TranslationBase.of(context).services; + case 4: + return TranslationBase + .of(context) + .bookAppo; + } + } +} + + diff --git a/lib/pages/landing/replay_page.dart b/lib/pages/landing/replay_page.dart new file mode 100644 index 00000000..368f7a1c --- /dev/null +++ b/lib/pages/landing/replay_page.dart @@ -0,0 +1,15 @@ +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ReplayPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return AppScaffold( + body: Center( + child: InkWell(onTap: () {}, child: Texts('Replay Page')), + ), + ); + } +} diff --git a/lib/pages/livecare/incoming_call.dart b/lib/pages/livecare/incoming_call.dart new file mode 100644 index 00000000..de80b4ae --- /dev/null +++ b/lib/pages/livecare/incoming_call.dart @@ -0,0 +1,255 @@ +import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart'; +import 'package:diplomaticquarterapp/models/LiveCare/room_model.dart'; +import 'package:diplomaticquarterapp/pages/conference/conference_page.dart'; +import 'package:diplomaticquarterapp/pages/conference/widgets/platform_exception_alert_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:just_audio/just_audio.dart'; + +class IncomingCall extends StatefulWidget { + IncomingCallData incomingCallData; + + IncomingCall({@required this.incomingCallData}); + + @override + _IncomingCallState createState() => _IncomingCallState(); +} + +class _IncomingCallState extends State + with SingleTickerProviderStateMixin { + AnimationController _animationController; + + final player = AudioPlayer(); + + @override + void initState() { + _animationController = + AnimationController(vsync: this, duration: Duration(milliseconds: 500)); + + WidgetsBinding.instance.addPostFrameCallback((_) => _runAnimation()); + + print(widget.incomingCallData.doctorname); + print(widget.incomingCallData.clinicname); + print(widget.incomingCallData.speciality); + + super.initState(); + } + + @override + void dispose() { + _animationController.dispose(); + player.stop(); + disposeAudioResources(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: false, + body: SafeArea( + child: Container( + decoration: BoxDecoration(color: Colors.grey[700]), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + margin: EdgeInsets.only(top: 30.0), + alignment: Alignment.center, + child: Text("Incoming Video Call", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 26.0, + color: Colors.white, + letterSpacing: 1.0)), + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.fromLTRB(50.0, 30.0, 50.0, 20.0), + child: Image.asset( + 'assets/images/new-design/hmg_full_logo_hd_white.png'), + ), + Container( + margin: EdgeInsets.fromLTRB(30.0, 10.0, 30.0, 0.0), + child: Divider( + color: Colors.white, + thickness: 1.0, + ), + ), + Container( + margin: EdgeInsets.only(top: 20.0), + alignment: Alignment.center, + child: Text("Dr Eyad Ismail Abu Jayab", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 22.0, + fontWeight: FontWeight.bold, + letterSpacing: 0.8, + color: Colors.white)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.center, + child: Text("ENT Clinic", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 22.0, + letterSpacing: 0.8, + color: Colors.white)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.center, + child: Text("Speciality", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 22.0, + letterSpacing: 0.8, + color: Colors.white)), + ), + Container( + decoration: BoxDecoration( + color: Colors.grey[900].withOpacity(0.8), + borderRadius: BorderRadius.all(Radius.circular(10.0)), + ), + padding: EdgeInsets.all(20.0), + margin: EdgeInsets.only(top: 20.0), + child: Column( + children: [ + Text("Appointment Information", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + letterSpacing: 1.0, + color: Colors.white)), + Container( + margin: EdgeInsets.only(top: 20.0), + child: Text("Sun, 15th Dec, 2019, 09:00", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 20.0, + letterSpacing: 1.0, + color: Colors.white)), + ), + Container( + margin: EdgeInsets.only(top: 20.0), + child: Text("ENT Clinic", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 20.0, + letterSpacing: 1.0, + color: Colors.white)), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 100.0), + alignment: Alignment.center, + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + RotationTransition( + turns: Tween(begin: 0.0, end: -.1) + .chain(CurveTween(curve: Curves.elasticIn)) + .animate(_animationController), + child: Container( + child: RawMaterialButton( + onPressed: () { + _submit(); + }, + elevation: 2.0, + fillColor: Colors.green, + child: Icon( + Icons.call, + color: Colors.white, + size: 35.0, + ), + padding: EdgeInsets.all(15.0), + shape: CircleBorder(), + ), + )), + Container( + child: RawMaterialButton( + onPressed: () { + backToHome(); + }, + elevation: 2.0, + fillColor: Colors.red, + child: Icon( + Icons.call_end, + color: Colors.white, + size: 35.0, + ), + padding: EdgeInsets.all(15.0), + shape: CircleBorder(), + ), + ), + ], + ), + ), + ], + )), + ), + ); + } + + void _runAnimation() async { + setAudioFile(); + for (int i = 0; i < 100; i++) { + await _animationController.forward(); + await _animationController.reverse(); + } + } + + Future _submit() async { + backToHome(); + try { + final roomModel = RoomModel( + name: widget.incomingCallData.name, + token: widget.incomingCallData.sessionId, + identity: widget.incomingCallData.identity); + + await Navigator.of(context).push( + MaterialPageRoute( + fullscreenDialog: true, + builder: (BuildContext context) => + ConferencePage(roomModel: roomModel), + ), + ); + } catch (err) { + print(err); + await PlatformExceptionAlertDialog( + exception: err, + ).show(context); + } + } + + void backToHome() { + player.stop(); +// disposeAudioResources(); + Navigator.of(context).pop(); + } + + disposeAudioResources() async { + await player.dispose(); + } + + void setAudioFile() async { + player.stop(); + await player.setVolume(1.0); // full volume + try { + await player.setAsset('assets/sounds/ring_60Sec.mp3').then((value) { + player.setLoopMode(LoopMode.one); // loop ring sound + player.play(); + }).catchError((err) { + print("Error: $err"); + }); + } catch (e) { + print("Error: $e"); + } + } +} diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart new file mode 100644 index 00000000..fc5c4eab --- /dev/null +++ b/lib/pages/livecare/livecare_home.dart @@ -0,0 +1,132 @@ +import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart'; +import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCarePendingRequest.dart'; +import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_list.dart'; +import 'package:diplomaticquarterapp/pages/livecare/widgets/livecare_logs.dart'; +import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +import 'livecare_type_select.dart'; + +class LiveCareHome extends StatefulWidget { + static bool showFooterButton = true; + + @override + _LiveCareHomeState createState() => _LiveCareHomeState(); +} + +class _LiveCareHomeState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + bool isDataLoaded = false; + bool hasLiveCareRequest = false; + + List erRequestHistoryList; + + ErRequestHistoryList pendingERRequestHistoryList; + + @override + void initState() { + _tabController = new TabController(length: 2, vsync: this); + erRequestHistoryList = List(); + + pendingERRequestHistoryList = new ErRequestHistoryList(); + + WidgetsBinding.instance.addPostFrameCallback((_) => getLiveCareHistory()); + + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "LiveCare", + isShowAppBar: true, + body: Container( + child: Column(children: [ + /// this is will not colored with theme data + TabBar( + tabs: [ + Tab(text: TranslationBase.of(context).consultation), + Tab(text: TranslationBase.of(context).logs), + ], + controller: _tabController, + ), + Divider( + color: Colors.grey[600], + thickness: 0.5, + ), + Expanded( + child: TabBarView( + physics: NeverScrollableScrollPhysics(), + children: [ + isDataLoaded && !hasLiveCareRequest + ? ClinicList( + getLiveCareHistory: getLiveCareHistory, + ) + : isDataLoaded + ? LiveCarePendingRequest( + getLiveCareHistory: getLiveCareHistory, + pendingERRequestHistoryList: + pendingERRequestHistoryList) + : Container(), + isDataLoaded + ? LiveCareLogs( + erRequestHistoryList: erRequestHistoryList, + ) + : Container(), + ], + controller: _tabController, + ), + ), + ]), + ), + ); + } + + void getLiveCareHistory() { + setState(() { + isDataLoaded = false; + hasLiveCareRequest = false; + }); + LiveCareService service = new LiveCareService(); + PatientERVirtualHistoryResponse patientERVirtualHistoryResponse = + new PatientERVirtualHistoryResponse(); + service + .getLivecareHistory(context) + .then((res) { + setState(() { + print(res['ErRequestHistoryList'].length); + if (res['ErRequestHistoryList'].length != 0) { + patientERVirtualHistoryResponse = + PatientERVirtualHistoryResponse.fromJson(res); + erRequestHistoryList = + patientERVirtualHistoryResponse.erRequestHistoryList; + + if (patientERVirtualHistoryResponse + .erRequestHistoryList[0].callStatus < + 4) { + pendingERRequestHistoryList = + patientERVirtualHistoryResponse.erRequestHistoryList[0]; + hasLiveCareRequest = true; + } else { + hasLiveCareRequest = false; + } + } + }); + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + setState(() { + isDataLoaded = true; + }); + }); + } +} diff --git a/lib/pages/livecare/livecare_scheduling/livecare_scheduling_clinic_list.dart b/lib/pages/livecare/livecare_scheduling/livecare_scheduling_clinic_list.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/livecare/livecare_scheduling/schedule_clinic_card.dart b/lib/pages/livecare/livecare_scheduling/schedule_clinic_card.dart new file mode 100644 index 00000000..4309cc62 --- /dev/null +++ b/lib/pages/livecare/livecare_scheduling/schedule_clinic_card.dart @@ -0,0 +1,51 @@ +import 'package:diplomaticquarterapp/models/LiveCare/LiveCareScheduleClinicsListResponse.dart'; +import 'package:flutter/material.dart'; + +class ScheduleClinicCard extends StatefulWidget { + bool isSelected; + final ClinicsHaveScheduleList clinicsHaveScheduleList; + var languageID; + + ScheduleClinicCard( + {this.isSelected, + this.languageID, + @required this.clinicsHaveScheduleList}); + + @override + _ScheduleClinicCardState createState() => _ScheduleClinicCardState(); +} + +class _ScheduleClinicCardState extends State { + @override + Widget build(BuildContext context) { + return Container( + child: Card( + margin: EdgeInsets.fromLTRB(15.0, 10.0, 15.0, 8.0), + color: widget.isSelected ? Colors.blue : Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + width: MediaQuery.of(context).size.width * 0.8, + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + child: Text( + widget.languageID == 'ar' + ? widget.clinicsHaveScheduleList.clinicDescN + : widget.clinicsHaveScheduleList.clinicDesc, + style: TextStyle( + fontSize: 16.0, + color: + widget.isSelected ? Colors.white : Colors.black)), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/livecare/livecare_type_select.dart b/lib/pages/livecare/livecare_type_select.dart new file mode 100644 index 00000000..833c9698 --- /dev/null +++ b/lib/pages/livecare/livecare_type_select.dart @@ -0,0 +1,227 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class LiveCareTypeSelect extends StatefulWidget { + @override + _LiveCareTypeSelectState createState() => _LiveCareTypeSelectState(); +} + +class _LiveCareTypeSelectState extends State { + var languageID; + AppSharedPreferences sharedPref = AppSharedPreferences(); + + @override + void initState() { + getLanguageID(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + leading: InkWell( + onTap: () { + Navigator.pop(context, null); + }, + child: Icon( + Icons.close, + color: Colors.white, + ), + ), + title: Text(TranslationBase.of(context).bookAppo, + style: TextStyle(color: Colors.white)), + ), + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 20.0, right: 20.0), + child: Column( + children: [ + Container( + alignment: Alignment.center, + margin: EdgeInsets.only(top: 15.0, bottom: 10.0), + child: Image.asset( + languageID == 'ar' + ? "assets/images/new-design/liveCare_ar_bg.png" + : "assets/images/new-design/liveCare_en_bg.png", + width: 120), + ), + Container( + alignment: Alignment.center, + child: Text("LiveCare Service", + style: TextStyle( + fontWeight: FontWeight.bold, fontSize: 20.0))), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.center, + child: Text( + "is to obtain medical advice with a specialist doctor Via a video call", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 18.0))), + Container( + margin: EdgeInsets.only(top: 15.0), + alignment: Alignment.centerLeft, + child: Text("WHY LIVECARE?", + style: TextStyle( + fontWeight: FontWeight.bold, fontSize: 20.0))), + Container( + margin: EdgeInsets.only(top: 20.0, left: 20.0), + child: Row( + children: [ + SvgPicture.asset("assets/images/new-design/check_icon.svg", + width: 25), + Container( + width: MediaQuery.of(context).size.width * 0.72, + margin: EdgeInsets.all(10.0), + child: Text( + "No need to wait, you will get Medical consultation immediately via Video call.", + overflow: TextOverflow.clip, + style: TextStyle(fontSize: 14.0)), + ) + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 5.0, left: 20.0), + child: Row( + children: [ + SvgPicture.asset("assets/images/new-design/check_icon.svg", + width: 25), + Container( + width: MediaQuery.of(context).size.width * 0.72, + margin: EdgeInsets.all(10.0), + child: Text("The doctor will see your medical file.", + overflow: TextOverflow.clip, + style: TextStyle(fontSize: 14.0)), + ) + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 5.0, left: 20.0), + child: Row( + children: [ + SvgPicture.asset("assets/images/new-design/check_icon.svg", + width: 25), + Container( + width: MediaQuery.of(context).size.width * 0.72, + margin: EdgeInsets.all(10.0), + child: Text("Free Prescription delivery service.", + overflow: TextOverflow.clip, + style: TextStyle(fontSize: 14.0)), + ) + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 20.0), + child: Text( + "** The service is included with some insurance companies according to the terms and conditions With our best wishes for health and wellness", + style: TextStyle(fontSize: 16.0))), + InkWell( + onTap: (){ + Navigator.pop(context, "immediate"); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.red[900], + borderRadius: BorderRadius.all(Radius.circular(10.0))), + height: 120.0, + margin: EdgeInsets.only(top: 20.0), + child: Row( + children: [ + Container( + margin: EdgeInsets.only(left: 20.0), + child: SvgPicture.asset( + "assets/images/new-design/liveCare_logo_icon_white.svg", + width: 80), + ), + Container( + width: MediaQuery.of(context).size.width * 0.56, + margin: EdgeInsets.fromLTRB(30.0, 20.0, 0.0, 0.0), + child: Column( + children: [ + Text("Get Medical consultation immediately", + overflow: TextOverflow.clip, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 18.0, + color: Colors.white)), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.centerLeft, + child: Text("Instant video call", + style: TextStyle( + fontSize: 18.0, color: Colors.white)), + ) + ], + ), + ), + ], + )), + ), + InkWell( + onTap: (){ + Navigator.pop(context, "schedule"); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.grey[700], + borderRadius: BorderRadius.all(Radius.circular(10.0))), + height: 120.0, + margin: EdgeInsets.only(top: 20.0), + child: Row( + children: [ + Container( + margin: EdgeInsets.only(left: 20.0), + child: Image.asset( + "assets/images/new-design/calendar.png", + width: 70), + ), + Container( + width: MediaQuery.of(context).size.width * 0.58, + margin: EdgeInsets.fromLTRB(30.0, 30.0, 0.0, 0.0), + child: Column( + children: [ + Container( + alignment: Alignment.centerLeft, + child: Text("Book Appointment", + overflow: TextOverflow.clip, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 18.0, + color: Colors.white)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.centerLeft, + child: Text("Schedule Video Call", + style: TextStyle( + fontSize: 18.0, color: Colors.white)), + ) + ], + ), + ), + ], + )), + ), + SizedBox( + height: 40.0, + ), + ], + ), + ), + ), + ); + } + + getLanguageID() async { + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + setState(() { + this.languageID = languageID; + }); + } +} diff --git a/lib/pages/livecare/widgets/ClinicTimingsDialog.dart b/lib/pages/livecare/widgets/ClinicTimingsDialog.dart new file mode 100644 index 00000000..d5fce79e --- /dev/null +++ b/lib/pages/livecare/widgets/ClinicTimingsDialog.dart @@ -0,0 +1,118 @@ +import 'package:diplomaticquarterapp/models/LiveCare/ClinicsServiceTimingsResponse.dart'; +import 'package:flutter/material.dart'; + +class ClinicTimingsDialog extends StatefulWidget { + final clinicName; + final List + patientERGetClinicsServiceTimingsList; + + ClinicTimingsDialog( + {@required this.clinicName, + @required this.patientERGetClinicsServiceTimingsList}); + + @override + _ClinicTimingsDialogState createState() => _ClinicTimingsDialogState(); +} + +class _ClinicTimingsDialogState extends State { + @override + void initState() { + print(widget.patientERGetClinicsServiceTimingsList); + super.initState(); + } + + @override + Widget build(BuildContext context) { + var size = MediaQuery.of(context).size; + final double itemHeight = ((size.height - kToolbarHeight - 24) * 0.42) / 2; + final double itemWidth = size.width / 2; + return Container( + child: Dialog( + shape: + RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)), + child: Container( + height: MediaQuery.of(context).size.height * 0.68, + margin: EdgeInsets.all(20.0), + width: 450.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + alignment: Alignment.center, + margin: EdgeInsets.only(bottom: 10.0), + child: Text("Clinic Schedule", + textAlign: TextAlign.center, + style: + TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + Divider( + thickness: 1.0, + color: Colors.grey[400], + ), + Container( + margin: EdgeInsets.only(bottom: 20.0, top: 10.0), + child: Text(widget.clinicName, + style: + TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + CustomScrollView( + primary: false, + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + slivers: [ + SliverPadding( + padding: const EdgeInsets.fromLTRB(15, 0, 15, 0), + sliver: SliverGrid.count( + crossAxisCount: 2, + childAspectRatio: (itemWidth / itemHeight), + children: widget.patientERGetClinicsServiceTimingsList + .map((e) => Container( + height: 10.0, + child: Column( + children: [ + Text(e.dayOfWeekStr), + Text(e.shiftTimings[0].startTime + + " - " + + e.shiftTimings[0].endTime), + ], + ), + )) + .toList()), + ), + ], + ), + Divider( + thickness: 1.0, + color: Colors.grey[400], + ), + Container( + alignment: Alignment.center, + height: 30.0, + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Container( + child: Text("OK", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 18.0, + )), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/livecare/widgets/LiveCareHistoryCard.dart b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart new file mode 100644 index 00000000..25ec8514 --- /dev/null +++ b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart @@ -0,0 +1,212 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart'; +import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; +import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +class LiveCareHistoryCard extends StatefulWidget { + ErRequestHistoryList erRequestHistoryList; + + LiveCareHistoryCard({this.erRequestHistoryList}); + + @override + _LiveCareHistoryCardState createState() => _LiveCareHistoryCardState(); +} + +class _LiveCareHistoryCardState extends State { + AuthenticatedUser authUser = new AuthenticatedUser(); + AppSharedPreferences sharedPref = AppSharedPreferences(); + + @override + void initState() { + getAuthenticatedUser(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.all(10.0), + child: Card( + margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height * 0.22, + padding: EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text("Requested date:", + style: + TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(widget.erRequestHistoryList.sArrivalTime, + style: TextStyle(fontSize: 14.0)), + Text( + "Call Duration\n" + + getCallTime( + widget.erRequestHistoryList.callDuration), + textAlign: TextAlign.center, + style: + TextStyle(fontSize: 14.0, color: Colors.grey[600])), + ], + ), + ), + Container( + padding: EdgeInsets.all(7.0), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.green, + ), + margin: EdgeInsets.only(top: 5.0, bottom: 5.0), + child: Text(widget.erRequestHistoryList.stringCallStatus, + style: TextStyle(fontSize: 14.0, color: Colors.white)), + ), + Divider( + color: Colors.grey[500], + ), + Container( + margin: EdgeInsets.all(5.0), + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: InkWell( + onTap: () { + print("Invoice"); + openInvoice(); + }, + child: Container( + child: Row( + children: [ + Icon(Icons.content_paste, color: Colors.blue), + Container( + margin: EdgeInsets.only(left: 10.0), + child: Text("Invoice", + textAlign: TextAlign.center), + ), + ], + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + print("Complaints"); + openComplaint(); + }, + child: Container( + child: Row( + children: [ + Icon(Icons.add, size: 24.0, color: Colors.red), + Container( + margin: EdgeInsets.only(left: 10.0), + child: Text("Complaints", + textAlign: TextAlign.center), + ), + ], + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + print("Rate Dr & Appointment"); + }, + child: Container( + child: Row( + children: [ + Icon(Icons.star, + size: 24.0, color: Colors.yellow[700]), + Container( + width: MediaQuery.of(context).size.width * 0.2, + margin: EdgeInsets.only(left: 10.0), + child: Text("Rate Dr & Appointment", + overflow: TextOverflow.clip, + textAlign: TextAlign.center), + ), + ], + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ); + } + + openInvoice() { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: "Send a copy of this invoice to the email: " + + authUser.emailAddress, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => {sendInvoiceEmail(context)}, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + + openComplaint() { + Navigator.push(context, FadePage(page: FeedbackHomePage())); + } + + sendInvoiceEmail(context) { + ConfirmDialog.closeAlertDialog(context); + LiveCareService service = new LiveCareService(); + service + .sendLiveCareInvoiceEmail( + widget.erRequestHistoryList.appointmentNo.toString(), + widget.erRequestHistoryList.projectID, + authUser.emailAddress, + context) + .then((res) { + AppToast.showSuccessToast(message: "LiveCare invoice sent successfully"); + }).catchError((err) { + AppToast.showErrorToast(message: err); + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + getAuthenticatedUser() async { + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + setState(() { + authUser = data; + }); + } + } + + getCallTime(int number) { + number = number.round(); + var hours = (number / 60 / 60).floor(); + var minutes = (number / 60).floor() - (hours * 60).floor(); + var seconds = number % 60; + return '${hours.toString().padLeft(2, '0')}:${minutes.toString().padLeft(2, '0')}:${seconds.toString().padLeft(2, '0')}'; + } +} diff --git a/lib/pages/livecare/widgets/LiveCareInfoDialog.dart b/lib/pages/livecare/widgets/LiveCareInfoDialog.dart new file mode 100644 index 00000000..0fa02cbe --- /dev/null +++ b/lib/pages/livecare/widgets/LiveCareInfoDialog.dart @@ -0,0 +1,108 @@ +import 'package:flutter/material.dart'; + +class LiveCareInfoDialog extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Container( + child: Dialog( + shape: + RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)), + child: Container( + height: MediaQuery.of(context).size.height * 0.61, + margin: EdgeInsets.all(20.0), + width: 450.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + alignment: Alignment.center, + margin: EdgeInsets.only(bottom: 10.0), + child: Icon(Icons.info_outline, + size: 80.0, color: Colors.red[900]), + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.only(bottom: 20.0), + child: Text("Important Instructions", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 24.0, + fontWeight: FontWeight.bold, + color: Colors.red[900])), + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.only(bottom: 20.0), + child: Text( + "Please make sure that you're logged in on Al Habib Mobile Application", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + color: Colors.black)), + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.only(bottom: 20.0), + child: Icon(Icons.not_interested, + size: 80.0, color: Colors.red[900]), + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.only(bottom: 40.0), + child: Text( + "Otherwise, you will not receive the doctor's call.", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 22.0, + fontWeight: FontWeight.bold, + color: Colors.red[900])), + ), + Divider( + thickness: 1.0, + color: Colors.grey[400], + ), + Container( + alignment: Alignment.center, + height: 40.0, + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: InkWell( + onTap: () { + Navigator.pop(context, false); + }, + child: Container( + child: Text("Cancel", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 18.0, color: Colors.red[700])), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + Navigator.pop(context, true); + }, + child: Container( + child: Text("Ok", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 18.0, + )), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/livecare/widgets/LiveCarePaymentDialog.dart b/lib/pages/livecare/widgets/LiveCarePaymentDialog.dart new file mode 100644 index 00000000..e2dab5b0 --- /dev/null +++ b/lib/pages/livecare/widgets/LiveCarePaymentDialog.dart @@ -0,0 +1,296 @@ +import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; + +class LiveCarePaymentDialog extends StatefulWidget { + GetERAppointmentFeesList getERAppointmentFeesList; + int waitingTime; + String clinicName; + + LiveCarePaymentDialog( + {@required this.getERAppointmentFeesList, @required this.waitingTime, @required this.clinicName}); + + @override + _LiveCarePaymentDialogState createState() => _LiveCarePaymentDialogState(); +} + +class _LiveCarePaymentDialogState extends State { + int _selected = 0; + + @override + Widget build(BuildContext context) { + var size = MediaQuery.of(context).size; + final double itemHeight = ((size.height - kToolbarHeight - 24) * 0.42) / 2; + final double itemWidth = size.width / 2; + + return Container( + child: Dialog( + shape: + RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)), + child: Container( + height: MediaQuery.of(context).size.height * 0.691, + margin: EdgeInsets.all(20.0), + width: 450.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + alignment: Alignment.center, + margin: EdgeInsets.only(bottom: 10.0), + child: Text("Online Consultation", + textAlign: TextAlign.center, + style: + TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + Divider( + thickness: 1.0, + color: Colors.grey[400], + ), + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: Text("Waiting time to start LiveCare consultation", + textAlign: TextAlign.end, + style: TextStyle(fontSize: 13.0)), + ), + Expanded( + child: Container( + child: Icon(Icons.access_time, + size: 36.0, color: Colors.red[800]), + ), + ), + Expanded( + child: Text(widget.waitingTime.toString() + " Minutes", + textAlign: TextAlign.start, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + color: Colors.red[900])), + ), + ], + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.only(bottom: 10.0, top: 10.0), + child: Text(widget.clinicName, + textAlign: TextAlign.center, + style: + TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold)), + ), + Container( + width: MediaQuery.of(context).size.width, + decoration: BoxDecoration( + color: Colors.black87, + borderRadius: new BorderRadius.only( + topLeft: const Radius.circular(5.0), + topRight: const Radius.circular(5.0), + ), + border: Border.all(color: Colors.black87)), + alignment: Alignment.center, + margin: EdgeInsets.only(top: 5.0), + padding: EdgeInsets.all(5.0), + child: Text("Consultation fee", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.bold, + color: Colors.white)), + ), + Container( + decoration: BoxDecoration( + borderRadius: new BorderRadius.only( + bottomLeft: const Radius.circular(5.0), + bottomRight: const Radius.circular(5.0), + ), + border: Border.all(color: Colors.black54)), + child: Table( + children: [ + TableRow(children: [ + TableCell( + child: _getNormalText( + TranslationBase.of(context).patientShareToDo)), + TableCell( + child: _getNormalText( + widget.getERAppointmentFeesList.amount + + " " + + widget.getERAppointmentFeesList.currency)), + ]), + TableRow(children: [ + TableCell( + child: _getNormalText( + TranslationBase.of(context).patientTaxToDo)), + TableCell( + child: _getNormalText( + widget.getERAppointmentFeesList.tax + + " " + + widget.getERAppointmentFeesList.currency)), + ]), + TableRow(children: [ + TableCell( + child: _getMarginText(TranslationBase.of(context) + .patientShareTotalToDo)), + TableCell( + child: _getMarginText( + widget.getERAppointmentFeesList.total + + " " + + widget.getERAppointmentFeesList.currency)), + ]), + ], + ), + ), + Container( + padding: EdgeInsets.only(top: 10.0, bottom: 10.0, left: 10.0), + decoration: BoxDecoration( + borderRadius: new BorderRadius.all( + const Radius.circular(5.0), + ), + color: Colors.green[200].withOpacity(0.5)), + margin: EdgeInsets.only(top: 20.0), + child: Row( + children: [ + Image.asset("assets/images/new-design/alert-triangle.png"), + Container( + margin: EdgeInsets.only(left: 10.0), + width: MediaQuery.of(context).size.width * 0.55, + child: Text( + "If you're Insurance patient, you have only have to pay the co-payment", + style: TextStyle(fontSize: 13.0)), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Container( + child: new Radio( + value: 1, + groupValue: _selected, + onChanged: onRadioChanged, + ), + ), + Container( + child: new Text( + 'I Accept the Terms And Conditions', + style: new TextStyle(fontSize: 14.0), + ), + ), +// Container( +//// alignment: Alignment.centerRight, +// child: new Text( +// 'Click Here', +// textAlign: TextAlign.end, +// style: new TextStyle(fontSize: 16.0), +// ), +// ), + ], + ), + ), + Divider( + thickness: 1.0, + color: Colors.grey[400], + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.only(top: 10.0), + child: new Text( + 'You can pay by the following Options:', + textAlign: TextAlign.center, + style: new TextStyle(fontSize: 14.0), + ), + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 5.0), + child: Image.asset( + "assets/images/new-design/payment_options_invoice_confirmation.png", + width: 300), + ), + Divider( + thickness: 1.0, + color: Colors.grey[400], + ), + Container( + alignment: Alignment.center, + height: 40.0, + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: InkWell( + onTap: () { + Navigator.pop(context, false); + }, + child: Container( + child: Text("Cancel", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 18.0, color: Colors.red[700])), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + if(_selected == 0) { + AppToast.showErrorToast(message: "Please accept terms & conditions to continue"); + } else { + Navigator.pop(context, true); + } + }, + child: Container( + child: Text("Ok", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 18.0, + )), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ); + } + + void onRadioChanged(int value) { + setState(() { + _selected = value; + }); + } + + _getNormalText(text) { + return Container( + margin: EdgeInsets.only(top: 10.0, right: 10.0), + child: Text(text, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 14, + fontFamily: 'Open-Sans', + letterSpacing: 0.5, + color: Colors.black)), + ); + } + + _getMarginText(text) { + return Container( + margin: EdgeInsets.only(top: 10.0, right: 10.0, bottom: 10.0), + child: Text(text, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 14, + fontFamily: 'Open-Sans', + letterSpacing: 0.5, + fontWeight: FontWeight.bold, + color: Colors.black)), + ); + } +} diff --git a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart new file mode 100644 index 00000000..bfd42e62 --- /dev/null +++ b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart @@ -0,0 +1,167 @@ +import 'package:circular_countdown_timer/circular_countdown_timer.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart'; +import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +class LiveCarePendingRequest extends StatefulWidget { + ErRequestHistoryList pendingERRequestHistoryList; + final Function getLiveCareHistory; + + LiveCarePendingRequest( + {@required this.getLiveCareHistory, this.pendingERRequestHistoryList}); + + @override + _LiveCarePendingRequestState createState() => _LiveCarePendingRequestState(); +} + +class _LiveCarePendingRequestState extends State { + @override + void initState() { + // TODO: implement initState + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + border: Border.all(color: Colors.grey[300]), + borderRadius: BorderRadius.circular(10), + color: Colors.white, + shape: BoxShape.rectangle, + ), + margin: EdgeInsets.all(15.0), + padding: EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Container( + child: Text("In Progress:", + style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.only(top: 10.0), + child: Text("Estimated Waiting Time: ", + style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), + ), + Container( + transform: Matrix4.translationValues(0.0, -50.0, 0.0), + alignment: Alignment.center, + child: CircularCountDownTimer( + duration: + widget.pendingERRequestHistoryList.watingtimeInteger * 60, + width: MediaQuery.of(context).size.width / 3, + height: MediaQuery.of(context).size.height / 3, + color: Colors.white, + fillColor: Colors.green[700], + strokeWidth: 15.0, + textStyle: TextStyle( + fontSize: 22.0, + color: Colors.black87, + fontWeight: FontWeight.bold), + isReverse: true, + isTimerTextShown: true, + onComplete: () { + print('Countdown Ended'); + }, + ), + ), + Container( + transform: Matrix4.translationValues(0.0, -60.0, 0.0), + child: Divider( + color: Colors.grey[500], + thickness: 0.7, + ), + ), + Container( + transform: Matrix4.translationValues(0.0, -50.0, 0.0), + child: Text("Requested date:", + style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold)), + ), + Container( + transform: Matrix4.translationValues(0.0, -30.0, 0.0), + child: Text( + DateUtil.getDateFormatted( + widget.pendingERRequestHistoryList.arrivalTime), + style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), + ), + Container( + transform: Matrix4.translationValues(0.0, -20.0, 0.0), + padding: EdgeInsets.all(7.0), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.red[800], + ), + margin: EdgeInsets.only(top: 5.0, bottom: 5.0), + child: Text(widget.pendingERRequestHistoryList.stringCallStatus, + style: TextStyle(fontSize: 14.0, color: Colors.white)), + ), + Container( + transform: Matrix4.translationValues(0.0, 0.0, 0.0), + child: Divider( + color: Colors.grey[500], + thickness: 0.7, + ), + ), + Container( + alignment: Alignment.center, + transform: Matrix4.translationValues(0.0, 10.0, 0.0), + child: Text( + "Your turn is after " + + widget.pendingERRequestHistoryList.patCount.toString() + + " Patients", + style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + Container( + transform: Matrix4.translationValues(0.0, 130.0, 0.0), + alignment: Alignment.bottomCenter, + width: MediaQuery.of(context).size.width, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: Colors.red[800], + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + cancelLiveCareRequest(); + }, + child: Text(TranslationBase.of(context).cancel, + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ], + ), + ); + } + + cancelLiveCareRequest() { + LiveCareService service = new LiveCareService(); + service + .cancelLiveCareRequest(widget.pendingERRequestHistoryList.vCID, context) + .then((res) { + AppToast.showSuccessToast( + message: "LiveCare request cancelled successfully"); + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + widget.getLiveCareHistory(); + }); + } +} diff --git a/lib/pages/livecare/widgets/clinic_card.dart b/lib/pages/livecare/widgets/clinic_card.dart new file mode 100644 index 00000000..56613034 --- /dev/null +++ b/lib/pages/livecare/widgets/clinic_card.dart @@ -0,0 +1,136 @@ +import 'package:diplomaticquarterapp/models/LiveCare/ClinicsServiceTimingsResponse.dart'; +import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse.dart'; +import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +import 'ClinicTimingsDialog.dart'; + +// ignore: must_be_immutable +class ClinicCard extends StatefulWidget { + bool isSelected; + final PatientERGetClinicsList patientERGetClinicsList; + var languageID; + + ClinicCard( + {this.isSelected, + this.languageID, + @required this.patientERGetClinicsList}); + + @override + _State createState() => _State(); +} + +class _State extends State { + ClinicsServiceTimingsResponse clinicsServiceTimingsResponse; + + @override + void initState() { + clinicsServiceTimingsResponse = new ClinicsServiceTimingsResponse(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Row( + children: [ + Card( + margin: EdgeInsets.fromLTRB(15.0, 10.0, 8.0, 8.0), + color: widget.isSelected ? Colors.blue : Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + width: MediaQuery.of(context).size.width * 0.75, + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + child: Text( + widget.languageID == 'ar' + ? widget.patientERGetClinicsList.serviceNameN + : widget.patientERGetClinicsList.serviceName, + style: TextStyle( + fontSize: 16.0, + color: + widget.isSelected ? Colors.white : Colors.black)), + ), + ], + ), + ), + ), + InkWell( + onTap: () { + getClinicTimings(widget.patientERGetClinicsList); + }, + child: Card( + margin: EdgeInsets.fromLTRB(8.0, 10.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + child: Container( + padding: EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Icon(Icons.access_time, size: 26.0, color: Colors.red[800]), + ], + ), + ), + ), + ), + ], + ); + } + + getClinicTimings(PatientERGetClinicsList patientERGetClinicsList) { + LiveCareService service = new LiveCareService(); + service + .getLivecareClinicTiming(patientERGetClinicsList.serviceID, context) + .then((res) { + if (res['MessageStatus'] == 1) { + setState(() { + clinicsServiceTimingsResponse = + ClinicsServiceTimingsResponse.fromJson(res); + print(clinicsServiceTimingsResponse + .patientERGetClinicsServiceTimingsList.length); + + showGeneralDialog( + barrierColor: Colors.black.withOpacity(0.5), + transitionBuilder: (context, a1, a2, widget) { + final curvedValue = + Curves.easeInOutBack.transform(a1.value) - 1.0; + return Transform( + transform: + Matrix4.translationValues(0.0, curvedValue * 200, 0.0), + child: Opacity( + opacity: a1.value, + child: ClinicTimingsDialog( + clinicName: patientERGetClinicsList.serviceName, + patientERGetClinicsServiceTimingsList: + clinicsServiceTimingsResponse + .patientERGetClinicsServiceTimingsList, + ), + ), + ); + }, + transitionDuration: Duration(milliseconds: 500), + barrierDismissible: true, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) {}); + }); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } +} diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart new file mode 100644 index 00000000..fc27d92b --- /dev/null +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -0,0 +1,689 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart'; +import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse.dart'; +import 'package:diplomaticquarterapp/models/LiveCare/LiveCareScheduleClinicsListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; +import 'package:diplomaticquarterapp/pages/livecare/livecare_scheduling/schedule_clinic_card.dart'; +import 'package:diplomaticquarterapp/pages/livecare/livecare_type_select.dart'; +import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCareInfoDialog.dart'; +import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCarePaymentDialog.dart'; +import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ClinicList extends StatefulWidget { + final Function getLiveCareHistory; + + ClinicList({@required this.getLiveCareHistory}); + + @override + _clinic_listState createState() => _clinic_listState(); +} + +class _clinic_listState extends State { + int currentSelectedIndex = 0; + LiveCareClinicsListResponse liveCareClinicsListResponse; + + LiveCareScheduleClinicsListResponse liveCareScheduleClinicsListResponse; + + bool isDataLoaded = false; + var languageID; + var currentSelectedLiveCareType; + + int selectedClinicID = 1; + String selectedClinicName = "-"; + + AppSharedPreferences sharedPref = AppSharedPreferences(); + + AuthenticatedUser authUser; + AuthProvider authProvider = new AuthProvider(); + + MyInAppBrowser browser; + + @override + void initState() { + liveCareClinicsListResponse = new LiveCareClinicsListResponse(); + liveCareScheduleClinicsListResponse = + new LiveCareScheduleClinicsListResponse(); + + WidgetsBinding.instance.addPostFrameCallback((_) { + openLiveCareSelectionDialog(); + }); + + getLanguageID(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return SingleChildScrollView( + child: currentSelectedLiveCareType == "immediate" + ? getLiveCareImmediateClinicList() + : getLiveCareScheduleClinicList()); + } + + void startLiveCare() { + bool isError = false; + LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); + ERAppointmentFeesResponse erAppointmentFeesResponse = + new ERAppointmentFeesResponse(); + service.getERAppointmentFees(selectedClinicID, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['HasAppointment'] == true) { + isError = true; + showLiveCareCancelDialog(res['ErrorEndUserMessage'], res); + } else { + erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res); + isError = false; + } + if (!isError) + getERAppointmentTime( + erAppointmentFeesResponse.getERAppointmentFeesList); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + isError = true; + AppToast.showErrorToast(message: err); + }); + } + + showLiveCareCancelDialog(String msg, res) { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: msg, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => {cancelAppointment(res)}, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + + cancelAppointment(res) { + AppoitmentAllHistoryResultList appo = AppoitmentAllHistoryResultList(); + appo.clinicID = res['ClinicID']; + appo.doctorID = res['DoctorID']; + appo.endTime = res['EndTime']; + appo.projectID = res['ProjectID']; + appo.startTime = res['StrAppointmentDate']; + appo.appointmentNo = res['AppointmentID']; + appo.isLiveCareAppointment = true; + appo.originalClinicID = 0; + appo.originalProjectID = res['ProjectID']; + appo.appointmentDate = res['AppointmentDate']; + + ConfirmDialog.closeAlertDialog(context); + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service.cancelAppointment(appo, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + startLiveCare(); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + getERAppointmentTime(GetERAppointmentFeesList getERAppointmentFeesList) { + LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); + service.getERAppointmentTime(selectedClinicID, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res); + showLiveCarePaymentDialog( + getERAppointmentFeesList, res['WatingtimeInteger']); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + AppToast.showErrorToast(message: err); + }); + } + + showLiveCarePaymentDialog( + GetERAppointmentFeesList getERAppointmentFeesList, int waitingTime) { + showGeneralDialog( + barrierColor: Colors.black.withOpacity(0.5), + transitionBuilder: (context, a1, a2, widget) { + final curvedValue = + Curves.easeInOutBack.transform(a1.value) - 1.0; + return Transform( + transform: + Matrix4.translationValues(0.0, curvedValue * 200, 0.0), + child: Opacity( + opacity: a1.value, + child: LiveCarePaymentDialog( + getERAppointmentFeesList: getERAppointmentFeesList, + waitingTime: waitingTime, + clinicName: selectedClinicName), + ), + ); + }, + transitionDuration: Duration(milliseconds: 500), + barrierDismissible: true, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) {}) + .then((value) { + if (value) { + if (getERAppointmentFeesList.total == "0" || + getERAppointmentFeesList.total == "0.0") { + showLiveCareInfoDialog(getERAppointmentFeesList); + } else { + navigateToPaymentMethod(getERAppointmentFeesList, context); + } + } + }); + } + + showLiveCareInfoDialog( + GetERAppointmentFeesList getERAppointmentFeesList) async { + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + setState(() { + authUser = data; + }); + } + + showGeneralDialog( + barrierColor: Colors.black.withOpacity(0.5), + transitionBuilder: (context, a1, a2, widget) { + final curvedValue = + Curves.easeInOutBack.transform(a1.value) - 1.0; + return Transform( + transform: + Matrix4.translationValues(0.0, curvedValue * 200, 0.0), + child: Opacity( + opacity: a1.value, + child: LiveCareInfoDialog(), + ), + ); + }, + transitionDuration: Duration(milliseconds: 500), + barrierDismissible: true, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) {}) + .then((value) { + if (value) { + if (getERAppointmentFeesList.total == "0" || + getERAppointmentFeesList.total == "0.0") { + addNewCallForPatientER(authUser.patientID.toString() + + "" + + DateTime.now().millisecondsSinceEpoch.toString()); + } else { + navigateToPaymentMethod(getERAppointmentFeesList, context); + } + } + }); + } + + Future navigateToPaymentMethod( + GetERAppointmentFeesList getERAppointmentFeesList, context) async { + AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); + + appo.clinicID = selectedClinicID; + appo.appointmentNo = DateTime.now().millisecondsSinceEpoch; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + setState(() { + authUser = data; + }); + } + + Navigator.push( + context, MaterialPageRoute(builder: (context) => PaymentMethod())) + .then((value) { + print(value); + if (value != null) { + openPayment(value, authUser, + double.parse(getERAppointmentFeesList.total), appo); + } + }); + } + + openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, + double amount, AppoitmentAllHistoryResultList appo) { + browser = new MyInAppBrowser( + onExitCallback: onBrowserExit, + appo: appo, + onLoadStartCallback: onBrowserLoadStart); + + browser.openPaymentBrowser( + amount, + "LiveCare Payment", + Utils.getAppointmentTransID(12, appo.clinicID, appo.appointmentNo), + "12", + authenticatedUser.emailAddress, + paymentMethod, + authenticatedUser.patientType, + authenticatedUser.firstName, + authenticatedUser.patientID, + authenticatedUser, + browser); + } + + onBrowserLoadStart(String url) { + print("onBrowserLoadStart"); + print(url); + + MyInAppBrowser.successURLS.forEach((element) { + if (url.contains(element)) { + if (browser.isOpened()) browser.close(); + MyInAppBrowser.isPaymentDone = true; + return; + } + }); + + MyInAppBrowser.errorURLS.forEach((element) { + if (url.contains(element)) { + if (browser.isOpened()) browser.close(); + MyInAppBrowser.isPaymentDone = false; + return; + } + }); + } + + onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { + print("onBrowserExit Called!!!!"); + if (isPaymentMade) checkPaymentStatus(appo); + } + + checkPaymentStatus(AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); + service + .checkPaymentStatus( + Utils.getAppointmentTransID( + appo.projectID, appo.clinicID, appo.appointmentNo), + context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + print("Printing Payment Status Reponse!!!!"); + print(res); + String paymentInfo = res['Response_Message']; + if (paymentInfo == 'Success') { + addNewCallForPatientER(Utils.getAppointmentTransID( + appo.projectID, appo.clinicID, appo.appointmentNo)); + } else { + AppToast.showErrorToast(message: res['Response_Message']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + addNewCallForPatientER(String clientRequestID) { + LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); + service + .addNewCallForPatientER(selectedClinicID, clientRequestID, context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showSuccessToast( + message: "New Call has been added successfully"); + widget.getLiveCareHistory(); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + getLanguageID() async { + languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + } + + getLiveCareClinicsList() { + isDataLoaded = false; + LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); + service.getLivecareClinics(context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res['PatientER_GetClinicsList'].length); + if (res['MessageStatus'] == 1) { + setState(() { + liveCareClinicsListResponse = + LiveCareClinicsListResponse.fromJson(res); + print(liveCareClinicsListResponse.patientERGetClinicsList.length); + selectedClinicID = + liveCareClinicsListResponse.patientERGetClinicsList[0].serviceID; + selectedClinicName = liveCareClinicsListResponse + .patientERGetClinicsList[0].serviceName; + isDataLoaded = true; + }); + } else { + isDataLoaded = true; + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + getLiveCareScheduleClinicsList() { + isDataLoaded = false; + LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); + service.getLiveCareScheduledClinics(context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res['ClinicsHaveScheduleList'].length); + if (res['MessageStatus'] == 1) { + setState(() { + liveCareScheduleClinicsListResponse = + LiveCareScheduleClinicsListResponse.fromJson(res); + print(liveCareScheduleClinicsListResponse + .clinicsHaveScheduleList.length); + selectedClinicID = liveCareScheduleClinicsListResponse + .clinicsHaveScheduleList[0].serviceID; + selectedClinicName = liveCareScheduleClinicsListResponse + .clinicsHaveScheduleList[0].clinicDesc; + isDataLoaded = true; + }); + } else { + isDataLoaded = true; + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + openLiveCareSelectionDialog() { + Navigator.of(context) + .push(new MaterialPageRoute( + builder: (BuildContext context) { + return LiveCareTypeSelect(); + }, + fullscreenDialog: true)) + .then((value) { + if (value == null) { + Navigator.pop(context); + } else { + print(value); + if (value == "immediate") { + setState(() { + currentSelectedLiveCareType = "immediate"; + }); + getLiveCareClinicsList(); + } + if (value == "schedule") { + setState(() { + currentSelectedLiveCareType = "schedule"; + }); + getLiveCareScheduleClinicsList(); + } + } + }); + } + + Widget getLiveCareScheduleClinicList() { + return Column( + children: [ + isDataLoaded + ? Container( + height: MediaQuery.of(context).size.height * 0.7, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ +// Container( +// margin: EdgeInsets.all(15.0), +// child: Text("Online Clinics: ", +// style: TextStyle( +// fontSize: 20.0, fontWeight: FontWeight.bold)), +// ), + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + padding: EdgeInsets.all(0.0), + itemCount: liveCareScheduleClinicsListResponse + .clinicsHaveScheduleList.length, + itemBuilder: (context, index) { + return InkWell( + onTap: () { + updateSelectedScheduleIndex( + liveCareScheduleClinicsListResponse + .clinicsHaveScheduleList[index]); + }, + child: ScheduleClinicCard( + isSelected: selectedClinicID == + liveCareScheduleClinicsListResponse + .clinicsHaveScheduleList[index] + .serviceID + ? true + : false, + clinicsHaveScheduleList: + liveCareScheduleClinicsListResponse + .clinicsHaveScheduleList[index], + languageID: languageID, + ), + ); + }, + ), + Container( + height: 10.0, + ), + ], + ), + ) + : Container(), + isDataLoaded + ? Align( + alignment: FractionalOffset.bottomCenter, + child: Container( + width: MediaQuery.of(context).size.width, + height: 50.0, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: startScheduleLiveCare, + child: Text("Start", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ) + : Container(), + ], + ); + } + + Widget getLiveCareImmediateClinicList() { + return Column( + children: [ + isDataLoaded + ? Container( + height: MediaQuery.of(context).size.height * 0.7, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.all(15.0), + child: Text("Online Clinics: ", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + padding: EdgeInsets.all(0.0), + itemCount: liveCareClinicsListResponse + .patientERGetClinicsList.length, + itemBuilder: (context, index) { + return InkWell( + onTap: () { + updateSelectedIndex(liveCareClinicsListResponse + .patientERGetClinicsList[index]); + }, + child: ClinicCard( + isSelected: selectedClinicID == + liveCareClinicsListResponse + .patientERGetClinicsList[index] + .serviceID + ? true + : false, + patientERGetClinicsList: liveCareClinicsListResponse + .patientERGetClinicsList[index], + languageID: languageID, + ), + ); + }, + ), + Container( + height: 10.0, + ), + ], + ), + ) + : Container(), + isDataLoaded + ? Align( + alignment: FractionalOffset.bottomCenter, + child: Container( + width: MediaQuery.of(context).size.width, + height: 50.0, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: startLiveCare, + child: Text("Start", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ) + : Container(), + ], + ); + } + + void startScheduleLiveCare() { + List doctorsList = []; + LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); + List _patientDoctorAppointmentListHospital = + List(); + service + .getLiveCareScheduledDoctorList(context, selectedClinicID) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + setState(() { + if (res['DoctorByClinicIDList'].length != 0) { + res['DoctorByClinicIDList'].forEach((v) { + doctorsList.add(new DoctorList.fromJson(v)); + }); + + doctorsList.forEach((element) { + List doctorByHospital = + _patientDoctorAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + _patientDoctorAppointmentListHospital[ + _patientDoctorAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + _patientDoctorAppointmentListHospital.add( + PatientDoctorAppointmentList( + filterName: element.projectName, + distanceInKMs: + element.projectDistanceInKiloMeters.toString(), + patientDoctorAppointment: element)); + } + }); + } else {} + }); + this.sharedPref.setBool(IS_LIVECARE_APPOINTMENT, true); + navigateToSearchResults( + context, doctorsList, _patientDoctorAppointmentListHospital); + } else {} + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + Future navigateToSearchResults( + context, + List docList, + List + patientDoctorAppointmentListHospital) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => SearchResults( + doctorsList: docList, + isLiveCareAppointment: true, + patientDoctorAppointmentListHospital: + patientDoctorAppointmentListHospital))); + } + + updateSelectedIndex(PatientERGetClinicsList patientERGetClinicsList) { + setState(() { + selectedClinicID = patientERGetClinicsList.serviceID; + selectedClinicName = patientERGetClinicsList.serviceName; + }); + } + + updateSelectedScheduleIndex(ClinicsHaveScheduleList patientERGetClinicsList) { + setState(() { + selectedClinicID = patientERGetClinicsList.serviceID; + selectedClinicName = patientERGetClinicsList.clinicDesc; + }); + } +} diff --git a/lib/pages/livecare/widgets/livecare_logs.dart b/lib/pages/livecare/widgets/livecare_logs.dart new file mode 100644 index 00000000..a7f7fdc0 --- /dev/null +++ b/lib/pages/livecare/widgets/livecare_logs.dart @@ -0,0 +1,40 @@ +import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart'; +import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCareHistoryCard.dart'; +import 'package:flutter/material.dart'; + +class LiveCareLogs extends StatefulWidget { + List erRequestHistoryList; + + LiveCareLogs({@required this.erRequestHistoryList}); + + @override + _LiveCareLogsState createState() => _LiveCareLogsState(); +} + +class _LiveCareLogsState extends State { + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return SingleChildScrollView( + child: Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + padding: EdgeInsets.all(0.0), + itemCount: widget.erRequestHistoryList.length, + itemBuilder: (context, index) { + return widget.erRequestHistoryList[index].callStatus < 4 + ? Container() + : LiveCareHistoryCard( + erRequestHistoryList: widget.erRequestHistoryList[index]); + }, + ), + ), + ); + } +} diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart new file mode 100644 index 00000000..646158db --- /dev/null +++ b/lib/pages/login/confirm-login.dart @@ -0,0 +1,837 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; +import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; +import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:intl/intl.dart'; +import 'package:local_auth/local_auth.dart'; +import 'package:provider/provider.dart'; +// import 'package:smart_progress_bar/smart_progress_bar.dart'; + +class ConfirmLogin extends StatefulWidget { + @override + _ConfirmLogin createState() => _ConfirmLogin(); +} + +class _ConfirmLogin extends State { + final LocalAuthentication auth = LocalAuthentication(); + var _availableBiometrics; + var sharedPref = new AppSharedPreferences(); + bool authenticated; + final authService = new AuthProvider(); + int mobileNumber; + String errorMsg = ''; + SelectDeviceIMEIRES user; + bool isLoading = false; + var registerd_data; + bool isMoreOption = false; + var zipCode; + + var patientOutSA; + + var loginTokenID; + + var loginType; + + var deviceToken; + + var lastLogin; + + int selectedOption; + + bool onlySMSBox = false; + var userData; + + static BuildContext _context; + + static bool _loading; + + int fingrePrintBefore; + + AuthenticatedUserObject authenticatedUserObject = + locator(); + AppointmentRateViewModel appointmentRateViewModel = + locator(); + ProjectViewModel projectViewModel; + + ToDoCountProviderModel toDoProvider; + + @override + void initState() { + _getAvailableBiometrics(); + setDefault(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + toDoProvider = Provider.of(context); + return AppScaffold( + appBarTitle: TranslationBase.of(context).confirm, + isShowAppBar: true, + isShowDecPage: false, + body: SingleChildScrollView( + child: Container( + padding: EdgeInsets.all(20), + height: SizeConfig.realScreenHeight * .9, + width: SizeConfig.realScreenWidth, + child: Column( + children: [ + user != null && isMoreOption == false + ? Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + 'assets/images/DQ/dq_logo_icon.png', + height: 90, + width: 90, + ), + AppText( + TranslationBase.of(context).welcomeBack + + ' ' + + user.name, + fontSize: SizeConfig.textMultiplier * 3.5, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context).accountInfo, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + SizedBox( + height: 20, + ), + Card( + color: Colors.grey[300], + child: Row( + children: [ + Flexible( + child: ListTile( + title: Text( + TranslationBase.of(context).lastLoginAt, + textAlign: TextAlign.center, + overflow: TextOverflow.ellipsis, + ), + subtitle: Text( + user.editedOn != null + ? formatDate( + DateUtil.convertStringToDate( + user.editedOn)) + : user.createdOn != null + ? formatDate( + DateUtil.convertStringToDate( + user.createdOn)) + : '--', + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.center), + )), + Flexible( + child: ListTile( + title: Text( + TranslationBase.of(context).lastLoginWith, + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.center), + subtitle: Text( + getType(user.logInType, context), + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.center), + )) + ], + )), + ], + ) + : Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + 'assets/images/DQ/dq_logo_icon.png', + height: 90, + width: 90, + ), + this.onlySMSBox == false + ? AppText( + TranslationBase.of(context).verifyLoginWith, + fontSize: SizeConfig.textMultiplier * 3.5, + textAlign: TextAlign.left, + ) + : AppText( + TranslationBase.of(context) + .verifyFingerprint2, + fontSize: SizeConfig.textMultiplier * 2.5, + textAlign: TextAlign.start, + ), + ]), + user != null && isMoreOption == false + ? Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: InkWell( + onTap: () => { + authenticateUser( + 3, BiometricType.face.index) + }, + child: getButton(user.logInType))), + Expanded(child: getButton(5)) + ]) + ]) + : Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + onlySMSBox == false + ? Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded(child: getButton(3)), + Expanded(child: getButton(2)) + ], + ) + : SizedBox(), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded(child: getButton(1)), + Expanded(child: getButton(4)) + ], + ), + ]), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + user != null + ? Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).useAnotherAccount, + () => { + Navigator.of(context).pushNamed( + LOGIN_TYPE, + ) + }, + )), + ], + ) + : SizedBox(), + ], + ), + ) + ], + ), + ), + ), + ); + } + + Future _getAvailableBiometrics() async { + var availableBiometrics; + try { + availableBiometrics = await auth.getAvailableBiometrics(); + } on PlatformException catch (e) { + print(e); + } + if (!mounted) return; + + setState(() { + _availableBiometrics = availableBiometrics; + }); + } + + authenticateUser(type, isActive) { + GifLoaderDialogUtils.showMyDialog(context); + if (type == 2 || type == 3) { + fingrePrintBefore = type; + } + this.selectedOption = fingrePrintBefore != null ? fingrePrintBefore : type; + + switch (type) { + case 1: + this.loginWithSMS(type, isActive); + break; + case 2: + this.loginWithFingurePrintFace(type, isActive); + break; + case 3: + this.loginWithFingurePrintFace(type, isActive); + break; + case 4: + this.loginWithSMS(type, isActive); + break; + default: + break; + } + sharedPref.setInt(LAST_LOGIN, + this.selectedOption); //this.cs.sharedService.setStorage(this.selectedOption, AuthenticationService.LAST_LOGIN); + } + + loginWithSMS(type, isActive) { + //if (!el.disabled) { + if (this.user != null && this.registerd_data == null) { + this.checkUserAuthentication(type); + } else { + if (this.loginTokenID != null) { + // Future.delayed(Duration(seconds: 1), () { + this.sendActivationCode(type); + // }); + } else { + this.checkUserAuthentication(type); + } + } + } + + checkUserAuthentication(type) { + showLoader(true); + var req = getCommonRequest(type: type); + req.logInTokenID = ""; + + var request = CheckPatientAuthenticationReq.fromJson(req.toJson()); + + sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request); + authService + .checkPatientAuthentication(request) + .then((value) => { + GifLoaderDialogUtils.hideDialog(context), + if (value['isSMSSent']) + { + sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']), + this.loginTokenID = value['LogInTokenID'], + sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request), + // Future.delayed(Duration(seconds: 1), () { + this.sendActivationCode(type) + // }) + } + else + { + if (value['IsAuthenticated']) {this.checkActivationCode()} + } + }) + .catchError((err) { + print(err); + GifLoaderDialogUtils.hideDialog(context); + }); + } + + sendActivationCode(type) async { + var request = this.getCommonRequest(type: type); + GifLoaderDialogUtils.showMyDialog(context); + await this.authService.sendActivationCode(request).then((result) { + GifLoaderDialogUtils.hideDialog(context); + if (result != null && result['isSMSSent'] == true) { + this.startSMSService(type); + } + }).catchError((r) { + GifLoaderDialogUtils.hideDialog(context); + }); + } + + startSMSService(type) { + new SMSOTP( + context, + type, + this.mobileNumber, + (value) { + this.checkActivationCode(value: value); + }, + () => { + Navigator.pop(context), + print('Faild..'), + }, + ).displayDialog(context); + } + + loginWithFingurePrintFace(type, isActive) async { + if (isActive == 1) { + // this.startBiometricLoginIfAvailable(); + authenticated = await auth.authenticateWithBiometrics( + localizedReason: 'Scan your fingerprint to authenticate', + useErrorDialogs: true, + stickyAuth: true); + + if (authenticated == true) { + if (user != null && (user.logInType == 2 || user.logInType == 3)) { + this.checkActivationCode(); + } else { + var request = this.getCommonRequest(type: type); + this.getMobileInfo(request); + } + } + } + } + + getMobileInfo(request) { + // GifLoaderDialogUtils.showMyDialog(context); + this.authService.getLoginInfo(request).then((result) { + GifLoaderDialogUtils.hideDialog(context); + if (result['SMSLoginRequired'] == false) { + this.loginTokenID = result.logInTokenID; + this.patientOutSA = result.patientOutSA; + // sms for register the biometric + if (result.isSMSSent) { + this.onlySMSBox = false; + //this.button(); + } else { + checkActivationCode(); + } + } else { + if (result['IsAuthenticated'] == true) { + setState(() { + isMoreOption = true; + this.onlySMSBox = true; + // this.fingrePrintBefore = true; + }); + } + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + setDefault() async { + if (await sharedPref.getObject(IMEI_USER_DATA) != null) + user = SelectDeviceIMEIRES.fromJson( + await sharedPref.getObject(IMEI_USER_DATA)); + + if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) { + isMoreOption = true; + this.registerd_data = CheckPatientAuthenticationReq.fromJson( + await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN)); + } + + this.mobileNumber = this.registerd_data != null + ? this.registerd_data.patientMobileNumber + : int.parse(this.user.mobile); + this.zipCode = this.registerd_data != null + ? this.registerd_data.zipCode + : this.user.outSA == true + ? "971" + : "966"; + this.patientOutSA = this.registerd_data != null + ? this.registerd_data.zipCode == "966" + ? 0 + : 1 + : this.user.outSA; + if (this.registerd_data != null) { + this.loginTokenID = await sharedPref.getString(LOGIN_TOKEN_ID); + this.loginType = this.registerd_data.searchType; + } + this.deviceToken = await sharedPref.getString(PUSH_TOKEN); + this.lastLogin = await sharedPref.getInt(LAST_LOGIN) != null + ? await sharedPref.getInt(LAST_LOGIN) + : user != null + ? user.logInType + : null; + + //this.cs.sharedService.getStorage(AuthenticationService.LAST_LOGIN); + } + + getCommonRequest({type}) { + var request = SendActivationRequest(); + request.patientMobileNumber = this.mobileNumber; + request.mobileNo = '0' + this.mobileNumber.toString(); + request.deviceToken = this.deviceToken; + request.projectOutSA = this.patientOutSA == true ? true : false; + request.loginType = this.selectedOption; + request.oTPSendType = + type == 1 ? type : 2; //this.selectedOption == 1 ? 1 : 2; + request.zipCode = this.zipCode; + + request.logInTokenID = this.loginTokenID ?? ""; + + if (this.registerd_data != null) { + request.searchType = this.registerd_data.searchType != null + ? this.registerd_data.searchType + : 1; + request.patientID = this.registerd_data.patientID != null + ? this.registerd_data.patientID + : 0; + request.patientIdentificationID = request.nationalID = + this.registerd_data.patientIdentificationID != null + ? this.registerd_data.patientIdentificationID + : '0'; + + request.isRegister = this.registerd_data.isRegister; + } else { + request.searchType = request.searchType != null ? request.searchType : 2; + request.patientID = this.user.patientID != null ? this.user.patientID : 0; + request.nationalID = + request.nationalID != null ? request.nationalID : '0'; + request.patientIdentificationID = request.patientIdentificationID != null + ? request.patientIdentificationID + : '0'; + request.isRegister = false; + } + request.deviceTypeID = request.searchType; + return request; + } + + checkActivationCode({value}) async { + GifLoaderDialogUtils.showMyDialog(context); + var request = this.getCommonRequest().toJson(); + + authService + .checkActivationCode(request, value) + .then((result) => { + if (result is Map) + { + projectViewModel.setPrivilege(privilegeList: result), + result = CheckActivationCode.fromJson(result), + if (this.registerd_data != null && + this.registerd_data.isRegister == true) + { + Navigator.of(context).pushNamed( + REGISTER_INFO, + ) + } + else + { + sharedPref.remove(FAMILY_FILE), + result.list.isFamily = false, + userData = result.list, + // sharedPref.setString( + // BLOOD_TYPE, result['PatientBloodType']), + sharedPref.setObject(MAIN_USER, result.list), + sharedPref.setObject(USER_PROFILE, result.list), + loginTokenID = result.logInTokenID, + sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), + sharedPref.setString(TOKEN, result.authenticationTokenID), + checkIfUserAgreedBefore(result), + } + } + else + { + // Navigator.of(context).pop(), + GifLoaderDialogUtils.hideDialog(context), + Future.delayed(Duration(seconds: 1), () { + AppToast.showErrorToast(message: result); + }), + } + }) + .catchError((err) { + print(err); + GifLoaderDialogUtils.hideDialog(context); + Future.delayed(Duration(seconds: 1), () { + AppToast.showErrorToast(message: err); + }); + }); + } + + checkIfUserAgreedBefore(CheckActivationCode result) { + if (result.isNeedUserAgreement == true) { + //move to agreement page. + } else { + insertIMEI(); + } + } + + insertIMEI() { + authService + .insertDeviceImei(selectedOption) + .then((value) => {goToHome()}) + .catchError((err) { + print(err); + }); + } + + getToDoCount() { + toDoProvider.setState(0, true); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + print(res['AppointmentActiveNumber']); + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber'], true); + } else {} + }).catchError((err) { + print(err); + }); + } + + goToHome() async { + await authenticatedUserObject.getUser(getUser: true); + authenticatedUserObject.isLogin = true; + appointmentRateViewModel.isLogin = true; + projectViewModel.isLogin = true; + projectViewModel.user = authenticatedUserObject.user; + Provider.of(context, listen: false) + .setUser(authenticatedUserObject.user); + getToDoCount(); + appointmentRateViewModel + .getIsLastAppointmentRatedList() + .then((value) => { + getToDoCount(), + // GifLoaderDialogUtils.hideDialog(context), + if (appointmentRateViewModel.isHaveAppointmentNotRate) + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: RateAppointmentDoctor(), + ), + (r) => false) + } + else + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: LandingPage(), + ), + (r) => false) + } + }) + .catchError((err) { + print(err); + //GifLoaderDialogUtils.hideDialog(context); + }); + // SMSOTP.showLoadingDialog(context, false), + } + + loading(flag) { + setState(() { + isLoading = flag; + }); + } + + Widget getButton(flag) { + switch (flag) { + case 4: + return InkWell( + onTap: () => {authenticateUser(4, true)}, + child: RoundedContainer( + height: 140, + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: EdgeInsets.fromLTRB(5, 15, 5, 15), + child: Column( + children: [ + Image.asset( + 'assets/images/login/104.png', + height: SizeConfig.imageSizeMultiplier * 13, + width: SizeConfig.imageSizeMultiplier * 16, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context).verifyWhatsApp, + fontSize: SizeConfig.textMultiplier * 2, + ) + ], + ), + ))); + break; + case 1: + return InkWell( + onTap: () => {authenticateUser(1, true)}, + child: RoundedContainer( + height: 140, + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: EdgeInsets.fromLTRB(5, 15, 5, 15), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/login/103.png', + height: SizeConfig.imageSizeMultiplier * 13, + width: SizeConfig.imageSizeMultiplier * 16, + ), + projectViewModel.isArabic + ? SizedBox( + height: 20, + ) + : SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context).verifySMS, + fontSize: projectViewModel.isArabic + ? SizeConfig.textMultiplier * 1.8 + : SizeConfig.textMultiplier * 2, + textAlign: TextAlign.center, + ) + ], + ), + ))); + break; + case 2: + return InkWell( + onTap: () => {authenticateUser(2, BiometricType.fingerprint.index)}, + child: RoundedContainer( + height: 140, + backgroundColor: BiometricType.fingerprint.index == 1 + ? Colors.white + : Colors.white.withOpacity(.7), + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: EdgeInsets.fromLTRB(5, 15, 5, 15), + child: Column( + children: [ + Image.asset( + 'assets/images/login/102.png', + height: SizeConfig.imageSizeMultiplier * 13, + width: SizeConfig.imageSizeMultiplier * 16, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context).verifyFingerprint, + fontSize: SizeConfig.textMultiplier * 2, + ) + ], + ), + ))); + break; + case 3: + return InkWell( + onTap: () => {authenticateUser(3, BiometricType.face.index)}, + child: RoundedContainer( + height: 140, + backgroundColor: checkIfBiometricAvailable(BiometricType.face) + ? Colors.white + : Colors.white.withOpacity(.7), + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: EdgeInsets.fromLTRB(5, 15, 5, 15), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/login/101.png', + height: SizeConfig.imageSizeMultiplier * 13, + width: SizeConfig.imageSizeMultiplier * 16, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context).verifyFaceID, + fontSize: SizeConfig.textMultiplier * 2, + ) + ], + ), + ))); + break; + + default: + return InkWell( + onTap: () => { + setState(() { + isMoreOption = true; + }) + }, + child: RoundedContainer( + height: 140, + backgroundColor: BiometricType.fingerprint.index == 1 + ? Colors.white + : Colors.white.withOpacity(.7), + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: EdgeInsets.fromLTRB(5, 15, 5, 15), + child: Column( + children: [ + Image.asset( + 'assets/images/login/more_icon.png', + height: SizeConfig.imageSizeMultiplier * 13, + width: SizeConfig.imageSizeMultiplier * 16, + ), + projectViewModel.isArabic + ? SizedBox( + height: 15, + ) + : SizedBox( + height: 10, + ), + AppText( + TranslationBase.of(context).moreVerification, + fontSize: SizeConfig.textMultiplier * 2, + textAlign: TextAlign.center, + ) + ], + ), + ))); + } + } + + getType(type, context) { + switch (type) { + case 1: + return TranslationBase.of(context).verifySMS; + break; + case 2: + return TranslationBase.of(context).verifyFingerprint; + break; + case 3: + return TranslationBase.of(context).verifyFaceID; + break; + case 4: + return TranslationBase.of(context).verifyWhatsApp; + break; + default: + return TranslationBase.of(context).verifySMS; + break; + } + } + + bool checkIfBiometricAvailable(BiometricType biometricType) { + bool isAvailable = false; + if (_availableBiometrics != null) { + for (var i = 0; i < _availableBiometrics.length; i++) { + if (biometricType == _availableBiometrics[i]) isAvailable = true; + } + } + return isAvailable; + } + + formatDate(date) { + return DateFormat('MMM dd, yyy, kk:mm').format(date); + } + + showLoader(bool isTrue) { + setState(() { + isLoading = isTrue; + }); + } +} diff --git a/lib/pages/login/forgot-password.dart b/lib/pages/login/forgot-password.dart new file mode 100644 index 00000000..cb2604b1 --- /dev/null +++ b/lib/pages/login/forgot-password.dart @@ -0,0 +1,146 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ForgotPassword extends StatefulWidget { + @override + _ForgotPassword createState() => _ForgotPassword(); +} + +class _ForgotPassword extends State { + String selectedType = 'Saudi Arabia'; + String countryCode = '966'; + final TextEditingController nationalIDorFile = null; + String mobileNo; + var con; + @override + Widget build(BuildContext context) { + con = context; + return AppScaffold( + appBarTitle: TranslationBase.of(context).forgotFileNoTitle, + isShowAppBar: true, + isShowDecPage: false, + body: SingleChildScrollView( + child: Container( + padding: EdgeInsets.only(top: 10, left: 20, right: 20), + height: SizeConfig.realScreenHeight * .8, + width: SizeConfig.realScreenWidth, + child: Column(children: [ + Expanded( + flex: 1, + child: AppText( + TranslationBase.of(context).forgotDesc, + fontSize: SizeConfig.textMultiplier * 3, + textAlign: TextAlign.start, + marginTop: 10.0, + )), + Expanded( + flex: 2, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [], + ), + MobileNo( + onNumberChange: (value) => {mobileNo = value}, + onCountryChange: (value) => countryCode = value), + ], + ), + ), + Expanded( + flex: 2, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).submit, + () { + sendPatientIDBySMS(); +// print(mobileNo.text); + }, + )), + ], + ), + ], + )) + ]), + ))); + } + + sendPatientIDBySMS() { + GifLoaderDialogUtils.showMyDialog(context); + final authService = new AuthProvider(); + authService.sendPatientIDSMS(mobileNo, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + this.startSMSService(mobileNo, res['LogInTokenID']); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + startSMSService(mobile, token) { + new SMSOTP( + context, + 1, + mobile, + (value) => {this.checkActivationCode(value, token, int.parse(mobileNo))}, + () => { + print('Faild..'), + }, + ).displayDialog(context); + } + + checkActivationCode(value, token, mobileNo) { + GifLoaderDialogUtils.showMyDialog(context); + final authService = new AuthProvider(); + var request = { + "LogInTokenID": token, + "PatientOutSA": countryCode == '966' ? 0 : 1, + "PatientMobileNumber": mobileNo, + "ZipCode": countryCode, + "activationCode": value, + "isRegister": false, + "IsSilentLogin": false + }; + authService.forgotPasswordActivation(request, value).then((res) { + if (res is String) { + GifLoaderDialogUtils.hideDialog(con); + Future.delayed(Duration(seconds: 1), () { + AppToast.showErrorToast(message: res); + }); + } else { + GifLoaderDialogUtils.hideDialog(con); + Navigator.of(context).pop(); + AlertDialogBox( + context: con, + confirmMessage: res['ReturnMessage'], + okText: TranslationBase.of(con).ok, + okFunction: () { + AlertDialogBox.closeAlertDialog(con); + Navigator.of(context).pop(); + }).showAlertDialog(context); + } + }); + } +} diff --git a/lib/pages/login/login-type.dart b/lib/pages/login/login-type.dart new file mode 100644 index 00000000..6113fb71 --- /dev/null +++ b/lib/pages/login/login-type.dart @@ -0,0 +1,181 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class LoginType extends StatelessWidget { + static int loginType = 0; + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).login, + isShowAppBar: true, + isShowDecPage: false, + body: SingleChildScrollView( + child: Container( + padding: + EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), + height: SizeConfig.realScreenHeight * .9, + width: SizeConfig.realScreenWidth, + child: Column( + children: [ + Expanded( + flex: 4, + child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + 'assets/images/DQ/dq_logo_icon.png', + height: 90, + width: 90, + ), + AppText( + TranslationBase.of(context).logintypeRadio, + fontSize: SizeConfig.textMultiplier * 3.5, + textAlign: TextAlign.start, + marginBottom: 20.0, + marginTop: 20.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: InkWell( + onTap: () => { + LoginType.loginType = 1, + Navigator.of(context) + .pushNamed(LOGIN_PAGE) + }, + child: RoundedContainer( + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: EdgeInsets.fromLTRB( + 20, 10, 20, 10), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/id_card_icon.png', + height: SizeConfig + .imageSizeMultiplier * + 12, + width: SizeConfig + .imageSizeMultiplier * + 15, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context) + .idNo, + fontSize: SizeConfig + .textMultiplier * + 2, + fontWeight: FontWeight.bold, + ) + ], + ), + )))), + Expanded( + child: InkWell( + onTap: () => { + LoginType.loginType = 2, + Navigator.of(context) + .pushNamed(LOGIN_PAGE) + }, + child: RoundedContainer( + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: EdgeInsets.fromLTRB( + 25, 10, 25, 10), + child: Column( + children: [ + Image.asset( + 'assets/images/my_file_white_icon.png', + height: SizeConfig + .imageSizeMultiplier * + 12, + width: SizeConfig + .imageSizeMultiplier * + 15, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context) + .fileNo, + fontSize: SizeConfig + .textMultiplier * + 2, + fontWeight: FontWeight.bold, + ) + ], + ), + )))) + ], + ), + SizedBox( + height: 25, + ), + Divider( + color: Colors.grey, + height: 2, + ), + Center( + child: InkWell( + onTap: () => { + Navigator.of(context) + .pushNamed(FORGOT_PASSWORD) + }, + child: AppText( + TranslationBase.of(context) + .forgotPassword, + fontSize: + SizeConfig.textMultiplier * 2.5, + marginTop: 20.0, + underline: true))) + ]), + ), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Divider( + color: Colors.grey, + height: 2, + ), + SizedBox( + height: 10, + ), + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).registerNow, + () => { + Navigator.of(context).pushNamed( + REGISTER, + ) + }, + )), + ], + ), + ], + )) + ], + )))); + } +} diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart new file mode 100644 index 00000000..c2a943d2 --- /dev/null +++ b/lib/pages/login/login.dart @@ -0,0 +1,313 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/pages/login/login-type.dart'; +import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; +import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class Login extends StatefulWidget { + @override + _Login createState() => _Login(); +} + +class _Login extends State { + final util = Utils(); + final nationalIDorFile = TextEditingController(); + final int loginType = LoginType.loginType; + String mobileNo; + String countryCode = '966'; + bool isButtonDisabled = true; + final authService = new AuthProvider(); + var sharedPref = new AppSharedPreferences(); + bool isLoading = false; + AppointmentRateViewModel appointmentRateViewModel = + locator(); + + AuthenticatedUserObject authenticatedUserObject = + locator(); + + ProjectViewModel projectViewModel; + ToDoCountProviderModel toDoProvider; + + @override + void initState() { +// getDeviceToken(); + super.initState(); + } + + getDeviceToken() async { + setState(() async { + nationalIDorFile.text = await sharedPref.getString(PUSH_TOKEN); + }); + } + + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + toDoProvider = Provider.of(context); + return AppScaffold( + appBarTitle: TranslationBase.of(context).login, + isShowAppBar: true, + isShowDecPage: false, + body: SingleChildScrollView( + child: Container( + padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), + height: SizeConfig.realScreenHeight * .9, + width: SizeConfig.realScreenWidth, + child: Column( + children: [ + Expanded( + flex: 2, + child: AppText( + TranslationBase.of(context).enterNationalId, + fontSize: SizeConfig.textMultiplier * 3.5, + textAlign: TextAlign.start, + )), + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + MobileNo(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), + Directionality( + textDirection: TextDirection.ltr, + child: Container( + child: TextFields( + keyboardType: TextInputType.number, + fontWeight: FontWeight.normal, + controller: nationalIDorFile, + onChanged: (value) => {validateForm()}, + prefixIcon: Icon( + loginType == 1 + ? Icons.chrome_reader_mode + : Icons.receipt, + color: Color(0xFF40ACC9)), + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + hintText: loginType == 1 + ? TranslationBase.of(context).nationalID + : TranslationBase.of(context).fileNo, + ))) + ], + ), + ), + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Divider( + color: Colors.grey, + height: 2, + ), + SizedBox( + height: 10, + ), + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).login, + () => {this.startLogin()}, + color: isButtonDisabled == true + ? Colors.grey + : Colors.grey[900], + textColor: Colors.white, + )) + ], + ), + ], + )) + ], + ), + ), + ), + ); + } + + startLogin() { + if (isButtonDisabled == false) { + checkUserAuthentication(); + } + } + + void validateForm() { + if (util.validateIDBox(nationalIDorFile.text, loginType) == true && + util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) { + setState(() { + isButtonDisabled = false; + }); + } else { + setState(() { + isButtonDisabled = true; + }); + } + } + + checkUserAuthentication() { + // showLoader(true); + var request = CheckPatientAuthenticationReq(); + request.isRegister = false; + request.patientMobileNumber = int.parse(mobileNo); + request.zipCode = countryCode; + request.searchType = this.loginType; + request.deviceTypeID = this.loginType; + if (this.loginType == 1) { + request.patientIdentificationID = this.nationalIDorFile.text; + request.patientID = 0; + } else { + request.patientIdentificationID = ''; + request.patientID = int.parse(nationalIDorFile.text); + } + sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request); + GifLoaderDialogUtils.showMyDialog(context); + authService + .checkPatientAuthentication(request) + .then((value) => { + //showLoader(false), + if (value['isSMSSent']) + { + sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']), + sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request), + GifLoaderDialogUtils.hideDialog(context), + Navigator.of(context).pushNamed(CONFIRM_LOGIN) + } + else + { + if (value['IsAuthenticated']) {this.checkActivationCode()} + } + }) + .catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: err, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => { + ConfirmDialog.closeAlertDialog(context), + Navigator.of(context).pushNamed( + REGISTER, + ), + }, + cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); + dialog.showAlertDialog(context); + }); + // SMSOTP.showLoadingDialog(context, false), + } + + checkActivationCode({code}) async { + Map request = {}; + // request.logInTokenID = await sharedPref.getString(LOGIN_TOKEN_ID); + // request.activationCode = code ?? "0000"; + // request.isSilentLogin = code != null ? false : true; + if (code == null) + //showLoader(true); + request['PatientMobileNumber'] = int.parse(mobileNo); + request['ZipCode'] = countryCode; + request['SearchType'] = loginType; + request['LoginType'] = loginType; + if (this.loginType == 1) { + request['PatientIdentificationID'] = this.nationalIDorFile.text; + request['PatientID'] = 0; + } else { + request['PatientIdentificationID'] = ''; + request['PatientID'] = int.parse(nationalIDorFile.text); + } + // request.isRegister = false; + this.authService.checkActivationCode(request, code).then((result) async { + sharedPref.remove(FAMILY_FILE); + // Register GeoZones after login + registerGeoZones(); + projectViewModel.setPrivilege(privilegeList: result); + result = CheckActivationCode.fromJson(result); + result.list.isFamily = false; + // this.sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']), + this.sharedPref.setObject(USER_PROFILE, result.list); + this.sharedPref.setObject(MAIN_USER, result.list); + this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); + this.sharedPref.setString(TOKEN, result.authenticationTokenID); + await authenticatedUserObject.getUser(getUser: true); + authenticatedUserObject.isLogin = true; + appointmentRateViewModel.isLogin = true; + projectViewModel.isLogin = true; + projectViewModel.user = authenticatedUserObject.user; + appointmentRateViewModel + .getIsLastAppointmentRatedList() + .then((value) => { + getToDoCount(), + GifLoaderDialogUtils.hideDialog(context), + if (appointmentRateViewModel.isHaveAppointmentNotRate) + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: RateAppointmentDoctor(), + ), + (r) => false) + } + else + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: LandingPage(), + ), + (r) => false) + } + }) + .catchError((err) { + print(err); + GifLoaderDialogUtils.hideDialog(context); + }); + + }); + } + + getToDoCount() { + toDoProvider.setState(0, true); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + print(res['AppointmentActiveNumber']); + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber'], true); + } else {} + }).catchError((err) { + print(err); + }); + } + + void registerGeoZones() { + projectViewModel.platformBridge().registerHmgGeofences(); + } + +// showLoader(bool isTrue) { +// setState(() { +// isLoading = isTrue; +// }); +// } +} diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart new file mode 100644 index 00000000..467068cc --- /dev/null +++ b/lib/pages/login/register-info.dart @@ -0,0 +1,397 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; +import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart'; +import 'package:diplomaticquarterapp/models/Authentication/register_user_requet.dart'; +import 'package:diplomaticquarterapp/pages/login/login-type.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hijri/hijri_calendar.dart'; +import 'package:intl/intl.dart'; + +class RegisterInfo extends StatefulWidget { + @override + _RegisterInfo createState() => _RegisterInfo(); +} + +class _RegisterInfo extends State { + final authService = new AuthProvider(); + final sharedPref = new AppSharedPreferences(); + RegisterInfoResponse registerInfo; + bool isLoading; + int page = 1; + final List locationList = [ + new Location(name: 'KSA', value: '1'), + new Location(name: 'Dubai', value: '2'), + ]; + String language = '1'; + var registerd_data; + final List languageList = [ + new Language(name: 'English', value: '2'), + new Language(name: 'Arabic', value: '1'), + ]; + String email = ''; + + String location = '1'; + + @override + void initState() { + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + getRegisterInfo(); + }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).register, + isShowAppBar: true, + isShowDecPage: false, + body: SingleChildScrollView( + padding: EdgeInsets.all(20), + child: Column(children: [ + AppText( + TranslationBase.of(context).patientInfo, + fontSize: SizeConfig.textMultiplier * 3, + textAlign: TextAlign.left, + ), + registerInfo != null && page == 1 + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + AppText(TranslationBase.of(context).nationalID), + Container( + margin: EdgeInsets.only(bottom: 10), + child: TextFields( + hintText: registerInfo.idNumber, + prefixIcon: Icon(Icons.chrome_reader_mode, + color: Colors.red), + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + readOnly: true, + )), + AppText(TranslationBase.of(context).firstName), + Container( + margin: EdgeInsets.only(bottom: 10), + child: TextFields( + hintText: registerInfo.firstNameEn == '-' + ? registerInfo.firstNameAr + : registerInfo.firstNameEn, + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + readOnly: true, + )), + AppText(TranslationBase.of(context).middleName), + Container( + margin: EdgeInsets.only(bottom: 10), + child: TextFields( + hintText: registerInfo.secondNameEn == '-' + ? registerInfo.secondNameAr + : registerInfo.secondNameEn, + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + readOnly: true, + )), + AppText(TranslationBase.of(context).lastName), + Container( + margin: EdgeInsets.only(bottom: 10), + child: TextFields( + hintText: registerInfo.lastNameEn == '-' + ? registerInfo.lastNameAr + : registerInfo.lastNameEn, + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + readOnly: true, + )), + AppText(TranslationBase.of(context).gender), + Container( + margin: EdgeInsets.only(bottom: 10), + child: TextFields( + hintText: registerInfo.maritalStatusCode == 'U' + ? 'Unknown' + : registerInfo.maritalStatusCode == 'M' + ? 'Male' + : 'Female', + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + readOnly: true, + )), + AppText(TranslationBase.of(context).maritalStatus), + Container( + margin: EdgeInsets.only(bottom: 10), + child: TextFields( + hintText: registerInfo.maritalStatus, + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + readOnly: true, + )), + AppText(TranslationBase.of(context).nationality), + Container( + margin: EdgeInsets.only(bottom: 10), + child: TextFields( + hintText: registerInfo.nationalityCode, + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + readOnly: true, + )), + AppText(TranslationBase.of(context).mobileNumber), + Container( + margin: EdgeInsets.only(bottom: 10), + child: TextFields( + hintText: + registerd_data.patientMobileNumber.toString(), + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + readOnly: true, + )), + AppText(TranslationBase.of(context).dob), + Container( + margin: EdgeInsets.only(bottom: 10), + child: TextFields( + hintText: registerInfo.dateOfBirth, + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + readOnly: true, + )), + ], + ) + : registerInfo != null && page == 2 + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(TranslationBase.of(context).language, + textAlign: TextAlign.start), + Container( + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white, + border: Border.all(color: Colors.grey), + borderRadius: BorderRadius.circular(10)), + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: language, + iconSize: 40, + elevation: 16, + onChanged: (value) => { + setState(() { + language = value; + }) + }, + items: languageList + .map>( + (Language value) { + return DropdownMenuItem( + value: value.value, + child: Text(value.name), + ); + }).toList()))), + AppText(TranslationBase.of(context).location), + Container( + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white, + border: Border.all(color: Colors.grey), + borderRadius: BorderRadius.circular(10)), + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: location, + iconSize: 40, + elevation: 16, + onChanged: (value) => { + setState(() { + location = value; + }) + }, + items: locationList + .map>( + (Location value) { + return DropdownMenuItem( + value: value.value, + child: Text(value.name), + ); + }).toList()))), + AppText(TranslationBase.of(context).email), + Container( + margin: EdgeInsets.only(bottom: 10), + child: TextFields( + onChanged: (value) => { + setState(() { + email = value; + }) + }, + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + )), + ], + ) + : SizedBox(), + Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Row( + children: [ + Expanded( + child: DefaultButton( + page == 1 + ? TranslationBase.of(context).next + : TranslationBase.of(context).register, + () => {nextPage()}, + textColor: Colors.white, + color: this.isValid() == false && page == 2 + ? Colors.grey + : Colors.black, + )) + ], + ), + ], + ) + ]), + )); + } + + nextPage() { + if (page == 1) { + setState(() { + page++; + }); + } else { + registerNow(); + } + } + + registerNow() { + dynamic request = getTempUserRequest(); + GifLoaderDialogUtils.showMyDialog(context); + this.authService.registerUser(request).then((result) => { + GifLoaderDialogUtils.hideDialog(context), + // userData = result.list; + //AuthenticatedUser.fromJson(result['List'][0]), + if(result is String){ + new ConfirmDialog( + context: context, + confirmMessage: result, + okText: TranslationBase.of(context).ok, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => { + ConfirmDialog.closeAlertDialog(context) + }, + cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}) + .showAlertDialog(context) + + }else + { + result.list.isFamily = false, + sharedPref.setObject(USER_PROFILE, result.list), + this.sharedPref.setObject(MAIN_USER, result.list), + sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), + sharedPref.setString(TOKEN, result.authenticationTokenID), + Navigator.of(context).pushNamed(HOME) + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: err, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => { + ConfirmDialog.closeAlertDialog(context) + }, + cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); + dialog.showAlertDialog(context); + + }); + } + + getRegisterInfo() async { + var data = + RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA)); + if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) { + var data2 = CheckPatientAuthenticationReq.fromJson( + await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN)); + + setState(() { + this.registerInfo = data; + + this.registerd_data = data2; + }); + } + } + + getTempUserRequest() { + DateFormat dateFormat = DateFormat("mm/dd/yyyy"); + print(dateFormat.parse(registerInfo.dateOfBirth)); + var hDate = + new HijriCalendar.fromDate(dateFormat.parse(registerInfo.dateOfBirth)); + var date = hDate.toString(); + return { + "Patientobject": { + "TempValue": true, + "PatientIdentificationType": 1, + "PatientIdentificationNo": registerInfo.idNumber, + "MobileNumber": registerd_data.patientMobileNumber, + "PatientOutSA": registerd_data.zipCode == '966' ? 0 : 1, + "FirstNameN":registerInfo.firstNameAr =='-' ?"": registerInfo.firstNameAr, + "FirstName": registerInfo.firstNameEn =='-' ?"":registerInfo.firstNameEn, + "MiddleNameN":registerInfo.secondNameAr =='-' ? "" : registerInfo.secondNameAr, + "MiddleName":registerInfo.secondNameEn == '-' ? "": registerInfo.secondNameEn, + "LastNameN": registerInfo.lastNameAr =='-'? "" : registerInfo.lastNameAr, + "LastName": registerInfo.lastNameEn =='-' ? "": registerInfo.lastNameEn, + "StrDateofBirth": registerInfo.dateOfBirth, + "DateofBirth": DateUtil.convertISODateToJsonDate( + registerInfo.dateOfBirth.replaceAll('/', '-')), + "Gender": registerInfo.gender == 'M' ? 1 : 2, + "NationalityID": registerInfo.nationality, + "DateofBirthN": date, + "EmailAddress": email, + "SourceType": location, + "PreferredLanguage": registerd_data.languageID.toString(), + "Marital": registerInfo.maritalStatusCode == 'U' + ? '0' + : registerInfo.maritalStatusCode == 'M' + ? '1' + : '2', + }, + "PatientIdentificationID": registerInfo.idNumber, + "PatientMobileNumber": registerd_data.patientMobileNumber, + }; + } + + bool isValid() { + if (location != null || + language != null || + Utils.validEmail(email) == true) { + return true; + } else { + return false; + } + } +} + +class Language { + final String name; + final String value; + Language({this.name, this.value}); +} + +class Location { + final String name; + final String value; + Location({this.name, this.value}); +} diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart new file mode 100644 index 00000000..131db748 --- /dev/null +++ b/lib/pages/login/register.dart @@ -0,0 +1,333 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_user_status_reponse.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_user_status_req.dart'; +import 'package:diplomaticquarterapp/models/Authentication/checkpatient_for_registration.dart'; +import 'package:diplomaticquarterapp/pages/login/login-type.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; +import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class Register extends StatefulWidget { + @override + _Register createState() => _Register(); +} + +class _Register extends State { + final nationalIDorFile = TextEditingController(); + final int loginType = LoginType.loginType; + String mobileNo; + String countryCode = '966'; + var isHijri; + final util = Utils(); + DateTime selectedDate; + String dob; + bool isButtonDisabled = true; + final authService = new AuthProvider(); + final sharedPref = new AppSharedPreferences(); + + bool isLoading; + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).register, + isShowAppBar: true, + isShowDecPage: false, + body: SingleChildScrollView( + child: Container( + padding: + EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), + height: SizeConfig.realScreenHeight * .9, + width: SizeConfig.realScreenWidth, + child: Column(children: [ + Expanded( + flex: 1, + child: AppText( + TranslationBase.of(context).enterNationalId, + fontSize: SizeConfig.textMultiplier * 3, + textAlign: TextAlign.left, + )), + Expanded( + flex: 4, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + MobileNo( + onNumberChange: (value) => + {mobileNo = value, validateForm()}, + onCountryChange: (value) => countryCode = value), + Container( + child: TextFields( + controller: nationalIDorFile, + onChanged: (value) => validateForm(), + keyboardType: TextInputType.number, + prefixIcon: Icon(Icons.chrome_reader_mode, + color: Color(0xFF40ACC9)), + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + hintText: TranslationBase.of(context).nationalID, + )), + Row( + children: [ + Expanded( + child: Row( + children: [ + Radio( + value: 1, + groupValue: isHijri, + onChanged: (value) { + setState(() { + isHijri = value; + }); + validateForm(); + }, + ), + Text(TranslationBase.of(context).hijriDate), + ], + ), + ), + Expanded( + child: Row( + children: [ + Radio( + value: 0, + groupValue: isHijri, + onChanged: (value) { + setState(() { + isHijri = value; + }); + validateForm(); + }, + ), + Text(TranslationBase.of(context).gregorianDate), + ], + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + width: SizeConfig.realScreenWidth * .9, + height: 60, + child: isHijri == 1 + ? TextFields( + onChanged: (value) => {dob = value}, + hintText: 'DD/MM/YYYY', + prefixIcon: Icon(Icons.date_range), + ) + : RaisedButton.icon( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(15.0), + ), + color: Colors.white, + onPressed: () => { + if (isHijri != null) + _selectDate(context) + }, + icon: Icon(Icons.date_range), + label: Text(selectedDate != null + ? "${selectedDate.toLocal()}" + .split(' ')[0] + : TranslationBase.of(context).dob))) + ]) + ], + ), + ), + Expanded( + flex: 2, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Divider( + color: Colors.grey, + height: 2, + ), + SizedBox( + height: 10, + ), + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).registerNow, + () => {startRegistration()}, + textColor: Colors.white, + color: isButtonDisabled == true + ? Colors.grey + : Colors.grey[900])) + ], + ), + ], + )) + ]), + ))); + } + + Future _selectDate(BuildContext context) async { + final DateTime picked = await showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(1950, 8), + lastDate: DateTime.now()); + if (picked != null && picked != selectedDate) + setState(() { + selectedDate = picked; + }); + } + + startRegistration() { + if (isButtonDisabled == false) { + var request = CheckPatientForRegistration(); + request.patientMobileNumber = int.parse(mobileNo); + request.zipCode = countryCode; + request.patientOutSA = countryCode == '966' ? 0 : 1; + // if (this.loginType == 1) { + request.patientIdentificationID = int.parse(nationalIDorFile.text); + request.patientID = 0; + request.isRegister = true; + // } else { + // request.patientIdentificationID = 0; + // request.patientID = int.parse(nationalIDorFile.text); + // } + this.checkPatientForRegisteration(request); + } + } + + checkPatientForRegisteration(request) { + GifLoaderDialogUtils.showMyDialog(context); + this + .authService + .checkPatientForRegisteration(request) + .then((response) => {checkUserStatus(response, request)}) + .catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: err, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => { + ConfirmDialog.closeAlertDialog(context), + Navigator.of(context).pushNamed( + REGISTER, + ), + }, + cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); + dialog.showAlertDialog(context); + }); + } + + void validateForm() { + if (util.validateIDBox(nationalIDorFile.text, loginType) == true && + mobileNo.length >= 9 && + util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true && + isHijri != null) { + setState(() { + isButtonDisabled = false; + }); + } else { + setState(() { + isButtonDisabled = true; + }); + } + } + + checkUserStatus(response, CheckPatientForRegistration request) async { + GifLoaderDialogUtils.hideDialog(context); + if (response is Map) { + var nRequest = request.toJson(); + nRequest['LogInTokenID'] = response['LogInTokenID']; + if (response['hasFile'] == true) { + // AppToast.showErrorToast(message: response['ErrorEndUserMessage']); + AlertDialogBox( + context: context, + confirmMessage: response['ErrorEndUserMessage'], + okText: TranslationBase.of(context).ok, + okFunction: () { + AlertDialogBox.closeAlertDialog(context); + Navigator.of(context).pop(); + }).showAlertDialog(context); + } else { + nRequest['forRegister'] = true; + nRequest['isRegister'] = true; + nRequest["PatientIdentificationID"] = + nRequest["PatientIdentificationID"].toString(); + sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, nRequest); + sharedPref.setString(LOGIN_TOKEN_ID, response['LogInTokenID']); + this.chekUserData(response['LogInTokenID']); + } + } else { + // if (response['ErrorCode'] == '-986') { + //AppToast.showErrorToast(message: response); + AlertDialogBox( + context: context, + confirmMessage: response, + okText: TranslationBase.of(context).ok, + okFunction: () { + AlertDialogBox.closeAlertDialog(context); + Navigator.of(context).pop(); + }).showAlertDialog(context); + //} + } + } + + chekUserData(loginToken) { + // let m = hijri(this.dateOfBirth).locale('en'); + // // const dateHijri = m.format('iDD/iMM/iYYYY'); + // const request = { + // PatientIdentificationID: this.id.toString(), + // // TokenID: token, + // DOB: this.dateOption === '1' ? this.dateOfBirth : moment(this.dateOfBirth).format('DD/MM/YYYY'), + // IsHijri: Number(this.dateOption) + // } + GifLoaderDialogUtils.showMyDialog(context); + var request = CheckUserStatusRequest(); + request.patientIdentificationID = nationalIDorFile.text; + request.dOB = isHijri == 1 + ? dob + : "${selectedDate.toLocal()}".split(' ')[0].replaceAll('-', '/'); + request.isHijri = isHijri; + request.patientOutSA = countryCode == '966' ? 0 : 1; + this.authService.checkUserStatus(request).then((result) => { + GifLoaderDialogUtils.hideDialog(context), + if (result is Map) + { + result = CheckUserStatusResponse.fromJson(result), + sharedPref.setObject(NHIC_DATA, result), + Navigator.of(context).pushNamed( + CONFIRM_LOGIN, + ) + // Navigator.of(context).pushNamed( + // REGISTER_INFO, + // ) + } + else + {AppToast.showErrorToast(message: result)} + //this.onRegister(); + }); + } + + showLoader(bool isTrue) { + setState(() { + isLoading = isTrue; + }); + } +} diff --git a/lib/pages/login/welcome.dart b/lib/pages/login/welcome.dart new file mode 100644 index 00000000..419df302 --- /dev/null +++ b/lib/pages/login/welcome.dart @@ -0,0 +1,101 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class WelcomeLogin extends StatefulWidget { + @override + _WelcomeLogin createState() => _WelcomeLogin(); +} + +class _WelcomeLogin extends State { + bool isLoading = true; + + @override + void initState() { + isLoading = true; + // checkUser(context); + super.initState(); + } + + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).welcome, + isShowDecPage: false, + isShowAppBar: true, + body: Padding( + padding: EdgeInsets.all(20), + child: Column( + children: [ + Expanded( + flex: 6, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset('assets/images/DQ/dq_logo_icon.png', + height: 90, width: 90), + Text( + TranslationBase.of(context).welcome, + style: TextStyle( + fontSize: 30, fontWeight: FontWeight.bold), + textAlign: TextAlign.start, + ), + Text( + TranslationBase.of(context).welcomeText, + style: TextStyle(fontSize: 24), + textAlign: TextAlign.start, + ), + Text( + TranslationBase.of(context).welcomeText2, + style: TextStyle(fontSize: 24), + textAlign: TextAlign.start, + ), + SizedBox( + height: SizeConfig.realScreenHeight * .15, + ) + ]), + ), + Expanded( + flex: 2, + child: Column( + //mainAxisAlignment: MainAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).yes, + () => { + Navigator.of(context).pushNamed( + LOGIN_TYPE, + ), + }, + color: Color(0xFF40ACC9), + textColor: Colors.white, + )) + ], + ), + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).no, + () => { + Navigator.of(context).pushNamed( + REGISTER, + ) + }, + )) + ], + ), + ], + )) + ], + ))); + } +} diff --git a/lib/pages/medical/active_medications/ActiveMedicationsPage.dart b/lib/pages/medical/active_medications/ActiveMedicationsPage.dart new file mode 100644 index 00000000..5bc9618d --- /dev/null +++ b/lib/pages/medical/active_medications/ActiveMedicationsPage.dart @@ -0,0 +1,131 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/ActiveMedicationsViewModel.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/active_medications/reminder_page.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ActiveMedicationsPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getActiveMedication(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).activeMedications, + isShowAppBar: true, + body: Container( + child: ListView.builder( + itemCount: model.activePrescriptionReport.length, + itemBuilder: (context, index) => Container( + padding: EdgeInsets.all(10), + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), color: Colors.white), + child: Row( + children: [ + Image.memory( + Utils.dataFromBase64String(model + .activePrescriptionReport[index].productImageBase64), + height: SizeConfig.imageSizeMultiplier * 19, + width: SizeConfig.imageSizeMultiplier * 18, + fit: BoxFit.cover, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + model.activePrescriptionReport[index].itemDescription, + bold: true, + ), + SizedBox( + height: 5, + ), + Texts( + TranslationBase.of(context).expDate+' :' + + DateUtil.getDayMonthYearDateFormatted(model + .activePrescriptionReport[index].orderDate), + ), + SizedBox( + height: 5, + ), + Texts( + TranslationBase.of(context).route+ ' :' + + model.activePrescriptionReport[index].route, + ), + SizedBox( + height: 5, + ), + Texts( + TranslationBase.of(context).frequency+ ' :' + + model.activePrescriptionReport[index].frequency, + ), + SizedBox( + height: 5, + ), + Texts( + TranslationBase.of(context).dailyQuantity + ' :${model.activePrescriptionReport[index].doseDailyQuantity}', + ), + ], + ), + ), + Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Icon( + Icons.notifications, + color: Colors.red, + size: 28, + ), + SizedBox(height: 25,), + InkWell( + onTap: (){ + Navigator.push( + context, + FadePage( + page: ReminderPage( + frequency: model.activePrescriptionReport[index] + .frequencyNumber, + days: model.activePrescriptionReport[index].days, + itemDescription: model + .activePrescriptionReport[index] + .itemDescription, + ), + ), + ); + }, + child: Row( + children: [ + Icon( + Icons.notifications_active, + color: Colors.red, + size: 28, + ), + Texts( + TranslationBase.of(context).addReminder, + color: Colors.red, + ) + ], + ), + ) + ], + ), + ) + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/active_medications/DayCheckBoxDialog.dart b/lib/pages/medical/active_medications/DayCheckBoxDialog.dart new file mode 100644 index 00000000..5cb4020c --- /dev/null +++ b/lib/pages/medical/active_medications/DayCheckBoxDialog.dart @@ -0,0 +1,161 @@ +import 'package:device_calendar/device_calendar.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class DayCheckBoxDialog extends StatefulWidget { + final Function(List) onValueSelected; + final String title; + final List selectedDaysOfWeek; + final List daysOfWeek = [ + DayOfWeek.Monday, + DayOfWeek.Tuesday, + DayOfWeek.Wednesday, + DayOfWeek.Thursday, + DayOfWeek.Friday, + DayOfWeek.Saturday, + DayOfWeek.Sunday, + ]; + + DayCheckBoxDialog( + {Key key, this.onValueSelected, this.selectedDaysOfWeek, this.title}); + + @override + _DayCheckBoxDialogState createState() => _DayCheckBoxDialogState(); +} + +class _DayCheckBoxDialogState extends State { + @override + Widget build(BuildContext context) { + return SimpleDialog( + title: Container( + width: double.infinity, + child: Center( + child: Texts( + widget.title, + textAlign: TextAlign.center, + ))), + children: [ + Container( + height: widget.daysOfWeek.length > 3 + ? MediaQuery.of(context).size.height * 0.6 + : null, + child: SingleChildScrollView( + child: Column( + children: [ + Divider(), + ...List.generate( + widget.daysOfWeek.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + if (widget.selectedDaysOfWeek + .contains(widget.daysOfWeek[index])) + widget.selectedDaysOfWeek + .remove(widget.daysOfWeek[index]); + else + widget.selectedDaysOfWeek + .add(widget.daysOfWeek[index]); + }); + }, + child: ListTile( + title: Text(DateUtil.getDay(widget.daysOfWeek[index])), + leading: Checkbox( + value: widget.selectedDaysOfWeek + .contains(widget.daysOfWeek[index]), + onChanged: (value) { + setState(() { + if (widget.selectedDaysOfWeek + .contains(widget.daysOfWeek[index])) + widget.selectedDaysOfWeek + .remove(widget.daysOfWeek[index]); + else + widget.selectedDaysOfWeek + .add(widget.daysOfWeek[index]); + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context) + .cancel + .toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedDaysOfWeek); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + ), + ), + ), + ), + ), + ], + ) + ], + ), + ), + ) + ], + ); + } + + +} diff --git a/lib/pages/medical/active_medications/reminder_page.dart b/lib/pages/medical/active_medications/reminder_page.dart new file mode 100644 index 00000000..7980d941 --- /dev/null +++ b/lib/pages/medical/active_medications/reminder_page.dart @@ -0,0 +1,332 @@ +import 'package:device_calendar/device_calendar.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/ActiveMedicationsViewModel.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:provider/provider.dart'; + +import 'DayCheckBoxDialog.dart'; + +// ignore: must_be_immutable +class ReminderPage extends StatefulWidget { + final int frequency; + final int days; + final String itemDescription; + + List _scheduleList = List(); + List daysOfWeek = [ + DayOfWeek.Monday, + DayOfWeek.Tuesday, + DayOfWeek.Wednesday, + DayOfWeek.Thursday, + DayOfWeek.Friday, + DayOfWeek.Saturday, + DayOfWeek.Sunday + ]; + + DateTime startDay; + DateTime endDay; + + ReminderPage({Key key, this.frequency, this.days, this.itemDescription}) { + startDay = DateTime.now(); + endDay = DateTime.now().add(Duration(days: days)); + int hour = (24 ~/ frequency).round(); + int durations = 24 ~/ hour; + for (int count = 0; count < durations; count++) { + _scheduleList.add(DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day, (hour * count))); + } + } + + @override + _ReminderPageState createState() => _ReminderPageState(); +} + +class _ReminderPageState extends State { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).reminder, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.maxFinite, + child: Texts(TranslationBase.of(context).reminderDes), + ), + Divider(), + SizedBox( + height: 12, + ), + Texts(TranslationBase.of(context).startDay), + SizedBox( + height: 6, + ), + InkWell( + onTap: () { + DatePicker.showDatePicker(context, + showTitleActions: true, + minTime: DateTime( + DateTime.now().year, DateTime.now().month - 1, 1), + maxTime: DateTime.now(), onConfirm: (date) { + setState(() { + widget.startDay = date; + }); + }, + currentTime: widget.startDay, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getStartDay()), + Icon( + Icons.calendar_today, + color: Colors.black, + ) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + Texts(TranslationBase.of(context).endDay), + SizedBox( + height: 6, + ), + InkWell( + onTap: () { + DatePicker.showDatePicker(context, + showTitleActions: true, + minTime: DateTime( + DateTime.now().year, DateTime.now().month - 1, 1), + maxTime: DateTime.now(), onConfirm: (date) { + setState(() { + widget.endDay = date; + }); + }, + currentTime: widget.endDay, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getEndDay()), + Icon( + Icons.calendar_today, + color: Colors.black, + ) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + Texts(TranslationBase.of(context).days), + SizedBox( + height: 6, + ), + InkWell( + onTap: () => confirmSelectDayDialog(), + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Texts( + getDays(), + )), + Icon( + Icons.arrow_drop_down, + color: Colors.black, + ) + ], + ), + ), + ), + ...List.generate( + widget._scheduleList.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 7, + ), + Texts(TranslationBase.of(context).scheduleTime), + SizedBox( + height: 7, + ), + InkWell( + onTap: () { + DatePicker.showTimePicker(context, + showTitleActions: true, onConfirm: (date) { + setState(() { + widget._scheduleList[index] = date; + }); + }, + currentTime: widget._scheduleList[index], + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts(getDateTime( + widget._scheduleList[index])), + Icon( + Icons.access_time, + color: Colors.black, + ) + ], + ), + ), + ), + ], + )), + Container( + width: double.maxFinite, + height: MediaQuery.of(context).size.height * 0.12, + ), + ], + ), + ), + ), + bottomSheet: Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.2, + padding: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SecondaryButton( + label: TranslationBase.of(context).ok, + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + schedule(); + }, + ), + SizedBox( + height: 15, + ), + SecondaryButton( + label: TranslationBase.of(context).cancel, + color: Colors.red[800], + textColor: Colors.white, + onTap: () { + Navigator.pop(context); + }, + ), + ], + ), + ), + ), + ); + } + + schedule() async { + List scheduleDateTime = + calculateDaysInterval(widget.startDay, widget.endDay); + + CalendarUtils calendarUtils = await CalendarUtils.getInstance(); + + calendarUtils.createOrUpdateEvents( + scheduleList: widget._scheduleList, + description: widget.itemDescription, + title: widget.itemDescription, + scheduleDateTime: scheduleDateTime); + + Navigator.pop(context); + } + + List calculateDaysInterval(DateTime startDate, DateTime endDate) { + List days = []; + for (int i = 0; i <= endDate.difference(startDate).inDays; i++) { + widget._scheduleList.forEach((element) { + days.add(startDate.add( + Duration(days: i, hours: element.hour, minutes: element.minute))); + }); + } + return days; + } + + String getStartDay() { + return "${DateUtil.getMonth(widget.startDay.month)} ${widget.startDay.day}, ${widget.startDay.year}"; + } + + String getEndDay() { + return "${DateUtil.getMonth(widget.endDay.month)} ${widget.endDay.day}, ${widget.endDay.year}"; + } + + String getDateTime(DateTime dateTime) { + return '${dateTime.hour}:${dateTime.minute}'; + } + + String getDays() { + String days = ""; + widget.daysOfWeek.forEach((element) { + days += "${DateUtil.getDay(element)},"; + }); + return days; + } + + void confirmSelectDayDialog() { + showDialog( + context: context, + child: DayCheckBoxDialog( + title: 'Select Day', + selectedDaysOfWeek: widget.daysOfWeek, + onValueSelected: (value) { + setState(() { + widget.daysOfWeek = value; + }); + }, + ), + ); + } +} diff --git a/lib/pages/medical/allergies_page.dart b/lib/pages/medical/allergies_page.dart new file mode 100644 index 00000000..459ef0f8 --- /dev/null +++ b/lib/pages/medical/allergies_page.dart @@ -0,0 +1,59 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/AllergiesViewModel.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class AllergiesPage extends StatelessWidget { + List imagesInfo = List(); + @override + Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/alllergies/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/alllergies/ar/0.png')); + return BaseView( + onModelReady: (model) => model.getAllergies(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).allergies, + baseViewModel: model, + description: TranslationBase.of(context).infoAllergies, + imagesInfo: imagesInfo, + body: ListView.builder( + itemCount: model.allergies.length, + itemBuilder: (context, index) => Container( + margin: EdgeInsets.all(15), + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + ), + child: Row( + children: [ + Image.asset( + 'assets/images/new-design/allergiesDetails.png', + width: 50, + height: 50, + fit: BoxFit.cover, + ), + SizedBox( + width: 15, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(TranslationBase.of(context).remarks+" :"), + Texts(TranslationBase.of(context).description + model.allergies[index].description ?? ''), + ], + ), + ) + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/ask_doctor/ViewDoctorResponsesPage.dart b/lib/pages/medical/ask_doctor/ViewDoctorResponsesPage.dart new file mode 100644 index 00000000..fc47ed3c --- /dev/null +++ b/lib/pages/medical/ask_doctor/ViewDoctorResponsesPage.dart @@ -0,0 +1,33 @@ +import 'package:diplomaticquarterapp/core/model/ask_doctor/DoctorResponse.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; + +class ViewDoctorResponsesPage extends StatelessWidget { + final DoctorResponse doctorResponse; + + const ViewDoctorResponsesPage({Key key, this.doctorResponse}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.updateReadStatus(transactionNo: doctorResponse.transactionNo), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).viewDoctorResponses, + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart new file mode 100644 index 00000000..902225b1 --- /dev/null +++ b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart @@ -0,0 +1,123 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'ask_doctor_page.dart'; +import 'doctor_response.dart'; + +class AskDoctorHomPage extends StatefulWidget { + @override + _AskDoctorHomPageState createState() => _AskDoctorHomPageState(); +} + +class _AskDoctorHomPageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).askDoctor, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.9), + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + labelColor: Theme.of(context).primaryColor, + labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Tab( + child: Container( + width: MediaQuery.of(context).size.width * 0.36, + child: Center( + child: Texts(TranslationBase.of(context).askDoctor), + ), + ), + ), + Tab(child: Container( + width: MediaQuery.of(context).size.width * 0.36, + child: Center( + child: Texts(TranslationBase.of(context).doctorResponses,textAlign: TextAlign.start,), + ), + ),) + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + AskDoctorPage(), + DoctorResponse() + ], + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/medical/ask_doctor/ask_doctor_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_page.dart new file mode 100644 index 00000000..6beed0dc --- /dev/null +++ b/lib/pages/medical/ask_doctor/ask_doctor_page.dart @@ -0,0 +1,240 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/ask_doctor/request_type.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rating_bar/rating_bar.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +class AskDoctorPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getMyDoctor(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(10), + child: Column( + children: [ + SizedBox( + height: 70, + ), + ...List.generate( + model.patientDoctorAppointmentListHospital.length, + (index) => AppExpandableNotifier( + title: + model.patientDoctorAppointmentListHospital[index].filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: + model.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.map((doctor) { + return InkWell( + onTap: () { + model + .getCallInfoHoursResult( + doctorId: doctor.doctorID, + projectId: doctor.projectID) + .then((value) { + if (model.state != ViewState.ErrorLocal && + model.state != ViewState.Error) { + // Navigator.pop(context); + Navigator.push( + context, + FadePage( + page: RequestTypePage(doctorList: doctor,), + ), + ); + } else { + AppToast.showErrorToast(message: model.error); + } + }); + + ///.showProgressBar( + // text: "Loading", + // backgroundColor: + // Colors.blue.withOpacity(0.6)) + }, + child: Card( + margin: + EdgeInsets.fromLTRB(10.0, 16.0, 10.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + decoration: BoxDecoration(), + padding: EdgeInsets.all(7.0), + width: MediaQuery.of(context).size.width, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: + BorderRadius.circular(100.0), + child: Image.network( + doctor.doctorImageURL, + fit: BoxFit.fill, + height: 60.0, + width: 60.0), + ), + ), + Expanded( + flex: 4, + child: Container( + width: + MediaQuery.of(context).size.width * + 0.55, + margin: EdgeInsets.fromLTRB( + 20.0, 10.0, 10.0, 0.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + if (doctor.doctorTitle != null) + Text( + doctor.doctorTitle + + " " + + doctor.name, + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700], + letterSpacing: 1.0)), + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(doctor.clinicName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(doctor.projectName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + if (doctor.speciality != null) + Container( + margin: EdgeInsets.only( + top: 3.0, bottom: 3.0), + child: Text( + getDoctorSpeciality( + doctor.speciality) + .trim(), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + doctor.nearestFreeSlot != null + ? Container( + margin: EdgeInsets.only( + top: 3.0, bottom: 3.0), + child: Text( + getDate(doctor + .nearestFreeSlot), + style: TextStyle( + fontSize: 14.0, + fontWeight: + FontWeight.bold, + color: Colors + .green[600], + letterSpacing: + 1.0)), + ) + : Container(), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: doctor + .actualDoctorRate + .toDouble(), + size: 20.0, + filledColor: + Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: + Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + Container( + child: Image.network( + doctor.nationalityFlagURL, + width: 25.0, + height: 25.0), + ), + ], + ), + ], + ), + ), + ), + ], + ), + ), + ), + ); + }).toList(), + )), + ) + ], + ), + ), + ), + ), + ); + } + + String getDoctorSpeciality(List docSpecial) { + String docSpeciality = ""; + docSpecial.forEach((v) { + docSpeciality = docSpeciality + v + "\n"; + }); + return docSpeciality; + } + + String getDate(String date) { + DateTime dateObj = DateUtil.convertStringToDate(date); + return DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString() + + " " + + dateObj.hour.toString() + + ":" + + getMinute(dateObj); + } + + String getMinute(DateTime dateObj) { + if (dateObj.minute == 0) { + return dateObj.minute.toString() + "0"; + } else { + return dateObj.minute.toString(); + } + } +} + diff --git a/lib/pages/medical/ask_doctor/doctor_response.dart b/lib/pages/medical/ask_doctor/doctor_response.dart new file mode 100644 index 00000000..846c9a05 --- /dev/null +++ b/lib/pages/medical/ask_doctor/doctor_response.dart @@ -0,0 +1,189 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import 'ViewDoctorResponsesPage.dart'; + +class DoctorResponse extends StatelessWidget { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getDoctorResponse(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 65, + ), + AppExpandableNotifier( + headerWidget: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(TranslationBase.of(context).newDes), + Container( + width: 30, + height: 30, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.red[800], + ), + child: Center( + child: Texts( + '${model.doctorResponseList.length}', + color: Colors.white, + ), + ), + ) + ], + ), + ), + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model.doctorResponseList.map( + (doctor) { + return InkWell( + onTap: () { + ///go to page ViewDoctorResponsesPage + Navigator.push( + context, + FadePage( + page: ViewDoctorResponsesPage( + doctorResponse: doctor, + ), + ), + ); + }, + child: Container( + height: 70, + margin: EdgeInsets.only(top: 8, bottom: 8), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + color: Colors.white, + border: Border.all(color: Colors.grey[300]), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts('${doctor.doctorName}'), + SizedBox( + height: 5, + ), + Texts( + '${doctor.requestTypeDescription}'), + ], + ), + ), + ), + Icon(projectViewModel.isArabic + ? Icons.arrow_forward_ios + : Icons.arrow_back_ios) + ], + ), + ), + ); + }, + ).toList(), + ), + ), + AppExpandableNotifier( + headerWidget: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(TranslationBase.of(context).all), + Container( + width: 30, + height: 30, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.red[800], + ), + child: Center( + child: Texts( + '${model.doctorResponseList.length}', + color: Colors.white, + ), + ), + ) + ], + ), + ), + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model.doctorResponseList.map( + (doctor) { + return InkWell( + onTap: () {}, + child: Container( + height: 70, + margin: EdgeInsets.only(top: 8, bottom: 8), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + color: Colors.white, + border: Border.all(color: Colors.grey[300]), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts('${doctor.doctorName}'), + SizedBox( + height: 5, + ), + Texts( + '${doctor.requestTypeDescription}'), + ], + ), + ), + ), + Icon(projectViewModel.isArabic + ? Icons.arrow_forward_ios + : Icons.arrow_back_ios) + ], + ), + ), + ); + }, + ).toList(), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/ask_doctor/request_type.dart b/lib/pages/medical/ask_doctor/request_type.dart new file mode 100644 index 00000000..55e04a73 --- /dev/null +++ b/lib/pages/medical/ask_doctor/request_type.dart @@ -0,0 +1,134 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class RequestTypePage extends StatefulWidget { + final DoctorList doctorList; + + RequestTypePage({Key key, this.doctorList}); + + @override + _RequestTypePageState createState() => _RequestTypePageState(); +} + +class _RequestTypePageState extends State { + String selected = ""; + int parameterCode = -1; + String question = ""; + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getCallRequestTypeLOVs(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).requestType, + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ...List.generate( + model.askDoctorReqTypes.length, + (index) => Container( + width: double.maxFinite, + height: 55, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.0)), + margin: EdgeInsets.all(8.0), + child: InkWell( + onTap: () { + setState(() { + selected = model.askDoctorReqTypes[index].description; + parameterCode = + model.askDoctorReqTypes[index].parameterCode; + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + model.askDoctorReqTypes[index].description), + ), + Radio( + value: model.askDoctorReqTypes[index].description, + groupValue: selected, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + selected = value; + parameterCode = model + .askDoctorReqTypes[index].parameterCode; + }); + }, + ), + ], + ), + ), + ), + ), + if (parameterCode == 6) + Container( + margin: EdgeInsets.only(left: 10, right: 10), + child: NewTextFields( + hintText: TranslationBase.of(context).questionHere, + minLines: 2, + maxLines: 15, + onChanged: (value) { + setState(() { + question = value; + }); + }, + ), + ), + Container( + width: double.maxFinite, + height: MediaQuery.of(context).size.height * 0.2, + ), + ], + ), + ), + ), + bottomSheet: Container( + width: double.maxFinite, + height: MediaQuery.of(context).size.height * 0.1, + child: Padding( + padding: const EdgeInsets.all(12.0), + child: SecondaryButton( + label: TranslationBase.of(context).submit, + loading: model.state == ViewState.BusyLocal, + textColor: Colors.white, + onTap: () { + model + .sendRequestLOV( + doctorList: widget.doctorList, + requestType: parameterCode.toString(), + remark: question) + .then((value) { + if (model.state != ViewState.ErrorLocal || + model.state != ViewState.Error) { + Navigator.pop(context); + } + }); + }, + color: Colors.grey[800], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart new file mode 100644 index 00000000..a3005db5 --- /dev/null +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -0,0 +1,429 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectHospitalDialog.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +import '../../../core/model/my_balance/AdvanceModel.dart'; +import 'confirm_payment_page.dart'; +import 'dialogs/SelectBeneficiaryDialog.dart'; +import 'dialogs/SelectPatientFamilyDialog.dart'; +import 'dialogs/SelectPatientInfoDialog.dart'; +import 'new_text_Field.dart'; + +enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } + +class AdvancePaymentPage extends StatefulWidget { + @override + _AdvancePaymentPageState createState() => _AdvancePaymentPageState(); +} + +class _AdvancePaymentPageState extends State { + TextEditingController _fileTextController = TextEditingController(); + TextEditingController _notesTextController = TextEditingController(); + BeneficiaryType beneficiaryType = BeneficiaryType.NON; + HospitalsModel _selectedHospital; + String amount = ""; + String email; + PatientInfo _selectedPatientInfo; + AuthenticatedUser authenticatedUser; + GetAllSharedRecordsByStatusList selectedPatientFamily; + AdvanceModel advanceModel = AdvanceModel(); + + AppSharedPreferences sharedPref = AppSharedPreferences(); + AuthenticatedUser authUser; + + List imagesInfo = List(); + + @override + void initState() { + super.initState(); + getAuthUser(); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/advance-payment/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/advance-payment/ar/0.png')); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getHospitals(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + imagesInfo: imagesInfo, + appBarTitle: TranslationBase.of(context).advancePayment, + description: TranslationBase.of(context).infoAdvancePayment, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).advancePaymentLabel, + textAlign: TextAlign.center, + ), + SizedBox( + height: 12, + ), + InkWell( + onTap: () => confirmSelectBeneficiaryDialog(model), + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getBeneficiaryType()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + if (beneficiaryType == BeneficiaryType.MyFamilyFiles) + SizedBox( + height: 12, + ), + if (beneficiaryType == BeneficiaryType.MyFamilyFiles) + InkWell( + onTap: () { + GifLoaderDialogUtils.showMyDialog(context); + model.getFamilyFiles().then((value) { + GifLoaderDialogUtils.hideDialog(context); + confirmSelectFamilyDialog(model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList); + }); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getFamilyMembersName()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: TranslationBase.of(context).fileNumber, + controller: _fileTextController, + ), + if (beneficiaryType == BeneficiaryType.OtherAccount) + SizedBox( + height: 12, + ), + if (beneficiaryType == BeneficiaryType.OtherAccount) + InkWell( + onTap: () { + if (_fileTextController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + model + .getPatientInfoByPatientID( + id: _fileTextController.text) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + confirmSelectPatientDialog(model.patientInfoList); + }); + } else + AppToast.showErrorToast( + message: 'Please Enter The File Number'); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getPatientName()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + InkWell( + onTap: () => confirmSelectHospitalDialog(model.hospitals), + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getHospitalName()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: TranslationBase.of(context).amount, + keyboardType: TextInputType.number, + onChanged: (value) { + setState(() { + amount = value; + }); + }, + ), + SizedBox( + height: 12, + ), + if(model.user!=null) + NewTextFields( + hintText: TranslationBase.of(context).depositorEmail, + initialValue: model.user.emailAddress, + onChanged: (value) { + email = value; + }, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: TranslationBase.of(context).notes, + controller: _notesTextController, + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.15, + ) + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.13, + width: double.infinity, + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + label: TranslationBase.of(context).submit, + disabled: amount.isEmpty || + _fileTextController.text.isEmpty || + _selectedHospital == null, + onTap: () { + var mobileNum; + var patientName; + + if (beneficiaryType == BeneficiaryType.MyFamilyFiles) { + mobileNum = selectedPatientFamily.mobileNumber; + patientName = selectedPatientFamily.patientName; + } + + if (beneficiaryType == BeneficiaryType.MyAccount) { + mobileNum = model.user.mobileNumber; + patientName = model.user.firstName; + } + + if (beneficiaryType == BeneficiaryType.OtherAccount) { + mobileNum = _selectedPatientInfo.mobileNumber; + patientName = _selectedPatientInfo.fullName; + } + + advanceModel.fileNumber = _fileTextController.text; + advanceModel.hospitalsModel = _selectedHospital; + advanceModel.note = _notesTextController.text; + advanceModel.email = email ?? model.user.emailAddress; + advanceModel.amount = amount; + advanceModel.mobileNumber = mobileNum; + advanceModel.patientName = patientName; + GifLoaderDialogUtils.showMyDialog(context); + model + .getPatientInfoByPatientIDAndMobileNumber(advanceModel) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (model.state != ViewState.Error && + model.state != ViewState.ErrorLocal) { + Utils.hideKeyboard(context); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PaymentMethod())).then( + (value) { + Navigator.push( + context, + FadePage( + page: ConfirmPaymentPage( + advanceModel: advanceModel, + selectedPaymentMethod: value, + patientInfoAndMobileNumber: + model.patientInfoAndMobileNumber, + authenticatedUser: authUser, + ), + ), + ); + }, + ); + } + }); + }, + ), + )), + ); + } + + void confirmSelectBeneficiaryDialog(MyBalanceViewModel model) { + showDialog( + context: context, + child: SelectBeneficiaryDialog( + beneficiaryType: beneficiaryType, + onValueSelected: (value) { + setState(() { + if (value == BeneficiaryType.MyAccount) { + _fileTextController.text = model.user.patientID.toString(); + advanceModel.depositorName = + model.user.firstName + " " + model.user.lastName; + } else + _fileTextController.text = ""; + + beneficiaryType = value; + }); + }, + ), + ); + } + + void confirmSelectHospitalDialog(List hospitals) { + showDialog( + context: context, + child: SelectHospitalDialog( + hospitals: hospitals, + selectedHospital: _selectedHospital, + onValueSelected: (value) { + setState(() { + _selectedHospital = value; + }); + }, + ), + ); + } + + void confirmSelectPatientDialog(List patientInfoList) { + showDialog( + context: context, + child: SelectPatientInfoDialog( + patientInfoList: patientInfoList, + selectedPatientInfo: _selectedPatientInfo, + onValueSelected: (value) { + setState(() { + advanceModel.depositorName = value.fullName; + _selectedPatientInfo = value; + }); + }, + ), + ); + } + + void confirmSelectFamilyDialog( + List getAllSharedRecordsByStatusList) { + if (getAllSharedRecordsByStatusList.isNotEmpty) + showDialog( + context: context, + child: SelectPatientFamilyDialog( + getAllSharedRecordsByStatusList: getAllSharedRecordsByStatusList, + selectedPatientFamily: selectedPatientFamily, + onValueSelected: (value) { + setState(() { + selectedPatientFamily = value; + _fileTextController.text = + selectedPatientFamily.responseID.toString(); + advanceModel.depositorName = value.patientName; + }); + }, + ), + ); + } + + String getBeneficiaryType() { + switch (beneficiaryType) { + case BeneficiaryType.MyAccount: + return TranslationBase.of(context).myAccount; + case BeneficiaryType.MyFamilyFiles: + return TranslationBase.of(context).myFamilyFiles; + break; + case BeneficiaryType.OtherAccount: + return TranslationBase.of(context).otherAccount; + break; + case BeneficiaryType.NON: + return TranslationBase.of(context).selectBeneficiary; + } + return TranslationBase.of(context).selectBeneficiary; + } + + String getHospitalName() { + if (_selectedHospital != null) + return _selectedHospital.name; + else + return TranslationBase.of(context).selectHospital; + } + + String getPatientName() { + if (_selectedPatientInfo != null) + return _selectedPatientInfo.fullName; + else + return TranslationBase.of(context).selectPatientName; + } + + getAuthUser() async { + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + setState(() { + authUser = data; + }); + } + } + + String getFamilyMembersName() { + if (selectedPatientFamily != null) + return selectedPatientFamily.patientName; + else + return TranslationBase.of(context).selectFamilyPatientName; + } +} diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart new file mode 100644 index 00000000..8a69bf5d --- /dev/null +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -0,0 +1,324 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'dialogs/ConfirmSMSDialog.dart'; +import 'new_text_Field.dart'; + +class ConfirmPaymentPage extends StatelessWidget { + final AdvanceModel advanceModel; + final PatientInfoAndMobileNumber patientInfoAndMobileNumber; + final String selectedPaymentMethod; + MyInAppBrowser browser; + AuthenticatedUser authenticatedUser; + AppSharedPreferences sharedPref = AppSharedPreferences(); + String transID = ""; + + ConfirmPaymentPage( + {this.advanceModel, + this.patientInfoAndMobileNumber, + this.selectedPaymentMethod, + this.authenticatedUser}); + + @override + Widget build(BuildContext context) { + void showSMSDialog() { + showDialog( + context: context, + barrierDismissible: false, + child: ConfirmSMSDialog( + phoneNumber: patientInfoAndMobileNumber.mobileNumber, + ), + ).then((value) { + print("dialog dismissed"); + print(value); + if (value != null && value) { + AppoitmentAllHistoryResultList appo = + new AppoitmentAllHistoryResultList(); + appo.projectID = patientInfoAndMobileNumber.projectID; + openPayment(selectedPaymentMethod, authenticatedUser, + double.parse(advanceModel.amount), null); + } + }); + } + + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).advancePayment, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).confirmThePayment, + textAlign: TextAlign.center, + fontWeight: FontWeight.w500, + fontSize: 24, + ), + SizedBox( + height: 12, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + height: 100.0, + padding: EdgeInsets.all(7.0), + width: MediaQuery.of(context).size.width * 0.45, + child: Image.asset(getImagePath(selectedPaymentMethod)), + ), + Texts( + '${advanceModel.amount} SAR', + fontSize: 26, + bold: true, + ) + ], + ), + SizedBox( + height: 12, + ), + Row( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.all(3), + child: NewTextFields( + hintText: TranslationBase.of(context).fileNumber, + initialValue: advanceModel.fileNumber, + isEnabled: false, + ), + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.all(3), + child: NewTextFields( + hintText: TranslationBase.of(context).name, + initialValue: patientInfoAndMobileNumber.firstName, + isEnabled: false, + ), + ), + ), + ], + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: TranslationBase.of(context).mobileNumber, + initialValue: patientInfoAndMobileNumber.mobileNumber, + isEnabled: false, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: TranslationBase.of(context).depositorName, + initialValue: model.user.firstName + + " " + + model.user.middleName + + " " + + model.user.lastName, + isEnabled: false, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: TranslationBase.of(context).notes, + initialValue: advanceModel.note, + isEnabled: false, + ), + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.13, + width: double.infinity, + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + color: Theme.of(context).primaryColor, + label: TranslationBase.of(context).confirm.toUpperCase(), + disabled: model.state == ViewState.Busy, + onTap: () { + GifLoaderDialogUtils.showMyDialog(context); + model + .sendActivationCodeForAdvancePayment( + patientID: int.parse(advanceModel.fileNumber), + projectID: advanceModel.hospitalsModel.iD) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (model.state != ViewState.ErrorLocal && + model.state != ViewState.Error) showSMSDialog(); + }); + }, + ), + ), + ), + ); + } + + String getImagePath(String paymentMethod) { + switch (paymentMethod) { + case "MADA": + return 'assets/images/new-design/mada.png'; + break; + case "SADAD": + return 'assets/images/new-design/sadad.png'; + break; + case "VISA": + return 'assets/images/new-design/visa.png'; + break; + case "MASTERCARD": + return 'assets/images/new-design/mastercard.png'; + break; + case "Installment": + return 'assets/images/new-design/installment.png'; + break; + } + + return 'assets/images/new-design/mada.png'; + } + + openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, + double amount, AppoitmentAllHistoryResultList appo) { + browser = new MyInAppBrowser( + onExitCallback: onBrowserExit, + appo: appo, + onLoadStartCallback: onBrowserLoadStart); + + transID = Utils.getAdvancePaymentTransID( + advanceModel.hospitalsModel.iD, int.parse(advanceModel.fileNumber)); + + browser.openPaymentBrowser( + amount, + "Advance Payment", + transID, + advanceModel.hospitalsModel.iD.toString(), + advanceModel.email, + paymentMethod, + patientInfoAndMobileNumber.patientType, + advanceModel.patientName, + advanceModel.fileNumber, + authenticatedUser, + browser); + } + + onBrowserLoadStart(String url) { + print("onBrowserLoadStart"); + print(url); + + MyInAppBrowser.successURLS.forEach((element) { + if (url.contains(element)) { + if (browser.isOpened()) browser.close(); + MyInAppBrowser.isPaymentDone = true; + return; + } + }); + + MyInAppBrowser.errorURLS.forEach((element) { + if (url.contains(element)) { + if (browser.isOpened()) browser.close(); + MyInAppBrowser.isPaymentDone = false; + return; + } + }); + } + + onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { + print("onBrowserExit Called!!!!"); + if (isPaymentMade) checkPaymentStatus(appo); + } + + checkPaymentStatus(AppoitmentAllHistoryResultList appo) { + GifLoaderDialogUtils.showMyDialog(AppGlobal.context); + DoctorsListService service = new DoctorsListService(); + service.checkPaymentStatus(transID, AppGlobal.context).then((res) { + print("Printing Payment Status Reponse!!!!"); + print(res); + String paymentInfo = res['Response_Message']; + if (paymentInfo == 'Success') { + createAdvancePayment(res, appo); + } else { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + AppToast.showErrorToast(message: res['Response_Message']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + String paymentReference = res['Fort_id'].toString(); + service.HIS_createAdvancePayment( + appo, + advanceModel.hospitalsModel.iD.toString(), + res['Amount'], + res['Fort_id'], + res['PaymentMethod'], + patientInfoAndMobileNumber.patientType, + advanceModel.patientName, + advanceModel.fileNumber, + AppGlobal.context) + .then((res) { + print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); + addAdvancedNumberRequest( + res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), + paymentReference, + 0, + appo); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + addAdvancedNumberRequest(String advanceNumber, String paymentReference, + dynamic appointmentID, AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + service + .addAdvancedNumberRequest( + advanceNumber, paymentReference, appointmentID, AppGlobal.context) + .then((res) { + print(res); + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + navigateToHome(AppGlobal.context); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + Future navigateToHome(context) async { + Navigator.of(context).pushNamed(HOME); + } +} diff --git a/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart b/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart new file mode 100644 index 00000000..380f250c --- /dev/null +++ b/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart @@ -0,0 +1,374 @@ +import 'dart:async'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ConfirmSMSDialog extends StatefulWidget { + final String phoneNumber; + final AdvanceModel advanceModel; + final PatientInfoAndMobileNumber patientInfoAndMobileNumber; + final String selectedPaymentMethod; + + const ConfirmSMSDialog( + {Key key, + this.phoneNumber, + this.advanceModel, + this.selectedPaymentMethod, + this.patientInfoAndMobileNumber}) + : super(key: key); + + @override + _ConfirmSMSDialogState createState() => _ConfirmSMSDialogState(); +} + +class _ConfirmSMSDialogState extends State { + final verifyAccountForm = GlobalKey(); + Map verifyAccountFormValue = { + 'digit1': null, + 'digit2': null, + 'digit3': null, + 'digit4': null, + }; + + TextEditingController digit1 = TextEditingController(text: ""); + TextEditingController digit2 = TextEditingController(text: ""); + TextEditingController digit3 = TextEditingController(text: ""); + TextEditingController digit4 = TextEditingController(text: ""); + + String timerText = (TIMER_MIN - 1).toString() + ':59'; + int min = TIMER_MIN - 1; + int sec = 59; + Timer _timer; + + resendCode() { + min = TIMER_MIN - 1; + sec = 59; + _timer = Timer.periodic(Duration(seconds: 1), (Timer timer) { + if (min <= 0 && sec <= 0) { + timer.cancel(); + } else { + setState(() { + sec = sec - 1; + if (sec == 0 && min == 0) { + Navigator.pop(context); + min = 0; + sec = 0; + } else if (sec == 0) { + min = min - 1; + sec = 59; + } + timerText = min.toString() + ':' + sec.toString(); + }); + } + }); + } + + FocusNode focusD1; + FocusNode focusD2; + FocusNode focusD3; + FocusNode focusD4; + + @override + void initState() { + super.initState(); + resendCode(); + focusD1 = FocusNode(); + focusD2 = FocusNode(); + focusD3 = FocusNode(); + focusD4 = FocusNode(); + } + + @override + void dispose() { + _timer.cancel(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => Dialog( + elevation: 0.6, + child: Container( + height: 520, + child: ListView( + children: [ + Container( + width: double.infinity, + height: 40, + color: Colors.grey[700], + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + flex: 4, + child: Center( + child: Texts( + 'SMS', + color: Colors.white, + textAlign: TextAlign.center, + ))), + Expanded( + flex: 1, + child: InkWell( + onTap: () => Navigator.pop(context), + child: Container( + decoration: BoxDecoration( + shape: BoxShape.circle, color: Colors.white), + child: Icon( + Icons.clear, + color: Colors.grey[900], + )), + ), + ) + ], + ), + ), + Image.asset( + 'assets/images/login/103.png', + height: MediaQuery.of(context).size.width * 0.25, + width: MediaQuery.of(context).size.width * 0.25, + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).pleaseEnterTheVerificationCode + + '[${widget.phoneNumber}]', + textAlign: TextAlign.center, + ), + ), + SizedBox( + height: 12, + ), + Form( + key: verifyAccountForm, + child: Container( + width: SizeConfig.realScreenWidth * 0.90, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 30, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Container( + width: 65, + child: TextFormField( + textInputAction: TextInputAction.next, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ), + focusNode: focusD1, + //maxLength: 1, + controller: digit1, + textAlign: TextAlign.center, + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + onSaved: (val) { + verifyAccountFormValue['digit1'] = val; + }, + validator: validateCodeDigit, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusD2); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context).requestFocus(focusD2); + } + }, + ), + ), + Container( + width: 65, + child: TextFormField( + focusNode: focusD2, + controller: digit2, + textInputAction: TextInputAction.next, + //maxLength: 1, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ), + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + validator: validateCodeDigit, + onSaved: (val) { + verifyAccountFormValue['digit2'] = val; + }, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusD3); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context).requestFocus(focusD3); + } + }, + ), + ), + Container( + width: 65, + child: TextFormField( + focusNode: focusD3, + controller: digit3, + textInputAction: TextInputAction.next, + //maxLength: 1, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ), + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + validator: validateCodeDigit, + onSaved: (val) { + verifyAccountFormValue['digit3'] = val; + }, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD4); + } + }, + )), + Container( + width: 65, + child: TextFormField( + focusNode: focusD4, + controller: digit4, + // maxLength: 1, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ), + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + validator: validateCodeDigit, + onSaved: (val) { + verifyAccountFormValue['digit4'] = val; + }, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusD4); + submit(model); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD4); + submit(model); + } + }), + ) + ], + ), + SizedBox( + height: 8, + ), + if (model.state == ViewState.ErrorLocal || + model.state == ViewState.Error) + Container( + margin: EdgeInsets.only(left: 8, right: 8), + width: double.maxFinite, + child: Texts( + model.error, + color: Colors.red, + ), + ), + SizedBox(height: 20), + // buildText(), + + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context) + .theVerificationCodeExpiresIn + + ' $timerText', + textAlign: TextAlign.center, + ), + ), + SizedBox(height: 20), + + Container( + width: double.maxFinite, + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + label: + TranslationBase.of(context).submit.toUpperCase(), + onTap: () { + submit(model); + }, + ), + ), + ], + ), + ), + ) + ], + ), + ), + ), + ); + } + + void submit(MyBalanceViewModel model) { + if (verifyAccountForm.currentState.validate()) { + final activationCode = + digit1.text + digit2.text + digit3.text + digit4.text; + GifLoaderDialogUtils.showMyDialog(AppGlobal.context); + model + .checkActivationCodeForAdvancePayment(activationCode: activationCode) + .then((value) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + Navigator.pop(context, true); + }); + } + } + + String validateCodeDigit(value) { + if (value.isEmpty) { + return ''; + } + return null; + } + + InputDecoration buildInputDecoration(BuildContext context) { + return InputDecoration( + // ts/images/password_icon.png + contentPadding: EdgeInsets.only(top: 20, bottom: 20), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5)), + borderSide: BorderSide(color: Colors.black), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + borderSide: BorderSide(color: Theme.of(context).primaryColor), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + borderSide: BorderSide(color: Theme.of(context).errorColor), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + borderSide: BorderSide(color: Theme.of(context).errorColor), + ), + ); + } +} diff --git a/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart b/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart new file mode 100644 index 00000000..b004bc38 --- /dev/null +++ b/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart @@ -0,0 +1,176 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../advance_payment_page.dart'; + +class SelectBeneficiaryDialog extends StatefulWidget { + final BeneficiaryType beneficiaryType; + final Function(BeneficiaryType) onValueSelected; + + SelectBeneficiaryDialog( + {Key key, this.beneficiaryType, this.onValueSelected}); + + @override + _SelectBeneficiaryDialogState createState() => + _SelectBeneficiaryDialogState(this.beneficiaryType); +} + +class _SelectBeneficiaryDialogState extends State { + _SelectBeneficiaryDialogState(this.beneficiaryType); + + BeneficiaryType beneficiaryType; + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Container( + child: Column( + children: [ + Divider(), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + beneficiaryType = BeneficiaryType.MyAccount; + }); + }, + child: ListTile( + title: Text(TranslationBase.of(context).myAccount), + leading: Radio( + value: BeneficiaryType.MyAccount, + groupValue: beneficiaryType, + activeColor: Color(0xFF40ACC9), + onChanged: (BeneficiaryType value) { + setState(() { + beneficiaryType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + beneficiaryType = BeneficiaryType.MyFamilyFiles; + }); + }, + child: ListTile( + title: Text(TranslationBase.of(context).myFamilyFiles), + leading: Radio( + value: BeneficiaryType.MyFamilyFiles, + groupValue: beneficiaryType, + activeColor: Color(0xFF40ACC9), + onChanged: (BeneficiaryType value) { + setState(() { + beneficiaryType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + beneficiaryType = BeneficiaryType.OtherAccount; + }); + }, + child: ListTile( + title: Text(TranslationBase.of(context).otherAccount), + leading: Radio( + value: BeneficiaryType.OtherAccount, + groupValue: beneficiaryType, + activeColor: Color(0xFF40ACC9), + onChanged: (BeneficiaryType value) { + setState(() { + beneficiaryType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(beneficiaryType); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + ), + ), + ), + ), + ), + ], + ) + ], + ), + ) + ], + ); + } +} diff --git a/lib/pages/medical/balance/dialogs/SelectCiteisDialog.dart b/lib/pages/medical/balance/dialogs/SelectCiteisDialog.dart new file mode 100644 index 00000000..3d07c08c --- /dev/null +++ b/lib/pages/medical/balance/dialogs/SelectCiteisDialog.dart @@ -0,0 +1,132 @@ +//import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SelectCiteisDialog extends StatefulWidget { + final List hospitals; + final Function(CitiesModel) onValueSelected; + CitiesModel selectedHospital; + + SelectCiteisDialog( + {Key key, this.hospitals, this.onValueSelected, this.selectedHospital}); + @override + _SelectCiteisDialogState createState() => _SelectCiteisDialogState(); +} + +class _SelectCiteisDialogState extends State { + @override + void initState() { + super.initState(); + + widget.selectedHospital = widget.selectedHospital ?? widget.hospitals[0]; + } + + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + children: [ + Divider(), + ...List.generate( + widget.hospitals.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedHospital = widget.hospitals[index]; + }); + }, + child: ListTile( + // title: Text(widget.hospitals[index].description + + // ' ${widget.hospitals[index].distanceInKilometers} KM'), + title: Text(widget.hospitals[index].description), + leading: Radio( + value: widget.hospitals[index], + groupValue: widget.selectedHospital, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedHospital = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedHospital); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} diff --git a/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart b/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart new file mode 100644 index 00000000..42bd66b7 --- /dev/null +++ b/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart @@ -0,0 +1,129 @@ +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SelectHospitalDialog extends StatefulWidget { + final List hospitals; + final Function(HospitalsModel) onValueSelected; + HospitalsModel selectedHospital; + + SelectHospitalDialog( + {Key key, this.hospitals, this.onValueSelected, this.selectedHospital}); + + @override + _SelectHospitalDialogState createState() => _SelectHospitalDialogState(); +} + +class _SelectHospitalDialogState extends State { + @override + void initState() { + super.initState(); + widget.selectedHospital = widget.selectedHospital ?? widget.hospitals[0]; + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + children: [ + Divider(), + ...List.generate( + widget.hospitals.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedHospital = widget.hospitals[index]; + }); + }, + child: ListTile( + title: Text(widget.hospitals[index].name + + ' ${widget.hospitals[index].distanceInKilometers} KM'), + leading: Radio( + value: widget.hospitals[index], + groupValue: widget.selectedHospital, + activeColor: Color(0xFF40ACC9), + onChanged: (value) { + setState(() { + widget.selectedHospital = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedHospital); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} diff --git a/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart b/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart new file mode 100644 index 00000000..bb9afd6c --- /dev/null +++ b/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart @@ -0,0 +1,128 @@ +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SelectPatientFamilyDialog extends StatefulWidget { + final List getAllSharedRecordsByStatusList; + final Function(GetAllSharedRecordsByStatusList) onValueSelected; + GetAllSharedRecordsByStatusList selectedPatientFamily; + + SelectPatientFamilyDialog({Key key, this.getAllSharedRecordsByStatusList, this.onValueSelected,this.selectedPatientFamily}); + + @override + _SelectPatientFamilyDialogState createState() => _SelectPatientFamilyDialogState(); +} + +class _SelectPatientFamilyDialogState extends State { + + @override + void initState() { + super.initState(); + widget.selectedPatientFamily = widget.selectedPatientFamily?? widget.getAllSharedRecordsByStatusList[0]; + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + children: [ + Divider(), + ...List.generate( + widget.getAllSharedRecordsByStatusList.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedPatientFamily = widget.getAllSharedRecordsByStatusList[index]; + }); + }, + child: ListTile( + title: Text(widget.getAllSharedRecordsByStatusList[index].patientName), + leading: Radio( + value: widget.getAllSharedRecordsByStatusList[index], + groupValue: widget.selectedPatientFamily, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedPatientFamily = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedPatientFamily); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} diff --git a/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart b/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart new file mode 100644 index 00000000..bea4f694 --- /dev/null +++ b/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart @@ -0,0 +1,130 @@ +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SelectPatientInfoDialog extends StatefulWidget { + final List patientInfoList ; + final Function(PatientInfo) onValueSelected; + PatientInfo selectedPatientInfo; + + SelectPatientInfoDialog({Key key, this.patientInfoList, this.onValueSelected,this.selectedPatientInfo}); + + @override + _SelectPatientInfoDialogState createState() => _SelectPatientInfoDialogState(); +} + +class _SelectPatientInfoDialogState extends State { + + @override + void initState() { + super.initState(); + widget.selectedPatientInfo = widget.selectedPatientInfo?? widget.patientInfoList[0]; + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + children: [ + Divider(), + ...List.generate( + widget.patientInfoList.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedPatientInfo = widget.patientInfoList[index]; + }); + }, + child: ListTile( + title: Text(widget.patientInfoList[index].fullName), + leading: Radio( + value: widget.patientInfoList[index], + groupValue: widget.selectedPatientInfo, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedPatientInfo = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedPatientInfo); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} diff --git a/lib/pages/medical/balance/my_balance_page.dart b/lib/pages/medical/balance/my_balance_page.dart new file mode 100644 index 00000000..1edbcbf6 --- /dev/null +++ b/lib/pages/medical/balance/my_balance_page.dart @@ -0,0 +1,119 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import 'advance_payment_page.dart'; + +class MyBalancePage extends StatelessWidget { + + List imagesInfo = List(); + + @override + Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/ar/0.png')); + return BaseView( + onModelReady: (model) => model.getPatientAdvanceBalanceAmount(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).myBalances, + imagesInfo: imagesInfo, + description: TranslationBase.of(context).infoMyBalance, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).balanceAmount, + color: Colors.black, + bold: true, + ), + SizedBox( + height: 15, + ), + Container( + padding: EdgeInsets.all(8), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(7), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + + Texts( + '${model.totalAdvanceBalanceAmount ?? 0} '+ TranslationBase.of(context).sar, + color: Colors.white, + bold: true, + ), + Texts( + TranslationBase.of(context).totalBalance, + color: Colors.white, + ), + ], + ), + ), + SizedBox( + height: 9, + ), + ...List.generate( + model.patientAdvanceBalanceAmountList.length, + (index) => Container( + padding: EdgeInsets.all(8), + height: 65, + margin: EdgeInsets.only(top: 8), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(7), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + + Texts( + '${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} '+TranslationBase.of(context).sar, + bold: true, + ), + Texts(model.patientAdvanceBalanceAmountList[index] + .projectDescription), + ], + ), + ), + ), + SizedBox(height: MediaQuery.of(context).size.height * 0.13 ,) + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.12, + color: Colors.white, + width: double.infinity, + padding: EdgeInsets.all(12), + child: SecondaryButton( + // color: Colors.grey[900], + textColor: Colors.white, + label: TranslationBase.of(context).createAdvancedPayment, + onTap: () { + Navigator.push(context, FadePage(page: AdvancePaymentPage())); + }, + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/balance/new_text_Field.dart b/lib/pages/medical/balance/new_text_Field.dart new file mode 100644 index 00000000..ad9eb580 --- /dev/null +++ b/lib/pages/medical/balance/new_text_Field.dart @@ -0,0 +1,239 @@ +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +class NumberTextInputFormatter extends TextInputFormatter { + @override + TextEditingValue formatEditUpdate( + TextEditingValue oldValue, TextEditingValue newValue) { + final int newTextLength = newValue.text.length; + int selectionIndex = newValue.selection.end; + int usedSubstringIndex = 0; + final StringBuffer newText = StringBuffer(); + if (newTextLength >= 1) { + newText.write('('); + if (newValue.selection.end >= 1) selectionIndex++; + } + if (newTextLength >= 4) { + newText.write(newValue.text.substring(0, usedSubstringIndex = 3) + ') '); + if (newValue.selection.end >= 3) selectionIndex += 2; + } + if (newTextLength >= 7) { + newText.write(newValue.text.substring(3, usedSubstringIndex = 6) + '-'); + if (newValue.selection.end >= 6) selectionIndex++; + } + if (newTextLength >= 11) { + newText.write(newValue.text.substring(6, usedSubstringIndex = 10) + ' '); + if (newValue.selection.end >= 10) selectionIndex++; + } + // Dump the rest. + if (newTextLength >= usedSubstringIndex) + newText.write(newValue.text.substring(usedSubstringIndex)); + return TextEditingValue( + text: newText.toString(), + selection: TextSelection.collapsed(offset: selectionIndex), + ); + } +} + +final _mobileFormatter = NumberTextInputFormatter(); + +class NewTextFields extends StatefulWidget { + NewTextFields( + {Key key, + this.type, + this.hintText, + this.suffixIcon, + this.autoFocus, + this.onChanged, + this.initialValue, + this.minLines, + this.maxLines, + this.inputFormatters, + this.padding, + this.focus = false, + this.maxLengthEnforced = true, + this.suffixIconColor, + this.inputAction, + this.onSubmit, + this.keepPadding = true, + this.textCapitalization = TextCapitalization.none, + this.controller, + this.keyboardType, + this.validator, + this.borderOnlyError = false, + this.onSaved, + this.onSuffixTap, + this.readOnly: false, + this.maxLength, + this.prefixIcon, + this.bare = false, + this.onTap, + this.fontSize = 16.0, + this.fontWeight = FontWeight.w700, + this.autoValidate = false, + this.hintColor,this.isEnabled=true}) + : super(key: key); + + final String hintText; + + // final String initialValue; + final String type; + final bool autoFocus; + final IconData suffixIcon; + final Color suffixIconColor; + final Icon prefixIcon; + final VoidCallback onTap; + final TextEditingController controller; + final TextInputType keyboardType; + final FormFieldValidator validator; + final Function onSaved; + final Function onSuffixTap; + final Function onChanged; + final Function onSubmit; + final bool readOnly; + final int maxLength; + final int minLines; + final int maxLines; + final bool maxLengthEnforced; + final bool bare; + final bool isEnabled; + final TextInputAction inputAction; + final double fontSize; + final FontWeight fontWeight; + final bool keepPadding; + final TextCapitalization textCapitalization; + final List inputFormatters; + final bool autoValidate; + final EdgeInsets padding; + final bool focus; + final bool borderOnlyError; + final Color hintColor; + final String initialValue; + @override + _NewTextFieldsState createState() => _NewTextFieldsState(); +} + +class _NewTextFieldsState extends State { + final FocusNode _focusNode = FocusNode(); + bool focus = false; + bool view = false; + + @override + void initState() { + super.initState(); + _focusNode.addListener(() { + setState(() { + focus = _focusNode.hasFocus; + }); + }); + } + + @override + void didUpdateWidget(NewTextFields oldWidget) { + if (widget.focus) _focusNode.requestFocus(); + super.didUpdateWidget(oldWidget); + } + + @override + void dispose() { + _focusNode.dispose(); + super.dispose(); + } + + + bool _determineReadOnly() { + if (widget.readOnly != null && widget.readOnly) { + _focusNode.unfocus(); + return true; + } else { + return false; + } + } + + @override + Widget build(BuildContext context) { + return AnimatedContainer( + duration: Duration(milliseconds: 300), + decoration:BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Container( + margin: EdgeInsets.only(top: 8), + + child: TextFormField( + enabled: widget.isEnabled, + initialValue: widget.initialValue, + keyboardAppearance: Theme.of(context).brightness, + scrollPhysics: BouncingScrollPhysics(), + autovalidate: widget.autoValidate, + textCapitalization: widget.textCapitalization, + onFieldSubmitted: widget.inputAction == TextInputAction.next + ? (widget.onSubmit != null + ? widget.onSubmit + : (val) { + _focusNode.nextFocus(); + }) + : widget.onSubmit, + textInputAction: widget.inputAction, + minLines: widget.minLines ?? 1, + maxLines: widget.maxLines ?? 1, + maxLengthEnforced: widget.maxLengthEnforced, + onChanged: widget.onChanged, + focusNode: _focusNode, + maxLength: widget.maxLength ?? null, + controller: widget.controller, + keyboardType: widget.keyboardType, + readOnly: _determineReadOnly(), + obscureText: widget.type == "password" && !view ? true : false, + autofocus: widget.autoFocus ?? false, + validator: widget.validator, + onSaved: widget.onSaved, + + style: Theme.of(context) + .textTheme + .body2 + .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + inputFormatters: widget.keyboardType == TextInputType.phone + ? [ + WhitelistingTextInputFormatter.digitsOnly, + _mobileFormatter, + ] + : widget.inputFormatters, + decoration: InputDecoration( + labelText: widget.hintText, + labelStyle: TextStyle(color: Colors.black), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Theme.of(context) + .errorColor + .withOpacity(0.5), + width: 1.0), + borderRadius: BorderRadius.circular(12.0)), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Theme.of(context) + .errorColor + .withOpacity(0.5), + width: 1.0), + borderRadius: BorderRadius.circular(8.0)), + focusedBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12)), + disabledBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12)), + enabledBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/doctor/doctor_home_page.dart b/lib/pages/medical/doctor/doctor_home_page.dart new file mode 100644 index 00000000..c8fad3ce --- /dev/null +++ b/lib/pages/medical/doctor/doctor_home_page.dart @@ -0,0 +1,116 @@ +import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/my_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'doctor_profile_page.dart'; + +class DoctorHomePage extends StatelessWidget { + List imagesInfo = List(); + @override + Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-doctor/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-doctor/ar/0.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-doctor/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-doctor/ar/1.png')); + return BaseView( + onModelReady: (model) => model.getMyDoctor(), + builder: (context, MyDoctorViewModel model, widget) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).myDoctor, + description: TranslationBase.of(context).infoMyDoctor, + infoList: TranslationBase.of(context).infoMyDoctorPoints, + imagesInfo: imagesInfo, + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: FractionallySizedBox( + widthFactor: 1.0, + child: Center( + child: Column( + children: [ + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () => model.setFilterType(FilterType.Clinic), + child: ListTile( + title: Text(TranslationBase.of(context).clinic), + leading: Radio( + value: FilterType.Clinic, + groupValue: model.filterType, + onChanged: (FilterType value) { + model.setFilterType(value); + }, + ), + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => model.setFilterType(FilterType.Hospital), + child: ListTile( + title: Text(TranslationBase.of(context).hospital), + leading: Radio( + value: FilterType.Hospital, + groupValue: model.filterType, + onChanged: (FilterType value) => + model.setFilterType(value), + ), + ), + ), + ) + ], + ), + ...List.generate( + model.patientDoctorAppointmentList.length, + (index) => AppExpandableNotifier( + title: model + .patientDoctorAppointmentList[index].filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model.patientDoctorAppointmentList[index] + .patientDoctorAppointmentList + .map((doctor) { + DoctorList doctorList = DoctorList( + projectID: doctor.projectID, + setupID: doctor.setupID, + clinicID: doctor.clinicID, + projectName: doctor.projectName, + clinicName: doctor.clinicName, + actualDoctorRate: doctor.actualDoctorRate, + doctorID: doctor.doctorID, + doctorRate: doctor.doctorRate, + gender: doctor.gender, + doctorTitle: doctor.doctorTitle, + name: doctor.name, + doctorImageURL: doctor.doctorImageURL, + nationalityFlagURL: doctor.nationalityFlagURL); + return DoctorView( + doctor: doctorList, + isLiveCareAppointment: false, + ); + + }).toList(), + )), + ) + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/doctor/doctor_information_page.dart b/lib/pages/medical/doctor/doctor_information_page.dart new file mode 100644 index 00000000..7634cde2 --- /dev/null +++ b/lib/pages/medical/doctor/doctor_information_page.dart @@ -0,0 +1,199 @@ +import 'package:diplomaticquarterapp/core/model/doctor/doctor_profile.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class DoctorInformation extends StatefulWidget { + final DoctorProfile doctorProfile; + + const DoctorInformation({Key key, this.doctorProfile}) : super(key: key); + + @override + _DoctorInformationState createState() => _DoctorInformationState(); +} + +class _DoctorInformationState extends State { + bool _isShowInfo = true; + bool _isScientificQualification = true; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.grey[200], + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 10, right: 10, left: 10), + padding: EdgeInsets.all(10.0), + width: double.infinity, + //height: 250, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(10.0)), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Icon( + Icons.person, + size: 25, + color: Colors.red[700], + ), + SizedBox( + width: 10, + ), + Expanded(child: Texts(widget.doctorProfile.doctorName)), + InkWell( + onTap: () { + setState(() { + _isShowInfo = !_isShowInfo; + }); + }, + child: Container( + margin: EdgeInsets.all(5), + decoration: + BoxDecoration(shape: BoxShape.circle, boxShadow: [ + BoxShadow( + color: Colors.red[700], + blurRadius: 1.0, + spreadRadius: 0.0, + ) + ]), + child: Icon( + _isShowInfo + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down , + size: 25, + color: Colors.white, + )), + ), + ], + ), + if (_isShowInfo) + AnimatedContainer( + duration: Duration(milliseconds: 7000), + margin: EdgeInsets.only(top: 20), + // height: 150, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Gender'), + Texts( + widget.doctorProfile.genderDescription, + variant: 'overline', + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Nationality'), + Texts( + widget.doctorProfile.nationalityName, + variant: 'overline', + ), + ], + ), + ], + ), + SizedBox( + height: 5, + ), + Divider( + height: 3, + color: Colors.grey, + ), + SizedBox( + height: 5, + ), + Texts('Clinic'), + Texts( + widget.doctorProfile.clinicDescription, + variant: 'overline', + ), + ], + ), + ) + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10, right: 10, left: 10), + padding: EdgeInsets.all(10.0), + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(10.0)), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Icon( + Icons.local_play, + size: 25, + color: Colors.red[700], + ), + SizedBox( + width: 10, + ), + Expanded(child: Texts(widget.doctorProfile.doctorName)), + InkWell( + onTap: () { + setState(() { + _isScientificQualification = + !_isScientificQualification; + }); + }, + child: Container( + margin: EdgeInsets.all(5), + decoration: + BoxDecoration(shape: BoxShape.circle, boxShadow: [ + BoxShadow( + color: Colors.red[700], + blurRadius: 1.0, + spreadRadius: 0.0, + ) + ]), + child: Icon( + _isScientificQualification + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + size: 25, + color: Colors.white, + )), + ), + ], + ), + if (_isScientificQualification) + AnimatedContainer( + duration: Duration(milliseconds: 7000), + margin: EdgeInsets.only(top: 20), + // height: 150, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(widget.doctorProfile.doctorProfileInfo,) + ], + ), + ) + ], + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/medical/doctor/doctor_profile_page.dart b/lib/pages/medical/doctor/doctor_profile_page.dart new file mode 100644 index 00000000..7588205c --- /dev/null +++ b/lib/pages/medical/doctor/doctor_profile_page.dart @@ -0,0 +1,183 @@ +import 'package:diplomaticquarterapp/core/model/doctor/patient_doctor_appointment.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/my_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rating_bar/rating_bar.dart'; + +import 'doctor_information_page.dart'; + +class DoctorProfilePage extends StatefulWidget { + final PatientDoctorAppointment patientDoctorAppointment; + + DoctorProfilePage({this.patientDoctorAppointment}); + + @override + _DoctorProfilePageState createState() => + _DoctorProfilePageState(patientDoctorAppointment); +} + +class _DoctorProfilePageState extends State + with TickerProviderStateMixin { + TabController _tabController; + final PatientDoctorAppointment patientDoctorAppointment; + + _DoctorProfilePageState(this.patientDoctorAppointment); + + @override + void initState() { + _tabController = new TabController(length: 2, vsync: this); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + /* onModelReady: (model) => model.getDoctorProfileAndRating( + doctorId: widget.patientDoctorAppointment.doctorID, + clinicID: widget.patientDoctorAppointment.clinicID, + projectID: widget.patientDoctorAppointment.projectID),*/ + builder: (context, model, widget) => DoctorView(doctor: model.doctorList,)/*AppScaffold( + isShowAppBar: true, + appBarTitle: 'Doctor Profile', + baseViewModel: model, + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 20.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + margin: EdgeInsets.all(5), + width: 50, + height: 50, + decoration: BoxDecoration( + shape: BoxShape.circle, color: Colors.grey), + child: Icon( + Icons.calendar_view_day, + size: 25, + color: Colors.white, + )), + ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: Image.network( + patientDoctorAppointment.doctorImageURL, + fit: BoxFit.fill, + height: 120.0, + width: 120.0), + ), + Container( + margin: EdgeInsets.all(5), + width: 50, + height: 50, + decoration: BoxDecoration( + shape: BoxShape.circle, color: Colors.grey), + child: Icon( + Icons.format_list_bulleted, + size: 25, + color: Colors.white, + )), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.center, + child: Text(patientDoctorAppointment.doctorName, + style: TextStyle( + fontSize: 20.0, + color: Colors.grey[900], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.center, + child: Text(patientDoctorAppointment.clinicName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[900], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: RatingBar.readOnly( + initialRating: + model.doctorRating.doctorRate?.toDouble() ?? 0.0, + size: 35.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: Text( + "(${model.doctorRating.patientNumber ?? 0} Reviews)", + style: TextStyle( + fontSize: 14.0, + color: Colors.blue[800], + letterSpacing: 1.0, + decoration: TextDecoration.underline, + )), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Divider( + color: Colors.grey[500], + ), + ), + TabBar( + indicatorColor: Colors.red[800], + indicatorWeight: 3.0, + tabs: [ + Tab( + child: Text('Doctor Information', + style: TextStyle(color: Colors.black))), + Tab( + child: Text(TranslationBase.of(context).availableAppo, + style: TextStyle(color: Colors.black)), + ) + ], + controller: _tabController, + ), + Container( + height: MediaQuery.of(context).size.height * 0.8, + child: TabBarView( + physics: BouncingScrollPhysics(), + children: [ + DoctorInformation( + doctorProfile: model.doctorProfile, + ), + Container(), +// DocAvailableAppointments(doctor: model.doctorList,) + ], + controller: _tabController, + ), + ), + ], + ), + ), + ], + ), + ), + )*/, + ); + } +} diff --git a/lib/pages/medical/eye/ClassesPage.dart b/lib/pages/medical/eye/ClassesPage.dart new file mode 100644 index 00000000..7904178c --- /dev/null +++ b/lib/pages/medical/eye/ClassesPage.dart @@ -0,0 +1,126 @@ +import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ClassesPage extends StatelessWidget { + final ListHISGetGlassPerscription glassPerscription; + + const ClassesPage({Key key, this.glassPerscription}) : super(key: key); + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(top: 70, left: 15, right: 15, bottom: 15), + child: Column( + children: [ + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).rightEye, + fontSize: 23, + bold: true, + ), + ), + getRow(TranslationBase.of(context).sphere, '${glassPerscription.rightEyeSpherical}', '-'), + getRow(TranslationBase.of(context).cylinder, '${glassPerscription.rightEyeCylinder}', '-'), + getRow(TranslationBase.of(context).axis, '${glassPerscription.rightEyeAxis}', '-'), + getRow(TranslationBase.of(context).prism, '${glassPerscription.rightEyePrism}', '-'), + getRow(TranslationBase.of(context).va, '${glassPerscription.rightEyeVA}', '-'), + ], + ), + ), + SizedBox( + height: 17, + ), + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).leftEye, + fontSize: 23, + bold: true, + ), + ), + getRow(TranslationBase.of(context).sphere, '${glassPerscription.leftEyeSpherical}', '-'), + getRow(TranslationBase.of(context).cylinder, '${glassPerscription.leftEyeCylinder}', '-'), + getRow(TranslationBase.of(context).axis, '${glassPerscription.leftEyeAxis}', '-'), + getRow(TranslationBase.of(context).prism, '${glassPerscription.leftEyePrism}', '-'), + getRow(TranslationBase.of(context).va, '${glassPerscription.leftEyeVA}', '-'), + ], + ), + ), + SizedBox( + height: 17, + ), + Container( + width: double.infinity, + child: SecondaryButton( + label: TranslationBase.of(context).sendEmail, + textColor: Colors.white, + color: Colors.red[700], + icon: Icon( + Icons.email, + color: Colors.white, + ), + ), + ) + ], + ), + ), + ), + ), + ); + } + + Widget getRow(String title, String val1, String val2) => Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(flex: 4, child: Texts(title)), + Expanded( + flex: 2, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Texts(val1 == 'null' ? '-' : val1), + Texts(val2 != 'null' ? '-' :val2), + ], + ), + ) + ], + ), + Divider() + ], + ), + ); +} diff --git a/lib/pages/medical/eye/ContactLensPage.dart b/lib/pages/medical/eye/ContactLensPage.dart new file mode 100644 index 00000000..373c3c79 --- /dev/null +++ b/lib/pages/medical/eye/ContactLensPage.dart @@ -0,0 +1,133 @@ +import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class ContactLensPage extends StatelessWidget { + final ListHISGetContactLensPerscription listHISGetContactLensPerscription; + + const ContactLensPage({Key key, this.listHISGetContactLensPerscription}) + : super(key: key); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(top: 70, left: 15, right: 15, bottom: 15), + child: Column( + children: [ + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).rightEye, + fontSize: 23, + bold: true, + ), + ), + getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription.brand}'), + getRow('B.C', '${listHISGetContactLensPerscription.baseCurve}'), + getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription.power}'), + getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription.diameter}'), + getRow('OZ', '${listHISGetContactLensPerscription.oZ}'), + getRow('CT', '${listHISGetContactLensPerscription.cT}'), + getRow('Blend', '${listHISGetContactLensPerscription.blend}'), + getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription.remarks}'), + + + ], + ), + ), + SizedBox( + height: 17, + ), + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).leftEye, + fontSize: 23, + bold: true, + ), + ), + getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription.brand}'), + getRow('B.C', '${listHISGetContactLensPerscription.baseCurve}'), + getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription.power}'), + getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription.diameter}'), + getRow('OZ', '${listHISGetContactLensPerscription.oZ}'), + getRow('CT', '${listHISGetContactLensPerscription.cT}'), + getRow('Blend', '${listHISGetContactLensPerscription.blend}'), + getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription.remarks}'), + ], + ), + ), + SizedBox( + height: 17, + ), + if(projectViewModel.havePrivilege(15)) + Container( + width: double.infinity, + child: SecondaryButton( + label: TranslationBase.of(context).sendEmail, + textColor: Colors.white, + color: Colors.red[700], + icon: Icon( + Icons.email, + color: Colors.white, + ), + ), + ) + ], + ), + ), + ), + ); + } + + Widget getRow(String title, String val1) => Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded(flex: 4, child: Texts(title)), + Expanded( + flex: 2, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(val1 == 'null' ? '-' : val1), + ], + ), + ) + ], + ), + Divider() + ], + ), + ); +} diff --git a/lib/pages/medical/eye/EyeHomePage.dart b/lib/pages/medical/eye/EyeHomePage.dart new file mode 100644 index 00000000..3f4df55f --- /dev/null +++ b/lib/pages/medical/eye/EyeHomePage.dart @@ -0,0 +1,127 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'ClassesPage.dart'; +import 'ContactLensPage.dart'; + +class EyeHomePage extends StatefulWidget { + final AppoimentAllHistoryResultList appointmentAllHistoryResultList; + + const EyeHomePage({Key key, this.appointmentAllHistoryResultList}) + : super(key: key); + + @override + _EyeHomePageState createState() => _EyeHomePageState(); +} + +class _EyeHomePageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).measurements, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(60.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 55.0, + margin: EdgeInsets.only(left: 20,right: 20,top: 15), + color: Colors.white, + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts(TranslationBase.of(context).classes), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts(TranslationBase.of(context).contactLens), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + ClassesPage( + glassPerscription: widget.appointmentAllHistoryResultList + .listHISGetGlassPerscription[0], + ), + ContactLensPage( + listHISGetContactLensPerscription: widget + .appointmentAllHistoryResultList + .listHISGetContactLensPerscription[0], + ) + ], + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/medical/eye/EyeMeasurementsPage.dart b/lib/pages/medical/eye/EyeMeasurementsPage.dart new file mode 100644 index 00000000..8dbe0f16 --- /dev/null +++ b/lib/pages/medical/eye/EyeMeasurementsPage.dart @@ -0,0 +1,123 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import 'EyeHomePage.dart'; + +class EyeMeasurementsPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getEyeMeasurement(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBarTitle: TranslationBase.of(context).eyeMeasurements, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(8), + child: Column( + children: [ + ...List.generate( + model.appointmentFilter.length, + (index) => AppExpandableNotifier( + title: model.appointmentFilter[index].filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model.appointmentFilter[index] + .appointmentAllHistoryResultList + .map((appointment) { + return InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: EyeHomePage( + appointmentAllHistoryResultList: appointment, + ), + ), + ); + }, + child: Container( + margin: EdgeInsets.all(8), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + color: Colors.white, + border: Border.all(color: Colors.grey), + ), + child: Row( + children: [ + Expanded( + flex: 1, + child: LargeAvatar( + name: appointment.doctorNameObj, + url: appointment.doctorImageURL, + ), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + appointment.doctorNameObj, + bold: true, + ), + Texts( + appointment.clinicName, + variant: 'caption3', + ), + Texts( + DateUtil.getMonthDayYearDateFormatted( + appointment.bookDate), + variant: 'caption3', + ), + StarRating( + totalAverage: appointment + .actualDoctorRate + .toDouble(), + forceStars: true), + ], + ), + ), + ), + Icon( + projectViewModel.isArabic + ? Icons.arrow_forward_ios + : Icons.arrow_back_ios, + color: Colors.grey, + size: 18, + ) + ], + ), + ), + ); + }).toList(), + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart new file mode 100644 index 00000000..a251a1ce --- /dev/null +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -0,0 +1,55 @@ +import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/LabResult/laboratory_result_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class LaboratoryResultPage extends StatefulWidget { + final PatientLabOrders patientLabOrders; + + LaboratoryResultPage({Key key, this.patientLabOrders}); + + @override + _LaboratoryResultPageState createState() => _LaboratoryResultPageState(); +} + +class _LaboratoryResultPageState extends State { + + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getLaboratoryResult( + invoiceNo: widget.patientLabOrders.invoiceNo, + clinicID: widget.patientLabOrders.clinicID, + projectID: widget.patientLabOrders.projectID, + orderNo: widget.patientLabOrders.orderNo), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).labResults, + baseViewModel: model, + body: Scaffold( + body: ListView.builder( + itemBuilder: (context, index) => LaboratoryResultWidget( + onTap: ()async { + GifLoaderDialogUtils.showMyDialog(context); + await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders,mes: TranslationBase.of(context).sendSuc); + GifLoaderDialogUtils.hideDialog(context); + }, + billNo: widget.patientLabOrders.invoiceNo, + details: model.patientLabSpecialResult[index].resultDataHTML, + orderNo: widget.patientLabOrders.orderNo, + patientLabOrder: widget.patientLabOrders, + ), + itemCount: model.patientLabSpecialResult.length, + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/labs/labs_home_page.dart b/lib/pages/medical/labs/labs_home_page.dart new file mode 100644 index 00000000..ce78a7dc --- /dev/null +++ b/lib/pages/medical/labs/labs_home_page.dart @@ -0,0 +1,113 @@ +import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import 'laboratory_result_page.dart'; + +class LabsHomePage extends StatelessWidget { + List imagesInfo =List(); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/ar/0.png')); + return BaseView( + onModelReady: (model) => model.getLabs(), + builder: (context, LabsViewModel model, widget) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + description: TranslationBase.of(context).infoLab, + appBarTitle: TranslationBase.of(context).labOrders, + imagesInfo: imagesInfo, + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: FractionallySizedBox( + widthFactor: 1.0, + child: Center( + child: Column( + children: [ + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () => model.setFilterType(FilterType.Clinic), + child: ListTile( + title: Text(TranslationBase.of(context).clinic), + leading: Radio( + value: FilterType.Clinic, + groupValue: model.filterType, + onChanged: (FilterType value) { + model.setFilterType(value); + }, + ), + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => model.setFilterType(FilterType.Hospital), + child: ListTile( + title: Text(TranslationBase.of(context).hospital), + leading: Radio( + value: FilterType.Hospital, + groupValue: model.filterType, + onChanged: (FilterType value) => + model.setFilterType(value), + ), + ), + ), + ) + ], + ), + ...List.generate( + model.patientLabOrdersList.length, + (index) => AppExpandableNotifier( + title: model.patientLabOrdersList[index].filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model + .patientLabOrdersList[index].patientLabOrdersList + .map((labOrder) { + return DoctorCard( + onTap: () => Navigator.push( + context, + FadePage( + page: LaboratoryResultPage( + patientLabOrders: labOrder, + ), + ), + ),isInOutPatient: labOrder.isInOutPatient, + name: labOrder.doctorName, + billNo: ' ${labOrder.invoiceNo}', + profileUrl: labOrder.doctorImageURL, + subName: labOrder.projectName, + isLiveCareAppointment: labOrder.isLiveCareAppointment, + date: projectViewModel.isArabic?DateUtil.getMonthDayYearDateFormattedAr(labOrder.orderDate):DateUtil.getMonthDayYearDateFormatted(labOrder.orderDate), + ); + }).toList(), + ), + ), + ) + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart new file mode 100644 index 00000000..ade69f45 --- /dev/null +++ b/lib/pages/medical/medical_profile_page.dart @@ -0,0 +1,206 @@ +import 'dart:math'; + +import 'package:badges/badges.dart'; +import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; +import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/reports/monthly_reports.dart'; +import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/smart_watch_instructions.dart'; +import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; +import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/time_line_widget.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/sliver_app_bar_delegate.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart'; +import 'package:provider/provider.dart'; +import '../../locator.dart'; +import '../../uitl/gif_loader_dialog_utils.dart'; +import 'active_medications/ActiveMedicationsPage.dart'; +import 'allergies_page.dart'; +import 'ask_doctor/ask_doctor_home_page.dart'; +import 'balance/my_balance_page.dart'; +import 'doctor/doctor_home_page.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; +import 'eye/EyeHomePage.dart'; +import 'eye/EyeMeasurementsPage.dart'; +import 'labs/labs_home_page.dart'; +import 'my_trackers/my_trackers.dart'; + +class MedicalProfilePage extends StatefulWidget { + @override + _MedicalProfilePageState createState() => _MedicalProfilePageState(); +} + +class _MedicalProfilePageState extends State { + var authProvider = new AuthProvider(); + List medical=List(); + ProjectViewModel projectViewModel; + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + var appoCountProvider = Provider.of(context); + + List myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel,context: context,count: appoCountProvider.count,isLogin: projectViewModel.isLogin); + return BaseView( + onModelReady: (model) => model.getAppointmentHistory(), + builder: (_, model, widget) => AppScaffold( + isShowDecPage: false, + baseViewModel: model, + body: Container( + child: SingleChildScrollView( + child: Column( + children: [ + Stack( + children: [ + Column( + children: [ + Container( + width: double.infinity, + height: 210, + child: Stack( + children: [ + Image.asset( + 'assets/images/timeline_bg.png', + fit: BoxFit.cover, + width: double.infinity, + // color: Colors.black.withOpacity(0.0) + ), + if (model.isLogin) + ListView.builder( + itemBuilder: (context, index) => + TimeLineWidget( + isUp: index % 2 == 1, + appoitmentAllHistoryResul: model + .appoitmentAllHistoryResultList[index], + ), + itemCount: model + .appoitmentAllHistoryResultList.length, + scrollDirection: Axis.horizontal, + reverse: !projectViewModel.isArabic, + ), + ], + ), + ), + SizedBox(height: 50,), + Padding( + padding: EdgeInsets.symmetric(vertical: 5.0), + child: GridView.builder( + shrinkWrap: true, + primary: false, + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, + childAspectRatio: MediaQuery.of(context).size.width / (MediaQuery.of(context).size.height / 2.40), + ), + itemCount: myMedicalList.length, + itemBuilder: (BuildContext context, int index) { + + return myMedicalList[index]; + }, + ), + ) + ], + ), + SizedBox( + height: + MediaQuery.of(context).size.height * 0.12, + ), + if (model.user != null && model.isLogin) + Positioned( + top: 185, + left: 20, + right: 20, + child: Container( + width: double.infinity, + height: 80, + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.transparent, width: 0.5), + borderRadius: + BorderRadius.all(Radius.circular(9)), + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/bg_graphic.png'), + fit: BoxFit.cover)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + SizedBox( + height: 8, + ), + Texts( + model.user.firstName + + " " + + model.user.lastName, + color: Colors.white, + bold: true, + ), + Texts( + '${model.user.patientID}', + color: Colors.white, + ), + ], + ), + ), + ), + Positioned( + top: 2, + left: projectViewModel.isArabic ? 0 : 10, + right: projectViewModel.isArabic ? 10 : 0, + child: Texts( + TranslationBase.of(context).timeLine, + color: Colors.white, + fontSize: 14, + fontWeight: FontWeight.normal, + ), + ) + ], + ), + ], + ), + ), + ), + ), + ); + } + + fullMedicalData(){ + if(projectViewModel.havePrivilege(5)) + {} + } +} + +class Medical{ + + final String title; + final String imagePath; + final String subTitle; + final Widget page; + + Medical({this.title, this.imagePath, this.subTitle, this.page}); + +} diff --git a/lib/pages/medical/my_admissions_page.dart b/lib/pages/medical/my_admissions_page.dart new file mode 100644 index 00000000..ff25884e --- /dev/null +++ b/lib/pages/medical/my_admissions_page.dart @@ -0,0 +1,61 @@ +import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; + +class MyAdmissionsPage extends StatefulWidget { + @override + _MyAdmissionsPageState createState() => _MyAdmissionsPageState(); +} + +class _MyAdmissionsPageState extends State { + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + AppExpandableNotifier( + title: 'Arryan Hospital', + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + DoctorCard( + name: 'Dr Mohammad Aljammal', + date: 'Feb 14, 2020', + profileUrl: + 'https://scontent.famm4-1.fna.fbcdn.net/v/t31.0-8/30425660_1862582094040824_7851633779570222226_o.jpg?_nc_cat=101&_nc_sid=09cbfe&_nc_eui2=AeF3TI6D2_tFS5QoQsqyaCKd2zBfzh74hOzbMF_OHviE7PQdLHRwmBoIOiKyWmK9MskOshPjkU73a5EdQMA3dqnV&_nc_ohc=1feou2fDCuIAX_Ra9qB&_nc_ht=scontent.famm4-1.fna&oh=709d34d1c284de1d0aa08ed37b0ac09a&oe=5F3C5ACB', + rat: 3.8, + subName: 'Jammal', + ), + DoctorCard( + name: 'Dr Mohammad Aljammal', + date: 'Feb 14, 2020', + profileUrl: + 'https://scontent.famm4-1.fna.fbcdn.net/v/t31.0-8/30425660_1862582094040824_7851633779570222226_o.jpg?_nc_cat=101&_nc_sid=09cbfe&_nc_eui2=AeF3TI6D2_tFS5QoQsqyaCKd2zBfzh74hOzbMF_OHviE7PQdLHRwmBoIOiKyWmK9MskOshPjkU73a5EdQMA3dqnV&_nc_ohc=1feou2fDCuIAX_Ra9qB&_nc_ht=scontent.famm4-1.fna&oh=709d34d1c284de1d0aa08ed37b0ac09a&oe=5F3C5ACB', + rat: 3.8, + subName: 'Jammal', + ), + ], + ), + ), + + AppExpandableNotifier( + title: 'Arryan Hospital', + bodyWidget: DoctorCard( + onTap: () { + //TODO when we need it + }, + name: 'Dr Mohammad Aljammal', + date: 'Feb 14, 2020', + profileUrl: + 'https://scontent.famm4-1.fna.fbcdn.net/v/t31.0-8/30425660_1862582094040824_7851633779570222226_o.jpg?_nc_cat=101&_nc_sid=09cbfe&_nc_eui2=AeF3TI6D2_tFS5QoQsqyaCKd2zBfzh74hOzbMF_OHviE7PQdLHRwmBoIOiKyWmK9MskOshPjkU73a5EdQMA3dqnV&_nc_ohc=1feou2fDCuIAX_Ra9qB&_nc_ht=scontent.famm4-1.fna&oh=709d34d1c284de1d0aa08ed37b0ac09a&oe=5F3C5ACB', + rat: 4.8, + subName: 'Jammal', + ), + ), + + ], + ), + ); + } +} diff --git a/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart b/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart new file mode 100644 index 00000000..a7b23191 --- /dev/null +++ b/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart @@ -0,0 +1,204 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:feather_icons_flutter/feather_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:provider/provider.dart'; + +class AddWeightPage extends StatefulWidget { + @override + _AddWeightPageState createState() => _AddWeightPageState(); +} + +class _AddWeightPageState extends State { + TextEditingController _weightValueController = TextEditingController(); + DateTime bloodSugarDate = DateTime.now(); + DateTime timeSugarDate = DateTime.now(); + int weightUnit = 1; + final List measureUnitEnList = [ + 'Kg', + 'Pound', + ]; + final List measureUnitArList = [ + 'Kg', + 'Pound', + ]; + String measureTimeSelectedType = 'Kg'; + + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Add', + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.all(15), + child: Column( + children: [ + SizedBox( + height: 15, + ), + NewTextFields( + hintText: 'Enter Weight Value', + controller: _weightValueController, + keyboardType: TextInputType.number, + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + confirmSelectMeasureTimeDialog(projectViewModel.isArabic + ? measureUnitEnList + : measureUnitArList); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(measureTimeSelectedType), + Icon( + Icons.arrow_drop_down, + color: Colors.grey, + ) + ], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showDatePicker(context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now(), onConfirm: (date) { + print('confirm $date'); + setState(() { + bloodSugarDate = date; + }); + }, + currentTime: bloodSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('Date'), + Texts(getDate()), + ], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showTimePicker(context, showTitleActions: true, + onConfirm: (date) { + print('confirm $date'); + setState(() { + timeSugarDate = date; + }); + }, + currentTime: timeSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Texts('Time'), Texts(getTime())], + ), + ), + ), + ], + ), + ), + ), + bottomSheet: Container( + color: Colors.transparent, + width: double.infinity, + height: MediaQuery.of(context).size.width * 0.2, + child: Padding( + padding: const EdgeInsets.all(15.0), + child: SecondaryButton( + loading: model.state == ViewState.BusyLocal, + label: 'SAVE', + textColor: Colors.white, + onTap: () { + if (_weightValueController.text.isNotEmpty ) { + model.addWeightResult( + weightDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + weightMeasured: _weightValueController.text.toString(), + weightUnit: weightUnit, + ); + } + }), + ), + ), + ), + ); + } + + String getDate() { + return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}"; + } + + String getTime() { + return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; + } + + void confirmSelectMeasureTimeDialog(List list) { + showDialog( + context: context, + child: RadioStringDialog( + radioList: list, + title: 'Measure unit', + selectedValue: measureTimeSelectedType, + onValueSelected: (value) { + setState(() { + measureTimeSelectedType = value; + weightUnit = list.indexOf(value); + }); + }, + ), + ); + } +} diff --git a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart new file mode 100644 index 00000000..8e6f808c --- /dev/null +++ b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart @@ -0,0 +1,151 @@ +import 'dart:ui'; +import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'AddWeightPage.dart'; +import 'WeightMonthlyPage.dart'; +import 'WeightYeaPage.dart'; +import 'WeightWeeklyPage.dart'; + +class WeightHomePage extends StatefulWidget { + @override + _WeightHomePageState createState() => _WeightHomePageState(); +} + +class _WeightHomePageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 3, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getWeight(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Weight', + baseViewModel: model, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(60.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 55.0, + color: Colors.white, + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + indicatorColor: Colors.red[800], + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Weekly'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Monthly'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Yearly'), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + WeightWeeklyPage( + data: model.getWeightWeeklySeries(), + diabtecPatientResult: model.weekWeightMeasurementResult, + ), + WeightMonthlyPage( + data: model.getWeightMonthlyTimeSeriesSales(), + diabtecPatientResult: model.monthWeightMeasurementResult, + ), + WeightYearPage( + data: model.getWeightYearTimeSeriesSales(), + diabtecPatientResult: model.yearWeightMeasurementResult, + ) + ], + ), + ) + ], + ), + floatingActionButton: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: AddWeightPage())); + }, + child: Container( + width: 55, + height: 55, + decoration: BoxDecoration( + shape: BoxShape.circle, color: HexColor('515B5D')), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, + ), + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart new file mode 100644 index 00000000..9f7063f1 --- /dev/null +++ b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart @@ -0,0 +1,162 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class WeightMonthlyPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const WeightMonthlyPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.LineChart(data, + //animate: animate, + defaultRenderer: + new charts.LineRendererConfig(includePoints: true)), + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + ), + child: Center( + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + ), + child: Center( + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ], + ), + ); + diabtecPatientResult.forEach( + (diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.weightMeasured}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart new file mode 100644 index 00000000..9c3363dd --- /dev/null +++ b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart @@ -0,0 +1,184 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class WeightWeeklyPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const WeightWeeklyPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.TimeSeriesChart( + data, + dateTimeFactory: const charts.LocalDateTimeFactory(), + ), + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + ), + child: Center( + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + ), + child: Center( + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Edit', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach( + (diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.weightMeasured}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Icon(Icons.edit), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart new file mode 100644 index 00000000..587cc3f6 --- /dev/null +++ b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart @@ -0,0 +1,161 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class WeightYearPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const WeightYearPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.TimeSeriesChart( + data, + dateTimeFactory: const charts.LocalDateTimeFactory(), + ), + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + ), + child: Center( + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + ), + child: Center( + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ], + ), + ); + diabtecPatientResult.forEach( + (diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.weightMeasured}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart new file mode 100644 index 00000000..b8d9a557 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart @@ -0,0 +1,215 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:feather_icons_flutter/feather_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:provider/provider.dart'; + +class AddBloodPressurePage extends StatefulWidget { + @override + _AddBloodPressurePageState createState() => _AddBloodPressurePageState(); +} + +class _AddBloodPressurePageState extends State { + TextEditingController _bloodSystolicValueController = TextEditingController(); + TextEditingController _bloodDiastolicValueController = + TextEditingController(); + DateTime bloodSugarDate = DateTime.now(); + DateTime timeSugarDate = DateTime.now(); + int measuredArm = 1; + final List measureTimeEnList = [ + 'Left Arm', + 'Right Arm', + ]; + final List measureTimeArList = [ + 'الذراع الأيسر', + 'الذراع الأيمن', + ]; + String measureTimeSelectedType = 'Left Arm'; + + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Add', + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.all(15), + child: Column( + children: [ + SizedBox( + height: 15, + ), + NewTextFields( + hintText: 'Enter Systolic Value', + controller: _bloodSystolicValueController, + keyboardType: TextInputType.number, + ), + SizedBox( + height: 8, + ), + NewTextFields( + hintText: 'Blood Diastolic Value', + controller: _bloodDiastolicValueController, + keyboardType: TextInputType.number, + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + confirmSelectMeasureTimeDialog(projectViewModel.isArabic + ? measureTimeEnList + : measureTimeArList); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(measureTimeSelectedType), + Icon( + Icons.arrow_drop_down, + color: Colors.grey, + ) + ], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showDatePicker(context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now(), onConfirm: (date) { + print('confirm $date'); + setState(() { + bloodSugarDate = date; + }); + }, + currentTime: bloodSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('Date'), + Texts(getDate()), + ], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showTimePicker(context, showTitleActions: true, + onConfirm: (date) { + print('confirm $date'); + setState(() { + timeSugarDate = date; + }); + }, + currentTime: timeSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Texts('Time'), Texts(getTime())], + ), + ), + ), + ], + ), + ), + ), + bottomSheet: Container( + color: Colors.transparent, + width: double.infinity, + height: MediaQuery.of(context).size.width * 0.2, + child: Padding( + padding: const EdgeInsets.all(15.0), + child: SecondaryButton( + loading: model.state == ViewState.BusyLocal, + label: 'SAVE', + textColor: Colors.white, + onTap: () { + if (_bloodSystolicValueController.text.isNotEmpty && + _bloodDiastolicValueController.text.isNotEmpty) { + model.addDiabtecResult( + bloodPressureDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + diastolicPressure: _bloodDiastolicValueController.text.toString(), + systolicePressure: _bloodSystolicValueController.text.toString(), + measuredArm: measuredArm, + ); + } + }), + ), + ), + ), + ); + } + + String getDate() { + return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}"; + } + + String getTime() { + return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; + } + + void confirmSelectMeasureTimeDialog(List list) { + showDialog( + context: context, + child: RadioStringDialog( + radioList: list, + title: 'Select the Arm', + selectedValue: measureTimeSelectedType, + onValueSelected: (value) { + setState(() { + measureTimeSelectedType = value; + measuredArm = list.indexOf(value); + }); + }, + ), + ); + } +} diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart new file mode 100644 index 00000000..e6bb3ed4 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart @@ -0,0 +1,153 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import 'AddBloodPressurePage.dart'; +import 'BloodPressureMonthly.dart'; +import 'BloodPressureYeaPage.dart'; +import 'bloodPressureWeeklyPage.dart'; + +class BloodPressureHomePage extends StatefulWidget { + @override + _BloodPressureHomePageState createState() => _BloodPressureHomePageState(); +} + +class _BloodPressureHomePageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 3, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getBloodPressure(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Blood Pressure', + baseViewModel: model, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(60.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 55.0, + color: Colors.white, + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Weekly'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Monthly'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Yearly'), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + BloodPressureWeeklyPage( + data: model.getBloodWeeklySeries(), + diabtecPatientResult: model.weekDiabtecPatientResult, + ), + BloodPressureMonthlyPage( + data: model.getBloodMonthlyTimeSeriesSales(), + diabtecPatientResult: model.monthDiabtecPatientResult, + ), + BloodPressureYearPage( + data: model.getBloodYearTimeSeriesSales(), + diabtecPatientResult: model.yearDiabtecPatientResult, + ) + ], + ), + ) + ], + ), + floatingActionButton: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: AddBloodPressurePage())); + }, + child: Container( + width: 55, + height: 55, + decoration: BoxDecoration( + shape: BoxShape.circle, color: HexColor('515B5D')), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, + ), + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart new file mode 100644 index 00000000..8b9e504f --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart @@ -0,0 +1,202 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class BloodPressureMonthlyPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const BloodPressureMonthlyPage( + {Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.LineChart(data, + //animate: animate, + defaultRenderer: + new charts.LineRendererConfig(includePoints: true)), + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + ), + child: Center( + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + ), + child: Center( + child: Texts( + 'Measured', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach( + (diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.measuredArmDesc}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.systolicePressure}/${diabtec.diastolicPressure}', + textAlign: TextAlign.center, + fontSize: 12, + color: Colors.red, + ), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart new file mode 100644 index 00000000..0c67be7c --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart @@ -0,0 +1,198 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class BloodPressureYearPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const BloodPressureYearPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.TimeSeriesChart( + data, + dateTimeFactory: const charts.LocalDateTimeFactory(), + ), + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + ), + child: Center( + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + ), + child: Center( + child: Texts( + 'Measured', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach( + (diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.measuredArmDesc}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.systolicePressure}/${diabtec.diastolicPressure}', + textAlign: TextAlign.center, + fontSize: 12, + color: Colors.red, + ), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart new file mode 100644 index 00000000..52313483 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart @@ -0,0 +1,222 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class BloodPressureWeeklyPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const BloodPressureWeeklyPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.TimeSeriesChart( + data, + dateTimeFactory: const charts.LocalDateTimeFactory(), + ), + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + ), + child: Center( + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + ), + child: Center( + child: Texts( + 'Measured', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + ), + child: Center( + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Edit', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach( + (diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.measuredArmDesc}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.systolicePressure}/${diabtec.diastolicPressure}', + textAlign: TextAlign.center, + fontSize: 12, + color: Colors.red, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Icon(Icons.edit), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart new file mode 100644 index 00000000..00f06a25 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart @@ -0,0 +1,344 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:feather_icons_flutter/feather_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:provider/provider.dart'; + +class AddBloodSugarPage extends StatefulWidget { + @override + _AddBloodSugarPageState createState() => _AddBloodSugarPageState(); +} + +class _AddBloodSugarPageState extends State { + TextEditingController _bloodSugarValueController = TextEditingController(); + DateTime bloodSugarDate = DateTime.now(); + DateTime timeSugarDate = DateTime.now(); + String measureUnitSelectedType = 'mg/dlt'; + int measuredTime=1; + final List measureUnitList = ['mg/dlt', 'mol/L']; + final List measureTimeEnList = [ + 'Before Breakfast', + 'After Breakfast', + 'Before Lunch', + 'After Lunch', + 'Before Dinner', + 'After Dinner', + 'Before Sleep', + 'After Sleep', + 'Fasting', + 'Other', + ]; + final List measureTimeArList = [ + 'Before Breakfast', + 'After Breakfast', + 'Before Lunch', + 'After Lunch', + 'Before Dinner', + 'After Dinner', + 'Before Sleep', + 'After Sleep', + 'Fasting', + 'Other', + ]; + String measureTimeSelectedType; + + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + showTaskOptions() { + showModalBottomSheet( + backgroundColor: Colors.white, + context: context, + builder: (BuildContext bc) { + return Container( + padding: EdgeInsets.symmetric(vertical: 12.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(16.0), + topRight: Radius.circular(16.0))), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + decoration: BoxDecoration( + color: Colors.grey[200], + borderRadius: BorderRadius.circular(3.0)), + width: 40.0, + height: 6.0, + ), + InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 18.0, vertical: 18.0), + child: Row( + children: [ + Icon( + FeatherIcons.share, + color: Theme + .of(context) + .primaryColor, + size: 18.0, + ), + SizedBox(width: 24.0), + Texts('Share Task', + variant: "body2Link", color: Colors.grey[800]), + ], + ), + ), + ), + InkWell( + onTap: () { + Navigator.pop(context); + // Navigator.of(context).push(SlideUpPageRoute(widget: PostTaskIndex(task: new Task(category: task?.category, description: task?.description, title: task?.title)))); + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 18.0, vertical: 18.0), + child: Row( + children: [ + Icon( + FeatherIcons.copy, + color: Theme + .of(context) + .primaryColor, + size: 18.0, + ), + SizedBox(width: 24.0), + Texts('Post Similar Task', + variant: "body2Link", color: Colors.grey[800]), + ], + ), + ), + ), + ], + ), + ); + }); + } + + return BaseView( + builder: (_, model, w) => + AppScaffold( + isShowAppBar: true, + appBarTitle: 'Add', + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.all(15), + child: Column( + children: [ + SizedBox( + height: 15, + ), + NewTextFields( + hintText: 'Enter Blood Sugar Value', + controller: _bloodSugarValueController, + keyboardType: TextInputType.number, + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + confirmSelectMeasureUnitDialog(); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(measureUnitSelectedType), + Icon( + Icons.arrow_drop_down, + color: Colors.grey, + ) + ], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showDatePicker(context, + showTitleActions: true, + minTime: DateTime(DateTime + .now() + .year - 1, 1, 1), + maxTime: DateTime.now(), + onConfirm: (date) { + print('confirm $date'); + setState(() { + bloodSugarDate = date; + }); + }, + currentTime: bloodSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('Date'), + Texts(getDate()), + ], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showTimePicker( + context, showTitleActions: true, + onConfirm: (date) { + print('confirm $date'); + setState(() { + timeSugarDate = date; + }); + }, + currentTime: timeSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Texts('Time'), Texts(getTime())], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + confirmSelectMeasureTimeDialog(projectViewModel.isArabic + ? measureTimeEnList + : measureTimeArList); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(measureTimeSelectedType ?? 'Others'), + Icon( + Icons.arrow_drop_down, + color: Colors.grey, + ) + ], + ), + ), + ), + ], + ), + ), + ), + bottomSheet: Container( + color: Colors.transparent, + width: double.infinity, + height: MediaQuery + .of(context) + .size + .width * 0.2, + child: Padding( + padding: const EdgeInsets.all(15.0), + child: SecondaryButton( + loading: model.state == ViewState.BusyLocal, + label: 'SAVE', textColor: Colors.white, onTap: () { + if (_bloodSugarValueController.text.isNotEmpty) { + model.addDiabtecResult(diabtecUnit: measureUnitSelectedType, + measuredTime: measuredTime, + bloodSugerResult:_bloodSugarValueController.text.toString(), + bloodSugerDateChart: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + + ); + } + }), + ), + ), + ), + ); + } + + String getDate() { + return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate + .day}, ${bloodSugarDate.year}"; + } + + String getTime() { + return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; + } + + void confirmSelectMeasureUnitDialog() { + showDialog( + context: context, + child: RadioStringDialog( + radioList: measureUnitList, + title: 'Measure unit', + selectedValue: measureUnitSelectedType, + onValueSelected: (value) { + setState(() { + measureUnitSelectedType = value; + }); + }, + ), + ); + } + + void confirmSelectMeasureTimeDialog(List list) { + showDialog( + context: context, + child: RadioStringDialog( + radioList: list, + title: 'Measure time', + selectedValue: measureTimeSelectedType, + onValueSelected: (value) { + setState(() { + measureTimeSelectedType = value; + measuredTime = list.indexOf(value); + }); + }, + ), + ); + } +} diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart b/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart new file mode 100644 index 00000000..fdd7b348 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart @@ -0,0 +1,198 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class BloodMonthlyPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const BloodMonthlyPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.LineChart(data, + //animate: animate, + defaultRenderer: + new charts.LineRendererConfig(includePoints: true)), + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + ), + child: Center( + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + ), + child: Center( + child: Texts( + 'Measured', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach( + (diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.dateChart.hour}:${diabtec.dateChart.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.measuredDesc}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.resultValue}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart new file mode 100644 index 00000000..47f87847 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart @@ -0,0 +1,198 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class BloodYearPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const BloodYearPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.TimeSeriesChart( + data, + dateTimeFactory: const charts.LocalDateTimeFactory(), + ), + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + ), + child: Center( + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + ), + child: Center( + child: Texts( + 'Measured', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach( + (diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.dateChart.hour}:${diabtec.dateChart.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.measuredDesc}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.resultValue}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart new file mode 100644 index 00000000..9259e286 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart @@ -0,0 +1,154 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +import 'AddBloodSugarPage.dart'; +import 'BloodMonthly.dart'; +import 'BloodYeaPage.dart'; +import 'blood_sugar_weekly_page.dart'; + +class BloodSugarHomePage extends StatefulWidget { + @override + _BloodSugarHomePageState createState() => _BloodSugarHomePageState(); +} + +class _BloodSugarHomePageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 3, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getBloodSugar(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Blood Sugar', + baseViewModel: model, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(60.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 55.0, + color: Colors.white, + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Weekly'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Monthly'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Yearly'), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + BloodSugarWeeklyPage( + data: model.getBloodWeeklySeries(), + diabtecPatientResult: model.weekDiabtecPatientResult, + ), + BloodMonthlyPage( + data: model.getBloodMonthlyTimeSeriesSales(), + diabtecPatientResult: model.monthDiabtecPatientResult, + ), + BloodYearPage( + data: model.getBloodYearTimeSeriesSales(), + diabtecPatientResult: model.yearDiabtecPatientResult, + ) + ], + ), + ) + ], + ), + floatingActionButton: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: AddBloodSugarPage())); + }, + child: Container( + width: 55, + height: 55, + decoration: BoxDecoration( + shape: BoxShape.circle, color: HexColor('515B5D')), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, + ), + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart new file mode 100644 index 00000000..4b007929 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart @@ -0,0 +1,222 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class BloodSugarWeeklyPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const BloodSugarWeeklyPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.TimeSeriesChart( + data, + dateTimeFactory: const charts.LocalDateTimeFactory(), + ), + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + ), + child: Center( + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + ), + child: Center( + child: Texts( + 'Measured', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + ), + child: Center( + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Edit', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach( + (diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.dateChart.hour}:${diabtec.dateChart.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.measuredDesc}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.resultValue}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Icon(Icons.edit), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/my_trackers.dart b/lib/pages/medical/my_trackers/my_trackers.dart new file mode 100644 index 00000000..ecdf5a53 --- /dev/null +++ b/lib/pages/medical/my_trackers/my_trackers.dart @@ -0,0 +1,114 @@ +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'Weight/WeightHomePage.dart'; +import 'blood_pressure/BloodPressureHomePage.dart'; +import 'blood_suger/blood_sugar_home_page.dart'; + +class MyTrackers extends StatelessWidget { + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: 'My Tracker', + isShowAppBar: true, + body: SingleChildScrollView( + child: Container( + padding: EdgeInsets.all(12), + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: InkWell( + onTap: ()=> Navigator.push(context, FadePage(page: BloodSugarHomePage())), + child: Container( + margin: EdgeInsets.all(5), + width: MediaQuery.of(context).size.width*0.35, + height:MediaQuery.of(context).size.width*0.35 , + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + color: Colors.white + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset('assets/tracker/blood-suger.png',width: 60.0,), + SizedBox(height: 15,), + Text('Blood Sugar'), + ], + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: ()=> Navigator.push(context, FadePage(page: BloodPressureHomePage())), + child: Container( + margin: EdgeInsets.all(5), + width: MediaQuery.of(context).size.width*0.35, + height:MediaQuery.of(context).size.width*0.35 , + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + color: Colors.white + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset('assets/tracker/blood-pressure.png',width: 60.0,), + SizedBox(height: 15,), + Text('Blood Pressure'), + ], + ), + ), + ), + ), + ], + ), + Row( + //mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: InkWell( + onTap: ()=> Navigator.push(context, FadePage(page: WeightHomePage())), + child: Container( + margin: EdgeInsets.all(5), + width: MediaQuery.of(context).size.width*0.35, + height:MediaQuery.of(context).size.width*0.35 , + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + color: Colors.white + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset('assets/tracker/weight.png',width: 60.0,), + SizedBox(height: 15,), + Text('Weight'), + ], + ), + ), + ), + ), + Expanded( + child: Container(), + ), + ], + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart new file mode 100644 index 00000000..196b5d79 --- /dev/null +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -0,0 +1,82 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/model/sick_leave/sick_leave.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/patient_sick_leave_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class PatientSickLeavePage extends StatefulWidget { + @override + _PatientSickLeavePageState createState() => _PatientSickLeavePageState(); +} + +class _PatientSickLeavePageState extends State { + List imagesInfo = List(); + + @override + void initState() { + imagesInfo.add(ImagesInfo( + imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/en/0.png', + imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/ar/0.png')); + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getSickLeave(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).sickLeaves, + description: TranslationBase.of(context).infoSickLeaves, + infoList: TranslationBase.of(context).infoSickLeavePoints, + imagesInfo: imagesInfo, + baseViewModel: model, + body: Container( + margin: EdgeInsets.all(12), + child: ListView.builder( + itemCount: model.sickLeaveList.length, + itemBuilder: (context, index) => DoctorCard( + isLiveCareAppointment: model.sickLeaveList[index].isLiveCareAppointment, + name: model.sickLeaveList[index].doctorName, + date:projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(model.sickLeaveList[index].requestDate):DateUtil.getMonthDayYearDateFormatted(model.sickLeaveList[index].requestDate), + profileUrl: model.sickLeaveList[index].doctorImageURL, + rat: model.sickLeaveList[index].actualDoctorRate.toDouble(), + subName: model.sickLeaveList[index].projectName, + isInOutPatient: model.sickLeaveList[index].isInOutPatient, + onEmailTap: () { + showConfirmMessage(model, index); + }, + ), + ), + ), + ), + ); + } + + void showConfirmMessage(PatientSickLeaveViewMode model, int index) { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: model.user.emailAddress, + onTapSendEmail: () { + model.sendSickLeaveEmail( + message: TranslationBase.of(context).emailSentSuccessfully, + requestNo: model.sickLeaveList[index].requestNo, + doctorName: model.sickLeaveList[index].doctorName, + projectName: model.sickLeaveList[index].projectName, + setupID: model.sickLeaveList[index].setupID, + projectID: model.sickLeaveList[index].projectID); + }, + ), + ); + } +} diff --git a/lib/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart b/lib/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart new file mode 100644 index 00000000..1b1eaf3f --- /dev/null +++ b/lib/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart @@ -0,0 +1,101 @@ +import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:maps_launcher/maps_launcher.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class PharmacyForPrescriptionsPage extends StatelessWidget { + final PrescriptionReport prescriptionReport; + + PharmacyForPrescriptionsPage({Key key, this.prescriptionReport}); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getListPharmacyForPrescriptions(itemId: prescriptionReport.itemID), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).ports, + baseViewModel: model, + body: ListView.builder( + itemBuilder: (context, index) => Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all(color: Colors.grey[200], width: 0.5), + ), + child: Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5)), + child: Image.network( + model.pharmacyPrescriptionsList[index].projectImageURL, + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(model.pharmacyPrescriptionsList[index] + .locationDescription), + SizedBox( + height: 5, + ), + Texts(model.pharmacyPrescriptionsList[index].cityName), + ], + ), + ), + ), + InkWell( + onTap: () { + MapsLauncher.launchCoordinates( + double.parse( + model.pharmacyPrescriptionsList[index].latitude), + double.parse( + model.pharmacyPrescriptionsList[index].longitude)); + }, + child: Icon( + Icons.pin_drop, + size: 18, + color: Colors.red[900], + ), + ), + SizedBox( + width: 15, + ), + InkWell( + onTap: Feedback.wrapForTap((){ + launch("tel://${model.pharmacyPrescriptionsList[index].phoneNumber}"); + },context), + child: Container( + child: Icon( + Icons.call, + size: 18, + color: Colors.red[900], + ), + ), + ) + ], + ), + ), + itemCount: model.pharmacyPrescriptionsList.length, + ), + ), + ); + } +} diff --git a/lib/pages/medical/prescriptions/prescription_details_page.dart b/lib/pages/medical/prescriptions/prescription_details_page.dart new file mode 100644 index 00000000..d59bc06d --- /dev/null +++ b/lib/pages/medical/prescriptions/prescription_details_page.dart @@ -0,0 +1,195 @@ +import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class PrescriptionDetailsPage extends StatelessWidget { + final PrescriptionReport prescriptionReport; + + PrescriptionDetailsPage({Key key, this.prescriptionReport}); + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).prescriptions, + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all(color: Colors.grey[200], width: 0.5), + ), + child: Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5)), + child: Image.network( + prescriptionReport.imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + prescriptionReport.itemDescription.isNotEmpty + ? prescriptionReport.itemDescription + : prescriptionReport.itemDescriptionN), + ), + ), + ) + ], + ), + ), + Container( + margin: EdgeInsets.all(8), + child: InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: PharmacyForPrescriptionsPage( + prescriptionReport: prescriptionReport), + ), + ), + child: Center( + child: Column( + children: [ + Container( + width: 50, + decoration: BoxDecoration( + color: Colors.white, shape: BoxShape.rectangle), + child: Column( + children: [ + Icon( + Icons.pin_drop, + color: Colors.red[800], + size: 55, + ), + ], + ), + ), + SizedBox( + height: 5, + ), + Texts(TranslationBase.of(context).ports) + ], + ), + )), + ), + Container( + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + child: Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 0.5), + outside: BorderSide(width: 0.5)), + children: [ + TableRow( + children: [ + Container( + color: Colors.white, + height: 30, + width: double.infinity, + child: Center( + child: Texts(TranslationBase.of(context).way))), + Container( + color: Colors.white, + height: 30, + width: double.infinity, + child: Center( + child: + Texts(TranslationBase.of(context).average))), + Container( + color: Colors.white, + height: 30, + width: double.infinity, + child: Center( + child: Texts( + TranslationBase.of(context).dailyDoses))), + Container( + color: Colors.white, + height: 30, + width: double.infinity, + child: Center( + child: + Texts(TranslationBase.of(context).period))), + ], + ), + TableRow( + children: [ + Container( + color: Colors.white, + height: 50, + width: double.infinity, + child: + Center(child: Text(prescriptionReport.routeN))), + Container( + color: Colors.white, + height: 50, + width: double.infinity, + child: Center( + child: + Text(prescriptionReport.frequencyN ?? ''))), + Container( + color: Colors.white, + height: 50, + width: double.infinity, + child: Center( + child: Text( + '${prescriptionReport.doseDailyQuantity}'))), + Container( + color: Colors.white, + height: 50, + width: double.infinity, + child: + Center(child: Text('${prescriptionReport.days}'))) + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + width: double.infinity, + color: Colors.white, + padding: EdgeInsets.all(5), + child: Center( + child: Column( + children: [ + Texts(TranslationBase.of(context).notes), + SizedBox( + height: 5, + ), + Divider( + height: 0.5, + color: Colors.grey[300], + ), + SizedBox( + height: 5, + ), + Texts(prescriptionReport.remarks ?? ''), + ], + ), + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart new file mode 100644 index 00000000..6fb07f68 --- /dev/null +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -0,0 +1,231 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart'; +import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import '../../../widgets/dialogs/confirm_send_email_dialog.dart'; + +class PrescriptionItemsPage extends StatelessWidget { + final Prescriptions prescriptions; + + PrescriptionItemsPage({Key key, this.prescriptions}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => + model.getPrescriptionReport(prescriptions: prescriptions), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).prescriptions, + baseViewModel: model, + body: Container( + height: MediaQuery.of(context).size.height * 0.8, + child: Column( + children: [ + if (!prescriptions.isInOutPatient) + ...List.generate( + model.prescriptionReportList.length, + (index) => InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionDetailsPage( + prescriptionReport: + model.prescriptionReportList[index], + ), + ), + ), + child: Container( + width: double.infinity, + margin: + EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], width: 0.5), + ), + child: Row( + children: [ + ClipRRect( + borderRadius: + BorderRadius.all(Radius.circular(5)), + child: Image.network( + model.prescriptionReportList[index] + .imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts(model + .prescriptionReportList[index] + .itemDescription + .isNotEmpty + ? model.prescriptionReportList[index] + .itemDescription + : model.prescriptionReportList[index] + .itemDescriptionN)), + )), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) + ], + ), + ), + )) + else + ...List.generate( + model.prescriptionReportEnhList.length, + (index) => InkWell( + onTap: () { + PrescriptionReport prescriptionReport = + PrescriptionReport( + imageSRCUrl: model + .prescriptionReportEnhList[index].imageSRCUrl, + itemDescription: model + .prescriptionReportEnhList[index] + .itemDescription, + itemDescriptionN: model + .prescriptionReportEnhList[index] + .itemDescription, + routeN: + model.prescriptionReportEnhList[index].route, + frequency: model + .prescriptionReportEnhList[index].frequency, + frequencyN: model + .prescriptionReportEnhList[index].frequency, + doseDailyQuantity: model + .prescriptionReportEnhList[index] + .doseDailyQuantity, + days: model.prescriptionReportEnhList[index].days, + itemID: + model.prescriptionReportEnhList[index].itemID, + remarks: model + .prescriptionReportEnhList[index].remarks); + Navigator.push( + context, + FadePage( + page: PrescriptionDetailsPage( + prescriptionReport: prescriptionReport, + ), + ), + ); + }, + child: Container( + margin: EdgeInsets.all(8.0), + color: Colors.white, + child: Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5)), + child: Image.network( + model + .prescriptionReportEnhList[index].imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(model.prescriptionReportEnhList[index] + .itemDescription), + ], + ), + ), + ), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) + ], + ), + ), + ), + ) + ], + ), + ), + bottomSheet: Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.14, + color: Colors.grey[100], + child: Column( + children: [ + Divider(), + if(projectViewModel.havePrivilege(13)) + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + label: TranslationBase.of(context).sendCopy, + onTap: () { + showConfirmMessage(context,model); + }, + loading: model.state == ViewState.BusyLocal, + ), + ), + if (false) + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + label: TranslationBase.of(context).resendOrder, + backgroundColor: Colors.green[200], + )) + ], + ), + ), + ), + ); + } + + void showConfirmMessage(BuildContext context, PrescriptionsViewModel model) { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: model.user.emailAddress, + onTapSendEmail: () { + model.sendPrescriptionEmail( + appointmentDate: prescriptions.appointmentDate, + patientID: prescriptions.patientID, + clinicName: prescriptions.companyName, + doctorName: prescriptions.doctorName, + mes: TranslationBase.of(context).sendSuc, + projectID: prescriptions.projectID); + }, + ), + ); + } +} diff --git a/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart b/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart new file mode 100644 index 00000000..30bfa13e --- /dev/null +++ b/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart @@ -0,0 +1,160 @@ +import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/BottomButton.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class PrescriptionsHistoryDetailsPage extends StatelessWidget { + final PrescriptionsOrder prescriptionsOrder; + + PrescriptionsHistoryDetailsPage({Key key, this.prescriptionsOrder}); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getPrescriptionReportEnh( + prescriptionsOrder: prescriptionsOrder), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).orderDetails, + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(15.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 5, + ), + Container( + width: double.infinity, + decoration: BoxDecoration( + color: prescriptionsOrder.status == 3 ?Colors.green : prescriptionsOrder.status ==2 ? Colors.grey: Colors.red, + borderRadius: BorderRadius.circular(5)), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts(TranslationBase.of(context).orderStatus +' : ${prescriptionsOrder.descriptionN}',color: Colors.white,), + )), + SizedBox( + height: 15, + ), + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 0.5), + outside: BorderSide(width: 0.5)), + children: [ + TableRow(children: [ + Container( + height: 50, + color: Colors.white, + child: Center( + child: Texts(TranslationBase.of(context).orderNo), + ), + ), + Container( + height: 50, + color: Colors.white, + child: Center( + child: Texts(TranslationBase.of(context).date), + ), + ), + ]), + TableRow(children: [ + Container( + height: 70, + color: Colors.white, + child: Center( + child: Texts('${prescriptionsOrder.iD}'), + ), + ), + Container( + height: 70, + color: Colors.white, + child: Center( + child: Texts('${prescriptionsOrder.createdOn.year}-${prescriptionsOrder.createdOn.day}-${prescriptionsOrder.createdOn.day} ${prescriptionsOrder.createdOn.hour}:${prescriptionsOrder.createdOn.minute}'), + ), + ), + ]) + ], + ), + SizedBox( + height: 15, + ), + ...List.generate( + model.prescriptionReportEnhList.length, + (index) => Container( + margin: EdgeInsets.all(8.0), + color: Colors.white, + child: Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5)), + child: Image.network( + model.prescriptionReportEnhList[index].imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(model.prescriptionReportEnhList[index] + .itemDescription), + ], + ), + ), + ), + ], + ), + ), + ), + SizedBox(height: 120,) + ], + ), + ), + ), + bottomSheet: Container( + //padding: EdgeInsets.all(8.0), + // margin: EdgeInsets.all(8.0), + child: BottomButton( + label: TranslationBase.of(context).cancelOrder, + disabled: prescriptionsOrder.status != 1, + textColor: Colors.white, + onTap: (){ + + showCDialog(model,context); + //showAlertDialog(context); + }, + ), + ), + ), + ); + } + + showCDialog(PrescriptionsViewModel model,context){ + ConfirmDialog( + context: context, + confirmMessage: "Are you sure ?", + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel, + okFunction: () { + Navigator.of(context).pop(); + model.updatePressOrder(presOrderID: prescriptionsOrder.iD).then((value) { + Navigator.of(context).pop(); + }); + }, + cancelFunction: () => {}).showAlertDialog(context); + // dialog.showAlertDialog(context); + } + +} diff --git a/lib/pages/medical/prescriptions/prescriptions_history_page.dart b/lib/pages/medical/prescriptions/prescriptions_history_page.dart new file mode 100644 index 00000000..84691773 --- /dev/null +++ b/lib/pages/medical/prescriptions/prescriptions_history_page.dart @@ -0,0 +1,86 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_details_page.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class PrescriptionsHistoryPage extends StatelessWidget { + final PrescriptionsViewModel prescriptionsViewModel; + + PrescriptionsHistoryPage({Key key, this.prescriptionsViewModel}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + return AppScaffold( + baseViewModel: prescriptionsViewModel, + body: ListView.builder( + physics: BouncingScrollPhysics(), + itemBuilder: (context, index) => InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionsHistoryDetailsPage( + prescriptionsOrder: + prescriptionsViewModel.prescriptionsHistory[index], + ), + ), + ), + child: Container( + padding: EdgeInsets.all(15.0), + margin: EdgeInsets.all(8.0), + decoration: + BoxDecoration(shape: BoxShape.rectangle, color: Colors.white), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + DateUtil.getDayMonthYearHourMinuteDateFormatted(prescriptionsViewModel.prescriptionsHistory[index].createdOn), + fontWeight: FontWeight.w300, + ), + SizedBox( + height: 5, + ), + Texts( + '${TranslationBase.of(context).orderNo} ${prescriptionsViewModel.prescriptionsHistory[index].iD}'), + SizedBox( + height: 5, + ), + Texts( + '${prescriptionsViewModel.prescriptionsHistory[index].descriptionN}'), + SizedBox( + height: 5, + ), + Texts( + '${TranslationBase.of(context).orderNo}', + fontWeight: FontWeight.w300, + ), + SizedBox( + height: 5, + ), + ], + ), + ), + Icon( + Icons.arrow_forward_ios, + size: 25, + ) + ], + ), + ), + ), + itemCount: prescriptionsViewModel.prescriptionsHistory.length, + ), + ); + } +} diff --git a/lib/pages/medical/prescriptions/prescriptions_home_page.dart b/lib/pages/medical/prescriptions/prescriptions_home_page.dart new file mode 100644 index 00000000..96d4aba0 --- /dev/null +++ b/lib/pages/medical/prescriptions/prescriptions_home_page.dart @@ -0,0 +1,135 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../../../Constants.dart'; + +class HomePrescriptionsPage extends StatefulWidget { + @override + _HomePrescriptionsPageState createState() => _HomePrescriptionsPageState(); +} + +class _HomePrescriptionsPageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + List imagesInfo = List(); + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/0.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/1.png')); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getPrescriptions(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).prescriptions, + description: TranslationBase.of(context).infoPrescriptions, + infoList: TranslationBase.of(context).infoPrescriptionsPoints, + imagesInfo: imagesInfo, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.7), + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: Texts(TranslationBase.of(context).prescriptions), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: Texts(TranslationBase.of(context).history), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + PrescriptionsPage( + prescriptionsViewModel: model, + ), + PrescriptionsHistoryPage( + prescriptionsViewModel: model, + ) + ], + ), + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/prescriptions/prescriptions_page.dart b/lib/pages/medical/prescriptions/prescriptions_page.dart new file mode 100644 index 00000000..abf68328 --- /dev/null +++ b/lib/pages/medical/prescriptions/prescriptions_page.dart @@ -0,0 +1,105 @@ +import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_items_page.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class PrescriptionsPage extends StatelessWidget { + final PrescriptionsViewModel prescriptionsViewModel; + + const PrescriptionsPage({Key key, this.prescriptionsViewModel}) + : super(key: key); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( + baseViewModel: prescriptionsViewModel, + body: FractionallySizedBox( + widthFactor: 1.0, + child: ListView( + physics: BouncingScrollPhysics(), + children: [ + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () => + prescriptionsViewModel.setFilterType(FilterType.Clinic), + child: ListTile( + title: Text(TranslationBase.of(context).clinic), + leading: Radio( + value: FilterType.Clinic, + groupValue: prescriptionsViewModel.filterType, + onChanged: (FilterType value) { + prescriptionsViewModel.setFilterType(value); + }, + ), + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => prescriptionsViewModel + .setFilterType(FilterType.Hospital), + child: ListTile( + title: Text(TranslationBase.of(context).hospital), + leading: Radio( + value: FilterType.Hospital, + groupValue: prescriptionsViewModel.filterType, + onChanged: (FilterType value) { + prescriptionsViewModel.setFilterType(value); + }, + ), + ), + ), + ) + ], + ), + ...List.generate( + prescriptionsViewModel.prescriptionsOrderList.length, + (index) => AppExpandableNotifier( + title: prescriptionsViewModel + .prescriptionsOrderList[index].filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: prescriptionsViewModel + .prescriptionsOrderList[index].prescriptionsList + .map((prescriptions) { + return InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionItemsPage(prescriptions: prescriptions,), + ), + ), + child: DoctorCard( + name: prescriptions.doctorName, + profileUrl: prescriptions.doctorImageURL, + rat: prescriptions.actualDoctorRate.toDouble(), + subName: prescriptions.name, + isInOutPatient: prescriptions.isInOutPatient, + isLiveCareAppointment: prescriptions.isLiveCareAppointment, + date:projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr( DateUtil.convertStringToDate(prescriptions.appointmentDate) ):DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(prescriptions.appointmentDate)), + ), + ); + }).toList(), + )), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart new file mode 100644 index 00000000..742e3ddf --- /dev/null +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -0,0 +1,113 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class RadiologyDetailsPage extends StatelessWidget { + final FinalRadiology finalRadiology; + + RadiologyDetailsPage({Key key, this.finalRadiology}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getRadImageURL( + projectId: finalRadiology.projectID, + lineItem: finalRadiology.invoiceLineItemNo, + invoiceNo: finalRadiology.invoiceNo), + builder: (_, model, widget) => AppScaffold( + appBarTitle: TranslationBase.of(context).report, + isShowAppBar: true, + baseViewModel: model, + body: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Texts( + '${finalRadiology.reportData}', + textAlign: TextAlign.center, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + '${finalRadiology.reportData}', + textAlign: TextAlign.start, + fontSize: 17, + ), + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.2, + ) + ], + ), + ), + bottomSheet: (projectViewModel.havePrivilege(9) || + projectViewModel.havePrivilege(8)) + ? Container( + width: double.infinity, + height: finalRadiology.dIAPACSURL != "" + ? MediaQuery.of(context).size.height * 0.25 + : MediaQuery.of(context).size.height * 0.14, + color: Colors.grey[100], + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Divider(), + if (finalRadiology.dIAPACSURL != "" && projectViewModel.havePrivilege(9)) + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + onTap: () { + launch(model.radImageURL); + }, + label: TranslationBase.of(context).openRad, + backgroundColor: Colors.grey[800], + ), + ), + if (projectViewModel.havePrivilege(8)) + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + onTap: () { + showConfirmMessage( + finalRadiology: finalRadiology, model: model); + }, + label: TranslationBase.of(context).sendCopyRad, + loading: model.state == ViewState.BusyLocal, + backgroundColor: Theme.of(context).primaryColor, + ), + ) + ], + ), + ):Container()), + ); + } + + void showConfirmMessage( + {FinalRadiology finalRadiology, RadiologyViewModel model}) { + showDialog( + context: AppGlobal.context, + child: ConfirmSendEmailDialog( + email: model.user.emailAddress, + onTapSendEmail: () { + model.sendRadReportEmail( + mes: TranslationBase.of(AppGlobal.context).sendSuc, + finalRadiology: finalRadiology); + }, + ), + ); + } +} diff --git a/lib/pages/medical/radiology/radiology_home_page.dart b/lib/pages/medical/radiology/radiology_home_page.dart new file mode 100644 index 00000000..2123172a --- /dev/null +++ b/lib/pages/medical/radiology/radiology_home_page.dart @@ -0,0 +1,112 @@ +import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class RadiologyHomePage extends StatelessWidget { + List imagesInfo = List(); + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/ar/0.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/ar/1.png')); + return BaseView( + onModelReady: (model) => model.getPatientRadOrders(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).radiology, + baseViewModel: model, + description: TranslationBase.of(context).infoRadiology, + imagesInfo: imagesInfo, + body: FractionallySizedBox( + widthFactor: 1.0, + child: ListView( + physics: BouncingScrollPhysics(), + children: [ + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () => + model.setFilterType(FilterType.Clinic), + child: ListTile( + title: Text(TranslationBase.of(context).clinic), + leading: Radio( + value: FilterType.Clinic, + groupValue: model.filterType, + onChanged: (FilterType value) { + model.setFilterType(value); + }, + ), + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => model + .setFilterType(FilterType.Hospital), + child: ListTile( + title: Text(TranslationBase.of(context).hospital), + leading: Radio( + value: FilterType.Hospital, + groupValue: model.filterType, + onChanged: (FilterType value) { + model.setFilterType(value); + }, + ), + ), + ), + ) + ], + ), + ...List.generate( + model.finalRadiologyList.length, + (index) => AppExpandableNotifier( + title: model + .finalRadiologyList[index].filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model + .finalRadiologyList[index].finalRadiologyList + .map((radiology) { + return InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: RadiologyDetailsPage(finalRadiology: radiology,), + ), + ), + child: DoctorCard( + isInOutPatient: radiology.isInOutPatient, + isLiveCareAppointment: radiology.isLiveCareAppointment, + name: radiology.doctorName, + profileUrl: radiology.doctorImageURL, + billNo: '${radiology.invoiceNo}', + subName: '${radiology.projectName}', + date: projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(radiology.orderDate):DateUtil.getMonthDayYearDateFormatted(radiology.orderDate), + ), + ); + }).toList(), + )), + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/reports/monthly_reports.dart b/lib/pages/medical/reports/monthly_reports.dart new file mode 100644 index 00000000..ae9cc295 --- /dev/null +++ b/lib/pages/medical/reports/monthly_reports.dart @@ -0,0 +1,167 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/reports/user_agreement_page.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/input/custom_switch.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class MonthlyReportsPage extends StatefulWidget { + @override + _MonthlyReportsPageState createState() => _MonthlyReportsPageState(); +} + +class _MonthlyReportsPageState extends State { + bool isAgree = false; + bool isSummary = false; + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).monthlyReports, + body: SingleChildScrollView( + child: Container( + padding: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.all(9), + height: 55, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(8)), + shape: BoxShape.rectangle, + border: Border.all(color: Colors.grey)), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + TranslationBase.of(context).patientHealthSummaryReport, + bold: true, + ), + CustomSwitch( + value: isSummary, + activeColor: Colors.red, + inactiveColor: Colors.grey, + onChanged: () async { + setState(() { + isSummary = !isSummary; + }); + }, + ) + ], + ), + ), + SizedBox( + height: 15, + ), + Container( + margin: EdgeInsets.all(8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + model.user.emailAddress, + bold: true, + ), + ], + ), + ), + Divider( + height: 10.4, + thickness: 1.0, + ), + SizedBox( + height: 15, + ), + Container( + margin: EdgeInsets.all(8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Texts(TranslationBase.of(context) + .toViewTheTermsAndConditions), + ), + InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: UserAgreementContent(), + ), + ); + }, + child: Texts( + TranslationBase.of(context).clickHere, + color: Colors.blue, + ), + ) + ], + ), + ), + SizedBox( + height: 5, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Checkbox( + value: isAgree, + onChanged: (value) { + setState(() { + isAgree = !isAgree; + }); + }, + activeColor: Colors.red, + ), + Texts(TranslationBase.of(context) + .iAgreeToTheTermsAndConditions), + ], + ), + Container( + margin: EdgeInsets.all(8), + width: double.infinity, + child: SecondaryButton( + textColor: Colors.white, + label: TranslationBase.of(context).save, + disabled: !isAgree, + loading: model.state == ViewState.BusyLocal, + onTap: () { + model.updatePatientHealthSummaryReport( + message: TranslationBase.of(context) + .updateSuccessfully, + isSummary: isSummary); + }, + ), + ), + Padding( + padding: const EdgeInsets.all(5.0), + child: Texts( + TranslationBase.of(context) + .iAgreeToTheTermsAndConditionsSubtitle, + fontWeight: FontWeight.normal, + ), + ), + SizedBox( + height: 12, + ), + Center(child: Image.asset('assets/images/report.jpg')) + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart new file mode 100644 index 00000000..d3c818ff --- /dev/null +++ b/lib/pages/medical/reports/report_home_page.dart @@ -0,0 +1,193 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/reports_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/reports/report_list_widget.dart'; +import 'package:diplomaticquarterapp/pages/medical/reports/reports_page.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class HomeReportPage extends StatefulWidget { + @override + _HomeReportPageState createState() => _HomeReportPageState(); +} + +class _HomeReportPageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + List imagesInfo = List(); + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 4, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/1.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/1.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/2.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/2.png')); + return BaseView( + onModelReady: (model) => model.getReports(), //model.getPrescriptions(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).newMedReport, + title: TranslationBase.of(context).medReport, + description: TranslationBase.of(context).infoMonthReport, + baseViewModel: model, + imagesInfo: imagesInfo, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.7), + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + labelColor: Theme.of(context).primaryColor, + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.15, + child: Center( + child: Texts(TranslationBase.of(context).requested,fontSize: 11,), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.15, + child: Center( + child: Texts(TranslationBase.of(context).ready,fontSize: 11,), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.15, + child: Center( + child: + Texts(TranslationBase.of(context).completed,fontSize: 11,), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.15, + child: Center( + child: + Texts(TranslationBase.of(context).cancelled,fontSize: 11,), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + if(model.user!=null) + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + ReportListWidget( + reportList: model.reportsOrderRequestList, + emailAddress: model.user.emailAddress + ), + ReportListWidget( + reportList: model.reportsOrderReadyList, + emailAddress: model.user.emailAddress + ), + ReportListWidget( + reportList: model.reportsOrderCompletedList, + emailAddress: model.user.emailAddress + ), + ReportListWidget( + reportList: model.reportsOrderCanceledList, + emailAddress: model.user.emailAddress + ), + ], + ), + ), + SizedBox( + height: 110, + ) + ], + ), + bottomSheet: projectViewModel.havePrivilege(21) ?Container( + width: double.infinity, + height: 90, + margin: EdgeInsets.all(8.0), + child: Button( + label: TranslationBase.of(context).requestMedicalReport, + backgroundColor: Colors.grey[800], + onTap: () => Navigator.push( + context, + FadePage( + page: MedicalReports(), + ), + ), + ), + ):null, + ), + ), + ); + } +} diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart new file mode 100644 index 00000000..72d0422b --- /dev/null +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -0,0 +1,133 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/reports/Reports.dart'; +import 'package:diplomaticquarterapp/core/service/medical/reports_service.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ReportListWidget extends StatelessWidget { + final List reportList; + final String emailAddress; + + ReportListWidget({@required this.reportList, this.emailAddress}); + + @override + Widget build(BuildContext context) { + return Container( + child: ListView.builder( + itemBuilder: (context, index) => Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + width: double.infinity, + margin: EdgeInsets.only(left: 8, right: 8, top: 3), + decoration: BoxDecoration( + color: Colors.white, + border: Border.all(color: Colors.white, width: 2), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all( + Radius.circular(8.0), + )), + child: Row( + children: [ + Expanded( + flex: 1, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: LargeAvatar( + name: reportList[index].doctorName, + url: reportList[index].doctorImageURL, + ), + ), + ), + Expanded( + flex: 4, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Texts(reportList[index].projectName), + Texts(reportList[index].clinicDescription), + Texts(TranslationBase.of(context).invoiceNo + + ': ${reportList[index].invoiceNo}'), + SizedBox(height: 12), + ], + ), + reportList[index].status == 2 + ? Container( + margin: + EdgeInsets.only(left: 15.0, right: 15.0), + child: InkWell( + onTap: () { + showConfirmMessage(reportList[index]); + // sendReportEmail(reportList[index]); + }, + child: Icon( + Icons.email, + color: Theme.of(context).primaryColor, + size: 35.0, + ), + ), + ) + : Container(), + ], + ), + ), + ) + ], + ), + ), + ), + itemCount: reportList.length, + ), + ); + } + + void showConfirmMessage(Reports report) { + showDialog( + context: AppGlobal.context, + child: ConfirmSendEmailDialog( + email: emailAddress, + onTapSendEmail: () { + sendReportEmail(report); + }, + ), + ); + } + + sendReportEmail(Reports report) { + GifLoaderDialogUtils.showMyDialog(AppGlobal.context); + ReportsService _reportsService = locator(); + _reportsService + .sendEmailForMedicalReport( + report.projectName, + report.clinicDescription, + report.doctorName, + DateUtil.convertDateToString(report.requestDate), + report.invoiceNo.toString(), + report.projectID, + DateUtil.convertDateToString(report.requestDate), + report.setupId) + .then((value) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + AppToast.showSuccessToast( + message: TranslationBase.of(AppGlobal.context).emailSentSuccessfully); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + print(err); + }); + } +} diff --git a/lib/pages/medical/reports/reports_page.dart b/lib/pages/medical/reports/reports_page.dart new file mode 100644 index 00000000..d8cb2ca0 --- /dev/null +++ b/lib/pages/medical/reports/reports_page.dart @@ -0,0 +1,210 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/reports_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class MedicalReports extends StatelessWidget { + @override + Widget build(BuildContext context) { + void confirmBox( + AppointmentHistory model, ReportsViewModel reportsViewModel) { + showDialog( + context: context, + child: ConfirmDialog( + appointmentHistory: model, + onOkSelected: (model) => reportsViewModel.insertRequestForMedicalReport(model,TranslationBase.of(context).successSendReport), + ), + ); + } + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getPatentAppointmentHistory(), + builder: (_, model, widget) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).medReport, + body: ListView.builder( + itemCount: model.appointHistoryList.length, + itemBuilder: (context, index) => Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + width: double.infinity, + margin: EdgeInsets.only(left: 8, right: 8, top: 3), + decoration: BoxDecoration( + color: Colors.white, + border: Border.all(color: Colors.white, width: 2), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all( + Radius.circular(8.0), + )), + child: Row( + children: [ + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.only(left: 5, right: 5), + child: LargeAvatar( + width: 50, + height: 50, + name: model.appointHistoryList[index].doctorNameObj, + url: model.appointHistoryList[index].doctorImageURL, + ), + ), + ), + Expanded( + flex: 4, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Texts(model.appointHistoryList[index].projectName), + Texts(model.appointHistoryList[index].clinicName), + Texts(projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(model.appointHistoryList[index].appointmentDate):DateUtil.getMonthDayYearDateFormatted(model.appointHistoryList[index].appointmentDate)), + StarRating( + totalAverage: model + .appointHistoryList[index].actualDoctorRate + .toDouble(), + forceStars: true), + SizedBox( + height: 12, + ), + ], + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => + confirmBox(model.appointHistoryList[index], model), + child: Container( + width: 85, + height: 50, + decoration: BoxDecoration( + color: Colors.black54, + border: + Border.all(color: Colors.transparent, width: 2), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + ), + child: Center( + child: Texts( + TranslationBase.of(context).requestReport, + fontSize: 12, + color: Colors.white, + ), + ), + ), + ), + ), + SizedBox( + width: 12, + ), + ], + ), + ), + ), + ), + ), + ); + } +} + +class ConfirmDialog extends StatefulWidget { + final Function(AppointmentHistory) onOkSelected; + final AppointmentHistory appointmentHistory; + + ConfirmDialog({this.onOkSelected, this.appointmentHistory}); + + @override + _ConfirmDialogState createState() => _ConfirmDialogState(); +} + +class _ConfirmDialogState extends State { + @override + Widget build(BuildContext context) { + return SimpleDialog( + title: Texts(TranslationBase.of(context).confirm), + children: [ + Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Texts(TranslationBase.of(context).confirmMsgReport), + SizedBox( + height: 5.0, + ), + Divider( + height: 2.5, + color: Colors.grey[500], + ), + SizedBox( + height: 5, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () => Navigator.pop(context), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel, + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onOkSelected(widget.appointmentHistory); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + ), + ), + ), + ), + ), + ], + ) + ], + ), + ) + ], + ); + } +} diff --git a/lib/pages/medical/reports/user_agreement_page.dart b/lib/pages/medical/reports/user_agreement_page.dart new file mode 100644 index 00000000..9bb886e3 --- /dev/null +++ b/lib/pages/medical/reports/user_agreement_page.dart @@ -0,0 +1,25 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter_html/flutter_html.dart'; + +class UserAgreementContent extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getUserTermsAndConditions(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBarTitle: TranslationBase.of(context).userAgreement, + body: SingleChildScrollView( + child: Html( + data: model.userAgreementContent, + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/smart_watch_health_data/health_data_list.dart b/lib/pages/medical/smart_watch_health_data/health_data_list.dart new file mode 100644 index 00000000..2f9a3e60 --- /dev/null +++ b/lib/pages/medical/smart_watch_health_data/health_data_list.dart @@ -0,0 +1,145 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class HealthDataList extends StatefulWidget { + @override + _HealthDataListState createState() => _HealthDataListState(); +} + +class _HealthDataListState extends State { + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "Smartwatches", + isShowAppBar: true, + body: Container( + height: MediaQuery.of(context).size.height, + margin: EdgeInsets.all(20.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + child: Image.asset( + "assets/images/SmartWatches/heartrate_icon.png", + width: 60.0, + height: 60.0), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + child: Text("Heart Rate", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + Divider( + color: Colors.grey[500], + ), + Row( + children: [ + Container( + child: Image.asset( + "assets/images/SmartWatches/sleep_data.png", + width: 60.0, + height: 60.0), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + child: Text("Sleep Data", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + Divider( + color: Colors.grey[500], + ), + Row( + children: [ + Container( + child: Image.asset( + "assets/images/SmartWatches/heartrate_icon.png", + width: 60.0, + height: 60.0), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + child: Text("Steps", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + Divider( + color: Colors.grey[500], + ), + Row( + children: [ + Container( + child: Image.asset( + "assets/images/SmartWatches/heartrate_icon.png", + width: 60.0, + height: 60.0), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + child: Text("Distance", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + Divider( + color: Colors.grey[500], + ), + Row( + children: [ + Container( + child: Image.asset( + "assets/images/SmartWatches/heartrate_icon.png", + width: 60.0, + height: 60.0), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + child: Text("Energy", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + Divider( + color: Colors.grey[500], + ), + ], + ), + ), + ), + bottomSheet: Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.1, + color: Colors.grey[100], + child: Column( + children: [ + Divider( + color: Colors.transparent, + ), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + onTap: () { +// launch(model.radImageURL); + }, + label: 'Sync Health Data', + backgroundColor: Colors.grey[800], + ), + ), + ], + ), + )); + } +} diff --git a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart new file mode 100644 index 00000000..eb0c1675 --- /dev/null +++ b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart @@ -0,0 +1,819 @@ +import 'dart:io'; + +import 'package:carousel_slider/carousel_slider.dart'; +import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/health_data_list.dart'; +import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class SmartWatchInstructions extends StatefulWidget { + @override + _SmartWatchInstructionsState createState() => _SmartWatchInstructionsState(); +} + +class _SmartWatchInstructionsState extends State { + CarouselController buttonCarouselController = CarouselController(); + + bool hasAlreadySynced = false; + + @override + void initState() { + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + getLastPatientRecord(context); + }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "Sync Health Data", + isShowAppBar: true, + body: Container( + child: Platform.isIOS + ? _getAppleWatchInstructions() + : _getGoogleWatchInstructions(), + )); + } + + _getAppleWatchInstructions() { + return SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: CarouselSlider( + carouselController: buttonCarouselController, + options: CarouselOptions( + enableInfiniteScroll: false, + viewportFraction: 0.95, + height: MediaQuery.of(context).size.height * 0.9), + items: [1, 2].map((i) { + return Builder( + builder: (BuildContext context) { + return Container( + width: MediaQuery.of(context).size.width, + margin: EdgeInsets.symmetric(horizontal: 5.0), + child: Card( + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white.withOpacity(1.0), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: i == 1 + ? Column( + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Supported Smartwatches", + style: TextStyle( + fontSize: 22.0, + fontWeight: FontWeight.bold, + fontFamily: "WorkSans")), + ), + Container( + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/apple-watch-1.jpeg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Apple Watch Series 1", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/apple-watch-2.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Apple Watch Series 2", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/apple-watch-3.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Apple Watch Series 3", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/apple-watch-4.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Apple Watch Series 4", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/apple-watch-5.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Apple Watch Series 5", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/Apple-Watch-6.png", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Apple Watch Series 6", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/miBand3.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text("Mi Band 3", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/miBand4.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text("Mi Band 4", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.fromLTRB( + 10.0, 30.0, 10.0, 10.0), + child: Text( + "It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "Before syncing data, please make sure that you have followed the instructions properly", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(15.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10.0), + ), + minWidth: + MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + buttonCarouselController.nextPage(); + }, + child: Text("CONTINUE", + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ], + ) + : Column( + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Watch Instructions:", + style: TextStyle( + fontSize: 22.0, + fontWeight: FontWeight.bold, + fontFamily: "WorkSans")), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.fromLTRB( + 10.0, 20.0, 10.0, 10.0), + child: Text( + "Before syncing data, please make sure that following instructions are met: ", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.fromLTRB( + 10.0, 20.0, 10.0, 10.0), + child: Text( + "1. Make sure that you have installed 'Health' App & 'Watch' App from Apple Store.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "2. Make sure that your Apple Watch is connected with the Watch & Health Apps.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "3. Make sure that data like heart rate, steps, distance etc. are being shown on your health app.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.fromLTRB( + 15.0, 110.0, 15.0, 15.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10.0), + ), + minWidth: + MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + buttonCarouselController.nextPage(); + }, + child: Text("SYNC HEALTH DATA", + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + hasAlreadySynced ? Container( + margin: EdgeInsets.fromLTRB( + 15.0, 0.0, 15.0, 15.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10.0), + ), + minWidth: + MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + _openHealthDataList(); + }, + child: Text("ALREADY SYNCED", + style: TextStyle(fontSize: 18.0)), + ), + ), + ): Container(), + ], + ), + )); + }, + ); + }).toList(), + ), + ) + ], + ), + ); + } + + _getGoogleWatchInstructions() { + return SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: CarouselSlider( + carouselController: buttonCarouselController, + options: CarouselOptions( + enableInfiniteScroll: false, + viewportFraction: 0.95, + height: MediaQuery.of(context).size.height * 0.9), + items: [1, 2].map((i) { + return Builder( + builder: (BuildContext context) { + return Container( + width: MediaQuery.of(context).size.width, + margin: EdgeInsets.symmetric(horizontal: 5.0), + child: Card( + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white.withOpacity(1.0), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: i == 1 + ? Column( + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Supported Smartwatches", + style: TextStyle( + fontSize: 22.0, + fontWeight: FontWeight.bold, + fontFamily: "WorkSans")), + ), + Container( + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/huawei-watch-2.png", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Huawei Watch 2", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/ticwatche2.png", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Mobovi TicWatch E2", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/huawei-watch-2-classic.png", + width: 70.0, + height: 70.0), + Container( + child: Text("Huawei Watch", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/ticwatche2.png", + width: 70.0, + height: 70.0), + Container( + child: Text("Fossil Sport", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/misfit-vapor-2.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "MisFit Vapor 2", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/lg-watch-sport.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "LG Watch Sport", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/miBand3.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text("Mi Band 3", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/miBand4.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text("Mi Band 4", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + InkWell( + onTap: () { + launch( + "https://wearos.google.com/#find-your-watch"); + }, + child: Container( + margin: EdgeInsets.only(top: 20.0), + child: Text( + "More Supported Smartwatches...", + style: TextStyle( + fontSize: 17.0, + color: Colors.blue, + decoration: + TextDecoration.underline)), + ), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "Before syncing data, please make sure that you have followed the instructions properly", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(15.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10.0), + ), + minWidth: + MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + buttonCarouselController.nextPage(); + }, + child: Text("CONTINUE", + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ], + ) + : Column( + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Watch Instructions:", + style: TextStyle( + fontSize: 22.0, + fontWeight: FontWeight.bold, + fontFamily: "WorkSans")), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "Before syncing data, please make sure that following instructions are met: ", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "1. Make sure that you have installed 'WearOS' & 'Google Fit' apps from Google PlayStore.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "2. Make sure that you have installed your watch related apps from Google PlayStore.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "3. Make sure that your Smart Watch is connected with the WearOS app & your watch apps.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "4. Make sure that your smart watch apps are linked/associated with Google Fit App.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.fromLTRB( + 15.0, 95.0, 15.0, 15.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10.0), + ), + minWidth: + MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + buttonCarouselController.nextPage(); + }, + child: Text("SYNC HEALTH DATA", + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + hasAlreadySynced ? Container( + margin: EdgeInsets.fromLTRB( + 15.0, 0.0, 15.0, 15.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10.0), + ), + minWidth: + MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + _openHealthDataList(); + }, + child: Text("ALREADY SYNCED", + style: TextStyle(fontSize: 18.0)), + ), + ), + ) : Container(), + ], + ), + )); + }, + ); + }).toList(), + ), + ) + ], + ), + ); + } + + getLastPatientRecord(BuildContext context) { + SmartWatchIntegrationService service = new SmartWatchIntegrationService(); + service.getLastPatientRecord(context).then((res) { + if (res['MessageStatus'] == 1) { + print(res['Med_GetPatientLastRecordList']); + setState(() { + if (res['Med_GetPatientLastRecordList'] != null) + hasAlreadySynced = true; + else + hasAlreadySynced = false; + }); + } else {} + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + _openHealthDataList() { + Navigator.push( + context, MaterialPageRoute(builder: (context) => HealthDataList())); + } +} diff --git a/lib/pages/medical/vital_sign/LineChartCurved.dart b/lib/pages/medical/vital_sign/LineChartCurved.dart new file mode 100644 index 00000000..7b7449a8 --- /dev/null +++ b/lib/pages/medical/vital_sign/LineChartCurved.dart @@ -0,0 +1,217 @@ +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; + +class LineChartCurved extends StatelessWidget { + final String title; + final List timeSeries; + final int indexes; + + LineChartCurved({this.title, this.timeSeries, this.indexes}); + + List xAxixs = List(); + List yAxixs = List(); + + @override + Widget build(BuildContext context) { + getXaxix(); + getYaxix(); + return AspectRatio( + aspectRatio: 1.1, + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(18)), + // color: Colors.white, + ), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox( + height: 4, + ), + Text( + title, + style: TextStyle( + color: Colors.black, + fontSize: 15, + letterSpacing: 2), + textAlign: TextAlign.center, + ), + SizedBox(height: 10,), + Expanded( + child: Padding( + padding: const EdgeInsets.only(right: 18.0, left: 16.0), + child: LineChart( + sampleData1(context), + swapAnimationDuration: const Duration(milliseconds: 250), + ), + ), + ), + const SizedBox( + height: 10, + ), + ], + ), + ], + ), + ), + ); + } + + getXaxix() { + for (int index = 0; index < timeSeries.length; index++) { + int mIndex = indexes * index; + if (mIndex < timeSeries.length) { + xAxixs.add(mIndex); + } + } + } + getYaxix() { + int indexess= (timeSeries.length*0.30).toInt(); + for (int index = 0; index < timeSeries.length; index++) { + int mIndex = indexess * index; + if (mIndex < timeSeries.length) { + yAxixs.add(timeSeries[mIndex].sales); + } + } + } + + LineChartData sampleData1(context) { + return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + tooltipBgColor: Colors.white, + + ), + touchCallback: (LineTouchResponse touchResponse) {}, + handleBuiltInTouches: true, + ), + gridData: FlGridData( + show: true, drawVerticalLine: true, drawHorizontalLine: true), + titlesData: FlTitlesData( + bottomTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontSize: 10, + ), + rotateAngle:-65, + //rotateAngle:-65, + margin: 22, + getTitles: (value) { + if (timeSeries.length < 15) { + if (timeSeries.length > value.toInt()) { + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + } else + return ''; + } else { + if (value.toInt() == 0) + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + if (value.toInt() == timeSeries.length - 1) + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + if (xAxixs.contains(value.toInt())) { + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + } + } + return ''; + }, + ), + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), + getTitles: (value) { + // if (timeSeries.length < 10) { + // return '${value.toInt()}'; + // } else { + // if (value == getMinY()) + // return '${value.toInt()}'; + // if (value == getMaxY()) + // return '${value.toInt()}'; + // if (yAxixs.contains(value)) { + // return '${value.toInt()}'; + // } + // return ''; + // } + return '${value.toInt()}'; + }, + margin: 12, + ), + ), + borderData: FlBorderData( + show: true, + border: const Border( + bottom: BorderSide( + color: Colors.black, + width: 0.5, + ), + left: BorderSide( + color: Colors.black, + ), + right: BorderSide( + color: Colors.black, + ), + top: BorderSide( + color: Colors.transparent, + ), + ), + ), + minX: 0, + maxX: (timeSeries.length - 1).toDouble(), + maxY: getMaxY()+0.3, + minY: getMinY(), + lineBarsData: getData(context), + ); + } + + double getMaxY() { + double max = 0; + timeSeries.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + + return max.roundToDouble() ; + } + + double getMinY() { + double min = timeSeries[0].sales; + timeSeries.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + int value = min.toInt(); + + return value.toDouble(); + } + + List getData(context) { + List spots = List(); + for (int index = 0; index < timeSeries.length; index++) { + spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); + } + + final LineChartBarData lineChartBarData1 = LineChartBarData( + spots: spots, + isCurved: true, + colors: [Theme.of(context).primaryColor], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + + return [ + lineChartBarData1, + ]; + } +} diff --git a/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart b/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart new file mode 100644 index 00000000..e8cb8b24 --- /dev/null +++ b/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart @@ -0,0 +1,257 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; + +class LineChartCurvedBloodPressure extends StatelessWidget { + final String title; + final List timeSeries1; + final List timeSeries2; + final int indexes; + + LineChartCurvedBloodPressure( + {this.title, this.timeSeries1, this.indexes, this.timeSeries2}); + + List xAxixs = List(); + List yAxixs = List(); + + @override + Widget build(BuildContext context) { + getXaxix(); + return AspectRatio( + aspectRatio: 1.1, + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(18)), + // color: Colors.white, + ), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox( + height: 15, + ), + Text( + title, + style: TextStyle( + color: Colors.black, fontSize: 15, letterSpacing: 2), + textAlign: TextAlign.center, + ), + SizedBox( + height: 10, + ), + Expanded( + child: Padding( + padding: + const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), + child: LineChart( + sampleData1(context), + swapAnimationDuration: const Duration(milliseconds: 250), + ), + ), + ), + SizedBox( + height: 10, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Container( + width: 20, + height: 20, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Theme.of(context).primaryColor), + ), + SizedBox(width: 5,), + Texts(TranslationBase.of(context).systolicLng) + ], + ), + SizedBox(width: 15,), + Row( + children: [ + Container( + width: 20, + height: 20, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.grey), + ), + SizedBox(width: 5,), + Texts(TranslationBase.of(context).diastolicLng) + ], + ), + ], + ) + ], + ), + ], + ), + ), + ); + } + + getXaxix() { + for (int index = 0; index < timeSeries1.length; index++) { + int mIndex = indexes * index; + if (mIndex < timeSeries1.length) { + xAxixs.add(mIndex); + } + } + } + + LineChartData sampleData1(context) { + return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + tooltipBgColor: Colors.white, + ), + touchCallback: (LineTouchResponse touchResponse) {}, + handleBuiltInTouches: true, + ), + gridData: FlGridData( + show: true, drawVerticalLine: true, drawHorizontalLine: true), + titlesData: FlTitlesData( + bottomTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontSize: 10, + ), + rotateAngle: -65, + //rotateAngle:-65, + margin: 22, + getTitles: (value) { + if (timeSeries1.length < 15) { + if (timeSeries1.length > value.toInt()) { + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + } else + return ''; + } else { + if (value.toInt() == 0) + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (value.toInt() == timeSeries1.length - 1) + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (xAxixs.contains(value.toInt())) { + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + } + } + return ''; + }, + ), + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), + getTitles: (value) { + return '${value.toInt()}'; + }, + margin: 12, + ), + ), + borderData: FlBorderData( + show: true, + border: const Border( + bottom: BorderSide( + color: Colors.black, + width: 0.5, + ), + left: BorderSide( + color: Colors.black, + ), + right: BorderSide( + color: Colors.black, + ), + top: BorderSide( + color: Colors.transparent, + ), + ), + ), + minX: 0, + maxX: (timeSeries1.length - 1).toDouble(), + maxY: getMaxY() + 0.3, + minY: getMinY(), + lineBarsData: getData(context), + ); + } + + double getMaxY() { + double max = 0; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + timeSeries2.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + + return max.roundToDouble(); + } + + double getMinY() { + double min = timeSeries1[0].sales; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + timeSeries2.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + + int value = min.toInt(); + + return value.toDouble(); + } + + List getData(context) { + List spots = List(); + for (int index = 0; index < timeSeries1.length; index++) { + spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); + } + + List spots2 = List(); + for (int index = 0; index < timeSeries2.length; index++) { + spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); + } + + final LineChartBarData lineChartBarData1 = LineChartBarData( + spots: spots, + isCurved: true, + colors: [Theme.of(context).primaryColor], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + final LineChartBarData lineChartBarData2 = LineChartBarData( + spots: spots2, + isCurved: true, + colors: [Colors.grey], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + + return [lineChartBarData1, lineChartBarData2]; + } +} diff --git a/lib/pages/medical/vital_sign/vital_sign_details_blood_pressurewideget.dart b/lib/pages/medical/vital_sign/vital_sign_details_blood_pressurewideget.dart new file mode 100644 index 00000000..e28b52e1 --- /dev/null +++ b/lib/pages/medical/vital_sign/vital_sign_details_blood_pressurewideget.dart @@ -0,0 +1,146 @@ +import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +class VitalSignBloodPressureWidget extends StatefulWidget { + final List vitalList; + final String title1; + final String title2; + final String title3; + final String viewKey1; + final String viewKey2; + + VitalSignBloodPressureWidget( + {Key key, this.vitalList, this.title1, this.title2, this.viewKey1, this.title3, this.viewKey2}); + + @override + _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); +} + +class _VitalSignDetailsWidgetState extends State { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), + border: Border.all(color: Colors.grey, width: 1), + ), + margin: EdgeInsets.all(20), + child: Container( + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(projectViewModel), + ), + ], + ), + ), + ); + } + + List fullData(ProjectViewModel projectViewModel) { + List tableRow = []; + tableRow.add(TableRow(children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) + ), + ), + child: Center( + child: Texts( + TranslationBase.of(context).date, + color: Colors.white, + ), + ), + height: 60, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + + ), + child: Center( + child: Texts(widget.title2, color: Colors.white), + ), + height: 60), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) + ), + ), + child: Center( + child: Texts(widget.title3, color: Colors.white), + ), + height: 60), + ), + ])); + widget.vitalList.forEach((vital) { + var data = vital.toJson()[widget.viewKey1]; + if (data != 0) + tableRow.add(TableRow(children: [ + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${projectViewModel.isArabic ? DateUtil.getWeekDayArabic(vital.vitalSignDate.weekday) : DateUtil.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${projectViewModel.isArabic ? DateUtil.getMonthArabic(vital.vitalSignDate.month) : DateUtil.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${vital.toJson()[widget.viewKey1]}', + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${vital.toJson()[widget.viewKey2]}', + textAlign: TextAlign.center, + ), + ), + ), + ), + ])); + }); + return tableRow; + } +} diff --git a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart new file mode 100644 index 00000000..4d141b5f --- /dev/null +++ b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart @@ -0,0 +1,203 @@ +import 'package:diplomaticquarterapp/core/enum/patient_lookup.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/vital_sign_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_item.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_item_details_screen.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; + +import '../../../d_q_icons_icons.dart'; + +class VitalSignDetailsScreen extends StatelessWidget { + static const String url = "assets/images/"; + + int appointmentNo; + int projectID; + bool isNotOneAppointment; + VitalSignDetailsScreen({this.appointmentNo, this.projectID,this.isNotOneAppointment=true}); + List imagesInfo = List(); + + + @override + Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vital-signs/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vital-signs/ar/0.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vital-signs/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vital-signs/ar/1.png')); + return BaseView( + onModelReady: appointmentNo != null && projectID != null + ? (model) => model.getPatientVitalSign( + appointmentNo: appointmentNo, projectID: projectID) + : (model) => model.getPatientVitalSign(), + builder: (_, mode, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).vitalSigns, + baseViewModel: mode, + description: TranslationBase.of(context).infoSigns, + imagesInfo: imagesInfo, + body: mode.vitalSignResModelList.length > 0 + ? Container( + child: ListView( + children: [ + Row( + children: [ + InkWell( + onTap: () =>isNotOneAppointment? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: VitalSignDetails.Height, + pageTitle: TranslationBase.of(context).height, + vitalList: mode.vitalSignResModelList, + ), + ), + ):null, + child: Container( + child: VitalSignItem( + des: TranslationBase.of(context).height, + icon: DQIcons.height, + lastVal: mode.heightCm, + unit: TranslationBase.of(context).cm, + ), + ), + ), + InkWell( + onTap: () => isNotOneAppointment ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: VitalSignDetails.Weight, + pageTitle: TranslationBase.of(context).weight, + vitalList: mode.vitalSignResModelList, + ), + ), + ):null, + child: VitalSignItem( + des: TranslationBase.of(context).weight, + icon: DQIcons.weight_scale, + unit: TranslationBase.of(context).kg, + lastVal: mode.weightKg, + ), + ), + ], + ), + Row( + children: [ + InkWell( + onTap: () => isNotOneAppointment ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: VitalSignDetails.BodyMeasurements, + pageTitle: TranslationBase.of(context) + .bodyMeasurements, + vitalList: mode.vitalSignResModelList, + ), + ), + ): null, + child: VitalSignItem( + des: TranslationBase.of(context).body, + icon: DQIcons.bmi, + lastVal: mode.bodyMax, + unit: TranslationBase.of(context).mass, + ), + ), + InkWell( + onTap: () => isNotOneAppointment ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: VitalSignDetails.Temperature, + pageTitle: + TranslationBase.of(context).temperature, + vitalList: mode.vitalSignResModelList, + ), + ), + ):null, + child: Container( + child: VitalSignItem( + des: TranslationBase.of(context).temperature, + icon: DQIcons.thermometer, + lastVal: mode.temperatureCelcius, + unit: TranslationBase.of(context).tempC, + ), + ), + ), + ], + ), + Row( + children: [ + InkWell( + onTap: () => isNotOneAppointment ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: VitalSignDetails.heart, + pageTitle: TranslationBase.of(context).heart, + vitalList: mode.vitalSignResModelList, + ), + ), + ):null, + child: VitalSignItem( + des: TranslationBase.of(context).heart, + icon: DQIcons.heart, + lastVal: mode.hartRat, + unit: TranslationBase.of(context).bpm, + ), + ), + InkWell( + onTap: () => isNotOneAppointment ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: VitalSignDetails.Respiration, + pageTitle: + TranslationBase.of(context).respirationRate, + vitalList: mode.vitalSignResModelList, + ), + ), + ):null, + child: VitalSignItem( + des: TranslationBase.of(context).respirationRate, + icon: DQIcons.outline, + lastVal: mode.respirationBeatPerMinute, + unit: TranslationBase.of(context).respirationSigns, + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + InkWell( + onTap: () => isNotOneAppointment ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: VitalSignDetails.BloodPressure, + pageTitle: TranslationBase.of(context).bloodPressure, + vitalList: mode.vitalSignResModelList, + ), + ), + ):null, + child: VitalSignItem( + des: TranslationBase.of(context).bloodPressure, + icon: DQIcons.blood_pressure, + lastVal: mode.bloodPressure, + unit: TranslationBase.of(context).sysDias, + ), + ), + ], + ), + ], + ), + ) + : Center( + child: Texts('No Data'), + ), + ), + ); + } +} diff --git a/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart b/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart new file mode 100644 index 00000000..113e29a6 --- /dev/null +++ b/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart @@ -0,0 +1,121 @@ +import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +class VitalSignDetailsWidget extends StatefulWidget { + final List vitalList; + final String title1; + final String title2; + final String viewKey; + + VitalSignDetailsWidget( + {Key key, this.vitalList, this.title1, this.title2, this.viewKey}); + + @override + _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); +} + +class _VitalSignDetailsWidgetState extends State { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), + border: Border.all(color: Colors.grey, width: 1), + ), + margin: EdgeInsets.all(20), + child: Container( + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(projectViewModel), + ), + ], + ), + ), + ); + } + + List fullData(ProjectViewModel projectViewModel) { + List tableRow = []; + tableRow.add(TableRow(children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) + ), + ), + child: Center( + child: Texts( + TranslationBase.of(context).date, + color: Colors.white, + ), + ), + height: 60, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) + ), + ), + child: Center( + child: Texts(widget.title2, color: Colors.white), + ), + height: 60), + ) + ])); + widget.vitalList.forEach((vital) { + var data = vital.toJson()[widget.viewKey]; + if (data != 0) + tableRow.add(TableRow(children: [ + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${projectViewModel.isArabic ? DateUtil.getWeekDayArabic(vital.vitalSignDate.weekday) : DateUtil.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${projectViewModel.isArabic ? DateUtil.getMonthArabic(vital.vitalSignDate.month) : DateUtil.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${vital.toJson()[widget.viewKey]}', + textAlign: TextAlign.center, + ), + ), + ), + ), + ])); + }); + return tableRow; + } +} diff --git a/lib/pages/medical/vital_sign/vital_sign_item.dart b/lib/pages/medical/vital_sign/vital_sign_item.dart new file mode 100644 index 00000000..fb44772d --- /dev/null +++ b/lib/pages/medical/vital_sign/vital_sign_item.dart @@ -0,0 +1,97 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class VitalSignItem extends StatelessWidget { + const VitalSignItem( + {Key key, + @required this.des, + this.lastVal = 'N/A', + this.unit = '', + this.height, + this.width, + @required this.icon}) + : super(key: key); + + final String des; + final String lastVal; + final String unit; + final IconData icon; + final double height; + final double width; + + @override + Widget build(BuildContext context) { + return RoundedContainer( + margin: 0.025 * SizeConfig.realScreenWidth, + height: 0.15 * SizeConfig.realScreenHeight, + width: 0.45 * SizeConfig.realScreenWidth, + child: Container( + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 0.10 * SizeConfig.realScreenHeight, + child: Row( + children: [ + Expanded( + flex: 2, + child: Align( + alignment: Alignment.topLeft, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + des, + style: TextStyle( + fontSize: 1.7 * SizeConfig.textMultiplier, + color: HexColor('#B8382C'), + fontWeight: FontWeight.bold, + ), + ), + ), + ), + ), + Expanded( + flex: 1, + child: Container( + child: Icon( + icon, + size: 40, + ), + ), + ) + ], + ), + ), + Expanded( + child: Container( + width: double.infinity, + child: Align( + alignment: Alignment.topRight, + child: Container( + margin: EdgeInsets.only(left: 5, right: 5), + child: RichText( + text: TextSpan( + style: TextStyle(color: Colors.black), + children: [ + TextSpan(text: lastVal), + TextSpan( + text: unit, + style: TextStyle( + color: HexColor('#B8382C'), + ), + ), + ]), + ), + ), + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart new file mode 100644 index 00000000..6db865b6 --- /dev/null +++ b/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart @@ -0,0 +1,195 @@ +import 'package:diplomaticquarterapp/core/enum/patient_lookup.dart'; +import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sing_chart_and_detials.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class VitalSignItemDetailsScreen extends StatelessWidget { + final VitalSignDetails pageKey; + final String pageTitle; + List VSchart; + + VitalSignItemDetailsScreen({this.vitalList, this.pageKey, this.pageTitle}); + + final List vitalList; + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + switch (pageKey) { + case VitalSignDetails.BodyMeasurements: + VSchart = [ + { + 'name': 'BMI', + 'nameAr': 'مؤشر الكتلة', + 'title1': 'Date', + 'title2': 'BMI', + 'title2Ar': 'الكتلة', + 'viewKey': 'BodyMassIndex', + }, + + ]; + + break; + + case VitalSignDetails.Temperature: + VSchart = [ + { + 'name': 'Temperature In Celsius', + 'nameAr': 'درجة الحرارة بالدرجة المئوية', + 'title1': 'Date', + 'title2': 'C', + 'title2Ar': 'ْس', + 'viewKey': 'TemperatureCelcius', + }, + ]; + + break; + case VitalSignDetails.Pulse: + VSchart = [ + { + 'name': 'Pulse Beat Per Minute', + 'nameAr': 'نبضة نبضة في الدقيقة', + 'title1': 'Date', + 'title2': 'Minute', + 'title2Ar': 'دقيقة', + 'viewKey': 'PulseBeatPerMinute', + }, + ]; + + break; + case VitalSignDetails.Prescriptions: + VSchart = [ + { + 'name': 'Respiration Beat Per Minute', + 'nameAr': 'ضربات التنفس في الدقيقة', + 'title1': 'Date', + 'title2': 'Beat Per Minute', + 'title2Ar': 'نفس في الدقيقة', + 'viewKey': 'RespirationBeatPerMinute', + }, + ]; + + break; + case VitalSignDetails.BloodPressure: + VSchart = [ + { + 'name': 'Blood Pressure Systolic Diastolic', + 'nameAr': 'ضغط الدم الإنقباض الإنبساط', + 'title1': 'Date', + 'title2': 'systolic', + 'title3': 'Diastolic', + 'title2Ar': 'الإنقباض', + 'title3Ar': 'الإنبساط', + 'viewKey': 'BloodPressure', + }, + + ]; + + break; + case VitalSignDetails.Respiration: + VSchart = [ + { + 'name': 'Respiration Rate', + 'nameAr': 'معدل التنفس', + 'title1': 'Date', + 'title2': 'bpm', + 'title2Ar': 'نفس', + 'viewKey': 'RespirationBeatPerMinute', + }, + ]; + + break; + case VitalSignDetails.heart: + VSchart = [ + { + 'name': 'Heart rate', + 'nameAr': 'معدل النبض بالدقيقة', + 'title1': 'Date', + 'title2': 'bpm', + 'title2Ar': 'نبضة', + 'viewKey': 'PulseBeatPerMinute', + }, + ]; + + break; + case VitalSignDetails.PainScale: + VSchart = [ + { + 'name': 'PainScore', + 'nameAr': 'نقاط الألم', + 'title1': 'Date', + 'title2': 'Cm', + 'title2Ar': 'سم', + 'viewKey': 'PainScore', + }, + ]; + + break; + case VitalSignDetails.Weight: + VSchart = [ + { + 'name': 'Weight Kg', + 'nameAr': 'الوزن كجم', + 'title1': 'Date', + 'title2': 'Kg', + 'title2Ar': 'كجم', + 'viewKey': 'WeightKg', + }, + ]; + + break; + + case VitalSignDetails.Height: + VSchart = [ + { + 'name': 'Height Cm', + 'nameAr': 'الطول سم', + 'title1': 'Date', + 'title2': 'Cm', + 'title2Ar': 'سم', + 'viewKey': 'HeightCm', + }, + ]; + + break; + default: + } + return AppScaffold( + appBarTitle: pageTitle, + isShowAppBar: true, + body: ListView( + children: VSchart.map((chartInfo) { + var vitalListTemp = vitalList.where( + (element) => element.toJson()[chartInfo['viewKey']] != null, + ); + + if(vitalListTemp.length != 0 && chartInfo['viewKey']=='BloodPressure'){ + return VitalSingChartBloodPressure( + vitalList: vitalList, + name:projectViewModel.isArabic? chartInfo['nameAr']:chartInfo['name'], + title1: chartInfo['title1'], + title2:projectViewModel.isArabic?chartInfo['title2Ar']: chartInfo['title2'], + title3:projectViewModel.isArabic?chartInfo['title3Ar']: chartInfo['title3'], + viewKey1: 'BloodPressureHigher', + viewKey2: 'BloodPressureLower', + + ); + } + + return vitalListTemp.length != 0 + ? VitalSingChartAndDetials( + vitalList: vitalList, + name:projectViewModel.isArabic? chartInfo['nameAr']:chartInfo['name'], + title1: chartInfo['title1'], + title2:projectViewModel.isArabic?chartInfo['title2Ar']: chartInfo['title2'], + viewKey: chartInfo['viewKey']) + : Container(); + }).toList(), + ), + ); + } +} diff --git a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart new file mode 100644 index 00000000..43bc9f0a --- /dev/null +++ b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart @@ -0,0 +1,63 @@ +import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_wideget.dart'; +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:flutter/material.dart'; + +import 'package:charts_flutter/flutter.dart' as charts; + +import 'LineChartCurved.dart'; + +class VitalSingChartAndDetials extends StatelessWidget { + VitalSingChartAndDetials({ + Key key, + @required this.vitalList, + @required this.name, + @required this.viewKey, + @required this.title1, + @required this.title2, + }) : super(key: key); + + final List vitalList; + final String name; + final String viewKey; + final String title1; + final String title2; + List timeSeriesData = []; + + @override + Widget build(BuildContext context) { + generateData(); + return Column( + children: [ + AppExpandableNotifier( + isExpand: true, + headerWidget: LineChartCurved(title: name,timeSeries:timeSeriesData,indexes: timeSeriesData.length~/5.5,), + bodyWidget: VitalSignDetailsWidget( + vitalList: vitalList, + title1: title1, + title2: title2, + viewKey: viewKey, + ), + ), + ], + ); + } + + generateData() { + if (vitalList.length > 0) { + vitalList.reversed.toList().forEach( + (element) { + if( element.toJson()[viewKey]!=null && element.toJson()[viewKey]?.toInt()!=0) + timeSeriesData.add( + TimeSeriesSales2( + new DateTime(element.vitalSignDate.year, element.vitalSignDate.month, element.vitalSignDate.day), + element.toJson()[viewKey].toDouble(), + ), + ); + }, + ); + } + return timeSeriesData.reversed.toList(); + } +} diff --git a/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart new file mode 100644 index 00000000..84a2eb51 --- /dev/null +++ b/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart @@ -0,0 +1,85 @@ +import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_blood_pressurewideget.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_wideget.dart'; +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:flutter/material.dart'; + +import 'package:charts_flutter/flutter.dart' as charts; + +import 'LineChartCurved.dart'; +import 'LineChartCurvedBloodPressure.dart'; + +class VitalSingChartBloodPressure extends StatelessWidget { + VitalSingChartBloodPressure({ + Key key, + @required this.vitalList, + @required this.name, + @required this.viewKey1, + @required this.viewKey2, + @required this.title1, + @required this.title2, + @required this.title3, + }) : super(key: key); + + final List vitalList; + final String name; + final String viewKey1; + final String viewKey2; + final String title1; + final String title2; + final String title3; + List timeSeriesData1 = []; + List timeSeriesData2 = []; + + @override + Widget build(BuildContext context) { + generateData(); + return Column( + children: [ + AppExpandableNotifier( + isExpand: true, + headerWidget: LineChartCurvedBloodPressure( + title: name, + timeSeries1: timeSeriesData1, + timeSeries2: timeSeriesData2, + indexes: timeSeriesData1.length ~/ 5.5, + ), + bodyWidget: VitalSignBloodPressureWidget( + vitalList: vitalList, + title1: title1, + title2: title2, + title3: title3, + viewKey1: viewKey1, + viewKey2: viewKey2, + ), + ), + ], + ); + } + + generateData() { + if (vitalList.length > 0) { + vitalList.reversed.toList().forEach( + (element) { + if (element.toJson()[viewKey1]?.toInt() != 0) + timeSeriesData1.add( + TimeSeriesSales2( + new DateTime(element.vitalSignDate.year, + element.vitalSignDate.month, element.vitalSignDate.day), + element.toJson()[viewKey1].toDouble(), + ), + ); + if (element.toJson()[viewKey2]?.toInt() != 0) + timeSeriesData2.add( + TimeSeriesSales2( + new DateTime(element.vitalSignDate.year, + element.vitalSignDate.month, element.vitalSignDate.day), + element.toJson()[viewKey2].toDouble(), + ), + ); + }, + ); + } + } +} diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart new file mode 100644 index 00000000..c3a19917 --- /dev/null +++ b/lib/pages/paymentService/payment_service.dart @@ -0,0 +1,189 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/advance_payment_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/my_balance_page.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +class PaymentService extends StatelessWidget { + ToDoCountProviderModel model; + ProjectViewModel projectViewModel; + + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + model = Provider.of(context); + return AppScaffold( + isShowAppBar: true, + isShowDecPage: false, + appBarTitle: TranslationBase.of(context).paymentService, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: InkWell( + onTap: () => Navigator.push( + context, FadePage(page: AdvancePaymentPage())), + child: Container( + margin: EdgeInsets.all(5.0), + padding: EdgeInsets.all(9), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.0), + shape: BoxShape.rectangle), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).payment, + color: HexColor('#B61422'), + bold: true, + ), + Texts( + TranslationBase.of(context).paymentOnline, + fontSize: 14, + fontWeight: FontWeight.normal, + ), + SizedBox( + height: 12, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + child: Image.asset( + 'assets/images/online_payment_icon.png', + fit: BoxFit.fill, + height: 55, + width: double.infinity, + ), + ), + ], + ), + ), + ), + ), + if(!projectViewModel.havePrivilege(33)) + Expanded( + child: InkWell( + onTap: () => navigateToToDoPage(context), + child: Container( + margin: EdgeInsets.all(5.0), + padding: EdgeInsets.all(9), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.0), + shape: BoxShape.rectangle), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).onlineCheckIn, + color: HexColor('#B61422'), + bold: true, + ), + Texts( + TranslationBase.of(context).appointment, + fontSize: 14, + fontWeight: FontWeight.normal, + ), + SizedBox( + height: 12, + ), + Align( + alignment: !projectViewModel.isArabic + ? Alignment.centerRight + : Alignment.centerLeft, + child: Image.asset( + 'assets/images/device_icon.png', + height: 55, + ), + ), + ], + ), + ), + ), + ) + ], + ), + if(!projectViewModel.havePrivilege(33)) + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: InkWell( + onTap: () => Navigator.push( + context, FadePage(page: MyBalancePage())), + child: Container( + margin: EdgeInsets.all(5.0), + padding: EdgeInsets.all(9), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.0), + shape: BoxShape.rectangle), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'My Balances', + color: HexColor('#B61422'), + bold: true, + ), + Texts( + TranslationBase.of(context).payment, + fontSize: 14, + fontWeight: FontWeight.normal, + ), + SizedBox( + height: 12, + ), + Align( + alignment: !projectViewModel.isArabic + ? Alignment.centerRight + : Alignment.centerLeft, + child: Image.asset( + 'assets/images/new-design/check-in.png', + height: 55, + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Container(), + ) + ], + ), + ], + ), + ), + ), + ); + } + + navigateToToDoPage(BuildContext context) { + if (projectViewModel.isLogin) { + if (model.count != 0) { + Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); + } else { + AppToast.showErrorToast( + message: TranslationBase.of(context).upcomingEmpty); + } + } else { + Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); + } + } +} diff --git a/lib/pages/pharmacies/medicine_search_screen.dart b/lib/pages/pharmacies/medicine_search_screen.dart new file mode 100644 index 00000000..7a61dabe --- /dev/null +++ b/lib/pages/pharmacies/medicine_search_screen.dart @@ -0,0 +1,150 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacies_view_model.dart'; +import '../base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; +import 'package:diplomaticquarterapp/widgets/pharmacy/drug_item.dart'; +import 'package:diplomaticquarterapp/core/service/pharmacies_service.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/pharmacies_list_screen.dart'; + +class MedicineSearch extends StatelessWidget { + final textController = TextEditingController(); + final _formKey = GlobalKey(); + @override + Widget build(BuildContext context) { + return BaseView( + allowAny: true, + onModelReady: (model) => model.clearMedicineSearch(), + builder: (BuildContext context, PharmacyViewModel model, Widget child) => + AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).searchMedicine, + isShowAppBar: true, + isShowDecPage: false, + body: Container( + height: SizeConfig.screenHeight, + child: Column( + children: [ + Padding( + padding: EdgeInsets.only( + bottom: SizeConfig.heightMultiplier * 1, + right: SizeConfig.heightMultiplier * 2.5, + top: SizeConfig.heightMultiplier * 4, + left: SizeConfig.heightMultiplier * 2.5, + ), + child: Form( + key: _formKey, + child: TextFields( + hintText: + TranslationBase.of(context).searchMedicineHere, + inputAction: TextInputAction.search, + onSaved: (value) {}, + onSubmit: (value) { + searchMedicine(model, context); + }, + controller: textController, + validator: (value) { + if (value.isEmpty) { + return TranslationBase.of(context).pleaseEnterMedicineName; + }else if( value.length <4){ + return TranslationBase.of(context).searchItemError; + }else + return null; + }, + ), + ), + ), + Container( + margin: EdgeInsets.only( + bottom: SizeConfig.heightMultiplier * 0.0, + right: SizeConfig.heightMultiplier * 5, + top: SizeConfig.heightMultiplier * 1, + left: SizeConfig.heightMultiplier * 5, + ), + child: Wrap( + children: [ + Container( + child: Button( + loading: model.state == ViewState.BusyLocal, + label: TranslationBase.of(context).search, + onTap: () { + searchMedicine(model, context); + }), + width: 350.0, + ), + ], + ), + ), + if(model.pharmacy.isNotEmpty) + Container( + margin: EdgeInsets.only( + left: SizeConfig.heightMultiplier * 2), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).youCanFind+ + '${model.pharmacy == null ? '0' : model.pharmacy.length.toString()}'+ + TranslationBase.of(context).itemInSearch, + ), + ], + ), + ), + if (model.state == ViewState.ErrorLocal) + Container( + child: Texts(model.error), + ), + Expanded( + child: Container( + width: SizeConfig.screenWidth * 0.85, + //child: _getHospitals(model.pharmacy), + child: ListView.builder( + //physics: NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.pharmacy == null + ? 0 + : model.pharmacy.length, + itemBuilder: (BuildContext context, int index) { + return InkWell( + child: MedicineItemWidget( + label: model.pharmacy[index].itemDes, + url: model.pharmacy[index].productImage), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PharmaciesList( + medicineID: + model.pharmacy[index].itemID, + imageURL: model + .pharmacy[index].productImage, + medicineDescription: + model.pharmacy[index].itemDes), + ), + ); + }, + ); + }), + ), + ), + ], + ), + )), + ); + } + + searchMedicine(PharmacyViewModel model, BuildContext context) { + Utils.hideKeyboard(context); + if (_formKey.currentState.validate()) + model.getMedicine(name: textController.text); + } +} diff --git a/lib/pages/pharmacies/pharmacies_list_screen.dart b/lib/pages/pharmacies/pharmacies_list_screen.dart new file mode 100644 index 00000000..a35a77c9 --- /dev/null +++ b/lib/pages/pharmacies/pharmacies_list_screen.dart @@ -0,0 +1,193 @@ +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacies_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:maps_launcher/maps_launcher.dart'; +import 'package:url_launcher/url_launcher.dart'; + +import '../base/base_view.dart'; + +class PharmaciesList extends StatelessWidget { + final int medicineID; + final String imageURL; + final String medicineDescription; + + PharmaciesList({this.medicineID, this.imageURL, this.medicineDescription}); + + @override + Widget build(BuildContext context) { + return BaseView( + allowAny: true, + onModelReady: (model) => model.getPharmacies(id: medicineID), + builder: (BuildContext context, PharmacyViewModel model, Widget child) => + AppScaffold( + appBarTitle: TranslationBase.of(context).pharmaciesList, + baseViewModel: model, + isShowAppBar: true, + isShowDecPage: false, + body: Container( + height: SizeConfig.screenHeight, + child: ListView( + shrinkWrap: true, + scrollDirection: Axis.vertical, + physics: AlwaysScrollableScrollPhysics(), + children: [ + RoundedContainer( + child: Row( + children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: BorderRadius.all( + Radius.circular(7), + ), + child: Image.memory( + dataFromBase64String(imageURL), + height: SizeConfig.imageSizeMultiplier * 19, + width: SizeConfig.imageSizeMultiplier * 18, + fit: BoxFit.cover, + ), + ), + ), + Expanded( + flex: 3, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 6.8, vertical: 3.5), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Texts( + TranslationBase.of(context).description, + ), + Texts( + medicineDescription, + ), + Texts( + TranslationBase.of(context).price, + marginRight: 10, + marginLeft: 10, + marginBottom: 2.0, + ), + if (model.pharmacyList.length > 0) + Texts( + model.pharmacyList[0].price.toString(), + ), + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 2.0, + bottom: SizeConfig.widthMultiplier * 3.0, + right: SizeConfig.widthMultiplier * 4.0, + left: SizeConfig.widthMultiplier * 2.5, + ), + child: Align( + alignment: Alignment.center, + child: Texts( + TranslationBase.of(context).youCanFindItIn, + ), + ), + alignment: Alignment.topRight, + ), + Container( + width: SizeConfig.screenWidth * 1.0, + child: ListView.builder( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemCount: model.pharmacyList == null + ? 0 + : model.pharmacyList.length, + itemBuilder: (BuildContext context, int index) { + return RoundedContainer( + child: Row( + children: [ + Expanded( + child: ClipRRect( + borderRadius: + BorderRadius.all(Radius.circular(7)), + child: Image.network( + model.pharmacyList[index].imageLocation, + height: SizeConfig.imageSizeMultiplier * 13.0, + width: SizeConfig.imageSizeMultiplier * 11.0, + fit: BoxFit.cover, + ), + ), + ), + Expanded( + flex: 4, + child: Padding( + padding: EdgeInsets.all(9.0), + child: Texts( + model.pharmacyList[index].desLocation, + ), + ), + ), + Expanded( + flex: 2, + child: Wrap( + direction: Axis.horizontal, + alignment: WrapAlignment.end, + crossAxisAlignment: WrapCrossAlignment.end, + children: [ + Padding( + padding: EdgeInsets.all(6.0), + child: InkWell( + child: Icon( + Icons.phone, + color: Theme.of(context).primaryColor, + ), + onTap: () => launch("tel://" + + model.pharmacyList[index].phoneNumber), + ), + ), + Padding( + padding: EdgeInsets.all(6.0), + child: InkWell( + child: Icon( + Icons.local_pharmacy, + color: Theme.of(context).primaryColor, + ), + onTap: () { + MapsLauncher.launchCoordinates( + double.parse( + model.pharmacyList[index].latitude), + double.parse(model + .pharmacyList[index].longitude), + ); + }, + ), + ), + ], + ), + ) + ], + ), + ); + }, + ), + ), + ], + ), + ), + ), + ); + } + + Uint8List dataFromBase64String(String base64String) { + return base64Decode(base64String); + } +} diff --git a/lib/pages/pharmacies/screens/order-preview-page.dart b/lib/pages/pharmacies/screens/order-preview-page.dart new file mode 100644 index 00000000..d9646fcf --- /dev/null +++ b/lib/pages/pharmacies/screens/order-preview-page.dart @@ -0,0 +1,48 @@ +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/GestureIconButton.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class OrderPreviewPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, wi) => AppScaffold( + title: "Shopping Cart", + isShowAppBar: true, + isShowDecPage: false, + baseViewModel: model, + backgroundColor: Colors.white, + body: Container( + width: double.infinity, + child: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GestureIconButton( + TranslationBase.of(context).deleteAllItems, + Icon(Icons.delete_outline_sharp, color: Colors.grey.shade800,), + onTap: () => {}, + ), + const Divider( + color: Colors.grey, + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), + + ], + ), + ), + ), + ), + ), + ); + } +} + diff --git a/lib/pages/pharmacies/screens/pharmacy_module_page.dart b/lib/pages/pharmacies/screens/pharmacy_module_page.dart new file mode 100644 index 00000000..2ae2be65 --- /dev/null +++ b/lib/pages/pharmacies/screens/pharmacy_module_page.dart @@ -0,0 +1,245 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/screens/order-preview-page.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/widgets/BannerPager.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductTileItem.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/widgets/manufacturerItem.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; + +class PharmacyPage extends StatelessWidget { + + @override + Widget build(BuildContext context) { + return BaseView( + // onModelReady: (model) => model.getPharmacyHomeData(), + onModelReady: (model) => model.getPharmacyHomeData(), + builder: (_, model, wi) => AppScaffold( + title: "", + isShowAppBar: true, + isShowDecPage: false, + baseViewModel: model, + backgroundColor: Colors.white, + body: Container( + width: double.infinity, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BannerPager(model), + GridViewButtons(), + /*BannerPager(model.getBannerImagesUrl()),*/ + Container( + margin: EdgeInsets.fromLTRB(10, 0, 10, 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + TranslationBase.of(context).shopByBrands, + bold: true, + ), + BorderedButton( + TranslationBase.of(context).viewAll, + hasBorder: true, + vPadding: 6, + borderColor: Colors.green, + color: Colors.green, + handler: () {}, + ), + ], + ), + ), + Container( + height: 60, + child: ListView.builder( + itemBuilder: (ctx, i) => + ManufacturerItem(model.manufacturerList[i]), + scrollDirection: Axis.horizontal, + itemCount: model.manufacturerList.length, + ), + ), + Container( + margin: EdgeInsets.fromLTRB(10, 10, 10, 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + TranslationBase.of(context).recentlyViewed, + bold: true, + ), + BorderedButton( + TranslationBase.of(context).viewAll, + hasBorder: true, + vPadding: 6, + borderColor: Colors.green, + color: Colors.green, + handler: () {}, + ), + ], + ), + ), + Container( + height: model.lastVisitedProducts.length > 0 ? MediaQuery.of(context).size.height / 4 : 0, + child: ListView.builder( + itemBuilder: (ctx, i) => + ProductTileItem(model.lastVisitedProducts[i]), + scrollDirection: Axis.horizontal, + itemCount: model.lastVisitedProducts.length, + ), + ), + Container( + margin: EdgeInsets.fromLTRB(10, 10, 10, 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + TranslationBase.of(context).bestSellers, + bold: true, + ), + BorderedButton( + TranslationBase.of(context).viewAll, + hasBorder: true, + borderColor: Colors.green, + color: Colors.green, + vPadding: 6, + handler: () {}, + ), + ], + ), + ), + Container( + height: MediaQuery.of(context).size.height / 4, + child: ListView.builder( + itemBuilder: (ctx, i) => + ProductTileItem(model.bestSellerProduct[i]), + scrollDirection: Axis.horizontal, + itemCount: model.bestSellerProduct.length, + ), + ), + ], + ), + ), + ), + ), + ); + } +} + +class GridViewButtons extends StatelessWidget { + @override + Widget build(BuildContext context) { + final gridHeight = (MediaQuery.of(context).size.width * 0.3) * 1.8; + return Container( + child: SizedBox( + height: gridHeight, + child: GridView.count( + childAspectRatio: 2.2, + crossAxisSpacing: 10, + mainAxisSpacing: 10, + controller: new ScrollController(keepScrollOffset: false), + shrinkWrap: true, + padding: const EdgeInsets.all(4.0), + crossAxisCount: 2, + children: [ + DashboardItem( + imageName: 'pharmacy_module/bg_1.png', + hasColorFilter: false, + opacity: 0.8, + child: GridViewCard( + TranslationBase.of(context).offersAndPromotions, + 'assets/images/pharmacy_module/offer_icon.png', + () { + Navigator.push(context, FadePage(page: OrderPreviewPage())); + }), + ), + DashboardItem( + imageName: 'pharmacy_module/bg_2.png', + opacity: 0, + hasColorFilter: false, + child: GridViewCard(TranslationBase.of(context).medicationRefill, + 'assets/images/pharmacy_module/medication_icon.png', () {}), + ), + DashboardItem( + imageName: 'pharmacy_module/bg_3.png', + opacity: 0, + hasColorFilter: false, + child: GridViewCard(TranslationBase.of(context).myPrescriptions, + 'assets/images/pharmacy_module/prescription_icon.png', () {}), + ), + DashboardItem( + imageName: 'pharmacy_module/bg_4.png', + opacity: 0, + hasColorFilter: false, + child: GridViewCard( + TranslationBase.of(context).searchAndScanMedication, + 'assets/images/pharmacy_module/search_scan_icon.png', + () {}), + ), + ], + ), + ), + ); + } +} + +class GridViewCard extends StatelessWidget { + final String text; + final String cardImage; + final Function handler; + + GridViewCard(this.text, this.cardImage, this.handler); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.all(4.0), + child: Container( + child: Row( + children: [ + Expanded( + flex: 2, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 2, + child: Padding( + padding: const EdgeInsets.all(6), + child: Texts( + text, + color: Colors.white, + fontSize: SizeConfig.textMultiplier * 1.5, + ), + ), + ), + Expanded( + child: BorderedButton( + TranslationBase.of(context).viewAll, + handler: handler, + ), + ), + ], + ), + ), + Expanded( + child: Align( + alignment: Alignment.centerRight, + child: Image.asset( + cardImage, + fit: BoxFit.cover, + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/pharmacies/screens/phramacy-product-detail-page.dart b/lib/pages/pharmacies/screens/phramacy-product-detail-page.dart new file mode 100644 index 00000000..afbd2b06 --- /dev/null +++ b/lib/pages/pharmacies/screens/phramacy-product-detail-page.dart @@ -0,0 +1,19 @@ +import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class ProductDetailScreen extends StatelessWidget { + final PharmacyProduct product; + + ProductDetailScreen(this.product); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: Center( + child: Texts("id = ${product.id}"), + ), + ); + } +} diff --git a/lib/pages/pharmacies/widgets/BannerPager.dart b/lib/pages/pharmacies/widgets/BannerPager.dart new file mode 100644 index 00000000..989c7557 --- /dev/null +++ b/lib/pages/pharmacies/widgets/BannerPager.dart @@ -0,0 +1,88 @@ +import 'package:carousel_slider/carousel_slider.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; + +class BannerPager extends StatefulWidget { + final PharmacyModuleViewModel _model; + + BannerPager(this._model); + + @override + _BannerPagerState createState() => _BannerPagerState(); +} + +class _BannerPagerState extends State { + int _current = 0; + + @override + Widget build(BuildContext context) { + return Container( + child: Column( + children: [ + CarouselSlider( + options: CarouselOptions( + aspectRatio: 7 / 2, + enlargeCenterPage: true, + enableInfiniteScroll: false, + initialPage: 0, + autoPlay: true, + autoPlayInterval: Duration(seconds: 3), + autoPlayAnimationDuration: Duration(milliseconds: 800), + autoPlayCurve: Curves.decelerate, + onPageChanged: (index, reason) { + setState(() { + _current = index; + }); + }, + ), + items: widget._model + .getBannerImagesUrl() + .mapIndexed( + (item, index) => Container( + margin: EdgeInsets.symmetric(horizontal: 1.0), + child: ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + child: Center( + child: index == 0 + ? Image.asset( + item, + fit: BoxFit.cover, + ) + : Image.network( + item, + fit: BoxFit.cover, + ), + ), + ), + ), + ) + .toList(), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: widget._model + .getBannerImagesUrl() + .mapIndexed( + (item, index) => Container( + width: 12.0, + height: 4.0, + margin: + EdgeInsets.symmetric(vertical: 0.0, horizontal: 2.0), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: _current == index + ? Color.fromRGBO(0, 250, 0, 0.9) + : Color.fromRGBO(0, 0, 0, 0.4), + ), + ), + ) + .toList(), + ), + ) + ], + )); + } +} diff --git a/lib/pages/pharmacies/widgets/ProductOrderItem.dart b/lib/pages/pharmacies/widgets/ProductOrderItem.dart new file mode 100644 index 00000000..81b6068a --- /dev/null +++ b/lib/pages/pharmacies/widgets/ProductOrderItem.dart @@ -0,0 +1,13 @@ +import 'package:flutter/material.dart'; + +class ProductOrderItem extends StatelessWidget { + @override + Widget build(BuildContext context) { + return ListTile( + leading: Icon( + Icons.delete_outline_sharp, + color: Colors.grey.shade800, + ), + ); + } +} diff --git a/lib/pages/pharmacies/widgets/ProductTileItem.dart b/lib/pages/pharmacies/widgets/ProductTileItem.dart new file mode 100644 index 00000000..62493387 --- /dev/null +++ b/lib/pages/pharmacies/widgets/ProductTileItem.dart @@ -0,0 +1,146 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/screens/phramacy-product-detail-page.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class ProductTileItem extends StatelessWidget { + final AppSharedPreferences sharedPref = AppSharedPreferences(); + final PharmacyProduct item; + + ProductTileItem(this.item); + + void productOnClick(BuildContext ctx) { + _saveLastVisitProducts(); + Navigator.push(ctx, FadePage(page: ProductDetailScreen(item))); + } + + void _saveLastVisitProducts() async { + String lastVisited = ""; + bool isIdExist = false; + if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) != + null) { + lastVisited = + await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS); + lastVisited.split(",").forEach((id) { + if (id == item.id) { + isIdExist = true; + } + }); + } + if (!isIdExist) { + if (lastVisited == "") { + // it means there is no lastVisited yet + lastVisited = "${item.id}"; + } else { + // there is lastVisited id's and this product id is not found + lastVisited += ",${item.id}"; + } + sharedPref.setString(PHARMACY_LAST_VISITED_PRODUCTS, lastVisited); + } + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectProvider = Provider.of(context); + return InkWell( + onTap: () => productOnClick(context), + splashColor: Theme.of(context).primaryColor, + child: Card( + elevation: 2, + shape: Border(right: BorderSide(color: Colors.grey.shade300, width: 1)), + margin: EdgeInsets.symmetric( + horizontal: 8, + vertical: 4, + ), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 0), + width: MediaQuery.of(context).size.width / 3, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack( + children: [ + Container( + margin: EdgeInsets.fromLTRB(0, 16, 0, 0), + alignment: Alignment.center, + child: Image.network( + item.images[0].src, + fit: BoxFit.cover, + height: 80, + ), + ), + Container( + width: item.rxMessage != null + ? MediaQuery.of(context).size.width / 5 + : 0, + padding: EdgeInsets.all(4), + decoration: BoxDecoration( + color: Color(0xffb23838), + borderRadius: + BorderRadius.only(topLeft: Radius.circular(6)), + ), + child: Texts( + item.rxMessage != null ? item.rxMessage : "", + color: Colors.white, + regular: true, + fontSize: 10, + fontWeight: FontWeight.w400, + ), + ) + ], + ), + Container( + margin: EdgeInsets.symmetric( + horizontal: 6, + vertical: 0, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + projectProvider.isArabic ? item.name : item.namen, + regular: true, + fontSize: 12, + fontWeight: FontWeight.w400, + ), + Padding( + padding: const EdgeInsets.only(top: 4, bottom: 4), + child: Texts( + "SAR ${item.price}", + bold: true, + fontSize: 14, + ), + ), + Row( + children: [ + StarRating( + totalAverage: item.approvedTotalReviews > 0 + ? (item.approvedRatingSum.toDouble() / + item.approvedTotalReviews.toDouble()) + .toDouble() + : 0, + forceStars: true), + Texts( + "(${item.approvedTotalReviews})", + regular: true, + fontSize: 10, + fontWeight: FontWeight.w400, + ) + ], + ), + ], + ), + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/pharmacies/widgets/manufacturerItem.dart b/lib/pages/pharmacies/widgets/manufacturerItem.dart new file mode 100644 index 00000000..7ffa3d89 --- /dev/null +++ b/lib/pages/pharmacies/widgets/manufacturerItem.dart @@ -0,0 +1,35 @@ +import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart'; +import 'package:flutter/material.dart'; + +class ManufacturerItem extends StatelessWidget { + final Manufacturer item; + + ManufacturerItem(this.item); + + @override + Widget build(BuildContext context) { + return Card( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), + margin: EdgeInsets.symmetric( + horizontal: 8, + vertical: 4, + ), + child: Container( + decoration: BoxDecoration( + border: Border( + right: BorderSide(color: Colors.grey.shade300, width: 1), + bottom: BorderSide(color: Colors.grey.shade300, width: 1), + left: BorderSide(color: Colors.grey.shade300, width: 1), + top: BorderSide(color: Colors.grey.shade300, width: 1)), + ), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 8), + child: Image.network( + item.image.src, + fit: BoxFit.cover, + ), + ), + ), + ); + } +} diff --git a/lib/pages/rateAppointment/rate_appointment_clinic.dart b/lib/pages/rateAppointment/rate_appointment_clinic.dart new file mode 100644 index 00000000..f5ec34c3 --- /dev/null +++ b/lib/pages/rateAppointment/rate_appointment_clinic.dart @@ -0,0 +1,241 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/rate/appointment_details.dart'; +import 'package:diplomaticquarterapp/core/model/rate/appoitment_rated.dart'; +import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; +import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class RateAppointmentClinic extends StatefulWidget { + final AppointmentDetails appointmentDetails; + final String doctorNote; + final int doctorRate; + + RateAppointmentClinic( + {this.appointmentDetails, this.doctorRate, this.doctorNote}); + + @override + _RateAppointmentClinicState createState() => _RateAppointmentClinicState(); +} + +class _RateAppointmentClinicState extends State { + final formKey = GlobalKey(); + String note = ""; + int rating = 0; + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + body: Scaffold( + backgroundColor: Colors.grey[200], + appBar: AppBar( + elevation: 0, + textTheme: TextTheme( + headline6: + TextStyle(color: Colors.white, fontWeight: FontWeight.bold), + ), + title: Text('Rate'), + leading: Builder( + builder: (BuildContext context) { + return IconButton( + icon: Icon(Icons.menu), + color: Colors.white, + onPressed: () => Scaffold.of(context).openDrawer(), + ); + }, + ), + centerTitle: true, + ), + drawer: SafeArea(child: AppDrawer()), + body: FractionallySizedBox( + widthFactor: 1, + child: SingleChildScrollView( + child: Container( + padding: EdgeInsets.all(12), + child: Column( + children: [ + SizedBox( + height: 25, + ), + Texts( + TranslationBase.of(context).lastAppointment, + bold: true, + color: Colors.black, + ), + SizedBox( + height: 25, + ), + Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + ), + child: Column( + children: [ + SizedBox( + height: 8, + ), + LargeAvatar( + name: model.appointmentDetails.clinicName, + width: 110, + height: 110, + ), + SizedBox( + height: 22, + ), + Texts( + model.appointmentDetails.projectName, + bold: true, + ), + SizedBox( + height: 4, + ), + Texts( + model.appointmentDetails.clinicName, + bold: true, + ), + SizedBox( + height: 8, + ) + ], + ), + ), + SizedBox( + height: 12, + ), + Center( + child: Texts( + TranslationBase.of(context).rateClinic, + textAlign: TextAlign.center, + )), + SizedBox( + height: 12, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ...List.generate( + 5, + (index) => AnimatedSwitcher( + duration: Duration(milliseconds: 1000), + switchInCurve: Curves.elasticOut, + switchOutCurve: Curves.elasticIn, + transitionBuilder: + (Widget child, Animation animation) { + return ScaleTransition( + child: child, scale: animation); + }, + child: Container( + key: ValueKey(rating), + child: IconButton( + iconSize: 45.0, + onPressed: () { + setState(() { + rating = index + 1; + }); + }, + color: rating >= (index + 1) + ? Color.fromRGBO(255, 186, 0, 1.0) + : Colors.grey[400], + // Theme.of(context).hintColor, + icon: Icon(rating >= (index + 1) + ? EvaIcons.star + : EvaIcons.star)), + ), + ), + ) + ], + ), + SizedBox(height: 12), + SizedBox( + height: 12, + ), + ], + ), + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.15, + width: double.infinity, + color: Colors.grey[200], + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + onTap: () async { + if (rating > 0) { + model + .sendAppointmentRate( + rating, + widget.appointmentDetails.appointmentNo, + widget.appointmentDetails.projectID, + widget.appointmentDetails.doctorID, + widget.appointmentDetails.clinicID, + note) + .then( + (value) => { + Navigator.pushReplacement( + context, + FadePage( + page: LandingPage(), + ), + ) + }, + ); + } else { + AppToast.showErrorToast( + message: 'please rate the clinic'); + } + }, + label: TranslationBase.of(context).submit, + disabled: model.state == ViewState.BusyLocal, + loading: model.state == ViewState.BusyLocal, + textColor: Theme.of(context).backgroundColor), + ), + SizedBox( + height: 12, + ), + InkWell( + onTap: () { + Navigator.pushReplacement( + context, + FadePage( + page: LandingPage(), + ), + ); + }, + child: Texts( + TranslationBase.of(context).later, + decoration: TextDecoration.underline, + color: HexColor('#151DFE'), + fontSize: 18, + ), + ) + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart new file mode 100644 index 00000000..b3349704 --- /dev/null +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -0,0 +1,244 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/rate/appointment_details.dart'; +import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_clinic.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; +import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class RateAppointmentDoctor extends StatefulWidget { + @override + _RateAppointmentDoctorState createState() => _RateAppointmentDoctorState(); +} + +class _RateAppointmentDoctorState extends State { + final formKey = GlobalKey(); + String note = ""; + int rating = 0; + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + body: Scaffold( + backgroundColor: Colors.grey[200], + appBar: AppBar( + elevation: 0, + textTheme: TextTheme( + headline6: + TextStyle(color: Colors.white, fontWeight: FontWeight.bold), + ), + title: Text(TranslationBase.of(context).rate), + leading: Builder( + builder: (BuildContext context) { + return IconButton( + icon: Icon(Icons.menu), + color: Colors.white, + onPressed: () => Scaffold.of(context).openDrawer(), + ); + }, + ), + centerTitle: true, + ), + drawer: SafeArea(child: AppDrawer()), + body: FractionallySizedBox( + widthFactor: 1, + child: SingleChildScrollView( + child: Container( + padding: EdgeInsets.all(12), + child: Column( + children: [ + SizedBox( + height: 25, //5598 + ), + Texts( + TranslationBase.of(context).lastVisit, + bold: true, + color: Colors.black, + ), + SizedBox( + height: 25, + ), + Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + ), + child: Column( + children: [ + SizedBox( + height: 8, + ), + LargeAvatar( + name: model.appointmentDetails.doctorName, + url: model.appointmentDetails.doctorImageURL, + width: 110, + height: 110, + ), + SizedBox( + height: 22, + ), + Texts( + TranslationBase.of(context).dr + " " + model.appointmentDetails.doctorName, + bold: true, + ), + SizedBox( + height: 4, + ), + Texts( + model.appointmentDetails.clinicName != null ? model.appointmentDetails.clinicName : "", + bold: true, + ), + SizedBox( + height: 8, + ) + ], + ), + ), + SizedBox( + height: 12, + ), + Center( + child: Texts( + TranslationBase.of(context).tapTitle, + textAlign: TextAlign.center, + )), + SizedBox( + height: 12, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ...List.generate( + 5, + (index) => AnimatedSwitcher( + duration: Duration(milliseconds: 1000), + switchInCurve: Curves.elasticOut, + switchOutCurve: Curves.elasticIn, + transitionBuilder: + (Widget child, Animation animation) { + return ScaleTransition( + child: child, scale: animation); + }, + child: Container( + key: ValueKey(rating), + child: IconButton( + iconSize: 45.0, + onPressed: () { + setState(() { + rating = index + 1; + }); + }, + color: rating >= (index + 1) + ? Color.fromRGBO(255, 186, 0, 1.0) + : Colors.grey[400], + // Theme.of(context).hintColor, + icon: Icon(rating >= (index + 1) + ? EvaIcons.star + : EvaIcons.star)), + ), + ), + ) + ], + ), + SizedBox( + height: 12, + ), + Form( + key: formKey, + child: TextFields( + hintText: TranslationBase.of(context).notes, + minLines: 4, + maxLines: 4, + // validator: (value) { + // if (value.isEmpty) + // return 'Please enter your note'; + // else if (rating == 0) return 'Rating cannot be \"0\"'; + // return null; + // }, + onChanged: (value) { + setState(() { + note = value; + }); + }, + ), + ), + SizedBox( + height: 12, + ), + Container( + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + onTap: () async { + final form = formKey.currentState; + if (form.validate() && rating>0 ) { + form.save(); + Navigator.push( + context, + FadePage( + page: RateAppointmentClinic( + appointmentDetails: + model.appointmentDetails, + doctorNote: note, + doctorRate: rating, + ), + ), + ); + } + }, + label: TranslationBase.of(context).next, + disabled: model.state == ViewState.BusyLocal|| rating==0, + loading: model.state == ViewState.BusyLocal, + textColor: Theme.of(context).backgroundColor), + ), + SizedBox( + height: 12, + ), + InkWell( + onTap: () { + Navigator.pushReplacement( + context, + FadePage( + page: LandingPage(), + ), + ); + }, + child: Texts( + TranslationBase.of(context).later, + decoration: TextDecoration.underline, + color: HexColor('#151DFE'), + fontSize: 18, + ), + ) + ], + ), + ) + ], + ), + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/settings/general_setting.dart b/lib/pages/settings/general_setting.dart new file mode 100644 index 00000000..7085150a --- /dev/null +++ b/lib/pages/settings/general_setting.dart @@ -0,0 +1,434 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/services/permission/permission_service.dart'; +import 'package:diplomaticquarterapp/theme/theme_notifier.dart'; +import 'package:diplomaticquarterapp/theme/theme_value.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:screen/screen.dart'; + +class GeneralSettings extends StatefulWidget { + @override + _GeneralSettings createState() => _GeneralSettings(); +} + +class _GeneralSettings extends State + with TickerProviderStateMixin { + var themeNotifier; + int blindValue = 0; + bool vibration =false; + bool accsibility =false; + bool camera =false; + bool location =false; + var sharedPref = new AppSharedPreferences(); + var permission = new PermissionService(); + var mediaQueryData; + @override + void initState() { + getValues(); + super.initState(); + } + + + Widget build(BuildContext context) { + mediaQueryData = MediaQuery.of(context); + themeNotifier = Provider.of(context); + return Container( + child: ListView(scrollDirection: Axis.vertical, children: [ + Container( + padding: EdgeInsets.all(10), + child: AppText( + TranslationBase.of(context).modes, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + ), + Container( + color: Colors.white, + padding: EdgeInsets.all(10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(TranslationBase.of(context).vibration), + Switch( + value: vibration, + onChanged: (value) { + setState(() { + vibration = value; + + }); + setVibration(value); + }, + activeTrackColor: Colors.lightGreenAccent, + activeColor: Colors.green, + ) + ], + )), + Container( + color: Colors.white, + padding: EdgeInsets.all(10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(TranslationBase.of(context).accessibility), + Switch( + value: accsibility, + onChanged: (value) { + setState(() { + accsibility = value; + }); + //setAccisibility(value); + }, + activeTrackColor: Colors.lightGreenAccent, + activeColor: Colors.green, + ) + ], + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + TranslationBase.of(context).blindMode, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + ), + new Container( + color: Colors.white, + padding: EdgeInsets.all(8.0), + child: new Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + new Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + new Text( + TranslationBase.of(context).offTheme, + style: new TextStyle(fontSize: 16.0), + ), + Radio( + value: 0, + groupValue: blindValue, + onChanged: (value) { + setState(() => {this.blindValue = value}); + setTheme(value); + }, + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + new Text( + TranslationBase.of(context).invertTheme, + style: new TextStyle( + fontSize: 16.0, + ), + ), + new Radio( + value: 1, + groupValue: blindValue, + onChanged: (value) { + setState(() => {this.blindValue = value}); + setTheme(value); + }, + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + new Text( + TranslationBase.of(context).dimTheme, + style: new TextStyle(fontSize: 16.0), + ), + new Radio( + value: 2, + groupValue: blindValue, + onChanged: (value) { + setState(() => {this.blindValue = value}); + setTheme(value); + }, + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + new Text( + TranslationBase.of(context).bwTheme, + style: new TextStyle(fontSize: 16.0), + ), + new Radio( + value: 3, + groupValue: blindValue, + onChanged: (value) { + setState(() => {this.blindValue = value}); + + setTheme(value); + }, + ), + ], + ), + ], + ) + ])), + Container( + padding: EdgeInsets.all(10), + child: AppText( + TranslationBase.of(context).permissions, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + ), + Container( + color: Colors.white, + padding: EdgeInsets.all(10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(TranslationBase.of(context).cameraPermission), + Switch( + value: camera, + onChanged: (value) { + setState(() { + camera = value; + }); + }, + activeTrackColor: Colors.lightGreenAccent, + activeColor: Colors.green, + ) + ], + )), + Container( + color: Colors.white, + padding: EdgeInsets.all(10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(TranslationBase.of(context).locationPermission), + Switch( + value: location, + onChanged: (value) { + setState(() { + location = value; + }); + }, + activeTrackColor: Colors.lightGreenAccent, + activeColor: Colors.green, + ) + ], + )) + ])); + } + + setTheme(value) async{ + switch (value) { + case 0: + { + themeNotifier.setTheme(await getTheme(value)); + Screen.setBrightness(1.0); + } + break; + case 1: + { + themeNotifier.setTheme(ThemeData( + fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'ar' ? 'Cairo' : 'WorkSans', + primarySwatch: Colors.grey, + visualDensity: VisualDensity.adaptivePlatformDensity, + brightness: Brightness.light, + pageTransitionsTheme: const PageTransitionsTheme( + builders: { + TargetPlatform.android: ZoomPageTransitionsBuilder(), + TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), + }, + ), + hintColor: Colors.grey[400], + cardColor: Colors.black, + buttonColor: Colors.grey[400], + disabledColor: Colors.grey[300], + errorColor: Color.fromRGBO(235, 80, 60, 1.0), + scaffoldBackgroundColor: Colors.grey, + textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), + textSelectionHandleColor: Colors.grey, + canvasColor: Colors.white, + backgroundColor: Colors.grey, + highlightColor: Colors.grey[100].withOpacity(0.4), + splashColor: Colors.transparent, + primaryColor: Colors.grey, + bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), + cursorColor: Colors.grey, + + iconTheme: IconThemeData(), + appBarTheme: AppBarTheme( + color: Colors.grey, + brightness: Brightness.dark, + elevation: 10.0, + actionsIconTheme: IconThemeData( + color: Colors.grey, + ), + ), + )); + Screen.setBrightness(1.0); + } + break; + case 2: + themeNotifier.setTheme(await getTheme(value)); + Screen.setBrightness(0.01); + break; + case 3: + { + themeNotifier.setTheme(await getTheme(value)); + Screen.setBrightness(1.0); + } + break; + default: + { + themeNotifier.setTheme(await getTheme(value)); + Screen.setBrightness(1.0); + } + break; + } + //permission.setTheme(value); + + } + setVibration(value){ + permission.setVibrationPermission(value); + } + + setAccisibility(){ + if(!accsibility){ + + } + // permission.setVibrationPermission(value); + } + getValues() async{ + blindValue= permission.isThemeEnabled() == null ? 0 : permission.isThemeEnabled(); + vibration = permission.isVibrationEnabled() ==null ? false : permission.isVibrationEnabled(); + accsibility =mediaQueryData.accessibleNavigation; + } + getTheme(value) async{ + if(value ==1){ + return ThemeData( + fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'ar' ? 'Cairo' : 'WorkSans', + primarySwatch: Colors.grey, + visualDensity: VisualDensity.adaptivePlatformDensity, + brightness: Brightness.light, + pageTransitionsTheme: const PageTransitionsTheme( + builders: { + TargetPlatform.android: ZoomPageTransitionsBuilder(), + TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), + }, + ), + hintColor: Colors.grey[400], + cardColor: Colors.black, + buttonColor: Colors.grey[400], + disabledColor: Colors.grey[300], + errorColor: Color.fromRGBO(235, 80, 60, 1.0), + scaffoldBackgroundColor: Colors.grey, + textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), + textSelectionHandleColor: Colors.grey, + canvasColor: Colors.white, + backgroundColor: Colors.grey, + highlightColor: Colors.grey[100].withOpacity(0.4), + splashColor: Colors.transparent, + primaryColor: Colors.grey, + bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), + cursorColor: Colors.grey, + + iconTheme: IconThemeData(), + appBarTheme: AppBarTheme( + color: Colors.grey, + brightness: Brightness.dark, + elevation: 10.0, + actionsIconTheme: IconThemeData( + color: Colors.grey, + ), + ), + ); + + }else if(value ==3){ + return ThemeData( + fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'ar' ? 'Cairo' : 'WorkSans', + primarySwatch: Colors.grey, + visualDensity: VisualDensity.adaptivePlatformDensity, + brightness: Brightness.light, + pageTransitionsTheme: const PageTransitionsTheme( + builders: { + TargetPlatform.android: ZoomPageTransitionsBuilder(), + TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), + }, + ), + hintColor: Colors.grey[400], + cardColor: Colors.black, + buttonColor: Colors.grey[400], + disabledColor: Colors.grey[300], + errorColor: Color.fromRGBO(235, 80, 60, 1.0), + scaffoldBackgroundColor: Colors.grey, + textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), + textSelectionHandleColor: Colors.grey, + canvasColor: Colors.white, + backgroundColor: Colors.grey, + highlightColor: Colors.grey[100].withOpacity(0.4), + splashColor: Colors.transparent, + primaryColor: Colors.grey, + bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), + cursorColor: Colors.grey, + + iconTheme: IconThemeData(), + appBarTheme: AppBarTheme( + color: Colors.black45, + brightness: Brightness.dark, + elevation: 10.0, + actionsIconTheme: IconThemeData( + color: Colors.grey, + ), + ), + ); + + }else { + return ThemeData( + fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'ar' ? 'Cairo' : 'WorkSans', + primarySwatch: Colors.blue, + visualDensity: VisualDensity.adaptivePlatformDensity, + brightness: Brightness.light, + pageTransitionsTheme: const PageTransitionsTheme( + builders: { + TargetPlatform.android: ZoomPageTransitionsBuilder(), + TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), + }, + ), + hintColor: Colors.grey[400], + disabledColor: Colors.grey[300], + errorColor: Color.fromRGBO(235, 80, 60, 1.0), + scaffoldBackgroundColor: Color(0xffEEEEEE), + textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), + textSelectionHandleColor: Colors.grey, + canvasColor: Colors.white, + backgroundColor: Colors.white, + highlightColor: Colors.grey[100].withOpacity(0.4), + splashColor: Colors.transparent, + primaryColor: Color(0xff40ACC9), + bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), + cursorColor: Colors.grey, + cardColor: Colors.white, + iconTheme: IconThemeData(), + appBarTheme: AppBarTheme( + color: Color(0xff40ACC9), + brightness: Brightness.dark, + elevation: 10.0, + actionsIconTheme: IconThemeData( + color: Color(0xff40ACC9), + ), + ), + ); + + } + } +} diff --git a/lib/pages/settings/profile_setting.dart b/lib/pages/settings/profile_setting.dart new file mode 100644 index 00000000..dcfdb8a8 --- /dev/null +++ b/lib/pages/settings/profile_setting.dart @@ -0,0 +1,263 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:provider/provider.dart'; + +class ProfileSettings extends StatefulWidget { + + @override + _ProfileSettings createState() => _ProfileSettings(); +} + +class _ProfileSettings extends State + with TickerProviderStateMixin { + bool smsAlert = true; + bool emailAlert = true; + int language = 1; + final authService = new AuthProvider(); + TextEditingController emergencyContact = new TextEditingController(); + TextEditingController emailController = new TextEditingController(); + TextEditingController emergencyContactName = new TextEditingController(); + @override + void initState() { + Future.delayed(new Duration(seconds: 0), () { + ProjectViewModel projectProvider; + projectProvider = Provider.of(context); + if (projectProvider.isLogin == true) getSettings(context); + }); + super.initState(); + } + + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => {}, + builder: (_, model, wi) => Container( + child: model.user != null + ? ListView(scrollDirection: Axis.vertical, children: [ + Container( + padding: EdgeInsets.all(15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + TranslationBase.of(context).fileNo, + color: Colors.black, + ), + AppText( + model.user.patientID.toString(), + color: Colors.black, + ), + ], + ), + ), + SizedBox( + height: 1, + width: MediaQuery.of(context).size.width, + child: Container( + color: Colors.grey[300], + ), + ), + Padding( + child: AppText( + TranslationBase.of(context).languageSetting, + fontWeight: FontWeight.bold), + padding: EdgeInsets.all(10), + ), + Container( + color: Colors.white, + padding: EdgeInsets.only( + top: 0, left: 10, right: 10, bottom: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(TranslationBase.of(context).english), + new Radio( + value: 2, + groupValue: language, + onChanged: (value) { + setState(() { + language = value; + }); + }, + ) + ], + )), + Container( + color: Colors.white, + padding: EdgeInsets.only( + top: 0, left: 10, right: 10, bottom: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(TranslationBase.of(context).arabic), + new Radio( + value: 1, + groupValue: language, + onChanged: (value) { + setState(() { + language = value; + }); + }, + ) + ], + )), + Padding( + child: AppText(TranslationBase.of(context).alert), + padding: EdgeInsets.all(10), + ), + Container( + color: Colors.white, + padding: EdgeInsets.only( + top: 0, left: 10, right: 10, bottom: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(TranslationBase.of(context).emailAlert), + Switch( + value: emailAlert, + onChanged: (value) { + setState(() { + emailAlert = value; + }); + }, + activeTrackColor: Colors.lightGreenAccent, + activeColor: Colors.green, + ) + ], + )), + Container( + color: Colors.white, + padding: EdgeInsets.only( + top: 0, left: 10, right: 10, bottom: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(TranslationBase.of(context).smsAlert), + Switch( + value: smsAlert, + onChanged: (value) { + setState(() { + smsAlert = value; + }); + }, + activeTrackColor: Colors.lightGreenAccent, + activeColor: Colors.green, + ) + ], + )), + Padding( + child: AppText(TranslationBase.of(context).contactInfo), + padding: EdgeInsets.all(10), + ), + Container( + color: Colors.white, + padding: EdgeInsets.only( + top: 0, left: 10, right: 10, bottom: 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(TranslationBase.of(context).email), + TextField( + controller: emailController, + decoration: InputDecoration( + suffixIcon: Icon(Icons.edit), + )) + ], + )), + Container( + color: Colors.white, + padding: EdgeInsets.only( + top: 0, left: 10, right: 10, bottom: 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(TranslationBase.of(context).emergencyName), + TextField( + controller: emergencyContactName, + decoration: InputDecoration( + suffixIcon: Icon(Icons.edit), + )) + ], + )), + Container( + color: Colors.white, + padding: EdgeInsets.only( + top: 0, left: 10, right: 10, bottom: 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).emergencyContact), + TextField( + controller: emergencyContact, + decoration: InputDecoration( + suffixIcon: Icon(Icons.edit), + ), + ) + ], + )), + Container( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).save, + () { + saveSettings(); + }, + )), + ], + )) + ]) + : Center( + child: + AppText(TranslationBase.of(context).loginToUseService), + ))); + } + + getSettings(context) { + GifLoaderDialogUtils.showMyDialog(context); + authService.getSettings().then((result) => { + GifLoaderDialogUtils.hideDialog(context), + setValue(result["PateintInfoForUpdateList"][0]) + }); + } + + setValue(value) { + setState(() { + this.language = int.parse(value["PreferredLanguage"]); + this.emailAlert = value["IsEmailAlertRequired"]; + this.smsAlert = value["IsSMSAlertRequired"]; + this.emailController.text = value["EmailAddress"]; + this.emergencyContact.text = value["EmergencyContactNo"]; + this.emergencyContactName.text = value["EmergencyContactName"]; + }); + } + + saveSettings() { + GifLoaderDialogUtils.showMyDialog(context); + Map request = {}; + request["EmailAddress"] = this.emailController.text; + request["EmergencyContactName"] = this.emergencyContactName.text; + request["EmergencyContactNo"] = this.emergencyContact.text; + request["IsEmailAlertRequired"] = this.emailAlert; + request["IsSMSAlertRequired"] = this.smsAlert; + request["PreferredLanguage"] = this.language.toString(); + authService.saveSettings(request).then((result) => { + AppToast.showSuccessToast( + message: TranslationBase.of(context).profileUpdate), + GifLoaderDialogUtils.hideDialog(context) + }); + } +} diff --git a/lib/pages/settings/settings.dart b/lib/pages/settings/settings.dart new file mode 100644 index 00000000..0c63b900 --- /dev/null +++ b/lib/pages/settings/settings.dart @@ -0,0 +1,67 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/pages/settings/profile_setting.dart'; +import 'package:diplomaticquarterapp/pages/settings/general_setting.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/arrow_back.dart'; +import 'package:flutter/material.dart'; + +class Settings extends StatefulWidget { + final int type; + + Settings({this.type = 0}); + @override + _Settings createState() => _Settings(); +} + +class _Settings extends State with TickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + _tabController = + new TabController(length: 2, vsync: this, initialIndex: widget.type); + + if(widget.type==1){ + _tabController.animateTo(1); + } + + super.initState(); + } + + @override + Widget build(BuildContext context) { + AppGlobal.context = context; + return Scaffold( + appBar: AppBar( + bottom: TabBar( + // isScrollable: true, + + indicatorWeight: 5.0, + //indicatorSize: TabBarIndicatorSize.label, + // indicatorSize: TabBarIndicatorSize.tab, + + indicatorColor: Theme.of(context).primaryColor, + // labelColor: Theme.of(context).primaryColor, + tabs: [ + Tab(text: TranslationBase.of(context).general), + Tab( + text: TranslationBase.of(context).profile, + ) + ], + controller: _tabController, + ), + title: Text(TranslationBase.of(context).settings, + style: TextStyle(color: Colors.white)), + leading: Builder( + builder: (BuildContext context) { + return ArrowBack(); + }, + ), + ), + body: TabBarView( + physics: NeverScrollableScrollPhysics(), + children: [GeneralSettings(), ProfileSettings()], + controller: _tabController), + ); + } +} diff --git a/lib/pages/symptom-checker/info.dart b/lib/pages/symptom-checker/info.dart new file mode 100644 index 00000000..7906ba1a --- /dev/null +++ b/lib/pages/symptom-checker/info.dart @@ -0,0 +1,131 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/routes.dart'; + +class SymptomInfo extends StatefulWidget { + @override + _SymptomInfo createState() => new _SymptomInfo(); +} + +class _SymptomInfo extends State { + bool checkValue = false; + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).termsService, + isShowAppBar: true, + body: Padding( + padding: EdgeInsets.all(20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).beforeUsing, + fontWeight: FontWeight.bold, + fontSize: 14, + // textAlign: TextAlign.center, + ), + Container( + width: MediaQuery.of(context).size.width, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + ), + padding: EdgeInsets.all(30), + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + AppText(TranslationBase.of(context).remeberthat, + fontSize: 16), + SizedBox( + height: 10, + ), + AppText( + '1. ' + TranslationBase.of(context).checkDiagnosis, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText(TranslationBase.of(context).informational, + fontSize: 16), + SizedBox( + height: 10, + ), + AppText( + '2. ' + TranslationBase.of(context).notUseInEmbergency, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + TranslationBase.of(context).notUseInEmbergencyDetails, + fontSize: 16), + AppText( + TranslationBase.of(context).notUseInEmbergencyCall, + underline: true, + color: Colors.blue, + fontSize: 16), + SizedBox( + height: 10, + ), + AppText( + '3.' + TranslationBase.of(context).dataSafe, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText(TranslationBase.of(context).dataSafeInfo, + fontSize: 16), + ], + ), + ), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Padding( + padding: EdgeInsets.all(10), + child: CheckboxListTile( + title: AppText(TranslationBase.of(context).accept), + value: checkValue, + onChanged: (newValue) { + setState(() { + this.checkValue = newValue; + }); + }, + controlAffinity: ListTileControlAffinity + .leading, // <-- leading Checkbox + ), + ), + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).next, + () => { + if (checkValue == true) + { + Navigator.of(context).pushNamed( + SELECT_GENDER, + ) + } + }, + color: checkValue == true + ? Colors.black + : Colors.grey, + textColor: Colors.white, + )) + ], + ), + ], + )) + ], + ))); + } +} diff --git a/lib/pages/symptom-checker/select-gender.dart b/lib/pages/symptom-checker/select-gender.dart new file mode 100644 index 00000000..0b8be29d --- /dev/null +++ b/lib/pages/symptom-checker/select-gender.dart @@ -0,0 +1,124 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:flutter_xlider/flutter_xlider.dart'; + +class SelectGender extends StatefulWidget { + @override + _SelectGender createState() => new _SelectGender(); +} + +class _SelectGender extends State { + double slider = 22; + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).gender, + isShowAppBar: true, + body: Padding( + padding: EdgeInsets.all(20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + //TranslationBase.of(context).beforeUsing, + TranslationBase.of(context).selectGender, + fontWeight: FontWeight.bold, + fontSize: 20, + // textAlign: TextAlign.center, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + AppText(TranslationBase.of(context).iAma, fontSize: 16), + SizedBox( + height: 10, + ), + Row( + children: [ + Expanded( + child: Container( + height: 200, + width: 150, + child: Card( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(15.0), + ), + shadowColor: Colors.red, + child: Image.asset( + 'assets/images/female_face.png')))), + Expanded( + child: Container( + height: 200, + width: 150, + child: Card( + shadowColor: Colors.red, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(15.0), + ), + child: Image.asset( + 'assets/images/male_face.png')))) + ], + ), + AppText(TranslationBase.of(context).selectAge, + fontSize: 25), + SizedBox( + height: 10, + ), + AppText( + TranslationBase.of(context).iAm + + ' ' + + slider.toString() + + ' ' + + TranslationBase.of(context) + .yearOld, //TranslationBase.of(context).remeberthat, + fontSize: 16), + SizedBox( + height: 30, + ), + FlutterSlider( + values: [slider], + max: 90, + min: 14, + onDragCompleted: (handlerIndex, lowerValue, upperValue) { + print(lowerValue); + print(upperValue); + setState(() { + slider = upperValue; + }); + }, + ), + ], + ), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).next, + () => { + Navigator.of(context).pushNamed( + SYMPTOM_CHECKER, + ) + }, + )) + ], + ), + ], + )) + ], + ))); + } +} diff --git a/lib/pages/symptom-checker/symtom-checker.dart b/lib/pages/symptom-checker/symtom-checker.dart new file mode 100644 index 00000000..c088caab --- /dev/null +++ b/lib/pages/symptom-checker/symtom-checker.dart @@ -0,0 +1,61 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class SymptomChecker extends StatelessWidget { + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Symptom Checker', + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + SvgPicture.string( + ''' + + + + + + + + + + + + + + + + + + + + + + + + + + +'''), + Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).next, + () => {}, + )) + ], + )) + ], + ))); + } +} diff --git a/lib/pages/vaccine/my_vaccines_item_screen.dart b/lib/pages/vaccine/my_vaccines_item_screen.dart new file mode 100644 index 00000000..33ef5975 --- /dev/null +++ b/lib/pages/vaccine/my_vaccines_item_screen.dart @@ -0,0 +1,78 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:provider/provider.dart'; +import '../base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.dart'; +import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; +import 'package:popup_box/popup_box.dart'; + +class MyVaccinesItemPage extends StatefulWidget { + @override + _MyVaccinesItemPageState createState() => _MyVaccinesItemPageState(); +} + +class _MyVaccinesItemPageState extends State { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getMyVaccinationItem(), + builder: (BuildContext context, VaccineViewModel model, Widget child) => + AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).myVaccinesAvailability, + baseViewModel: model, + body: Container( + margin: EdgeInsets.only( + left: SizeConfig.screenWidth * 0.004, + right: SizeConfig.screenWidth * 0.004, + top: SizeConfig.screenWidth * 0.04, + ), + child: ListView.builder( + itemCount: model.vaccinationItemList.length, + itemBuilder: (context, index) => InkWell( + onTap: () async { + await model.getMyVaccinationOnHand( + pItemCode: model.vaccinationItemList[index].iTEMCODE); + if (model.hasError) { + AppToast.showErrorToast(message: model.error); + } else { + //TODO show dialog + + } + }, + child: Container( + margin: EdgeInsets.all(5), + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(7), + color: Colors.white, + ), + child: Row( + children: [ + Expanded( + child: Texts( + model.vaccinationItemList[index].dESCRIPTION)), + Icon(projectViewModel.isArabic + ? Icons.arrow_forward_ios + : Icons.arrow_back_ios) + ], + ), + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/vaccine/my_vaccines_screen.dart b/lib/pages/vaccine/my_vaccines_screen.dart new file mode 100644 index 00000000..169e5cd5 --- /dev/null +++ b/lib/pages/vaccine/my_vaccines_screen.dart @@ -0,0 +1,219 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:provider/provider.dart'; +import '../base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.dart'; +import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; +import 'package:popup_box/popup_box.dart'; + +import 'my_vaccines_item_screen.dart'; + +//TODO fix by jammal we have a static data +class MyVaccines extends StatefulWidget { + @override + _MyVaccinesState createState() => _MyVaccinesState(); +} + +class _MyVaccinesState extends State { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getVaccine(), + builder: (BuildContext context, VaccineViewModel model, Widget child) => + AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).myVaccines, + baseViewModel: model, + body: Container( + margin: EdgeInsets.only( + left: SizeConfig.screenWidth * 0.004, + right: SizeConfig.screenWidth * 0.004, + top: SizeConfig.screenWidth * 0.04, + ), + child: Column( + children: [ + RoundedContainer( + backgroundColor: Colors.white, + child: ExpansionTile( + title: Container( + height: 65.0, + child: Text('2018'), + ), + children: [ + Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.vaccineList == null + ? 0 + : model.vaccineList.length, + itemBuilder: (BuildContext context, int index) { + return Column( + children: [ + RoundedContainer( + child: Column( + children: [ + Row( + children: [ + Expanded( + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + horizontal: 20.0, + vertical: 20.0), + child: Image.network( + model.vaccineList[index] + .doctorImageURL, + height: SizeConfig + .imageSizeMultiplier * + 23, + width: SizeConfig + .imageSizeMultiplier * + 20, + fit: BoxFit.fill, + ), + ), + ], + ), + flex: 2, + ), + Expanded( + child: Container( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + model.vaccineList[index] + .doctorTitle + + model.vaccineList[index] + .doctorName, + style: TextStyle( + fontWeight: + FontWeight.w900, + fontSize: 16.6, + ), + ), + SizedBox(height: 7.0), + Text( + model.vaccineList[index] + .projectName, + style: TextStyle( + fontSize: 17.0, + letterSpacing: 0.5, + ), + ), + SizedBox(height: 7.0), + Text( + model.vaccineList[index] + .vaccineName, + style: TextStyle( + fontSize: 17.0, + ), + ), + SizedBox(height: 7.0), + Text( + 'Date Taken ' + + convertDateFormat(model + .vaccineList[index] + .invoiceDate), + style: TextStyle( + fontSize: 17.0), + ), + ], + ), + ), + flex: 5, + ), + ], + ), + ], + ), + ), + ], + ); + }), + ) + ], + ), + ), + // SpaceBetweenTexts(space: 165.0), + ], + ), + ), + bottomSheet: Container( + color: Theme.of(context).scaffoldBackgroundColor, + padding: EdgeInsets.all(12), + height: MediaQuery.of(context).size.height * 0.25, + width: double.infinity, + child: Column( + children: [ + Divider( + height: 2, + thickness: 1, + ), + SizedBox( + height: 6, + ), + Container( + width: double.infinity, + // height: 80.0, + child: Button( + label: TranslationBase.of(context).checkVaccineAvailability, + backgroundColor: Color(0xff9EA3A4), + onTap: () => + Navigator.push(context, FadePage(page: MyVaccinesItemPage())), + ), + ), + if(projectViewModel.havePrivilege(27)) + Container( + width: double.infinity, + // height: 80.0, + child: SecondaryButton( + label: TranslationBase.of(context).sendEmail, + color: Color(0xffF62426), + textColor: Colors.white, + disabled: model.vaccineList.length == 0, + loading: model.state == ViewState.BusyLocal, + onTap: () async { + model.sendEmail( + message: + TranslationBase.of(context).emailSentSuccessfully); + }, + ), + ), + ], + ), + ), + ), + ); + } + + convertDateFormat(String Date) { + const start = "/Date("; + const end = "+0300)"; + + final startIndex = Date.indexOf(start); + final endIndex = Date.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(Date.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + + "-" + + date.month.toString().padLeft(2, '0') + + "-" + + date.day.toString().padLeft(2, '0'); + + return newDate.toString(); + } +} diff --git a/lib/providers/project_provider.dart b/lib/providers/project_provider.dart deleted file mode 100644 index da48ffb9..00000000 --- a/lib/providers/project_provider.dart +++ /dev/null @@ -1,74 +0,0 @@ -import 'dart:async'; - -import 'package:connectivity/connectivity.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:flutter/cupertino.dart'; - -class ProjectProvider with ChangeNotifier { - AppSharedPreferences sharedPref = AppSharedPreferences(); - Locale _appLocale; - String currentLanguage = 'ar'; - bool _isArabic = false; - bool isInternetConnection = true; - bool isLoading = false; - bool isError = false; - String error = ''; - - Locale get appLocal => _appLocale; - - bool get isArabic => _isArabic; - StreamSubscription subscription; - - ProjectProvider() { - loadSharedPrefLanguage(); - - subscription = Connectivity() - .onConnectivityChanged - .listen((ConnectivityResult result) { - switch (result) { - case ConnectivityResult.wifi: - isInternetConnection = true; - break; - case ConnectivityResult.mobile: - isInternetConnection = true; - break; - case ConnectivityResult.none: - isInternetConnection = false; - break; - } - notifyListeners(); - }); - } - - void loadSharedPrefLanguage() async { - currentLanguage = await sharedPref.getString(APP_LANGUAGE); - _appLocale = Locale(currentLanguage ?? 'en'); - _isArabic = currentLanguage != null - ? currentLanguage == 'ar' ? true : false - : false; - notifyListeners(); - } - - void changeLanguage(String lan) { - if (lan != "en" && currentLanguage != lan) { - _appLocale = Locale("ar"); - _isArabic = true; - currentLanguage = 'ar'; - sharedPref.setString(APP_LANGUAGE, 'ar'); - } else if (lan != "ar" && currentLanguage != lan) { - _appLocale = Locale("en"); - _isArabic = false; - currentLanguage = 'en'; - sharedPref.setString(APP_LANGUAGE, 'en'); - } - - notifyListeners(); - } - - @override - void dispose() { - if (subscription != null) subscription.cancel(); - super.dispose(); - } -} diff --git a/lib/routes.dart b/lib/routes.dart new file mode 100644 index 00000000..b11025c2 --- /dev/null +++ b/lib/routes.dart @@ -0,0 +1,56 @@ +import 'package:diplomaticquarterapp/pages/DrawerPages/family/add-family-member.dart'; +import 'package:diplomaticquarterapp/pages/DrawerPages/family/add-family_type.dart'; +import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; +import 'package:diplomaticquarterapp/pages/login/confirm-login.dart'; +import 'package:diplomaticquarterapp/pages/login/forgot-password.dart'; +import 'package:diplomaticquarterapp/pages/login/register-info.dart'; +import 'package:diplomaticquarterapp/pages/login/welcome.dart'; +import 'package:diplomaticquarterapp/pages/login/login-type.dart'; +import 'package:diplomaticquarterapp/pages/login/login.dart'; +import 'package:diplomaticquarterapp/pages/login/register.dart'; +import 'package:diplomaticquarterapp/pages/settings/settings.dart'; +import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart'; +import 'package:diplomaticquarterapp/pages/symptom-checker/select-gender.dart'; +import 'package:diplomaticquarterapp/pages/symptom-checker/symtom-checker.dart'; +import 'package:diplomaticquarterapp/splashPage.dart'; + +const String INIT_ROUTE = '/'; +const String HOME = 'home'; +const String SPLASH = '/'; +const String LOGIN = 'login'; +const String WELCOME_LOGIN = 'welcome-login'; +const String LOGIN_TYPE = 'login-type'; +const String LOGIN_PAGE = 'login-page'; +const String FORGOT_PASSWORD = 'forgot-password'; +const String REGISTER = 'register'; +const String CONFIRM_LOGIN = 'confrim-login'; +const String REGISTER_INFO = 'register-info'; +const String MY_FAMILIY = 'my-family'; +const String ADD_FAMILY_MEMBER_TYPE = 'add-family-member-type'; +const String ADD_FAMILY_MEMBER = 'add-family-member'; +const String LIVE_CARE = 'live-care'; +const String SYMPTOM_CHECKER = 'symptom-checker'; +const String SYMPTOM_CHECKER_INFO = 'symptom-checker-info'; +const String SELECT_GENDER = 'select-gender'; +const String SETTINGS = 'settings'; +var routes = { + SPLASH: (_) => SplashScreen(), + HOME: (_) => LandingPage(), + WELCOME_LOGIN: (_) => WelcomeLogin(), + LOGIN_TYPE: (_) => LoginType(), + LOGIN_PAGE: (_) => Login(), + FORGOT_PASSWORD: (_) => ForgotPassword(), + REGISTER: (_) => Register(), + CONFIRM_LOGIN: (_) => ConfirmLogin(), + REGISTER_INFO: (_) => RegisterInfo(), + MY_FAMILIY: (_) => MyFamily(), + ADD_FAMILY_MEMBER_TYPE: (_) => AddFamilyMemberType(), + ADD_FAMILY_MEMBER: (_) => AddMember(), + LIVE_CARE: (_) => LiveCareHome(), + SYMPTOM_CHECKER: (_) => SymptomChecker(), + SYMPTOM_CHECKER_INFO: (_) => SymptomInfo(), + SELECT_GENDER: (_) => SelectGender(), + SETTINGS: (_) => Settings() +}; diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart new file mode 100644 index 00000000..d26c74ad --- /dev/null +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -0,0 +1,1323 @@ +import 'dart:io'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/Request.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:flutter/cupertino.dart'; + +class DoctorsListService extends BaseService { + AppSharedPreferences sharedPref = AppSharedPreferences(); + AppGlobal appGlobal = new AppGlobal(); + + AuthenticatedUser authUser = new AuthenticatedUser(); + AuthProvider authProvider = new AuthProvider(); + + double lat; + double long; + String deviceToken; + String tokenID; + + Future getDoctorsList( + int clinicID, int projectID, bool isNearest, BuildContext context, + {doctorId, doctorName}) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + if (await this.sharedPref.getDouble(USER_LAT) != null && + await this.sharedPref.getDouble(USER_LONG) != null) { + lat = await this.sharedPref.getDouble(USER_LAT); + long = await this.sharedPref.getDouble(USER_LONG); + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": "YckwoXhUmWBsnHKEKig", + "ClinicID": clinicID, + "ProjectID": projectID, + "DoctorName": doctorName, //!= null ? doctorId : 0, + "ContinueDentalPlan": false, + "IsSearchAppointmnetByClinicID": true, + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "gender": authUser.gender != null ? authUser.gender : 0, + "age": authUser.age != null ? authUser.age : 0, + "IsGetNearAppointment": false, + // "Latitude": 0, + // "Longitude": 0, + // "License": true, + "SearchForVoiceCommand": + doctorId != null && doctorId.length > 0 ? true : false, + "DoctorIDsList": doctorId, + "Latitude": lat != null ? lat.toString() : 0, + "Longitude": long != null ? long.toString() : 0, + "IsGetNearAppointment": isNearest, + if (isNearest) + "SelectedDate": DateUtil.convertDateToString(DateTime.now()), + "License": true + }; + + dynamic localRes; + + await baseAppClient.post(GET_DOCTORS_LIST_URL, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getDoctorsListByName(String docName, BuildContext context) async { + Map request; + + double lat; + double long; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + if (await this.sharedPref.getDouble(USER_LAT) != null && + await this.sharedPref.getDouble(USER_LONG) != null) { + lat = await this.sharedPref.getDouble(USER_LAT); + long = await this.sharedPref.getDouble(USER_LONG); + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": null, + "ClinicID": 0, + "ProjectID": 0, + "ContinueDentalPlan": false, + "IsSearchAppointmnetByClinicID": false, + "DoctorName": docName, + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "gender": authUser.gender != null ? authUser.gender : 0, + "age": authUser.age != null ? authUser.age : 0, + "IsGetNearAppointment": false, + "Latitude": lat, + "Longitude": long, + "License": true + }; + + dynamic localRes; + + await baseAppClient.post(GET_DOCTORS_LIST_URL, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getDoctorsProfile( + int docID, int clinicID, int projectID, context) async { + Map request; + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": null, + "doctorID": docID, + "ClinicID": clinicID, + "PatientID": 0, + "License": true, + "IsRegistered": true, + "ProjectID": projectID, + "isDentalAllowedBackend": false + }; + + dynamic localRes; + + await baseAppClient.post(GET_DOCTOR_PROFILE, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getDoctorsRating( + int docID, context) async { + Map request; + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": null, + "doctorID": docID, + "PatientID": 0, + "License": true, + "IsRegistered": true, + "isDentalAllowedBackend": false + }; + + dynamic localRes; + + await baseAppClient.post(GET_DOCTOR_RATING_NOTES, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getDoctorsRatingDetails( + int docID, context) async { + Map request; + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": null, + "DoctorID": docID, + "PatientID": 0, + "License": true, + "IsRegistered": true, + "isDentalAllowedBackend": false + }; + + dynamic localRes; + + await baseAppClient.post(GET_DOCTOR_RATING_DETAILS, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getDoctorFreeSlots( + int docID, int clinicID, int projectID, BuildContext context) async { + Map request; + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "DoctorID": docID, + "IsBookingForLiveCare": 0, + "ClinicID": clinicID, + "ProjectID": projectID, + "OriginalClinicID": clinicID, + "days": 0, + "isReschadual": false, + "VersionID": req.VersionID, + "Channel": 3, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "generalid": "Cs2020@2016\$2958", + "PatientOutSA": authUser.outSA, + "SessionID": null, + "isDentalAllowedBackend": false, + "DeviceTypeID": 1 + }; + + dynamic localRes; + + await baseAppClient.post(GET_DOCTOR_FREE_SLOTS, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getDoctorScheduledFreeSlots(int docID, int clinicID, + int projectID, int serviceID, BuildContext context) async { + Map request; + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "DoctorID": docID, + "IsBookingForLiveCare": 1, + "ClinicID": clinicID, + "ProjectID": projectID, + "OriginalClinicID": clinicID, + "ServiceID": serviceID, + "days": 50, + "isReschadual": false, + "VersionID": req.VersionID, + "Channel": 3, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "generalid": "Cs2020@2016\$2958", + "PatientOutSA": authUser.outSA, + "SessionID": null, + "isDentalAllowedBackend": false, + "DeviceTypeID": 1 + }; + + dynamic localRes; + + await baseAppClient.post(GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future insertAppointment(int docID, int clinicID, int projectID, + String selectedTime, String selectedDate, BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "IsForLiveCare": false, + "ProjectID": projectID, + "ClinicID": clinicID, + "DoctorID": docID, + "StartTime": selectedTime, + "SelectedTime": selectedTime, + "EndTime": selectedTime, + "InitialSlotDuration": 0, + "StrAppointmentDate": selectedDate, + "IsVirtual": false, + "DeviceType": Platform.isIOS ? 'iOS' : 'Android', + "BookedBy": 102, + "VisitType": 1, + "VisitFor": 1, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + + await baseAppClient.post(INSERT_SPECIFIC_APPOINTMENT, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future insertLiveCareScheduleAppointment( + int docID, + int clinicID, + int projectID, + int serviceID, + String selectedTime, + String selectedDate, + BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "IsForLiveCare": true, + "ProjectID": projectID, + "ClinicID": clinicID, + "DoctorID": docID, + "ServiceID": serviceID, + "StartTime": selectedTime, + "SelectedTime": selectedTime, + "EndTime": selectedTime, + "InitialSlotDuration": 0, + "StrAppointmentDate": selectedDate, + "IsVirtual": false, + "DeviceType": Platform.isIOS ? 'iOS' : 'Android', + "BookedBy": 102, + "VisitType": 1, + "VisitFor": 1, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + + await baseAppClient.post(INSERT_LIVECARE_SCHEDULE_APPOINTMENT, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getPatientShare( + String appoID, int clinicID, int projectID, BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + + request = { + "ProjectID": projectID, + "ClinicID": clinicID, + "AppointmentNo": appoID, + "IsActiveAppointment": true, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + + await baseAppClient.post(GET_PATIENT_SHARE, + onSuccess: (response, statusCode) async { + localRes = response['OnlineCheckInAppointments'][0]; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getLiveCareAppointmentPatientShare( + String appoID, int clinicID, int projectID, BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + + request = { + "ProjectID": projectID, + "ClinicID": clinicID, + "AppointmentNo": appoID, + "IsActiveAppointment": true, + "IsForLiveCare": true, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + + await baseAppClient.post(GET_PATIENT_SHARE_LIVECARE, + onSuccess: (response, statusCode) async { + localRes = response['OnlineCheckInAppointments'][0]; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getPatientAppointmentHistory( + bool isActiveAppointment, BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + + request = { + "IsActiveAppointment": isActiveAppointment, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": 0, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + + await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getPatientAppointmentCurfewHistory( + bool isActiveAppointment) async { + Map request; + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + + request = { + "IsActiveAppointment": isActiveAppointment, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": 0, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": 1231755, + "TokenID": "@dm!n", + "PatientTypeID": 1, + "PatientType": 1 + }; + + dynamic localRes; + + await baseAppClient.post(GET_PATIENT_APPOINTMENT_CURFEW_HISTORY, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future confirmAppointment(int appoNo, int clinicID, int projectID, + bool isLiveCare, BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + + request = { + "AppointmentNumber": appoNo, + "IsLiveCareAppointment": isLiveCare, + "ClinicID": clinicID, + "ProjectID": projectID, + "ConfirmationBy": 102, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": 0, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + + await baseAppClient.post(CONFIRM_APPOINTMENT, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future insertVIDARequest(int appoNo, int clinicID, int projectID, + int serviceID, int docID, BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + deviceToken = await sharedPref.getString(PUSH_TOKEN); + + if (await this.sharedPref.getDouble(USER_LAT) != null && + await this.sharedPref.getDouble(USER_LONG) != null) { + lat = await this.sharedPref.getDouble(USER_LAT); + long = await this.sharedPref.getDouble(USER_LONG); + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + + request = { + "AppointmentNo": appoNo, + "ClinicID": clinicID, + "ProjectID": projectID, + "ServiceID": serviceID, + "AcceptedBy": docID, + "DeviceToken": deviceToken, + "Latitude": lat, + "Longitude": long, + "DeviceType": req.DeviceType, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + + await baseAppClient.post(INSERT_VIDA_REQUEST, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future cancelAppointment( + AppoitmentAllHistoryResultList appo, BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + + request = { + "AppointmentID": appo.appointmentNo, + "ClinicID": appo.clinicID, + "ProjectID": appo.projectID, + "EndTime": appo.endTime, + "StartTime": appo.startTime, + "DoctorID": appo.doctorID, + "IsForLiveCare": appo.isLiveCareAppointment, + "OriginalClinicID": appo.originalClinicID, + "OriginalProjectID": appo.originalProjectID, + "StrAppointmentDate": DateUtil.getDateFormatted(appo.appointmentDate), + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + + await baseAppClient.post(CANCEL_APPOINTMENT, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future generateAppointmentQR( + PatientShareResponse patientShareResponse, BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + + request = { + "AppointmentNo": patientShareResponse.appointmentNo, + "ClinicID": patientShareResponse.clinicID, + "ProjectID": patientShareResponse.projectID, + "IsFollowup": patientShareResponse.isFollowup, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + + await baseAppClient.post(GENERATE_QR_APPOINTMENT, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future sendAppointmentQREmail( + String to, + String appoDate, + String appoNo, + String docName, + String projName, + String QR, + String speciality, + BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + + request = { + "AppointmentNo": appoNo, + "AppointmentDate": appoDate, + "DoctorName": docName, + "ProjectName": projName, + "QR": QR, + "Speciality": speciality, + "To": to, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + + await baseAppClient.post(EMAIL_QR_APPOINTMENT, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future checkPaymentStatus( + String transactionID, BuildContext context) async { + Map request; + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "ClientRequestID": transactionID, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + dynamic localRes; + await baseAppClient.post(CHECK_PAYMENT_STATUS, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future addAdvancedNumberRequest( + String advanceNumber, + String paymentReference, + dynamic appointmentID, + BuildContext context) async { + Map request; + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "AdvanceNumber": advanceNumber, + "PaymentReferenceNumber": paymentReference, + "AppointmentID": appointmentID, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + dynamic localRes; + await baseAppClient.post(ADD_ADVANCE_NUMBER_REQUEST, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future isAllowedToAskDoctor(int docID, BuildContext context) async { + Map request; + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "IsForAskYourDoctor": true, + "DoctorID": docID, + "Top": 25, + "beforeDays": 15, + "exludType": 4, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + await baseAppClient.post(IS_ALLOW_ASK_DOCTOR, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getCallRequestType(BuildContext context) async { + Map request; + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + await baseAppClient.post(GET_CALL_REQUEST_TYPE, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future sendAskDocCallRequest(AppoitmentAllHistoryResultList appo, + String requestType, BuildContext context) async { + Map request; + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + + request = { + "ProjectID": appo.projectID, + "SetupID": appo.setupID, + "DoctorID": appo.doctorID, + "RequestType": requestType, + "RequestTypeID": requestType, + "PatientMobileNumber": authUser.mobileNumber, + "IsMessageSent": false, + "RequestDate": + DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now()) + .split(" ")[0], + "RequestTime": + DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now()) + .split(" ")[1], + "Remarks": "", + "Status": 1, + "CreatedBy": 102, + "CreatedOn": + DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now()) + .split(" ")[0], + "EditedBy": 102, + "EditedOn": + DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now()) + .split(" ")[0], + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + await baseAppClient.post(SEND_CALL_REQUEST, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getPatientRadOrders(String appoNo, BuildContext context) async { + Map request; + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "AppointmentNo": appoNo, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + await baseAppClient.post(GET_PATIENT_ORDERS, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getPatientLabOrdersByAppoNo(dynamic appoNo, dynamic projID, dynamic clinicID, BuildContext context) async { + Map request; + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "AppointmentNo": appoNo, + "ProjectID": projID, + "ClinicID": clinicID, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + await baseAppClient.post(GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getPatientPrescriptionReports( + AppoitmentAllHistoryResultList appo, BuildContext context) async { + Map request; + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "AppointmentNo": appo.appointmentNo, + "ClinicID": appo.clinicID, + "ProjectID": appo.projectID, + "EpisodeID": appo.episodeID, + "VersionID": req.VersionID, + "SetupID": appo.setupID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + await baseAppClient.post(GET_PRESCRIPTION_REPORT_ENH, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future sendPrescriptionEmail(String appoDate, String setupId, + dynamic prescriptionReportEnhList, BuildContext context) async { + Map request; + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "AppointmentDate": appoDate, + "DateofBirth": authUser.dateofBirth, + "ListPrescriptions": prescriptionReportEnhList, + "PatientIditificationNum": authUser.patientIdentificationNo, + "PatientMobileNumber": authUser.mobileNumber, + "PatientName": authUser.firstName + " " + authUser.lastName, + "To": authUser.emailAddress, + "SetupID": setupId, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + await baseAppClient.post(SEND_PRESCRIPTION_EMAIL, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future createAdvancePayment( + AppoitmentAllHistoryResultList appo, + String projectID, + double payedAmount, + String paymentReference, + String paymentMethodName, + BuildContext context) async { + Map request; + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "ProjectID": projectID, + "OnlineCheckInAppointment": { + "AppointmentNo": appo != null ? appo.appointmentNo.toString() : "0", + "PaymentMethodName": paymentMethodName, + "PaymentAmount": payedAmount == 0 ? "0" : payedAmount.toString(), + "PaymentDate": payedAmount == 0 + ? "" + : "/Date(" + + DateTime.now().millisecondsSinceEpoch.toString() + + ")/", + "PaymentReferenceNumber": payedAmount == 0 ? "" : paymentReference, + "ProjectID": appo != null ? appo.projectID.toString() : projectID, + "PatientID": authUser.patientID, + "ClinicID": appo != null ? appo.clinicID : "0", + "UserID": authUser.patientID, + "Status": authUser.patientType + }, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + dynamic localRes; + await baseAppClient.post(CREATE_ADVANCE_PAYMENT, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future HIS_createAdvancePayment( + AppoitmentAllHistoryResultList appo, + String projectID, + double payedAmount, + String paymentReference, + String paymentMethodName, + dynamic patientType, + String patientName, + dynamic patientID, + BuildContext context) async { + Map request; + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + + request = { + "CustName": patientName, + "CustID": patientID, + "SetupID": "010266", + "ProjectID": projectID, + "PatientID": patientID, + "AccountID": patientID, + "PaymentAmount": payedAmount, + "NationalityID": null, + "DepositorName": authUser.firstName + " " + authUser.lastName, + "CreatedBy": 3, + "PaymentMethodName": paymentMethodName, + "PaymentReference": paymentReference, + "PaymentMethod": paymentMethodName, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "TokenID": "@dm!n", + "PatientTypeID": patientType, + "PatientType": patientType + }; + dynamic localRes; + await baseAppClient.post(HIS_CREATE_ADVANCE_PAYMENT, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } +} diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart new file mode 100644 index 00000000..8f0ea470 --- /dev/null +++ b/lib/services/authentication/auth_provider.dart @@ -0,0 +1,502 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_request.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_user_status_req.dart'; +import 'package:diplomaticquarterapp/models/Authentication/checkpatient_for_registration.dart'; +import 'package:diplomaticquarterapp/models/Authentication/insert_device_imei_request.dart'; +import 'package:diplomaticquarterapp/models/Authentication/register_user_requet.dart'; +import 'package:diplomaticquarterapp/models/Authentication/registered_authenticated_user_req.dart'; +import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; +import 'package:diplomaticquarterapp/models/Request.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:flutter/cupertino.dart'; + +import '../../locator.dart'; + +// SharedPreferences sharedPref = new SharedPreferences(); +enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED } + +AppSharedPreferences sharedPref = new AppSharedPreferences(); +AppGlobal appGlobal = new AppGlobal(); + +const String INSERT_DEVICE_IMEI = + 'Services/Patients.svc/REST/Patient_INSERTDeviceIMEI'; +const String SELECT_DEVICE_IMEI = + 'Services/Patients.svc/REST/Patient_SELECTDeviceIMEIbyIMEI'; +const String CHECK_PATIENT_AUTH = + 'Services/Authentication.svc/REST/CheckPatientAuthentication'; +const GET_MOBILE_INFO = 'Services/Authentication.svc/REST/GetMobileLoginInfo'; +const SEND_ACTIVATION_CODE = + 'Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationType'; +const CHECK_ACTIVATION_CODE = + 'Services/Authentication.svc/REST/CheckActivationCode'; +const FORGOT_PASSWORD = + 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo'; +const CHECK_PATIENT_FOR_REGISTRATION = + "Services/Authentication.svc/REST/CheckPatientForRegisteration"; + +const CHECK_USER_STATUS = "Services/NHIC.svc/REST/GetPatientInfo"; +const REGISTER_USER = 'Services/Authentication.svc/REST/PatientRegistration'; +const LOGGED_IN_USER_URL = + 'Services/MobileNotifications.svc/REST/Insert_PatientMobileDeviceInfo'; + +const FORGOT_PATIENT_ID = + 'Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber'; +const DASHBOARD = 'Services/Patients.svc/REST/PatientDashboard'; +const PROFILE_SETTING = 'Services/Patients.svc/REST/GetPateintInfoForUpdate'; +const SAVE_SETTING = 'Services/Patients.svc/REST/UpdatePateintInfo'; + +class AuthProvider with ChangeNotifier { + bool isLogin = false; + bool isLoading = true; + dynamic authenticatedUser; + AuthenticatedUserObject authenticatedUserObject = + locator(); + + AuthProvider() { + getUserAuthentication(); + } + + void getUserAuthentication() async { + Map profile = await sharedPref.getObject(USER_PROFILE); + if (profile != null) { + isLoading = false; + isLogin = true; + } else { + isLoading = false; + isLogin = false; + } + notifyListeners(); + } + + APP_STATUS get stutas { + if (isLoading) { + return APP_STATUS.LOADING; + } else { + if (this.isLogin) { + return APP_STATUS.AUTHENTICATED; + } else { + return APP_STATUS.UNAUTHENTICATED; + } + } + } + + // Future login(UserModel userInfo) async { + // try { + // dynamic localRes; + + // await BaseAppClient.post(LOGIN_URL, + // onSuccess: (dynamic response, int statusCode) { + // localRes = response; + // }, onFailure: (String error, int statusCode) { + // throw error; + // }, body: userInfo.toJson()); + + // return Future.value(localRes); + // } catch (error) { + // print(error); + // throw error; + // } + // } + + Future insertDeviceImei(lstLogin) async { + try { + dynamic localRes; + var lastLogin = lstLogin; //await sharedPref.getInt( + // LAST_LOGIN); //this.cs.sharedService.getStorage(AuthenticationService.LAST_LOGIN); //this.cs.sharedService.getSharedData(AuthenticationService.LAST_LOGIN, false); + + var request = + AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + var newRequest = INSERTDeviceIMEIRequest(); + + var imei = await sharedPref.getString(PUSH_TOKEN); + // if (!request.) { + newRequest.iMEI = imei; //imei!=null ? imei : ''; + newRequest.firstName = request.firstName + " " + request.lastName; + newRequest.firstNameN = request.firstNameN + " " + request.lastNameN; + newRequest.lastNameN = request.lastNameN ?? ""; + newRequest.outSA = request.outSA == 1 ? true : false; + newRequest.biometricEnabled = false; + newRequest.preferredLanguage = int.parse(request.preferredLanguage) ?? 1; + newRequest.logInTypeID = lastLogin ?? 1; + newRequest.patientID = request.patientID; + newRequest.mobileNo = request.mobileNumber; + newRequest.identificationNo = request.patientIdentificationNo; + newRequest.patientIdentificationNo = request.patientIdentificationNo; + newRequest.patientType = request.patientType; + newRequest.setupID = request.setupID; + newRequest.tokenID = await sharedPref.getString(TOKEN); + // } + + await new BaseAppClient().post(INSERT_DEVICE_IMEI, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: newRequest.toJson()); + return Future.value(localRes); + } catch (error) { + print(error); + throw error; + } + } + + Future selectDeviceImei(imei) async { + try { + dynamic localRes; + Map request = {}; + request['IMEI'] = imei; + await new BaseAppClient().post(SELECT_DEVICE_IMEI, + onSuccess: (dynamic response, int statusCode) { + localRes = SelectDeviceIMEIRES.fromJson( + response['Patient_SELECTDeviceIMEIbyIMEIList'][0]); + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } catch (error) { + return Future.value(null); + } + } + + Future checkPatientAuthentication( + CheckPatientAuthenticationReq request) async { + request.versionID = VERSION_ID; + request.channel = CHANNEL; + request.iPAdress = IP_ADDRESS; + request.generalid = GENERAL_ID; + request.languageID = LANGUAGE_ID; + request.patientOutSA = request.zipCode == '966' ? 0 : 1; + try { + dynamic localRes; + await new BaseAppClient().post(CHECK_PATIENT_AUTH, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request.toJson()); + return Future.value(localRes); + } catch (error) { + throw error; + //throw error; + } + } + + Future getLoginInfo(request) async { + request.versionID = VERSION_ID; + request.channel = CHANNEL; + request.iPAdress = IP_ADDRESS; + request.generalid = GENERAL_ID; + request.languageID = LANGUAGE_ID; + request.deviceTypeID = DeviceTypeID; + request.patientOutSA = request.zipCode == '966' ? 0 : 1; + request.isDentalAllowedBackend = false; + + dynamic localRes; + await new BaseAppClient().post(GET_MOBILE_INFO, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request.toJson()); + return Future.value(localRes); + } + + Future sendActivationCode(request) async { + request.versionID = VERSION_ID; + request.channel = CHANNEL; + request.iPAdress = IP_ADDRESS; + request.generalid = GENERAL_ID; + request.languageID = LANGUAGE_ID; + request.deviceTypeID = DeviceTypeID; + request.patientOutSA = request.zipCode == '966' ? 0 : 1; + request.isDentalAllowedBackend = false; + + dynamic localRes; + await new BaseAppClient().post(SEND_ACTIVATION_CODE, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + authenticatedUser = CheckActivationCode.fromJson(localRes); + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request.toJson()); + return Future.value(localRes); + } + + Future checkActivationCode(request, [value]) async { + var neRequest = CheckActivationCodeReq.fromJson(request); + neRequest.activationCode = value ?? "0000"; + neRequest.isSilentLogin = value != null ? false : true; + neRequest.versionID = VERSION_ID; + neRequest.channel = CHANNEL; + neRequest.iPAdress = IP_ADDRESS; + neRequest.generalid = GENERAL_ID; + // neRequest.languageID = LANGUAGE_ID; + neRequest.deviceTypeID = DeviceTypeID; + neRequest.patientOutSA = neRequest.zipCode == '966' ? 0 : 1; + neRequest.projectOutSA = neRequest.zipCode == '966' ? false : true; + neRequest.isDentalAllowedBackend = false; + neRequest.deviceToken = null; + neRequest.forRegisteration = + neRequest.isRegister != null ? neRequest.isRegister : false; + neRequest.isRegister = false; + dynamic localRes; + try { + await new BaseAppClient().post(CHECK_ACTIVATION_CODE, + onSuccess: (dynamic response, int statusCode) { + localRes = response; //CheckActivationCode.fromJson(); + }, onFailure: (String error, int statusCode) { + localRes = error; + return Future.value(error); + // throw error; + }, body: neRequest.toJson()); + sharedPref.setString(BLOOD_TYPE, localRes['PatientBloodType']); + return Future.value(localRes); + } catch (error) { + throw localRes; + //return Future.value(error); + } + } + + AuthenticatedUser getAuthenticatedUser() { + this.isLogin = true; + return authenticatedUser; + } + + Future checkPatientForRegisteration( + CheckPatientForRegistration request) async { + request.versionID = VERSION_ID; + request.channel = CHANNEL; + request.iPAdress = IP_ADDRESS; + request.generalid = GENERAL_ID; + request.deviceTypeID = DeviceTypeID; + request.languageID = LANGUAGE_ID; + request.isRegister = false; + // request.tokenID = ''; + dynamic localRes; + try { + await new BaseAppClient().post(CHECK_PATIENT_FOR_REGISTRATION, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + localRes = error; + return Future.value(error); + }, body: request.toJson()); + return Future.value(localRes); + } catch (error) { + throw error; + } + } + + Future checkUserStatus(CheckUserStatusRequest request) async { + request.versionID = VERSION_ID; + request.channel = CHANNEL; + request.iPAdress = IP_ADDRESS; + request.generalid = GENERAL_ID; + request.deviceTypeID = DeviceTypeID; + request.languageID = LANGUAGE_ID; + + // request.tokenID = ''; + dynamic localRes; + try { + await new BaseAppClient().post(CHECK_USER_STATUS, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + localRes = error; + return Future.value(error); + }, body: request.toJson()); + return Future.value(localRes); + } catch (error) { + throw error; + } + } + + Future registerUser(request) async { + request['VersionID'] = VERSION_ID; + request['Channel'] = CHANNEL; + request['IPAdress'] = IP_ADDRESS; + request['Generalid'] = GENERAL_ID; + request['DeviceTypeID'] = DeviceTypeID; + request['LanguageID'] = LANGUAGE_ID; + var requestN = RegisterUserRequest.fromJson(request); + // request.tokenID = ''; + dynamic localRes; + try { + await new BaseAppClient().post(REGISTER_USER, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + localRes = error; + return Future.value(error); + }, body: requestN.toJson()); + return Future.value(localRes); + } catch (error) { + throw error; + } + } + + Future registeredAuthenticatedUser( + AuthenticatedUser user, deviceToken, lat, long) async { + var request = new RegisteredAuthenticatedUserRequest(); + request.deviceToken = deviceToken; + request.voipToken = + ""; //this.cs.sharedService.getSharedData(AuthenticationService.APNS_TOKEN, false); + request.deviceType = DeviceTypeID.toString(); + request.patientMobileNumber = '0' + user.mobileNumber; + request.nationalID = user.patientIdentificationNo; + request.gender = user.gender; + request.patientID = user.patientID; + request.patientOutSA = user.outSA; + request.loginType = await sharedPref.getInt(LAST_LOGIN) != null + ? await sharedPref.getInt(LAST_LOGIN) + : 1; + request.mACAddress = '00:00:00:00:00:00'; + request.latitude = lat; + request.longitude = long; + request.languageID = int.parse(user.preferredLanguage); + request.patientTypeID = 2; + dynamic localRes; + try { + await new BaseAppClient().post(LOGGED_IN_USER_URL, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + localRes = error; + return Future.value(error); + }, body: request.toJson()); + return Future.value(localRes); + } catch (error) { + throw error; + } + } + + Future sendPatientIDSMS(mobileNo, context) async { + Map request; + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": 0, + "PatientID": 0, + "TokenID": "", + "PatientMobileNumber": mobileNo, + "SearchType": 2, + "ZipCode": "966", + "PatientIdentificationID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": null + }; + + dynamic localRes; + + await new BaseAppClient().post(FORGOT_PATIENT_ID, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future forgotPasswordActivation(request, [value]) async { + // var neRequest = CheckActivationCodeReq.fromJson(request); + // neRequest.activationCode = value ?? "0000"; + // neRequest.isSilentLogin = value != null ? false : true; + request['VersionID'] = VERSION_ID; + request['Channel'] = CHANNEL; + request['IPAdress'] = IP_ADDRESS; + request['generalid'] = GENERAL_ID; + request['LanguageID'] = LANGUAGE_ID; + request['DeviceTypeID'] = DeviceTypeID; + + dynamic localRes; + try { + await new BaseAppClient().post(FORGOT_PASSWORD, + onSuccess: (dynamic response, int statusCode) { + localRes = response; //CheckActivationCode.fromJson(); + }, onFailure: (String error, int statusCode) { + localRes = error; + return Future.value(error); + // throw error; + }, body: request); + return Future.value(localRes); + } catch (error) { + throw error; + //return Future.value(error); + } + } + + Future getDashboard() async { + Map request = {}; + request['VersionID'] = VERSION_ID; + request['Channel'] = CHANNEL; + request['IPAdress'] = IP_ADDRESS; + request['generalid'] = GENERAL_ID; + request['LanguageID'] = LANGUAGE_ID; + request['DeviceTypeID'] = DeviceTypeID; + request["PatientTypeID"] = 1; + request["PatientType"] = 1; + dynamic localRes; + try { + await new BaseAppClient().post(DASHBOARD, + onSuccess: (dynamic response, int statusCode) { + localRes = response; //CheckActivationCode.fromJson(); + }, onFailure: (String error, int statusCode) { + localRes = error; + return Future.value(error); + // throw error; + }, body: request); + return Future.value(localRes); + } catch (error) { + throw error; + //return Future.value(error); + } + } + + getSettings() async { + dynamic localRes; + try { + await new BaseAppClient().post(PROFILE_SETTING, + onSuccess: (dynamic response, int statusCode) { + localRes = response; //CheckActivationCode.fromJson(); + }, onFailure: (String error, int statusCode) { + localRes = error; + return Future.value(error); + // throw error; + }, body: {}); + return Future.value(localRes); + } catch (error) { + throw error; + //return Future.value(error); + } + } + + Future saveSettings(request) async { + dynamic localRes; + try { + await new BaseAppClient().post(SAVE_SETTING, + onSuccess: (dynamic response, int statusCode) { + localRes = response; //CheckActivationCode.fromJson(); + }, onFailure: (String error, int statusCode) { + localRes = error; + return Future.value(error); + // throw error; + }, body: request); + return Future.value(localRes); + } catch (error) { + throw error; + //return Future.value(error); + } + } +} diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart new file mode 100644 index 00000000..99345030 --- /dev/null +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -0,0 +1,195 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/Request.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:flutter/material.dart'; + +class ClinicListService extends BaseService { + AppSharedPreferences sharedPref = AppSharedPreferences(); + AppGlobal appGlobal = new AppGlobal(); + + AuthenticatedUser authUser = new AuthenticatedUser(); + AuthProvider authProvider = new AuthProvider(); + + double lat; + double long; + + Future getClinicsList(context) async { + Map request; + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": 0, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": null + }; + + dynamic localRes; + + await baseAppClient.post(GET_CLINICS_LIST_URL, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getActiveAppointmentNo(context) async { + Map request; + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": 0, + "TokenID": "", + "IsActiveAppointment": true, + "DeviceTypeID": req.DeviceTypeID, + "PatientType": user.patientType, + "PatientTypeID": user.patientType, + "SessionID": null + }; + + dynamic localRes; + + await baseAppClient.post(GET_ACTIVE_APPOINTMENTS_LIST_URL, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getProjectsList(context) async { + Map request; + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": 0, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": null + }; + + dynamic localRes; + + await baseAppClient.post(GET_PROJECTS_LIST, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getChiefComplaintsList( + int clinicID, int projectID, BuildContext context, + {doctorId}) async { + //Utils.showProgressDialog(context); + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "ClinicID": clinicID, + "ProjectID": projectID, + "SelectedDate": "", + "SelectedTime": "", + "License": true, + "VersionID": 5.6, + "Channel": 3, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "generalid": "Cs2020@2016\$2958", + "PatientOutSA": 0, + "SessionID": null, + "isDentalAllowedBackend": true, + "DeviceTypeID": 1, + "PatientID": 1, + "ContinueDentalPlan": true, + "IsSearchAppointmnetByClinicID": false + }; + + dynamic localRes; + + await baseAppClient.post(GET_DOCTORS_LIST_URL, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getChiefComplaintDoctorList( + int chiefComplaintID, int projectID, BuildContext context, + {doctorId}) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + if (await this.sharedPref.getDouble(USER_LAT) != null && + await this.sharedPref.getDouble(USER_LONG) != null) { + lat = await this.sharedPref.getDouble(USER_LAT); + long = await this.sharedPref.getDouble(USER_LONG); + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "ChiefComplaintID": chiefComplaintID, + "ProjectID": projectID, + "VersionID": 5.6, + "Channel": 3, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": 0, + "SessionID": null, + "isDentalAllowedBackend": true, + "Latitude": lat.toString(), + "Longitude": long.toString(), + "DeviceTypeID": req.DeviceTypeID, + "IsPublicRequest" : true + }; + + dynamic localRes; + + await baseAppClient.post(GET_DENTAL_DOCTORS_LIST_URL, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } +} diff --git a/lib/services/covid-drivethru/covid-drivethru.dart b/lib/services/covid-drivethru/covid-drivethru.dart new file mode 100644 index 00000000..3943a8b3 --- /dev/null +++ b/lib/services/covid-drivethru/covid-drivethru.dart @@ -0,0 +1,126 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/Request.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:flutter/material.dart'; + +class CovidDriveThruService extends BaseService { + AppSharedPreferences sharedPref = AppSharedPreferences(); + AppGlobal appGlobal = new AppGlobal(); + + AuthenticatedUser authUser = new AuthenticatedUser(); + AuthProvider authProvider = new AuthProvider(); + + Future getCovidProjectsList(BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": "YckwoXhUmWBsnHKEKig", + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "License": true + }; + + dynamic localRes; + + await baseAppClient.post(GET_COVID_DRIVETHRU_PROJECT_LIST, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getCovidPaymentInformation(BuildContext context, int projectID) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "ProjectID": projectID, + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": "YckwoXhUmWBsnHKEKig", + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "License": true + }; + + dynamic localRes; + + await baseAppClient.post(GET_COVID_DRIVETHRU_PAYMENT_INFO, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getCovidFreeSlots(BuildContext context, int projectID) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "ProjectID": projectID, + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": "YckwoXhUmWBsnHKEKig", + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "License": true + }; + + dynamic localRes; + + await baseAppClient.post(GET_COVID_DRIVETHRU_FREE_SLOTS, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } +} diff --git a/lib/services/family_files/family_files_provider.dart b/lib/services/family_files/family_files_provider.dart new file mode 100644 index 00000000..7a2dec81 --- /dev/null +++ b/lib/services/family_files/family_files_provider.dart @@ -0,0 +1,347 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/family-file/add_family_file_request.dart'; +import 'package:diplomaticquarterapp/core/model/family-file/insert_share_file_request.dart'; +import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; +import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:flutter/cupertino.dart'; + +// SharedPreferences sharedPref = new SharedPreferences(); +enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED } +AppSharedPreferences sharedPref = new AppSharedPreferences(); + +const String GET_SHARED_RECORD_BY_STATUS = + 'Services/Authentication.svc/REST/GetAllSharedRecordsByStatus'; +const String ADD_FAMILY_FILES = + 'Services/Patients.svc/REST/ShareFamilyFileService'; +const String SEND_FAMILY_FILE_ACTIVATION = + 'Services/Authentication.svc/REST/SendActivationCodeForFamilyFile'; +const String INSERT_PATIENT_FILE = + 'Services/Authentication.svc/REST/Insert_SharePatientFile'; +const String CHECK_ACTIVATION_CODE = + 'Services/Authentication.svc/REST/CheckActivationCodeForFamilyFile'; + +const String UPDATE_FILE_STATUS = + 'Services/Authentication.svc/REST/Update_FileStatus'; +const String REMOVE_FILE_STATUS = + 'Services/Authentication.svc/REST/ActiveDeactive_PatientFile'; + +const String ACTIVATION_CODE_URL = + "Services/Authentication.svc/REST/CheckActivationCode"; +const String SENT_REQUEST_URL = + 'Services/Authentication.svc/REST/GetAllSharedRecordsByStatus'; +const String RECEVIED_REQUEST_URL = + 'Services/Authentication.svc/REST/GetAllPendingRecordsByResponseId'; +const ACCEPT_REJECT_FAMILY = + 'Services/Authentication.svc/REST/Update_FileStatus'; +const DEACTIVATE_FAMILY = + 'Services/Authentication.svc/REST/DeactivateRequestByRensponse'; + +class FamilyFilesProvider with ChangeNotifier { + bool isLogin = false; + bool isLoading = true; + dynamic authenticatedUser; + GetAllSharedRecordsByStatusResponse allSharedRecordsByStatusResponse; + Future getSharedRecordByStatus() async { + try { + dynamic localRes; + var request = GetAllSharedRecordsByStatusReq(); + var result = await sharedPref.getObject(MAIN_USER); + request.status = 0; + request.patientID = result["PatientID"]; + await new BaseAppClient().post(GET_SHARED_RECORD_BY_STATUS, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + throw error; + }, body: request.toJson()); + + sharedPref.setObject(FAMILY_FILE, localRes); + return Future.value( + GetAllSharedRecordsByStatusResponse.fromJson(localRes)); + } catch (error) { + print(error); + throw error; + } + } + + Future getUserViewRequest( + responseID) async { + try { + dynamic localRes; + Map request = {}; + request['ResponseID'] = responseID; + await new BaseAppClient().post(RECEVIED_REQUEST_URL, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + return Future.error(error); + }, body: request); + if (localRes != null) { + // sharedPref.setObject(FAMILY_FILE, localRes); + allSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse.fromJson(localRes); + return Future.value(allSharedRecordsByStatusResponse); + } else + return Future.error("No Data"); + } catch (error) { + print(error); + return Future.error(error); + } + } + + Future getUserSentRequest() async { + try { + dynamic localRes; + Map request = {}; + request['Status'] = 0; + await new BaseAppClient().post(SENT_REQUEST_URL, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + return Future.value(error); + //AppToast.showErrorToast(message: error); + //throw error; + }, body: request); + //sharedPref.setObject(FAMILY_FILE, localRes); + return Future.value( + GetAllSharedRecordsByStatusResponse.fromJson(localRes)); + } catch (error) { + print(error); + throw error; + } + } + + Future addFamilyFile(AddFamilyFileReq request) async { + try { + dynamic localRes; + // var request = GetAllSharedRecordsByStatusReq(); + //request.status = 0; + await new BaseAppClient().post(ADD_FAMILY_FILES, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + throw error; + }, body: request.toJson()); + //sharedPref.setObject(FAMILY_FILE, localRes); + return Future.value(localRes); + } catch (error) { + print(error); + + return Future.value(error); + } + } + + Future insertNewMember(InsertSharePatientFileReq request) async { + try { + dynamic localRes; + // var request = GetAllSharedRecordsByStatusReq(); + //request.status = 0; + await new BaseAppClient().post(INSERT_PATIENT_FILE, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request.toJson()); + + return Future.value(localRes); + } catch (error) { + print(error); + throw error; + } + } + + Future sendActivationCode( + cellNumber, zipCode, patientIdentificationID) async { + try { + dynamic localRes; + var request = SendActivationRequest(); + request.zipCode = zipCode; + request.patientMobileNumber = int.parse(cellNumber); + request.patientIdentificationID = patientIdentificationID; + request.projectOutSA = zipCode == '966' ? false : true; + request.loginType = request.searchType = 1; + request.oTPSendType = 1; + request.isRegister = false; + await new BaseAppClient().post(SEND_FAMILY_FILE_ACTIVATION, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + throw error; + }, body: request.toJson()); + + return Future.value(localRes); + } catch (error) { + print(error); + throw error; + } + } + + //TODO + Future checkActivationCode( + loginTokenID, activationCode, indentification, mobileNo) async { + try { + dynamic localRes; + Map request = {}; + // request['ZipCode'] = user.ZipCode; + request['PatientMobileNumber'] = mobileNo; + request['PatientIdentificationID'] = indentification; + request['LogInTokenID'] = loginTokenID; + request['activationCode'] = activationCode; + // this.authService.authenticateRequest(request); + await new BaseAppClient().post(CHECK_ACTIVATION_CODE, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + throw error; + }, body: request); + + return Future.value(localRes); + } catch (error) { + print(error); + throw error; + } + } + + Future acceptAndRejectRecievedRequests(id, stauts) async { + try { + dynamic localRes; + Map request = {}; + request['ID'] = id; + request['Status'] = stauts; + await new BaseAppClient().post(UPDATE_FILE_STATUS, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + throw error; + }, body: request); + + return Future.value(localRes); + } catch (error) { + print(error); + throw error; + } + } + + Future deativateActivateMemberFile(request) async { + try { + dynamic localRes; + + await new BaseAppClient().post(REMOVE_FILE_STATUS, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + throw error; + }, body: request); + + return Future.value(localRes); + } catch (error) { + print(error); + throw error; + } + } + + Future silentLoggin(GetAllSharedRecordsByStatusList switchUser, + {onSuccess, mainUser}) async { + Map request = {}; + if (mainUser == true) { + var currentUser = + AuthenticatedUser.fromJson(await sharedPref.getObject(MAIN_USER)); + //const request = new SwitchUserRequest(); + request['LogInTokenID'] = ''; + request['PatientOutSA'] = currentUser.outSA; //? 1 : 0; + request['PatientMobileNumber'] = + currentUser.mobileNumber; //['MobileNumber']; + request['SearchType'] = 2; + request['SuperUser'] = currentUser.patientID; //currentUser.PatientID; + request['PatientIdentificationID'] = ''; + request['IsSilentLogin'] = true; + request['PatientID'] = currentUser.patientID; //['PatientID']; + request['ZipCode'] = currentUser.outSA == 1 ? "971" : "966"; + request['activationCode'] = '0000'; + request['isRegister'] = false; + } else { + var currentUser = + AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + //const request = new SwitchUserRequest(); + + request['LogInTokenID'] = ''; + request['PatientOutSA'] = currentUser.outSA; //? 1 : 0; + request['PatientMobileNumber'] = + switchUser.mobileNumber; //['MobileNumber']; + request['SearchType'] = 2; + request['SuperUser'] = switchUser.patientID; //currentUser.PatientID; + request['PatientIdentificationID'] = ''; + request['IsSilentLogin'] = true; + request['PatientID'] = switchUser.responseID; //['PatientID']; + request['ZipCode'] = currentUser.outSA == 1 ? "971" : "966"; + request['activationCode'] = '0000'; + request['isRegister'] = false; + } + try { + dynamic localRes; + + await new BaseAppClient().post(ACTIVATION_CODE_URL, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + throw error; + }, body: request); + sharedPref.setString(BLOOD_TYPE, localRes['PatientBloodType']); + return Future.value(localRes); + } catch (error) { + print(error); + throw error; + } + } + + Future acceptRejectFamily(request) async { + try { + dynamic localRes; + + await new BaseAppClient().post(ACCEPT_REJECT_FAMILY, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + throw error; + }, body: request); + + return Future.value(localRes); + } catch (error) { + print(error); + throw error; + } + } + + Future deactivateFamily(request) async { + try { + dynamic localRes; + + await new BaseAppClient().post(DEACTIVATE_FAMILY, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + throw error; + }, body: request); + + return Future.value(localRes); + } catch (error) { + print(error); + throw error; + } + } +} diff --git a/lib/services/livecare_services/livecare_provider.dart b/lib/services/livecare_services/livecare_provider.dart new file mode 100644 index 00000000..285fa0bf --- /dev/null +++ b/lib/services/livecare_services/livecare_provider.dart @@ -0,0 +1,379 @@ +import 'dart:io'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/Request.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:flutter/material.dart'; + +class LiveCareService extends BaseService { + AppSharedPreferences sharedPref = AppSharedPreferences(); + AppGlobal appGlobal = new AppGlobal(); + + AuthenticatedUser authUser = new AuthenticatedUser(); + AuthProvider authProvider = new AuthProvider(); + + Future getLivecareClinics(BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": 0, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": "YckwoXhUmWBsnHKEKig", + "Age": authUser.age != null ? authUser.age : 0, + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "Gender": authUser.gender != null ? authUser.gender : 0 + }; + + dynamic localRes; + + await baseAppClient.post(GET_LIVECARE_CLINICS, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getLiveCareScheduledClinics(BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": 0, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": "YckwoXhUmWBsnHKEKig", + "Age": authUser.age != null ? authUser.age : 0, + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "Gender": authUser.gender != null ? authUser.gender : 0 + }; + + dynamic localRes; + + await baseAppClient.post(GET_LIVECARE_SCHEDULE_CLINICS, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getLiveCareScheduledDoctorList(BuildContext context, int serviceID) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": 0, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "ServiceID": serviceID, + "SessionID": "YckwoXhUmWBsnHKEKig", + "Age": authUser.age != null ? authUser.age : 0, + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "Gender": authUser.gender != null ? authUser.gender : 0 + }; + + dynamic localRes; + + await baseAppClient.post(GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getLivecareHistory(BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); +// Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "TokenID": "", + "SessionID": "YckwoXhUmWBsnHKEKig" + }; + + dynamic localRes; + + await baseAppClient.post(GET_LIVECARE_HISTORY, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getLivecareClinicTiming( + int serviceID, BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": 0, + "ServiceID": serviceID, + "DeviceTypeID": req.DeviceTypeID, + "SessionID": "YckwoXhUmWBsnHKEKig", + "Age": authUser.age != null ? authUser.age : 0, + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "Gender": authUser.gender != null ? authUser.gender : 0 + }; + + dynamic localRes; + + await baseAppClient.post(GET_LIVECARE_CLINIC_TIMING, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getERAppointmentFees(int serviceID, BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": 0, + "ServiceID": serviceID, + "ProjectID": 15, + "DeviceTypeID": req.DeviceTypeID, + "PatientType": authUser.patientType != null ? authUser.patientType : 0, + "PatientTypeID": authUser.patientType != null ? authUser.patientType : 0, + "SessionID": "YckwoXhUmWBsnHKEKig", + "Age": authUser.age != null ? authUser.age : 0, + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "Gender": authUser.gender != null ? authUser.gender : 0 + }; + + dynamic localRes; + + await baseAppClient.post(GET_ER_APPOINTMENT_FEES, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getERAppointmentTime(int serviceID, BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": 0, + "ServiceID": serviceID, + "ProjectID": 15, + "DeviceTypeID": req.DeviceTypeID, + "PatientType": authUser.patientType != null ? authUser.patientType : 0, + "PatientTypeID": authUser.patientType != null ? authUser.patientType : 0, + "SessionID": "YckwoXhUmWBsnHKEKig", + "Age": authUser.age != null ? authUser.age : 0, + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "Gender": authUser.gender != null ? authUser.gender : 0 + }; + + dynamic localRes; + + await baseAppClient.post(GET_ER_APPOINTMENT_TIME, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future addNewCallForPatientER( + int serviceID, String clientRequestID, BuildContext context) async { + Map request; + + String deviceToken; + getDeviceToken().then((value) { + print(value); + deviceToken = value; + }); + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": 0, + "ErServiceID": serviceID, + "ClientRequestID": clientRequestID, + "DeviceToken": deviceToken, + "VoipToken": "", + "Latitude": "24.708488", + "Longitude": "46.665925", + "DeviceType": Platform.isIOS ? 'iOS' : 'Android', + "PatientType": authUser.patientType != null ? authUser.patientType : 0, + "PatientTypeID": authUser.patientType != null ? authUser.patientType : 0, + "SessionID": "YckwoXhUmWBsnHKEKig", + "Age": authUser.age != null ? authUser.age : 0, + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "Gender": authUser.gender != null ? authUser.gender : 0 + }; + + dynamic localRes; + + await baseAppClient.post(ADD_NEW_CALL_FOR_PATIENT_ER, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getDeviceToken() async { + String deviceToken = await sharedPref.getString(PUSH_TOKEN); + return deviceToken; + } + + Future cancelLiveCareRequest(int vc_id, BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + request = {"VCID": vc_id}; + + dynamic localRes; + + await baseAppClient.post(CANCEL_LIVECARE_REQUEST, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future sendLiveCareInvoiceEmail(String appoNo, int projectID, + String emailAddress, BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + request = { + "To": emailAddress, + "ProjectID": projectID, + "AppointmentNo": appoNo + }; + + dynamic localRes; + + await baseAppClient.post(SEND_LIVECARE_INVOICE_EMAIL, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } +} diff --git a/lib/services/permission/permission_service.dart b/lib/services/permission/permission_service.dart new file mode 100644 index 00000000..ea408ce2 --- /dev/null +++ b/lib/services/permission/permission_service.dart @@ -0,0 +1,66 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/Request.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:localstorage/localstorage.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'package:vibration/vibration.dart'; +class PermissionService extends BaseService { + final LocalStorage storage = new LocalStorage("permission"); + + AppGlobal appGlobal = new AppGlobal(); + + setVibrationPermission(flag) async { + storage.setItem('isVibration', flag); + } + + isVibrationEnabled() { + return (storage.getItem('isVibration') ==null) || (storage.getItem('isVibration')) ==false ? false :true; + } + vibrate(callback, context) async{ + + if (callback == null) + return null; + if(isVibrationEnabled() ==true){ + if (await Vibration.hasVibrator()) { + Vibration.vibrate(duration: 100); + callback(); + } + }else{ + callback(); + } + } + + + setTheme(flag) async { + storage.setItem('isTheme', flag); + } + + isThemeEnabled() { + return storage.getItem('isTheme'); + } + cameraPermission() async{ + Map statuses = await [ + Permission.camera, + ].request(); + } + isCameraEnabled() async{ + print(await Permission.camera.status); + return await Permission.camera.status == PermissionStatus.granted ? true : false; + } + setCameraLocationPermission(context) async{ + Navigator.pop(context); + openAppSettings(); + } + isLocationEnabled() async{ + return await Permission.location.status == PermissionStatus.granted ? true : false; + } + openSettings() async{ + openAppSettings(); + } +} diff --git a/lib/services/robo_search/event_provider.dart b/lib/services/robo_search/event_provider.dart new file mode 100644 index 00000000..dda20978 --- /dev/null +++ b/lib/services/robo_search/event_provider.dart @@ -0,0 +1,30 @@ +import 'dart:async'; + +import 'package:flutter_tts/flutter_tts.dart'; + +class RobotProvider { + static final RobotProvider _singleton = RobotProvider._internal(); + var value; + StreamController controller = StreamController.broadcast(); + FlutterTts flutterTts = FlutterTts(); + getData() { + // return data; + } + intStream() { + controller.add({}); + } + + setValue(Map data) { + value = data; + controller.add(value); + } + + factory RobotProvider() { + return _singleton; + } + + RobotProvider._internal(); + speak(data) async { + await flutterTts.speak(data); + } +} diff --git a/lib/services/robo_search/search_provider.dart b/lib/services/robo_search/search_provider.dart new file mode 100644 index 00000000..82c32f91 --- /dev/null +++ b/lib/services/robo_search/search_provider.dart @@ -0,0 +1,47 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'dart:async'; + +import 'package:flutter/material.dart'; + +class SearchProvider with ChangeNotifier { + bool isLogin = false; + bool isLoading = true; + dynamic pageData = {}; + static bool isNewSession = false; + static var sessionID = new DateTime.now().millisecondsSinceEpoch; + Future getBotPages(request) async { + try { + request['SessionID'] = '123'; + await BaseAppClient().post(SEARCH_BOT, + onSuccess: (dynamic response, int statusCode) { + pageData = response; + + // notifyListeners(); + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + + return Future.value(pageData); + } catch (error) { + print(error); + throw error; + } + } + + setLisener(data) { + //SearchProvider.pageData = data; + //projectProvider.setSearchValue(pageData); + notifyListeners(); + } + + getSessionID() { + if (isNewSession == true) { + return new DateTime.now().millisecondsSinceEpoch; + } else { + return sessionID; + } + } +} diff --git a/lib/services/smartwatch_integration/SmartWatchIntegrationService.dart b/lib/services/smartwatch_integration/SmartWatchIntegrationService.dart new file mode 100644 index 00000000..3bfe62e3 --- /dev/null +++ b/lib/services/smartwatch_integration/SmartWatchIntegrationService.dart @@ -0,0 +1,54 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/Request.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:flutter/material.dart'; + +class SmartWatchIntegrationService extends BaseService { + AppSharedPreferences sharedPref = AppSharedPreferences(); + AppGlobal appGlobal = new AppGlobal(); + + AuthenticatedUser authUser = new AuthenticatedUser(); + AuthProvider authProvider = new AuthProvider(); + + Future getLastPatientRecord(BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": "YckwoXhUmWBsnHKEKig", + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "License": true + }; + + dynamic localRes; + + await baseAppClient.post(GET_PATIENT_LAST_RECORD, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + + } +} diff --git a/lib/splashPage.dart b/lib/splashPage.dart new file mode 100644 index 00000000..20da2ba6 --- /dev/null +++ b/lib/splashPage.dart @@ -0,0 +1,60 @@ +import 'dart:async'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import 'config/shared_pref_kay.dart'; +import 'config/size_config.dart'; +import 'core/service/AuthenticatedUserObject.dart'; +import 'core/service/privilege_service.dart'; +import 'core/viewModels/project_view_model.dart'; +import 'locator.dart'; +import 'models/Authentication/authenticated_user.dart'; +import 'widgets/transitions/slide_up_page.dart'; + +AppSharedPreferences sharedPref = new AppSharedPreferences(); +AuthenticatedUserObject authenticatedUserObject = + locator(); + +class SplashScreen extends StatefulWidget { + @override + _SplashScreenState createState() => _SplashScreenState(); +} + +class _SplashScreenState extends State { + PrivilegeService _privilegeService = locator(); + @override + void initState() { + super.initState(); + Timer( + Duration(seconds: 1, milliseconds: 500), + () { + loadPrivilege().then((value) { + Navigator.of(context).pushReplacement( + MaterialPageRoute( + builder: (BuildContext context) => LandingPage(), + ), + ); + }); + + }, + ); + } + + /// load the Privilege from service + Future loadPrivilege() async { + await _privilegeService.getPrivilege(); + Provider.of(context, listen: false).setPrivilegeModelList(privilege: _privilegeService.privilegeModelList); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + body: Image.asset('assets/images/powerd-by.jpg',fit: BoxFit.fitWidth,width: MediaQuery.of(context).size.width,), + ); + } +} diff --git a/lib/theme/theme_notifier.dart b/lib/theme/theme_notifier.dart new file mode 100644 index 00000000..e414d159 --- /dev/null +++ b/lib/theme/theme_notifier.dart @@ -0,0 +1,15 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/theme/theme_value.dart'; +import 'package:flutter/material.dart'; + +class ThemeNotifier with ChangeNotifier { + ThemeData _themeData = defaultTheme; + ThemeNotifier(this._themeData); + getTheme() => _themeData; + + setTheme(ThemeData themeData) async { + _themeData = themeData; + + notifyListeners(); + } +} diff --git a/lib/theme/theme_value.dart b/lib/theme/theme_value.dart new file mode 100644 index 00000000..d19e13b2 --- /dev/null +++ b/lib/theme/theme_value.dart @@ -0,0 +1,129 @@ +import 'dart:ui'; +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +/// ---- Default Theme ---- +/// + +//final projectProvider = Provider.of(AppGlobal.context); +final bluePrimary = Color(0xFF3F51B5); +final blueAccent = Color(0xFFFF9800); +final blueBackground = Color(0xFFFFFFFF); + +// ProjectViewModel projectProvider = Provider.of(AppGlobal.context); + final bwTheme = ThemeData( + //fontFamily: projectProvider.isArabic ? 'Cairo' : 'WorkSans', + primarySwatch: Colors.grey, + visualDensity: VisualDensity.adaptivePlatformDensity, + brightness: Brightness.light, + pageTransitionsTheme: const PageTransitionsTheme( + builders: { + TargetPlatform.android: ZoomPageTransitionsBuilder(), + TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), + }, + ), + hintColor: Colors.grey[400], + cardColor: Colors.black, + buttonColor: Colors.grey[400], + disabledColor: Colors.grey[300], + errorColor: Color.fromRGBO(235, 80, 60, 1.0), + scaffoldBackgroundColor: Colors.grey, + textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), + textSelectionHandleColor: Colors.grey, + canvasColor: Colors.white, + backgroundColor: Colors.grey, + highlightColor: Colors.grey[100].withOpacity(0.4), + splashColor: Colors.transparent, + primaryColor: Colors.grey, + bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), + cursorColor: Colors.grey, + + iconTheme: IconThemeData(), + appBarTheme: AppBarTheme( + color: Colors.black45, + brightness: Brightness.dark, + elevation: 10.0, + actionsIconTheme: IconThemeData( + color: Colors.grey, + ), + ), + ); + + final defaultTheme = ThemeData( + //fontFamily: ProjectViewModel().isArabic? 'Cairo' : 'WorkSans', + primarySwatch: Colors.blue, + visualDensity: VisualDensity.adaptivePlatformDensity, + brightness: Brightness.light, + pageTransitionsTheme: const PageTransitionsTheme( + builders: { + TargetPlatform.android: ZoomPageTransitionsBuilder(), + TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), + }, + ), + hintColor: Colors.grey[400], + disabledColor: Colors.grey[300], + errorColor: Color.fromRGBO(235, 80, 60, 1.0), + scaffoldBackgroundColor: Color(0xffEEEEEE), + textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), + textSelectionHandleColor: Colors.grey, + canvasColor: Colors.white, + backgroundColor: Colors.white, + highlightColor: Colors.grey[100].withOpacity(0.4), + splashColor: Colors.transparent, + primaryColor: Color(0xff40ACC9), + bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), + cursorColor: Colors.grey, + cardColor: Colors.white, + iconTheme: IconThemeData(), + appBarTheme: AppBarTheme( + color: Color(0xff40ACC9), + brightness: Brightness.dark, + elevation: 10.0, + actionsIconTheme: IconThemeData( + color: Color(0xff40ACC9), + ), + ), + ); + + final invertTheme = ThemeData( + //fontFamily: projectProvider.isArabic ? 'Cairo' : 'WorkSans', + primarySwatch: Colors.grey, + visualDensity: VisualDensity.adaptivePlatformDensity, + brightness: Brightness.light, + pageTransitionsTheme: const PageTransitionsTheme( + builders: { + TargetPlatform.android: ZoomPageTransitionsBuilder(), + TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), + }, + ), + hintColor: Colors.grey[400], + cardColor: Colors.black, + buttonColor: Colors.grey[400], + disabledColor: Colors.grey[300], + errorColor: Color.fromRGBO(235, 80, 60, 1.0), + scaffoldBackgroundColor: Colors.grey, + textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), + textSelectionHandleColor: Colors.grey, + canvasColor: Colors.white, + backgroundColor: Colors.grey, + highlightColor: Colors.grey[100].withOpacity(0.4), + splashColor: Colors.transparent, + primaryColor: Colors.grey, + bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), + cursorColor: Colors.grey, + + iconTheme: IconThemeData(), + appBarTheme: AppBarTheme( + color: Colors.grey, + brightness: Brightness.dark, + elevation: 10.0, + actionsIconTheme: IconThemeData( + color: Colors.grey, + ), + ), + ); + diff --git a/lib/uitl/CalendarUtils.dart b/lib/uitl/CalendarUtils.dart new file mode 100644 index 00000000..546d9b2d --- /dev/null +++ b/lib/uitl/CalendarUtils.dart @@ -0,0 +1,79 @@ +import 'dart:async'; +import 'dart:ui'; + +import 'package:device_calendar/device_calendar.dart'; + +final DeviceCalendarPlugin deviceCalendarPlugin = DeviceCalendarPlugin(); + +class CalendarUtils { + static Completer _completer; + + Calendar get writableCalendars => calendars?.firstWhere((c) => !c.isReadOnly); + List calendars; + + CalendarUtils._(this.calendars); + + static Future getInstance() async { + if (_completer == null) { + _completer = Completer(); + try { + final calendarsResult = await deviceCalendarPlugin.retrieveCalendars(); + _completer.complete(CalendarUtils._(calendarsResult?.data)); + } on Exception catch (e) { + _completer.completeError(e); + final Future sharedPrefsFuture = _completer.future; + _completer = null; + return sharedPrefsFuture; + } + } + return _completer.future; + } + + Future createOrUpdateEvents( + {List scheduleList, + String title, + String description, + List scheduleDateTime, + List daysOfWeek}) async { + List events = List(); + scheduleDateTime.forEach((element) { + RecurrenceRule recurrenceRule = RecurrenceRule( + RecurrenceFrequency.Daily, + daysOfWeek: daysOfWeek, + endDate: element, + ); + Event event = Event(writableCalendars.id, + recurrenceRule: recurrenceRule, + start: element, + end: element.add(Duration(minutes: 30)), + title: title, + description: description); + events.add(event); + }); + + events.forEach((element) { + deviceCalendarPlugin.createOrUpdateEvent(element); + }); + } + + deleteEvent(Calendar _calendar, Event _event) async { + await deviceCalendarPlugin.deleteEvent(_calendar.id, _event.eventId); + } + + Future retrieveEvents( + String calendarId, + RetrieveEventsParams retrieveEventsParams, + ) async { + return await deviceCalendarPlugin.retrieveEvents( + calendarId, retrieveEventsParams); + } + + Future createCalendar( + String calendarName, { + Color calendarColor, + String localAccountName, + }) async { + return await deviceCalendarPlugin.createCalendar(calendarName, + calendarColor: calendarColor, localAccountName: localAccountName); + } +} diff --git a/lib/uitl/HMGNetworkConnectivity.dart b/lib/uitl/HMGNetworkConnectivity.dart new file mode 100644 index 00000000..228edf93 --- /dev/null +++ b/lib/uitl/HMGNetworkConnectivity.dart @@ -0,0 +1,120 @@ +import 'dart:developer'; +import 'dart:io'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:wifi/wifi.dart'; + +import 'gif_loader_dialog_utils.dart'; + +class HMGNetworkConnectivity { + final BuildContext context; + final Function callBack; + + final String SSID = "HMG-MobileApp"; + + HMGNetworkConnectivity(this.context, this.callBack); + + void checkAndConnectIfNoInternet() async { + String pingUrl = "$BASE_URL$PING_SERVICE"; + // pingUrl = "https://captive.apple.com"; + + String ssid = await Wifi.ssid.catchError((error) { + log(error.toString()); + }); + + bool alreadyConnected = ssid == SSID; + + BaseAppClient().simpleGet(pingUrl, onSuccess: (dynamic response, int statusCode) { + log("Having internet with status code: $statusCode"); + }, onFailure: (String error, int statusCode) { + if (alreadyConnected) + showFailDailog(TranslationBase.of(context).failedToAccessHmgServices); + else { + confirmFromUser(); + } + }); + } + + void confirmFromUser() { + TranslationBase translator = TranslationBase.of(context); + ConfirmDialog( + context: context, + confirmMessage: translator.wantToConnectWithHmgNetwork, + okText: translator.yes, + okFunction: () { + ConfirmDialog.closeAlertDialog(context); + callBack(); + }, + cancelText: translator.no, + cancelFunction: () { + ConfirmDialog.closeAlertDialog(context); + }).showAlertDialog(context); + } + + void showFailDailog(String message) { + TranslationBase translator = TranslationBase.of(context); + AlertDialogBox( + context: context, + okText: translator.ok, + confirmMessage: message, + okFunction: () { + AlertDialogBox.closeAlertDialog(context); + }).showAlertDialog(context); + } + + // void next() { + // if (Platform.isIOS) { + // confirmFromUser_iOS(); + // } else if (Platform.isAndroid) { + // confirmFromUser(); + // } + // } + + // void confirmFromUser_iOS() { + // String message = "You don't have internet access, Do you want to connect with HMG Network to use App.\n\nMake sure you are in HMG Network range"; + // ConfirmDialog( + // context: context, + // confirmMessage: message, + // okText: "Yes", + // okFunction: () { + // ConfirmDialog.closeAlertDialog(context); + // callBack(); + // }, + // cancelText: "No", + // cancelFunction: () { + // ConfirmDialog.closeAlertDialog(context); + // }).showAlertDialog(context); + // } + + // void connect_Android() { + // // enable the Wifi if its off + // PlatformBridge() + // .enableWifiIfNot() + // .then((value) => { + // if (value == true) + // { + // callBack() + // // Wifi.list(SSID) + // // .then((value1) => { + // // if (value1.length > 0) {callBack()} else {log("No HMG network in range")} + // // }) + // // .catchError((e) { + // // log(e); + // // }) + // } + // }) + // .catchError((error) { + // showFailDailog(error); + // }); + // } +} diff --git a/lib/uitl/HMG_Geofence.dart b/lib/uitl/HMG_Geofence.dart new file mode 100644 index 00000000..54c789ba --- /dev/null +++ b/lib/uitl/HMG_Geofence.dart @@ -0,0 +1,189 @@ +// import 'dart:convert'; +// import 'dart:core'; +// import 'dart:io'; +// import 'dart:isolate'; +// import 'dart:math'; +// import 'dart:ui'; +// +// import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +// import 'package:diplomaticquarterapp/core/model/geofencing/requests/GeoZonesRequestModel.dart'; +// import 'package:diplomaticquarterapp/core/model/geofencing/requests/LogGeoZoneRequestModel.dart'; +// import 'package:diplomaticquarterapp/core/model/geofencing/responses/GeoZonesResponseModel.dart'; +// import 'package:diplomaticquarterapp/core/service/geofencing/GeofencingServices.dart'; +// import 'package:diplomaticquarterapp/locator.dart'; +// import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; +// import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +// import 'package:flutter/cupertino.dart'; +// import 'package:flutter/foundation.dart'; +// import 'package:geofencing/geofencing.dart'; +// +// class HMG_Geofencing { +// var _testTrigger = false; +// static var _isolatePortName = "hmg_geofencing_send_port"; +// +// List _zones; +// List registeredGeofences = []; +// +// final AndroidGeofencingSettings androidSettings = AndroidGeofencingSettings(initialTrigger: [GeofenceEvent.enter, GeofenceEvent.exit, GeofenceEvent.dwell], loiteringDelay: 1000 * 60); +// +// final BuildContext context; +// final List triggers = List(); +// +// HMG_Geofencing(this.context) { +// triggers.add(GeofenceEvent.enter); +// triggers.add(GeofenceEvent.exit); +// // triggers.add(GeofenceEvent.dwell); +// } +// +// Future loadZones() async{ +// _zones = await locator().getAllGeoZones(GeoZonesRequestModel()); +// return this; +// } +// +// void init() async { +// // debug check (Testing Geo Zones) +// if (kDebugMode) { +// addTestingGeofences(); +// } +// _saveZones(); +// await GeofencingManager.initialize(); +// await Future.delayed(Duration(seconds: 2)); +// _registerIsolatePort(); +// _registerGeofences().then((value) { +// debugPrint(value.toString()); +// if(_testTrigger) { +// var events = [GeofenceEvent.enter,GeofenceEvent.exit]; +// events.shuffle(); +// transitionTrigger(value, null, events.first); +// } +// }); +// +// } +// +// void _saveZones() { +// var list = List(); +// _zones.forEach((element) { +// list.add(element.toJson()); +// }); +// +// var jsonString = jsonEncode(list); +// AppSharedPreferences pref = AppSharedPreferences(); +// pref.setString(HMG_GEOFENCES, jsonString); +// } +// +// Future> _registerGeofences() async { +// registeredGeofences = await GeofencingManager.getRegisteredGeofenceIds(); +// +// var maxLimit = Platform.isIOS ? 20 : 100; +// +// if (registeredGeofences.length < maxLimit) { +// var notRegistered = _zones.where((element) => !(registeredGeofences.contains(element.geofenceId()))).toList(); +// for (int i = 0; i < notRegistered.length; i++) { +// var zone = notRegistered.elementAt(i); +// var lat = double.tryParse(zone.latitude); +// var lon = double.tryParse(zone.longitude); +// var rad = double.tryParse(zone.radius.toString()); +// +// if (lat != null || lon != null || rad != null) { +// await GeofencingManager.registerGeofence(GeofenceRegion(zone.geofenceId(), lat, lon, rad, triggers), transitionTrigger); +// registeredGeofences.add(zone.geofenceId()); +// if (registeredGeofences.length >= maxLimit) { +// break; +// } +// await Future.delayed(Duration(milliseconds: 100)); +// debugPrint("Geofence: ${zone.description} registered"); +// } else { +// debugPrint("Geofence: ${zone.description} registered"); +// } +// } +// } +// return registeredGeofences; +// } +// +// void addTestingGeofences() { +// _zones.add(GeoZonesResponseModel.get("24.777577,46.652675", 150, "msH")); +// _zones.add(GeoZonesResponseModel.get("24.691136,46.650116", 150, "zkH")); +// _zones.add(GeoZonesResponseModel.get("24.7087913,46.6656461", 150, "csO")); +// } +// +// static void transitionTrigger(List id, Location location, GeofenceEvent event) { +// var dataToSend = id.map((element) => {"event": event, "geofence_id": element}).toList() ?? []; +// final SendPort send = IsolateNameServer.lookupPortByName(_isolatePortName); +// send?.send(dataToSend); +// } +// +// ReceivePort _port = ReceivePort(); +// void _registerIsolatePort() async{ +// IsolateNameServer.registerPortWithName(_port.sendPort, _isolatePortName); +// _port.listen((dynamic data) { +// +// Future result = AppSharedPreferences().getStringWithDefaultValue(HMG_GEOFENCES,"[]"); +// result.then((jsonString){ +// +// List jsonList = json.decode(jsonString) ?? []; +// List geoList = jsonList.map((e) => GeoZonesResponseModel().fromJson(e)).toList() ?? []; +// +// (data as List).forEach((element) async { +// GeofenceEvent geofenceEvent = element["event"]; +// String geofence_id = element["geofence_id"]; +// +// GeoZonesResponseModel geoZone = _findByGeofenceFrom(geoList, by: geofence_id); +// if(geoZone != null) { +// LocalNotification.getInstance().showNow( +// title: "GeofenceEvent: ${_nameOf(geofenceEvent)}", +// subtitle: geoZone.description, +// payload: json.encode(geoZone.toJson())); +// +// _logGeoZoneToServer(zoneId: geoZone.geofId, transition: _idOf(geofenceEvent)); +// } +// +// await Future.delayed(Duration(milliseconds: 700)); +// +// }); +// +// }); +// }); +// } +// +// _logGeoZoneToServer({int zoneId, int transition}){ +// locator() +// .logGeoZone(LogGeoZoneRequestModel(GeoType: transition, PointsID: zoneId ?? 1)) +// .then((response){ +// +// }).catchError((error){ +// +// }); +// +// } +// +// GeoZonesResponseModel _findByGeofenceFrom(List list, { String by}) { +// var have = list.where((element) => element.geofenceId() == by).toList().first; +// return have; +// } +// +// String _nameOf(GeofenceEvent event) { +// switch (event) { +// case GeofenceEvent.enter: +// return "Enter"; +// case GeofenceEvent.exit: +// return "Exit"; +// case GeofenceEvent.dwell: +// return "dWell"; +// default: +// return event.toString(); +// } +// } +// +// int _idOf(GeofenceEvent event){ +// switch (event) { +// case GeofenceEvent.enter: +// return 1; +// case GeofenceEvent.exit: +// return 2; +// case GeofenceEvent.dwell: +// return 3; +// default: +// return -1; +// } +// } +// } diff --git a/lib/uitl/LocalNotification.dart b/lib/uitl/LocalNotification.dart new file mode 100644 index 00000000..e0367ba3 --- /dev/null +++ b/lib/uitl/LocalNotification.dart @@ -0,0 +1,131 @@ +import 'dart:math'; +import 'dart:typed_data'; +import 'dart:ui'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter_local_notifications/flutter_local_notifications.dart'; + +final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); + +class LocalNotification { + Function(String payload) _onNotificationClick; + static LocalNotification _instance; + static LocalNotification getInstance(){ + return _instance; + } + static init({Function(String payload) onNotificationClick}){ + if(_instance == null){ + _instance = LocalNotification(); + _instance._onNotificationClick = onNotificationClick; + _instance._initialize(); + }else{ + // assert(false,(){ + // //TODO fix it + // "LocalNotification Already Initialized"; + // }); + } + } + + _initialize(){ + var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon'); + var initializationSettingsIOS = IOSInitializationSettings(onDidReceiveLocalNotification: null); + var initializationSettings = InitializationSettings(initializationSettingsAndroid, initializationSettingsIOS); + flutterLocalNotificationsPlugin.initialize(initializationSettings, onSelectNotification: _onNotificationClick); + } + + var _random = new Random(); + _randomNumber({int from = 100000}){ + return _random.nextInt(from); + } + + _vibrationPattern(){ + var vibrationPattern = Int64List(4); + vibrationPattern[0] = 0; + vibrationPattern[1] = 1000; + vibrationPattern[2] = 5000; + vibrationPattern[3] = 2000; + + return vibrationPattern; + } + + Future showNow({@required String title, @required String subtitle, String payload}) { + Future.delayed(Duration(seconds: 1)).then((result) async { + var androidPlatformChannelSpecifics = AndroidNotificationDetails('com.hmg.local_notification', 'HMG', 'HMG', importance: Importance.Max, priority: Priority.High, ticker: 'ticker', vibrationPattern: _vibrationPattern()); + var iOSPlatformChannelSpecifics = IOSNotificationDetails(); + var platformChannelSpecifics = NotificationDetails(androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); + await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload); + }); + } + + Future scheduleNotification({@required DateTime scheduledNotificationDateTime, @required String title, @required String description}) async { + ///vibrationPattern + var vibrationPattern = Int64List(4); + vibrationPattern[0] = 0; + vibrationPattern[1] = 1000; + vibrationPattern[2] = 5000; + vibrationPattern[3] = 2000; + + var androidPlatformChannelSpecifics = AndroidNotificationDetails('active-prescriptions', 'ActivePrescriptions', 'ActivePrescriptionsDescription', + // icon: 'secondary_icon', + sound: RawResourceAndroidNotificationSound('slow_spring_board'), + + ///change it to be as ionic + // largeIcon: DrawableResourceAndroidBitmap('sample_large_icon'),///change it to be as ionic + vibrationPattern: vibrationPattern, + enableLights: true, + color: const Color.fromARGB(255, 255, 0, 0), + ledColor: const Color.fromARGB(255, 255, 0, 0), + ledOnMs: 1000, + ledOffMs: 500); + var iOSPlatformChannelSpecifics = IOSNotificationDetails(sound: 'slow_spring_board.aiff'); + + ///change it to be as ionic + // var platformChannelSpecifics = NotificationDetails( + // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); + // await flutterLocalNotificationsPlugin.schedule(0, title, description, + // scheduledNotificationDateTime, platformChannelSpecifics); + } + + ///Repeat notification every day at approximately 10:00:00 am + Future showDailyAtTime() async { + var time = Time(10, 0, 0); + var androidPlatformChannelSpecifics = AndroidNotificationDetails('repeatDailyAtTime channel id', 'repeatDailyAtTime channel name', 'repeatDailyAtTime description'); + var iOSPlatformChannelSpecifics = IOSNotificationDetails(); + // var platformChannelSpecifics = NotificationDetails( + // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); + // await flutterLocalNotificationsPlugin.showDailyAtTime( + // 0, + // 'show daily title', + // 'Daily notification shown at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}', + // time, + // platformChannelSpecifics); + } + + ///Repeat notification weekly on Monday at approximately 10:00:00 am + Future showWeeklyAtDayAndTime() async { + var time = Time(10, 0, 0); + var androidPlatformChannelSpecifics = AndroidNotificationDetails('show weekly channel id', 'show weekly channel name', 'show weekly description'); + var iOSPlatformChannelSpecifics = IOSNotificationDetails(); + // var platformChannelSpecifics = NotificationDetails( + // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); + // await flutterLocalNotificationsPlugin.showWeeklyAtDayAndTime( + // 0, + // 'show weekly title', + // 'Weekly notification shown on Monday at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}', + // Day.Monday, + // time, + // platformChannelSpecifics); + } + + String _toTwoDigitString(int value) { + return value.toString().padLeft(2, '0'); + } + + Future cancelNotification() async { + await flutterLocalNotificationsPlugin.cancel(0); + } + + Future cancelAllNotifications() async { + await flutterLocalNotificationsPlugin.cancelAll(); + } +} diff --git a/lib/uitl/PlatformBridge.dart b/lib/uitl/PlatformBridge.dart new file mode 100644 index 00000000..3ad91cdd --- /dev/null +++ b/lib/uitl/PlatformBridge.dart @@ -0,0 +1,152 @@ +import 'dart:developer'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/localized_values.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/services.dart'; + +class PlatformBridge { + static const platform = const MethodChannel("HMG-Platform-Bridge"); + static PlatformBridge _shared; + static BuildContext _context; + + // // Singleton + // static final PlatformBridge _singleton = PlatformBridge._internal(); + // factory PlatformBridge() { + // return _singleton; + // } + // PlatformBridge._internal(); + + static PlatformBridge shared() { + if (_shared == null) { + assert(true, "PlatformBridge is not initialized, (Initialized it by calling 'PlatformBridge.init(BuildContext))'."); + } + return _shared; + } + + static void init(BuildContext context) { + _context = context; + _shared = PlatformBridge(); + + Future incoming(MethodCall methodCall) async { + switch (methodCall.method) { + case 'localizedValue': + String key = methodCall.arguments.toString(); + return localizedValue(key); + + case 'getGeoZones': + return getGeoZones(); + + case 'getLogGeofenceFullUrl': + return getLogGeofenceFullUrl(); + + case 'getDefaultHttpParameters': + return getDefaultHttpParameters(); + + default: + throw MissingPluginException('notImplemented'); + } + } + + platform.setMethodCallHandler(incoming); + } + + //--------------------------------- + // Incoming below + //--------------------------------- + static Future localizedValue(String forKey) async { + String currentLanguage = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Object localized = platformLocalizedValues[forKey][currentLanguage]; + return (localized != null || (localized is String)) ? localized : forKey; + } + + static Future getGeoZones() async { + var res = await sharedPref.getStringWithDefaultValue(HMG_GEOFENCES, "[]"); + return res; + } + + static Future getLogGeofenceFullUrl() async { + var res = BASE_URL + LOG_GEO_ZONES; + return res; + } + + static Future getDefaultHttpParameters() async { + return BaseAppClient.defaultHttpParameters(); + } + + //--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--// + //--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--// + + //--------------------------------- + // Outgoing below + //--------------------------------- + // Method Names + static const hmg_internet_wifi_connect_method = "connectHMGInternetWifi"; + static const hmg_guest_wifi_connect_method = "connectHMGGuestWifi"; + static const is_hmg_network_available_method = "isHMGNetworkAvailable"; + static const enable_wifi_if_not = "enableWifiIfNot"; + static const show_loading_method = "loading"; + static const register_Hmg_Geofences = "registerHmgGeofences"; + static const un_register_Hmg_Geofences = "unRegisterHmgGeofences"; + + Future connectHMGInternetWifi(String patientId) { + print("Invoking platform method: $hmg_internet_wifi_connect_method"); + try { + return platform.invokeMethod(hmg_internet_wifi_connect_method, [patientId]); + } on PlatformException catch (e) { + print(e); + return Future.error(e); + } + } + + Future connectHMGGuestWifi() { + print("Invoking platform method: $hmg_guest_wifi_connect_method"); + try { + return platform.invokeMethod(hmg_guest_wifi_connect_method); + } on PlatformException catch (e) { + print(e); + return Future.error(e); + } + } + + Future isHMGNetworkAvailable(String ssid) { + print("Invoking platform method: $is_hmg_network_available_method"); + try { + return platform.invokeMethod(is_hmg_network_available_method, ssid); + } on PlatformException catch (e) { + print(e); + return Future.error(e); + } + } + + Future enableWifiIfNot() async { + print("Invoking platform method: $enable_wifi_if_not"); + try { + return platform.invokeMethod(enable_wifi_if_not); + } on PlatformException catch (e) { + print(e); + return Future.error(e); + } + } + + void showLoading(String message, bool show) async { + print("Invoking platform method: $show_loading_method"); + try { + var result = await platform.invokeMethod(show_loading_method, [message, show]); + } on PlatformException catch (e) { + print(e); + } + } + + // GEO Fences + void registerHmgGeofences() async { + var result = await platform.invokeMethod(register_Hmg_Geofences); + } + + void unRegisterHmgGeofences() async { + var result = await platform.invokeMethod(un_register_Hmg_Geofences); + } +} diff --git a/lib/uitl/ProgressDialog.dart b/lib/uitl/ProgressDialog.dart new file mode 100644 index 00000000..6820a6d5 --- /dev/null +++ b/lib/uitl/ProgressDialog.dart @@ -0,0 +1,26 @@ +import 'package:flutter/material.dart'; + +AlertDialog _alert = AlertDialog( + content: Row( + children: [ + CircularProgressIndicator(), + Container(margin: EdgeInsets.only(left: 7), child: Text("Loading...")), + ], + ), +); + +class ProgressDialogUtil { + static showProgressDialog(BuildContext context) { + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return _alert; + }, + ); + } + + static hideProgressDialog(BuildContext context) { + Navigator.pop(context); + } +} diff --git a/lib/uitl/app_shared_preferences.dart b/lib/uitl/app_shared_preferences.dart index 86a30f79..3ea323df 100644 --- a/lib/uitl/app_shared_preferences.dart +++ b/lib/uitl/app_shared_preferences.dart @@ -47,6 +47,13 @@ class AppSharedPreferences { return prefs.getString(key); } + /// Get String [key] the key was saved + getStringWithDefaultValue(String key, String defaultVal) async { + final SharedPreferences prefs = await _prefs; + String value = prefs.getString(key); + return value == null ? defaultVal : value; + } + /// Get List of String [key] the key was saved getStringList(String key) async { final SharedPreferences prefs = await _prefs; diff --git a/lib/uitl/app_toast.dart b/lib/uitl/app_toast.dart index 8e45e3ce..5c917009 100644 --- a/lib/uitl/app_toast.dart +++ b/lib/uitl/app_toast.dart @@ -64,7 +64,7 @@ class AppToast { FlutterFlexibleToast.showToast( message: message, toastLength: toastLength, - timeInSeconds: timeInSeconds, + timeInSeconds: timeInSeconds=2, fontSize: fontSize, toastGravity: toastGravity, backgroundColor: Colors.green, @@ -87,7 +87,7 @@ class AppToast { static void showErrorToast({ @required String message, Toast toastLength = Toast.LENGTH_LONG, - int timeInSeconds, + int timeInSeconds=2, double fontSize = 16, ToastGravity toastGravity = ToastGravity.TOP, Color textColor = Colors.white, diff --git a/lib/uitl/cupertino_picker.dart b/lib/uitl/cupertino_picker.dart index 34da2f66..d40d4b39 100644 --- a/lib/uitl/cupertino_picker.dart +++ b/lib/uitl/cupertino_picker.dart @@ -3,37 +3,52 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - -class CupertinoPickerUtils{ - +class CupertinoPickerUtils { int cupertinoPickerIndex = 0; /// show Cupertino Picker for any list [context] the page BuildContext /// [items] the list of items we need to show /// [onSelectFun] the call function on select event - ///The [isDismissible] parameter specifies whether the bottom sheet will be + /// [isDismissible] parameter specifies whether the bottom sheet will be /// dismissed when user taps on the scrim. + + /// [itemExtent] All children will be given the [BoxConstraints] to match this exact + /// height. Must not be null and must be positive. + + /// The [looping] argument decides whether the child list loops and can be + /// scrolled infinitely. If set to true, scrolling past the end of the list + /// will loop the list back to the beginning. If set to false, the list will + /// stop scrolling when you reach the end or the beginning. + + /// [backgroundColor] background color showCupertinoPicker( - {context, items, decKey, onSelectFun, bool isDismissible = false}) { + {BuildContext context, + List items, + String decKey, + Function onSelectFun, + bool isDismissible = false, + double itemExtent = 25, + bool looping = true, + Color backgroundColor = const Color(0xfff7f7f7)}) { showModalBottomSheet( isDismissible: isDismissible, context: context, builder: (BuildContext builder) { return Container( height: SizeConfig.realScreenHeight * 0.4, - color: Color(0xfff7f7f7), + color: backgroundColor, child: Column( mainAxisAlignment: MainAxisAlignment.end, children: [ Container( - color: Color(0xfff7f7f7), + color: backgroundColor, child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ CupertinoButton( child: Text(TranslationBase.of(context).cancel, style: - TextStyle(color: Theme.of(context).primaryColor)), + TextStyle(color: Theme.of(context).primaryColor)), onPressed: () { Navigator.pop(context); }, @@ -53,8 +68,14 @@ class CupertinoPickerUtils{ ), Container( height: SizeConfig.realScreenHeight * 0.3, - color: Color(0xfff7f7f7), - child: buildPickerItems(context, items, decKey, onSelectFun)) + color: backgroundColor, + child: buildPickerItems( + context: context, + decKey: decKey, + itemExtent: itemExtent, + items: items, + looping: looping, + onSelectFun: onSelectFun)) ], ), ); @@ -67,22 +88,28 @@ class CupertinoPickerUtils{ /// [items] the list of items we need to show /// [onSelectFun] the call function on select event /// [decKey] the key we show for user - buildPickerItems(context, List items, decKey, onSelectFun) { + buildPickerItems( + {BuildContext context, + List items, + String decKey, + Function onSelectFun, + double itemExtent, + bool looping}) { return CupertinoPicker( magnification: 1.5, scrollController: - FixedExtentScrollController(initialItem: cupertinoPickerIndex), + FixedExtentScrollController(initialItem: cupertinoPickerIndex), children: items.map((item) { return Text( '${item["$decKey"]}', style: TextStyle(fontSize: SizeConfig.textMultiplier * 2), ); }).toList(), - itemExtent: 25, - looping: true, + itemExtent: itemExtent, + looping: looping, onSelectedItemChanged: (int index) { cupertinoPickerIndex = index; }, ); } -} \ No newline at end of file +} diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index db735892..79932c1c 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -1,17 +1,65 @@ -class DateUtil { +import 'package:device_calendar/device_calendar.dart'; +import 'package:intl/intl.dart'; +class DateUtil { /// convert String To Date function /// [date] String we want to convert static DateTime convertStringToDate(String date) { + if (date != null) { + const start = "/Date("; + const end = "+0300)"; + final startIndex = date.indexOf(start); + final endIndex = date.indexOf(end, startIndex + start.length); + return DateTime.fromMillisecondsSinceEpoch( + int.parse( + date.substring(startIndex + start.length, endIndex), + ), + ); + } else + return DateTime.now(); + } + + static DateTime convertStringToDateTime(String date) { + if (date != null) { + try { + var dateT = date.split('/'); + var year = dateT[2].substring(0, 4); + var dateP = + DateTime(int.parse(year), int.parse(dateT[1]), int.parse(dateT[0])); + return dateP; + } catch (e) { + print(e); + } + + return DateTime.now(); + } else + return DateTime.now(); + } + + static String convertDateToString(DateTime date) { const start = "/Date("; const end = "+0300)"; - final startIndex = date.indexOf(start); - final endIndex = date.indexOf(end, startIndex + start.length); - return DateTime.fromMillisecondsSinceEpoch( - int.parse( - date.substring(startIndex + start.length, endIndex), - ), - ); + int milliseconds = date.millisecondsSinceEpoch; + + return start + "$milliseconds" + end; + } + + static String convertDateToStringLocation(DateTime date) { + const start = "/Date("; + const end = ")/"; + int milliseconds = date.millisecondsSinceEpoch; + + return start + "$milliseconds" + end; + } + + static String yearMonthDay(DateTime dateTime) { + String dateFormat = '${dateTime.year}-${dateTime.month}-${dateTime.day}'; + return dateFormat; + } + + static String time(DateTime dateTime) { + String dateFormat = '${dateTime.hour}:${dateTime.minute}:00'; + return dateFormat; } /// check Date @@ -39,37 +87,118 @@ class DateUtil { return "Old Date"; } + static String getDateFormatted(String date) { + DateTime dateObj = DateUtil.convertStringToDate(date); + return DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString(); + } + /// get month by /// [month] convert month number in to month name static getMonth(int month) { switch (month) { case 1: - return "Jan"; + return "January"; case 2: - return "Feb"; + return "February"; case 3: - return "Mar"; + return "March"; case 4: - return "Apr"; + return "April"; case 5: return "May"; case 6: - return "Jun"; + return "June"; case 7: - return "Jul"; + return "July"; case 8: - return "Aug"; + return "August"; case 9: - return "Sep"; + return "September"; case 10: - return "Oct"; + return "October"; case 11: - return "Nov"; + return "November"; case 12: - return "Dec"; + return "December"; } } + /// get month by + /// [month] convert month number in to month name in Arabic + static getMonthArabic(int month) { + switch (month) { + case 1: + return "يناير"; + case 2: + return " فبراير"; + case 3: + return "مارس"; + case 4: + return "أبريل"; + case 5: + return "مايو"; + case 6: + return "يونيو"; + case 7: + return "يوليو"; + case 8: + return "أغسطس"; + case 9: + return "سبتمبر"; + case 10: + return " اكتوبر"; + case 11: + return " نوفمبر"; + case 12: + return "ديسمبر"; + } + } + + static getMonthByName(String month) { + switch (month.toLowerCase()) { + case 'january': + return 1; + case 'february': + return 2; + case 'march': + return 3; + case 'april': + return 4; + case 'may': + return 5; + case 'june': + return 6; + case 'july': + return 7; + case 'august': + return 8; + case 'september': + return 9; + case 'october': + return 10; + case 'november': + return 11; + case 'december': + return 12; + } + } + + static getMonthDateTime(String month, yearName) { + DateTime date; + try { + date = DateTime(int.parse(yearName), getMonthByName(month)); + } catch (e) { + print(e); + } + return date ?? DateTime.now(); + } + /// get month by /// [weekDay] convert week day in int to week day name static getWeekDay(int weekDay) { @@ -91,6 +220,26 @@ class DateUtil { } } + /// get month by + /// [weekDay] convert week day in int to week day name arabic + static getWeekDayArabic(int weekDay) { + switch (weekDay) { + case 1: + return "الاثنين"; + case 2: + return "الثلاثاء"; + case 3: + return "الاربعاء"; + case 4: + return "الخميس"; + case 5: + return "الجمعه"; + case 6: + return "السبت "; + case 7: + return "الاحد"; + } + } /// get data formatted like Apr 26,2020 /// [dateTime] convert DateTime to data formatted @@ -99,17 +248,69 @@ class DateUtil { return getMonth(dateTime.month) + " " + dateTime.day.toString() + - "," + + ", " + dateTime.year.toString(); else return ""; } + /// get data formatted like Apr 26,2020 + /// [dateTime] convert DateTime to data formatted Arabic + static String getMonthDayYearDateFormattedAr(DateTime dateTime) { + if (dateTime != null) + return getMonthArabic(dateTime.month) + + " " + + dateTime.day.toString() + + ", " + + dateTime.year.toString(); + else + return ""; + } + + /// get data formatted like Thursday, Apr 26,2020 + /// [dateTime] convert DateTime to date formatted + static String getWeekDayMonthDayYearDateFormatted( + DateTime dateTime, String lang) { + if (dateTime != null) + return lang == 'en' + ? getDay(dateTime.weekday.getDayOfWeekEnumValue) + + ", " + + getMonth(dateTime.month) + + " " + + dateTime.day.toString() + + " " + + dateTime.year.toString() + : getWeekDayArabic(dateTime.weekday) + + ", " + + dateTime.day.toString() + + " " + + getMonthArabic(dateTime.month) + + " " + + dateTime.year.toString(); + else + return ""; + } + static String getMonthDayYearLangDateFormatted( + DateTime dateTime, String lang) { + if (dateTime != null) + return lang == 'en' + ? getMonth(dateTime.month) + + " " + + dateTime.day.toString() + + " " + + dateTime.year.toString() + : dateTime.day.toString() + + " " + + getMonthArabic(dateTime.month) + + " " + + dateTime.year.toString(); + else + return ""; + } /// get data formatted like 26/4/2020 /// [dateTime] convert DateTime to data formatted static String getDayMonthYearDateFormatted(DateTime dateTime) { - print(dateTime); if (dateTime != null) return dateTime.day.toString() + "/" + @@ -119,4 +320,77 @@ class DateUtil { else return ""; } + + /// get data formatted like 26/4/2020 10:30 + /// [dateTime] convert DateTime to data formatted + static String getDayMonthYearHourMinuteDateFormatted(DateTime dateTime) { + if (dateTime != null) + return dateTime.day.toString() + + "/" + + dateTime.month.toString() + + "/" + + dateTime.year.toString() + + " " + + dateTime.hour.toString() + + ":" + + dateTime.minute.toString(); + else + return ""; + } + + /// get data formatted like 2020-8-13 09:43:00 + /// [dateTime] convert DateTime to data formatted + static String getYearMonthDayHourMinSecDateFormatted(DateTime dateTime) { + if (dateTime != null) + return dateTime.year.toString() + + "-" + + dateTime.month.toString() + + "-" + + dateTime.day.toString() + + " " + + dateTime.hour.toString() + + ":" + + dateTime.minute.toString() + + ":" + + dateTime.second.toString(); + else + return ""; + } + + static convertISODateToJsonDate(String isoDate) { + return "/Date(" + + DateFormat('mm-dd-yyy') + .parse(isoDate) + .millisecondsSinceEpoch + .toString() + + ")/"; + } + + static String getDay(DayOfWeek dayOfWeek) { + switch (dayOfWeek) { + case DayOfWeek.Monday: + return "Monday"; + break; + case DayOfWeek.Tuesday: + return "Tuesday"; + break; + case DayOfWeek.Wednesday: + return "Wednesday"; + break; + case DayOfWeek.Thursday: + return "Thursday"; + break; + case DayOfWeek.Friday: + return "Friday"; + break; + case DayOfWeek.Saturday: + return "Saturday"; + break; + case DayOfWeek.Sunday: + return "Sunday"; + + break; + } + return ""; + } } diff --git a/lib/uitl/gif_loader_dialog_utils.dart b/lib/uitl/gif_loader_dialog_utils.dart new file mode 100644 index 00000000..ac37cdfb --- /dev/null +++ b/lib/uitl/gif_loader_dialog_utils.dart @@ -0,0 +1,13 @@ +import 'package:flutter/material.dart'; + +import '../widgets/Loader/gif_loader_container.dart'; + +class GifLoaderDialogUtils { + static showMyDialog(BuildContext context) { + showDialog(context: context, child: GifLoaderContainer()); + } + + static hideDialog(BuildContext context) { + Navigator.of(context).pop(); + } +} diff --git a/lib/uitl/location_util.dart b/lib/uitl/location_util.dart new file mode 100644 index 00000000..c3799425 --- /dev/null +++ b/lib/uitl/location_util.dart @@ -0,0 +1,73 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:geolocator/geolocator.dart'; + +class LocationUtils { + AppSharedPreferences sharedPref = new AppSharedPreferences(); + + bool isShowConfirmDialog; + BuildContext context; + + LocationUtils({@required this.isShowConfirmDialog, @required this.context}); + + void getCurrentLocation() async { + print("current location"); + Geolocator.isLocationServiceEnabled().then((value) { + if (value) { + Geolocator.checkPermission().then((permission) { + if (permission == LocationPermission.always || + permission == LocationPermission.whileInUse) { + Geolocator.getLastKnownPosition() + .then((value) => setLocation(value)); + } + + if (permission == LocationPermission.denied || + permission == LocationPermission.deniedForever) { + setZeroLocation(); + if (isShowConfirmDialog) showErrorLocationDialog(false); + } + }).catchError((err) { + print(err); + }); + } else { + if (isShowConfirmDialog) showErrorLocationDialog(false); + } + }).catchError((err) { + print(err); + }); + } + + showErrorLocationDialog(bool isPermissionError) { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: TranslationBase.of(context).locationDialogMessage, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => { + ConfirmDialog.closeAlertDialog(context), + if (isPermissionError) + Geolocator.openAppSettings() + else + Geolocator.openLocationSettings() + }, + cancelFunction: () => {}); + return dialog.showAlertDialog(context); + } + + void setLocation(Position position) { + this + .sharedPref + .setDouble(USER_LAT, position != null ? position.latitude : 0.0); + this + .sharedPref + .setDouble(USER_LONG, position != null ? position.longitude : 0.0); + } + + void setZeroLocation() { + this.sharedPref.setDouble(USER_LAT, 0.0); + this.sharedPref.setDouble(USER_LONG, 0.0); + } +} diff --git a/lib/uitl/navigation_service.dart b/lib/uitl/navigation_service.dart new file mode 100644 index 00000000..d4cd426b --- /dev/null +++ b/lib/uitl/navigation_service.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; + +class NavigationService { + final GlobalKey navigatorKey = + new GlobalKey(); + + Future navigateTo(String routeName) { + return navigatorKey.currentState.pushNamed(routeName); + } +} diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 4c1b4446..418ff732 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'package:diplomaticquarterapp/config/localized_values.dart'; +import 'package:diplomaticquarterapp/pages/symptom-checker/select-gender.dart'; import 'package:flutter/foundation.dart' show SynchronousFuture; import 'package:flutter/material.dart'; @@ -13,8 +14,11 @@ class TranslationBase { return Localizations.of(context, TranslationBase); } - String get dashboardScreenToolbarTitle => - localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; + String by(String key) { + return localizedValues[key][locale.languageCode]; + } + + String get dashboardScreenToolbarTitle => localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; String get settings => localizedValues['settings'][locale.languageCode]; @@ -27,6 +31,935 @@ class TranslationBase { String get cancel => localizedValues['cancel'][locale.languageCode]; String get done => localizedValues['done'][locale.languageCode]; + + String get home => localizedValues['home'][locale.languageCode]; + + String get services => localizedValues['services'][locale.languageCode]; + + String get mySchedule => localizedValues['mySchedule'][locale.languageCode]; + + String get replay2 => localizedValues['replay2'][locale.languageCode]; + + String get logout => localizedValues['logout'][locale.languageCode]; + + String get bookAppo => localizedValues['bookAppo'][locale.languageCode]; + + String get searchBy => localizedValues['searchBy'][locale.languageCode]; + + String get clinic => localizedValues['clinic'][locale.languageCode]; + + String get name => localizedValues['name'][locale.languageCode]; + + String get doctor => localizedValues['doctor'][locale.languageCode]; + + String get clinicName => localizedValues['clinicName'][locale.languageCode]; + + String get doctorName => localizedValues['doctorName'][locale.languageCode]; + + String get nearestAppo => localizedValues['nearestAppo'][locale.languageCode]; + + String get searchByDocText => + localizedValues['searchByDocText'][locale.languageCode]; + + String get enterDocName => + localizedValues['enterDocName'][locale.languageCode]; + + String get search => localizedValues['search'][locale.languageCode]; + + String get bookNow => localizedValues['bookNow'][locale.languageCode]; + + String get docInfo => localizedValues['docInfo'][locale.languageCode]; + + String get appoInfo => localizedValues['appoInfo'][locale.languageCode]; + + String get availableAppo => + localizedValues['availableAppo'][locale.languageCode]; + + String get gender => localizedValues['gender'][locale.languageCode]; + + String get nationality => localizedValues['nationality'][locale.languageCode]; + + String get docQualifications => + localizedValues['docQualifications'][locale.languageCode]; + + String get confirmAppoHeading => + localizedValues['confirmAppoHeading'][locale.languageCode]; + + String get patientInfo => localizedValues['patientInfo'][locale.languageCode]; + + String get bookSuccess => localizedValues['bookSuccess'][locale.languageCode]; + + String get patientShare => localizedValues['patientShare'][locale.languageCode]; + + String get patientShareWithTax => localizedValues['patientShareWithTax'][locale.languageCode]; + + String get confirmAppo => localizedValues['confirmAppo'][locale.languageCode]; + + String get confirm => localizedValues['confirm'][locale.languageCode]; + + String get confirmLiveCare => localizedValues['confirmLiveCare'][locale.languageCode]; + + String get waitingForDoctor => localizedValues['waitingForDoctor'][locale.languageCode]; + + String get confirmLater => localizedValues['confirmLater'][locale.languageCode]; + + String get todoList => localizedValues['todoList'][locale.languageCode]; + + String get appoActions => localizedValues['appoActions'][locale.languageCode]; + + String get appointment => localizedValues['appointment'][locale.languageCode]; + + String get hospital => localizedValues['hospital'][locale.languageCode]; + + String get date => localizedValues['date'][locale.languageCode]; + + String get time => localizedValues['time'][locale.languageCode]; + + String get login => localizedValues['login'][locale.languageCode]; + + String get loginregister => localizedValues['loginregister'][locale.languageCode]; + + String get poweredBy => localizedValues['poweredBy'][locale.languageCode]; + + String get welcome => localizedValues['welcome'][locale.languageCode]; + + String get welcomeText => localizedValues['welcome_text'][locale.languageCode]; + + String get welcomeText2 => localizedValues['welcome_text2'][locale.languageCode]; + + String get yes => localizedValues['yes'][locale.languageCode]; + + String get no => localizedValues['no'][locale.languageCode]; + + String get logintypeRadio => localizedValues['logintyperadio'][locale.languageCode]; + String get registerInfoFamily => localizedValues['register-info-family'][locale.languageCode]; + + String get registerNow => localizedValues['registernow'][locale.languageCode]; + + String get nationalID => localizedValues['nationalID'][locale.languageCode]; + + String get idNo => localizedValues['national-id'][locale.languageCode]; + + String get fileNo => localizedValues['fileNo'][locale.languageCode]; + String get fileno => localizedValues['fileno'][locale.languageCode]; + String get forgotPassword => localizedValues['forgotFileNo'][locale.languageCode]; + + String get forgotFileNoTitle => localizedValues['forgotFileNoTitle'][locale.languageCode]; + + String get enterNationalId => localizedValues['enter-national-id'][locale.languageCode]; + + String get profileInfo => localizedValues['profile-info'][locale.languageCode]; + + String get submit => localizedValues['submit'][locale.languageCode]; + + String get forgotDesc => localizedValues['forgot-desc'][locale.languageCode]; + + String get dob => localizedValues['dob'][locale.languageCode]; + + String get hijriDate => localizedValues['hijri-date'][locale.languageCode]; + + String get gregorianDate => + localizedValues['gregorian-date'][locale.languageCode]; + + String get verifyLoginWith => + localizedValues['verify-login-with'][locale.languageCode]; + + String get register => localizedValues['register-user'][locale.languageCode]; + + String get verifyFingerprint => + localizedValues['verify-with-fingerprint'][locale.languageCode]; + + String get verifyFaceID => + localizedValues['verify-with-faceid'][locale.languageCode]; + + String get verifySMS => + localizedValues['verify-with-sms'][locale.languageCode]; + + String get verifyWhatsApp => + localizedValues['verify-with-whatsapp'][locale.languageCode]; + + String get lastLoginAt => localizedValues['last-login'][locale.languageCode]; + + String get lastLoginWith => + localizedValues['last-login-with'][locale.languageCode]; + + String get verifyFingerprint2 => + localizedValues['verify-fingerprint'][locale.languageCode]; + + String get searchMedicine => + localizedValues['searchMedicine'][locale.languageCode]; + + String get searchMedicineHere => + localizedValues['searchMedicineHere'][locale.languageCode]; + + String get pendingPayment => + localizedValues['pendingPayment'][locale.languageCode]; + + String get payNow => localizedValues['payNow'][locale.languageCode]; + + String get viewQR => localizedValues['viewQR'][locale.languageCode]; + + String get instruction => localizedValues['instruction'][locale.languageCode]; + + String get livecare => localizedValues['livecare'][locale.languageCode]; + + String get upcomingNoAction => + localizedValues['upcoming-noAction'][locale.languageCode]; + + String get upcomingConfirm => + localizedValues['upcoming-confirm'][locale.languageCode]; + + String get upcomingPaymentPending => localizedValues['upcoming-payment-pending'][locale.languageCode]; + String get upcomingConfirmMore => + localizedValues['book-success-confirm-more-24-1-2'][locale.languageCode]; + + + String get upcomingPaymentNow => localizedValues['upcoming-payment-now'][locale.languageCode]; + + String get upcomingQR => localizedValues['upcoming-QR'][locale.languageCode]; + + String get upcomingVirtual => localizedValues['upcoming-virtual'][locale.languageCode]; + + String get upcomingLivecare => localizedValues['upcoming-livecare'][locale.languageCode]; + + String get liveCareAppo => localizedValues['livecareAppo'][locale.languageCode]; + + String get upcomingDetails => localizedValues['upcoming-details'][locale.languageCode]; + + String get reschedule => localizedValues['reschedule'][locale.languageCode]; + + String get raise => localizedValues['raise'][locale.languageCode]; + + String get complaint => localizedValues['complaint'][locale.languageCode]; + + String get add => localizedValues['add'][locale.languageCode]; + + String get reminder => localizedValues['reminder'][locale.languageCode]; + + String get location => localizedValues['location'][locale.languageCode]; + + String get online => localizedValues['online'][locale.languageCode]; + + String get payment => localizedValues['payment'][locale.languageCode]; + + String get cancel_nocaps => localizedValues['cancel-nocaps'][locale.languageCode]; + + String get cancelAppoMsg => localizedValues['cancelAppoMsg'][locale.languageCode]; + + String get pharmaciesList => localizedValues['pharmaciesList'][locale.languageCode]; + + String get description => localizedValues['description'][locale.languageCode]; + + String get price => localizedValues['price'][locale.languageCode]; + + String get youCanFindItIn => localizedValues['youCanFindItIn'][locale.languageCode]; + + String get pleaseEnterMedicineName => localizedValues['pleaseEnterMedicineName'][locale.languageCode]; + + String get verificationMessage => localizedValues['verification_message'][locale.languageCode]; + + String get validationMessage => localizedValues['validation_message'][locale.languageCode]; + + String get arabicChange => localizedValues['arabic-change'][locale.languageCode]; + + String get notification => localizedValues['notification'][locale.languageCode]; + + String get appsetting => localizedValues['app-settings'][locale.languageCode]; + + String get rateApp => localizedValues['rate-app'][locale.languageCode]; + String get setReminder => localizedValues['set-reminder'][locale.languageCode]; + String get before => localizedValues['before'][locale.languageCode]; + String get minute => localizedValues['minute'][locale.languageCode]; + String get hour => localizedValues['hour'][locale.languageCode]; + String get reminderSuccess => localizedValues['reminderSuccess'][locale.languageCode]; + String get patientShareToDo => localizedValues['patientShareToDo'][locale.languageCode]; + String get patientTaxToDo => localizedValues['patientTaxToDo'][locale.languageCode]; + String get patientShareTotalToDo => localizedValues['patientShareTotalToDo'][locale.languageCode]; + String get paymentMethod => localizedValues['paymentMethod'][locale.languageCode]; + + String get moreVerification => localizedValues['more-verify'][locale.languageCode]; + + String get welcomeBack => localizedValues['welcome-back'][locale.languageCode]; + + String get accountInfo => localizedValues['account-info'][locale.languageCode]; + + String get useAnotherAccount => localizedValues['another-acc'][locale.languageCode]; + + String get next => localizedValues['next'][locale.languageCode]; + + String get noNeedToWaitInLine => localizedValues['noNeedToWaitInLine'][locale.languageCode]; + String get useQRAppoAttend => localizedValues['useQRAppoAttend'][locale.languageCode]; + String get passQRAppoAttend => localizedValues['passQRAppoAttend'][locale.languageCode]; + String get sitWaitingQR => localizedValues['sitWaitingQR'][locale.languageCode]; + String get attendRegisterCode => localizedValues['attendRegisterCode'][locale.languageCode]; + String get scanQRHospital => localizedValues['scanQRHospital'][locale.languageCode]; + String get sendEmail => localizedValues['sendEmail'][locale.languageCode]; + String get close => localizedValues['close'][locale.languageCode]; + String get booked => localizedValues['booked'][locale.languageCode]; + String get confirmed => localizedValues['confirmed'][locale.languageCode]; + String get arrived => localizedValues['arrived'][locale.languageCode]; + String get payNowBookSuccess => localizedValues['payNowBookSuccess'][locale.languageCode]; + String get payNowBookSuccesstext1 => localizedValues['payNowBookSuccesstext1'][locale.languageCode]; + String get payNowBookSuccesstext2 => localizedValues['payNowBookSuccesstext2'][locale.languageCode]; + String get payLater => localizedValues['payLater'][locale.languageCode]; + String get askDocNotAllowed => localizedValues['askDocNotAllowed'][locale.languageCode]; + String get firstName => localizedValues['first-name'][locale.languageCode]; + + String get middleName => localizedValues['middle-name'][locale.languageCode]; + + String get lastName => localizedValues['last-name'][locale.languageCode]; + + String get male => localizedValues['male'][locale.languageCode]; + + String get female => localizedValues['female'][locale.languageCode]; + + String get prefferedLanguage => localizedValues['preferred-language'][locale.languageCode]; + + String get english => localizedValues['english'][locale.languageCode]; + + String get arabic => localizedValues['arabic'][locale.languageCode]; + + String get registrLocation => localizedValues['locations-register'][locale.languageCode]; + + String get ksa => localizedValues['ksa'][locale.languageCode]; + + String get dubai => localizedValues['dubai'][locale.languageCode]; + + String get enterEmail => localizedValues['enter-email'][locale.languageCode]; + + String get family => localizedValues['family'][locale.languageCode]; + + String get myFamilyFiles => localizedValues['family-title'][locale.languageCode]; + String get myFamily => localizedValues['myFamily'][locale.languageCode]; + + String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; + String get respirationRate => localizedValues['respirationRate'][locale.languageCode]; + + String get bodyMeasurements => localizedValues['bodyMeasurements'][locale.languageCode]; + String get height => localizedValues['height'][locale.languageCode]; + + String get temperature => localizedValues['temperature'][locale.languageCode]; + + String get pulse => localizedValues['pulse'][locale.languageCode]; + + String get respiration => localizedValues['respiration'][locale.languageCode]; + + String get bloodPressure => localizedValues['bloodPressure'][locale.languageCode]; + String get painScale => localizedValues['painScale'][locale.languageCode]; + String get heart => localizedValues['heart'][locale.languageCode]; + + String get weight => localizedValues['weight'][locale.languageCode]; + + String get request => localizedValues['request'][locale.languageCode]; + String get memberName => localizedValues['member-name'][locale.languageCode]; + String get switchUser => localizedValues['switch-login'][locale.languageCode]; + String get removeMember => localizedValues['remove-membe'][locale.languageCode]; + String get allowView => localizedValues['allow-view'][locale.languageCode]; + String get rejectView => localizedValues['reject-view'][locale.languageCode]; + String get deleteView => localizedValues['delete-view'][locale.languageCode]; + String get approvals => localizedValues['approvals'][locale.languageCode]; + String get approvalNo => localizedValues['approvalNo'][locale.languageCode]; + String get companyName => localizedValues['companyName'][locale.languageCode]; + String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; + String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; + String get procedureName => localizedValues['procedureName'][locale.languageCode]; + String get procedureStatus => localizedValues['procedureStatus'][locale.languageCode]; + String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; + String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; + String get totalApproval => localizedValues['totalApproval'][locale.languageCode]; + String get category => localizedValues['category'][locale.languageCode]; + String get expirationDate => localizedValues['expirationDate'][locale.languageCode]; + String get patientCard => localizedValues['patientCard'][locale.languageCode]; + String get policyNumber => localizedValues['policyNumber'][locale.languageCode]; + String get seeDetails => localizedValues['seeDetails'][locale.languageCode]; + String get insuranceCards => localizedValues['insuranceCards'][locale.languageCode]; + String get requestType => localizedValues['requestType'][locale.languageCode]; + String get addFamilyMember => localizedValues['add-new-member'][locale.languageCode]; + String get removeFamilyMember => localizedValues['remove-family-member'][locale.languageCode]; + + String get myMedicalFile => + localizedValues['MyMedicalFile'][locale.languageCode]; + String get myMedicalFileSubTitle => + localizedValues['myMedicalFileSubTitle'][locale.languageCode]; + String get viewMore => localizedValues['viewMore'][locale.languageCode]; + String get homeHealthCareService => + localizedValues['homeHealthCareService'][locale.languageCode]; + String get onlinePharmacy => + localizedValues['OnlinePharmacy'][locale.languageCode]; + String get emergencyService => + localizedValues['EmergencyService'][locale.languageCode]; + String get onlinePaymentService => + localizedValues['OnlinePaymentService'][locale.languageCode]; + String get offersAndPackages => + localizedValues['OffersAndPackages'][locale.languageCode]; + String get comprehensiveMedicalCheckup => + localizedValues['ComprehensiveMedicalCheckup'][locale.languageCode]; + String get hMGService => localizedValues['HMGService'][locale.languageCode]; + String get viewAllHabibMedicalService => + localizedValues['ViewAllHabibMedicalService'][locale.languageCode]; + String get viewAll => localizedValues['viewAll'][locale.languageCode]; + String get view => localizedValues['view'][locale.languageCode]; + String get contactUs => localizedValues['ContactUs'][locale.languageCode]; + String get viewAllWaysReachUs => localizedValues['ViewAllWaysReachUs'][locale.languageCode]; + String get medicalProfile => localizedValues['medicalProfile'][locale.languageCode]; + String get parking => localizedValues['parking'][locale.languageCode]; + String get alhabiServices => localizedValues['alhabiServices'][locale.languageCode]; + String get parkingTitle => localizedValues['parkingTitle'][locale.languageCode]; + String get readBarcode => localizedValues['readBarcode'][locale.languageCode]; + String get showMyPark => localizedValues['showMyPark'][locale.languageCode]; + String get clearMyData => localizedValues['clearMyData'][locale.languageCode]; + String get floor => localizedValues['floor'][locale.languageCode]; + String get gate => localizedValues['gate'][locale.languageCode]; + String get building => localizedValues['building'][locale.languageCode]; + String get branch => localizedValues['branch'][locale.languageCode]; + String get emergencyServices => localizedValues['emergencyServices'][locale.languageCode]; + String get nearester => localizedValues['nearester'][locale.languageCode]; + String get locationa => localizedValues['locationa'][locale.languageCode]; + String get ambulancerequest => localizedValues['ambulancerequest'][locale.languageCode]; + String get requestA => localizedValues['requestA'][locale.languageCode]; + String get consultation => localizedValues['consultation'][locale.languageCode]; + String get logs => localizedValues['logs'][locale.languageCode]; + String get textToSpeech => localizedValues['textToSpeech'][locale.languageCode]; + + String get myAppointments => localizedValues['MyAppointments'][locale.languageCode]; + String get noBookedAppointments => localizedValues['NoBookedAppointments'][locale.languageCode]; + String get noConfirmedAppointments => localizedValues['NoConfirmedAppointments'][locale.languageCode]; + String get noArrivedAppointments => localizedValues['noArrivedAppointments'][locale.languageCode]; + String get myAppointmentsList => localizedValues['MyAppointmentsList'][locale.languageCode]; + String get radiology => localizedValues['Radiology'][locale.languageCode]; + String get radiologySubtitle => localizedValues['RadiologySubtitle'][locale.languageCode]; + String get lab => localizedValues['Lab'][locale.languageCode]; + String get labSubtitle => localizedValues['LabSubtitle'][locale.languageCode]; + String get medicines => localizedValues['Medicines'][locale.languageCode]; + String get medicinesSubtitle => localizedValues['MedicinesSubtitle'][locale.languageCode]; + String get vitalSigns => localizedValues['VitalSigns'][locale.languageCode]; + String get vitalSignsSubtitle => localizedValues['VitalSignsSubTitle'][locale.languageCode]; + String get myMedical => localizedValues['MyMedical'][locale.languageCode]; + String get myMedicalSubtitle => localizedValues['MyMedicalSubtitle'][locale.languageCode]; + String get myDoctor => localizedValues['MyDoctor'][locale.languageCode]; + String get myDoctorSubtitle => localizedValues['MyDoctorSubtitle'][locale.languageCode]; + String get eye => localizedValues['Eye'][locale.languageCode]; + String get eyeSubtitle => localizedValues['EyeSubtitle'][locale.languageCode]; + String get insurance => localizedValues['Insurance'][locale.languageCode]; + String get insuranceSubtitle => localizedValues['InsuranceSubtitle'][locale.languageCode]; + String get updateInsurance => localizedValues['UpdateInsurance'][locale.languageCode]; + String get updateInsuranceSubtitle => localizedValues['UpdateInsuranceSubtitle'][locale.languageCode]; + String get insuranceApproval => localizedValues['InsuranceApproval'][locale.languageCode]; + String get insuranceApprovalSubtitle => localizedValues['InsuranceApprovalSubtitle'][locale.languageCode]; + String get allergies => localizedValues['Allergies'][locale.languageCode]; + String get allergiesSubtitle => localizedValues['AllergiesSubtitle'][locale.languageCode]; + String get myVaccines => localizedValues['MyVaccines'][locale.languageCode]; + String get myVaccinesSubtitle => localizedValues['MyVaccinesSubtitle'][locale.languageCode]; + String get medical => localizedValues['Medical'][locale.languageCode]; + String get medicalSubtitle => localizedValues['MedicalSubtitle'][locale.languageCode]; + String get monthly => localizedValues['Monthly'][locale.languageCode]; + String get monthlySubtitle => localizedValues['MonthlySubtitle'][locale.languageCode]; + String get sick => localizedValues['Sick'][locale.languageCode]; + String get sickSubtitle => localizedValues['SickSubtitle'][locale.languageCode]; + String get myBalance => localizedValues['MyBalance'][locale.languageCode]; + String get myBalanceSubtitle => + localizedValues['MyBalanceSubtitle'][locale.languageCode]; + String get patientCall => localizedValues['PatientCall'][locale.languageCode]; + String get patientCallSubtitle => + localizedValues['PatientCallSubtitle'][locale.languageCode]; + String get smartWatches => + localizedValues['SmartWatches'][locale.languageCode]; + String get smartWatchesSubtitle => + localizedValues['SmartWatchesSubtitle'][locale.languageCode]; + String get myTrackers => localizedValues['MyTrackers'][locale.languageCode]; + String get myTrackersSubtitle => + localizedValues['MyTrackersSubtitle'][locale.languageCode]; + String get askYour => localizedValues['AskYour'][locale.languageCode]; + String get askYourSubtitle => + localizedValues['AskYourSubtitle'][locale.languageCode]; + String get internet => localizedValues['Internet'][locale.languageCode]; + String get internetSubtitle => + localizedValues['InternetSubtitle'][locale.languageCode]; + String get chatbot => localizedValues['Chatbot'][locale.languageCode]; + String get chatbotSubtitle => + localizedValues['ChatbotSubtitle'][locale.languageCode]; + String get timeLine => localizedValues['TimeLine'][locale.languageCode]; + String get labOrders => localizedValues['LabOrders'][locale.languageCode]; + String get billNo => localizedValues['BillNo'][locale.languageCode]; + String get prescriptions => + localizedValues['Prescriptions'][locale.languageCode]; + String get history => localizedValues['History'][locale.languageCode]; + String get orderNo => localizedValues['OrderNo'][locale.languageCode]; + String get orderDetails => + localizedValues['OrderDetails'][locale.languageCode]; + String get vitalSign => localizedValues['VitalSign'][locale.languageCode]; + String get monthlyReports => + localizedValues['MonthlyReports'][locale.languageCode]; + + String get locationDialogMessage => + localizedValues['locationDialogMessage'][locale.languageCode]; + String get userViewRequest => + localizedValues['user-view-requester'][locale.languageCode]; + String get userView => localizedValues['user-view'][locale.languageCode]; + String get sentRequest => + localizedValues['sent-requests'][locale.languageCode]; + String get km => localizedValues['km'][locale.languageCode]; + String get patientHealthSummaryReport => + localizedValues['PatientHealthSummaryReport'][locale.languageCode]; + String get toViewTheTermsAndConditions => + localizedValues['ToViewTheTermsAndConditions'][locale.languageCode]; + String get clickHere => localizedValues['ClickHere'][locale.languageCode]; + String get iAgreeToTheTermsAndConditions => + localizedValues['IAgreeToTheTermsAndConditions'][locale.languageCode]; + String get iAgreeToTheTermsAndConditionsSubtitle => + localizedValues['IAgreeToTheTermsAndConditionsSubtitle'] + [locale.languageCode]; + String get save => localizedValues['Save'][locale.languageCode]; + String get userAgreement => + localizedValues['UserAgreement'][locale.languageCode]; + String get updateSuccessfully => + localizedValues['UpdateSuccessfully'][locale.languageCode]; + String get emailSentSuccessfully => + localizedValues['EmailSentSuccessfully'][locale.languageCode]; + String get checkVaccineAvailability => + localizedValues['CHECK_VACCINE_AVAILABILITY'][locale.languageCode]; + String get myVaccinesAvailability => + localizedValues['MyVaccinesAvailability'][locale.languageCode]; + String get paymentService => + localizedValues['PaymentService'][locale.languageCode]; + String get paymentOnline => + localizedValues['PaymentOnline'][locale.languageCode]; + String get onlineCheckIn => + localizedValues['OnlineCheckIn'][locale.languageCode]; + String get myBalances => localizedValues['MyBalances'][locale.languageCode]; + String get balanceAmount => + localizedValues['BalanceAmount'][locale.languageCode]; + String get totalBalance => + localizedValues['TotalBalance'][locale.languageCode]; + String get createAdvancedPayment => + localizedValues['CreateAdvancedPayment'][locale.languageCode]; + String get advancePayment => + localizedValues['AdvancePayment'][locale.languageCode]; + String get advancePaymentLabel => + localizedValues['AdvancePaymentLabel'][locale.languageCode]; + String get fileNumber => localizedValues['FileNumber'][locale.languageCode]; + String get amount => localizedValues['Amount'][locale.languageCode]; + String get depositorEmail => + localizedValues['DepositorEmail'][locale.languageCode]; + String get notes => localizedValues['Notes'][locale.languageCode]; + String get selectPatientName => + localizedValues['SelectPatientName'][locale.languageCode]; + String get selectFamilyPatientName => + localizedValues['SelectFamilyPatientName'][locale.languageCode]; + String get selectHospital => + localizedValues['SelectHospital'][locale.languageCode]; + String get myAccount => localizedValues['MyAccount'][locale.languageCode]; + String get otherAccount => + localizedValues['OtherAccount'][locale.languageCode]; + String get selectBeneficiary => + localizedValues['SelectBeneficiary'][locale.languageCode]; + String get confirmThePayment => + localizedValues['ConfirmThePayment'][locale.languageCode]; + String get depositorName => + localizedValues['DepositorName'][locale.languageCode]; + String get mobileNumber => + localizedValues['MobileNumber'][locale.languageCode]; + String get ok => localizedValues['Ok'][locale.languageCode]; + String get theVerificationCodeExpiresIn => + localizedValues['TheVerificationCodeExpiresIn'][locale.languageCode]; + String get pleaseEnterTheVerificationCode => + localizedValues['PleaseEnterTheVerificationCode'][locale.languageCode]; + String get eyeMeasurements => + localizedValues['EyeMeasurements'][locale.languageCode]; + String get measurements => + localizedValues['Measurements'][locale.languageCode]; + String get classes => localizedValues['Classes'][locale.languageCode]; + String get contactLens => localizedValues['ContactLens'][locale.languageCode]; + String get rightEye => localizedValues['RightEye'][locale.languageCode]; + String get sphere => localizedValues['Sphere'][locale.languageCode]; + String get cylinder => localizedValues['Cylinder'][locale.languageCode]; + String get axis => localizedValues['Axis'][locale.languageCode]; + String get prism => localizedValues['Prism'][locale.languageCode]; + String get va => localizedValues['VA'][locale.languageCode]; + String get leftEye => localizedValues['LeftEye'][locale.languageCode]; + String get brand => localizedValues['Brand'][locale.languageCode]; + String get power => localizedValues['Power'][locale.languageCode]; + String get diameter => localizedValues['Diameter'][locale.languageCode]; + String get remarks => localizedValues['Remarks'][locale.languageCode]; + String get activeMedications => + localizedValues['ActiveMedications'][locale.languageCode]; + String get expDate => localizedValues['ExpDate'][locale.languageCode]; + String get route => localizedValues['Route'][locale.languageCode]; + String get frequency => localizedValues['Frequency'][locale.languageCode]; + String get dailyQuantity => + localizedValues['DailyQuantity'][locale.languageCode]; + String get addReminder => localizedValues['AddReminder'][locale.languageCode]; + String get reminderDes => localizedValues['reminderDes'][locale.languageCode]; + String get startDay => localizedValues['StartDay'][locale.languageCode]; + String get endDay => localizedValues['EndDay'][locale.languageCode]; + String get days => localizedValues['Days'][locale.languageCode]; + String get scheduleTime => + localizedValues['ScheduleTime'][locale.languageCode]; + String get askDoctor => localizedValues['AskDoctor'][locale.languageCode]; + String get doctorResponses => + localizedValues['DoctorResponses'][locale.languageCode]; + String get newDes => localizedValues['New'][locale.languageCode]; + String get all => localizedValues['All'][locale.languageCode]; + String get questionHere => + localizedValues['QuestionHere'][locale.languageCode]; + String get viewDoctorResponses => + localizedValues['ViewDoctorResponses'][locale.languageCode]; + String get serviceInformationButton => + localizedValues['ServiceInformationButton'][locale.languageCode]; + String get serviceInformationTitle => + localizedValues['ServiceInformationTitle'][locale.languageCode]; + String get serviceInformation => + localizedValues['ServiceInformation'][locale.languageCode]; + String get homeHealthCare => + localizedValues['HomeHealthCare'][locale.languageCode]; + String get homeHealthCareText => + localizedValues['HomeHealthCareText'][locale.languageCode]; + String get loginRegister => + localizedValues['LoginRegister'][locale.languageCode]; + String get orderLog => localizedValues['OrderLog'][locale.languageCode]; + String get infoLab => localizedValues['info-lab'][locale.languageCode]; + String get infoRadiology => + localizedValues['info-radiology'][locale.languageCode]; + + // pharmacy module + String get medicationRefill => localizedValues['medicationRefill'][locale.languageCode]; + String get offersAndPromotions => localizedValues['offersAndPromotions'][locale.languageCode]; + String get myPrescriptions => localizedValues['myPrescriptions'][locale.languageCode]; + String get searchAndScanMedication => localizedValues['searchAndScanMedication'][locale.languageCode]; + String get shopByBrands => localizedValues['shopByBrands'][locale.languageCode]; + String get recentlyViewed => localizedValues['recentlyViewed'][locale.languageCode]; + String get bestSellers => localizedValues['bestSellers'][locale.languageCode]; + String get deleteAllItems => localizedValues['deleteAllItems'][locale.languageCode]; + + String get termsService => localizedValues['TermsService'][locale.languageCode]; + String get beforeUsing => localizedValues['Beforeusing'][locale.languageCode]; + String get accept => localizedValues['accept'][locale.languageCode]; + String get dataSafeInfo => localizedValues['data-safe-info'][locale.languageCode]; + String get dataSafe => localizedValues['data-safe'][locale.languageCode]; + String get informational => localizedValues['informational'][locale.languageCode]; + String get checkDiagnosis => localizedValues['check-diagnosis'][locale.languageCode]; + String get remeberthat => localizedValues['remeberthat'][locale.languageCode]; + String get notUseInEmbergency => localizedValues['not-use-in-emerbency'][locale.languageCode]; + String get notUseInEmbergencyDetails => localizedValues['not-use-in-emerbency-details'][locale.languageCode]; + String get notUseInEmbergencyCall => localizedValues['not-use-in-emerbency-details-call'][locale.languageCode]; + String get selectGender => localizedValues['select-gender'][locale.languageCode]; + String get iAma => localizedValues['i-am-a'][locale.languageCode]; + String get selectAge => localizedValues['select-age'][locale.languageCode]; + String get iAm => localizedValues['i-am'][locale.languageCode]; + String get yearOld => localizedValues['years-old'][locale.languageCode]; + String get email => localizedValues['email'][locale.languageCode]; + String get book => localizedValues['Book'][locale.languageCode]; + String get appointmentLabel => localizedValues['AppointmentLabel'][locale.languageCode]; + String get bloodType => localizedValues['BloodType'][locale.languageCode]; + + String get loginToUseService => localizedValues['loginToUseService'][locale.languageCode]; + String get maritalStatus => localizedValues['marital-status'][locale.languageCode]; + String get general => localizedValues['general'][locale.languageCode]; + String get profile => localizedValues['profile'][locale.languageCode]; + String get notifications => localizedValues['notifications'][locale.languageCode]; + String get notificationDetails => localizedValues['notificationDetails'][locale.languageCode]; + List get infoMyDoctorPoints => localizedValues['info-my-doctor-points'][locale.languageCode]; + String get infoMyDoctor => localizedValues['info-my-doctor'][locale.languageCode]; + String get infoPrescriptions => localizedValues['info-prescriptions'][locale.languageCode]; + List get infoPrescriptionsPoints => localizedValues['info-my-prescription-points'][locale.languageCode]; + + String get infoInsuranceCards => localizedValues['info-insurance-cards'][locale.languageCode]; + List get infoInsuranceCardsPoints => localizedValues['info-insurance-cards-points'][locale.languageCode]; + + String get infoAllergies => localizedValues['info-allergies'][locale.languageCode]; + + String get sickLeaves => localizedValues['sick-leaves'][locale.languageCode]; + String get infoSickLeaves => localizedValues['info-sick-leaves'][locale.languageCode]; + List get infoSickLeavePoints => localizedValues['info-sick-leave-points'][locale.languageCode]; + + String get infoApprovals => localizedValues['info-approvals'][locale.languageCode]; + List get infoApprovalPoints => localizedValues['info-approval-points'][locale.languageCode]; + + String get monthReport => localizedValues['month-report'][locale.languageCode]; + String get infoMonthReport => localizedValues['info-month-report'][locale.languageCode]; + String get languageSetting => localizedValues['language-setting'][locale.languageCode]; + String get alert => localizedValues['alert'][locale.languageCode]; + String get emailAlert => localizedValues['email-alert'][locale.languageCode]; + String get smsAlert => localizedValues['sms-alert'][locale.languageCode]; + String get contactInfo => localizedValues['contact-info'][locale.languageCode]; + String get emergencyName => localizedValues['emrg-name'][locale.languageCode]; + String get emergencyContact => localizedValues['emrg-no'][locale.languageCode]; + String get modes => localizedValues['modes'][locale.languageCode]; + String get vibration => localizedValues['vibration'][locale.languageCode]; + String get blindMode => localizedValues['blind-modes'][locale.languageCode]; + String get invertTheme => + localizedValues['invert-theme'][locale.languageCode]; + String get offTheme => localizedValues['off-theme'][locale.languageCode]; + String get dimTheme => localizedValues['dim-theme'][locale.languageCode]; + String get bwTheme => localizedValues['bw-theme'][locale.languageCode]; + + String get permissions => localizedValues['permissions'][locale.languageCode]; + String get cameraPermission => localizedValues['camera-permission'][locale.languageCode]; + String get locationPermission => localizedValues['location-permission'][locale.languageCode]; + String get accessibility => localizedValues['accessibility'][locale.languageCode]; + String get selectClinic => localizedValues['selectClinic'][locale.languageCode]; + String get reviews => localizedValues['reviews'][locale.languageCode]; + + String get orderStatus => localizedValues['orderStatus'][locale.languageCode]; + String get cancelOrder => localizedValues['CancelOrder'][locale.languageCode]; + String get findUs => localizedValues['FindUs'][locale.languageCode]; + String get feedback => localizedValues['Feedback'][locale.languageCode]; + String get liveChat => localizedValues['LiveChat'][locale.languageCode]; + String get service => localizedValues['Service'][locale.languageCode]; + String get hMGServiceLabel => + localizedValues['HMGServiceLabel'][locale.languageCode]; + String get healthWeatherIndicators => + localizedValues['HealthWeatherIndicators'][locale.languageCode]; + String get healthTipsBasedOnCurrentWeather => + localizedValues['HealthTipsBasedOnCurrentWeather'][locale.languageCode]; + String get moreDetails => localizedValues['MoreDetails'][locale.languageCode]; + String get sendCopy => localizedValues['SendCopy'][locale.languageCode]; + String get resendOrder => localizedValues['ResendOrder'][locale.languageCode]; + String get ports => localizedValues['Ports'][locale.languageCode]; + String get way => localizedValues['Way'][locale.languageCode]; + String get average => localizedValues['Average'][locale.languageCode]; + String get dailyDoses => localizedValues['DailyDoses'][locale.languageCode]; + String get period => localizedValues['Period'][locale.languageCode]; + String get cm => localizedValues['cm'][locale.languageCode]; + String get kg => localizedValues['kg'][locale.languageCode]; + String get mass => localizedValues['mass'][locale.languageCode]; + String get tempC => localizedValues['temp-c'][locale.languageCode]; + String get bpm => localizedValues['bpm'][locale.languageCode]; + String get respirationSigns => + localizedValues['respiration-signs'][locale.languageCode]; + String get sysDias => localizedValues['sys-dias'][locale.languageCode]; + String get body => localizedValues['body'][locale.languageCode]; + String get feedbackTitle => localizedValues['feedback'][locale.languageCode]; + String get send => localizedValues['send'][locale.languageCode]; + String get status => localizedValues['status'][locale.languageCode]; + String get likeToHear => localizedValues['like-to-hear'][locale.languageCode]; + String get subject => localizedValues['subject'][locale.languageCode]; + String get message => localizedValues['message'][locale.languageCode]; + String get emptySubject => + localizedValues['empty-subject'][locale.languageCode]; + String get emptyMessage => + localizedValues['empty-message'][locale.languageCode]; + String get selectAttachment => + localizedValues['select-attachment'][locale.languageCode]; + String get complainAppo => + localizedValues['complain-appo'][locale.languageCode]; + String get complainWithoutAppo => + localizedValues['complain-without-appo'][locale.languageCode]; + String get question => localizedValues['question'][locale.languageCode]; + String get messageType => + localizedValues['message-type'][locale.languageCode]; + String get compliment => localizedValues['compliment'][locale.languageCode]; + String get suggestion => localizedValues['suggestion'][locale.languageCode]; + String get yourFeedback => + localizedValues['your-feedback'][locale.languageCode]; + String get selectPart => localizedValues['select-part'][locale.languageCode]; + String get number => localizedValues['number'][locale.languageCode]; + String get notClassified => + localizedValues['not-classified'][locale.languageCode]; + String get searchItemError => + localizedValues['searchItemError'][locale.languageCode]; + String get youCanFind => localizedValues['YouCanFind'][locale.languageCode]; + String get itemInSearch => localizedValues['ItemInSearch'][locale.languageCode]; + String get wantToConnectWithHmgNetwork => localizedValues['wantConnectHmgNetwork'][locale.languageCode]; + String get failedToAccessHmgServices => localizedValues['failedToAccessHmgServices'][locale.languageCode]; + String get enablingWifi => localizedValues['enablingWifi'][locale.languageCode]; + String get offerAndPackages => localizedValues['offerAndPackages'][locale.languageCode]; + String get invoiceNo => localizedValues['InvoiceNo'][locale.languageCode]; + String get specialResult => + localizedValues['SpecialResult'][locale.languageCode]; + String get generalResult => + localizedValues['GeneralResult'][locale.languageCode]; + String get showMoreBtn => + localizedValues['show-more-btn'][locale.languageCode]; + String get value => localizedValues['value'][locale.languageCode]; + String get range => localizedValues['range'][locale.languageCode]; + String get outpatient => localizedValues['out-patient'][locale.languageCode]; + String get inPatient => localizedValues['in-patient'][locale.languageCode]; + String get liveCare => localizedValues['liveCare'][locale.languageCode]; + String get report => localizedValues['report'][locale.languageCode]; + String get openRad => localizedValues['open-rad'][locale.languageCode]; + String get sendCopyRad => localizedValues['send-copy'][locale.languageCode]; + String get appoSurvey => localizedValues['appoSurvey'][locale.languageCode]; + String get labResults => localizedValues['labResults'][locale.languageCode]; + String get doctorRating => + localizedValues['doctorRating'][locale.languageCode]; + String get good => localizedValues['good'][locale.languageCode]; + String get v_good => localizedValues['v-good'][locale.languageCode]; + String get excellent => localizedValues['excellent'][locale.languageCode]; + String get below_average => + localizedValues['below-average'][locale.languageCode]; + String get infoSigns => localizedValues['info-signs'][locale.languageCode]; + String get infoAdvancePayment => + localizedValues['info-advance-payment'][locale.languageCode]; + String get infoMyBalance => + localizedValues['info-my-balance'][locale.languageCode]; + String get erContant => localizedValues['er-contant'][locale.languageCode]; + String get er => localizedValues['er'][locale.languageCode]; + String get transportationService => + localizedValues['transportation-Service'][locale.languageCode]; + String get infoAmbulance => + localizedValues['info-ambulance'][locale.languageCode]; + String get transportHeading => + localizedValues['RRT-transport-heading'][locale.languageCode]; + String get sar => localizedValues['sar'][locale.languageCode]; + String get directionHeading => + localizedValues['RRT-direction-heading'][locale.languageCode]; + String get toHospital => localizedValues['to-hospital'][locale.languageCode]; + String get fromHospital => + localizedValues['from-hospital'][locale.languageCode]; + String get oneDirec => localizedValues['one-direc'][locale.languageCode]; + String get twoDirec => localizedValues['two-direc'][locale.languageCode]; + String get pickupLocation => + localizedValues['pickup-location'][locale.languageCode]; + String get pickupSpot => localizedValues['pickup-spot'][locale.languageCode]; + String get insideHome => localizedValues['inside-home'][locale.languageCode]; + String get haveAppo => localizedValues['have-appo'][locale.languageCode]; + String get dropoffLocation => + localizedValues['dropoff-location'][locale.languageCode]; + String get selectAll => localizedValues['select-all'][locale.languageCode]; + String get selectMap => localizedValues['select-map'][locale.languageCode]; + String get noAppointment => + localizedValues['no-appointment'][locale.languageCode]; + String get patientShareB => + localizedValues['patient-share'][locale.languageCode]; + String get patientShareTax => + localizedValues['patient-share-tax'][locale.languageCode]; + String get patientShareTotal => + localizedValues['patient-share-total'][locale.languageCode]; + String get selectAmbulate => + localizedValues['select-ambulate'][locale.languageCode]; + String get wheelchair => localizedValues['wheelchair'][locale.languageCode]; + String get walker => localizedValues['walker"'][locale.languageCode]; + String get stretcher => localizedValues['stretcher'][locale.languageCode]; + String get none => localizedValues['none'][locale.languageCode]; + String get RRTSummary => localizedValues['RRT-Summary'][locale.languageCode]; + String get billAmount => localizedValues['bill-amount'][locale.languageCode]; + String get transportMethod => + localizedValues['transport-method'][locale.languageCode]; + String get directions => localizedValues['directions'][locale.languageCode]; + + String get infoMyAppointments => + localizedValues['info-my-appointments'][locale.languageCode]; + String get infoTodo => localizedValues['info-todo'][locale.languageCode]; + String get familyInfo => localizedValues['family-info'][locale.languageCode]; + String get profileUpdate => + localizedValues['update-succ'][locale.languageCode]; + String get dentalComplaints => + localizedValues['dental-complains'][locale.languageCode]; + String get emptyResult => + localizedValues['empty-result'][locale.languageCode]; + + String get noBookedAppo => + localizedValues['no-booked-appointment'][locale.languageCode]; + String get noConfirmedAppo => + localizedValues['no-confirmed-appointment'][locale.languageCode]; + String get noArrivedAppo => + localizedValues['no-arrived-appointment'][locale.languageCode]; + String get upcomingEmpty => + localizedValues['upcoming-empty'][locale.languageCode]; + String get upcomingTimeLeft => + localizedValues['upcoming-timeLeft'][locale.languageCode]; + + String get covidTestAllServices => + localizedValues['covid-test-all-services'][locale.languageCode]; + String get pharmacy => localizedValues['pharmacy'][locale.languageCode]; + String get ereferral => localizedValues['ereferral'][locale.languageCode]; + String get childVaccine => + localizedValues['child-vaccine'][locale.languageCode]; + String get calculators => localizedValues['calculators'][locale.languageCode]; + String get converters => localizedValues['converters'][locale.languageCode]; + String get h2o => localizedValues['h2o'][locale.languageCode]; + String get vTour => localizedValues['v-tour'][locale.languageCode]; + String get hmgNews => localizedValues['hmg-news'][locale.languageCode]; + String get bloodD => localizedValues['blood-d'][locale.languageCode]; + String get symptomCheckerTitle => + localizedValues['symptomCheckerTitle'][locale.languageCode]; + String get latestNews => localizedValues['latest-news'][locale.languageCode]; + String get ourLocation => + localizedValues['our-location'][locale.languageCode]; + String get pharmacies => localizedValues['pharmacies'][locale.languageCode]; + String get hospitals => localizedValues['hospitals'][locale.languageCode]; + String get wallet => localizedValues['wallet'][locale.languageCode]; + String get hmg => localizedValues['hmg'][locale.languageCode]; + String get requested => localizedValues['requested'][locale.languageCode]; + String get ready => localizedValues['ready'][locale.languageCode]; + String get completed => localizedValues['completed'][locale.languageCode]; + String get cancelled => localizedValues['cancelled'][locale.languageCode]; + String get requestMedicalReport => + localizedValues['request-medical-report'][locale.languageCode]; + String get insurCards => localizedValues['insur-cards'][locale.languageCode]; + String get labResult => localizedValues['labResult'][locale.languageCode]; + String get details => localizedValues['details'][locale.languageCode]; + String get age => localizedValues['age'][locale.languageCode]; + String get activeInsurence => + localizedValues['active-insurence'][locale.languageCode]; + String get notActive => localizedValues['not-active'][locale.languageCode]; + String get cardDetail => localizedValues['card-detail'][locale.languageCode]; + String get dr => localizedValues['Dr'][locale.languageCode]; + String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; + String get instructions => + localizedValues['instructions'][locale.languageCode]; + String get instructionsPharmacies => + localizedValues['instructions-pharmacies'][locale.languageCode]; + String get selectHospitalDec => + localizedValues['select-hospital'][locale.languageCode]; + String get start => localizedValues['start'][locale.languageCode]; + String get infoChat => localizedValues['info-chat'][locale.languageCode]; + + String get noRecords => localizedValues['empty'][locale.languageCode]; + String get lastVisit => localizedValues['last-visit'][locale.languageCode]; + String get tapTitle => localizedValues['tap-title'][locale.languageCode]; + String get later => localizedValues['later'][locale.languageCode]; + + String get lastAppointment => + localizedValues['last-appointment'][locale.languageCode]; + String get rateClinic => localizedValues['rate-clinic'][locale.languageCode]; + String get fetchData => localizedValues['fetch-data'][locale.languageCode]; + + String get sendConfEmail => + localizedValues['send-email'][locale.languageCode]; + String get updateEmail => + localizedValues['update-email'][locale.languageCode]; + String get noDataAvailable => + localizedValues['noDataAvailable'][locale.languageCode]; + String get theName => localizedValues['thename'][locale.languageCode]; + String get noSearchResult => + localizedValues['noSearchResult'][locale.languageCode]; + String get selectFileSouse => + localizedValues['selectFileSouse'][locale.languageCode]; + String get rate => localizedValues['rate'][locale.languageCode]; + String get bookedSuccess => + localizedValues['booked-success'][locale.languageCode]; + String get appoReminder30 => + localizedValues['appo-reminder-select-option-30'][locale.languageCode]; + String get appoReminder60 => + localizedValues['appo-reminder-select-option-60'][locale.languageCode]; + String get appoReminder90 => + localizedValues['appo-reminder-select-option-90'][locale.languageCode]; + String get appoReminder120 => + localizedValues['appo-reminder-select-option-120'][locale.languageCode]; + String get gallery => localizedValues['gallery'][locale.languageCode]; + String get camera => localizedValues['camera'][locale.languageCode]; + String get medReport => localizedValues['med-report'][locale.languageCode]; + String get newMedReport => localizedValues['new-med-report'][locale.languageCode]; + String get requestReport => localizedValues['requestReport'][locale.languageCode]; + String get confirmMsgReport => localizedValues['confirm-msg-report'][locale.languageCode]; + String get successSendReport => localizedValues['successSendReport'][locale.languageCode]; + String get pulseTitle => localizedValues['pulseTitle'][locale.languageCode]; + String get systolicLng => localizedValues['systolic-lng'][locale.languageCode]; + String get diastolicLng => localizedValues['diastolic-lng'][locale.languageCode]; + String get policyHolder => localizedValues['policy-holder'][locale.languageCode]; + String get policyNo => localizedValues['policy-no'][locale.languageCode]; + String get expiryDateTitle => localizedValues['expiry-date'][locale.languageCode]; + String get classTitle => localizedValues['class'][locale.languageCode]; + String get approval => localizedValues['approval'][locale.languageCode]; + String get agree => localizedValues['agree'][locale.languageCode]; + String get disagree => localizedValues['disagree'][locale.languageCode]; + String get requestSent => localizedValues['request-sent'][locale.languageCode]; + String get attachInsuraceImage => localizedValues['attach-insurace-image'][locale.languageCode]; + String get infoInsurCards => localizedValues['info-insur-cards'][locale.languageCode]; + String get scanNow => localizedValues['scan-now'][locale.languageCode]; + } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 02d66c01..58ef9421 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -1,11 +1,45 @@ +import 'dart:convert'; +import 'dart:core'; +import 'dart:typed_data'; +import 'package:badges/badges.dart'; import 'package:connectivity/connectivity.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/Blood/my_balance_page.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; +import 'package:diplomaticquarterapp/pages/medical/active_medications/ActiveMedicationsPage.dart'; +import 'package:diplomaticquarterapp/pages/medical/allergies_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/ask_doctor/ask_doctor_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/doctor/doctor_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/eye/EyeMeasurementsPage.dart'; +import 'package:diplomaticquarterapp/pages/medical/labs/labs_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/my_trackers/my_trackers.dart'; +import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/reports/monthly_reports.dart'; +import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/smart_watch_instructions.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; +import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../Constants.dart'; import 'app_shared_preferences.dart'; import 'app_toast.dart'; AppSharedPreferences sharedPref = new AppSharedPreferences(); class Utils { + // static ProgressDialog pr; ///show custom Error Toast /// [message] to show for user @@ -37,4 +71,470 @@ class Utils { } return localMsg; } + + /// hides the keyboard if its already open + static hideKeyboard(BuildContext context) { + FocusScope.of(context).unfocus(); + } + + bool isSAUDIIDValid(String id, type) { + if (type == 1) { + if (id == null) { + return false; + } + try { + id = id.toString(); + id = id.trim(); + var returnValue = int.parse(id); + var sum = 0; + if (returnValue > 0) { + var type = int.parse(id[0]); + + if (id.length != 10) { + return false; + } + if (type != 2 && type != 1) { + return false; + } + + for (var i = 0; i < 10; i++) { + if (i % 2 == 0) { + var a = id[i]; + var x = int.parse(a) * 2; + var b = x.toString(); + if (b.length == 1) { + b = "0" + b; + } + sum += int.parse(b[0]) + int.parse(b[1]); + } else { + sum += int.parse(id[i]); + } + } + return sum % 10 == 0; + } + } catch (err) {} + return false; + } else { + return true; + } + } + + static String getAppointmentTransID(int projectID, int clinicID, int appoNo) { + return projectID.toString() + + '-' + + clinicID.toString() + + '-' + + appoNo.toString(); + } + + static String getAdvancePaymentTransID(int projectID, int fileNumber) { + return projectID.toString() + + '-' + + fileNumber.toString() + + '-' + + DateTime.now().millisecondsSinceEpoch.toString(); + } + + bool validateIDBox(String value, type) { + Pattern pattern = loginIDPattern(type); //r'^\d+(?:\.\d+)?$'; + + RegExp regex = new RegExp(pattern); + return regex.hasMatch(value); + } + + String loginIDPattern(loginType) { + var length = loginType == 1 ? 10 : 7; + return "([0-9]{" + length.toString() + "})"; + } + + static showProgressDialog(context, [String message = "Loading..."]) async { + // pr = ProgressDialog(context, + // type: ProgressDialogType.Normal, isDismissible: false, showLogs: false); + // pr.style( + // message: message, + // borderRadius: 10.0, + // backgroundColor: Colors.white, + // elevation: 10.0, + // insetAnimCurve: Curves.easeInOut, + // progress: 0.0, + // maxProgress: 100.0, + // progressTextStyle: TextStyle( + // color: Colors.black, fontSize: 13.0, fontWeight: FontWeight.w400), + // messageTextStyle: TextStyle( + // color: Colors.black, fontSize: 19.0, fontWeight: FontWeight.w600)); + + // if (!pr.isShowing()) { + // await pr.show(); + // } else { + // await pr.hide(); + // await pr.show(); + // } + } + + static hideProgressDialog() async { + // if (pr.isShowing()) { + // await pr.hide(); + // } + } + + static Uint8List dataFromBase64String(String base64String) { + return base64Decode(base64String); + } + + static validEmail(email) { + return RegExp( + r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+") + .hasMatch(email); + } + + static List myMedicalList({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count}) { + List medical = List(); + if (projectViewModel.havePrivilege(5)) { + medical.add(InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: MyAppointments(), + ), + ); + }, + child: isLogin + ? Container( + height: 120, + child: Stack(children: [ + MedicalProfileItem( + title: TranslationBase.of(context).myAppointments, + imagePath: 'my_appointment_icon.png', + subTitle: TranslationBase.of(context).myAppointmentsList, + hasBadge: true, + ), + Positioned( + right: 0.0, + child: Badge( + toAnimate: false, + position: BadgePosition.topEnd(), + shape: BadgeShape.circle, + badgeColor: secondaryColor.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(count.toString(), + style: + TextStyle(color: Colors.white, fontSize: 16.0)), + ), + ), + ), + ]), + ) + : MedicalProfileItem( + title: TranslationBase.of(context).myAppointments, + imagePath: 'my_appointment_icon.png', + subTitle: TranslationBase.of(context).myAppointmentsList, + hasBadge: true, + ), + )); + } + if (projectViewModel.havePrivilege(10)) { + medical.add(InkWell( + onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())), + child: MedicalProfileItem( + title: TranslationBase.of(context).lab, + imagePath: 'lab_result_icon.png', + subTitle: TranslationBase.of(context).labSubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(7)) { + medical.add(InkWell( + onTap: () => + Navigator.push(context, FadePage(page: RadiologyHomePage())), + child: MedicalProfileItem( + title: TranslationBase.of(context).radiology, + imagePath: 'radiology_icon.png', + subTitle: TranslationBase.of(context).radiologySubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(12)) { + medical.add(InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: HomePrescriptionsPage(), + ), + ); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).medicines, + imagePath: 'prescription_icon.png', + subTitle: TranslationBase.of(context).medicinesSubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(25)) { + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: VitalSignDetailsScreen(), + ), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).vitalSigns, + imagePath: 'vital_signs.png', + subTitle: TranslationBase.of(context).vitalSignsSubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(48)) { + medical.add(InkWell( + onTap: () => + Navigator.push(context, FadePage(page: ActiveMedicationsPage())), + child: MedicalProfileItem( + title: TranslationBase.of(context).myMedical, + imagePath: 'active_medications.png', + subTitle: TranslationBase.of(context).myMedicalSubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(6)) { + medical.add(InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: DoctorHomePage(), + ), + ); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).myDoctor, + imagePath: 'doctor_icon.png', + subTitle: TranslationBase.of(context).myDoctorSubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(14)) { + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: EyeMeasurementsPage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).eye, + imagePath: 'eye_measurement_icon.png', + subTitle: TranslationBase.of(context).eyeSubtitle, + ), + )); + } + if (projectViewModel.havePrivilege(22)) { + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: InsuranceCard())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).insurance, + imagePath: 'insurance_card_icon.png', + subTitle: TranslationBase.of(context).insuranceSubtitle, + ), + )); + } + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: InsuranceUpdate())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).updateInsurance, + imagePath: 'insurance_update_icon_.png', + subTitle: TranslationBase.of(context).updateInsuranceSubtitle, + ), + )); + + if (projectViewModel.havePrivilege(18)) { + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: InsuranceApproval())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).insuranceApproval, + imagePath: 'insurance_approvals_icon.png', + subTitle: TranslationBase.of(context).insuranceApprovalSubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(23)) { + medical.add(InkWell( + onTap: () => Navigator.push(context, FadePage(page: AllergiesPage())), + child: MedicalProfileItem( + title: TranslationBase.of(context).allergies, + imagePath: 'my_allergies_icon.png', + subTitle: TranslationBase.of(context).allergiesSubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(26)) { + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: MyVaccines())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).myVaccines, + imagePath: 'my_vaccines_icon.png', + subTitle: TranslationBase.of(context).myVaccinesSubtitle, + ), + )); + } + if (projectViewModel.havePrivilege(20)) + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: HomeReportPage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).medical, + imagePath: 'medical_reports_icon.png', + subTitle: TranslationBase.of(context).medicalSubtitle, + ), + )); + + if (projectViewModel.havePrivilege(19)) { + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: MonthlyReportsPage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).monthly, + imagePath: 'monthly_reports_icon.png', + subTitle: TranslationBase.of(context).monthlySubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(16)) { + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: PatientSickLeavePage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).sick, + imagePath: 'sick_leaves_icons.png', + subTitle: TranslationBase.of(context).sickSubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(47)) { + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: MyBalancePage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).myBalance, + imagePath: 'check-in.png', + subTitle: TranslationBase.of(context).myBalanceSubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(61)) { + medical.add(MedicalProfileItem( + title: TranslationBase.of(context).patientCall, + imagePath: 'medical_history_icon.png', + subTitle: TranslationBase.of(context).patientCallSubtitle, + )); + } + + if (projectViewModel.havePrivilege(24)) { + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: MyTrackers())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).myTrackers, + imagePath: 'my_tracker_icon.png', + subTitle: TranslationBase.of(context).myTrackersSubtitle, + ), + )); + } + if (projectViewModel.havePrivilege(30)) + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: SmartWatchInstructions())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).smartWatches, + imagePath: 'smartwatch_icon.png', + subTitle: TranslationBase.of(context).smartWatchesSubtitle, + ), + )); + + if (projectViewModel.havePrivilege(28)) { + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: AskDoctorHomPage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).askYour, + imagePath: 'ask_doctor_icon.png', + subTitle: TranslationBase.of(context).askYourSubtitle, + ), + )); + } + if (projectViewModel.havePrivilege(32)) { + medical.add(InkWell( + //TODO +// onTap: () { +// Navigator.push( +// context, FadePage(page: DoctorHomePage())); +// }, + child: MedicalProfileItem( + title: TranslationBase.of(context).internet, + imagePath: 'insurance_card_icon.png', + subTitle: TranslationBase.of(context).internetSubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(40)) { + medical.add(InkWell( +// onTap: () { +// Navigator.push( +// context, FadePage(page: InsuranceApproval())); +// }, + child: MedicalProfileItem( + title: TranslationBase.of(context).chatbot, + imagePath: 'insurance_approvals_icon.png', + subTitle: TranslationBase.of(context).chatbotSubtitle, + ), + )); + } + + return medical; + } +} + +// extension function that use in iterations(list.. etc) to iterate items and get index and item it self +extension IndexedIterable on Iterable { + Iterable mapIndexed(T Function(E e, int i) f) { + var i = 0; + return map((e) => f(e, i++)); + } } +/* + userBoard.asMap().map((i, element) => MapEntry(i, Stack( + GestureDetector(onTap: () { + setState(() { + // print("element=${element.toString()}"); + // print("element=${userBoard[i].toString()}"); + }); + }), + ))).values.toList(); + */ diff --git a/lib/widgets/Loader/gif_loader_container.dart b/lib/widgets/Loader/gif_loader_container.dart new file mode 100644 index 00000000..06c151c9 --- /dev/null +++ b/lib/widgets/Loader/gif_loader_container.dart @@ -0,0 +1,43 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter_gifimage/flutter_gifimage.dart'; + +class GifLoaderContainer extends StatefulWidget { + @override + _GifLoaderContainerState createState() => _GifLoaderContainerState(); +} + +class _GifLoaderContainerState extends State + with TickerProviderStateMixin { + GifController controller1; + + @override + void initState() { + controller1 = GifController(vsync: this); + + WidgetsBinding.instance.addPostFrameCallback((_) { + controller1.repeat( + min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true); + }); + super.initState(); + } + + @override + void dispose() { + controller1.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Center( + //progress-loading.gif + child: Container( + // margin: EdgeInsets.only(bottom: 40), + child: GifImage( + controller: controller1, + image: AssetImage( + "assets/images/progress-loading.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), + ), + )); + } +} \ No newline at end of file diff --git a/lib/widgets/avatar/large_avatar.dart b/lib/widgets/avatar/large_avatar.dart new file mode 100644 index 00000000..fcfcaa94 --- /dev/null +++ b/lib/widgets/avatar/large_avatar.dart @@ -0,0 +1,81 @@ +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +/// LargeAvatar +/// [name] the user name +/// [url] the image url +/// [disableProfileView] disable user profile view +/// [radius] the avatar radius +/// [width] the avatar width +/// [height] the avatar height +/// [onTap] on tap function +class LargeAvatar extends StatelessWidget { + LargeAvatar( + {Key key, + @required this.name, + this.url, + this.disableProfileView: false, + this.radius = 70.0, + this.width = 70, + this.height = 60, + this.onTap}) + : super(key: key); + + final String name; + final String url; + final bool disableProfileView; + final double radius; + final double width; + final double height; + final GestureTapCallback onTap; + + Widget _getAvatar() { + if (url != null && url.isNotEmpty && Uri.parse(url).isAbsolute) { + return Center( + child: ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(radius)), + child: Image.network( + url.trim(), + fit: BoxFit.fill, + width: width, + height: height, + ), + ), + ); + } else + return Center( + child: Texts( + name[0].toUpperCase(), + color: Colors.white, + fontSize: 18, + )); + } + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: disableProfileView ? null : onTap, + child: Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment(-1, -1), + end: Alignment(1, 1), + colors: [ + Colors.grey[100], + Colors.grey[800], + ]), + boxShadow: [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.08), + offset: Offset(0.0, 5.0), + blurRadius: 16.0) + ], + borderRadius: BorderRadius.all(Radius.circular(radius)), + ), + width: width, + height: height, + child: _getAvatar()), + ); + } +} diff --git a/lib/widgets/bottom_navigation/bottom_nav_bar.dart b/lib/widgets/bottom_navigation/bottom_nav_bar.dart new file mode 100644 index 00000000..66a83224 --- /dev/null +++ b/lib/widgets/bottom_navigation/bottom_nav_bar.dart @@ -0,0 +1,135 @@ +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../../d_q_icons_icons.dart'; +import 'bottom_navigation_item.dart'; + +class BottomNavBar extends StatefulWidget { + final ValueChanged changeIndex; + final int index ; + BottomNavBar({Key key, this.changeIndex,this.index}) : super(key: key); + + @override + _BottomNavBarState createState() => _BottomNavBarState(); +} + +class _BottomNavBarState extends State { + int _index = 0; + + ToDoCountProviderModel model; + AuthenticatedUserObject authenticatedUserObject = + locator(); + + _changeIndex(int index) { + if (index != 4) + widget.changeIndex(index); + else { + if (authenticatedUserObject.isLogin) { + if (model.count != 0) { + widget.changeIndex(index); + } else { + AppToast.showErrorToast( + message: TranslationBase.of(context).upcomingEmpty); + } + } else { + widget.changeIndex(index); + } + } + } + + @override + Widget build(BuildContext context) { + model = Provider.of(context); + ProjectViewModel projectViewModel = Provider.of(context); + return BottomAppBar( + elevation: 4, + shape: CircularNotchedRectangle(), + color: Colors.white, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 18), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + BottomNavigationItem( + icon: EvaIcons.home, + activeIcon: EvaIcons.home, + changeIndex: _changeIndex, + index: widget.index, + currentIndex: 0, + name: TranslationBase.of(context).home, + ), + BottomNavigationItem( + icon: DQIcons.my_medical_file, + activeIcon: DQIcons.my_medical_file, + changeIndex: _changeIndex, + index: widget.index, + currentIndex: 1, + name: TranslationBase.of(context).medicalProfile, + ), + if(widget.index == 0 && projectViewModel.havePrivilege(34)) + Expanded( + child: SizedBox( + height: 50, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox(height: 22), + ], + ), + ), + ), + if(widget.index != 0 && projectViewModel.havePrivilege(34)) + BottomNavigationItem( + icon: EvaIcons.calendar, + activeIcon: EvaIcons.calendar, + changeIndex: _changeIndex, + index: _index, + currentIndex: 2, + name: TranslationBase.of(context).bookAppo, + ), + + BottomNavigationItem( + icon: DQIcons.family, + activeIcon: DQIcons.family, + changeIndex: _changeIndex, + index: widget.index, + currentIndex: 3, + name: TranslationBase.of(context).myFamily, + ), + if(projectViewModel.havePrivilege(51)) + BottomNavigationItem( + icon: EvaIcons.calendar, + activeIcon: EvaIcons.calendar, + changeIndex: _changeIndex, + index: widget.index, + currentIndex: 4, + name: TranslationBase.of(context).todoList, + ) + ], + ), + ), + ); + } + + Future navigateToBookingOptions(context) async { + Navigator.push( + context, MaterialPageRoute(builder: (context) => BookingOptions())); + } + + Future navigateToToDoList(context) async { + Navigator.push(context, + MaterialPageRoute(builder: (context) => ToDo(isShowAppBar: false))); + } +} diff --git a/lib/widgets/bottom_navigation/bottom_navigation_item.dart b/lib/widgets/bottom_navigation/bottom_navigation_item.dart new file mode 100644 index 00000000..391b6a3d --- /dev/null +++ b/lib/widgets/bottom_navigation/bottom_navigation_item.dart @@ -0,0 +1,164 @@ +import 'package:badges/badges.dart'; +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../../Constants.dart'; + +class BottomNavigationItem extends StatelessWidget { + final IconData icon; + final IconData activeIcon; + final ValueChanged changeIndex; + final int index; + final int currentIndex; + final String name; + + AuthenticatedUserObject authenticatedUserObject = locator(); + + BottomNavigationItem( + {this.icon, + this.activeIcon, + this.changeIndex, + this.index, + this.currentIndex, + this.name}); + + @override + Widget build(BuildContext context) { + var model = Provider.of(context); + return Expanded( + child: SizedBox( + // height: 72.0, + child: Material( + type: MaterialType.transparency, + child: InkWell( + highlightColor: Colors.transparent, + splashColor: Colors.transparent, + onTap: () => changeIndex(currentIndex), + child: currentIndex != 4 + ? Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + height: 15, + ), + Container( + child: Icon(currentIndex == index ? activeIcon : icon, + color: currentIndex == index + ? secondaryColor + : Theme.of(context).dividerColor, + size: 22.0), + ), + SizedBox( + height: 2, + ), + Texts( + name, + textAlign: TextAlign.center, + color: currentIndex == index + ? secondaryColor + : Colors.grey, + fontSize: 11, + ), + SizedBox( + height: 7, + ), + ], + ) + : (authenticatedUserObject.isLogin && model.isShowBadge) + ? Stack( + alignment: AlignmentDirectional.center, + children: [ + Positioned( + right: 18.0, + bottom: 28.0, + child: Badge( + toAnimate: false, + position: BadgePosition.topEnd(), + shape: BadgeShape.circle, + badgeColor: secondaryColor.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(model.count.toString(), + style: TextStyle( + color: Colors.white, fontSize: 14.0)), + ), + ), + ), + Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + height: 15, + ), + Container( + child: Icon( + currentIndex == index ? activeIcon : icon, + color: currentIndex == index + ? secondaryColor + : Theme.of(context).dividerColor, + size: 22.0), + ), + SizedBox( + height: 2, + ), + Texts( + name, + textAlign: TextAlign.center, + color: currentIndex == index + ? Theme.of(context).primaryColor + : Colors.grey, + fontSize: 11, + ), + SizedBox( + height: 7, + ), + ], + ), + ], + ) + : Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + height: 15, + ), + Container( + child: Icon( + currentIndex == index ? activeIcon : icon, + color: currentIndex == index + ? secondaryColor + : Theme.of(context).dividerColor, + size: 22.0), + ), + SizedBox( + height: 2, + ), + Texts( + name, + textAlign: TextAlign.center, + color: currentIndex == index + ? secondaryColor + : Colors.grey, + fontSize: 11, + ), + SizedBox( + height: 7, + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/widgets/bottom_options/BottomSheet.dart b/lib/widgets/bottom_options/BottomSheet.dart new file mode 100644 index 00000000..7bbadd8c --- /dev/null +++ b/lib/widgets/bottom_options/BottomSheet.dart @@ -0,0 +1,144 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:feather_icons_flutter/feather_icons_flutter.dart'; +import 'package:flutter/material.dart'; +import 'package:image_picker/image_picker.dart'; + +class ImageOptions { + static showImageOptions(BuildContext context, Function(String,File) image,) { + showModalBottomSheet( + backgroundColor: Colors.transparent, + context: context, + builder: (BuildContext bc) { + return _BottomSheet( + children: [ + _BottomSheetItem( + title: TranslationBase.of(context).selectFileSouse, + ), + _BottomSheetItem( + title: TranslationBase.of(context).gallery, + icon: FeatherIcons.image, + onTap: () async { + File _image = + await ImagePicker.pickImage(source: ImageSource.gallery); + String fileName = _image.path; + final bytes = File(fileName).readAsBytesSync(); + String base64Encode = base64.encode(bytes); + if (base64Encode != null) { + image(base64Encode,_image); + } + }, + ), + _BottomSheetItem( + title: TranslationBase.of(context).camera, + icon: FeatherIcons.camera, + onTap: () async { + File _image = + await ImagePicker.pickImage(source: ImageSource.camera); + String fileName = _image.path; + final bytes = File(fileName).readAsBytesSync(); + String base64Encode = base64.encode(bytes); + if (base64Encode != null) { + image(base64Encode,_image); + } + }, + ), + _BottomSheetItem( + title: TranslationBase.of(context).cancel, + onTap: (){ + + }, + ) + ], + ); + }); + } +} + +class _BottomSheet extends StatelessWidget { + final List children; + + _BottomSheet({Key key, @required this.children}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.symmetric(vertical: 12.0), + decoration: BoxDecoration( + color: Theme.of(context).backgroundColor, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0))), + child: SafeArea( + top: false, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + decoration: BoxDecoration( + color: Theme.of(context).dividerColor, + borderRadius: BorderRadius.circular(3.0)), + width: 40.0, + height: 6.0, + ), + ...children + ], + ), + ), + ); + } +} + +class _BottomSheetItem extends StatelessWidget { + final Function onTap; + final IconData icon; + final String title; + final ITEM_COLOR color; + + _BottomSheetItem( + {Key key, + this.onTap, + @required this.title, + this.icon, + this.color = ITEM_COLOR.primary}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: () { + if (onTap != null) { + Navigator.pop(context); + onTap(); + } + }, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 18.0, vertical: 18.0), + child: Row( + children: [ + if (icon != null) + Icon( + icon, + color: color == ITEM_COLOR.error + ? Theme.of(context).errorColor + : Theme.of(context).primaryColor, + size: 18.0, + ), + if (icon != null) SizedBox(width: 24.0), + Texts( + title ?? "", + style: "bodyText2", + color: color == ITEM_COLOR.error + ? Theme.of(context).errorColor + : null, + ), + ], + ), + ), + ); + } +} + +enum ITEM_COLOR { primary, error } diff --git a/lib/widgets/buttons/BottomButton.dart b/lib/widgets/buttons/BottomButton.dart new file mode 100644 index 00000000..3e85aa1e --- /dev/null +++ b/lib/widgets/buttons/BottomButton.dart @@ -0,0 +1,148 @@ +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:flutter/material.dart'; + +/// [label] button label +/// [icon] button icon its optional +/// [color] the background color +/// [textColor] the text color +/// [onTap] button function +/// [loading] show the progress indicator +/// [disabled] disabled the button +/// [borderColor] the button border color +/// [child] the child inside the button +/// [disabledPadding] remove padding +class BottomButton extends StatelessWidget { + final bool loading; + final bool disabled; + final String label; + final Widget icon; + final Color color; + final Color textColor; + final Color borderColor; + final Function onTap; + final Widget child; + final bool disabledPadding; + + BottomButton( + {Key key, + this.loading = false, + this.disabled = false, + this.label, + this.icon, + this.color, + this.textColor, + this.disabledPadding = false, + this.borderColor, + this.onTap, + this.child}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.bottomCenter, + end: Alignment.topCenter, + stops: [ + 0.0, + 0.9 + ], + colors: [ + Theme.of(context).backgroundColor, + Theme.of(context).backgroundColor.withOpacity(0) + ]), + ), + alignment: Alignment.center, + child: SafeArea( + top: false, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + margin: child != null + ? EdgeInsets.only( + left: 14.0, right: 14.0, top: 14.0, bottom: 14) + : EdgeInsets.only( + left: 30.0, right: 30.0, top: 14.0, bottom: 14), + decoration: BoxDecoration( + color: child != null + ? Theme.of(context).backgroundColor + : null, + border: child != null + ? Border.all( + color: Theme.of(context).dividerColor, width: 2.0) + : Border.all(color: Colors.transparent, width: 0.0), + borderRadius: child != null + ? BorderRadius.circular(16.0) + : BorderRadius.circular(0.0), + boxShadow: child != null + ? [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.04), + spreadRadius: -0.0, + offset: Offset(0, 4.0), + blurRadius: 18.0) + ] + : []), + child: Column( + children: [ + if (child != null) + Padding( + padding: disabledPadding + ? EdgeInsets.only( + left: 0.0, + right: 0.0, + top: 14.0, + bottom: label != null ? 0.0 : 14) + : EdgeInsets.only( + left: 18.0, + right: 18.0, + top: 14.0, + bottom: label != null ? 0.0 : 14), + child: child, + ), + if (child != null) + Padding( + padding: EdgeInsets.only(top: 14.0, bottom: 14), + child: Divider(), + ), + if (label != null) + label == null + ? SizedBox(height: 50.0) + : Padding( + padding: child != null + ? EdgeInsets.only( + bottom: 16.0, left: 16.0, right: 16.0) + : EdgeInsets.zero, + child: SecondaryButton( + borderColor: borderColor, + onTap: () { + if (onTap != null) onTap(); + }, + loading: loading, + disabled: disabled, + label: label, + icon: icon, + color: color, + textColor: textColor), + ), + ], + ), + ), + if (label == null && child == null) + Padding( + padding: EdgeInsets.only( + left: 30.0, right: 30.0, top: 14.0, bottom: 14), + ), + ], + ), + ), + ), + ], + ); + } +} diff --git a/lib/widgets/buttons/GestureIconButton.dart b/lib/widgets/buttons/GestureIconButton.dart new file mode 100644 index 00000000..841d7ea6 --- /dev/null +++ b/lib/widgets/buttons/GestureIconButton.dart @@ -0,0 +1,70 @@ +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/material.dart'; + +class GestureIconButton extends StatefulWidget { + GestureIconButton( + this.label, + this.icon, { + Key key, + this.onTap, + this.backgroundColor, + }) : super(key: key); + + final String label; + final Widget icon; + final VoidCallback onTap; + final Color backgroundColor; + + @override + _GestureIconButtonState createState() => _GestureIconButtonState(); +} + +class _GestureIconButtonState extends State { + bool _buttonLongPress = false; + + @override + Widget build(BuildContext context) { + return GestureDetector( + onLongPressStart: (_) => + setState(() => _buttonLongPress = !_buttonLongPress), + onLongPressEnd: (_) => + setState(() => _buttonLongPress = !_buttonLongPress), + child: Wrap( + children: [ + Container( + decoration: BoxDecoration( + border: Border.all( + color: widget.backgroundColor != null + ? widget.backgroundColor + : Colors.grey[200], + ), + color: widget.backgroundColor != null + ? widget.backgroundColor + : Colors.grey.shade200, + borderRadius: BorderRadius.all(Radius.circular(8))), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Expanded( + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: const EdgeInsets.only(right: 8.0), + child: widget.icon, + ), + Texts( + widget.label, + color: _buttonLongPress ? Colors.white : Colors.black, + ), + ], + ), + ), + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/widgets/buttons/borderedButton.dart b/lib/widgets/buttons/borderedButton.dart new file mode 100644 index 00000000..5e05448e --- /dev/null +++ b/lib/widgets/buttons/borderedButton.dart @@ -0,0 +1,59 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:flutter/material.dart'; + +class BorderedButton extends StatelessWidget { + final String text; + final Function handler; + final Color color; + final bool hasBorder; + final Color borderColor; + final Color backgroundColor; + final double vPadding; + final double hPadding; + + BorderedButton( + this.text, { + this.handler, + this.color, + this.hasBorder = false, + this.borderColor, + this.backgroundColor, + this.vPadding = 0, + this.hPadding = 0, + }); + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.symmetric(horizontal: 4, vertical: 4), + child: ButtonTheme( + //adds padding inside the button + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + //limits the touch area to the button area + minWidth: 0, + //wraps child's width + height: 0, + //wraps child's height + child: RaisedButton( + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + padding: EdgeInsets.symmetric(horizontal: 12, vertical: vPadding), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(4.0), + side: BorderSide(color: hasBorder ? borderColor : Colors.white, width: 0.8),), + color: backgroundColor ?? Colors.white, + textColor: color ?? Color(0xffc4aa54), + disabledTextColor: color ?? Colors.black, + disabledColor: backgroundColor ?? Colors.white, + onPressed: handler, + child: Text( + text, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.normal), + ), + ), //your original button + ), + ); + } +} diff --git a/lib/widgets/buttons/button.dart b/lib/widgets/buttons/button.dart index 0c71f25a..5d7c9257 100644 --- a/lib/widgets/buttons/button.dart +++ b/lib/widgets/buttons/button.dart @@ -1,20 +1,33 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/services/permission/permission_service.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; +/// Button widget +/// [label] button label +/// [icon] button icon its optional +/// [onTap] button function +/// [loading] show the progress indicator +/// [elevation] color elevation value class Button extends StatefulWidget { Button( {Key key, - this.title: "", + this.label: "", this.icon, this.onTap, + this.backgroundColor, this.loading: false, this.elevation: true}) : super(key: key); - final String title; + final String label; final Widget icon; final VoidCallback onTap; final bool loading; final bool elevation; + final Color backgroundColor; @override _ButtonState createState() => _ButtonState(); @@ -24,7 +37,7 @@ class _ButtonState extends State