From f1f3b6bd566c25e8ae35e76c6f37deca349930fe Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 20 Sep 2020 17:51:38 +0300 Subject: [PATCH 01/36] first step from e-referral --- .../gradle/wrapper/gradle-wrapper.properties | 6 + android/app/gradlew | 172 ++ android/app/gradlew.bat | 84 + android/app/local.properties | 8 + lib/config/config.dart | 1461 ++++++++++++++- .../e_referral_service.dart | 28 + .../e_referral_view_model.dart | 26 + lib/locator.dart | 4 + ..._all_relationship_types_request_model.dart | 48 + ...all_relationship_types_response_model.dart | 25 + .../E-Referral/e_referral_index_page.dart | 82 + .../E-Referral/e_referral_page.dart | 128 ++ .../E-Referral/new_e_referral_page.dart | 273 +++ .../E-Referral/search_for_referrals_page.dart | 21 + .../select_country_ingo_Dialog.dart | 1585 +++++++++++++++++ .../select_relation_type_Dialog.dart | 130 ++ .../all_habib_medical_service_page.dart | 27 + lib/pages/landing/landing_page.dart | 227 +-- lib/widgets/data_display/CarouselSlider.dart | 66 + pubspec.yaml | 3 + 20 files changed, 4290 insertions(+), 114 deletions(-) create mode 100644 android/app/gradle/wrapper/gradle-wrapper.properties create mode 100644 android/app/gradlew create mode 100644 android/app/gradlew.bat create mode 100644 android/app/local.properties create mode 100644 lib/core/service/all_habib_medical_services/e_referral_service.dart create mode 100644 lib/core/viewModels/all_habib_medical_services/e_referral_view_model.dart create mode 100644 lib/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_request_model.dart create mode 100644 lib/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart create mode 100644 lib/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart create mode 100644 lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart create mode 100644 lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_page.dart create mode 100644 lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart create mode 100644 lib/pages/AlHabibMedicalService/E-Referral/select_country_ingo_Dialog.dart create mode 100644 lib/pages/AlHabibMedicalService/E-Referral/select_relation_type_Dialog.dart create mode 100644 lib/widgets/data_display/CarouselSlider.dart 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/lib/config/config.dart b/lib/config/config.dart index 9b910e66..71abe50a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -2,6 +2,7 @@ import 'dart:io'; 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; @@ -202,7 +203,7 @@ const GET_PATIENT_INFO_BY_ID = 'Services/Doctors.svc/REST/GetPatientInfoByPatien 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_ALL_RELATIONSHIP_TYPES = "Services/Patients.svc/REST/GetAllRelationshipTypes"; const TIMER_MIN = 10; class AppGlobal { @@ -228,4 +229,1462 @@ class AppGlobal { return request; } + + + + dynamic LIST_CODE = { + "codes": [ + { + "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" + } + ] + }; } diff --git a/lib/core/service/all_habib_medical_services/e_referral_service.dart b/lib/core/service/all_habib_medical_services/e_referral_service.dart new file mode 100644 index 00000000..7229f799 --- /dev/null +++ b/lib/core/service/all_habib_medical_services/e_referral_service.dart @@ -0,0 +1,28 @@ +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:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_request_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; +import 'package:geolocator/geolocator.dart'; + +class EReferralService extends BaseService { + List _relationTypes = List(); + + List get relationTypes => _relationTypes; + + + 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: {}); + } + +} 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..2122aa56 --- /dev/null +++ b/lib/core/viewModels/all_habib_medical_services/e_referral_view_model.dart @@ -0,0 +1,26 @@ +import 'dart:core'; + +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/service/all_habib_medical_services/e_referral_service.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; + +import '../../../locator.dart'; +import '../base_view_model.dart'; + +class EReferralViewModel extends BaseViewModel { + EReferralService _eReferralService = locator(); + + List get relationTypes => + _eReferralService.relationTypes; + + void getRelationTypes() async { + setState(ViewState.Busy); + await _eReferralService.getRelationTypes(); + if (_eReferralService.hasError) { + error = _eReferralService.error; + setState(ViewState.Error); + } + setState(ViewState.Idle); + } +} diff --git a/lib/locator.dart b/lib/locator.dart index 93715c99..f3bf87b7 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:get_it/get_it.dart'; +import 'core/service/all_habib_medical_services/e_referral_service.dart'; import 'core/service/appointment_rate_service.dart'; import 'core/service/dashboard_service.dart'; import 'core/service/er/am_service.dart'; @@ -18,6 +19,7 @@ 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/viewModels/all_habib_medical_services/e_referral_view_model.dart'; import 'core/viewModels/appointment_rate_view_model.dart'; import 'core/viewModels/er/am_request_view_model.dart'; import 'core/viewModels/er/near_hospital_view_model.dart'; @@ -66,6 +68,7 @@ void setupLocator() { locator.registerLazySingleton(() => ReportsMonthlyService()); locator.registerLazySingleton(() => ErService()); locator.registerLazySingleton(() => AmService()); + locator.registerLazySingleton(() => EReferralService()); locator.registerLazySingleton(() => PatientSickLeaveService()); @@ -92,5 +95,6 @@ void setupLocator() { locator.registerFactory(() => AmRequestViewModel()); locator.registerFactory(() => PatientSickLeaveViewMode()); locator.registerFactory(() => MyBalanceViewModel()); + locator.registerFactory(() => EReferralViewModel()); } diff --git a/lib/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_request_model.dart b/lib/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_request_model.dart new file mode 100644 index 00000000..10eb03de --- /dev/null +++ b/lib/models/AlHabibMedicalServices/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/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart b/lib/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart new file mode 100644 index 00000000..997e3f3c --- /dev/null +++ b/lib/models/AlHabibMedicalServices/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/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..00148889 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart @@ -0,0 +1,82 @@ +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: "Service Information", + 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..ceeafd2c --- /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_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: [ + NewEReferralPage( + eReferralViewModel: model, + ), + SearchForReferralsPage( + ) + ], + ), + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_page.dart new file mode 100644 index 00000000..c75f3ee7 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_page.dart @@ -0,0 +1,273 @@ +import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; +import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/select_country_ingo_Dialog.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/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'; + +enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } + +class NewEReferralPage extends StatefulWidget { + final EReferralViewModel eReferralViewModel; + + const NewEReferralPage({Key key, this.eReferralViewModel}) : super(key: key); + + @override + _NewEReferralPageState createState() => _NewEReferralPageState(); +} + +class _NewEReferralPageState extends State { + TextEditingController _fileTextController = TextEditingController(); + TextEditingController _notesTextController = TextEditingController(); + TextEditingController _mobileTextController = TextEditingController(); + BeneficiaryType beneficiaryType = BeneficiaryType.NON; + GetAllRelationshipTypeResponseModel _selectedRelation; + String amount = ""; + String email; + PatientInfo _selectedPatientInfo; + AuthenticatedUser authenticatedUser; + GetAllSharedRecordsByStatusList selectedPatientFamily; + AdvanceModel advanceModel = AdvanceModel(); + dynamic _selectedCountry; + AppSharedPreferences sharedPref = AppSharedPreferences(); + AuthenticatedUser authUser; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + 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.94, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 75, + ), + Center( + child: Texts( +// TranslationBase.of(context).advancePaymentLabel, + "Referral requester information", + textAlign: TextAlign.center, + ), + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: TranslationBase.of(context).fileNumber, + controller: _fileTextController, + ), + InkWell( + 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: () => 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) + ], + ), + ), + ), + 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, + ), + SizedBox( + height: 12, + ), + 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 || + _selectedRelation == null, + ), + ))); + } + + 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 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( + keyboardType: TextInputType.phone, + decoration: InputDecoration( + border: InputBorder.none, hintText: '5xxxxxxxx'), + ), + ), + ) + ]), + ); + } +} 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..3662bd51 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart @@ -0,0 +1,21 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_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'; + +class SearchForReferralsPage extends StatelessWidget { + + SearchForReferralsPage({Key key}); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: Container(), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/E-Referral/select_country_ingo_Dialog.dart b/lib/pages/AlHabibMedicalService/E-Referral/select_country_ingo_Dialog.dart new file mode 100644 index 00000000..fadf7855 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/select_country_ingo_Dialog.dart @@ -0,0 +1,1585 @@ +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/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 SelectCountryDialog extends StatefulWidget { +// final List relationTypes; + final Function(dynamic) onValueSelected; + dynamic selectedCountry; + + SelectCountryDialog( + {Key key, /*this.relationTypes,*/ this.onValueSelected, this.selectedCountry}); + + @override + _SelectCountryDialogState createState() => _SelectCountryDialogState(); +} + +class _SelectCountryDialogState extends State { + 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/select_relation_type_Dialog.dart b/lib/pages/AlHabibMedicalService/E-Referral/select_relation_type_Dialog.dart new file mode 100644 index 00000000..42809035 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/select_relation_type_Dialog.dart @@ -0,0 +1,130 @@ +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/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/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index dc0d3cd2..3e08cee5 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/parking_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -44,6 +45,32 @@ class _AllHabibMedicalServiceState extends State { ), ), ), + + InkWell( + onTap: ()=> Navigator.push(context, FadePage(page: EReferralIndexPage())), + child: Container( + height: 50, + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(7), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Texts( + "EReferralPage", + fontSize: 16, + ) + ], + ), + ), + ), + ), ], ), ); diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 315a9aa7..c82efe7b 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -119,120 +119,121 @@ class _LandingPageState extends State with WidgetsBindingObserver { print(err); }); + // TODO fix hot reload issue //_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"); - } - }, - ); +// _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"); +// } +// }, +// ); } showDialog(String message) { diff --git a/lib/widgets/data_display/CarouselSlider.dart b/lib/widgets/data_display/CarouselSlider.dart new file mode 100644 index 00000000..b8af33ac --- /dev/null +++ b/lib/widgets/data_display/CarouselSlider.dart @@ -0,0 +1,66 @@ +import 'package:carousel_pro/carousel_pro.dart'; +import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; +import 'package:flutter/material.dart'; + +class CarouselSlider extends StatelessWidget { + const CarouselSlider({ + @required this.imagesUrlList, + @required this.width, + @required this.height, + this.onImageChange, + this.autoPlay = false, + Key key, + }) : super(key: key); + + final List imagesUrlList; + final double height; + final double width; + final bool autoPlay; + final Function onImageChange; + @override + Widget build(BuildContext context) { + return Carousel( + boxFit: BoxFit.cover, + autoplay: true, + animationCurve: Curves.fastOutSlowIn, + animationDuration: Duration(milliseconds: 1000), + dotSize: 0.0, + dotIncreasedColor: Colors.transparent, + dotBgColor: Colors.transparent, + dotPosition: DotPosition.bottomCenter, + dotVerticalPadding: 10.0, + onImageChange: onImageChange, + showIndicator: true, + indicatorBgPadding: 7.0, + + images: imagesUrlList.map((image) { + return Builder(builder: (BuildContext context) { + return Container( + child: Image.network(image, loadingBuilder: (BuildContext context, + Widget child, ImageChunkEvent loadingProgress) { + if (loadingProgress == null) return child; + return Center( + child: SizedBox( + width: 40.0, + height: 40.0, + child: AppCircularProgressIndicator( +// background: Theme +// .of(context) +// .primaryColor, +// value: loadingProgress.expectedTotalBytes != null +// ? loadingProgress.cumulativeBytesLoaded / +// loadingProgress.expectedTotalBytes +// : 0, + ), + ), + ); + }, + width: width, + height: height, + fit: BoxFit.fill), + ); + }); + }).toList(), + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index 9b9588fd..c1a84585 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -110,6 +110,9 @@ dependencies: #Popup_window popup_box: ^0.1.0 + # Carousel + carousel_pro: ^1.0.0 + From 7840ec4c3b64a9ab9688398d3768f5fe54aed20f Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 21 Sep 2020 12:32:44 +0300 Subject: [PATCH 02/36] finish activation process until step 2 --- lib/config/config.dart | 1461 +---------------- .../e_referral_service.dart | 53 +- .../e_referral_view_model.dart | 22 + ...ion_code_for_e_referral_request_model.dart | 57 + ...ion_code_for_e_referral_request_model.dart | 57 + .../e_referral_confirm_sms_dialog.dart | 385 +++++ .../E-Referral/new_e_referral_page.dart | 132 +- .../new_e_referral_step_two_page.dart | 307 ++++ .../select_country_ingo_Dialog.dart | 4 +- 9 files changed, 958 insertions(+), 1520 deletions(-) create mode 100644 lib/models/AlHabibMedicalServices/EReferral/check_activation_code_for_e_referral_request_model.dart create mode 100644 lib/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_model.dart create mode 100644 lib/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart create mode 100644 lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_step_two_page.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 71abe50a..138d9482 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -204,6 +204,9 @@ const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = 'Services/Patients.svc/REST/AP_ 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_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 TIMER_MIN = 10; class AppGlobal { @@ -229,1462 +232,4 @@ class AppGlobal { return request; } - - - - dynamic LIST_CODE = { - "codes": [ - { - "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" - } - ] - }; } diff --git a/lib/core/service/all_habib_medical_services/e_referral_service.dart b/lib/core/service/all_habib_medical_services/e_referral_service.dart index 7229f799..2645e307 100644 --- a/lib/core/service/all_habib_medical_services/e_referral_service.dart +++ b/lib/core/service/all_habib_medical_services/e_referral_service.dart @@ -1,28 +1,57 @@ 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:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_request_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/check_activation_code_for_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; -import 'package:geolocator/geolocator.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_model.dart'; class EReferralService extends BaseService { List _relationTypes = List(); List get relationTypes => _relationTypes; + String _activationCode; + + 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: {}); + _relationTypes.clear(); + response['List_EReferralResult'].forEach((relation) { + _relationTypes + .add(GetAllRelationshipTypeResponseModel.fromJson(relation)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: {}); + } + + Future sendActivationCodeForEReferral( + SendActivationCodeForEReferralRequestModel + sendActivationCodeForEReferralRequestModel) async { + await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_E_REFERRAL, + onSuccess: (dynamic response, int statusCode) { + _activationCode = response["VerificationCode"]; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: sendActivationCodeForEReferralRequestModel.toJson()); } + Future checkActivationCodeForEReferral( + CheckActivationCodeForEReferralResponseModel + checkActivationCodeForEReferralRequestModel) async { + 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()); + } } 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 index 2122aa56..c87d979a 100644 --- 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 @@ -2,7 +2,9 @@ import 'dart:core'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/service/all_habib_medical_services/e_referral_service.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/check_activation_code_for_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import '../../../locator.dart'; @@ -23,4 +25,24 @@ class EReferralViewModel extends BaseViewModel { } setState(ViewState.Idle); } + + void sendActivationCodeForEReferral(SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel) async { + setState(ViewState.BusyLocal); + await _eReferralService.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel); + if (_eReferralService.hasError) { + error = _eReferralService.error; + setState(ViewState.ErrorLocal); + } + setState(ViewState.Idle); + } + + checkActivationCodeForEReferral(CheckActivationCodeForEReferralResponseModel checkActivationCodeForEReferralRequestModel) async { + setState(ViewState.BusyLocal); + await _eReferralService.checkActivationCodeForEReferral(checkActivationCodeForEReferralRequestModel); + if (_eReferralService.hasError) { + error = _eReferralService.error; + setState(ViewState.ErrorLocal); + } + setState(ViewState.Idle); + } } diff --git a/lib/models/AlHabibMedicalServices/EReferral/check_activation_code_for_e_referral_request_model.dart b/lib/models/AlHabibMedicalServices/EReferral/check_activation_code_for_e_referral_request_model.dart new file mode 100644 index 00000000..3f26abe7 --- /dev/null +++ b/lib/models/AlHabibMedicalServices/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/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_model.dart b/lib/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_model.dart new file mode 100644 index 00000000..622ef143 --- /dev/null +++ b/lib/models/AlHabibMedicalServices/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/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..91d7f08d --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart @@ -0,0 +1,385 @@ +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/all_habib_medical_services/e_referral_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/check_activation_code_for_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/new_e_referral_step_two_page.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.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/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +class EReferralConfirmSMSDialog extends StatefulWidget { + final String phoneNumber; + // final AdvanceModel advanceModel; + // final PatientInfoAndMobileNumber patientInfoAndMobileNumber; + // final String selectedPaymentMethod; + + const EReferralConfirmSMSDialog( + {Key key, + this.phoneNumber, + // 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(); + await model.checkActivationCodeForEReferral(checkActivationCodeForEReferralRequestModel); + if(model.state == ViewState.ErrorLocal) { + Utils.showErrorToast(model.error); + } else { + + Navigator.push(context, FadePage(page: NewEReferralStepTowPage())); + // 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/new_e_referral_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_page.dart index c75f3ee7..12d6327f 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_page.dart @@ -1,9 +1,11 @@ +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.dart'; import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_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/select_country_ingo_Dialog.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/select_relation_type_Dialog.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -28,18 +30,25 @@ class NewEReferralPage extends StatefulWidget { } class _NewEReferralPageState extends State { - TextEditingController _fileTextController = TextEditingController(); - TextEditingController _notesTextController = TextEditingController(); + TextEditingController _nameTextController = TextEditingController(); TextEditingController _mobileTextController = TextEditingController(); BeneficiaryType beneficiaryType = BeneficiaryType.NON; GetAllRelationshipTypeResponseModel _selectedRelation; - String amount = ""; String email; - PatientInfo _selectedPatientInfo; AuthenticatedUser authenticatedUser; GetAllSharedRecordsByStatusList selectedPatientFamily; AdvanceModel advanceModel = AdvanceModel(); - dynamic _selectedCountry; + + // 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; @@ -50,6 +59,25 @@ class _NewEReferralPageState extends State { @override Widget build(BuildContext context) { + void showSMSDialog() { + showDialog( + context: context, + barrierDismissible: false, + child: EReferralConfirmSMSDialog( + phoneNumber: _selectedCountry['code']+_mobileTextController.text, + ), + ).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( onModelReady: (model) => model.getRelationTypes(), builder: (_, model, widget) => AppScaffold( @@ -78,10 +106,14 @@ class _NewEReferralPageState extends State { height: 12, ), NewTextFields( - hintText: TranslationBase.of(context).fileNumber, - controller: _fileTextController, + hintText: "Enter Referral Requester Name*", + controller: _nameTextController, + ), + SizedBox( + height: 12, ), InkWell( + onTap: () => confirmSelectCountryTypeDialog(), child: Container( padding: EdgeInsets.all(12), width: double.infinity, @@ -92,7 +124,7 @@ class _NewEReferralPageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts("getPatientName"), + Texts(getCountryName()), Icon(Icons.arrow_drop_down) ], ), @@ -101,30 +133,28 @@ class _NewEReferralPageState extends State { 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) - ], - ), + 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: () => confirmSelectCountryTypeDialog(), + onTap: () => confirmSelectRelationTypeDialog( + model.relationTypes), child: Container( padding: EdgeInsets.all(12), width: double.infinity, @@ -135,7 +165,7 @@ class _NewEReferralPageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(getCountryName()), + Texts(getRelationName()), Icon(Icons.arrow_drop_down) ], ), @@ -144,23 +174,9 @@ class _NewEReferralPageState extends State { SizedBox( height: 12, ), - MobileNumberTextFiled(controller: _mobileTextController,code: _selectedCountry==null?"11":_selectedCountry["code"],), SizedBox( height: 12, ), - SizedBox( - height: 12, - ), - SizedBox( - height: 12, - ), - NewTextFields( - hintText: TranslationBase.of(context).notes, - controller: _notesTextController, - ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.15, - ) ], ), ), @@ -168,17 +184,34 @@ class _NewEReferralPageState extends State { ), ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.1, + height: MediaQuery + .of(context) + .size + .height * 0.1, width: double.infinity, - padding: EdgeInsets.all(12), + padding: EdgeInsets.all(9), child: SecondaryButton( textColor: Colors.white, - label: TranslationBase.of(context).submit, - disabled: amount.isEmpty || - _fileTextController.text.isEmpty || - _selectedRelation == null, + 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( @@ -215,7 +248,7 @@ class _NewEReferralPageState extends State { if (_selectedRelation != null) return _selectedRelation.text; else - return TranslationBase.of(context).selectHospital; + return "Select Relationship" /*TranslationBase.of(context).selectHospital*/; } String getCountryName() { @@ -261,6 +294,7 @@ class MobileNumberTextFiled extends StatelessWidget { 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_step_two_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_step_two_page.dart new file mode 100644 index 00000000..0654e4e4 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_step_two_page.dart @@ -0,0 +1,307 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.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/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_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/select_country_ingo_Dialog.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/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'; + +enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } + +class NewEReferralStepTowPage extends StatefulWidget { + final EReferralViewModel eReferralViewModel; + + const NewEReferralStepTowPage({Key key, this.eReferralViewModel}) : super(key: key); + + @override + _NewEReferralStepTowPageState createState() => _NewEReferralStepTowPageState(); +} + +class _NewEReferralStepTowPageState extends State { + TextEditingController _nameTextController = TextEditingController(); + TextEditingController _mobileTextController = TextEditingController(); + BeneficiaryType beneficiaryType = BeneficiaryType.NON; + 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, + ), + ).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( + 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.94, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 75, + ), + Center( + child: Texts( +// TranslationBase.of(context).advancePaymentLabel, + "Steeeepppppppppp 2", + 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) + ], + ), + ), + ), + 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 { + 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/select_country_ingo_Dialog.dart b/lib/pages/AlHabibMedicalService/E-Referral/select_country_ingo_Dialog.dart index fadf7855..0c8c6f75 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/select_country_ingo_Dialog.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/select_country_ingo_Dialog.dart @@ -19,7 +19,9 @@ class SelectCountryDialog extends StatefulWidget { } class _SelectCountryDialogState extends State { - List countryList = + + // todo create a model for Country + List countryList = [ { "name": "Saudi Arabia", From a4905783ad1e5060825ab41e5dcf41457380251b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 21 Sep 2020 12:36:22 +0300 Subject: [PATCH 03/36] refactor dialogs structure --- .../{ => dialogs}/e_referral_confirm_sms_dialog.dart | 0 .../{ => dialogs}/select_country_ingo_Dialog.dart | 0 .../select_relation_type_dialog.dart} | 0 .../E-Referral/new_e_referral_page.dart | 6 +++--- .../E-Referral/new_e_referral_step_two_page.dart | 6 +++--- 5 files changed, 6 insertions(+), 6 deletions(-) rename lib/pages/AlHabibMedicalService/E-Referral/{ => dialogs}/e_referral_confirm_sms_dialog.dart (100%) rename lib/pages/AlHabibMedicalService/E-Referral/{ => dialogs}/select_country_ingo_Dialog.dart (100%) rename lib/pages/AlHabibMedicalService/E-Referral/{select_relation_type_Dialog.dart => dialogs/select_relation_type_dialog.dart} (100%) diff --git a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/e_referral_confirm_sms_dialog.dart similarity index 100% rename from lib/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart rename to lib/pages/AlHabibMedicalService/E-Referral/dialogs/e_referral_confirm_sms_dialog.dart diff --git a/lib/pages/AlHabibMedicalService/E-Referral/select_country_ingo_Dialog.dart b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart similarity index 100% rename from lib/pages/AlHabibMedicalService/E-Referral/select_country_ingo_Dialog.dart rename to lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart diff --git a/lib/pages/AlHabibMedicalService/E-Referral/select_relation_type_Dialog.dart b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart similarity index 100% rename from lib/pages/AlHabibMedicalService/E-Referral/select_relation_type_Dialog.dart rename to lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart diff --git a/lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_page.dart index 12d6327f..35808776 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_page.dart @@ -5,9 +5,9 @@ import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_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/select_country_ingo_Dialog.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/select_relation_type_Dialog.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/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'; diff --git a/lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_step_two_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_step_two_page.dart index 0654e4e4..0cddb3ee 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_step_two_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_step_two_page.dart @@ -5,9 +5,9 @@ import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_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/select_country_ingo_Dialog.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/select_relation_type_Dialog.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/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'; From f582eee991db82c2f12c9bf3b8a198ee7ea2838b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 23 Sep 2020 09:39:51 +0300 Subject: [PATCH 04/36] make index page of add new referral as page controller --- lib/config/config.dart | 1 + .../e_referral_service.dart | 25 +++ .../e_referral_view_model.dart | 25 ++- .../get_all_cities_request_model.dart | 48 ++++++ .../get_all_cities_response_model.dart | 21 +++ .../new_e_referral_index_page.dart | 69 ++++++++ .../new_e_referral_step_one_page.dart} | 22 ++- .../new_e_referral_step_two_page.dart | 153 ++++++++++++------ .../dialogs/select_city_dialog.dart | 131 +++++++++++++++ .../e_referral_confirm_sms_dialog.dart | 14 +- .../E-Referral/e_referral_page.dart | 6 +- 11 files changed, 440 insertions(+), 75 deletions(-) create mode 100644 lib/models/AlHabibMedicalServices/EReferral/get_all_cities_request_model.dart create mode 100644 lib/models/AlHabibMedicalServices/EReferral/get_all_cities_response_model.dart create mode 100644 lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart rename lib/pages/AlHabibMedicalService/E-Referral/{new_e_referral_page.dart => New_E_Referral/new_e_referral_step_one_page.dart} (93%) rename lib/pages/AlHabibMedicalService/E-Referral/{ => New_E_Referral}/new_e_referral_step_two_page.dart (64%) create mode 100644 lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_city_dialog.dart rename lib/pages/AlHabibMedicalService/E-Referral/{dialogs => }/e_referral_confirm_sms_dialog.dart (97%) diff --git a/lib/config/config.dart b/lib/config/config.dart index 138d9482..ebb1f1cd 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -206,6 +206,7 @@ const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/R 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 TIMER_MIN = 10; diff --git a/lib/core/service/all_habib_medical_services/e_referral_service.dart b/lib/core/service/all_habib_medical_services/e_referral_service.dart index 2645e307..8729f9be 100644 --- a/lib/core/service/all_habib_medical_services/e_referral_service.dart +++ b/lib/core/service/all_habib_medical_services/e_referral_service.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/check_activation_code_for_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_cities_response_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_model.dart'; @@ -8,8 +9,11 @@ class EReferralService extends BaseService { List _relationTypes = List(); List get relationTypes => _relationTypes; + List _allCities = List(); + List get allCities => _allCities; String _activationCode; + String _logInTokenID; String get activationCode => _activationCode; @@ -31,12 +35,30 @@ class EReferralService extends BaseService { }, 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; @@ -46,6 +68,9 @@ class EReferralService extends BaseService { 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; 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 index c87d979a..002fa28c 100644 --- 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 @@ -3,6 +3,7 @@ import 'dart:core'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/service/all_habib_medical_services/e_referral_service.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/check_activation_code_for_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_cities_response_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; @@ -15,15 +16,29 @@ class EReferralViewModel extends BaseViewModel { List get relationTypes => _eReferralService.relationTypes; - + List get allCities => _eReferralService.allCities; + + + 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); } - setState(ViewState.Idle); } void sendActivationCodeForEReferral(SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel) async { @@ -32,8 +47,9 @@ class EReferralViewModel extends BaseViewModel { if (_eReferralService.hasError) { error = _eReferralService.error; setState(ViewState.ErrorLocal); + } else{ + setState(ViewState.Idle); } - setState(ViewState.Idle); } checkActivationCodeForEReferral(CheckActivationCodeForEReferralResponseModel checkActivationCodeForEReferralRequestModel) async { @@ -42,7 +58,8 @@ class EReferralViewModel extends BaseViewModel { if (_eReferralService.hasError) { error = _eReferralService.error; setState(ViewState.ErrorLocal); + } else{ + setState(ViewState.Idle); } - setState(ViewState.Idle); } } diff --git a/lib/models/AlHabibMedicalServices/EReferral/get_all_cities_request_model.dart b/lib/models/AlHabibMedicalServices/EReferral/get_all_cities_request_model.dart new file mode 100644 index 00000000..dd46a48b --- /dev/null +++ b/lib/models/AlHabibMedicalServices/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/models/AlHabibMedicalServices/EReferral/get_all_cities_response_model.dart b/lib/models/AlHabibMedicalServices/EReferral/get_all_cities_response_model.dart new file mode 100644 index 00000000..224cb84d --- /dev/null +++ b/lib/models/AlHabibMedicalServices/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/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..2863e184 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart @@ -0,0 +1,69 @@ + + +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_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; + List attachments; + + @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, + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + NewEReferralStepOnePage( + changePageViewIndex: changePageViewIndex, + ), + NewEReferralStepTowPage( + changePageViewIndex: changePageViewIndex, + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart similarity index 93% rename from lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_page.dart rename to lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart index 35808776..b77228ac 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart @@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_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/e_referral_confirm_sms_dialog.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'; @@ -18,21 +18,20 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } -class NewEReferralPage extends StatefulWidget { +class NewEReferralStepOnePage extends StatefulWidget { final EReferralViewModel eReferralViewModel; + final Function changePageViewIndex; - const NewEReferralPage({Key key, this.eReferralViewModel}) : super(key: key); + const NewEReferralStepOnePage({Key key, this.eReferralViewModel, this.changePageViewIndex}) : super(key: key); @override - _NewEReferralPageState createState() => _NewEReferralPageState(); + _NewEReferralStepOnePageState createState() => _NewEReferralStepOnePageState(); } -class _NewEReferralPageState extends State { +class _NewEReferralStepOnePageState extends State { TextEditingController _nameTextController = TextEditingController(); TextEditingController _mobileTextController = TextEditingController(); - BeneficiaryType beneficiaryType = BeneficiaryType.NON; GetAllRelationshipTypeResponseModel _selectedRelation; String email; AuthenticatedUser authenticatedUser; @@ -65,16 +64,15 @@ class _NewEReferralPageState extends State { barrierDismissible: false, child: EReferralConfirmSMSDialog( phoneNumber: _selectedCountry['code']+_mobileTextController.text, + onSucces: ()=> + widget.changePageViewIndex(1) + ), ).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); + } }); } diff --git a/lib/pages/AlHabibMedicalService/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 similarity index 64% rename from lib/pages/AlHabibMedicalService/E-Referral/new_e_referral_step_two_page.dart rename to lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart index 0cddb3ee..fe7b489c 100644 --- a/lib/pages/AlHabibMedicalService/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 @@ -1,29 +1,35 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.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/AlHabibMedicalServices/EReferral/get_all_cities_request_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_cities_response_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_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/e_referral_confirm_sms_dialog.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/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'; -enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } class NewEReferralStepTowPage extends StatefulWidget { final EReferralViewModel eReferralViewModel; + final Function changePageViewIndex; - const NewEReferralStepTowPage({Key key, this.eReferralViewModel}) : super(key: key); + const NewEReferralStepTowPage({Key key, this.eReferralViewModel, this.changePageViewIndex}) : super(key: key); @override _NewEReferralStepTowPageState createState() => _NewEReferralStepTowPageState(); @@ -32,12 +38,9 @@ class NewEReferralStepTowPage extends StatefulWidget { class _NewEReferralStepTowPageState extends State { TextEditingController _nameTextController = TextEditingController(); TextEditingController _mobileTextController = TextEditingController(); - BeneficiaryType beneficiaryType = BeneficiaryType.NON; - GetAllRelationshipTypeResponseModel _selectedRelation; - String email; - AuthenticatedUser authenticatedUser; + GetAllCitiesResponseModel _selectedCity ; GetAllSharedRecordsByStatusList selectedPatientFamily; - AdvanceModel advanceModel = AdvanceModel(); + List images = []; // todo create a model for Country // todo use country from the json @@ -59,27 +62,8 @@ class _NewEReferralStepTowPageState extends State { @override Widget build(BuildContext context) { - void showSMSDialog() { - showDialog( - context: context, - barrierDismissible: false, - child: EReferralConfirmSMSDialog( - phoneNumber: _selectedCountry['code']+_mobileTextController.text, - ), - ).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( - onModelReady: (model) => model.getRelationTypes(), + onModelReady: (model) => model.getAllCities(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, body: SingleChildScrollView( @@ -98,7 +82,7 @@ class _NewEReferralStepTowPageState extends State { Center( child: Texts( // TranslationBase.of(context).advancePaymentLabel, - "Steeeepppppppppp 2", + "Patient information", textAlign: TextAlign.center, ), ), @@ -106,7 +90,14 @@ class _NewEReferralStepTowPageState extends State { height: 12, ), NewTextFields( - hintText: "Enter Referral Requester Name*", + hintText: "Enter Identification Number", + controller: _nameTextController, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: "Enter Patient Name", controller: _nameTextController, ), SizedBox( @@ -145,7 +136,7 @@ class _NewEReferralStepTowPageState extends State { Center( child: Texts( // TranslationBase.of(context).advancePaymentLabel, - "Requester Relationship", + "Where the patient located", textAlign: TextAlign.center, ), ), @@ -153,8 +144,8 @@ class _NewEReferralStepTowPageState extends State { height: 12, ), InkWell( - onTap: () => confirmSelectRelationTypeDialog( - model.relationTypes), + onTap: () => confirmSelectCityDialog( + model.allCities), child: Container( padding: EdgeInsets.all(12), width: double.infinity, @@ -174,6 +165,73 @@ class _NewEReferralStepTowPageState extends State { SizedBox( height: 12, ), + + InkWell( + onTap: () { + ImageOptions.showImageOptions(context, (String image) { + 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( + 'selected attachment', + 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: 12, ), @@ -194,19 +252,12 @@ class _NewEReferralStepTowPageState extends State { textColor: Colors.white, label: "Next", onTap: () async { - SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel = - SendActivationCodeForEReferralRequestModel( - zipCode: _selectedCountry['code'], - patientMobileNumber: int.parse( - _mobileTextController.text),); - await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel); - - showSMSDialog(); + print(images.toString()); }, loading: model.state == ViewState.BusyLocal, disabled: _nameTextController.text.isEmpty || - _selectedRelation == null || + _selectedCity == null || _mobileTextController.text.isEmpty, ), ))); @@ -214,16 +265,16 @@ class _NewEReferralStepTowPageState extends State { } - void confirmSelectRelationTypeDialog( - List relations) { + void confirmSelectCityDialog( + List cities) { showDialog( context: context, - child: SelectRelationTypeDialog( - relationTypes: relations, - selectedRelation: _selectedRelation, + child: SelectCityDialog( + cities: cities, + selectedCity: _selectedCity, onValueSelected: (value) { setState(() { - _selectedRelation = value; + _selectedCity = value; }); }, ), @@ -245,8 +296,8 @@ class _NewEReferralStepTowPageState extends State { } String getRelationName() { - if (_selectedRelation != null) - return _selectedRelation.text; + if (_selectedCity != null) + return _selectedCity.description; else return "Select Relationship" /*TranslationBase.of(context).selectHospital*/; } @@ -297,7 +348,7 @@ class MobileNumberTextFiled extends StatelessWidget { controller: controller, keyboardType: TextInputType.phone, decoration: InputDecoration( - border: InputBorder.none, hintText: '5xxxxxxxx'), + 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..88ed8992 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_city_dialog.dart @@ -0,0 +1,131 @@ +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_cities_response_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/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 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/e_referral_confirm_sms_dialog.dart b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart similarity index 97% rename from lib/pages/AlHabibMedicalService/E-Referral/dialogs/e_referral_confirm_sms_dialog.dart rename to lib/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart index 91d7f08d..b7719f8c 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/dialogs/e_referral_confirm_sms_dialog.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart @@ -8,7 +8,7 @@ import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobi import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/check_activation_code_for_e_referral_request_model.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/new_e_referral_step_two_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; @@ -19,8 +19,11 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; +import 'New_E_Referral/new_e_referral_index_page.dart'; + class EReferralConfirmSMSDialog extends StatefulWidget { final String phoneNumber; + final Function onSucces; // final AdvanceModel advanceModel; // final PatientInfoAndMobileNumber patientInfoAndMobileNumber; // final String selectedPaymentMethod; @@ -28,6 +31,7 @@ class EReferralConfirmSMSDialog extends StatefulWidget { const EReferralConfirmSMSDialog( {Key key, this.phoneNumber, + this.onSucces // this.advanceModel, // this.selectedPaymentMethod, // this.patientInfoAndMobileNumber @@ -341,13 +345,13 @@ class _EReferralConfirmSMSDialogState extends State { // ToDo call service - CheckActivationCodeForEReferralResponseModel checkActivationCodeForEReferralRequestModel= new CheckActivationCodeForEReferralResponseModel(); + CheckActivationCodeForEReferralResponseModel checkActivationCodeForEReferralRequestModel= new CheckActivationCodeForEReferralResponseModel(activationCode: activationCode); await model.checkActivationCodeForEReferral(checkActivationCodeForEReferralRequestModel); if(model.state == ViewState.ErrorLocal) { - Utils.showErrorToast(model.error); + // Utils.showErrorToast(model.error); } else { - - Navigator.push(context, FadePage(page: NewEReferralStepTowPage())); + widget.onSucces(); + // Navigator.push(context, FadePage(page: StartIndexForAddProduct())); // Navigate to new page } } diff --git a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart index ceeafd2c..9f836860 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart @@ -2,7 +2,8 @@ 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_page.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'; @@ -111,8 +112,7 @@ class _EReferralPageState extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - NewEReferralPage( - eReferralViewModel: model, + StartIndexForNewEReferral( ), SearchForReferralsPage( ) From 1e3ff89dbd2511e0434f7f552157e0e3c2518118 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 24 Sep 2020 10:28:10 +0300 Subject: [PATCH 05/36] finish new e-referral except calling the service --- lib/config/config.dart | 1 + .../e_referral_service.dart | 18 + .../e_referral_view_model.dart | 13 + .../create_e_referral_request_model.dart | 151 ++++++ .../new_e_referral_index_page.dart | 14 +- .../new_e_referral_step_one_page.dart | 19 +- .../new_e_referral_step_three_page.dart | 438 ++++++++++++++++++ .../new_e_referral_step_two_page.dart | 99 +--- .../all_habib_medical_service_page.dart | 2 +- lib/widgets/buttons/secondary_button.dart | 2 +- 10 files changed, 667 insertions(+), 90 deletions(-) create mode 100644 lib/models/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart create mode 100644 lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index ebb1f1cd..8191dbc6 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -207,6 +207,7 @@ const GET_ALL_RELATIONSHIP_TYPES = "Services/Patients.svc/REST/GetAllRelationshi 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 TIMER_MIN = 10; diff --git a/lib/core/service/all_habib_medical_services/e_referral_service.dart b/lib/core/service/all_habib_medical_services/e_referral_service.dart index 8729f9be..51f8fbf4 100644 --- a/lib/core/service/all_habib_medical_services/e_referral_service.dart +++ b/lib/core/service/all_habib_medical_services/e_referral_service.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/check_activation_code_for_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_cities_response_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_model.dart'; @@ -65,6 +66,8 @@ class EReferralService extends BaseService { }, body: sendActivationCodeForEReferralRequestModel.toJson()); } + + Future checkActivationCodeForEReferral( CheckActivationCodeForEReferralResponseModel checkActivationCodeForEReferralRequestModel) async { @@ -79,4 +82,19 @@ class EReferralService extends BaseService { super.error = error; }, body: checkActivationCodeForEReferralRequestModel.toJson()); } + + Future createEReferral( + + CreateEReferralRequestModel createEReferralRequestModel + ) async { + hasError = false; + await baseAppClient.post(CREATE_E_REFERRAL, + onSuccess: (dynamic response, int statusCode) { + print("EEEEEE"); + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: createEReferralRequestModel.toJson()); + } } 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 index 002fa28c..2a43d7b3 100644 --- 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 @@ -3,6 +3,7 @@ import 'dart:core'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/service/all_habib_medical_services/e_referral_service.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/check_activation_code_for_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_cities_response_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_model.dart'; @@ -62,4 +63,16 @@ class EReferralViewModel extends BaseViewModel { 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); + } + } } diff --git a/lib/models/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart b/lib/models/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart new file mode 100644 index 00000000..34139ba2 --- /dev/null +++ b/lib/models/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart @@ -0,0 +1,151 @@ +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; + EReferralAttachment 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'] = 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/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 index 2863e184..09297312 100644 --- 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 @@ -1,8 +1,10 @@ +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/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 { @@ -19,7 +21,9 @@ class _StartIndexForNewEReferralState extends State PageController _controller; int _currentIndex = 1; int pageSelected = 2; - List attachments; + + + CreateEReferralRequestModel createEReferralRequestModel = new CreateEReferralRequestModel(); @override void initState() { @@ -55,9 +59,17 @@ class _StartIndexForNewEReferralState extends State 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 index b77228ac..a69bc014 100644 --- 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 @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.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/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; @@ -20,10 +21,10 @@ import 'package:flutter/material.dart'; class NewEReferralStepOnePage extends StatefulWidget { - final EReferralViewModel eReferralViewModel; + final CreateEReferralRequestModel createEReferralRequestModel; final Function changePageViewIndex; - const NewEReferralStepOnePage({Key key, this.eReferralViewModel, this.changePageViewIndex}) : super(key: key); + const NewEReferralStepOnePage({Key key, this.createEReferralRequestModel, this.changePageViewIndex}) : super(key: key); @override _NewEReferralStepOnePageState createState() => _NewEReferralStepOnePageState(); @@ -64,8 +65,16 @@ class _NewEReferralStepOnePageState extends State { barrierDismissible: false, child: EReferralConfirmSMSDialog( phoneNumber: _selectedCountry['code']+_mobileTextController.text, - onSucces: ()=> - widget.changePageViewIndex(1) + onSucces: (){ + Navigator.of(context).pop(); + widget.changePageViewIndex(1); + widget.createEReferralRequestModel.requesterName=_nameTextController.text; + widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code']+_mobileTextController.text; + widget.createEReferralRequestModel.requesterRelationship=_selectedRelation.iD; + + + } + ), ).then((value) { @@ -191,7 +200,7 @@ class _NewEReferralStepOnePageState extends State { child: SecondaryButton( textColor: Colors.white, label: "Next", - onTap: () async { + onTap: () async { SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel = SendActivationCodeForEReferralRequestModel( zipCode: _selectedCountry['code'], 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..82751ea7 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart @@ -0,0 +1,438 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_cities_response_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/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 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; + + // 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( + 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: 40, + ), + 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) { + 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, + ), + ), + ], + ), + ], + ), + ], + ), + ), + 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) { + 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[0]; + 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 index fe7b489c..03c56086 100644 --- 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 @@ -1,19 +1,13 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.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/AlHabibMedicalServices/EReferral/get_all_cities_request_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_cities_response_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_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/bottom_options/BottomSheet.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -26,21 +20,21 @@ import '../dialogs/select_city_dialog.dart'; class NewEReferralStepTowPage extends StatefulWidget { - final EReferralViewModel eReferralViewModel; + final CreateEReferralRequestModel createEReferralRequestModel; final Function changePageViewIndex; - const NewEReferralStepTowPage({Key key, this.eReferralViewModel, this.changePageViewIndex}) : super(key: key); + const NewEReferralStepTowPage({Key key, this.createEReferralRequestModel, this.changePageViewIndex}) : super(key: key); @override _NewEReferralStepTowPageState createState() => _NewEReferralStepTowPageState(); } class _NewEReferralStepTowPageState extends State { - TextEditingController _nameTextController = TextEditingController(); + TextEditingController _patientNameTextController = TextEditingController(); + TextEditingController _patientIdentificationTextController = TextEditingController(); TextEditingController _mobileTextController = TextEditingController(); GetAllCitiesResponseModel _selectedCity ; GetAllSharedRecordsByStatusList selectedPatientFamily; - List images = []; // todo create a model for Country // todo use country from the json @@ -91,14 +85,15 @@ class _NewEReferralStepTowPageState extends State { ), NewTextFields( hintText: "Enter Identification Number", - controller: _nameTextController, + controller: _patientIdentificationTextController, + keyboardType:TextInputType.number , ), SizedBox( height: 12, ), NewTextFields( hintText: "Enter Patient Name", - controller: _nameTextController, + controller: _patientNameTextController, ), SizedBox( height: 12, @@ -166,72 +161,6 @@ class _NewEReferralStepTowPageState extends State { height: 12, ), - InkWell( - onTap: () { - ImageOptions.showImageOptions(context, (String image) { - 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( - 'selected attachment', - 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: 12, ), @@ -252,11 +181,17 @@ class _NewEReferralStepTowPageState extends State { textColor: Colors.white, label: "Next", onTap: () async { - print(images.toString()); + this.widget.changePageViewIndex(2); + this.widget.createEReferralRequestModel.identificationNo = int.parse( _patientIdentificationTextController.text); + this.widget.createEReferralRequestModel.patientMobileNumber = _selectedCountry['code']+_mobileTextController.text; + this.widget.createEReferralRequestModel.cityCode = _selectedCity.iD.toString(); + this.widget.createEReferralRequestModel.cityName = _selectedCity.description; + + }, loading: model.state == ViewState.BusyLocal, disabled: - _nameTextController.text.isEmpty || + _patientNameTextController.text.isEmpty || _patientIdentificationTextController.text.isEmpty|| _selectedCity == null || _mobileTextController.text.isEmpty, ), @@ -299,7 +234,7 @@ class _NewEReferralStepTowPageState extends State { if (_selectedCity != null) return _selectedCity.description; else - return "Select Relationship" /*TranslationBase.of(context).selectHospital*/; + return "Select City" /*TranslationBase.of(context).selectHospital*/; } String getCountryName() { diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 3e08cee5..4a1dd469 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -63,7 +63,7 @@ class _AllHabibMedicalServiceState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Texts( - "EReferralPage", + "E-Referral", fontSize: 16, ) ], diff --git a/lib/widgets/buttons/secondary_button.dart b/lib/widgets/buttons/secondary_button.dart index 65bb8d36..4bceab3c 100644 --- a/lib/widgets/buttons/secondary_button.dart +++ b/lib/widgets/buttons/secondary_button.dart @@ -139,7 +139,7 @@ class _SecondaryButtonState extends State onTapCancel: () { _animationController.forward(); }, - onTap: Feedback.wrapForTap(widget.onTap, context), + onTap: widget.disabled?null:Feedback.wrapForTap(widget.onTap, context), behavior: HitTestBehavior.opaque, child: Transform.scale( scale: _buttonSize, From ae147b59888ab56c8a34b7d17ac91b28b99ef762 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 24 Sep 2020 17:02:37 +0300 Subject: [PATCH 06/36] first step from search referrals --- lib/config/config.dart | 6 + .../e_referral_service.dart | 29 ++- .../e_referral_view_model.dart | 21 +- .../EReferral/search_criteria_model.dart | 21 ++ .../search_e_referral_request_model.dart | 60 +++++ .../search_e_referral_response_model.dart | 60 +++++ .../new_e_referral_step_one_page.dart | 8 +- .../new_e_referral_step_three_page.dart | 15 +- .../new_e_referral_step_two_page.dart | 2 +- .../select_search_criteria_dialog.dart | 139 +++++++++++ .../E-Referral/search_for_referrals_page.dart | 222 +++++++++++++++++- 11 files changed, 547 insertions(+), 36 deletions(-) create mode 100644 lib/models/AlHabibMedicalServices/EReferral/search_criteria_model.dart create mode 100644 lib/models/AlHabibMedicalServices/EReferral/search_e_referral_request_model.dart create mode 100644 lib/models/AlHabibMedicalServices/EReferral/search_e_referral_response_model.dart create mode 100644 lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_search_criteria_dialog.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 8191dbc6..cf7a7b54 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -203,11 +203,17 @@ const GET_PATIENT_INFO_BY_ID = 'Services/Doctors.svc/REST/GetPatientInfoByPatien 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'; + + + +//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"; const TIMER_MIN = 10; diff --git a/lib/core/service/all_habib_medical_services/e_referral_service.dart b/lib/core/service/all_habib_medical_services/e_referral_service.dart index 51f8fbf4..49453169 100644 --- a/lib/core/service/all_habib_medical_services/e_referral_service.dart +++ b/lib/core/service/all_habib_medical_services/e_referral_service.dart @@ -4,15 +4,18 @@ import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/che import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_cities_response_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/search_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/search_e_referral_response_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_model.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; @@ -84,7 +87,6 @@ class EReferralService extends BaseService { } Future createEReferral( - CreateEReferralRequestModel createEReferralRequestModel ) async { hasError = false; @@ -97,4 +99,25 @@ class EReferralService extends BaseService { super.error = error; }, body: createEReferralRequestModel.toJson()); } + + Future getEReferrals( + SearchEReferralRequestModel searchEReferralRequestModel + ) async { + hasError = false; + await baseAppClient.post(GET_E_REFERRALS, + onSuccess: (dynamic response, int statusCode) { + print("EEEEEE"); + + // 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/viewModels/all_habib_medical_services/e_referral_view_model.dart b/lib/core/viewModels/all_habib_medical_services/e_referral_view_model.dart index 2a43d7b3..1c8a1200 100644 --- 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 @@ -6,8 +6,9 @@ import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/che import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_cities_response_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/search_e_referral_request_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/search_e_referral_response_model.dart'; import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_model.dart'; -import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; @@ -18,6 +19,7 @@ class EReferralViewModel extends BaseViewModel { List get relationTypes => _eReferralService.relationTypes; List get allCities => _eReferralService.allCities; + List get allReferral => _eReferralService.allReferral; @@ -64,14 +66,25 @@ class EReferralViewModel extends BaseViewModel { } } - - void createEReferral(CreateEReferralRequestModel createEReferralRequestModel) async { + void createEReferral( + CreateEReferralRequestModel createEReferralRequestModel) async { setState(ViewState.BusyLocal); await _eReferralService.createEReferral(createEReferralRequestModel); if (_eReferralService.hasError) { error = _eReferralService.error; setState(ViewState.ErrorLocal); - } else{ + } 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/models/AlHabibMedicalServices/EReferral/search_criteria_model.dart b/lib/models/AlHabibMedicalServices/EReferral/search_criteria_model.dart new file mode 100644 index 00000000..3ddbe331 --- /dev/null +++ b/lib/models/AlHabibMedicalServices/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/models/AlHabibMedicalServices/EReferral/search_e_referral_request_model.dart b/lib/models/AlHabibMedicalServices/EReferral/search_e_referral_request_model.dart new file mode 100644 index 00000000..b06ce8e7 --- /dev/null +++ b/lib/models/AlHabibMedicalServices/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/models/AlHabibMedicalServices/EReferral/search_e_referral_response_model.dart b/lib/models/AlHabibMedicalServices/EReferral/search_e_referral_response_model.dart new file mode 100644 index 00000000..801d8e13 --- /dev/null +++ b/lib/models/AlHabibMedicalServices/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/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 index a69bc014..bc06dcf7 100644 --- 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 @@ -100,7 +100,7 @@ class _NewEReferralStepOnePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 75, + height: 20, ), Center( child: Texts( @@ -178,12 +178,6 @@ class _NewEReferralStepOnePageState extends State { ), ), ), - SizedBox( - height: 12, - ), - SizedBox( - height: 12, - ), ], ), ), 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 index 82751ea7..be507678 100644 --- 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 @@ -4,7 +4,6 @@ import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/cre import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_cities_response_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/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; @@ -40,17 +39,6 @@ class _NewEReferralStepThreePageState extends State { List insuredPatientImages = []; bool isPatientInsured = false; - - // 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; @@ -76,7 +64,7 @@ class _NewEReferralStepThreePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 40, + height: 20, ), Center( child: Texts( @@ -274,6 +262,7 @@ class _NewEReferralStepThreePageState extends State { ], ), ), + if(isPatientInsured) SizedBox( height: 12, ), 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 index 03c56086..407abc9b 100644 --- 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 @@ -71,7 +71,7 @@ class _NewEReferralStepTowPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 75, + height: 30, ), Center( child: Texts( 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..3c28b6fe --- /dev/null +++ b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_search_criteria_dialog.dart @@ -0,0 +1,139 @@ +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/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/search_for_referrals_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart index 3662bd51..f8465e76 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart @@ -1,21 +1,227 @@ -import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_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/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/search_criteria_model.dart'; +import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/search_e_referral_request_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/transitions/fade_page.dart'; +import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class SearchForReferralsPage extends StatelessWidget { +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 AppScaffold( - body: Container(), + 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 allReferral 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; + } } From b853bede685a00dac336919bf37257bab1e4ae11 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 28 Sep 2020 17:55:24 +0300 Subject: [PATCH 07/36] first step from h2o --- lib/config/config.dart | 8 + .../user_progress_for_today_data_model.dart | 28 ++ .../user_progress_request_model.dart | 76 ++++++ .../AlHabibMedicalService/H2O_service.dart | 61 +++++ .../AlHabibMedicalService/H2O_view_model.dart | 24 ++ lib/locator.dart | 4 + .../all_habib_medical_service_page.dart | 4 +- .../h2o/h2o_index_page.dart | 122 +++++++++ .../AlHabibMedicalService/h2o/month_page.dart | 8 + .../AlHabibMedicalService/h2o/today_page.dart | 184 +++++++++++++ .../AlHabibMedicalService/h2o/week_page.dart | 8 + .../widgets/h20_floating_action_button.dart | 253 ++++++++++++++++++ lib/widgets/others/app_scaffold_widget.dart | 5 +- 13 files changed, 782 insertions(+), 3 deletions(-) create mode 100644 lib/core/model/AlHabibMedicalService/user_progress_for_today_data_model.dart create mode 100644 lib/core/model/AlHabibMedicalService/user_progress_request_model.dart create mode 100644 lib/core/service/AlHabibMedicalService/H2O_service.dart create mode 100644 lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart create mode 100644 lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart create mode 100644 lib/pages/AlHabibMedicalService/h2o/month_page.dart create mode 100644 lib/pages/AlHabibMedicalService/h2o/today_page.dart create mode 100644 lib/pages/AlHabibMedicalService/h2o/week_page.dart create mode 100644 lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 90c37129..63dc8bc6 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -210,6 +210,14 @@ const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = 'Services/Patients.svc/REST/AP_ const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment'; const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; + + +// H2O +const H2O_GET_USER_PROGRESS = "/Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; + + + + const TIMER_MIN = 10; class AppGlobal { diff --git a/lib/core/model/AlHabibMedicalService/user_progress_for_today_data_model.dart b/lib/core/model/AlHabibMedicalService/user_progress_for_today_data_model.dart new file mode 100644 index 00000000..63c7093b --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/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/user_progress_request_model.dart b/lib/core/model/AlHabibMedicalService/user_progress_request_model.dart new file mode 100644 index 00000000..d06e053b --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/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/service/AlHabibMedicalService/H2O_service.dart b/lib/core/service/AlHabibMedicalService/H2O_service.dart new file mode 100644 index 00000000..80f8b4d6 --- /dev/null +++ b/lib/core/service/AlHabibMedicalService/H2O_service.dart @@ -0,0 +1,61 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_today_data_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_request_model.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class H2OService extends BaseService { + List userProgressForTodayDataList = List(); + UserProgressRequestModel userProgressRequestModel = + UserProgressRequestModel(); + + Future getUserProgressForTodayData() async { + userProgressRequestModel.progress = 1; + userProgressRequestModel.mobileNumber = "537503378";//super.user.mobileNumber; + userProgressRequestModel.identificationNo = super.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; + + hasError = false; + // await baseAppClient.post(H2O_GET_USER_PROGRESS, + // onSuccess: (dynamic response, int statusCode) { + // userProgressForTodayDataList.clear(); + // response['UserProgressForWeekData'].forEach((hospital) { + // userProgressForTodayDataList.add(PatientLabOrders.fromJson(hospital)); + // }); + // }, onFailure: (String error, int statusCode) { + // hasError = true; + // super.error = error; + // }, body: {}); + } + + Future getUserProgressForMonthData() async { + userProgressRequestModel.progress = 2; + + hasError = false; + // await baseAppClient.post(H2O_GET_USER_PROGRESS, + // onSuccess: (dynamic response, int statusCode) { + // userProgressForTodayDataList.clear(); + // response['UserProgressForMonthData'].forEach((hospital) { + // userProgressForTodayDataList.add(PatientLabOrders.fromJson(hospital)); + // }); + // }, onFailure: (String error, int statusCode) { + // hasError = true; + // super.error = error; + // }, body: _requestPatientLabOrders.toJson()); + } +} 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..7a5b497d --- /dev/null +++ b/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart @@ -0,0 +1,24 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_today_data_model.dart'; +import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; + +import '../../../locator.dart'; + +class H2OViewModel extends BaseViewModel { + H2OService _h2OService = + locator(); + UserProgressForTodayDataModel get userProgressData => _h2OService.userProgressForTodayDataList[0]; + + Future getUserProgressForTodayData() async { + setState(ViewState.BusyLocal); + await _h2OService.getUserProgressForTodayData(); + if (_h2OService.hasError) { + error = _h2OService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + +} diff --git a/lib/locator.dart b/lib/locator.dart index 072370b7..e54c31b1 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,4 +1,6 @@ +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/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:get_it/get_it.dart'; @@ -76,6 +78,7 @@ void setupLocator() { locator.registerLazySingleton(() => MyBalanceService()); locator.registerLazySingleton(() => FindusService()); locator.registerLazySingleton(() => LiveChatService()); + locator.registerLazySingleton(() => H2OService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -100,5 +103,6 @@ void setupLocator() { locator.registerFactory(() => MyBalanceViewModel()); locator.registerFactory(() => FindusViewModel()); locator.registerFactory(() => LiveChatViewModel()); + locator.registerFactory(() => H2OViewModel()); } diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 616b5fd8..bc119a22 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -17,6 +17,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/widgets/data_display/services)contaniner.dart'; +import 'h2o/h2o_index_page.dart'; + class AllHabibMedicalService extends StatefulWidget { @override _AllHabibMedicalServiceState createState() => _AllHabibMedicalServiceState(); @@ -237,7 +239,7 @@ class _AllHabibMedicalServiceState extends State { onTap: () => Navigator.push( context, FadePage( - page: ParkingPage(), + page: H2OPage(), ), ), imageLocation: 'assets/images/new-design/water_icon.png', 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..ff67dbc0 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart @@ -0,0 +1,122 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_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/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 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( + onModelReady: (model) => model.getPrescriptions(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).myDoctor, + 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: 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: 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..86dfa0d1 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/h2o/month_page.dart @@ -0,0 +1,8 @@ +import 'package:flutter/cupertino.dart'; + +class MonthPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Center(child: Container(child: Text("Month Page "),)); + } +} diff --git a/lib/pages/AlHabibMedicalService/h2o/today_page.dart b/lib/pages/AlHabibMedicalService/h2o/today_page.dart new file mode 100644 index 00000000..d394d355 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/h2o/today_page.dart @@ -0,0 +1,184 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +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:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.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 StatefulWidget { + @override + _TodayPageState createState() => _TodayPageState(); +} + +class _TodayPageState extends State with TickerProviderStateMixin { + static const List icons = const [ + Icons.sms, + Icons.mail, + Icons.phone + ]; + AnimationController _controller; + + @override + void initState() { + _controller = new AnimationController( + vsync: this, + duration: const Duration(milliseconds: 500), + ); + super.initState(); + } + + @override + Widget build(BuildContext context) { + Color backgroundColor = Theme.of(context).cardColor; + Color foregroundColor = Theme.of(context).accentColor; + return BaseView( + onModelReady: (model) => model.getUserProgressForTodayData(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: false, + appBarTitle: "Water Tracker", + body: SingleChildScrollView( + padding: EdgeInsets.symmetric(vertical: 12), + child: model.state == ViewState.BusyLocal + ? Center( + child: Container( + margin: EdgeInsets.only(top: 90), + child: AppCircularProgressIndicator())) + : 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.percentageConsumed / + 100), + //, + center: Center( + child: Column( + children: [ + SizedBox( + height: 40, + ), + Text( + "Consumed", + style: TextStyle(fontSize: 20.0), + ), + SizedBox( + height: 4, + ), + Text( + model.userProgressData.quantityConsumed + .toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20.0, + color: Hexcolor("#60BCF9")), + ), + SizedBox( + height: 4, + ), + SizedBox( + height: 5, + width: 50, + child: Container( + color: Colors.grey, + ), + ), + Text( + "Remaining", + style: TextStyle(fontSize: 20.0), + ), + SizedBox( + height: 4, + ), + Text( + (model.userProgressData.quantityLimit - + model.userProgressData + .quantityConsumed) + .toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20.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, + backgroundColor: backgroundColor, + foregroundColor: foregroundColor)), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/h2o/week_page.dart b/lib/pages/AlHabibMedicalService/h2o/week_page.dart new file mode 100644 index 00000000..6acf8062 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/h2o/week_page.dart @@ -0,0 +1,8 @@ +import 'package:flutter/cupertino.dart'; + +class WeekPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Center(child: Container(child: Text("Week page"),)); + } +} 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..08a787dc --- /dev/null +++ b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart @@ -0,0 +1,253 @@ +import 'dart:math' as math; + +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/material.dart'; + +class H20FloatingActionButton extends StatelessWidget { + const H20FloatingActionButton({ + Key key, + @required AnimationController controller, + @required this.backgroundColor, + @required this.foregroundColor, + }) : _controller = controller, + super(key: key); + + final AnimationController _controller; + final Color backgroundColor; + final Color foregroundColor; + + @override + Widget build(BuildContext context) { + _showMaterialDialog(String count) { + + + 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 $count ?", + 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: () { + + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } + + void ShowConfirmMessage(String count){ + showDialog( + context: context, + child: _showMaterialDialog(count) + ); + } + + + + + + 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("600ml"); + }, + ), + ActionButton( + controller: _controller, + text: "330ml", + onTap: () { + ShowConfirmMessage("330ml"); + }, + ), + ActionButton( + controller: _controller, + text: "200ml", + onTap: () { + ShowConfirmMessage("200ml"); + }, + ), + ], + ), + ], + ), + 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( + heroTag: null, + backgroundColor: backgroundColor, + mini: true, + child: Text( + "Custom", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 14.0, color: Colors.grey), + ), + onPressed: () {}, + ), + ), + ), + 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( + heroTag: null, + backgroundColor: backgroundColor, + 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/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 56e06939..80a3e7af 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -25,6 +25,7 @@ class AppScaffold extends StatelessWidget { final bool isShowAppBar; final bool hasAppBarParam; final BaseViewModel baseViewModel; + final Widget floatingActionButton; AppScaffold( {@required this.body, @@ -33,7 +34,7 @@ class AppScaffold extends StatelessWidget { this.isShowAppBar = false, this.hasAppBarParam, this.bottomSheet, - this.baseViewModel}); + this.baseViewModel, this.floatingActionButton}); @override Widget build(BuildContext context) { @@ -75,7 +76,7 @@ class AppScaffold extends StatelessWidget { : buildBodyWidget(), bottomSheet: bottomSheet, // bottomNavigationBar: BottomBarSearch() - //floatingActionButton: FloatingSearchButton(), + floatingActionButton: floatingActionButton??floatingActionButton, ); } From b1b6c77d6212e0e5f8973aef1213f706d69cec88 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 29 Sep 2020 12:07:27 +0300 Subject: [PATCH 08/36] Finish H2O Services --- lib/config/config.dart | 2 +- .../insert_user_activity_request_model.dart | 76 ++++++ .../AlHabibMedicalService/H2O_service.dart | 20 +- .../AlHabibMedicalService/H2O_view_model.dart | 29 ++- .../h2o/Dialog/confirm_add_amount_dialog.dart | 107 +++++++++ .../h2o/Dialog/select_amount_dialog.dart | 157 +++++++++++++ .../h2o/add_custom_amount.dart | 131 +++++++++++ .../AlHabibMedicalService/h2o/today_page.dart | 40 ++-- .../widgets/h20_floating_action_button.dart | 217 ++++++++++-------- 9 files changed, 663 insertions(+), 116 deletions(-) create mode 100644 lib/core/model/AlHabibMedicalService/insert_user_activity_request_model.dart create mode 100644 lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart create mode 100644 lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart create mode 100644 lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 63dc8bc6..f995d2a4 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -214,7 +214,7 @@ const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/R // H2O const H2O_GET_USER_PROGRESS = "/Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; - +const H2O_INSERT_USER_ACTIVITY="Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; diff --git a/lib/core/model/AlHabibMedicalService/insert_user_activity_request_model.dart b/lib/core/model/AlHabibMedicalService/insert_user_activity_request_model.dart new file mode 100644 index 00000000..2d27729b --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/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/service/AlHabibMedicalService/H2O_service.dart b/lib/core/service/AlHabibMedicalService/H2O_service.dart index 80f8b4d6..2f73e7f0 100644 --- a/lib/core/service/AlHabibMedicalService/H2O_service.dart +++ b/lib/core/service/AlHabibMedicalService/H2O_service.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/insert_user_activity_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_today_data_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_request_model.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; @@ -10,7 +11,7 @@ class H2OService extends BaseService { Future getUserProgressForTodayData() async { userProgressRequestModel.progress = 1; - userProgressRequestModel.mobileNumber = "537503378";//super.user.mobileNumber; + userProgressRequestModel.mobileNumber = super.user.mobileNumber.substring(1); userProgressRequestModel.identificationNo = super.user.patientIdentificationNo; hasError = false; @@ -27,6 +28,23 @@ class H2OService extends BaseService { }, 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()); + } + Future getUserProgressForWeekData() async { userProgressRequestModel.progress = 2; diff --git a/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart index 7a5b497d..0ebb9712 100644 --- a/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart @@ -1,21 +1,44 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/insert_user_activity_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_today_data_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_request_model.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import '../../../locator.dart'; class H2OViewModel extends BaseViewModel { - H2OService _h2OService = - locator(); + + H2OService _h2OService = locator(); + UserProgressForTodayDataModel get userProgressData => _h2OService.userProgressForTodayDataList[0]; Future getUserProgressForTodayData() async { + + + // UserProgressRequestModel userProgressRequestModel = + // UserProgressRequestModel(); + // userProgressRequestModel.progress = 1; + // userProgressRequestModel.mobileNumber = user.mobileNumber.substring(1); + // userProgressRequestModel.identificationNo = user.patientIdentificationNo; setState(ViewState.BusyLocal); await _h2OService.getUserProgressForTodayData(); if (_h2OService.hasError) { error = _h2OService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + 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); } 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..2b2873e4 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart @@ -0,0 +1,107 @@ +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/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/today_page.dart b/lib/pages/AlHabibMedicalService/h2o/today_page.dart index d394d355..d6c62cbb 100644 --- a/lib/pages/AlHabibMedicalService/h2o/today_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/today_page.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; 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/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'; @@ -47,7 +48,7 @@ class _TodayPageState extends State with TickerProviderStateMixin { child: Container( margin: EdgeInsets.only(top: 90), child: AppCircularProgressIndicator())) - : Container( + : model.state == ViewState.ErrorLocal ? AppEmbeddedError(error: model.error):Container( margin: EdgeInsets.only(top: 60), child: Column( children: [ @@ -59,6 +60,7 @@ class _TodayPageState extends State with TickerProviderStateMixin { lineWidth: 15.0, percent: (model.userProgressData.percentageConsumed / + 100) >= 1?1:(model.userProgressData.percentageConsumed / 100), //, center: Center( @@ -76,7 +78,7 @@ class _TodayPageState extends State with TickerProviderStateMixin { ), Text( model.userProgressData.quantityConsumed - .toString(), + .toString() + 'ml', style: TextStyle( fontWeight: FontWeight.bold, fontSize: 20.0, @@ -89,9 +91,12 @@ class _TodayPageState extends State with TickerProviderStateMixin { height: 5, width: 50, child: Container( - color: Colors.grey, + ), ), + SizedBox( + height: 4, + ), Text( "Remaining", style: TextStyle(fontSize: 20.0), @@ -102,11 +107,13 @@ class _TodayPageState extends State with TickerProviderStateMixin { Text( (model.userProgressData.quantityLimit - model.userProgressData - .quantityConsumed) - .toString(), + .quantityConsumed) <0 ?"0 ml": + (model.userProgressData.quantityLimit - + model.userProgressData + .quantityConsumed).toString() +' ml', style: TextStyle( fontWeight: FontWeight.bold, - fontSize: 20.0), + fontSize: 18.0), ), ], ), @@ -167,18 +174,19 @@ class _TodayPageState extends State with TickerProviderStateMixin { SizedBox( height: 0.5, width: MediaQuery.of(context).size.width, - child: Container( - color: Colors.grey, - ), + child: Container( + color: Colors.grey, ), - ], - ), + ), + ], ), - ), - floatingActionButton: H20FloatingActionButton( - controller: _controller, - backgroundColor: backgroundColor, - foregroundColor: foregroundColor)), + ), + ), + floatingActionButton: H20FloatingActionButton( + controller: _controller, + model: model, + ), + ), ); } } diff --git a/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart index 08a787dc..782e6a00 100644 --- a/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart +++ b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart @@ -1,111 +1,129 @@ import 'dart:math' as math; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/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 StatelessWidget { const H20FloatingActionButton({ Key key, @required AnimationController controller, - @required this.backgroundColor, - @required this.foregroundColor, + @required this.model + }) : _controller = controller, super(key: key); final AnimationController _controller; - final Color backgroundColor; - final Color foregroundColor; - + final H2OViewModel model; @override Widget build(BuildContext context) { - _showMaterialDialog(String count) { - - - 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 $count ?", - 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: () { + // _showMaterialDialog(String count, H2OViewModel model) { + // 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 $count ?", + // 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{ + // // insertUserActivity + // int addedValue; + // + // switch(count) { + // case "600ml": { + // addedValue = 600; + // } + // break; + // + // case "330ml": { + // addedValue = 330; + // + // } + // break; + // case "200ml": { + // addedValue = 200; + // } + // break; + // + // } + // + // InsertUserActivityRequestModel insertUserActivityRequestModel= InsertUserActivityRequestModel(quantityIntake:addedValue ); + // await 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, + // )), + // ), + // ), + // ), + // ], + // ) + // ], + // ) + // ], + // ); + // } - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, - )), - ), - ), - ), - ], - ) - ], - ) - ], - ); + void showConfirmMessage(int amount, H2OViewModel model) { + showDialog(context: context, child: ConfirmAddAmountDialog(model: model,amount:amount,)); } - void ShowConfirmMessage(String count){ - showDialog( - context: context, - child: _showMaterialDialog(count) - ); - } - - - - - return Container( margin: EdgeInsets.only(left: 20), child: new Column(mainAxisSize: MainAxisSize.min, children: [ @@ -119,21 +137,21 @@ class H20FloatingActionButton extends StatelessWidget { controller: _controller, text: "600ml", onTap: () { - ShowConfirmMessage("600ml"); + showConfirmMessage(600, model); }, ), ActionButton( controller: _controller, text: "330ml", onTap: () { - ShowConfirmMessage("330ml"); + showConfirmMessage(330, model); }, ), ActionButton( controller: _controller, text: "200ml", onTap: () { - ShowConfirmMessage("200ml"); + showConfirmMessage(200, model); }, ), ], @@ -174,15 +192,24 @@ class H20FloatingActionButton extends StatelessWidget { curve: Curves.easeOut), ), child: new FloatingActionButton( + backgroundColor: Colors.white, heroTag: null, - backgroundColor: backgroundColor, mini: true, child: Text( "Custom", textAlign: TextAlign.center, style: TextStyle(fontSize: 14.0, color: Colors.grey), ), - onPressed: () {}, + onPressed: () { + Navigator.push( + context, + FadePage( + page: AddCustomAmount( + model: model, + ), + ), + ); + }, ), ), ), @@ -195,8 +222,8 @@ class H20FloatingActionButton extends StatelessWidget { curve: Curves.easeOut), ), child: new FloatingActionButton( + backgroundColor: Colors.white, heroTag: null, - backgroundColor: backgroundColor, mini: true, child: Text( "Undo", From a00bc8268e0b950c803db187bd33fdd34d973193 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 29 Sep 2020 14:19:00 +0300 Subject: [PATCH 09/36] improve E-referral --- .../e_referral_service.dart | 15 ++++++++------- .../new_e_referral_step_three_page.dart | 4 ++-- .../E-Referral/search_for_referrals_page.dart | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/core/service/all_habib_medical_services/e_referral_service.dart b/lib/core/service/all_habib_medical_services/e_referral_service.dart index 49453169..b7cfd7e6 100644 --- a/lib/core/service/all_habib_medical_services/e_referral_service.dart +++ b/lib/core/service/all_habib_medical_services/e_referral_service.dart @@ -89,10 +89,11 @@ class EReferralService extends BaseService { Future createEReferral( CreateEReferralRequestModel createEReferralRequestModel ) async { - hasError = false; + hasError = false; await baseAppClient.post(CREATE_E_REFERRAL, onSuccess: (dynamic response, int statusCode) { - print("EEEEEE"); + // TODO Waiting for fix service + ("EEEEEE"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -107,13 +108,13 @@ class EReferralService extends BaseService { 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)); - }); + // response['ListCities'].forEach((city) { + // _allReferral + // .add(SearchEReferralResponseModel.fromJson(city)); + // }); }, onFailure: (String error, int statusCode) { hasError = true; 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 index be507678..ed46cbc1 100644 --- 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 @@ -378,8 +378,8 @@ class _NewEReferralStepThreePageState extends State { textColor: Colors.white, label: "Submit", onTap: () async { - // this.widget.createEReferralRequestModel.medicalReportAttachment = medicalReportImages; - // this.widget.createEReferralRequestModel.insuranceCardAttachment = insuredPatientImages[0]; + 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; diff --git a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart index f8465e76..5230ed92 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart @@ -122,7 +122,7 @@ class _SearchForReferralsPageState extends State { ), if ((model.state == ViewState.Idle && model.allReferral.length == 0)) - Text("There's No allReferral To deliver"), + Text("There's No Referral To deliver"), if (( model.state == ViewState.ErrorLocal)) AppEmbeddedError( error:model.error), From 37d9eae9eaa19c6484f664d8964fa60bb3db5e04 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 30 Sep 2020 09:02:51 +0300 Subject: [PATCH 10/36] improve E-referral --- lib/config/config.dart | 4 ++-- .../all_habib_medical_services/e_referral_service.dart | 4 ++-- lib/core/service/client/base_app_client.dart | 3 ++- .../EReferral/create_e_referral_request_model.dart | 8 +++++--- .../New_E_Referral/new_e_referral_step_one_page.dart | 2 +- .../New_E_Referral/new_e_referral_step_three_page.dart | 2 +- .../New_E_Referral/new_e_referral_step_two_page.dart | 3 ++- lib/pages/AlHabibMedicalService/my_web_view.dart | 1 - 8 files changed, 15 insertions(+), 12 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 42f69cfb..15f5974b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -81,7 +81,7 @@ const IS_LAST_APPOITMENT_RATED = const GET_APPOINTMENT_DETAILS_BY_NO = 'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo'; -const GET_QR_PARKING = '/Services/SWP.svc/REST/GetQRParkingByID'; +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 @@ -227,7 +227,7 @@ const GET_ALL_RELATIONSHIP_TYPES = "Services/Patients.svc/REST/GetAllRelationshi 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 CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral"; const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; const TIMER_MIN = 10; diff --git a/lib/core/service/all_habib_medical_services/e_referral_service.dart b/lib/core/service/all_habib_medical_services/e_referral_service.dart index b7cfd7e6..9bf7a435 100644 --- a/lib/core/service/all_habib_medical_services/e_referral_service.dart +++ b/lib/core/service/all_habib_medical_services/e_referral_service.dart @@ -90,10 +90,10 @@ class EReferralService extends BaseService { CreateEReferralRequestModel createEReferralRequestModel ) async { hasError = false; - await baseAppClient.post(CREATE_E_REFERRAL, + await baseAppClient.post(CREATE_E_REFERRAL/*'Services/Patients.svc/REST/CreateEReferral'*/, onSuccess: (dynamic response, int statusCode) { // TODO Waiting for fix service - ("EEEEEE"); + var asd= ("EEEEEE"); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 4d04378a..f5494049 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -78,8 +78,9 @@ class BaseAppClient { print("URL : $url"); print("Body : ${json.encode(body)}"); + var asd=""; if (await Utils.checkConnection()) { - final response = await http.post(url, + final response = await http.post(url.trim(), body: json.encode(body), headers: { 'Content-Type': 'application/json', diff --git a/lib/models/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart b/lib/models/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart index 34139ba2..e13de327 100644 --- a/lib/models/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart +++ b/lib/models/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart @@ -12,7 +12,7 @@ class CreateEReferralRequestModel { int preferredBranchCode; String preferredBranchName; List medicalReportAttachment; - EReferralAttachment insuranceCardAttachment; + dynamic insuranceCardAttachment; double versionID; int channel; int languageID; @@ -111,9 +111,11 @@ class CreateEReferralRequestModel { data['MedicalReportAttachment'] = this.medicalReportAttachment.map((v) => v.toJson()).toList(); } - if (this.insuranceCardAttachment != null) { + if (this.insuranceCardAttachment == null) { + data['InsuranceCardAttachment'] = {}; + } else data['InsuranceCardAttachment'] = this.insuranceCardAttachment.toJson(); - } + data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['LanguageID'] = this.languageID; 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 index bc06dcf7..6245ee3c 100644 --- 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 @@ -69,7 +69,7 @@ class _NewEReferralStepOnePageState extends State { Navigator.of(context).pop(); widget.changePageViewIndex(1); widget.createEReferralRequestModel.requesterName=_nameTextController.text; - widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code']+_mobileTextController.text; + widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString().substring(1)+_mobileTextController.text; widget.createEReferralRequestModel.requesterRelationship=_selectedRelation.iD; 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 index ed46cbc1..f8b484f8 100644 --- 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 @@ -387,7 +387,7 @@ class _NewEReferralStepThreePageState extends State { - this.widget.createEReferralRequestModel.fullName= ""; + // this.widget.createEReferralRequestModel.fullName= ""; this.widget.createEReferralRequestModel.otherRelationship= ""; // this.widget.createEReferralRequestModel.; // this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital"; 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 index 407abc9b..82abdbb9 100644 --- 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 @@ -183,7 +183,8 @@ class _NewEReferralStepTowPageState extends State { onTap: () async { this.widget.changePageViewIndex(2); this.widget.createEReferralRequestModel.identificationNo = int.parse( _patientIdentificationTextController.text); - this.widget.createEReferralRequestModel.patientMobileNumber = _selectedCountry['code']+_mobileTextController.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; diff --git a/lib/pages/AlHabibMedicalService/my_web_view.dart b/lib/pages/AlHabibMedicalService/my_web_view.dart index e614c8d0..59163c15 100644 --- a/lib/pages/AlHabibMedicalService/my_web_view.dart +++ b/lib/pages/AlHabibMedicalService/my_web_view.dart @@ -3,7 +3,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:webview_flutter/webview_flutter.dart'; -import 'package:tweet_webview/tweet_webview.dart'; class MyWebView extends StatelessWidget { final String title; From 3fab844ac980ebe11e246285ecdf24bbb4e7b26b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 30 Sep 2020 09:06:30 +0300 Subject: [PATCH 11/36] improve E-referral --- .../e_referral_service.dart | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/lib/core/service/all_habib_medical_services/e_referral_service.dart b/lib/core/service/all_habib_medical_services/e_referral_service.dart index 9bf7a435..4fbc612a 100644 --- a/lib/core/service/all_habib_medical_services/e_referral_service.dart +++ b/lib/core/service/all_habib_medical_services/e_referral_service.dart @@ -105,20 +105,21 @@ class EReferralService extends BaseService { SearchEReferralRequestModel searchEReferralRequestModel ) async { hasError = false; - 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()); + // 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()); } } From 5e50c0dc32ecd00652510633de187cfdc1a18d3c Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Wed, 30 Sep 2020 14:54:32 +0300 Subject: [PATCH 12/36] Blood Denote --- assets/images/BloodChrt_EN.png | Bin 0 -> 41626 bytes lib/config/config.dart | 3 + .../model/blooddonation/get_all_cities.dart | 21 + lib/core/model/my_balance/AdvanceModel.dart | 5 +- .../service/blood/blood_donation_service.dart | 34 + .../service/contactus/livechat_service.dart | 38 +- .../booddonation_view_model.dart | 26 + .../medical/my_balance_view_model.dart | 19 + lib/locator.dart | 5 + .../all_habib_medical_service_page.dart | 5 +- .../AlHabibMedicalService/my_web_view.dart | 1 - lib/pages/Blood/advance_payment_page.dart | 397 ++++++++++ lib/pages/Blood/blood_donation.dart | 696 ++++++++++++++++++ lib/pages/Blood/confirm_payment_page.dart | 306 ++++++++ lib/pages/Blood/dialogs/ConfirmSMSDialog.dart | 375 ++++++++++ .../dialogs/SelectBeneficiaryDialog.dart | 177 +++++ .../Blood/dialogs/SelectBloodDialog.dart | 328 +++++++++ .../Blood/dialogs/SelectGenderDialog.dart | 146 ++++ .../Blood/dialogs/SelectHospitalDialog.dart | 129 ++++ .../dialogs/SelectPatientFamilyDialog.dart | 130 ++++ .../dialogs/SelectPatientInfoDialog.dart | 130 ++++ lib/pages/Blood/my_balance_page.dart | 109 +++ lib/pages/Blood/new_text_Field.dart | 239 ++++++ lib/pages/Blood/user_agreement_page.dart | 55 ++ .../balance/dialogs/SelectCiteisDialog.dart | 132 ++++ pubspec.yaml | 1 - 26 files changed, 3478 insertions(+), 29 deletions(-) create mode 100644 assets/images/BloodChrt_EN.png create mode 100644 lib/core/model/blooddonation/get_all_cities.dart create mode 100644 lib/core/service/blood/blood_donation_service.dart create mode 100644 lib/core/viewModels/blooddonation/booddonation_view_model.dart create mode 100644 lib/pages/Blood/advance_payment_page.dart create mode 100644 lib/pages/Blood/blood_donation.dart create mode 100644 lib/pages/Blood/confirm_payment_page.dart create mode 100644 lib/pages/Blood/dialogs/ConfirmSMSDialog.dart create mode 100644 lib/pages/Blood/dialogs/SelectBeneficiaryDialog.dart create mode 100644 lib/pages/Blood/dialogs/SelectBloodDialog.dart create mode 100644 lib/pages/Blood/dialogs/SelectGenderDialog.dart create mode 100644 lib/pages/Blood/dialogs/SelectHospitalDialog.dart create mode 100644 lib/pages/Blood/dialogs/SelectPatientFamilyDialog.dart create mode 100644 lib/pages/Blood/dialogs/SelectPatientInfoDialog.dart create mode 100644 lib/pages/Blood/my_balance_page.dart create mode 100644 lib/pages/Blood/new_text_Field.dart create mode 100644 lib/pages/Blood/user_agreement_page.dart create mode 100644 lib/pages/medical/balance/dialogs/SelectCiteisDialog.dart diff --git a/assets/images/BloodChrt_EN.png b/assets/images/BloodChrt_EN.png new file mode 100644 index 0000000000000000000000000000000000000000..ac52957d4bc22be5f099d903cecb8d4d1fd09e3a GIT binary patch literal 41626 zcmdSBRa9I}@GnYmch_LS-91=vcXzko?(Po3gCw}a;O+!>7~FkumowkF_rKPCy$|Q% zJnS`V_Vli9$LB#UgbDdMVghEIO^CqRKLs6nZHPij#>0` zWw}nhes+Sqr}rnuy0n_@IG*{NLmvgic(hvhF(wH8+jr zI_3C|kj6ftcSt!)<$cbqdohPdSSE7>LYup z34+?Dt{$3^fbS^LXbI*>q9qgy^VCrR5@CG$Su+wW3mMpwn4}25zrQo%6P0UKVAe=? zKCW#dr8Ca{GutYjQX=k&*iDm$D+6qfwX)N z-&AyodH9!fuRvbG2KdQ;d@X3vSQ4`0GGJlFF-K%xL@O$P_31Hq%R#MmZ_s8qe04_onLIJp?-TStt1zBlWBXkn8MW)^(GOBH@{uluC)hx22x> za4dAS&SHD`?Y~$bT1RB#W~InuIPxvZEhy!`Aqk89xLmeplXFv-ZT7%Tj@bv0Ccn?n zhGP3QFSlq36j--lqv)r$CdUy)hZb#xrZxb75BZ58+YYuG=pD@e831PfKQog1|C$l_ z2D2zw3Shg^4*^g2e;olL8ho=*0<%ZfVNH(V))%@D(%hnl3G=vW#RI|6=cq37 zM~DIf>^Xbae6wD+@hyi?w2*b@F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L73ffM$tLaMwTFk=hsvEI8%V$^gH50_pMzGs4|BROksE;i;_4>pj8YP>n~ znTfQ4ly54=ZxH@4Q-{H6`CwGiRo0Q7=&ND;(TdL<@0l>>-GQ3QYaQ6)ESSSvlaG2% zAf9`x1i*l3DCqTZdBSMs;maOc2 zF_8)|;E<96#cAL0tZOA7%IEnqXoE~bAl|4CvxtzZrPD9zIi3ebIo5x;!iVlULqr6l-Fa) zq^PQ5FqSCr4o7345NTN|2PT@{s8ggQfI^$CeHwi5=a29|+v(3VdZ(7*z(+~$rEImd HN$CFos&lZC literal 0 HcmV?d00001 diff --git a/lib/config/config.dart b/lib/config/config.dart index 90c37129..78778a94 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -67,6 +67,9 @@ const GET_FINDUS_REQUEST= ///LiveChat const GET_LIVECHAT_REQUEST= 'Services/Patients.svc/REST/GetPatientICProjects'; +///BloodDenote +const GET_CITIES_REQUEST= + 'Services/Lists.svc/REST/GetAllCities'; ///Reports 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/my_balance/AdvanceModel.dart b/lib/core/model/my_balance/AdvanceModel.dart index 40472b13..b95e08a2 100644 --- a/lib/core/model/my_balance/AdvanceModel.dart +++ b/lib/core/model/my_balance/AdvanceModel.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; class AdvanceModel { @@ -7,6 +8,7 @@ class AdvanceModel { String email; String note; String depositorName; + CitiesModel citiessModel; AdvanceModel( {this.amount, @@ -14,5 +16,6 @@ class AdvanceModel { this.note, this.hospitalsModel, this.fileNumber, - this.depositorName}); + this.depositorName, + this.citiessModel}); } 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..ecb9ee2d --- /dev/null +++ b/lib/core/service/blood/blood_donation_service.dart @@ -0,0 +1,34 @@ + + +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); +} + + +} \ No newline at end of file diff --git a/lib/core/service/contactus/livechat_service.dart b/lib/core/service/contactus/livechat_service.dart index ae8fabc9..b806d56b 100644 --- a/lib/core/service/contactus/livechat_service.dart +++ b/lib/core/service/contactus/livechat_service.dart @@ -4,36 +4,24 @@ 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(); - +class LiveChatService extends BaseService { + List LivechatModelList = List(); Map body = Map(); - - Future getAllLiveChatOrders() async { hasError = false; - body['List_PatientICProjects'] =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); + LivechatModelList.clear(); + + response['List_PatientICProjects'].forEach((vital) { + LivechatModelList.add(GetPatientICProjectsModel.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/viewModels/blooddonation/booddonation_view_model.dart b/lib/core/viewModels/blooddonation/booddonation_view_model.dart new file mode 100644 index 00000000..d8d70a80 --- /dev/null +++ b/lib/core/viewModels/blooddonation/booddonation_view_model.dart @@ -0,0 +1,26 @@ +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{ + +// HospitalService _hospitalService = locator(); + + // List get hospitals => _hospitalService.hospitals; + + 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/medical/my_balance_view_model.dart b/lib/core/viewModels/medical/my_balance_view_model.dart index 350e9d89..33c89bb9 100644 --- a/lib/core/viewModels/medical/my_balance_view_model.dart +++ b/lib/core/viewModels/medical/my_balance_view_model.dart @@ -1,8 +1,10 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.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/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_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'; @@ -20,6 +22,11 @@ class MyBalanceViewModel extends BaseViewModel { List get patientAdvanceBalanceAmountList => _myBalanceService.patientAdvanceBalanceAmountList; + //======================== + BloodDonationService _bloodDonationService =locator(); + List get CitiesModelList => _bloodDonationService.CitiesModelList; + //=========================== + double get totalAdvanceBalanceAmount => _myBalanceService.totalAdvanceBalanceAmount; @@ -55,6 +62,18 @@ class MyBalanceViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + //============== + Future getCities() async { + setState(ViewState.Busy); + await _bloodDonationService.getAllCitiesOrders(); + // getHospitals(); + if (_bloodDonationService.hasError) { + error = _bloodDonationService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + //=============== Future getPatientInfoByPatientID({String id}) async { setState(ViewState.Busy); diff --git a/lib/locator.dart b/lib/locator.dart index 072370b7..18d629c0 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:get_it/get_it.dart'; import 'core/service/appointment_rate_service.dart'; +import 'core/service/blood/blood_donation_service.dart'; import 'core/service/contactus/finadus_service.dart'; import 'core/service/contactus/livechat_service.dart'; import 'core/service/dashboard_service.dart'; @@ -21,6 +22,7 @@ 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/viewModels/appointment_rate_view_model.dart'; +import 'core/viewModels/blooddonation/booddonation_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'; @@ -77,6 +79,8 @@ void setupLocator() { locator.registerLazySingleton(() => FindusService()); locator.registerLazySingleton(() => LiveChatService()); + locator.registerLazySingleton(() => BloodDonationService()); + /// View Model locator.registerFactory(() => HospitalViewModel()); locator.registerFactory(() => PharmacyViewModel()); @@ -100,5 +104,6 @@ void setupLocator() { locator.registerFactory(() => MyBalanceViewModel()); locator.registerFactory(() => FindusViewModel()); locator.registerFactory(() => LiveChatViewModel()); + locator.registerFactory(() => BloodDonationViewModel()); } diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 5ef49ab4..0ba0dbce 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -1,6 +1,9 @@ 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/advance_payment_page.dart'; +import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; + import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; @@ -212,7 +215,7 @@ class _AllHabibMedicalServiceState extends State { ServicesContainer( onTap: () => Navigator.push( context, - FadePage(), + FadePage(page:BloodDonationPage()), ), imageLocation: 'assets/images/new-design/blood_icon.png', title: 'Blood Donation', diff --git a/lib/pages/AlHabibMedicalService/my_web_view.dart b/lib/pages/AlHabibMedicalService/my_web_view.dart index e614c8d0..59163c15 100644 --- a/lib/pages/AlHabibMedicalService/my_web_view.dart +++ b/lib/pages/AlHabibMedicalService/my_web_view.dart @@ -3,7 +3,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:webview_flutter/webview_flutter.dart'; -import 'package:tweet_webview/tweet_webview.dart'; class MyWebView extends StatelessWidget { final String title; 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..bc262ec3 --- /dev/null +++ b/lib/pages/Blood/blood_donation.dart @@ -0,0 +1,696 @@ + +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.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/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.NON; + Blood blood = Blood.NON; + //HospitalsModel _selectedHospital; + CitiesModel _selectedHospital; + String amount = ""; + String email; + PatientInfo _selectedPatientInfo; + AuthenticatedUser authenticatedUser; + GetAllSharedRecordsByStatusList selectedPatientFamily; + AdvanceModel advanceModel = AdvanceModel(); + + 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", + 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.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.citiessModel = _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 confirmSelectBloodDialog(){ + showDialog( + context: context, + child: SelectBloodDialog(bloodType: blood, + onValueSelected: (value) { + setState(() { + if (value == Blood.Oplus) { + // _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(); + // advanceModel.depositorName = + // model.user.firstName + " " + model.user.lastName; + }else + if (value == Blood.ABplus) { + // _fileTextController.text = model.user.patientID.toString(); + // advanceModel.depositorName = + // model.user.firstName + " " + model.user.lastName; + }else + if (value == Blood.ABminus) { + // _fileTextController.text = model.user.patientID.toString(); + // advanceModel.depositorName = + // model.user.firstName + " " + model.user.lastName; + }else + if (value == Blood.Aplus) { + // _fileTextController.text = model.user.patientID.toString(); + // advanceModel.depositorName = + // model.user.firstName + " " + model.user.lastName; + }else + if (value == Blood.Aminus) { + // _fileTextController.text = model.user.patientID.toString(); + // advanceModel.depositorName = + // model.user.firstName + " " + model.user.lastName; + }else + if (value == Blood.Bplus) { + // _fileTextController.text = model.user.patientID.toString(); + // advanceModel.depositorName = + // model.user.firstName + " " + model.user.lastName; + }else + if (value == Blood.Bminus) { + // _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(); + // advanceModel.depositorName = + // model.user.firstName + " " + model.user.lastName; + } else + _fileTextController.text = ""; + + // 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 "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..cc5df0a6 --- /dev/null +++ b/lib/pages/Blood/confirm_payment_page.dart @@ -0,0 +1,306 @@ +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/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 'package:smart_progress_bar/smart_progress_bar.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: () { + model + .sendActivationCodeForAdvancePayment( + patientID: int.parse(advanceModel.fileNumber), + projectID: advanceModel.hospitalsModel.iD) + .then((value) { + if (model.state != ViewState.ErrorLocal && + model.state != ViewState.Error) showSMSDialog(); + }).showProgressBar( + text: "Loading", + backgroundColor: Colors.blue.withOpacity(0.6)); + }, + ), + ), + ), + ); + } + + 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, + 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(); + service + .checkPaymentStatus( + Utils.getAppointmentTransID( + appo.projectID, appo.clinicID, appo.appointmentNo), + AppGlobal.context) + .then((res) { + 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) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + String paymentReference = res['Fort_id'].toString(); + service + .createAdvancePayment(appo, res['Amount'], res['Fort_id'], + res['PaymentMethod'], AppGlobal.context) + .then((res) { + print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); + addAdvancedNumberRequest( + res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), + paymentReference, + appo.appointmentNo.toString(), + appo); + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + addAdvancedNumberRequest(String advanceNumber, String paymentReference, + String appointmentID, AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + service + .addAdvancedNumberRequest( + advanceNumber, paymentReference, appointmentID, AppGlobal.context) + .then((res) { + print(res); + navigateToHome(AppGlobal.context); + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + 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..8dd2b29e --- /dev/null +++ b/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart @@ -0,0 +1,375 @@ +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/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: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) { + 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; + 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..07d27e2d --- /dev/null +++ b/lib/pages/Blood/my_balance_page.dart @@ -0,0 +1,109 @@ +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..075dce4d --- /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"), + ), + SizedBox( + height: 20, + ), + Container( + child: + Text("I understand that the contact number or Email that I have provided on registration will be used for communication by HMG. 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."), + ), + SizedBox( + height: 20, + ), + Container( + child: + Text("I understand the risks of communicating by email and text messages, in particular the privacy risks. I 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."), + ), + SizedBox( + height: 20, + ), + Container( + child: + Text("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."), + ), + ], + ) + /////////// + ]) + + + + )); + } +} 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/pubspec.yaml b/pubspec.yaml index b5a2444a..8aa07a19 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -18,7 +18,6 @@ dependencies: intl: ^0.16.1 # web view webview_flutter: ^0.3.24 - tweet_webview: ^0.2.2 # http client http: ^0.12.1 connectivity: ^0.4.9 From 0ec39920f01196e6971909afa063888fa1b97cb8 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Wed, 30 Sep 2020 15:32:08 +0300 Subject: [PATCH 13/36] Blood Denote --- lib/pages/Blood/blood_donation.dart | 84 +++++++++++++++-------------- 1 file changed, 43 insertions(+), 41 deletions(-) diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index bc262ec3..a7a1d089 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -389,51 +389,53 @@ class _BloodDonationPageState extends State { ), ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.1, + height: MediaQuery.of(context).size.height * 0.12, 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.citiessModel = _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)); - }, + color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), + + label: "Save", + // + + // onTap: () { + // advanceModel.fileNumber = _fileTextController.text; + // // advanceModel.hospitalsModel = _selectedHospital; + // advanceModel.citiessModel = _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)); + // }, ), )), ); From 675d5445148e1697d096c64b255486b486d7c06f Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Wed, 30 Sep 2020 15:52:12 +0300 Subject: [PATCH 14/36] Blood Denote --- lib/pages/Blood/user_agreement_page.dart | 8 ++++---- lib/widgets/buttons/secondary_button.dart | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pages/Blood/user_agreement_page.dart b/lib/pages/Blood/user_agreement_page.dart index 075dce4d..d05725b4 100644 --- a/lib/pages/Blood/user_agreement_page.dart +++ b/lib/pages/Blood/user_agreement_page.dart @@ -20,28 +20,28 @@ class UserAgreementPage extends StatelessWidget { height: 20, ), Container( - child: Text("Communication via email, text messages and phone calls"), + 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 I have provided on registration will be used for communication by HMG. 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."), + 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. I 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."), + 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("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."), + 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/widgets/buttons/secondary_button.dart b/lib/widgets/buttons/secondary_button.dart index 65bb8d36..f3f7b4a8 100644 --- a/lib/widgets/buttons/secondary_button.dart +++ b/lib/widgets/buttons/secondary_button.dart @@ -18,7 +18,7 @@ class SecondaryButton extends StatefulWidget { this.label = "", this.icon, this.iconOnly = false, - this.color: const Color.fromRGBO(63, 72, 74, 1), + this.color:const Color.fromRGBO(63, 72, 74, 1), this.textColor, this.onTap, this.loading: false, From a00b3a133c870fcff403a9a43caf866454d00b7e Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Wed, 30 Sep 2020 17:06:05 +0300 Subject: [PATCH 15/36] Blood Denote --- lib/config/config.dart | 4 + .../blooddonation/blood_groub_details.dart | 77 +++++++++++++++++++ .../service/blood/blood_details_servies.dart | 31 ++++++++ .../service/blood/blood_donation_service.dart | 42 +++++----- .../blood_details_view_model.dart | 27 +++++++ .../booddonation_view_model.dart | 2 - .../medical/my_balance_view_model.dart | 16 ++++ lib/locator.dart | 4 + lib/pages/Blood/blood_donation.dart | 14 +++- 9 files changed, 187 insertions(+), 30 deletions(-) create mode 100644 lib/core/model/blooddonation/blood_groub_details.dart create mode 100644 lib/core/service/blood/blood_details_servies.dart create mode 100644 lib/core/viewModels/blooddonation/blood_details_view_model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 78778a94..d9db0863 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -71,6 +71,10 @@ const GET_LIVECHAT_REQUEST= 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'; 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/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 index ecb9ee2d..326407a3 100644 --- a/lib/core/service/blood/blood_donation_service.dart +++ b/lib/core/service/blood/blood_donation_service.dart @@ -1,34 +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{ - - +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); + 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); + } } - - -} \ No newline at end of file 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 index d8d70a80..b9c13c57 100644 --- a/lib/core/viewModels/blooddonation/booddonation_view_model.dart +++ b/lib/core/viewModels/blooddonation/booddonation_view_model.dart @@ -7,9 +7,7 @@ import '../base_view_model.dart'; class BloodDonationViewModel extends BaseViewModel{ -// HospitalService _hospitalService = locator(); - // List get hospitals => _hospitalService.hospitals; BloodDonationService _bloodDonationService =locator(); List get CitiesModelList => _bloodDonationService.CitiesModelList; diff --git a/lib/core/viewModels/medical/my_balance_view_model.dart b/lib/core/viewModels/medical/my_balance_view_model.dart index 33c89bb9..b110edcb 100644 --- a/lib/core/viewModels/medical/my_balance_view_model.dart +++ b/lib/core/viewModels/medical/my_balance_view_model.dart @@ -1,9 +1,11 @@ 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/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'; @@ -25,6 +27,10 @@ class MyBalanceViewModel extends BaseViewModel { //======================== BloodDonationService _bloodDonationService =locator(); List get CitiesModelList => _bloodDonationService.CitiesModelList; + BloodDetailsService _bloodDetailsService =locator(); + List get BloodDetailsModelList => _bloodDetailsService.BloodModelList;//_bloodDonationService.CitiesModelList; + + //=========================== double get totalAdvanceBalanceAmount => @@ -73,6 +79,16 @@ class MyBalanceViewModel extends BaseViewModel { } 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 { diff --git a/lib/locator.dart b/lib/locator.dart index 18d629c0..9914c59b 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:get_it/get_it.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/contactus/finadus_service.dart'; import 'core/service/contactus/livechat_service.dart'; @@ -22,6 +23,7 @@ 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/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/contactus/findus_view_model.dart'; import 'core/viewModels/contactus/livechat_view_model.dart'; @@ -80,6 +82,7 @@ void setupLocator() { locator.registerLazySingleton(() => LiveChatService()); locator.registerLazySingleton(() => BloodDonationService()); + locator.registerLazySingleton(() => BloodDetailsService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -105,5 +108,6 @@ void setupLocator() { locator.registerFactory(() => FindusViewModel()); locator.registerFactory(() => LiveChatViewModel()); locator.registerFactory(() => BloodDonationViewModel()); + locator.registerFactory(() => BloodDeatailsViewModel()); } diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index a7a1d089..d8174307 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -1,10 +1,13 @@ 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/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'; @@ -48,10 +51,11 @@ class _BloodDonationPageState extends State { TextEditingController _fileTextController = TextEditingController(); TextEditingController _notesTextController = TextEditingController(); BeneficiaryType beneficiaryType = BeneficiaryType.NON; - Gender gender = Gender.NON; - Blood blood = Blood.NON; + Gender gender = Gender.Male;//Gender.NON; + Blood blood = Blood.Aminus;//Blood.NON; //HospitalsModel _selectedHospital; CitiesModel _selectedHospital; + List_BloodGroupDetailsModel _selectBlood; String amount = ""; String email; PatientInfo _selectedPatientInfo; @@ -664,7 +668,9 @@ class _BloodDonationPageState extends State { if (_selectedHospital != null) return _selectedHospital.description; else - return "Select City";//TranslationBase.of(context).selectHospital; + return + "Riyadh"; + // return List_BloodGroupDetailsModel.fromJson(0).city.toString();//"Select City";//TranslationBase.of(context).selectHospital; } String getPatientName() { From dd76ae05a75961e73a99fb5d8c5e2e98d46fed3d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 30 Sep 2020 17:29:54 +0300 Subject: [PATCH 16/36] fix H2O page issue --- ...ion_code_for_e_referral_request_model.dart | 0 .../create_e_referral_request_model.dart | 0 .../get_all_cities_request_model.dart | 0 .../get_all_cities_response_model.dart | 0 ..._all_relationship_types_request_model.dart | 0 ...all_relationship_types_response_model.dart | 0 .../EReferral/search_criteria_model.dart | 0 .../search_e_referral_request_model.dart | 0 .../search_e_referral_response_model.dart | 0 ...ion_code_for_e_referral_request_model.dart | 0 .../user_progress_for_month_data_model.dart | 22 ++ .../user_progress_for_week_data_model.dart | 25 ++ .../AlHabibMedicalService/H2O_service.dart | 76 +++-- .../e_referral_service.dart | 14 +- lib/core/service/AuthenticatedUserObject.dart | 23 ++ lib/core/service/base_service.dart | 15 +- .../AlHabibMedicalService/H2O_view_model.dart | 106 ++++++- .../e_referral_view_model.dart | 16 +- lib/core/viewModels/base_view_model.dart | 3 + lib/locator.dart | 4 +- .../new_e_referral_index_page.dart | 2 +- .../new_e_referral_step_one_page.dart | 6 +- .../new_e_referral_step_three_page.dart | 4 +- .../new_e_referral_step_two_page.dart | 4 +- .../dialogs/select_city_dialog.dart | 4 +- .../dialogs/select_country_ingo_Dialog.dart | 3 - .../dialogs/select_relation_type_dialog.dart | 3 +- .../select_search_criteria_dialog.dart | 4 +- .../e_referral_confirm_sms_dialog.dart | 11 +- .../E-Referral/search_for_referrals_page.dart | 4 +- .../all_habib_medical_service_page.dart | 5 +- .../h2o/h2o_index_page.dart | 155 ++++------ .../AlHabibMedicalService/h2o/h2o_page.dart | 120 ++++++++ .../AlHabibMedicalService/h2o/month_page.dart | 21 +- .../AlHabibMedicalService/h2o/today_page.dart | 284 +++++++++--------- .../AlHabibMedicalService/h2o/week_page.dart | 24 +- lib/widgets/charts/app_bar_chart.dart | 43 +++ 37 files changed, 651 insertions(+), 350 deletions(-) rename lib/{models/AlHabibMedicalServices => core/model/AlHabibMedicalService}/EReferral/check_activation_code_for_e_referral_request_model.dart (100%) rename lib/{models/AlHabibMedicalServices => core/model/AlHabibMedicalService}/EReferral/create_e_referral_request_model.dart (100%) rename lib/{models/AlHabibMedicalServices => core/model/AlHabibMedicalService}/EReferral/get_all_cities_request_model.dart (100%) rename lib/{models/AlHabibMedicalServices => core/model/AlHabibMedicalService}/EReferral/get_all_cities_response_model.dart (100%) rename lib/{models/AlHabibMedicalServices => core/model/AlHabibMedicalService}/EReferral/get_all_relationship_types_request_model.dart (100%) rename lib/{models/AlHabibMedicalServices => core/model/AlHabibMedicalService}/EReferral/get_all_relationship_types_response_model.dart (100%) rename lib/{models/AlHabibMedicalServices => core/model/AlHabibMedicalService}/EReferral/search_criteria_model.dart (100%) rename lib/{models/AlHabibMedicalServices => core/model/AlHabibMedicalService}/EReferral/search_e_referral_request_model.dart (100%) rename lib/{models/AlHabibMedicalServices => core/model/AlHabibMedicalService}/EReferral/search_e_referral_response_model.dart (100%) rename lib/{models/AlHabibMedicalServices => core/model/AlHabibMedicalService}/EReferral/send_activation_code_for_e_referral_request_model.dart (100%) create mode 100644 lib/core/model/AlHabibMedicalService/user_progress_for_month_data_model.dart create mode 100644 lib/core/model/AlHabibMedicalService/user_progress_for_week_data_model.dart rename lib/core/service/{all_habib_medical_services => AlHabibMedicalService}/e_referral_service.dart (83%) create mode 100644 lib/core/service/AuthenticatedUserObject.dart create mode 100644 lib/pages/AlHabibMedicalService/h2o/h2o_page.dart create mode 100644 lib/widgets/charts/app_bar_chart.dart diff --git a/lib/models/AlHabibMedicalServices/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 similarity index 100% rename from lib/models/AlHabibMedicalServices/EReferral/check_activation_code_for_e_referral_request_model.dart rename to lib/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart diff --git a/lib/models/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart similarity index 100% rename from lib/models/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart rename to lib/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart diff --git a/lib/models/AlHabibMedicalServices/EReferral/get_all_cities_request_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/get_all_cities_request_model.dart similarity index 100% rename from lib/models/AlHabibMedicalServices/EReferral/get_all_cities_request_model.dart rename to lib/core/model/AlHabibMedicalService/EReferral/get_all_cities_request_model.dart diff --git a/lib/models/AlHabibMedicalServices/EReferral/get_all_cities_response_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart similarity index 100% rename from lib/models/AlHabibMedicalServices/EReferral/get_all_cities_response_model.dart rename to lib/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart diff --git a/lib/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_request_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_request_model.dart similarity index 100% rename from lib/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_request_model.dart rename to lib/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_request_model.dart diff --git a/lib/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart similarity index 100% rename from lib/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart rename to lib/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart diff --git a/lib/models/AlHabibMedicalServices/EReferral/search_criteria_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/search_criteria_model.dart similarity index 100% rename from lib/models/AlHabibMedicalServices/EReferral/search_criteria_model.dart rename to lib/core/model/AlHabibMedicalService/EReferral/search_criteria_model.dart diff --git a/lib/models/AlHabibMedicalServices/EReferral/search_e_referral_request_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart similarity index 100% rename from lib/models/AlHabibMedicalServices/EReferral/search_e_referral_request_model.dart rename to lib/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart diff --git a/lib/models/AlHabibMedicalServices/EReferral/search_e_referral_response_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/search_e_referral_response_model.dart similarity index 100% rename from lib/models/AlHabibMedicalServices/EReferral/search_e_referral_response_model.dart rename to lib/core/model/AlHabibMedicalService/EReferral/search_e_referral_response_model.dart diff --git a/lib/models/AlHabibMedicalServices/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 similarity index 100% rename from lib/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_model.dart rename to lib/core/model/AlHabibMedicalService/EReferral/send_activation_code_for_e_referral_request_model.dart diff --git a/lib/core/model/AlHabibMedicalService/user_progress_for_month_data_model.dart b/lib/core/model/AlHabibMedicalService/user_progress_for_month_data_model.dart new file mode 100644 index 00000000..a7f7805e --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/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/user_progress_for_week_data_model.dart b/lib/core/model/AlHabibMedicalService/user_progress_for_week_data_model.dart new file mode 100644 index 00000000..2641a678 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/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/service/AlHabibMedicalService/H2O_service.dart b/lib/core/service/AlHabibMedicalService/H2O_service.dart index 2f73e7f0..d44b50ef 100644 --- a/lib/core/service/AlHabibMedicalService/H2O_service.dart +++ b/lib/core/service/AlHabibMedicalService/H2O_service.dart @@ -1,18 +1,22 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/insert_user_activity_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_month_data_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_today_data_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_week_data_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/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 = super.user.mobileNumber.substring(1); - userProgressRequestModel.identificationNo = super.user.patientIdentificationNo; + userProgressRequestModel.mobileNumber = user.mobileNumber.substring(1); + userProgressRequestModel.identificationNo = user.patientIdentificationNo; hasError = false; await baseAppClient.post(H2O_GET_USER_PROGRESS, @@ -28,52 +32,58 @@ class H2OService extends BaseService { }, body: userProgressRequestModel.toJson()); } - - Future insertUserActivity(InsertUserActivityRequestModel insertUserActivityRequestModel) async { + Future getUserProgressForWeekData() async { + userProgressRequestModel.progress = 2; + userProgressRequestModel.mobileNumber = super.user.mobileNumber.substring(1); + userProgressRequestModel.identificationNo = super.user.patientIdentificationNo; hasError = false; - await baseAppClient.post(H2O_INSERT_USER_ACTIVITY, + await baseAppClient.post(H2O_GET_USER_PROGRESS, onSuccess: (dynamic response, int statusCode) { userProgressForTodayDataList.clear(); - response['UserProgressForTodayData'].forEach((progressData) { - userProgressForTodayDataList - .add(UserProgressForTodayDataModel.fromJson(progressData)); + response['UserProgressForWeekData'].forEach((hospital) { + userProgressForWeekDataList.add(UserProgressForWeekDataModel.fromJson(hospital)); }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: insertUserActivityRequestModel.toJson()); + }, body: userProgressRequestModel.toJson()); } - Future getUserProgressForWeekData() async { - userProgressRequestModel.progress = 2; + 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) { - // userProgressForTodayDataList.clear(); - // response['UserProgressForWeekData'].forEach((hospital) { - // userProgressForTodayDataList.add(PatientLabOrders.fromJson(hospital)); - // }); - // }, onFailure: (String error, int statusCode) { - // hasError = true; - // super.error = error; - // }, body: {}); + 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 getUserProgressForMonthData() async { - userProgressRequestModel.progress = 2; + + + + Future insertUserActivity(InsertUserActivityRequestModel insertUserActivityRequestModel) async { hasError = false; - // await baseAppClient.post(H2O_GET_USER_PROGRESS, - // onSuccess: (dynamic response, int statusCode) { - // userProgressForTodayDataList.clear(); - // response['UserProgressForMonthData'].forEach((hospital) { - // userProgressForTodayDataList.add(PatientLabOrders.fromJson(hospital)); - // }); - // }, onFailure: (String error, int statusCode) { - // hasError = true; - // super.error = error; - // }, body: _requestPatientLabOrders.toJson()); + 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/all_habib_medical_services/e_referral_service.dart b/lib/core/service/AlHabibMedicalService/e_referral_service.dart similarity index 83% rename from lib/core/service/all_habib_medical_services/e_referral_service.dart rename to lib/core/service/AlHabibMedicalService/e_referral_service.dart index 4fbc612a..6c356f5c 100644 --- a/lib/core/service/all_habib_medical_services/e_referral_service.dart +++ b/lib/core/service/AlHabibMedicalService/e_referral_service.dart @@ -1,12 +1,12 @@ 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'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/check_activation_code_for_e_referral_request_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_cities_response_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/search_e_referral_request_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/search_e_referral_response_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_model.dart'; class EReferralService extends BaseService { List _relationTypes = List(); diff --git a/lib/core/service/AuthenticatedUserObject.dart b/lib/core/service/AuthenticatedUserObject.dart new file mode 100644 index 00000000..1aaa4755 --- /dev/null +++ b/lib/core/service/AuthenticatedUserObject.dart @@ -0,0 +1,23 @@ +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() async { + if (user==null) { + 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; + } + +} diff --git a/lib/core/service/base_service.dart b/lib/core/service/base_service.dart index bef0e1f4..f2820dc1 100644 --- a/lib/core/service/base_service.dart +++ b/lib/core/service/base_service.dart @@ -1,7 +1,9 @@ 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 { @@ -10,14 +12,19 @@ class BaseService { BaseAppClient baseAppClient = BaseAppClient(); AuthenticatedUser user; + AuthenticatedUserObject authenticatedUserObject = locator(); + AppSharedPreferences sharedPref = AppSharedPreferences(); BaseService() { - _getUser(); + user = authenticatedUserObject.user; + // getUser(); } - _getUser() async { - var userData = await sharedPref.getObject(USER_PROFILE); - if (userData != null) user = AuthenticatedUser.fromJson(userData); + getUser() async { + if (user==null) { + var userData = await sharedPref.getObject(USER_PROFILE); + if (userData != null) user = AuthenticatedUser.fromJson(userData); + } } } diff --git a/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart index 0ebb9712..73a56d9b 100644 --- a/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart @@ -1,39 +1,108 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/insert_user_activity_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_month_data_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_today_data_model.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/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(); - UserProgressForTodayDataModel get userProgressData => _h2OService.userProgressForTodayDataList[0]; + List userProgressForWeekDataSeries; + List userProgressForMonthDataSeries; - Future getUserProgressForTodayData() async { + UserProgressForTodayDataModel get userProgressData { + if (_h2OService.userProgressForTodayDataList.length != 0) + return _h2OService.userProgressForTodayDataList[0]; + return null; + } - // UserProgressRequestModel userProgressRequestModel = - // UserProgressRequestModel(); - // userProgressRequestModel.progress = 1; - // userProgressRequestModel.mobileNumber = user.mobileNumber.substring(1); - // userProgressRequestModel.identificationNo = user.patientIdentificationNo; - setState(ViewState.BusyLocal); + Future getUserProgressForTodayData() async { + // if(_h2OService.userProgressForTodayDataList.length==0){ + setState(ViewState.Busy); await _h2OService.getUserProgressForTodayData(); if (_h2OService.hasError) { error = _h2OService.error; - setState(ViewState.ErrorLocal); + 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 insertUserActivity(InsertUserActivityRequestModel insertUserActivityRequestModel) async { + + 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; + insertUserActivityRequestModel.mobileNumber = + user.mobileNumber.substring(1); + insertUserActivityRequestModel.identificationNo = + user.patientIdentificationNo; await _h2OService.insertUserActivity(insertUserActivityRequestModel); if (_h2OService.hasError) { @@ -45,3 +114,12 @@ class H2OViewModel extends BaseViewModel { } } + + +/// Sample ordinal data type. +class ChartSeries { + final String y; + final int x; + + ChartSeries(this.y, this.x); +} 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 index 1c8a1200..1972e08f 100644 --- 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 @@ -1,14 +1,14 @@ import 'dart:core'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/service/all_habib_medical_services/e_referral_service.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/check_activation_code_for_e_referral_request_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_cities_response_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/search_e_referral_request_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/search_e_referral_response_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_model.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'; diff --git a/lib/core/viewModels/base_view_model.dart b/lib/core/viewModels/base_view_model.dart index 3d7122bd..7e16d22d 100644 --- a/lib/core/viewModels/base_view_model.dart +++ b/lib/core/viewModels/base_view_model.dart @@ -1,9 +1,12 @@ 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; diff --git a/lib/locator.dart b/lib/locator.dart index 08a338df..0841c969 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -5,7 +5,8 @@ import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:get_it/get_it.dart'; -import 'core/service/all_habib_medical_services/e_referral_service.dart'; +import 'core/service/AlHabibMedicalService/e_referral_service.dart'; +import 'core/service/AuthenticatedUserObject.dart'; import 'core/service/appointment_rate_service.dart'; import 'core/service/contactus/finadus_service.dart'; import 'core/service/contactus/livechat_service.dart'; @@ -69,6 +70,7 @@ GetIt locator = GetIt.instance; ///di void setupLocator() { /// Services + locator.registerLazySingleton(() => AuthenticatedUserObject()); locator.registerLazySingleton(() => HospitalService()); locator.registerLazySingleton(() => PharmacyService()); locator.registerLazySingleton(() => MyDoctorService()); 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 index 09297312..5787af66 100644 --- 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 @@ -1,6 +1,6 @@ -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart'; +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'; 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 index 6245ee3c..6460de03 100644 --- 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 @@ -1,9 +1,9 @@ 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/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/send_activation_code_for_e_referral_request_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'; 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 index f8b484f8..d84b9d61 100644 --- 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 @@ -1,7 +1,7 @@ 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/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_cities_response_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'; 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 index 82abdbb9..5f85fe12 100644 --- 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 @@ -1,7 +1,7 @@ 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/AlHabibMedicalServices/EReferral/create_e_referral_request_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_cities_response_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'; diff --git a/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_city_dialog.dart b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_city_dialog.dart index 88ed8992..2fb7e41a 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_city_dialog.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_city_dialog.dart @@ -1,6 +1,4 @@ -import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_cities_response_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; +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'; 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 index 0c8c6f75..f714bfb9 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart @@ -1,5 +1,3 @@ -import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/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'; @@ -7,7 +5,6 @@ import 'package:flutter/material.dart'; // ignore: must_be_immutable class SelectCountryDialog extends StatefulWidget { -// final List relationTypes; final Function(dynamic) onValueSelected; dynamic selectedCountry; 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 index 42809035..e8d4bb7d 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart @@ -1,5 +1,4 @@ -import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; +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'; 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 index 3c28b6fe..f4c8d989 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_search_criteria_dialog.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_search_criteria_dialog.dart @@ -1,6 +1,4 @@ -import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/get_all_relationship_types_response_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/search_criteria_model.dart'; +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'; 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 index b7719f8c..ba9a123d 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart @@ -3,23 +3,14 @@ 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/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/core/viewModels/medical/my_balance_view_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/check_activation_code_for_e_referral_request_model.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.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/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; - -import 'New_E_Referral/new_e_referral_index_page.dart'; class EReferralConfirmSMSDialog extends StatefulWidget { final String phoneNumber; diff --git a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart index 5230ed92..0b75705d 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart @@ -1,7 +1,7 @@ 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/models/AlHabibMedicalServices/EReferral/search_criteria_model.dart'; -import 'package:diplomaticquarterapp/models/AlHabibMedicalServices/EReferral/search_e_referral_request_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'; diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index bc220de0..5ea81c9e 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h2o_index_page.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'; @@ -22,7 +23,7 @@ import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:webview_flutter/webview_flutter.dart'; -import 'h2o/h2o_index_page.dart'; +import 'h2o/h2o_page.dart'; class AllHabibMedicalService extends StatefulWidget { @override @@ -244,7 +245,7 @@ class _AllHabibMedicalServiceState extends State { onTap: () => Navigator.push( context, FadePage( - page: H2OPage(), + page: H2OPageIndexPage(), ), ), imageLocation: 'assets/images/new-design/water_icon.png', diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart index ff67dbc0..9ce35d27 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart @@ -1,122 +1,73 @@ -import 'dart:ui'; - -import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_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/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h2o_page.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'; -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(); - } - +class H2OPageIndexPage extends StatelessWidget { @override Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => model.getPrescriptions(), - builder: (_, model, widget) => AppScaffold( + return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).myDoctor, - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(65.0), - child: Stack( + appBarTitle: "Service Information", + body: SingleChildScrollView( + padding: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, 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, - ), - ), + 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: Container( - height: 60.0, - margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.9, - - 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: 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"), - ), - ), - ], - ), + 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, + ), ], - ), - ), - body: Column( + )), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [TodayPage(), WeekPage(), MonthPage()], - ), - ) + 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 index 86dfa0d1..f0baf34d 100644 --- a/lib/pages/AlHabibMedicalService/h2o/month_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/month_page.dart @@ -1,8 +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 Center(child: Container(child: Text("Month Page "),)); + 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 index d6c62cbb..6ed1869d 100644 --- a/lib/pages/AlHabibMedicalService/h2o/today_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/today_page.dart @@ -1,10 +1,7 @@ -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; 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/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'; import 'package:hexcolor/hexcolor.dart'; @@ -16,13 +13,7 @@ class TodayPage extends StatefulWidget { } class _TodayPageState extends State with TickerProviderStateMixin { - static const List icons = const [ - Icons.sms, - Icons.mail, - Icons.phone - ]; AnimationController _controller; - @override void initState() { _controller = new AnimationController( @@ -34,153 +25,153 @@ class _TodayPageState extends State with TickerProviderStateMixin { @override Widget build(BuildContext context) { - Color backgroundColor = Theme.of(context).cardColor; - Color foregroundColor = Theme.of(context).accentColor; + + return BaseView( onModelReady: (model) => model.getUserProgressForTodayData(), builder: (_, model, widget) => AppScaffold( - isShowAppBar: false, - appBarTitle: "Water Tracker", - body: SingleChildScrollView( - padding: EdgeInsets.symmetric(vertical: 12), - child: model.state == ViewState.BusyLocal - ? Center( - child: Container( - margin: EdgeInsets.only(top: 90), - child: AppCircularProgressIndicator())) - : model.state == ViewState.ErrorLocal ? AppEmbeddedError(error: model.error):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.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.quantityConsumed - .toString() + 'ml', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20.0, - color: Hexcolor("#60BCF9")), - ), - SizedBox( - height: 4, - ), - SizedBox( - height: 5, - width: 50, - child: Container( + 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.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"), + ), + 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))), ), ), - 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, + 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, @@ -188,5 +179,6 @@ class _TodayPageState extends State with TickerProviderStateMixin { ), ), ); + } } diff --git a/lib/pages/AlHabibMedicalService/h2o/week_page.dart b/lib/pages/AlHabibMedicalService/h2o/week_page.dart index 6acf8062..e42eb19b 100644 --- a/lib/pages/AlHabibMedicalService/h2o/week_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/week_page.dart @@ -1,8 +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 Center(child: Container(child: Text("Week page"),)); + 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/widgets/charts/app_bar_chart.dart b/lib/widgets/charts/app_bar_chart.dart new file mode 100644 index 00000000..98ef3cfa --- /dev/null +++ b/lib/widgets/charts/app_bar_chart.dart @@ -0,0 +1,43 @@ +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; + +class AppBarChart extends StatelessWidget { + const AppBarChart({ + Key key, + @required this.seriesList, + }) : super(key: key); + + final List seriesList; + + @override + Widget build(BuildContext context) { + return Container( + height: 400, + margin: EdgeInsets.only(top: 60), + child: charts.BarChart( + seriesList, + // animate: animate, + + /// Customize the primary measure axis using a small tick renderer. + /// Use String instead of num for ordinal domain axis + /// (typically bar charts). + primaryMeasureAxis: new charts.NumericAxisSpec( + renderSpec: new charts.GridlineRendererSpec( + // Display the measure axis labels below the gridline. + // + // 'Before' & 'after' follow the axis value direction. + // Vertical axes draw 'before' below & 'after' above the tick. + // Horizontal axes draw 'before' left & 'after' right the tick. + labelAnchor: charts.TickLabelAnchor.before, + + // Left justify the text in the axis. + // + // Note: outside means that the secondary measure axis would right + // justify. + labelJustification: + charts.TickLabelJustification.outside, + )), + ), + ); + } +} From b658e7be4d3758a1a41866b5dc7dc73750a932dd Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Wed, 30 Sep 2020 17:30:29 +0300 Subject: [PATCH 17/36] Blood Denote --- lib/pages/Blood/blood_donation.dart | 60 ++++++++++------------------- 1 file changed, 20 insertions(+), 40 deletions(-) diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index d8174307..6132e38c 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -55,14 +55,14 @@ class _BloodDonationPageState extends State { Blood blood = Blood.Aminus;//Blood.NON; //HospitalsModel _selectedHospital; CitiesModel _selectedHospital; - List_BloodGroupDetailsModel _selectBlood; + 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; @@ -400,46 +400,16 @@ class _BloodDonationPageState extends State { child: SecondaryButton( textColor: Colors.white, color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), - label: "Save", // + onTap: (){ + + bloodDetails.city=_selectedHospital.toString(); + + // bloodDetails. + }, + - // onTap: () { - // advanceModel.fileNumber = _fileTextController.text; - // // advanceModel.hospitalsModel = _selectedHospital; - // advanceModel.citiessModel = _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)); - // }, ), )), ); @@ -472,41 +442,49 @@ class _BloodDonationPageState extends State { 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; @@ -536,10 +514,12 @@ class _BloodDonationPageState extends State { 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 = ""; + // _fileTextController.text = ""; + {bloodDetails.gender=2;} // beneficiaryType = value; gender=value; From fdc8ef36ef5fce1af24102cabd399c59b25eb77b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 1 Oct 2020 16:29:41 +0300 Subject: [PATCH 18/36] Refactor today page --- lib/config/config.dart | 2 +- .../AlHabibMedicalService/h2o/today_page.dart | 42 ++---- .../widgets/h20_floating_action_button.dart | 124 ++++-------------- 3 files changed, 35 insertions(+), 133 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 34bd9363..02b58b34 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -248,7 +248,7 @@ const GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies'; // H2O -const H2O_GET_USER_PROGRESS = "/Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; +const H2O_GET_USER_PROGRESS = "Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; const H2O_INSERT_USER_ACTIVITY="Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; diff --git a/lib/pages/AlHabibMedicalService/h2o/today_page.dart b/lib/pages/AlHabibMedicalService/h2o/today_page.dart index 6ed1869d..55767e5a 100644 --- a/lib/pages/AlHabibMedicalService/h2o/today_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/today_page.dart @@ -6,28 +6,10 @@ 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 StatefulWidget { - @override - _TodayPageState createState() => _TodayPageState(); -} - -class _TodayPageState extends State with TickerProviderStateMixin { - AnimationController _controller; - @override - void initState() { - _controller = new AnimationController( - vsync: this, - duration: const Duration(milliseconds: 500), - ); - super.initState(); - } - +class TodayPage extends StatelessWidget { @override Widget build(BuildContext context) { - - - return BaseView( + return BaseView( onModelReady: (model) => model.getUserProgressForTodayData(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, @@ -65,8 +47,8 @@ class _TodayPageState extends State with TickerProviderStateMixin { height: 4, ), Text(model.userProgressData ==null ?"0.0": - model.userProgressData.quantityConsumed - .toString() + 'ml', + model.userProgressData.quantityConsumed + .toString() + 'ml', style: TextStyle( fontWeight: FontWeight.bold, fontSize: 20.0, @@ -93,12 +75,12 @@ class _TodayPageState extends State with TickerProviderStateMixin { 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', + (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), @@ -174,11 +156,11 @@ class _TodayPageState extends State with TickerProviderStateMixin { ), ), floatingActionButton: H20FloatingActionButton( - controller: _controller, + // controller: _controller, model: model, ), ), ); - } } + diff --git a/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart index 782e6a00..a2fa1adf 100644 --- a/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart +++ b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart @@ -11,114 +11,34 @@ import 'package:flutter/material.dart'; import '../add_custom_amount.dart'; -class H20FloatingActionButton extends StatelessWidget { +class H20FloatingActionButton extends StatefulWidget { const H20FloatingActionButton({ Key key, @required AnimationController controller, @required this.model - }) : _controller = controller, + }) : super(key: key); - final AnimationController _controller; 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) { - // _showMaterialDialog(String count, H2OViewModel model) { - // 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 $count ?", - // 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{ - // // insertUserActivity - // int addedValue; - // - // switch(count) { - // case "600ml": { - // addedValue = 600; - // } - // break; - // - // case "330ml": { - // addedValue = 330; - // - // } - // break; - // case "200ml": { - // addedValue = 200; - // } - // break; - // - // } - // - // InsertUserActivityRequestModel insertUserActivityRequestModel= InsertUserActivityRequestModel(quantityIntake:addedValue ); - // await 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, - // )), - // ), - // ), - // ), - // ], - // ) - // ], - // ) - // ], - // ); - // } void showConfirmMessage(int amount, H2OViewModel model) { showDialog(context: context, child: ConfirmAddAmountDialog(model: model,amount:amount,)); @@ -137,21 +57,21 @@ class H20FloatingActionButton extends StatelessWidget { controller: _controller, text: "600ml", onTap: () { - showConfirmMessage(600, model); + showConfirmMessage(600, widget.model); }, ), ActionButton( controller: _controller, text: "330ml", onTap: () { - showConfirmMessage(330, model); + showConfirmMessage(330, widget.model); }, ), ActionButton( controller: _controller, text: "200ml", onTap: () { - showConfirmMessage(200, model); + showConfirmMessage(200, widget.model); }, ), ], @@ -205,7 +125,7 @@ class H20FloatingActionButton extends StatelessWidget { context, FadePage( page: AddCustomAmount( - model: model, + model: widget.model, ), ), ); From 98947d5f6b6525da5815946a22e7c4e06b93e8cf Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Sun, 4 Oct 2020 10:06:48 +0300 Subject: [PATCH 19/36] Blood Denote --- .../AlHabibMedicalService/all_habib_medical_service_page.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 8b04bc31..e0f07385 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/pages/Blood/advance_payment_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/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/family/my-family.dart'; @@ -188,7 +189,7 @@ class _AllHabibMedicalServiceState extends State { ServicesContainer( onTap: () => Navigator.push( context, - FadePage(), + FadePage(page: ChildVaccinesPage()), ), imageLocation: 'assets/images/new-design/children_vaccines_icon.png', From 20ef255ee6bf0834f93ac62b398992c2bd920a6f Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Sun, 4 Oct 2020 10:22:12 +0300 Subject: [PATCH 20/36] Blood Denote --- lib/core/viewModels/base_view_model.dart | 2 +- lib/pages/ChildVaccines/child_vaccines_page.dart | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 lib/pages/ChildVaccines/child_vaccines_page.dart diff --git a/lib/core/viewModels/base_view_model.dart b/lib/core/viewModels/base_view_model.dart index 3d7122bd..d19905f7 100644 --- a/lib/core/viewModels/base_view_model.dart +++ b/lib/core/viewModels/base_view_model.dart @@ -4,7 +4,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter/material.dart'; -class BaseViewModel extends ChangeNotifier { +class BaseViewModel extends ChangeNotifier { ViewState _state = ViewState.Idle; bool isInternetConnection = true; bool isLogin = false; diff --git a/lib/pages/ChildVaccines/child_vaccines_page.dart b/lib/pages/ChildVaccines/child_vaccines_page.dart new file mode 100644 index 00000000..07031ceb --- /dev/null +++ b/lib/pages/ChildVaccines/child_vaccines_page.dart @@ -0,0 +1,15 @@ + +import 'package:flutter/cupertino.dart'; + +class ChildVaccinesPage extends StatefulWidget { + @override + _ChildVaccinesPageState createState() => _ChildVaccinesPageState(); +} + +class _ChildVaccinesPageState extends State { + @override + Widget build(BuildContext context) { + return Container(); + } +} + From db19eec35f03ce48574fb3ba2e0788b21087452d Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Sun, 4 Oct 2020 13:12:31 +0300 Subject: [PATCH 21/36] Blood Denote --- .../ChildVaccines/child_vaccines_page.dart | 430 +++++++++++++++++- 1 file changed, 429 insertions(+), 1 deletion(-) diff --git a/lib/pages/ChildVaccines/child_vaccines_page.dart b/lib/pages/ChildVaccines/child_vaccines_page.dart index 07031ceb..cec04f12 100644 --- a/lib/pages/ChildVaccines/child_vaccines_page.dart +++ b/lib/pages/ChildVaccines/child_vaccines_page.dart @@ -1,5 +1,13 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.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:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; class ChildVaccinesPage extends StatefulWidget { @override @@ -7,9 +15,429 @@ class ChildVaccinesPage extends StatefulWidget { } class _ChildVaccinesPageState extends State { + TextEditingController titleController = TextEditingController(); + var checkedValue=false; + String addEmail=""; @override Widget build(BuildContext context) { - return Container(); + + return BaseView( + onModelReady: (model) => model.getCities(),//model.getHospitals(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + 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 ,), + 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 ,), + Padding( + padding: const EdgeInsets.all(10.0), + child:Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: model.user.emailAddress,//'Title', + controller: titleController, + fontSize: 20, + hintColor: Colors.black, + fontWeight: FontWeight.w600, + onChanged: (text) { + addEmail=text; + model.user.emailAddress==addEmail?checkedValue=false:checkedValue=true; + // checkedValue=true; + // print("First text field: $text"); + // print("First text field:"+ model.user.emailAddress); + + }, + 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(12), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), + label: "UPDATE EMAIL", + // + onTap: (){ + model.user.emailAddress=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(12), + child: SecondaryButton( + textColor: Colors.white, + color: Color.fromRGBO(63, 72, 74, 1,), + label: " VIEW LIST OF CHILDREN", + // + onTap: (){ + + // bloodDetails.city=_selectedHospital.toString(); + + // bloodDetails. + }, + + + ), + ), + // Texts( + // // TranslationBase.of(context).advancePaymentLabel, + // model.user.emailAddress, + // 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, + ) + ], + ), + + ), + ), + ); } } From 9ab0d6688827fe1c7a67e78b8b4263e94acd7639 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Mon, 5 Oct 2020 09:17:38 +0300 Subject: [PATCH 22/36] child Vaccines --- .../childvaccines/child_vaccines_service.dart | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 lib/core/service/childvaccines/child_vaccines_service.dart 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..dc317a3e --- /dev/null +++ b/lib/core/service/childvaccines/child_vaccines_service.dart @@ -0,0 +1,29 @@ + +import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; +import 'package:diplomaticquarterapp/config/config.dart'; +import '../base_service.dart'; + +class ChildVaccinesService extends BaseService{ + +List BabyInformationModelList = List(); + Map body = Map(); +Future getAllBabyInformationOrders() async { + hasError = false; + body['List_BabyInformationModel'] = false; + + + await baseAppClient.post(GET_BABYINFORMATION_REQUEST, + 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); +} + +} \ No newline at end of file From 0e4ff1f804c5c0b7c9229b43eceecbc48d33055e Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Mon, 5 Oct 2020 12:37:24 +0300 Subject: [PATCH 23/36] child Vaccines --- .../childvaccines/child_vaccines_service.dart | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/lib/core/service/childvaccines/child_vaccines_service.dart b/lib/core/service/childvaccines/child_vaccines_service.dart index dc317a3e..d614f9a5 100644 --- a/lib/core/service/childvaccines/child_vaccines_service.dart +++ b/lib/core/service/childvaccines/child_vaccines_service.dart @@ -1,29 +1,30 @@ - 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(); +class ChildVaccinesService extends BaseService { + List babyInformationModelList = List(); + List userInformationModelList = List(); Map body = Map(); -Future getAllBabyInformationOrders() async { - hasError = false; - body['List_BabyInformationModel'] = false; - - - await baseAppClient.post(GET_BABYINFORMATION_REQUEST, - 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 getAllBabyInformationOrders() async { + hasError = false; + body['isDentalAllowedBackend'] = false; + body['IsLogin'] = true; + //body['UserID'] = babyInformationModelList[0].userID; + body['UserID'] = 42843; + + + await baseAppClient.post(GET_BABYINFORMATION_REQUEST, + 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); + } } - -} \ No newline at end of file From 37b817e0c8377156b60314a2e2c0b41d82145386 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Mon, 5 Oct 2020 16:02:20 +0300 Subject: [PATCH 24/36] child Vaccines --- lib/pages/ChildVaccines/child_page.dart | 129 ++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 lib/pages/ChildVaccines/child_page.dart diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart new file mode 100644 index 00000000..e5a5058f --- /dev/null +++ b/lib/pages/ChildVaccines/child_page.dart @@ -0,0 +1,129 @@ +import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; +import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_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:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ChildPage extends StatefulWidget { +//final List babyInformationModelList; + + // ChildPage({Key key, this.babyInformationModelList}) ; + + @override + _ChildPageState createState() => _ChildPageState(); +} + +class _ChildPageState extends State with SingleTickerProviderStateMixin { + @override + Widget build(BuildContext context) { + var checkedValue= false; + return BaseView( + onModelReady: (model) => model.getBabyInformatioRequestOrders(),//model.getCOC(),getFindUsRequestOrders() + builder: (_, model, widget) => AppScaffold( + 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( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.white, + + ), + child: Column( + children: [ + Row(children:[Texts("CHILD NAME"),]), + Row(children:[Texts(model.babyInformationModelList[index].babyName),]), + + Row( + children: [IconButton( + icon: Icon(Icons.phone,color: Colors.red,), + tooltip: 'Increase volume by 10', + onPressed: () { + setState(() { + // _volume += 10; + // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + }); + }, + ), + Texts(model.babyInformationModelList[index].babyName), + IconButton( + icon: Icon(Icons.phone,color: Colors.red,), + tooltip: 'Increase volume by 10', + onPressed: () { + setState(() { + // _volume += 10; + // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + }); + }, + )] + ), + Row(children:[Texts("Birthday"),]), + Row(children:[IconButton( + icon: Icon(Icons.phone,color: Colors.red,), + tooltip: 'Increase volume by 10', + onPressed: () { + setState(() { + // _volume += 10; + // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + }); + }, + ), + Texts(model.babyInformationModelList[index].dOB.toString()),]), + Row(children:[IconButton( + icon: Icon(Icons.phone,color: Colors.red,), + tooltip: 'Increase volume by 10', + onPressed: () { + setState(() { + // _volume += 10; + // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + }); + }, + ), + Texts("Birthday"),]), + ], + ) + + + ) + + ) + + ], + + + ) + ) + ), + 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: "ADD NEW CHILD ", + // + onTap: (){ + + // bloodDetails.city=_selectedHospital.toString(); + + // bloodDetails. + }, + + + ), + ), + ) + ); + } +} From e14d619eddd036065dfb69a6c587861b5f5c8bd6 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Mon, 5 Oct 2020 16:33:07 +0300 Subject: [PATCH 25/36] child Vaccines --- .../images/new-design/calender-secondary.png | Bin 0 -> 16215 bytes assets/images/new-design/female.png | Bin 0 -> 2344 bytes assets/images/new-design/garbage.png | Bin 0 -> 1628 bytes assets/images/new-design/male.png | Bin 0 -> 6152 bytes lib/config/config.dart | 12 +++++ .../List_BabyInformationModel.dart | 45 ++++++++++++++++ .../childvaccines/user_information_model.dart | 48 ++++++++++++++++++ .../childvaccines/child_vaccines_service.dart | 2 +- .../user_information_service.dart | 34 +++++++++++++ .../child_vaccines_view_model.dart | 29 +++++++++++ .../user_information_view_model.dart | 25 +++++++++ lib/locator.dart | 8 +++ lib/pages/Blood/blood_donation.dart | 2 +- lib/pages/ChildVaccines/child_page.dart | 13 +++-- .../ChildVaccines/child_vaccines_page.dart | 29 ++++++++--- 15 files changed, 232 insertions(+), 15 deletions(-) create mode 100644 assets/images/new-design/calender-secondary.png create mode 100644 assets/images/new-design/female.png create mode 100644 assets/images/new-design/garbage.png create mode 100644 assets/images/new-design/male.png create mode 100644 lib/core/model/childvaccines/List_BabyInformationModel.dart create mode 100644 lib/core/model/childvaccines/user_information_model.dart create mode 100644 lib/core/service/childvaccines/user_information_service.dart create mode 100644 lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart create mode 100644 lib/core/viewModels/child_vaccines/user_information_view_model.dart diff --git a/assets/images/new-design/calender-secondary.png b/assets/images/new-design/calender-secondary.png new file mode 100644 index 0000000000000000000000000000000000000000..a790849d3f7979c473f5d489fe5b7d49aec72b3e GIT binary patch literal 16215 zcmV-dKd8WoP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3@DkzBcwh5y5fX9Bb^2Qp$kSo8NgxYd$P&Kt(E zXIhlF0?0ffktnnO_kWK0&wu{oYzWoFRBCQHTmHosoA3Nm?ep*X>1@2;@4p;h&$+LU zoA)O?4+VaP*Bkch^_|Dl#~aG)^=^E9+?4q`PJJE7y&w4g3p%rYf4#204ix`#SjdzhhxAR^oWU8^41KmhV|-30y&Fq4P8F-G$=yh~@Vf3g1I$ zKaZVx|MlD8z5n)Y>}-EM9=;BRvHA6a{B4Y0kGu5k@$h~c|K*C@$CvBfcn&d=`-rV@=Q;4YWTUZ9YPhmq2VjUecj97PUA&(SX4TbJ-)<91JMOge zF1zlw`ytj&IPs*DPdW9p)8A+9HLG7|&3&7>KhK(b&6;K`-q)3nS>xeS-VWgeCrNY0 zjQQx8@uC?ZpuOhIRu`k!%xTVS^CU&`%$iG@oaHoQ%wXKkr{mt|?qlZuIBzD!e>HFZ zcQa=+b^jkTXEb%MnfrC#ewek@FQbGzLCQjnsSO8U;|05RU%NQzm!GY3s zoaeTq#BFmP{fxYVUSb$tX2#{2eaJ10+IBdkS528n;wHnICk?+Qx4r{cSx4-iJ2+s# zPWo=S0pl5t&E4dc-57O7NGG3U2?xi_wln>xXN=+6o}D!H-En)>4eoEmHgl;VCTC`h zx#uF0IPYPLP6uk-%G(fx_BF8C?ry^@cqfrLz9pP;5CqBuaG zyC+^1h<#JgSi|zGYbg+y{*1L}RZMC&SJ!OD%EeiqXCk>Bv&opv+{vNU6AZReGTX1} zGx^SqL^R0>vur|*A!VF4dB=q=!g2<#s4ce(lXU!^t?YPX$r2^O5L<@}hg6yCR2MwR z3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@{Npt0lsFT15v!5$O_H+bbb zZT>)=v3di|Yv4gDs<)v(ZV>eneM3n;B|&{St~6!8vVfS!H9!B*Cz-0cYI@LN8WrKi^-lw z1b1Y&7@Iu}W)AFR|MG@s>-zaVzxh9dCVTp^8d+@AvXXDCaeF#Q4R48QBdz>!9GFXs1smX>ElFk3BrwUgt)Ah>I8*Zc z=5)9uzH3M|MrUrVJsv=Me7~L7Ni3?i(LaRym@{&`w*WDU&Uer#Fm@yAPj2{)PagHb zF7~K%SFgn2pqX{gP??x85qzv7XkT)sVJCv$MsK_R(3m>UdhnpR@O2%B!}kiV)L|Wa zf(=prHt0Sl3gf-~v`^+Q1bj0|EYJGm7QVGl#O@Y49hWWf?AI3c$&)gf<|@d@&8^RJ z=h8LSTh867KjKY4ue~HZD1CWct{hxX43-05yRVFnN`N5yKz{M-)&cY9_tuUkCZvlF znTO}jrYxTOQ$-U7bLu*|7p#5?VnmrCs~7&US=;_8fgJnpj4TEis`T&1^U5-u0Sm38 zKy`JP=-{y*S_0U+>O;EF(x9q{A7;y>g?_gSmMksAXT=!7D|6ez*&@jiDaaPMq$M#O TO?@NSz6-#SK(^!9c;EO3rQ_^~ literal 0 HcmV?d00001 diff --git a/assets/images/new-design/male.png b/assets/images/new-design/male.png new file mode 100644 index 0000000000000000000000000000000000000000..e957df707e9201793820bb08943f07b19d212705 GIT binary patch literal 6152 zcmV+j829IiP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+TEF1b{sj9MgOsiUIHe=upGm5PVb;`x_*?ooNt{PXX53_joA_n*9P z@%NY4-Nze|mlBWZ`Lpczc;$8Z{6Nj`>*MR|uFiLz_AV4Y7QX+Io!Oqh$F+B%6rb0_ z`?u@w=QRJ}cHaMSzRSLgfB!pIim` z{1!#RFYf{6TaDh=gM52EeVitKxuWoS<}YvL_<3pHYj@6S z=j`Y1G#4sW+$I6S1Drv6urLuhszo9j#}+g`A^x z&U)s%5tT%`7Q~vff_01z<{hG(@X@=^&i!fMoaDdNxA?z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F^| zI(S#U^qJ0B?A?N%!*BKwkh4{T5pWI&WTa+6vtVFfO*pb9knR0xGMOBZHCmPxv;(2% z0IqOgXYf)Uc%?cG9q6QC0&%*NZ>+K%>T+=b!r=m3rH0DMB^ zI@fWD{idCHFqurAACdq8pe7ui3mDr4D7&HA0)GRMCh%I&&g=w$-jb5fg8aNexs#OX z0A^f?ub~^XhYp!`@4Q0YL>M%H0I;~Rahjsq0pN25Y9qWQ3X8VHVjmW-6O>1F#N!8H zU?$1m4JtO^0?1XV$#>mXOn7;>z)!@*2Snj{flSLQJmQZ^a^KyONcuI@Dywgt3k|$-0(R{mc(BL*p_2< zeP>(SF?di#`N4H%Wu-Z)ynM2vnniHZH76oUFX+749SZC! 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/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/service/childvaccines/child_vaccines_service.dart b/lib/core/service/childvaccines/child_vaccines_service.dart index d614f9a5..097f6bb0 100644 --- a/lib/core/service/childvaccines/child_vaccines_service.dart +++ b/lib/core/service/childvaccines/child_vaccines_service.dart @@ -11,7 +11,7 @@ class ChildVaccinesService extends BaseService { hasError = false; body['isDentalAllowedBackend'] = false; body['IsLogin'] = true; - //body['UserID'] = babyInformationModelList[0].userID; + // body['UserID'] = babyInformationModelList[0].userID; body['UserID'] = 42843; 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..9082039f --- /dev/null +++ b/lib/core/service/childvaccines/user_information_service.dart @@ -0,0 +1,34 @@ + +import 'package:diplomaticquarterapp/config/config.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; + // body['isDentalAllowedBackend'] = false; + // body['IsLogin'] = true; + // body['UserID'] = 42843; + + + 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); + } + + +} \ No newline at end of file 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..e6a8ca60 --- /dev/null +++ b/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart @@ -0,0 +1,29 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; + +import 'package:diplomaticquarterapp/core/service/childvaccines/child_vaccines_service.dart'; + +import '../../../locator.dart'; +import '../base_view_model.dart'; + +class ChildVaccinesViewModel extends BaseViewModel{ + + + ChildVaccinesService _childVaccinesService = locator(); + + + + List get babyInformationModelList=> _childVaccinesService.babyInformationModelList;//BabyInformationModelList; + getBabyInformatioRequestOrders() async { + setState(ViewState.Busy); + + await _childVaccinesService.getAllBabyInformationOrders(); + + if (_childVaccinesService.hasError) { + error = _childVaccinesService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + +} \ 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..c362ef73 --- /dev/null +++ b/lib/core/viewModels/child_vaccines/user_information_view_model.dart @@ -0,0 +1,25 @@ +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; + + getUserInformatioRequestOrders() async { + setState(ViewState.Busy); + + await _userInformationService.getUserInformationOrders(); + + if (_userInformationService.hasError) { + error = _userInformationService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/locator.dart b/lib/locator.dart index 8a7022c6..b57a63a1 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,6 +1,7 @@ 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/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:get_it/get_it.dart'; @@ -10,6 +11,8 @@ 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/child_vaccines_service.dart'; +import 'core/service/childvaccines/user_information_service.dart'; import 'core/service/contactus/finadus_service.dart'; import 'core/service/contactus/livechat_service.dart'; import 'core/service/dashboard_service.dart'; @@ -37,6 +40,7 @@ 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/child_vaccines_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'; @@ -112,6 +116,8 @@ void setupLocator() { locator.registerLazySingleton(() => BloodDonationService()); locator.registerLazySingleton(() => BloodDetailsService()); + locator.registerLazySingleton(() => ChildVaccinesService()); + locator.registerLazySingleton(() => UserInformationService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -139,6 +145,8 @@ void setupLocator() { locator.registerFactory(() => LiveChatViewModel()); locator.registerFactory(() => BloodDonationViewModel()); locator.registerFactory(() => BloodDeatailsViewModel()); + locator.registerFactory(() => ChildVaccinesViewModel()); + locator.registerFactory(() => UserInformationViewModel()); locator.registerFactory(() => H2OViewModel()); locator.registerFactory(() => BloodSugarViewMode()); diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index 6132e38c..99e5242e 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -87,7 +87,7 @@ class _BloodDonationPageState extends State { children: [ Texts( // TranslationBase.of(context).advancePaymentLabel, - "Enter the required information, In order to register for Blood Donation Service", + "Enter the required information, In order to register for Blood Donation Service",//+model.user.firstName, textAlign: TextAlign.center, ), SizedBox( diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart index e5a5058f..ea107600 100644 --- a/lib/pages/ChildVaccines/child_page.dart +++ b/lib/pages/ChildVaccines/child_page.dart @@ -6,6 +6,7 @@ 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:diplomaticquarterapp/uitl/date_uitl.dart'; class ChildPage extends StatefulWidget { //final List babyInformationModelList; @@ -38,14 +39,16 @@ class _ChildPageState extends State with SingleTickerProviderStateMix color: Colors.white, ), + width: 150, child: Column( + children: [ Row(children:[Texts("CHILD NAME"),]), Row(children:[Texts(model.babyInformationModelList[index].babyName),]), Row( children: [IconButton( - icon: Icon(Icons.phone,color: Colors.red,), + icon: new Image.asset('assets/images/new-design/female.png'), tooltip: 'Increase volume by 10', onPressed: () { setState(() { @@ -56,7 +59,7 @@ class _ChildPageState extends State with SingleTickerProviderStateMix ), Texts(model.babyInformationModelList[index].babyName), IconButton( - icon: Icon(Icons.phone,color: Colors.red,), + icon: Icon(Icons.remove_red_eye_outlined,color: Colors.red,), tooltip: 'Increase volume by 10', onPressed: () { setState(() { @@ -68,7 +71,7 @@ class _ChildPageState extends State with SingleTickerProviderStateMix ), Row(children:[Texts("Birthday"),]), Row(children:[IconButton( - icon: Icon(Icons.phone,color: Colors.red,), + icon: new Image.asset('assets/images/new-design/calender-secondary.png'), tooltip: 'Increase volume by 10', onPressed: () { setState(() { @@ -77,9 +80,9 @@ class _ChildPageState extends State with SingleTickerProviderStateMix }); }, ), - Texts(model.babyInformationModelList[index].dOB.toString()),]), + Texts(DateUtil.yearMonthDay(model.babyInformationModelList[index].dOB)),]), Row(children:[IconButton( - icon: Icon(Icons.phone,color: Colors.red,), + icon: new Image.asset('assets/images/new-design/garbage.png'), tooltip: 'Increase volume by 10', onPressed: () { setState(() { diff --git a/lib/pages/ChildVaccines/child_vaccines_page.dart b/lib/pages/ChildVaccines/child_vaccines_page.dart index cec04f12..269c9259 100644 --- a/lib/pages/ChildVaccines/child_vaccines_page.dart +++ b/lib/pages/ChildVaccines/child_vaccines_page.dart @@ -1,28 +1,35 @@ +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 { +class _ChildVaccinesPageState extends State + with SingleTickerProviderStateMixin{ TextEditingController titleController = TextEditingController(); var checkedValue=false; String addEmail=""; @override Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => model.getCities(),//model.getHospitals(), + return BaseView( + onModelReady: (model) => model.getUserInformatioRequestOrders(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: " Vaccination",//TranslationBase.of(context).advancePayment, @@ -98,7 +105,7 @@ class _ChildVaccinesPageState extends State { label: "UPDATE EMAIL", // onTap: (){ - model.user.emailAddress=model.user.emailAddress+addEmail.toString(); + model.user.emailAddress=addEmail.toString(); AppToast.showSuccessToast( message: "Email updated"); // bloodDetails.city=_selectedHospital.toString(); @@ -119,12 +126,18 @@ class _ChildVaccinesPageState extends State { color: Color.fromRGBO(63, 72, 74, 1,), label: " VIEW LIST OF CHILDREN", // - onTap: (){ + onTap: () => Navigator.push( + context, + FadePage( + page: ChildPage(), - // bloodDetails.city=_selectedHospital.toString(); + //ChildPage(babyInformationModelList:model.BabyInformationModelList) + // HospitalsPage( + // findusHospitalModelList: model.FindusHospitalModelList, + // ) - // bloodDetails. - }, + ), + ), ), From 4009aed0009b0fdd19bb46596dedaa696a092deb Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Tue, 6 Oct 2020 13:05:18 +0300 Subject: [PATCH 26/36] child Vaccines --- .../ChildVaccines/add_newchild_page.dart | 235 +++++++++++++++++ lib/pages/ChildVaccines/child_page.dart | 22 +- lib/pages/ChildVaccines/new_text_Field.dart | 239 ++++++++++++++++++ .../medical/balance/advance_payment_page.dart | 1 + 4 files changed, 491 insertions(+), 6 deletions(-) create mode 100644 lib/pages/ChildVaccines/add_newchild_page.dart create mode 100644 lib/pages/ChildVaccines/new_text_Field.dart diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart new file mode 100644 index 00000000..0d87cda3 --- /dev/null +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -0,0 +1,235 @@ +import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.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/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/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'; +import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; + +import 'new_text_Field.dart'; + +enum Gender { Male, Female, NON } +enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } + +class AddNewChildPage extends StatefulWidget { + @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; + ChildVaccinesViewModel AddvancedModel = ChildVaccinesViewModel(); + + @override + Widget build(BuildContext context) { + + return 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: 170, + child: SecondaryButton( + + textColor:checkedValue == 1 + ? Colors.white + : Colors.black, + color: checkedValue == 1 + ? Colors.red + : Colors.white, + + label: "Male", + // + onTap: () { + // bloodDetails.city=_selectedHospital.toString(); + setState(() { + checkedValue=1; + print("checkedValue="+checkedValue.toString()); + }); + + // bloodDetails. + }, + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: 170, + 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), + 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( DateUtil.yearMonthDay(DateTime.now()) + //getStartDay() + ), + Icon( + Icons.calendar_today, + color: Colors.black, + ) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + //========= + + ], + ), + ), + ), + 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: "Add", + // + onTap: () { + // bloodDetails.city=_selectedHospital.toString(); + + // bloodDetails. + }, + ), + + ), + ); + } +} diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart index ea107600..54e2b60d 100644 --- a/lib/pages/ChildVaccines/child_page.dart +++ b/lib/pages/ChildVaccines/child_page.dart @@ -1,9 +1,11 @@ import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.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/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/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -20,10 +22,12 @@ class ChildPage extends StatefulWidget { class _ChildPageState extends State with SingleTickerProviderStateMixin { @override Widget build(BuildContext context) { - var checkedValue= false; + var checkedValue= true; return BaseView( onModelReady: (model) => model.getBabyInformatioRequestOrders(),//model.getCOC(),getFindUsRequestOrders() builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: " Vaccination", baseViewModel: model, body: SingleChildScrollView( child: Container( @@ -83,7 +87,7 @@ class _ChildPageState extends State with SingleTickerProviderStateMix Texts(DateUtil.yearMonthDay(model.babyInformationModelList[index].dOB)),]), Row(children:[IconButton( icon: new Image.asset('assets/images/new-design/garbage.png'), - tooltip: 'Increase volume by 10', + tooltip: '', onPressed: () { setState(() { // _volume += 10; @@ -116,12 +120,18 @@ class _ChildPageState extends State with SingleTickerProviderStateMix color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), label: "ADD NEW CHILD ", // - onTap: (){ + onTap: () => Navigator.push( + context, + FadePage( + page: AddNewChildPage(), - // bloodDetails.city=_selectedHospital.toString(); + //ChildPage(babyInformationModelList:model.BabyInformationModelList) + // HospitalsPage( + // findusHospitalModelList: model.FindusHospitalModelList, + // ) - // bloodDetails. - }, + ), + ), ), diff --git a/lib/pages/ChildVaccines/new_text_Field.dart b/lib/pages/ChildVaccines/new_text_Field.dart new file mode 100644 index 00000000..ad9eb580 --- /dev/null +++ b/lib/pages/ChildVaccines/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/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index 5cef835f..02d08682 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -29,6 +29,7 @@ import 'new_text_Field.dart'; enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } + class AdvancePaymentPage extends StatefulWidget { @override _AdvancePaymentPageState createState() => _AdvancePaymentPageState(); From 42554ffa675a0119c943ff1f0e5baa6721faec89 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Tue, 6 Oct 2020 15:45:58 +0300 Subject: [PATCH 27/36] child Vaccines --- .../ChildVaccines/add_newchild_page.dart | 109 ++++++++++++++++-- 1 file changed, 97 insertions(+), 12 deletions(-) diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart index 0d87cda3..b28c1986 100644 --- a/lib/pages/ChildVaccines/add_newchild_page.dart +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -1,7 +1,10 @@ +import 'package:device_calendar/device_calendar.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.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/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'; @@ -10,9 +13,7 @@ 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'; -import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; -import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; + import 'new_text_Field.dart'; @@ -20,6 +21,35 @@ enum Gender { Male, Female, NON } enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } class AddNewChildPage 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; + + //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(); } @@ -39,7 +69,8 @@ class _AddNewChildPageState extends State { TextEditingController _notesTextController = TextEditingController(); BeneficiaryType beneficiaryType = BeneficiaryType.NON; Gender gender = Gender.Male; - ChildVaccinesViewModel AddvancedModel = ChildVaccinesViewModel(); + //ChildVaccinesViewModel addvancedModel = ChildVaccinesViewModel(); + List_BabyInformationModel addvancedModel = List_BabyInformationModel(); @override Widget build(BuildContext context) { @@ -165,14 +196,17 @@ class _AddNewChildPageState extends State { onTap: () { DatePicker.showDatePicker(context, showTitleActions: true, - minTime: DateTime( - DateTime.now().year, DateTime.now().month - 1, 1), - maxTime: DateTime.now(), onConfirm: (date) { + // minTime: DateTime( + // DateTime.now().year, DateTime.now().month - 1, 1), + minTime: DateTime( + 1, 1, 1), + maxTime: DateTime.now(), + onConfirm: (date) { setState(() { - // widget.startDay = date; + widget.startDay = date; }); }, - // currentTime: widget.startDay, + currentTime: widget.startDay, // locale: projectViewModel.localeType ); }, @@ -186,8 +220,9 @@ class _AddNewChildPageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts( DateUtil.yearMonthDay(DateTime.now()) - //getStartDay() + Texts( //getStartDay() + // DateUtil.yearMonthDay(DateTime.now()) + getStartDay() ), Icon( Icons.calendar_today, @@ -223,7 +258,23 @@ class _AddNewChildPageState extends State { label: "Add", // onTap: () { - // bloodDetails.city=_selectedHospital.toString(); + + addvancedModel.babyName=_firstTextController.text + " "+_secondTextController.text; + addvancedModel.gender=checkedValue; + addvancedModel.dOB=DateUtil.convertStringToDate(getStartDay()) ; + addvancedModel.alertBy=2; + addvancedModel.alertBy=addvancedModel.babyID; + addvancedModel.genderDescription=checkedValue==1?"Male":"Female"; + addvancedModel.patientID=addvancedModel.patientID; + addvancedModel.userID=addvancedModel.userID; + // // advanceModel.fileNumber = _fileTextController.text; + // // advanceModel.hospitalsModel = _selectedHospital; + // // advanceModel.note = _notesTextController.text; + // // advanceModel.email = email ?? model.user.emailAddress; + // // advanceModel.amount = amount; + // // bloodDetails.city=_selectedHospital.toString(); + AppToast.showSuccessToast( + message: "Email updated"); // bloodDetails. }, @@ -232,4 +283,38 @@ class _AddNewChildPageState extends State { ), ); } + 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; + }); + }, + ), + ); + } } From 8a6511404f849bdd3b00a575f2f72380515231b8 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Tue, 6 Oct 2020 17:03:42 +0300 Subject: [PATCH 28/36] child Vaccines --- .../ChildVaccines/add_newchild_page.dart | 399 +++++++++--------- 1 file changed, 211 insertions(+), 188 deletions(-) diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart index b28c1986..f4f2db94 100644 --- a/lib/pages/ChildVaccines/add_newchild_page.dart +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -1,7 +1,11 @@ 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/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/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'; @@ -14,7 +18,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; - import 'new_text_Field.dart'; enum Gender { Male, Female, NON } @@ -24,6 +27,7 @@ class AddNewChildPage extends StatefulWidget { final int frequency; final int days; final String itemDescription; + String dateAdd; List _scheduleList = List(); List daysOfWeek = [ @@ -41,9 +45,10 @@ class AddNewChildPage extends StatefulWidget { //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(); + 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, @@ -71,218 +76,236 @@ class _AddNewChildPageState extends State { Gender gender = Gender.Male; //ChildVaccinesViewModel addvancedModel = ChildVaccinesViewModel(); List_BabyInformationModel addvancedModel = List_BabyInformationModel(); + CreateNewBaby newChild=CreateNewBaby(); + List_UserInformationModel informationModel =List_UserInformationModel(); @override Widget build(BuildContext context) { - - return 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, - + 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, ), - ],), - Container( - height: MediaQuery.of(context).size.height * 0.12, - width: double.infinity, - padding: EdgeInsets.all(12), - child: Row( - crossAxisAlignment: CrossAxisAlignment.stretch, - mainAxisAlignment: MainAxisAlignment.center, - - + 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: [ - - Container( - height: MediaQuery.of(context).size.height * 0.12, - width: 170, - child: SecondaryButton( - - textColor:checkedValue == 1 - ? Colors.white - : Colors.black, - color: checkedValue == 1 - ? Colors.red - : Colors.white, - - label: "Male", - // - onTap: () { - // bloodDetails.city=_selectedHospital.toString(); - setState(() { - checkedValue=1; - print("checkedValue="+checkedValue.toString()); - }); - - // bloodDetails. - }, - ), + Text( + "Gender:", + textAlign: TextAlign.end, ), - Container( - height: MediaQuery.of(context).size.height * 0.12, - width: 170, - 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(); + ], + ), + 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: 170, + child: SecondaryButton( + textColor: + checkedValue == 1 ? Colors.white : Colors.black, + color: checkedValue == 1 ? Colors.red : Colors.white, + + label: "Male", + // + onTap: () { + // bloodDetails.city=_selectedHospital.toString(); + setState(() { + checkedValue = 1; + print("checkedValue=" + checkedValue.toString()); + }); - // bloodDetails. - }, + // bloodDetails. + }, + ), ), - ) - ],) , - ), - //========== - SizedBox( - height: 6, - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "Date Of Birth::", - textAlign: TextAlign.end, + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: 170, + 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. + }, + ), + ) + ], ), - ],), - InkWell( - onTap: () { - DatePicker.showDatePicker(context, + ), + //========== + 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), + minTime: DateTime(1, 1, 1), maxTime: DateTime.now(), - onConfirm: (date) { + onConfirm: (date) { setState(() { - widget.startDay = date; + 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, - ) - ], + // 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, - ), - //========= - - ], + SizedBox( + height: 12, + ), + //========= + ], + ), ), ), - ), - 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: "Add", - // - onTap: () { + 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: "Add", + // + onTap: () { - addvancedModel.babyName=_firstTextController.text + " "+_secondTextController.text; - addvancedModel.gender=checkedValue; - addvancedModel.dOB=DateUtil.convertStringToDate(getStartDay()) ; - addvancedModel.alertBy=2; - addvancedModel.alertBy=addvancedModel.babyID; - addvancedModel.genderDescription=checkedValue==1?"Male":"Female"; - addvancedModel.patientID=addvancedModel.patientID; - addvancedModel.userID=addvancedModel.userID; - // // advanceModel.fileNumber = _fileTextController.text; - // // advanceModel.hospitalsModel = _selectedHospital; - // // advanceModel.note = _notesTextController.text; - // // advanceModel.email = email ?? model.user.emailAddress; - // // advanceModel.amount = amount; - // // bloodDetails.city=_selectedHospital.toString(); - AppToast.showSuccessToast( - message: "Email updated"); + newChild.babyName = + _firstTextController.text + " " + _secondTextController.text; + newChild.gender = checkedValue.toString(); + newChild.strDOB=getStartDay() ; + newChild.createdBy=informationModel.createdBy ; + newChild.editedBy=informationModel.createdBy; + newChild.tempValue=true; + newChild.userID=addvancedModel.userID; + newChild.isLogin=true; + newChild.alertBy=addvancedModel.alertBy; + + model.getNewBabyOrders(newChild: newChild); - // bloodDetails. - }, - ), + //DateTime.now();//DateUtil.convertStringToDate(getStartDay()); + // addvancedModel.alertBy = 2; + // addvancedModel.alertBy = addvancedModel.babyID; + // addvancedModel.genderDescription = + // checkedValue == 1 ? "Male" : "Female"; + // addvancedModel.patientID = addvancedModel.patientID; + // addvancedModel.userID = addvancedModel.userID; + // // advanceModel.fileNumber = _fileTextController.text; + // // advanceModel.hospitalsModel = _selectedHospital; + // // advanceModel.note = _notesTextController.text; + // // advanceModel.email = email ?? model.user.emailAddress; + // // advanceModel.amount = amount; + // // bloodDetails.city=_selectedHospital.toString(); + AppToast.showSuccessToast(message: "Record Added"); + //============ + Navigator.push( + context, + FadePage( + page: ChildPage(), + + //ChildPage(babyInformationModelList:model.BabyInformationModelList) + // HospitalsPage( + // findusHospitalModelList: model.FindusHospitalModelList, + // ) + ), + ); + //============== + + // bloodDetails. + }, + ), + ), ), ); } + String getStartDay() { return "${DateUtil.getMonth(widget.startDay.month)} ${widget.startDay.day}, ${widget.startDay.year}"; } From 6830996f9c838f2a213bb29af38ce971402086db Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Tue, 6 Oct 2020 18:01:32 +0300 Subject: [PATCH 29/36] child Vaccines --- .../add_new_child_view_model.dart | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lib/core/viewModels/child_vaccines/add_new_child_view_model.dart 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..26355bd7 --- /dev/null +++ b/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart @@ -0,0 +1,28 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart'; + +import '../../../locator.dart'; +import '../base_view_model.dart'; + + +class AddNewChildViewModel extends BaseViewModel{ + + CreteNewBabyService _creteNewBabyService = locator(); + + + + List get creteNewBabyModelList=> _creteNewBabyService.createNewBabyModelList; + getNewBabyOrders({ CreateNewBaby newChild}) async { + setState(ViewState.Busy); + + await _creteNewBabyService.getCreateNewBabyOrders(newChild: newChild); + + if ( _creteNewBabyService.hasError) { + error = _creteNewBabyService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + +} From fe17c20bdf19c746989824ccfe114f7af1911fd7 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Tue, 6 Oct 2020 18:04:14 +0300 Subject: [PATCH 30/36] child Vaccines --- lib/config/config.dart | 5 + .../childvaccines/add_newchild_model.dart | 100 ++++++++++++++++++ .../childvaccines/add_new_child_service.dart | 26 +++++ lib/locator.dart | 7 ++ 4 files changed, 138 insertions(+) create mode 100644 lib/core/model/childvaccines/add_newchild_model.dart create mode 100644 lib/core/service/childvaccines/add_new_child_service.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 204148b6..65f1553e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -78,6 +78,11 @@ const GET_USERINFORMATION_REQUEST= 'Services/Community.svc/REST/GetUserInformation_New'; +///addNewChild +const GET_NEWCHILD_REQUEST= + 'Services/Community.svc/REST/CreateNewBaby'; + + ///BloodDenote 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/service/childvaccines/add_new_child_service.dart b/lib/core/service/childvaccines/add_new_child_service.dart new file mode 100644 index 00000000..22a081a3 --- /dev/null +++ b/lib/core/service/childvaccines/add_new_child_service.dart @@ -0,0 +1,26 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; +import '../base_service.dart'; + +class CreteNewBabyService extends BaseService { + List createNewBabyModelList = List(); + + + Future getCreateNewBabyOrders({ CreateNewBaby newChild}) async { + hasError = false; + await baseAppClient.post(GET_NEWCHILD_REQUEST, + onSuccess: (dynamic response, int statusCode) { + createNewBabyModelList.clear(); + + response['List_UserInformationModel_New'].forEach((vital) { + createNewBabyModelList.add( + CreateNewBaby.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: newChild.toJson()); + } + +} \ No newline at end of file diff --git a/lib/locator.dart b/lib/locator.dart index b57a63a1..dee65ccc 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -11,6 +11,7 @@ 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/user_information_service.dart'; import 'core/service/contactus/finadus_service.dart'; @@ -40,6 +41,7 @@ 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/contactus/findus_view_model.dart'; import 'core/viewModels/contactus/livechat_view_model.dart'; @@ -118,6 +120,8 @@ void setupLocator() { locator.registerLazySingleton(() => BloodDetailsService()); locator.registerLazySingleton(() => ChildVaccinesService()); locator.registerLazySingleton(() => UserInformationService()); + locator.registerLazySingleton(() => CreteNewBabyService()); + /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -147,6 +151,9 @@ void setupLocator() { locator.registerFactory(() => BloodDeatailsViewModel()); locator.registerFactory(() => ChildVaccinesViewModel()); locator.registerFactory(() => UserInformationViewModel()); + locator.registerFactory(() => UserInformationViewModel()); + + locator.registerFactory(() => AddNewChildViewModel()); locator.registerFactory(() => H2OViewModel()); locator.registerFactory(() => BloodSugarViewMode()); From 1d29aa36a2f3f48a18ba0cff506e1b41ee0abc5b Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Wed, 7 Oct 2020 10:39:42 +0300 Subject: [PATCH 31/36] child Vaccines --- lib/config/config.dart | 4 + .../create_vaccination_table.dart | 25 ++ .../childvaccines/child_vaccines_service.dart | 9 +- .../user_information_service.dart | 13 +- .../vaccination_table_service.dart | 39 +++ .../vaccination_table_view_model.dart | 30 +++ lib/locator.dart | 7 +- .../ChildVaccines/add_newchild_page.dart | 10 +- lib/pages/ChildVaccines/child_page.dart | 34 ++- .../ChildVaccines/child_vaccines_page.dart | 1 + .../dialogs/SelectGenderDialog.dart | 146 +++++++++++ lib/pages/ChildVaccines/new_text_Field.dart | 239 ------------------ .../ChildVaccines/vaccinationtable_page.dart | 136 ++++++++++ 13 files changed, 435 insertions(+), 258 deletions(-) create mode 100644 lib/core/model/childvaccines/create_vaccination_table.dart create mode 100644 lib/core/service/childvaccines/vaccination_table_service.dart create mode 100644 lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart create mode 100644 lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart delete mode 100644 lib/pages/ChildVaccines/new_text_Field.dart create mode 100644 lib/pages/ChildVaccines/vaccinationtable_page.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 65f1553e..2f497de2 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -83,6 +83,10 @@ const GET_NEWCHILD_REQUEST= 'Services/Community.svc/REST/CreateNewBaby'; +///addNewTABLE +const GET_TABLE_REQUEST= + 'Services/Community.svc/REST/CreateVaccinationTable'; + ///BloodDenote 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/service/childvaccines/child_vaccines_service.dart b/lib/core/service/childvaccines/child_vaccines_service.dart index 097f6bb0..75a07338 100644 --- a/lib/core/service/childvaccines/child_vaccines_service.dart +++ b/lib/core/service/childvaccines/child_vaccines_service.dart @@ -1,3 +1,5 @@ +import 'dart:convert'; + 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'; @@ -6,13 +8,16 @@ import '../base_service.dart'; class ChildVaccinesService extends BaseService { List babyInformationModelList = List(); List userInformationModelList = List(); + Map body = Map(); Future getAllBabyInformationOrders() async { hasError = false; + body['isDentalAllowedBackend'] = false; body['IsLogin'] = true; - // body['UserID'] = babyInformationModelList[0].userID; - body['UserID'] = 42843; + + //body['UserID'] = userInformationModelList[0].userID;//AuthenticatedUser.fromJson(json['List'][0] //babyInformationModelList[0].userID; + body['UserID'] = 46013;//42843; await baseAppClient.post(GET_BABYINFORMATION_REQUEST, diff --git a/lib/core/service/childvaccines/user_information_service.dart b/lib/core/service/childvaccines/user_information_service.dart index 9082039f..7651ef0f 100644 --- a/lib/core/service/childvaccines/user_information_service.dart +++ b/lib/core/service/childvaccines/user_information_service.dart @@ -12,9 +12,16 @@ class UserInformationService extends BaseService{ Future getUserInformationOrders() async { hasError = false; - // body['isDentalAllowedBackend'] = false; - // body['IsLogin'] = true; - // body['UserID'] = 42843; + await getUser(); + body['CreatedBy'] = 102; + body['EditedBy'] = 102; + body['EmailAddress'] = user.emailAddress; + body['IsLogin'] =true; + body['LogInTokenID'] = 'ZBGoQFUG50eQJd6Y7u1ykA=='; + body['MobileNumber'] = user.mobileNumber; + body['NationalID'] = user.nationalityID; + body['ZipCode'] = user.zipCode; + body['isDentalAllowedBackend'] = false; await baseAppClient.post(GET_USERINFORMATION_REQUEST, 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/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/locator.dart b/lib/locator.dart index dee65ccc..46b97fce 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -14,6 +14,7 @@ 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/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'; @@ -43,6 +44,7 @@ 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'; @@ -121,6 +123,7 @@ void setupLocator() { locator.registerLazySingleton(() => ChildVaccinesService()); locator.registerLazySingleton(() => UserInformationService()); locator.registerLazySingleton(() => CreteNewBabyService()); + locator.registerLazySingleton(() => VaccinationTableService()); /// View Model @@ -151,7 +154,9 @@ void setupLocator() { locator.registerFactory(() => BloodDeatailsViewModel()); locator.registerFactory(() => ChildVaccinesViewModel()); locator.registerFactory(() => UserInformationViewModel()); - locator.registerFactory(() => UserInformationViewModel()); + locator.registerFactory(() => VaccinationTableViewModel()); + + locator.registerFactory(() => AddNewChildViewModel()); locator.registerFactory(() => H2OViewModel()); diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart index f4f2db94..a24fa5a4 100644 --- a/lib/pages/ChildVaccines/add_newchild_page.dart +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model 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'; @@ -18,7 +19,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'new_text_Field.dart'; + enum Gender { Male, Female, NON } enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } @@ -260,12 +261,15 @@ class _AddNewChildPageState extends State { _firstTextController.text + " " + _secondTextController.text; newChild.gender = checkedValue.toString(); newChild.strDOB=getStartDay() ; + newChild.alertBy=addvancedModel.alertBy; newChild.createdBy=informationModel.createdBy ; newChild.editedBy=informationModel.createdBy; newChild.tempValue=true; - newChild.userID=addvancedModel.userID; + // newChild.userID=46013;//informationModel.userID; newChild.isLogin=true; - newChild.alertBy=addvancedModel.alertBy; + //newChild.tokenID='qMgbP94U23RkXtWWT0Sw=='; + //'ZBGoQFUG50eQJd6Y7u1ykA=='; + model.getNewBabyOrders(newChild: newChild); diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart index 54e2b60d..c657b3ca 100644 --- a/lib/pages/ChildVaccines/child_page.dart +++ b/lib/pages/ChildVaccines/child_page.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.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/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -43,17 +44,18 @@ class _ChildPageState extends State with SingleTickerProviderStateMix color: Colors.white, ), - width: 150, + padding: EdgeInsets.all(12), + width: double.infinity, child: Column( children: [ Row(children:[Texts("CHILD NAME"),]), - Row(children:[Texts(model.babyInformationModelList[index].babyName),]), + Row(children:[Texts(model.babyInformationModelList[index].babyName.trim()),]), Row( children: [IconButton( - icon: new Image.asset('assets/images/new-design/female.png'), - tooltip: 'Increase volume by 10', + 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; @@ -61,15 +63,27 @@ class _ChildPageState extends State with SingleTickerProviderStateMix }); }, ), - Texts(model.babyInformationModelList[index].babyName), + Texts(model.babyInformationModelList[index].genderDescription), IconButton( - icon: Icon(Icons.remove_red_eye_outlined,color: Colors.red,), + icon: Icon(Icons.remove_red_eye,color: Colors.red,), tooltip: 'Increase volume by 10', onPressed: () { - setState(() { - // _volume += 10; - // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - }); + Navigator.push( + context, + FadePage( + page: VaccinationTablePage(), + + //ChildPage(babyInformationModelList:model.BabyInformationModelList) + // HospitalsPage( + // findusHospitalModelList: model.FindusHospitalModelList, + // ) + + ), + ); + // setState(() { + // // _volume += 10; + // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + // }); }, )] ), diff --git a/lib/pages/ChildVaccines/child_vaccines_page.dart b/lib/pages/ChildVaccines/child_vaccines_page.dart index 269c9259..ba4589a9 100644 --- a/lib/pages/ChildVaccines/child_vaccines_page.dart +++ b/lib/pages/ChildVaccines/child_vaccines_page.dart @@ -32,6 +32,7 @@ class _ChildVaccinesPageState extends State onModelReady: (model) => model.getUserInformatioRequestOrders(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, + baseViewModel: model, appBarTitle: " Vaccination",//TranslationBase.of(context).advancePayment, body: SingleChildScrollView( physics: ScrollPhysics(), diff --git a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart new file mode 100644 index 00000000..295c6dcd --- /dev/null +++ b/lib/pages/ChildVaccines/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/ChildVaccines/new_text_Field.dart b/lib/pages/ChildVaccines/new_text_Field.dart deleted file mode 100644 index ad9eb580..00000000 --- a/lib/pages/ChildVaccines/new_text_Field.dart +++ /dev/null @@ -1,239 +0,0 @@ -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/ChildVaccines/vaccinationtable_page.dart b/lib/pages/ChildVaccines/vaccinationtable_page.dart new file mode 100644 index 00000000..8039765e --- /dev/null +++ b/lib/pages/ChildVaccines/vaccinationtable_page.dart @@ -0,0 +1,136 @@ +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'; + +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: [ + Html( + data:"
BCG
HEPATITIS B
"//model.creteVaccinationTableModelList[index].vaccinesDescription + , + ), + // 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: 'Increase volume by 10', + // onPressed: () { + // Navigator.push( + // context, + // FadePage( + // page: VaccinationTablePage(), + // + // //ChildPage(babyInformationModelList:model.BabyInformationModelList) + // // HospitalsPage( + // // findusHospitalModelList: model.FindusHospitalModelList, + // // ) + // + // ), + // ); + // // setState(() { + // // // _volume += 10; + // // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + // // }); + // }, + // )] + // ), + // Row(children:[Texts("Birthday"),]), + // Row(children:[IconButton( + // icon: new Image.asset('assets/images/new-design/calender-secondary.png'), + // tooltip: 'Increase volume by 10', + // onPressed: () { + // setState(() { + // // _volume += 10; + // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + // }); + // }, + // ), + // Texts(DateUtil.yearMonthDay(model.babyInformationModelList[index].dOB)),]), + // Row(children:[IconButton( + // icon: new Image.asset('assets/images/new-design/garbage.png'), + // tooltip: '', + // onPressed: () { + // setState(() { + // // _volume += 10; + // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + // }); + // }, + // ), + // Texts("Birthday"),]), + ], + ) + + + ) + + ) + ], + ), + + ), + ), + 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: " ", + // + onTap: () {} + + + ), + ), + ), + ); + } +} From dcb93bf5cc58071887b871670cded223780bfc64 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Wed, 7 Oct 2020 12:12:15 +0300 Subject: [PATCH 32/36] child Vaccines --- .../ChildVaccines/vaccinationtable_page.dart | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/lib/pages/ChildVaccines/vaccinationtable_page.dart b/lib/pages/ChildVaccines/vaccinationtable_page.dart index 8039765e..952cfb0c 100644 --- a/lib/pages/ChildVaccines/vaccinationtable_page.dart +++ b/lib/pages/ChildVaccines/vaccinationtable_page.dart @@ -38,10 +38,27 @@ class VaccinationTablePage extends StatelessWidget { child: Column( children: [ - Html( - data:"
BCG
HEPATITIS B
"//model.creteVaccinationTableModelList[index].vaccinesDescription - , - ), + 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 ,), // Row(children:[Texts("CHILD NAME"),]), // Row(children:[Texts(model.babyInformationModelList[index].babyName.trim()),]), @@ -123,7 +140,7 @@ class VaccinationTablePage extends StatelessWidget { child: SecondaryButton( textColor: Colors.white, color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), - label: " ", + label: "Send Email ", // onTap: () {} From dbda69baa15f9b45cf198ca8273e4844de4e7b0e Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 7 Oct 2020 12:44:17 +0300 Subject: [PATCH 33/36] health Calculator'General Health' --- assets/images/medical/BMR_calculator.png | Bin 0 -> 3177 bytes .../images/medical/bmi_health_calculator.png | Bin 0 -> 2209 bytes assets/images/medical/body_fat.png | Bin 0 -> 4309 bytes assets/images/medical/body_weight.png | Bin 0 -> 2775 bytes assets/images/medical/calories-calculator.png | Bin 0 -> 3309 bytes assets/images/medical/carb_protein.png | Bin 0 -> 3732 bytes assets/images/medical/delivery_date_icon.png | Bin 0 -> 8713 bytes .../images/medical/ovulation_period_icon.png | Bin 0 -> 2506 bytes .../all_habib_medical_service_page.dart | 5 +- .../bmi_calculator/bmi_calculator.dart | 521 +++++++++ .../bmi_calculator/result_page.dart | 101 ++ .../bmr_calculator/bmr_calculator.dart | 721 ++++++++++++ .../bmr_calculator/bmr_result_page.dart | 65 ++ .../health_calculator/body_fat/body_fat.dart | 1003 +++++++++++++++++ .../body_fat/body_fat_result_page.dart | 77 ++ .../calorie_calculator.dart | 676 +++++++++++ .../calorie_result_page.dart | 59 + .../health_calculator/carbs/carbs.dart | 367 ++++++ .../carbs/carbs_result_page.dart | 175 +++ .../ideal_body/ideal_body.dart | 550 +++++++++ .../ideal_body/ideal_body_result_page.dart | 170 +++ .../health_converter/blood_cholesterol.dart | 2 +- .../​ health_calculators.dart | 279 +++++ pubspec.yaml | 3 + 24 files changed, 4772 insertions(+), 2 deletions(-) create mode 100644 assets/images/medical/BMR_calculator.png create mode 100644 assets/images/medical/bmi_health_calculator.png create mode 100644 assets/images/medical/body_fat.png create mode 100644 assets/images/medical/body_weight.png create mode 100644 assets/images/medical/calories-calculator.png create mode 100644 assets/images/medical/carb_protein.png create mode 100644 assets/images/medical/delivery_date_icon.png create mode 100644 assets/images/medical/ovulation_period_icon.png create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.dart create mode 100644 lib/pages/AlHabibMedicalService/​ health_calculators.dart diff --git a/assets/images/medical/BMR_calculator.png b/assets/images/medical/BMR_calculator.png new file mode 100644 index 0000000000000000000000000000000000000000..2c32b80da9aa28ade902c8324a2f3d28babeee59 GIT binary patch literal 3177 zcmV-v43_hWP)b6jsoye06zlovPGy3waz>j@p&br z=^-?B1n{h?dt7a^&Q07Z1hkEUv*9~RnD^E?<6Ok40Cou>tpw2CLg%?kn7cW(@o)$O z0K94$7yk(09VGLu0Is&w`J@-5d-z=eEp{^%B>nr`T4$V#I7$iWDFAz7OjTyrI^$eI z4*;V8oB`lYi)Q@4fITA6i%N}Tq!I3smRq)qI`>!kEisYa=g-S$;wv@>3PsVy99JtA<5vig{L5vY`zdc zxi;F*sF&>p&TTy`=wQ(-Kb!!g%vd*$t1e0421VnQwIrcx0KOL2)-M?s1a202!Xh$xk=oi1x zf_|JbA&mEN%yFLUG5Zhep~6ZW)4Yfuq5X?1_=7Lh~q<5ZyLH}SV*9!iQ_d1_5WGn zPW7DA9jDjWvImOu&EmMPs=GC;ktl(70&tQze=wr1i`YctLV&T3)BA4q6|NS?x_4P0 z)<~2z_Qs*ngv2?jHZmuteHBv~R66;DLGhaxW2Rgo9I#C>( zp5+yBK1v)17CS4V1S(@jjIH(gWa!Qma?CgXb&#WU_M|gFfJNfijIAe&^T(nZiV~%24;6#nb2nG~KS|Wssg6jf@-!aHcrk zN2h>Ll;Vk3$!K+u_OWV=yk7K%^~x4t1id$^u_%Gc^f8s1aYWPIloK6MxI$cO;YwD3 zk0=L%Tg!RSg~HTyAjIL>b$m>jE?o-_)+<9dsq6PE*VwKh?Zm=V^)Nk+sRYbaZYiA{ zqPaV#Cjou0D@)O_ivQO|v=s}ZRD+Y!{eP+87KaV=3krBwELPXcwncYRj#u-_Z7>H& zC$zg9qU#eDXFJ)Qj#1a|N$SDNM5C)?)OQJk6;q1w+D{WBIj@(r$vjIP$m`%*EA70A zK&OzgIa9le84l_IL%A#_>AFPKnW?Vdk|Y7gsKzTPQN>e&ZWosQ2GV>g`MFRz>J8^S zGq`RHBX3W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W_o{^S( z2|ecvVOdDL$?7CCcx45@+EQik0#26w4N#F0a9Idc zZ^nLo2G7(8%WDgIs6UwlO{pM@F82ioQsk^v=f&=Y=Gxw)p~ym@CerL&Cg;xsCROTJ z)pO?*k#^vrG@`%KLRMqwFPX%6M8oC4=ehU*ESiHjT2S8$9>Fa@MFcelsBie~sG})F4{94cApFW2V_TVm5bsvY`X_l#v@8n08K1 zdMqEo1WC1?@1WRnw<pMc&^;-p4{Q)0Xwzp>Shz??_ERYxTu!PP>sjUmy2|QnvZ1 z=bk4MxC2oh=EF*W`MOpB__i9BjG|-qa0%N9(bP4&M44&cZ!DI!Z~*u>RGKyPIvF6I P00000NkvXXu0mjfWD5>` literal 0 HcmV?d00001 diff --git a/assets/images/medical/bmi_health_calculator.png b/assets/images/medical/bmi_health_calculator.png new file mode 100644 index 0000000000000000000000000000000000000000..2eb494408ac68ae525b49b1bfa56bde5aafb376b GIT binary patch literal 2209 zcmV;S2wwMzP)7000PRNkl zX>3(R6vzLRDwG1Ph_WeEL5YF}P_Z9Six`o(A!^hRMfsv8H6X?iBjCaZjSDs!_aG*a zh=c@jiAW+s+&~3E0^$lNQZ{8(inM*^;JIWv%-nnC&b^Pm_WqJdU+;46%y~0sX3m_s zuMLi+9e_aq`U2<-puORmmcTv$n*n?V;E=66T>#Vo*b5-niV`X3F|G_vI0L|MtxOqu z`W!$fQc4?6UjV2CPzPWlfQ9_Ir9-A+47ZRI04(7DF-+0e9i)_A$^oktZsFvV;teTkrAi2+EK`bsVgMzM_gqNE2taoLZS#`Lc+>-^ z1@H-gRW1^WO@kH-JpjxGFygosGd>>yxD&uOi3Dl$=?dV>0#yhxl6#mgl8dEEc?Liq z0Mh}Ss0{iFAyG?s8bCh)Pf4}-jxuneiJ(pychxzrF@;Ds&Oeo-qapuQiVikOYRUkv z9bn^Chy>#=D#v+I`7ag}@KnJyG?6-4J4Un5zapMp%CmAQ?K$mHuJ6Jwj)1xdgW4_X zSxJmjUgv^s)Y6{-wsSi!)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nP2w5zM`i;UQ>K=Dz^8jpJe=EyD!WpdIl zEYF&c0jW}UdORbDz&_ydF8%|`XK~<-fv|U39!07Y3OWBUMkX4R*OJk!`S}+H1xr4y846x>DvN`Y2I;v4z4hrO}Tqh2HGd%ds9x0^h_? z4x1tc)p7eP)K@pVP|Uvr(2o7jRUGDel))bE!a`5$RC}s>u}E{|+_{P^d`talEP`4D j`DUo2A!pbBEd#)RN<(b-`aAnp00000NkvXXu0mjfec~A1 literal 0 HcmV?d00001 diff --git a/assets/images/medical/body_fat.png b/assets/images/medical/body_fat.png new file mode 100644 index 0000000000000000000000000000000000000000..3dd3615078a66ed8457e11edda369a7b682b952f GIT binary patch literal 4309 zcmV;`5GwD9P)d(cru)2p-T!s>UAv45 z58oxCBZz1pBHD$Bwj`p>iKvl?{!2u2h-f?!jU}QF9KCNxL_>+FKN0mNq6Q+WBcc^V zw3LYE646^k^fJR?o_R144IrXDiKr7eRuj<|L^KZ^&lAz~0vyLy!QMpl6cIHOQBGN2 zC8A+O6#e*m5z)OwwA_Q^bt3vH5tW0ZI}zPUL|=Juyh}u<5K-mEJ_$AWQp{uwB%+;& zs5YUV`LZ7O7@(wLzPwRHv@Qk53?jOXh}NXwn1>Z&qk;Lg?@L6tqw}s8Gt1i@n9M;$ zv?S$(6--OHp~y=IUJ|WF}cHhxw)cD~}U4k%&4gJ8dT9u>_9y z@Fi$ag_CTY<6|P)UCCj7MArtqtC0gAfC3<|xLMgD^XoeY+K75+6ZRmY^Re6|wV4V{ zh7ZhujU=K;_%+``MC}6x;6x(&Cp0B@K?~!Ht5W<}&GOqL9}{Ot*9s5+2+NLyWfNfRg5LzYnVvh%V6-#esC!IYXsYuu-~Rd1r*}D z;LtEGu)p8I%5@15Z70;71G#vu??WnK_;dXtLiVzq9SUaiMQ;|s7hxw1WSsXwn2JKt z12(fb@BJ{AhQPe%t%@&hLp|0QATwnJi`3Fm(~JbM&h1pyF7UOJ$=_U=@C-55U^@SPm{xyO3f{eYc#xrBy zJE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y4%!o?FT4a$}}Y;FGn$=s}P#&dkS^pxC|yvbL~j6qb`;U zGO1*GY3`tyOPOz3k%L2(MpNR21|c{=DpLbH)ee4$ zS0flix@|BCn?c`qH6l|&6w>vMfqw(CZ4zfMWH937yr`U&&^|L5Y5gf>N8;s0&%0xG zgBIQ9dCgNa=!VR0HpfiGMSC_HAU<&Kwh9`Tu`s19_86DRDf~0NPzV3{+o9BaPubB~ ziW`|TOOSw6THb~x{BW`?Uu2*fOpT{JzPb^x{%!#cOFu+W zN*Wn^X*vgcMje*0-q4XwS8_~8(&yf2zXh}>r{k;6*JR~zz$=IxEn5qId!_RKvK+~( z3kE|K$k{Rq3L<>2 ze+)$r_-}-yt+la0a&S@L!;~RZ1pmYlRw!^SJji-NZ`cMC`56KTCkEam@~xv1-my}s zZ&H~6qhUD&IOQ-*K4d8&Sn*TFk0ooSTfSX!=uFAfo>Po6|s>E?^_b00000NkvXXu0mjf Do~aw3 literal 0 HcmV?d00001 diff --git a/assets/images/medical/body_weight.png b/assets/images/medical/body_weight.png new file mode 100644 index 0000000000000000000000000000000000000000..d1f0b324620bff4bbefccdd4589626e1f2414cc0 GIT binary patch literal 2775 zcmd6p`yfc#=du+IrP!sJTrxRWWhc~Og+wmNL8B#? z$u+CfWiBI^IgDy@StK#HMDyLB@%`cbe*f_N@_v4KUQddrJ4Q`KR|Nn7HLR0^m;6S^ zCv20Fe6O`(@&Q1l0PA4qL(lu3ulCgEt>*iU=3B|z!#{$3_jd9B@lxG(S%q|fkI8!c zca;LifOB-9Hg#bCQZa|>dO6qFT$lXZnR4N`GZBHKR`?=(pOc;oZ|wHG6jYkR1ge`( zYHAjtCeH1e{P<#KxFsg$^P$#pI8E{?9~C2uInk9fURpeBw64%8xtb>rVOGJVkcieei;8}tAi6wb>kw5SBp!MtKoE_W$Y7!1o| z*#n)Ra3rJHp8x?>Z{|@&xwcE=J!CB}XsiN*0vZ7ad1m>?0D}ra77Xcm!;>b9%5&zx zdoT<5gJY~bja+7?}X$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PvHFB5k+DB2c0!qX(=? z_&w^bDgc!;7X&DhN54jyuyQ^^_aq-RD@cHaVx^@Gl3g%Et%y$bxw(llPPI*5VG&!R zVEedsTIEO_;oBY{Y;K6cIPuAtwp`l!j1YC^0)txw6>Z<5$&>8JhPrUW3|PvqwBzbfzTNh=iHW;TBGsGG_hgtiZeCFG2KAu13 rUK5~|7>eeu!Pa-{800000NkvXXu0mjf#~?xR literal 0 HcmV?d00001 diff --git a/assets/images/medical/carb_protein.png b/assets/images/medical/carb_protein.png new file mode 100644 index 0000000000000000000000000000000000000000..eb6c664047e682238647df697e0d995fd5294135 GIT binary patch literal 3732 zcmV;F4r}p=P)7%9zh#91rX=F-ZZEBQQS|A#U zrG|zfN|Axd1D2N{4MJeKE-Wnf?K$xNdi*>y|CyOH^Pm6nKF>V6Gyj~+%s1yd-}!E* z1^h;50EYuO7(fGn$O^ z(7N1ToX_|ufHxx$RX_d-;K*`+fj*);fb{`HYXtCD08apT0l>C^`~C-@Q@OuLpHK_n z4FjS60pJV(Ek$1s0B`|-*9~P}0E-!~4*=L9 z2s1uHU)54=iYVVu5vKOR)jC$yb0UBf0PJsBrayqQwDUy(dIQ)QpLpzl(6TS}Kn z*w~34JVzW1P59g|B#;kMLlrB&1Hdr}8%e@S3yG$LZTIm}F{0+!HUQQNp+S9xj{?{p zQugb@bk<9(AKL*K0iYw#{{vtGfX$*FHPVLzILN{C$<7xj>Gm5IeNn4~(~9ZAZ01-g?cEMwCRy(U z?fMr0tf2o;^D5tq!vhT$z zGwg*8D-OaQ61FHT92QVovti!%(h^As3$oo4$&wo~>$O`bb?R*ZPNo}dNx+3sc_ZCZ zMg!9-XbiRZzkki7;Ob*&7>7%(|#XA`8e>s59g#-aNF;~PShw(vape>!lWp>px znZaY|<{KRai^;VJmgmUHCT$eHkGUhMr6#B#HV2 zLsaF`F%j~GQOXRZ!wrpH$h;2uLM|u)um*?x_D6AkS&WbVMSh$)C_(C6anCJe$Em{?!Y;@_aS^tRd0co> zC_>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M6N<$g4U|Q?*IS* literal 0 HcmV?d00001 diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 6854cb27..b3387b34 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_converter.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/parking_page.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; @@ -216,7 +217,9 @@ class _AllHabibMedicalServiceState extends State { ServicesContainer( onTap: () => Navigator.push( context, - FadePage(), + FadePage( + page: (HealthCalculators()), + ), ), imageLocation: 'assets/images/new-design/health_calculator_icon.png', 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..62729222 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart @@ -0,0 +1,521 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.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/services.dart'; +import 'dart:math'; + +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..05d3d07a --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart @@ -0,0 +1,721 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.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 'dart:math'; + +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: 335.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: 335.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: 335.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..4a939b3f --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart @@ -0,0 +1,1003 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.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 'dart:math'; + +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: [ + Container( + width: 335.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: [ + Container( + width: 335.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: [ + Container( + width: 335.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: [ + Container( + width: 335.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..ac1aacc3 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart @@ -0,0 +1,676 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.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'; + +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: 335.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: 335.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: 335.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..32ec9262 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart @@ -0,0 +1,367 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.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 'dart:math'; + +import 'package:flutter/services.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: 335.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/ideal_body/ideal_body.dart b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart new file mode 100644 index 00000000..f534416f --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart @@ -0,0 +1,550 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.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 'dart:math'; + +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; + 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: [ + Container( + width: 335.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: [ + Container( + width: 335.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_converter/blood_cholesterol.dart b/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart index 7a48cf9b..9a2f08df 100644 --- a/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart +++ b/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart @@ -96,7 +96,7 @@ class _BloodCholesterolState extends State { children: [ Texts( 'Convert from', - ) + ), ], ), ), diff --git a/lib/pages/AlHabibMedicalService/​ health_calculators.dart b/lib/pages/AlHabibMedicalService/​ health_calculators.dart new file mode 100644 index 00000000..56fb0428 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/​ health_calculators.dart @@ -0,0 +1,279 @@ +import 'file:///C:/Users/admin/AndroidStudioProjects/diplomatic-quarter/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/diplomatic-quarter/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.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/bmr_calculator/bmr_calculator.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: BloodSugar()), + // ); + }, + child: MedicalProfileItem( + title: 'Ovulation', + imagePath: 'ovulation_period_icon.png', + subTitle: 'Period', + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + // Navigator.push( + // context, + // FadePage( + // page: BloodCholesterol(), + // ), + // ); + }, + child: MedicalProfileItem( + title: 'Delivery', + imagePath: 'delivery_date_icon.png', + subTitle: 'Due Date', + ), + ), + ), + ], + ), + ], + ), + ), + ], + ), + ) + ], + ), + ), + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index 9b9588fd..ff2c0a00 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -110,6 +110,9 @@ dependencies: #Popup_window popup_box: ^0.1.0 + #Numbers + number_inc_dec: ^0.6.6 + From 84f429e559dddd4f2c18d7c1c88ec7ce37344683 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 7 Oct 2020 12:50:08 +0300 Subject: [PATCH 34/36] merge --- .../all_habib_medical_service_page.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 5cd92898..bc30626e 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -220,7 +220,7 @@ class _AllHabibMedicalServiceState extends State { ServicesContainer( onTap: () => Navigator.push( context, - FadePage(page:BloodDonationPage()), + FadePage(page: BloodDonationPage()), ), imageLocation: 'assets/images/new-design/blood_icon.png', title: 'Blood Donation', @@ -288,7 +288,8 @@ class _AllHabibMedicalServiceState extends State { Navigator.of(context).push(MaterialPageRoute( builder: (BuildContext context) => MyWebView( title: "HMG News", - selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + selectedUrl: + "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", ))); }, imageLocation: From 24795e808f5ef4bc1da8924f904bc4666416c409 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Wed, 7 Oct 2020 12:56:42 +0300 Subject: [PATCH 35/36] child Vaccines --- .../dialogs/SelectGenderDialog.dart | 85 ++++++++----------- .../ChildVaccines/vaccinationtable_page.dart | 13 ++- 2 files changed, 47 insertions(+), 51 deletions(-) diff --git a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart index 295c6dcd..5eb461c6 100644 --- a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart +++ b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart @@ -5,20 +5,11 @@ 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); + _SelectGenderDialogState createState() => _SelectGenderDialogState(); } class _SelectGenderDialogState extends State { - _SelectGenderDialogState(this.beneficiaryType); - Gender beneficiaryType; - @override Widget build(BuildContext context) { return SimpleDialog( @@ -34,21 +25,12 @@ class _SelectGenderDialogState extends State { child: InkWell( onTap: () { setState(() { - beneficiaryType = Gender.Male; + //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; - }); - }, - ), + title: Text("Send the child's schedule to the email\n Tamer.dasdasdas@gmail.com "), + ), ), ) @@ -57,33 +39,33 @@ class _SelectGenderDialogState extends State { 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; - }); - }, - ), - ), - ), - ) - ], - ), + // 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, ), @@ -121,7 +103,7 @@ class _SelectGenderDialogState extends State { flex: 1, child: InkWell( onTap: () { - widget.onValueSelected(beneficiaryType); + // widget.onValueSelected(beneficiaryType); Navigator.pop(context); }, child: Padding( @@ -143,4 +125,7 @@ class _SelectGenderDialogState extends State { ], ); } + + + } diff --git a/lib/pages/ChildVaccines/vaccinationtable_page.dart b/lib/pages/ChildVaccines/vaccinationtable_page.dart index 952cfb0c..6ac11e4f 100644 --- a/lib/pages/ChildVaccines/vaccinationtable_page.dart +++ b/lib/pages/ChildVaccines/vaccinationtable_page.dart @@ -9,6 +9,8 @@ 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) { @@ -142,7 +144,16 @@ class VaccinationTablePage extends StatelessWidget { color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), label: "Send Email ", // - onTap: () {} + onTap: () { + //SelectGenderDialog(); +//=============== + showDialog( + context: context, + child: SelectGenderDialog( + ), + ); + //========= + } ), From cb2a78e2ee721f07974fb91065ae400db1ed750e Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Wed, 7 Oct 2020 16:17:16 +0300 Subject: [PATCH 36/36] child Vaccines --- .../get_vacainations_itemsmodel.dart | 18 +++++++++ .../get_vaccinations_item_services.dart | 38 +++++++++++++++++++ .../ChildVaccines/add_newchild_page.dart | 18 +-------- lib/pages/ChildVaccines/child_page.dart | 6 --- .../dialogs/SelectGenderDialog.dart | 28 +------------- 5 files changed, 58 insertions(+), 50 deletions(-) create mode 100644 lib/core/model/childvaccines/get_vacainations_itemsmodel.dart create mode 100644 lib/core/service/childvaccines/get_vaccinations_item_services.dart 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/service/childvaccines/get_vaccinations_item_services.dart b/lib/core/service/childvaccines/get_vaccinations_item_services.dart new file mode 100644 index 00000000..f7fe4662 --- /dev/null +++ b/lib/core/service/childvaccines/get_vaccinations_item_services.dart @@ -0,0 +1,38 @@ +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 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) { + 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/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart index a24fa5a4..f2970cad 100644 --- a/lib/pages/ChildVaccines/add_newchild_page.dart +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -274,19 +274,7 @@ class _AddNewChildPageState extends State { model.getNewBabyOrders(newChild: newChild); - //DateTime.now();//DateUtil.convertStringToDate(getStartDay()); - // addvancedModel.alertBy = 2; - // addvancedModel.alertBy = addvancedModel.babyID; - // addvancedModel.genderDescription = - // checkedValue == 1 ? "Male" : "Female"; - // addvancedModel.patientID = addvancedModel.patientID; - // addvancedModel.userID = addvancedModel.userID; - // // advanceModel.fileNumber = _fileTextController.text; - // // advanceModel.hospitalsModel = _selectedHospital; - // // advanceModel.note = _notesTextController.text; - // // advanceModel.email = email ?? model.user.emailAddress; - // // advanceModel.amount = amount; - // // bloodDetails.city=_selectedHospital.toString(); + AppToast.showSuccessToast(message: "Record Added"); //============ Navigator.push( @@ -294,10 +282,6 @@ class _AddNewChildPageState extends State { FadePage( page: ChildPage(), - //ChildPage(babyInformationModelList:model.BabyInformationModelList) - // HospitalsPage( - // findusHospitalModelList: model.FindusHospitalModelList, - // ) ), ); //============== diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart index c657b3ca..6a937aad 100644 --- a/lib/pages/ChildVaccines/child_page.dart +++ b/lib/pages/ChildVaccines/child_page.dart @@ -12,9 +12,7 @@ import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; class ChildPage extends StatefulWidget { -//final List babyInformationModelList; - // ChildPage({Key key, this.babyInformationModelList}) ; @override _ChildPageState createState() => _ChildPageState(); @@ -139,10 +137,6 @@ class _ChildPageState extends State with SingleTickerProviderStateMix FadePage( page: AddNewChildPage(), - //ChildPage(babyInformationModelList:model.BabyInformationModelList) - // HospitalsPage( - // findusHospitalModelList: model.FindusHospitalModelList, - // ) ), ), diff --git a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart index 5eb461c6..f84dea29 100644 --- a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart +++ b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart @@ -39,33 +39,7 @@ class _SelectGenderDialogState extends State { 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, ),