From 9a2cbf394bf6a30133b4b4a592ee8c5305b98f2e Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 15 Sep 2020 15:19:42 +0300 Subject: [PATCH 01/33] add images for my trackers --- assets/tracker/blood-pressure.png | Bin 0 -> 2894 bytes assets/tracker/blood-suger.png | Bin 0 -> 2646 bytes assets/tracker/devices.png | Bin 0 -> 2751 bytes assets/tracker/weight.png | Bin 0 -> 3084 bytes pubspec.yaml | 1 + 5 files changed, 1 insertion(+) create mode 100644 assets/tracker/blood-pressure.png create mode 100644 assets/tracker/blood-suger.png create mode 100644 assets/tracker/devices.png create mode 100644 assets/tracker/weight.png diff --git a/assets/tracker/blood-pressure.png b/assets/tracker/blood-pressure.png new file mode 100644 index 0000000000000000000000000000000000000000..7aca3763c550a53fce91669be1a4029716b5f5dc GIT binary patch literal 2894 zcmV-U3$gTxP)Px=2uVaiRCodHU0ZA%R~bHM*14HLOj8kPRIv|j)7H0jQ(CVhh|BG*O&TGEBBZzh zgj#WNUwC!%gai_;gaj1`*%3wU1CSv4Qi;+;Bwn{s@LueYl%P7Q8(AoAT`qR)c<1o_ zyK{DD$1`VVJUi>1<&3mGXa4j5|C#fBbFOn{%$Pnj0vZ90fJQ(gpb^jrXaqC@8Uc-f zMnEH=5ojF*xSvbu?(W{n6T6NZ2D{CVz8@VS*fJO9CC1E|eE!Y1?KVCAgGUW++-H~B z;JJ(63jTK${V$8ypWqbuF{EH znkON2mkQ43n_VDLG{00RO#O-S?MlC0+W9(pFjVXW?yGi`59i0i;O?wl@_I( z8+;;}9Nu2agR@`M&5IWg)zyiSf+r!UI>}8b2j_ct?ppl{8CMqqCotakmi7>NYodTxFhwY-WK3XLnWd7yO+{+${pe+{A9Op1$-q z`cgxpH#PVJxAaz!wIm@JVt=Fxj`*+|4;M2yd$Qy~@NyW=T_n~mN=SgRVi@LE8_ip( zyqMo4{Ms~IFaCu1M64$@I1JUjq>lN^?wCn z=lnKQt5^H_)6-^g?a<831$93q4Vw_Q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I?QW>Ks52^xN8v{anh|vMQCy7c!ar1g5!v z6;3w;yq3vq+`?^3=55-y@e15eAR_h}6jlbV$GX}d0-Eo5k#ay>iz=03Wn^Ss`n-XD z{Lu@$A(oYvM-vu5QkT|_SiE4Bs^m|1lzf*LjV@RVBd-m*j7gynp#A=^K z4>8wB3(CW*v95GnB%HkX`aVVop-0trA{oub&QS~%7j;=1Rc7XT|m@Q5H6J_o%R`R;6 zGc&DNb-T&j^)aNI#_QO&0Yo!Y3?K#&%{-u)IwnF4AewnVGj&Xa7(g`hfM)8L2r+RggN|WNyjdJ6@CZTw#Ea-17Z*S51$j6ASJ|JGynhq07*qoM6N<$ Ef^U=P2><{9 literal 0 HcmV?d00001 diff --git a/assets/tracker/devices.png b/assets/tracker/devices.png new file mode 100644 index 0000000000000000000000000000000000000000..f00f9d95d4b07e6f3f6b53d38cf30230822ac7dc GIT binary patch literal 2751 zcmV;w3PAOVP)PxoPWf_2Pp@I;KB8f;`1}Y}CA0jI%a~ez&qRD2okf_uebu!JY z#<3CZn59upGW{vhXy&A2nNnH#7osQz`IBWyfc&FniH4dNM0=jYt}TbN=bU@*o;|yJ z_nmp}?)koN_j}*(-S_+3y&WCxm6NId26z-+$~ZgF?_u}}%!C1uxV$3qJ2rR2{V8@W zydPeGrSKwTU39`E*cwbx=~;rR|VC1I6<&qiUv&Lp%0prf@T5(soEQI`!)^r9(32{?Z|( zLo(I^8B?c>kkTO;Yk`cZQ`87?0XiXLZQYbQMRmw0v3?00+EgoKs8CTIViP|Dcfniy z(MItV$6|2Hs1`qt>Xz6FGkVjEoL`O}gTTf(3YJ4VWCWGkg>HtGRSLX~-|vd171<%$ z*#$<*@8KA@2ihgR89k$_@(1}nB$`%qhiL1!;CZ+WrotW24spBwR5%)*hF^o-*)Gx_ z9HPPB4Xpkx#}C1+!S6H=CsUb(a#C=zDopU0_d)$AY}hYqP@Qv~G8=A!k#))?ofUoP zFXQH8z+LYPgNma0xp&AkjBf4<3iKL4`(foGc{6NOuN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V9v2{DZhGpMcntsBaWK_VZ76jmzqa;JTs+4H2r)D} zJ@ph^*OU1AC@gsM2dpk<@F|tv`T0M-9+$MS0zypTh57H{j^txN^&sNicp>>NEDK}#mdJXiO8jL#UW(+gIl~u# z#)EWj8s9H@9TssJ@5_(lo4mi}wwKmVHIQl`)j+C&R0F97QVpaUNHvgZAk{#sfm8!p a4g3#mdWdMp4E6Z{0000 Date: Sun, 20 Sep 2020 17:51:38 +0300 Subject: [PATCH 02/33] 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 c01e6095f2785f2658edeeb1dedab1e3507595cc Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 21 Sep 2020 12:02:15 +0300 Subject: [PATCH 03/33] done my trackers --- lib/config/config.dart | 18 +- .../blood_pressur/BloodPressureResult.dart | 90 +++++ .../MonthBloodPressureResultAverage.dart | 76 ++++ .../WeekBloodPressureResultAverage.dart | 30 ++ .../YearBloodPressureResultAverage.dart | 41 +++ .../blood_sugar/DiabtecPatientResult.dart | 98 +++++ .../MonthDiabtectResultAverage.dart | 36 ++ .../WeekDiabtectResultAverage.dart | 20 + .../blood_sugar/YearDiabtecResultAverage.dart | 36 ++ .../my_trakers/chartData/WeekChartDate.dart | 6 + .../chartData/YearMonthlyChartDate.dart | 6 + .../MonthWeightMeasurementResultAverage.dart | 36 ++ .../WeekWeightMeasurementResultAverage.dart | 21 ++ .../weight/WeightMeasurementResult.dart | 74 ++++ .../YearWeightMeasurementResultAverage.dart | 33 ++ .../service/medical/BloodPressureService.dart | 100 +++++ .../service/medical/BloodSugarService.dart | 96 +++++ .../medical/WeightPressureService.dart | 104 ++++++ lib/core/viewModels/base_view_model.dart | 8 + .../medical/blood_pressure_view_model.dart | 151 ++++++++ .../medical/blood_sugar_view_model.dart | 119 ++++++ .../medical/weight_pressure_view_model.dart | 113 ++++++ lib/core/viewModels/project_view_model.dart | 4 + lib/locator.dart | 14 +- lib/pages/base/base_view.dart | 5 +- .../dialogs/SelectPatientFamilyDialog.dart | 2 - lib/pages/medical/medical_profile_page.dart | 9 +- .../my_trackers/Weight/AddWeightPage.dart | 204 +++++++++++ .../my_trackers/Weight/WeightHomePage.dart | 151 ++++++++ .../my_trackers/Weight/WeightMonthlyPage.dart | 155 ++++++++ .../my_trackers/Weight/WeightWeeklyPage.dart | 170 +++++++++ .../my_trackers/Weight/WeightYeaPage.dart | 153 ++++++++ .../blood_pressure/AddBloodPressurePage.dart | 215 +++++++++++ .../blood_pressure/BloodPressureHomePage.dart | 154 ++++++++ .../blood_pressure/BloodPressureMonthly.dart | 200 ++++++++++ .../blood_pressure/BloodPressureYeaPage.dart | 199 ++++++++++ .../bloodPressureWeeklyPage.dart | 204 +++++++++++ .../blood_suger/AddBloodSugarPage.dart | 344 ++++++++++++++++++ .../my_trackers/blood_suger/BloodMonthly.dart | 188 ++++++++++ .../my_trackers/blood_suger/BloodYeaPage.dart | 199 ++++++++++ .../blood_suger/blood_sugar_home_page.dart | 145 ++++++++ .../blood_suger/blood_sugar_weekly_page.dart | 204 +++++++++++ .../medical/my_trackers/my_trackers.dart | 114 ++++++ lib/uitl/date_uitl.dart | 61 +++- lib/widgets/dialogs/RadioStringDialog.dart | 150 ++++++++ pubspec.yaml | 4 +- 46 files changed, 4537 insertions(+), 23 deletions(-) create mode 100644 lib/core/model/my_trakers/blood_pressur/BloodPressureResult.dart create mode 100644 lib/core/model/my_trakers/blood_pressur/MonthBloodPressureResultAverage.dart create mode 100644 lib/core/model/my_trakers/blood_pressur/WeekBloodPressureResultAverage.dart create mode 100644 lib/core/model/my_trakers/blood_pressur/YearBloodPressureResultAverage.dart create mode 100644 lib/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart create mode 100644 lib/core/model/my_trakers/blood_sugar/MonthDiabtectResultAverage.dart create mode 100644 lib/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart create mode 100644 lib/core/model/my_trakers/blood_sugar/YearDiabtecResultAverage.dart create mode 100644 lib/core/model/my_trakers/chartData/WeekChartDate.dart create mode 100644 lib/core/model/my_trakers/chartData/YearMonthlyChartDate.dart create mode 100644 lib/core/model/my_trakers/weight/MonthWeightMeasurementResultAverage.dart create mode 100644 lib/core/model/my_trakers/weight/WeekWeightMeasurementResultAverage.dart create mode 100644 lib/core/model/my_trakers/weight/WeightMeasurementResult.dart create mode 100644 lib/core/model/my_trakers/weight/YearWeightMeasurementResultAverage.dart create mode 100644 lib/core/service/medical/BloodPressureService.dart create mode 100644 lib/core/service/medical/BloodSugarService.dart create mode 100644 lib/core/service/medical/WeightPressureService.dart create mode 100644 lib/core/viewModels/medical/blood_pressure_view_model.dart create mode 100644 lib/core/viewModels/medical/blood_sugar_view_model.dart create mode 100644 lib/core/viewModels/medical/weight_pressure_view_model.dart create mode 100644 lib/pages/medical/my_trackers/Weight/AddWeightPage.dart create mode 100644 lib/pages/medical/my_trackers/Weight/WeightHomePage.dart create mode 100644 lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart create mode 100644 lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart create mode 100644 lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart create mode 100644 lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart create mode 100644 lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart create mode 100644 lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart create mode 100644 lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart create mode 100644 lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart create mode 100644 lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart create mode 100644 lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart create mode 100644 lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart create mode 100644 lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart create mode 100644 lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart create mode 100644 lib/pages/medical/my_trackers/my_trackers.dart create mode 100644 lib/widgets/dialogs/RadioStringDialog.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 9b910e66..ca902b45 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -169,7 +169,7 @@ const CHANNEL = 3; const GENERAL_ID = 'Cs2020@2016\$2958'; const IP_ADDRESS = '10.20.10.20'; const VERSION_ID = 5.6; -const SETUP_ID = '91877'; +const SETUP_ID = '91877'; const LANGUAGE = 2; const PATIENT_OUT_SA = 0; const SESSION_ID = 'TMRhVmkGhOsvamErw'; @@ -203,6 +203,22 @@ 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'; +///My Trackers +const GET_DIABETIC_RESULT_AVERAGE='Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; +const GET_DIABTEC_RESULT='Services/Patients.svc/REST/Patient_GetDiabtecResults'; +const ADD_DIABTEC_RESULT='Services/Patients.svc/REST/Patient_AddDiabtecResult'; + + +const GET_BLOOD_PRESSURE_RESULT_AVERAGE='Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; +const GET_BLOOD_PRESSURE_RESULT='Services/Patients.svc/REST/Patient_GetBloodPressureResult'; +const ADD_BLOOD_PRESSURE_RESULT='Services/Patients.svc/REST/Patient_AddBloodPressureResult'; + +const GET_WEIGHT_PRESSURE_RESULT_AVERAGE='Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; +const GET_WEIGHT_PRESSURE_RESULT='Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; +const ADD_WEIGHT_PRESSURE_RESULT='Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; + + + const TIMER_MIN = 10; class AppGlobal { diff --git a/lib/core/model/my_trakers/blood_pressur/BloodPressureResult.dart b/lib/core/model/my_trakers/blood_pressur/BloodPressureResult.dart new file mode 100644 index 00000000..57f2cd54 --- /dev/null +++ b/lib/core/model/my_trakers/blood_pressur/BloodPressureResult.dart @@ -0,0 +1,90 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class BloodPressureResult { + int patientID; + int lineItemNo; + DateTime bloodPressureDate; + int measuredArm; + int systolicePressure; + int diastolicPressure; + dynamic remark; + bool isActive; + int chartYear; + String chartMonth; + dynamic yearSystolicePressureAverageResult; + dynamic monthSystolicePressureResult; + dynamic weekSystolicePressureResult; + int yearDiastolicPressureAverageResult; + dynamic monthDiastolicPressureResult; + dynamic weekDiastolicPressureResult; + String measuredArmDesc; + dynamic weekDesc; + + BloodPressureResult( + {this.patientID, + this.lineItemNo, + this.bloodPressureDate, + this.measuredArm, + this.systolicePressure, + this.diastolicPressure, + this.remark, + this.isActive, + this.chartYear, + this.chartMonth, + this.yearSystolicePressureAverageResult, + this.monthSystolicePressureResult, + this.weekSystolicePressureResult, + this.yearDiastolicPressureAverageResult, + this.monthDiastolicPressureResult, + this.weekDiastolicPressureResult, + this.measuredArmDesc, + this.weekDesc}); + + BloodPressureResult.fromJson(Map json) { + patientID = json['PatientID']; + lineItemNo = json['LineItemNo']; + bloodPressureDate =DateUtil.convertStringToDate(json['BloodPressureDate']); + measuredArm = json['MeasuredArm']; + systolicePressure = json['SystolicePressure']; + diastolicPressure = json['DiastolicPressure']; + remark = json['Remark']; + isActive = json['IsActive']; + chartYear = json['ChartYear']; + chartMonth = json['ChartMonth']; + yearSystolicePressureAverageResult = + json['YearSystolicePressureAverageResult']; + monthSystolicePressureResult = json['MonthSystolicePressureResult']; + weekSystolicePressureResult = json['WeekSystolicePressureResult']; + yearDiastolicPressureAverageResult = + json['YearDiastolicPressureAverageResult']; + monthDiastolicPressureResult = json['MonthDiastolicPressureResult']; + weekDiastolicPressureResult = json['WeekDiastolicPressureResult']; + measuredArmDesc = json['MeasuredArmDesc']; + weekDesc = json['WeekDesc']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['LineItemNo'] = this.lineItemNo; + data['BloodPressureDate'] = this.bloodPressureDate; + data['MeasuredArm'] = this.measuredArm; + data['SystolicePressure'] = this.systolicePressure; + data['DiastolicPressure'] = this.diastolicPressure; + data['Remark'] = this.remark; + data['IsActive'] = this.isActive; + data['ChartYear'] = this.chartYear; + data['ChartMonth'] = this.chartMonth; + data['YearSystolicePressureAverageResult'] = + this.yearSystolicePressureAverageResult; + data['MonthSystolicePressureResult'] = this.monthSystolicePressureResult; + data['WeekSystolicePressureResult'] = this.weekSystolicePressureResult; + data['YearDiastolicPressureAverageResult'] = + this.yearDiastolicPressureAverageResult; + data['MonthDiastolicPressureResult'] = this.monthDiastolicPressureResult; + data['WeekDiastolicPressureResult'] = this.weekDiastolicPressureResult; + data['MeasuredArmDesc'] = this.measuredArmDesc; + data['WeekDesc'] = this.weekDesc; + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_pressur/MonthBloodPressureResultAverage.dart b/lib/core/model/my_trakers/blood_pressur/MonthBloodPressureResultAverage.dart new file mode 100644 index 00000000..5343119c --- /dev/null +++ b/lib/core/model/my_trakers/blood_pressur/MonthBloodPressureResultAverage.dart @@ -0,0 +1,76 @@ +class MonthBloodPressureResultAverage { + dynamic weekfourSystolicePressureAverageResult; + dynamic weekfourDiastolicPressureAverageResult; + dynamic weekthreeSystolicePressureAverageResult; + dynamic weekthreeDiastolicPressureAverageResult; + dynamic weektwoSystolicePressureAverageResult; + dynamic weektwoDiastolicPressureAverageResult; + dynamic weekoneSystolicePressureAverageResult; + dynamic weekoneDiastolicPressureAverageResult; + String weekDesc; + int weekDiastolicPressureAverageResult; + int weekSystolicePressureAverageResult; + + MonthBloodPressureResultAverage( + {this.weekfourSystolicePressureAverageResult, + this.weekfourDiastolicPressureAverageResult, + this.weekthreeSystolicePressureAverageResult, + this.weekthreeDiastolicPressureAverageResult, + this.weektwoSystolicePressureAverageResult, + this.weektwoDiastolicPressureAverageResult, + this.weekoneSystolicePressureAverageResult, + this.weekoneDiastolicPressureAverageResult, + this.weekDesc, + this.weekDiastolicPressureAverageResult, + this.weekSystolicePressureAverageResult}); + + MonthBloodPressureResultAverage.fromJson(Map json) { + weekfourSystolicePressureAverageResult = + json['weekfourSystolicePressureAverageResult']; + weekfourDiastolicPressureAverageResult = + json['weekfourDiastolicPressureAverageResult']; + weekthreeSystolicePressureAverageResult = + json['weekthreeSystolicePressureAverageResult']; + weekthreeDiastolicPressureAverageResult = + json['weekthreeDiastolicPressureAverageResult']; + weektwoSystolicePressureAverageResult = + json['weektwoSystolicePressureAverageResult']; + weektwoDiastolicPressureAverageResult = + json['weektwoDiastolicPressureAverageResult']; + weekoneSystolicePressureAverageResult = + json['weekoneSystolicePressureAverageResult']; + weekoneDiastolicPressureAverageResult = + json['weekoneDiastolicPressureAverageResult']; + weekDesc = json['WeekDesc']; + weekDiastolicPressureAverageResult = + json['WeekDiastolicPressureAverageResult']; + weekSystolicePressureAverageResult = + json['WeekSystolicePressureAverageResult']; + } + + Map toJson() { + final Map data = new Map(); + data['weekfourSystolicePressureAverageResult'] = + this.weekfourSystolicePressureAverageResult; + data['weekfourDiastolicPressureAverageResult'] = + this.weekfourDiastolicPressureAverageResult; + data['weekthreeSystolicePressureAverageResult'] = + this.weekthreeSystolicePressureAverageResult; + data['weekthreeDiastolicPressureAverageResult'] = + this.weekthreeDiastolicPressureAverageResult; + data['weektwoSystolicePressureAverageResult'] = + this.weektwoSystolicePressureAverageResult; + data['weektwoDiastolicPressureAverageResult'] = + this.weektwoDiastolicPressureAverageResult; + data['weekoneSystolicePressureAverageResult'] = + this.weekoneSystolicePressureAverageResult; + data['weekoneDiastolicPressureAverageResult'] = + this.weekoneDiastolicPressureAverageResult; + data['WeekDesc'] = this.weekDesc; + data['WeekDiastolicPressureAverageResult'] = + this.weekDiastolicPressureAverageResult; + data['WeekSystolicePressureAverageResult'] = + this.weekSystolicePressureAverageResult; + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_pressur/WeekBloodPressureResultAverage.dart b/lib/core/model/my_trakers/blood_pressur/WeekBloodPressureResultAverage.dart new file mode 100644 index 00000000..b7f3fc80 --- /dev/null +++ b/lib/core/model/my_trakers/blood_pressur/WeekBloodPressureResultAverage.dart @@ -0,0 +1,30 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class WeekBloodPressureResultAverage { + int dailySystolicePressureAverageResult; + int dailyDiastolicPressureAverageResult; + DateTime bloodPressureDate; + + WeekBloodPressureResultAverage( + {this.dailySystolicePressureAverageResult, + this.dailyDiastolicPressureAverageResult, + this.bloodPressureDate}); + + WeekBloodPressureResultAverage.fromJson(Map json) { + dailySystolicePressureAverageResult = + json['DailySystolicePressureAverageResult']; + dailyDiastolicPressureAverageResult = + json['DailyDiastolicPressureAverageResult']; + bloodPressureDate = DateUtil.convertStringToDate(json['BloodPressureDate']); + } + + Map toJson() { + final Map data = new Map(); + data['DailySystolicePressureAverageResult'] = + this.dailySystolicePressureAverageResult; + data['DailyDiastolicPressureAverageResult'] = + this.dailyDiastolicPressureAverageResult; + data['BloodPressureDate'] = this.bloodPressureDate; + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_pressur/YearBloodPressureResultAverage.dart b/lib/core/model/my_trakers/blood_pressur/YearBloodPressureResultAverage.dart new file mode 100644 index 00000000..095738d6 --- /dev/null +++ b/lib/core/model/my_trakers/blood_pressur/YearBloodPressureResultAverage.dart @@ -0,0 +1,41 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class YearBloodPressureResultAverage { + int monthSystolicePressureAverageResult; + int monthDiastolicPressureAverageResult; + dynamic monthNumber; + String monthName; + String yearName; + DateTime date; + + YearBloodPressureResultAverage( + {this.monthSystolicePressureAverageResult, + this.monthDiastolicPressureAverageResult, + this.monthNumber, + this.monthName, + this.yearName}); + + YearBloodPressureResultAverage.fromJson(Map json) { + monthSystolicePressureAverageResult = + json['monthSystolicePressureAverageResult']; + monthDiastolicPressureAverageResult = + json['monthDiastolicPressureAverageResult']; + monthNumber = json['monthNumber']; + monthName = json['monthName']; + yearName = json['yearName']; + date = DateUtil.getMonthDateTime(monthName,yearName); + + } + + Map toJson() { + final Map data = new Map(); + data['monthSystolicePressureAverageResult'] = + this.monthSystolicePressureAverageResult; + data['monthDiastolicPressureAverageResult'] = + this.monthDiastolicPressureAverageResult; + data['monthNumber'] = this.monthNumber; + data['monthName'] = this.monthName; + data['yearName'] = this.yearName; + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart b/lib/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart new file mode 100644 index 00000000..5b95409e --- /dev/null +++ b/lib/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart @@ -0,0 +1,98 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class DiabtecPatientResult { + String chartMonth; + var chartYear; + DateTime dateChart; + var description; + var descriptionN; + int diabtecAvarage; + bool isActive; + int lineItemNo; + var listMonth; + var listWeek; + int measured; + String measuredDesc; + var monthAverageResult; + int patientID; + var remark; + var resultDesc; + int resultValue; + String unit; + var weekAverageResult; + String weekDesc; + var yearAverageResult; + + DiabtecPatientResult( + {this.chartMonth, + this.chartYear, + this.dateChart, + this.description, + this.descriptionN, + this.diabtecAvarage, + this.isActive, + this.lineItemNo, + this.listMonth, + this.listWeek, + this.measured, + this.measuredDesc, + this.monthAverageResult, + this.patientID, + this.remark, + this.resultDesc, + this.resultValue, + this.unit, + this.weekAverageResult, + this.weekDesc, + this.yearAverageResult}); + + DiabtecPatientResult.fromJson(Map json) { + chartMonth = json['ChartMonth']; + chartYear = json['ChartYear']; + dateChart = DateUtil.convertStringToDate(json['DateChart']); + description = json['Description']; + descriptionN = json['DescriptionN']; + diabtecAvarage = json['DiabtecAvarage']; + isActive = json['IsActive']; + lineItemNo = json['LineItemNo']; + listMonth = json['List_Month']; + listWeek = json['List_Week']; + measured = json['Measured']; + measuredDesc = json['MeasuredDesc']; + monthAverageResult = json['MonthAverageResult']; + patientID = json['PatientID']; + remark = json['Remark']; + resultDesc = json['ResultDesc']; + resultValue = json['ResultValue']; + unit = json['Unit']; + weekAverageResult = json['WeekAverageResult']; + weekDesc = json['WeekDesc']; + yearAverageResult = json['YearAverageResult']; + } + + Map toJson() { + final Map data = new Map(); + data['ChartMonth'] = this.chartMonth; + data['ChartYear'] = this.chartYear; + data['DateChart'] = DateUtil.convertDateToString(this.dateChart); + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['DiabtecAvarage'] = this.diabtecAvarage; + data['IsActive'] = this.isActive; + data['LineItemNo'] = this.lineItemNo; + data['List_Month'] = this.listMonth; + data['List_Week'] = this.listWeek; + data['Measured'] = this.measured; + data['MeasuredDesc'] = this.measuredDesc; + data['MonthAverageResult'] = this.monthAverageResult; + data['PatientID'] = this.patientID; + data['Remark'] = this.remark; + data['ResultDesc'] = this.resultDesc; + data['ResultValue'] = this.resultValue; + data['Unit'] = this.unit; + data['WeekAverageResult'] = this.weekAverageResult; + data['WeekDesc'] = this.weekDesc; + data['YearAverageResult'] = this.yearAverageResult; + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_sugar/MonthDiabtectResultAverage.dart b/lib/core/model/my_trakers/blood_sugar/MonthDiabtectResultAverage.dart new file mode 100644 index 00000000..65522098 --- /dev/null +++ b/lib/core/model/my_trakers/blood_sugar/MonthDiabtectResultAverage.dart @@ -0,0 +1,36 @@ +class MonthDiabtectResultAverage { + var weekfourAverageResult; + var weekthreeAverageResult; + var weektwoAverageResult; + var weekoneAverageResult; + dynamic weekAverageResult; + String weekDesc; + + MonthDiabtectResultAverage( + {this.weekfourAverageResult, + this.weekthreeAverageResult, + this.weektwoAverageResult, + this.weekoneAverageResult, + this.weekAverageResult, + this.weekDesc}); + + MonthDiabtectResultAverage.fromJson(Map json) { + weekfourAverageResult = json['weekfourAverageResult']; + weekthreeAverageResult = json['weekthreeAverageResult']; + weektwoAverageResult = json['weektwoAverageResult']; + weekoneAverageResult = json['weekoneAverageResult']; + weekAverageResult = json['WeekAverageResult']; + weekDesc = json['WeekDesc']; + } + + Map toJson() { + final Map data = new Map(); + data['weekfourAverageResult'] = this.weekfourAverageResult; + data['weekthreeAverageResult'] = this.weekthreeAverageResult; + data['weektwoAverageResult'] = this.weektwoAverageResult; + data['weekoneAverageResult'] = this.weekoneAverageResult; + data['WeekAverageResult'] = this.weekAverageResult; + data['WeekDesc'] = this.weekDesc; + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart b/lib/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart new file mode 100644 index 00000000..c18e5433 --- /dev/null +++ b/lib/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart @@ -0,0 +1,20 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class WeekDiabtectResultAverage { + int dailyAverageResult; + DateTime dateChart; + + WeekDiabtectResultAverage({this.dailyAverageResult, this.dateChart}); + + WeekDiabtectResultAverage.fromJson(Map json) { + dailyAverageResult = json['DailyAverageResult']; + dateChart = DateUtil.convertStringToDate(json['DateChart']); + } + + Map toJson() { + final Map data = new Map(); + data['DailyAverageResult'] = this.dailyAverageResult; + data['DateChart'] = DateUtil.convertDateToString(this.dateChart); + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_sugar/YearDiabtecResultAverage.dart b/lib/core/model/my_trakers/blood_sugar/YearDiabtecResultAverage.dart new file mode 100644 index 00000000..cfdec286 --- /dev/null +++ b/lib/core/model/my_trakers/blood_sugar/YearDiabtecResultAverage.dart @@ -0,0 +1,36 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class YearDiabtecResultAverage { + dynamic monthAverageResult; + var monthNumber; + String monthName; + String yearName; + DateTime date; + + YearDiabtecResultAverage( + {this.monthAverageResult, + this.monthNumber, + this.monthName, + this.yearName}); + + YearDiabtecResultAverage.fromJson(Map json) { + try { + monthAverageResult = json['monthAverageResult']; + monthNumber = json['monthNumber']; + monthName = json['monthName']; + yearName = json['yearName']; + date = DateUtil.getMonthDateTime(monthName,yearName); + } catch (e) { + print(e); + } + } + + Map toJson() { + final Map data = new Map(); + data['monthAverageResult'] = this.monthAverageResult; + data['monthNumber'] = this.monthNumber; + data['monthName'] = this.monthName; + data['yearName'] = this.yearName; + return data; + } +} diff --git a/lib/core/model/my_trakers/chartData/WeekChartDate.dart b/lib/core/model/my_trakers/chartData/WeekChartDate.dart new file mode 100644 index 00000000..d972265d --- /dev/null +++ b/lib/core/model/my_trakers/chartData/WeekChartDate.dart @@ -0,0 +1,6 @@ +class WeekChartDate { + final DateTime x; + final dynamic y; + + WeekChartDate({this.x, this.y}); +} \ No newline at end of file diff --git a/lib/core/model/my_trakers/chartData/YearMonthlyChartDate.dart b/lib/core/model/my_trakers/chartData/YearMonthlyChartDate.dart new file mode 100644 index 00000000..96adca21 --- /dev/null +++ b/lib/core/model/my_trakers/chartData/YearMonthlyChartDate.dart @@ -0,0 +1,6 @@ + class YearMonthlyChartDate { + final dynamic x; + final dynamic y; + + YearMonthlyChartDate({this.x, this.y}); +} diff --git a/lib/core/model/my_trakers/weight/MonthWeightMeasurementResultAverage.dart b/lib/core/model/my_trakers/weight/MonthWeightMeasurementResultAverage.dart new file mode 100644 index 00000000..8165302d --- /dev/null +++ b/lib/core/model/my_trakers/weight/MonthWeightMeasurementResultAverage.dart @@ -0,0 +1,36 @@ +class MonthWeightMeasurementResultAverage { + dynamic weekfourAverageResult; + dynamic weekthreeAverageResult; + dynamic weektwoAverageResult; + dynamic weekoneAverageResult; + dynamic weekAverageResult; + String weekDesc; + + MonthWeightMeasurementResultAverage( + {this.weekfourAverageResult, + this.weekthreeAverageResult, + this.weektwoAverageResult, + this.weekoneAverageResult, + this.weekAverageResult, + this.weekDesc}); + + MonthWeightMeasurementResultAverage.fromJson(Map json) { + weekfourAverageResult = json['weekfourAverageResult']; + weekthreeAverageResult = json['weekthreeAverageResult']; + weektwoAverageResult = json['weektwoAverageResult']; + weekoneAverageResult = json['weekoneAverageResult']; + weekAverageResult = json['WeekAverageResult']; + weekDesc = json['WeekDesc']; + } + + Map toJson() { + final Map data = new Map(); + data['weekfourAverageResult'] = this.weekfourAverageResult; + data['weekthreeAverageResult'] = this.weekthreeAverageResult; + data['weektwoAverageResult'] = this.weektwoAverageResult; + data['weekoneAverageResult'] = this.weekoneAverageResult; + data['WeekAverageResult'] = this.weekAverageResult; + data['WeekDesc'] = this.weekDesc; + return data; + } +} diff --git a/lib/core/model/my_trakers/weight/WeekWeightMeasurementResultAverage.dart b/lib/core/model/my_trakers/weight/WeekWeightMeasurementResultAverage.dart new file mode 100644 index 00000000..b7345ad7 --- /dev/null +++ b/lib/core/model/my_trakers/weight/WeekWeightMeasurementResultAverage.dart @@ -0,0 +1,21 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class WeekWeightMeasurementResultAverage { + dynamic dailyAverageResult; + DateTime weightDate; + + WeekWeightMeasurementResultAverage( + {this.dailyAverageResult, this.weightDate}); + + WeekWeightMeasurementResultAverage.fromJson(Map json) { + dailyAverageResult = json['DailyAverageResult']; + weightDate = DateUtil.convertStringToDate(json['WeightDate']); + } + + Map toJson() { + final Map data = new Map(); + data['DailyAverageResult'] = this.dailyAverageResult; + data['WeightDate'] = this.weightDate; + return data; + } +} diff --git a/lib/core/model/my_trakers/weight/WeightMeasurementResult.dart b/lib/core/model/my_trakers/weight/WeightMeasurementResult.dart new file mode 100644 index 00000000..337e8662 --- /dev/null +++ b/lib/core/model/my_trakers/weight/WeightMeasurementResult.dart @@ -0,0 +1,74 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class WeightMeasurementResult { + int patientID; + int lineItemNo; + int weightMeasured; + DateTime weightDate; + dynamic remark; + bool isActive; + int measured; + dynamic unit; + int chartYear; + dynamic chartMonth; + double yearAverageResult; + dynamic monthAverageResult; + dynamic weekAverageResult; + dynamic weekDesc; + + WeightMeasurementResult( + {this.patientID, + this.lineItemNo, + this.weightMeasured, + this.weightDate, + this.remark, + this.isActive, + this.measured, + this.unit, + this.chartYear, + this.chartMonth, + this.yearAverageResult, + this.monthAverageResult, + this.weekAverageResult, + this.weekDesc}); + + WeightMeasurementResult.fromJson(Map json) { + try { + patientID = json['PatientID']; + lineItemNo = json['LineItemNo']; + weightMeasured = json['WeightMeasured']; + weightDate = DateUtil.convertStringToDate(json['WeightDate']); + remark = json['Remark']; + isActive = json['IsActive']; + measured = json['Measured']; + unit = json['Unit']; + chartYear = json['ChartYear']; + chartMonth = json['ChartMonth']; + yearAverageResult = json['YearAverageResult']; + monthAverageResult = json['MonthAverageResult']; + weekAverageResult = json['WeekAverageResult']; + weekDesc = json['WeekDesc']; + } catch (e) { + print(e); + } + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['LineItemNo'] = this.lineItemNo; + data['WeightMeasured'] = this.weightMeasured; + data['WeightDate'] = this.weightDate; + data['Remark'] = this.remark; + data['IsActive'] = this.isActive; + data['Measured'] = this.measured; + data['Unit'] = this.unit; + data['ChartYear'] = this.chartYear; + data['ChartMonth'] = this.chartMonth; + data['YearAverageResult'] = this.yearAverageResult; + data['MonthAverageResult'] = this.monthAverageResult; + data['WeekAverageResult'] = this.weekAverageResult; + data['WeekDesc'] = this.weekDesc; + return data; + } +} diff --git a/lib/core/model/my_trakers/weight/YearWeightMeasurementResultAverage.dart b/lib/core/model/my_trakers/weight/YearWeightMeasurementResultAverage.dart new file mode 100644 index 00000000..c2e20cb9 --- /dev/null +++ b/lib/core/model/my_trakers/weight/YearWeightMeasurementResultAverage.dart @@ -0,0 +1,33 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class YearWeightMeasurementResultAverage { + dynamic monthAverageResult; + int monthNumber; + String monthName; + String yearName; + DateTime date; + + YearWeightMeasurementResultAverage( + {this.monthAverageResult, + this.monthNumber, + this.monthName, + this.yearName}); + + YearWeightMeasurementResultAverage.fromJson(Map json) { + monthAverageResult = json['monthAverageResult']; + monthNumber = json['monthNumber']; + monthName = json['monthName']; + yearName = json['yearName']; + date = DateUtil.getMonthDateTime(monthName,yearName); + + } + + Map toJson() { + final Map data = new Map(); + data['monthAverageResult'] = this.monthAverageResult; + data['monthNumber'] = this.monthNumber; + data['monthName'] = this.monthName; + data['yearName'] = this.yearName; + return data; + } +} diff --git a/lib/core/service/medical/BloodPressureService.dart b/lib/core/service/medical/BloodPressureService.dart new file mode 100644 index 00000000..048c98e9 --- /dev/null +++ b/lib/core/service/medical/BloodPressureService.dart @@ -0,0 +1,100 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/MonthBloodPressureResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/WeekBloodPressureResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/YearBloodPressureResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/MonthDiabtectResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/YearDiabtecResultAverage.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class BloodPressureService extends BaseService { + List monthDiabtectResultAverageList = List(); + List weekDiabtectResultAverageList = List(); + List yearDiabtecResultAverageList = List(); + + ///Result + List monthDiabtecPatientResult = List(); + List weekDiabtecPatientResult = List(); + List yearDiabtecPatientResult = List(); + + Future getBloodSugar() async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_BLOOD_PRESSURE_RESULT_AVERAGE, + onSuccess: (dynamic response, int statusCode) { + monthDiabtectResultAverageList.clear(); + weekDiabtectResultAverageList.clear(); + yearDiabtecResultAverageList.clear(); + response['List_MonthBloodPressureResultAverage'].forEach((item) { + monthDiabtectResultAverageList + .add(MonthBloodPressureResultAverage.fromJson(item)); + }); + + response['List_WeekBloodPressureResultAverage'].forEach((item) { + weekDiabtectResultAverageList + .add(WeekBloodPressureResultAverage.fromJson(item)); + }); + + response['List_YearBloodPressureResultAverage'].forEach((item) { + yearDiabtecResultAverageList + .add(YearBloodPressureResultAverage.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getDiabtecResults() async { + hasError = false; + await baseAppClient.post(GET_BLOOD_PRESSURE_RESULT, + onSuccess: (dynamic response, int statusCode) { + monthDiabtecPatientResult.clear(); + weekDiabtecPatientResult.clear(); + yearDiabtecPatientResult.clear(); + + response['List_WeekBloodPressureResult'].forEach((item) { + weekDiabtecPatientResult.add(BloodPressureResult.fromJson(item)); + }); + + response['List_MonthBloodPressureResult'].forEach((item) { + monthDiabtecPatientResult.add(BloodPressureResult.fromJson(item)); + }); + + response['List_YearBloodPressureResult'].forEach((item) { + yearDiabtecPatientResult.add(BloodPressureResult.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + addDiabtecResult( + {String bloodPressureDate, + String diastolicPressure, + String systolicePressure, + int measuredArm}) async { + hasError = false; + super.error = ""; + + Map body = Map(); + body['BloodPressureDate'] = bloodPressureDate; + body['DiastolicPressure'] = diastolicPressure; + body['SystolicePressure'] = systolicePressure; + body['MeasuredArm'] = measuredArm; + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(ADD_BLOOD_PRESSURE_RESULT, + onSuccess: (response, statusCode) async { + + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/medical/BloodSugarService.dart b/lib/core/service/medical/BloodSugarService.dart new file mode 100644 index 00000000..09fe9fe9 --- /dev/null +++ b/lib/core/service/medical/BloodSugarService.dart @@ -0,0 +1,96 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/MonthDiabtectResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/YearDiabtecResultAverage.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class BloodSugarService extends BaseService { + List monthDiabtectResultAverageList = List(); + List weekDiabtectResultAverageList = List(); + List yearDiabtecResultAverageList = List(); + + ///Result + List monthDiabtecPatientResult = List(); + List weekDiabtecPatientResult = List(); + List yearDiabtecPatientResult = List(); + + Future getBloodSugar() async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_DIABETIC_RESULT_AVERAGE, + onSuccess: (dynamic response, int statusCode) { + monthDiabtectResultAverageList.clear(); + weekDiabtectResultAverageList.clear(); + yearDiabtecResultAverageList.clear(); + response['List_MonthDiabtectResultAverage'].forEach((item) { + monthDiabtectResultAverageList + .add(MonthDiabtectResultAverage.fromJson(item)); + }); + + response['List_WeekDiabtectResultAverage'].forEach((item) { + weekDiabtectResultAverageList + .add(WeekDiabtectResultAverage.fromJson(item)); + }); + + response['List_YearDiabtecResultAverage'].forEach((item) { + yearDiabtecResultAverageList + .add(YearDiabtecResultAverage.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getDiabtecResults() async { + hasError = false; + await baseAppClient.post(GET_DIABTEC_RESULT, + onSuccess: (dynamic response, int statusCode) { + monthDiabtecPatientResult.clear(); + weekDiabtecPatientResult.clear(); + yearDiabtecPatientResult.clear(); + + response['List_MonthDiabtecPatientResult'].forEach((item) { + monthDiabtecPatientResult.add(DiabtecPatientResult.fromJson(item)); + }); + + response['List_WeekDiabtecPatientResult'].forEach((item) { + weekDiabtecPatientResult.add(DiabtecPatientResult.fromJson(item)); + }); + + response['List_YearDiabtecPatientResult'].forEach((item) { + yearDiabtecPatientResult.add(DiabtecPatientResult.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + addDiabtecResult( + {String bloodSugerDateChart, + String bloodSugerResult, + String diabtecUnit, + int measuredTime}) async { + hasError = false; + super.error = ""; + + Map body = Map(); + body['BloodSugerDateChart'] = bloodSugerDateChart; + body['BloodSugerResult'] = bloodSugerResult; + body['DiabtecUnit'] = diabtecUnit; + body['MeasuredTime'] =2;// measuredTime; + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(ADD_BLOOD_PRESSURE_RESULT, + onSuccess: (response, statusCode) async { + var asd =""; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/medical/WeightPressureService.dart b/lib/core/service/medical/WeightPressureService.dart new file mode 100644 index 00000000..006de821 --- /dev/null +++ b/lib/core/service/medical/WeightPressureService.dart @@ -0,0 +1,104 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/MonthBloodPressureResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/WeekBloodPressureResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/YearBloodPressureResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/MonthDiabtectResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/YearDiabtecResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/MonthWeightMeasurementResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeekWeightMeasurementResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/YearWeightMeasurementResultAverage.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class WeightService extends BaseService { + + ///Average + List monthWeightMeasurementResultAverage = List(); + List weekWeightMeasurementResultAverage = List(); + List yearWeightMeasurementResultAverage = List(); + + ///Result + List monthWeightMeasurementResult = List(); + List weekWeightMeasurementResult = List(); + List yearWeightMeasurementResult = List(); + + Future getWeightAverage() async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT_AVERAGE, + onSuccess: (dynamic response, int statusCode) { + monthWeightMeasurementResultAverage.clear(); + weekWeightMeasurementResultAverage.clear(); + yearWeightMeasurementResultAverage.clear(); + response['List_MonthWeightMeasurementResultAverage'].forEach((item) { + monthWeightMeasurementResultAverage + .add(MonthWeightMeasurementResultAverage.fromJson(item)); + }); + + response['List_WeekWeightMeasurementResultAverage'].forEach((item) { + weekWeightMeasurementResultAverage + .add(WeekWeightMeasurementResultAverage.fromJson(item)); + }); + + response['List_YearWeightMeasurementResultAverage'].forEach((item) { + yearWeightMeasurementResultAverage + .add(YearWeightMeasurementResultAverage.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getWeightMeasurementResult() async { + hasError = false; + await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT, + onSuccess: (dynamic response, int statusCode) { + monthWeightMeasurementResult.clear(); + weekWeightMeasurementResult.clear(); + yearWeightMeasurementResult.clear(); + + response['List_WeekWeightMeasurementResult'].forEach((item) { + weekWeightMeasurementResult.add(WeightMeasurementResult.fromJson(item)); + }); + + response['List_MonthWeightMeasurementResult'].forEach((item) { + monthWeightMeasurementResult.add(WeightMeasurementResult.fromJson(item)); + }); + + response['List_YearWeightMeasurementResult'].forEach((item) { + yearWeightMeasurementResult.add(WeightMeasurementResult.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + addWeightResult( + {String weightDate, + String weightMeasured, + int weightUnit}) async { + hasError = false; + super.error = ""; + + Map body = Map(); + body['WeightDate'] = weightDate; + body['WeightMeasured'] = weightMeasured; + body['weightUnit'] = weightUnit; + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(ADD_WEIGHT_PRESSURE_RESULT, + onSuccess: (response, statusCode) async { + + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/viewModels/base_view_model.dart b/lib/core/viewModels/base_view_model.dart index 74899fae..8e228512 100644 --- a/lib/core/viewModels/base_view_model.dart +++ b/lib/core/viewModels/base_view_model.dart @@ -18,6 +18,8 @@ class BaseViewModel extends ChangeNotifier { void setState(ViewState viewState) { _state = viewState; + // this.removeListener(() { }); + if(hasListeners) notifyListeners(); } @@ -34,4 +36,10 @@ class BaseViewModel extends ChangeNotifier { notifyListeners(); } + + @override + void dispose() { + removeListener(() { }); + super.dispose(); + } } diff --git a/lib/core/viewModels/medical/blood_pressure_view_model.dart b/lib/core/viewModels/medical/blood_pressure_view_model.dart new file mode 100644 index 00000000..dfff5b45 --- /dev/null +++ b/lib/core/viewModels/medical/blood_pressure_view_model.dart @@ -0,0 +1,151 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; +import 'package:diplomaticquarterapp/core/service/medical/BloodPressureService.dart'; +import 'package:diplomaticquarterapp/core/service/medical/BloodSugarService.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:charts_flutter/flutter.dart' as charts; + +import '../../../core/viewModels/base_view_model.dart'; + +class BloodPressureViewMode extends BaseViewModel { + BloodPressureService bloodPressureService = locator(); + + ///BLOOD + List _bloodDiastolicPressureWeeklyTimeSeriesSalesList = List(); + List _bloodSystolicePressureWeeklyTimeSeriesSalesList = List(); + + List _bloodDiastolicMonthlyTimeSeriesSalesList = List(); + List _bloodSystolicMonthlyTimeSeriesSalesList = List(); + + List _bloodSystoliceYearTimeSeriesSalesList = List(); + List _bloodDiastolicYearTimeSeriesSalesList = List(); + + List get monthDiabtecPatientResult => bloodPressureService.monthDiabtecPatientResult; + + List get weekDiabtecPatientResult => bloodPressureService.weekDiabtecPatientResult; + + List get yearDiabtecPatientResult => bloodPressureService.yearDiabtecPatientResult; + + Future getBloodPressure() async { + setState(ViewState.Busy); + await bloodPressureService.getBloodSugar(); + await bloodPressureService.getDiabtecResults(); + if (bloodPressureService.hasError) { + error = bloodPressureService.error; + setState(ViewState.Error); + } else { + bloodPressureService.weekDiabtectResultAverageList.forEach((element) { + _bloodDiastolicPressureWeeklyTimeSeriesSalesList.add(WeekChartDate( + x: element.bloodPressureDate, + y: element.dailyDiastolicPressureAverageResult)); + _bloodSystolicePressureWeeklyTimeSeriesSalesList.add(WeekChartDate( + x: element.bloodPressureDate, + y: element.dailySystolicePressureAverageResult)); + }); + + for (int index = 0; + index < bloodPressureService.monthDiabtectResultAverageList.length; + index++) { + _bloodDiastolicMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate( + x: index, + y: bloodPressureService.monthDiabtectResultAverageList[index] + .weekDiastolicPressureAverageResult)); + _bloodSystolicMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate( + x: index, + y: bloodPressureService.monthDiabtectResultAverageList[index] + .weekSystolicePressureAverageResult)); + } + + bloodPressureService.yearDiabtecResultAverageList.forEach((element) { + _bloodSystoliceYearTimeSeriesSalesList + .add(WeekChartDate(x: element.date, y: element.monthSystolicePressureAverageResult)); + + _bloodDiastolicYearTimeSeriesSalesList + .add(WeekChartDate(x: element.date, y: element.monthDiastolicPressureAverageResult)); + }); + + setState(ViewState.Idle); + } + } + + List> getBloodWeeklySeries() { + return [ + charts.Series( + id: 'Diastolic', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _bloodDiastolicPressureWeeklyTimeSeriesSalesList, + ), + charts.Series( + id: 'Systolice', + colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _bloodSystolicePressureWeeklyTimeSeriesSalesList, + ) + ]; + } + + List> + getBloodMonthlyTimeSeriesSales() { + return [ + charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (YearMonthlyChartDate sales, _) => sales.x, + measureFn: (YearMonthlyChartDate sales, _) => sales.y, + data: _bloodDiastolicMonthlyTimeSeriesSalesList, + ), + charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, + domainFn: (YearMonthlyChartDate sales, _) => sales.x, + measureFn: (YearMonthlyChartDate sales, _) => sales.y, + data: _bloodSystolicMonthlyTimeSeriesSalesList, + ), + ]; + } + + List> getBloodYearTimeSeriesSales() { + return [ + charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _bloodSystoliceYearTimeSeriesSalesList, + ), + charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _bloodDiastolicYearTimeSeriesSalesList, + ) + ]; + } + + addDiabtecResult( + {String bloodPressureDate, + String diastolicPressure, + String systolicePressure, + int measuredArm}) async { + setState(ViewState.BusyLocal); + await bloodPressureService.addDiabtecResult( + bloodPressureDate: bloodPressureDate, + diastolicPressure: diastolicPressure, + systolicePressure: systolicePressure, + measuredArm: measuredArm); + if (bloodPressureService.hasError) { + error = bloodPressureService.error; + setState(ViewState.Error); + } else { + await getBloodPressure(); + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/medical/blood_sugar_view_model.dart b/lib/core/viewModels/medical/blood_sugar_view_model.dart new file mode 100644 index 00000000..fb00f80e --- /dev/null +++ b/lib/core/viewModels/medical/blood_sugar_view_model.dart @@ -0,0 +1,119 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; +import 'package:diplomaticquarterapp/core/service/medical/BloodSugarService.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:charts_flutter/flutter.dart' as charts; + +import '../../../core/viewModels/base_view_model.dart'; + +class BloodSugarViewMode extends BaseViewModel { + BloodSugarService bloodSugarService = locator(); + + ///BLOOD + List _bloodWeeklyTimeSeriesSalesList = List(); + List _bloodMonthlyTimeSeriesSalesList = List(); + List _bloodYearTimeSeriesSalesList = List(); + + List get monthDiabtecPatientResult => + bloodSugarService.monthDiabtecPatientResult; + + List get weekDiabtecPatientResult => + bloodSugarService.weekDiabtecPatientResult; + + List get yearDiabtecPatientResult => + bloodSugarService.yearDiabtecPatientResult; + + Future getBloodSugar() async { + setState(ViewState.Busy); + await bloodSugarService.getBloodSugar(); + await bloodSugarService.getDiabtecResults(); + if (bloodSugarService.hasError) { + error = bloodSugarService.error; + setState(ViewState.Error); + } else { + bloodSugarService.weekDiabtectResultAverageList.forEach((element) { + _bloodWeeklyTimeSeriesSalesList.add( + WeekChartDate(x: element.dateChart, y: element.dailyAverageResult)); + }); + + for (int index = 0; + index < bloodSugarService.monthDiabtectResultAverageList.length; + index++) { + _bloodMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate( + x: index, + y: bloodSugarService + .monthDiabtectResultAverageList[index].weekAverageResult)); + var asd=""; + } + + bloodSugarService.yearDiabtecResultAverageList.forEach((element) { + _bloodYearTimeSeriesSalesList + .add(WeekChartDate(x: element.date, y: element.monthAverageResult)); + }); + + setState(ViewState.Idle); + } + } + + List> getBloodWeeklySeries() { + return [ + new charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _bloodWeeklyTimeSeriesSalesList, + ) + ]; + } + + List> + getBloodMonthlyTimeSeriesSales() { + return [ + new charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (YearMonthlyChartDate sales, _) => sales.x, + measureFn: (YearMonthlyChartDate sales, _) => sales.y, + data: _bloodMonthlyTimeSeriesSalesList, + ) + ]; + } + + List> getBloodYearTimeSeriesSales() { + return [ + new charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _bloodYearTimeSeriesSalesList, + ) + ]; + } + + addDiabtecResult( + {String bloodSugerDateChart, + String bloodSugerResult, + String diabtecUnit, + int measuredTime}) async { + setState(ViewState.BusyLocal); + await bloodSugarService.addDiabtecResult( + bloodSugerDateChart: bloodSugerDateChart, + bloodSugerResult: bloodSugerResult , + diabtecUnit: diabtecUnit, + measuredTime: measuredTime); + if (bloodSugarService.hasError) { + error = bloodSugarService.error; + setState(ViewState.Error); + } else { + await getBloodSugar(); + setState(ViewState.Idle); + } + } + + + +} diff --git a/lib/core/viewModels/medical/weight_pressure_view_model.dart b/lib/core/viewModels/medical/weight_pressure_view_model.dart new file mode 100644 index 00000000..29095895 --- /dev/null +++ b/lib/core/viewModels/medical/weight_pressure_view_model.dart @@ -0,0 +1,113 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart'; +import 'package:diplomaticquarterapp/core/service/medical/BloodPressureService.dart'; +import 'package:diplomaticquarterapp/core/service/medical/BloodSugarService.dart'; +import 'package:diplomaticquarterapp/core/service/medical/WeightPressureService.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:charts_flutter/flutter.dart' as charts; + +import '../../../core/viewModels/base_view_model.dart'; + +class WeightPressureViewMode extends BaseViewModel { + WeightService weightService = locator(); + + List _weightWeeklyTimeSeriesSalesList = List(); + List _weightMonthlyTimeSeriesSalesList = List(); + List _weightYearTimeSeriesSalesList = List(); + + List get monthWeightMeasurementResult => + weightService.monthWeightMeasurementResult; + + List get weekWeightMeasurementResult => + weightService.weekWeightMeasurementResult; + + List get yearWeightMeasurementResult => + weightService.yearWeightMeasurementResult; + + Future getWeight() async { + setState(ViewState.Busy); + await weightService.getWeightAverage(); + await weightService.getWeightMeasurementResult(); + if (weightService.hasError) { + error = weightService.error; + setState(ViewState.Error); + } else { + weightService.weekWeightMeasurementResultAverage.forEach((element) { + _weightWeeklyTimeSeriesSalesList.add(WeekChartDate( + x: element.weightDate, y: element.dailyAverageResult)); + }); + + for (int index = 0; + index < weightService.monthWeightMeasurementResultAverage.length; + index++) { + _weightMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate( + x: index, + y: weightService.monthWeightMeasurementResultAverage[index].weekAverageResult)); + } + + weightService.yearWeightMeasurementResultAverage.forEach((element) { + _weightYearTimeSeriesSalesList + .add(WeekChartDate(x: element.date, y: element.monthAverageResult)); + }); + + setState(ViewState.Idle); + } + } + + List> getWeightWeeklySeries() { + return [ + charts.Series( + id: 'Diastolic', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _weightWeeklyTimeSeriesSalesList, + ), + ]; + } + + List> + getWeightMonthlyTimeSeriesSales() { + return [ + charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (YearMonthlyChartDate sales, _) => sales.x, + measureFn: (YearMonthlyChartDate sales, _) => sales.y, + data: _weightMonthlyTimeSeriesSalesList, + ), + ]; + } + + List> getWeightYearTimeSeriesSales() { + return [ + charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _weightYearTimeSeriesSalesList, + ), + ]; + } + + addWeightResult( + {String weightDate, String weightMeasured, int weightUnit}) async { + setState(ViewState.BusyLocal); + await weightService.addWeightResult( + weightDate: weightDate, + weightMeasured: weightMeasured, + weightUnit: weightUnit,); + if (weightService.hasError) { + error = weightService.error; + setState(ViewState.Error); + } else { + await getWeight(); + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index 5975daf2..ea06c8ad 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -3,8 +3,10 @@ import 'dart:async'; import 'package:connectivity/connectivity.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; class ProjectViewModel extends BaseViewModel { AppSharedPreferences sharedPref = AppSharedPreferences(); @@ -19,7 +21,9 @@ class ProjectViewModel extends BaseViewModel { dynamic get searchValue => searchvalue; Locale get appLocal => _appLocale; + LocaleType get localeType => isArabic? LocaleType.en:LocaleType.ar; bool get isArabic => _isArabic; + // BaseViewModel baseViewModel = locator() StreamSubscription subscription; ProjectViewModel() { diff --git a/lib/locator.dart b/lib/locator.dart index 93715c99..6c27dfe0 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -9,7 +9,10 @@ import 'core/service/er/am_service.dart'; import 'core/service/er/er_service.dart'; import 'core/service/feedback/feedback_service.dart'; import 'core/service/hospital_service.dart'; +import 'core/service/medical/BloodPressureService.dart'; +import 'core/service/medical/BloodSugarService.dart'; import 'core/service/medical/PatientSickLeaveService.dart'; +import 'core/service/medical/WeightPressureService.dart'; import 'core/service/medical/labs_service.dart'; import 'core/service/medical/medical_service.dart'; import 'core/service/medical/my_balance_service.dart'; @@ -24,16 +27,19 @@ import 'core/viewModels/er/near_hospital_view_model.dart'; import 'core/viewModels/feedback/feedback_view_model.dart'; import 'core/service/medical/reports_service.dart'; import 'core/viewModels/hospital_view_model.dart'; +import 'core/viewModels/medical/blood_pressure_view_model.dart'; import 'core/viewModels/medical/labs_view_model.dart'; import 'core/viewModels/medical/medical_view_model.dart'; import 'core/viewModels/medical/my_balance_view_model.dart'; import 'core/viewModels/medical/my_doctor_view_model.dart'; +import 'core/viewModels/medical/blood_sugar_view_model.dart'; import 'core/viewModels/medical/patient_sick_leave_view_model.dart'; import 'core/viewModels/medical/prescriptions_view_model.dart'; import 'core/viewModels/medical/radiology_view_model.dart'; import 'core/viewModels/medical/reports_monthly_view_model.dart'; import 'core/viewModels/medical/vital_sign_view_model.dart'; import 'core/viewModels/medical/reports_view_model.dart'; +import 'core/viewModels/medical/weight_pressure_view_model.dart'; import 'core/viewModels/pharmacies_view_model.dart'; import 'core/service/pharmacies_service.dart'; import 'core/service/insurance_service.dart'; @@ -66,10 +72,11 @@ void setupLocator() { locator.registerLazySingleton(() => ReportsMonthlyService()); locator.registerLazySingleton(() => ErService()); locator.registerLazySingleton(() => AmService()); - - locator.registerLazySingleton(() => PatientSickLeaveService()); locator.registerLazySingleton(() => MyBalanceService()); + locator.registerLazySingleton(() => BloodSugarService()); + locator.registerLazySingleton(() => BloodPressureService()); + locator.registerLazySingleton(() => WeightService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -92,5 +99,8 @@ void setupLocator() { locator.registerFactory(() => AmRequestViewModel()); locator.registerFactory(() => PatientSickLeaveViewMode()); locator.registerFactory(() => MyBalanceViewModel()); + locator.registerFactory(() => BloodSugarViewMode()); + locator.registerFactory(() => BloodPressureViewMode()); + locator.registerFactory(() => WeightPressureViewMode()); } diff --git a/lib/pages/base/base_view.dart b/lib/pages/base/base_view.dart index f6853123..6014b6c3 100644 --- a/lib/pages/base/base_view.dart +++ b/lib/pages/base/base_view.dart @@ -38,7 +38,10 @@ class _BaseViewState extends State> { @override void dispose() { - if (model != null) model = null; + if (model != null) { + model = null; + } + super.dispose(); } } diff --git a/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart b/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart index 5808aed8..bb9afd6c 100644 --- a/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart +++ b/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart @@ -1,5 +1,3 @@ -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'; diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 678ede88..85bd0e95 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -29,6 +29,7 @@ import 'doctor/doctor_home_page.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; import 'labs/labs_home_page.dart'; +import 'my_trackers/my_trackers.dart'; class MedicalProfilePage extends StatefulWidget { @override @@ -414,10 +415,10 @@ class _MedicalProfilePageState extends State { Expanded( flex: 1, child: InkWell( -// onTap: () { -// Navigator.push( -// context, FadePage(page: InsuranceApproval())); -// }, + onTap: () { + Navigator.push(context, + FadePage(page: MyTrackers())); + }, child: MedicalProfileItem( title: TranslationBase.of(context) .myTrackers, diff --git a/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart b/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart new file mode 100644 index 00000000..a7b23191 --- /dev/null +++ b/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart @@ -0,0 +1,204 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:feather_icons_flutter/feather_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:provider/provider.dart'; + +class AddWeightPage extends StatefulWidget { + @override + _AddWeightPageState createState() => _AddWeightPageState(); +} + +class _AddWeightPageState extends State { + TextEditingController _weightValueController = TextEditingController(); + DateTime bloodSugarDate = DateTime.now(); + DateTime timeSugarDate = DateTime.now(); + int weightUnit = 1; + final List measureUnitEnList = [ + 'Kg', + 'Pound', + ]; + final List measureUnitArList = [ + 'Kg', + 'Pound', + ]; + String measureTimeSelectedType = 'Kg'; + + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Add', + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.all(15), + child: Column( + children: [ + SizedBox( + height: 15, + ), + NewTextFields( + hintText: 'Enter Weight Value', + controller: _weightValueController, + keyboardType: TextInputType.number, + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + confirmSelectMeasureTimeDialog(projectViewModel.isArabic + ? measureUnitEnList + : measureUnitArList); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(measureTimeSelectedType), + Icon( + Icons.arrow_drop_down, + color: Colors.grey, + ) + ], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showDatePicker(context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now(), onConfirm: (date) { + print('confirm $date'); + setState(() { + bloodSugarDate = date; + }); + }, + currentTime: bloodSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('Date'), + Texts(getDate()), + ], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showTimePicker(context, showTitleActions: true, + onConfirm: (date) { + print('confirm $date'); + setState(() { + timeSugarDate = date; + }); + }, + currentTime: timeSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Texts('Time'), Texts(getTime())], + ), + ), + ), + ], + ), + ), + ), + bottomSheet: Container( + color: Colors.transparent, + width: double.infinity, + height: MediaQuery.of(context).size.width * 0.2, + child: Padding( + padding: const EdgeInsets.all(15.0), + child: SecondaryButton( + loading: model.state == ViewState.BusyLocal, + label: 'SAVE', + textColor: Colors.white, + onTap: () { + if (_weightValueController.text.isNotEmpty ) { + model.addWeightResult( + weightDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + weightMeasured: _weightValueController.text.toString(), + weightUnit: weightUnit, + ); + } + }), + ), + ), + ), + ); + } + + String getDate() { + return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}"; + } + + String getTime() { + return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; + } + + void confirmSelectMeasureTimeDialog(List list) { + showDialog( + context: context, + child: RadioStringDialog( + radioList: list, + title: 'Measure unit', + selectedValue: measureTimeSelectedType, + onValueSelected: (value) { + setState(() { + measureTimeSelectedType = value; + weightUnit = list.indexOf(value); + }); + }, + ), + ); + } +} diff --git a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart new file mode 100644 index 00000000..7d7c5dd5 --- /dev/null +++ b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart @@ -0,0 +1,151 @@ +import 'dart:ui'; +import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'AddWeightPage.dart'; +import 'WeightMonthlyPage.dart'; +import 'WeightYeaPage.dart'; +import 'WeightWeeklyPage.dart'; + +class WeightHomePage extends StatefulWidget { + @override + _WeightHomePageState createState() => _WeightHomePageState(); +} + +class _WeightHomePageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 3, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getWeight(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Weight', + baseViewModel: model, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(60.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 55.0, + color: Colors.white, + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + indicatorColor: Colors.red[800], + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Weekly'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Monthly'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Yearly'), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + WeightWeeklyPage( + data: model.getWeightWeeklySeries(), + diabtecPatientResult: model.weekWeightMeasurementResult, + ), + WeightMonthlyPage( + data: model.getWeightMonthlyTimeSeriesSales(), + diabtecPatientResult: model.monthWeightMeasurementResult, + ), + WeightYearPage( + data: model.getWeightYearTimeSeriesSales(), + diabtecPatientResult: model.yearWeightMeasurementResult, + ) + ], + ), + ) + ], + ), + floatingActionButton: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: AddWeightPage())); + }, + child: Container( + width: 55, + height: 55, + decoration: BoxDecoration( + shape: BoxShape.circle, color: Hexcolor('515B5D')), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, + ), + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart new file mode 100644 index 00000000..5bdbfeab --- /dev/null +++ b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart @@ -0,0 +1,155 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class WeightMonthlyPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const WeightMonthlyPage( + {Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.LineChart(data, + //animate: animate, + defaultRenderer: + new charts.LineRendererConfig(includePoints: true)), + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Time', color: Colors.white,fontSize: 15,), + ), + height: 40), + Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Value', color: Colors.white,fontSize: 15,), + ), + height: 40), + ], + ), + ); + diabtecPatientResult.forEach( + (diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.weightMeasured}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart new file mode 100644 index 00000000..ac1a3214 --- /dev/null +++ b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart @@ -0,0 +1,170 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class WeightWeeklyPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const WeightWeeklyPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.TimeSeriesChart( + data, + dateTimeFactory: const charts.LocalDateTimeFactory(), + ), + ), + SizedBox(height: 12,), + + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Time', color: Colors.white,fontSize: 15,), + ), + height: 40), + Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Value', color: Colors.white,fontSize: 15,), + ), + height: 40), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts('Edit', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach((diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.weightMeasured}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Icon(Icons.edit), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart new file mode 100644 index 00000000..3ddeaa82 --- /dev/null +++ b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart @@ -0,0 +1,153 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class WeightYearPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const WeightYearPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.TimeSeriesChart( + data, + dateTimeFactory: const charts.LocalDateTimeFactory(), + ), + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Time', color: Colors.white,fontSize: 15,), + ), + height: 40), + Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Value', color: Colors.white,fontSize: 15,), + ), + height: 40), + ], + ), + ); + diabtecPatientResult.forEach( + (diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.weightMeasured}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart new file mode 100644 index 00000000..b8d9a557 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart @@ -0,0 +1,215 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:feather_icons_flutter/feather_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:provider/provider.dart'; + +class AddBloodPressurePage extends StatefulWidget { + @override + _AddBloodPressurePageState createState() => _AddBloodPressurePageState(); +} + +class _AddBloodPressurePageState extends State { + TextEditingController _bloodSystolicValueController = TextEditingController(); + TextEditingController _bloodDiastolicValueController = + TextEditingController(); + DateTime bloodSugarDate = DateTime.now(); + DateTime timeSugarDate = DateTime.now(); + int measuredArm = 1; + final List measureTimeEnList = [ + 'Left Arm', + 'Right Arm', + ]; + final List measureTimeArList = [ + 'الذراع الأيسر', + 'الذراع الأيمن', + ]; + String measureTimeSelectedType = 'Left Arm'; + + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Add', + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.all(15), + child: Column( + children: [ + SizedBox( + height: 15, + ), + NewTextFields( + hintText: 'Enter Systolic Value', + controller: _bloodSystolicValueController, + keyboardType: TextInputType.number, + ), + SizedBox( + height: 8, + ), + NewTextFields( + hintText: 'Blood Diastolic Value', + controller: _bloodDiastolicValueController, + keyboardType: TextInputType.number, + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + confirmSelectMeasureTimeDialog(projectViewModel.isArabic + ? measureTimeEnList + : measureTimeArList); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(measureTimeSelectedType), + Icon( + Icons.arrow_drop_down, + color: Colors.grey, + ) + ], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showDatePicker(context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now(), onConfirm: (date) { + print('confirm $date'); + setState(() { + bloodSugarDate = date; + }); + }, + currentTime: bloodSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('Date'), + Texts(getDate()), + ], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showTimePicker(context, showTitleActions: true, + onConfirm: (date) { + print('confirm $date'); + setState(() { + timeSugarDate = date; + }); + }, + currentTime: timeSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Texts('Time'), Texts(getTime())], + ), + ), + ), + ], + ), + ), + ), + bottomSheet: Container( + color: Colors.transparent, + width: double.infinity, + height: MediaQuery.of(context).size.width * 0.2, + child: Padding( + padding: const EdgeInsets.all(15.0), + child: SecondaryButton( + loading: model.state == ViewState.BusyLocal, + label: 'SAVE', + textColor: Colors.white, + onTap: () { + if (_bloodSystolicValueController.text.isNotEmpty && + _bloodDiastolicValueController.text.isNotEmpty) { + model.addDiabtecResult( + bloodPressureDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + diastolicPressure: _bloodDiastolicValueController.text.toString(), + systolicePressure: _bloodSystolicValueController.text.toString(), + measuredArm: measuredArm, + ); + } + }), + ), + ), + ), + ); + } + + String getDate() { + return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}"; + } + + String getTime() { + return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; + } + + void confirmSelectMeasureTimeDialog(List list) { + showDialog( + context: context, + child: RadioStringDialog( + radioList: list, + title: 'Select the Arm', + selectedValue: measureTimeSelectedType, + onValueSelected: (value) { + setState(() { + measureTimeSelectedType = value; + measuredArm = list.indexOf(value); + }); + }, + ), + ); + } +} diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart new file mode 100644 index 00000000..c118f2ca --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart @@ -0,0 +1,154 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import 'AddBloodPressurePage.dart'; +import 'BloodPressureMonthly.dart'; +import 'BloodPressureYeaPage.dart'; +import 'bloodPressureWeeklyPage.dart'; + +class BloodPressureHomePage extends StatefulWidget { + @override + _BloodPressureHomePageState createState() => _BloodPressureHomePageState(); +} + +class _BloodPressureHomePageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 3, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getBloodPressure(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Blood Pressure', + baseViewModel: model, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(60.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 55.0, + color: Colors.white, + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + indicatorColor: Colors.red[800], + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Weekly'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Monthly'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Yearly'), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + BloodPressureWeeklyPage( + data: model.getBloodWeeklySeries(), + diabtecPatientResult: model.weekDiabtecPatientResult, + ), + BloodPressureMonthlyPage( + data: model.getBloodMonthlyTimeSeriesSales(), + diabtecPatientResult: model.monthDiabtecPatientResult, + ), + BloodPressureYearPage( + data: model.getBloodYearTimeSeriesSales(), + diabtecPatientResult: model.yearDiabtecPatientResult, + ) + ], + ), + ) + ], + ), + floatingActionButton: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: AddBloodPressurePage())); + }, + child: Container( + width: 55, + height: 55, + decoration: BoxDecoration( + shape: BoxShape.circle, color: Hexcolor('515B5D')), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, + ), + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart new file mode 100644 index 00000000..f38cc3b6 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart @@ -0,0 +1,200 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class BloodPressureMonthlyPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const BloodPressureMonthlyPage( + {Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.LineChart(data, + //animate: animate, + defaultRenderer: + new charts.LineRendererConfig(includePoints: true)), + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts( + 'Measured', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach( + (diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container(child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ),), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.measuredArmDesc}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.systolicePressure}/${diabtec.diastolicPressure}', + textAlign: TextAlign.center, + fontSize: 12, + color: Colors.red, + ), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart new file mode 100644 index 00000000..dfcf42ae --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart @@ -0,0 +1,199 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class BloodPressureYearPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const BloodPressureYearPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.TimeSeriesChart( + data, + dateTimeFactory: const charts.LocalDateTimeFactory(), + ), + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts( + 'Measured', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach( + (diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.measuredArmDesc}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.systolicePressure}/${diabtec.diastolicPressure}', + textAlign: TextAlign.center, + fontSize: 12, + color: Colors.red, + ), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart new file mode 100644 index 00000000..fbcbf417 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart @@ -0,0 +1,204 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class BloodPressureWeeklyPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const BloodPressureWeeklyPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.TimeSeriesChart( + data, + dateTimeFactory: const charts.LocalDateTimeFactory(), + ), + ), + SizedBox(height: 12,), + + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Time', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Measured', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Value', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts('Edit', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach((diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.measuredArmDesc}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.systolicePressure}/${diabtec.diastolicPressure}', + textAlign: TextAlign.center, + fontSize: 12, + color: Colors.red, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Icon(Icons.edit), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart new file mode 100644 index 00000000..00f06a25 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart @@ -0,0 +1,344 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:feather_icons_flutter/feather_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:provider/provider.dart'; + +class AddBloodSugarPage extends StatefulWidget { + @override + _AddBloodSugarPageState createState() => _AddBloodSugarPageState(); +} + +class _AddBloodSugarPageState extends State { + TextEditingController _bloodSugarValueController = TextEditingController(); + DateTime bloodSugarDate = DateTime.now(); + DateTime timeSugarDate = DateTime.now(); + String measureUnitSelectedType = 'mg/dlt'; + int measuredTime=1; + final List measureUnitList = ['mg/dlt', 'mol/L']; + final List measureTimeEnList = [ + 'Before Breakfast', + 'After Breakfast', + 'Before Lunch', + 'After Lunch', + 'Before Dinner', + 'After Dinner', + 'Before Sleep', + 'After Sleep', + 'Fasting', + 'Other', + ]; + final List measureTimeArList = [ + 'Before Breakfast', + 'After Breakfast', + 'Before Lunch', + 'After Lunch', + 'Before Dinner', + 'After Dinner', + 'Before Sleep', + 'After Sleep', + 'Fasting', + 'Other', + ]; + String measureTimeSelectedType; + + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + showTaskOptions() { + showModalBottomSheet( + backgroundColor: Colors.white, + context: context, + builder: (BuildContext bc) { + return Container( + padding: EdgeInsets.symmetric(vertical: 12.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(16.0), + topRight: Radius.circular(16.0))), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + decoration: BoxDecoration( + color: Colors.grey[200], + borderRadius: BorderRadius.circular(3.0)), + width: 40.0, + height: 6.0, + ), + InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 18.0, vertical: 18.0), + child: Row( + children: [ + Icon( + FeatherIcons.share, + color: Theme + .of(context) + .primaryColor, + size: 18.0, + ), + SizedBox(width: 24.0), + Texts('Share Task', + variant: "body2Link", color: Colors.grey[800]), + ], + ), + ), + ), + InkWell( + onTap: () { + Navigator.pop(context); + // Navigator.of(context).push(SlideUpPageRoute(widget: PostTaskIndex(task: new Task(category: task?.category, description: task?.description, title: task?.title)))); + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 18.0, vertical: 18.0), + child: Row( + children: [ + Icon( + FeatherIcons.copy, + color: Theme + .of(context) + .primaryColor, + size: 18.0, + ), + SizedBox(width: 24.0), + Texts('Post Similar Task', + variant: "body2Link", color: Colors.grey[800]), + ], + ), + ), + ), + ], + ), + ); + }); + } + + return BaseView( + builder: (_, model, w) => + AppScaffold( + isShowAppBar: true, + appBarTitle: 'Add', + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.all(15), + child: Column( + children: [ + SizedBox( + height: 15, + ), + NewTextFields( + hintText: 'Enter Blood Sugar Value', + controller: _bloodSugarValueController, + keyboardType: TextInputType.number, + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + confirmSelectMeasureUnitDialog(); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(measureUnitSelectedType), + Icon( + Icons.arrow_drop_down, + color: Colors.grey, + ) + ], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showDatePicker(context, + showTitleActions: true, + minTime: DateTime(DateTime + .now() + .year - 1, 1, 1), + maxTime: DateTime.now(), + onConfirm: (date) { + print('confirm $date'); + setState(() { + bloodSugarDate = date; + }); + }, + currentTime: bloodSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('Date'), + Texts(getDate()), + ], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showTimePicker( + context, showTitleActions: true, + onConfirm: (date) { + print('confirm $date'); + setState(() { + timeSugarDate = date; + }); + }, + currentTime: timeSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Texts('Time'), Texts(getTime())], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + confirmSelectMeasureTimeDialog(projectViewModel.isArabic + ? measureTimeEnList + : measureTimeArList); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(measureTimeSelectedType ?? 'Others'), + Icon( + Icons.arrow_drop_down, + color: Colors.grey, + ) + ], + ), + ), + ), + ], + ), + ), + ), + bottomSheet: Container( + color: Colors.transparent, + width: double.infinity, + height: MediaQuery + .of(context) + .size + .width * 0.2, + child: Padding( + padding: const EdgeInsets.all(15.0), + child: SecondaryButton( + loading: model.state == ViewState.BusyLocal, + label: 'SAVE', textColor: Colors.white, onTap: () { + if (_bloodSugarValueController.text.isNotEmpty) { + model.addDiabtecResult(diabtecUnit: measureUnitSelectedType, + measuredTime: measuredTime, + bloodSugerResult:_bloodSugarValueController.text.toString(), + bloodSugerDateChart: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + + ); + } + }), + ), + ), + ), + ); + } + + String getDate() { + return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate + .day}, ${bloodSugarDate.year}"; + } + + String getTime() { + return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; + } + + void confirmSelectMeasureUnitDialog() { + showDialog( + context: context, + child: RadioStringDialog( + radioList: measureUnitList, + title: 'Measure unit', + selectedValue: measureUnitSelectedType, + onValueSelected: (value) { + setState(() { + measureUnitSelectedType = value; + }); + }, + ), + ); + } + + void confirmSelectMeasureTimeDialog(List list) { + showDialog( + context: context, + child: RadioStringDialog( + radioList: list, + title: 'Measure time', + selectedValue: measureTimeSelectedType, + onValueSelected: (value) { + setState(() { + measureTimeSelectedType = value; + measuredTime = list.indexOf(value); + }); + }, + ), + ); + } +} diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart b/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart new file mode 100644 index 00000000..da31c4ed --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart @@ -0,0 +1,188 @@ + +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class BloodMonthlyPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const BloodMonthlyPage({Key key, this.data,this.diabtecPatientResult}) : super(key: key); + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.LineChart( + data, + //animate: animate, + defaultRenderer: new charts.LineRendererConfig(includePoints: true) + ), + ), + SizedBox(height: 12,), + + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Time', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Measured', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts('Value', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach((diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.dateChart.hour}:${diabtec.dateChart.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.measuredDesc}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.resultValue}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart new file mode 100644 index 00000000..3bddab88 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart @@ -0,0 +1,199 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class BloodYearPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const BloodYearPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.TimeSeriesChart( + data, + dateTimeFactory: const charts.LocalDateTimeFactory(), + ), + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts( + 'Measured', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach( + (diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.dateChart.hour}:${diabtec.dateChart.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.measuredDesc}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.resultValue}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart new file mode 100644 index 00000000..1190b6b6 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart @@ -0,0 +1,145 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +import 'AddBloodSugarPage.dart'; +import 'BloodMonthly.dart'; +import 'BloodYeaPage.dart'; +import 'blood_sugar_weekly_page.dart'; + +class BloodSugarHomePage extends StatefulWidget { + @override + _BloodSugarHomePageState createState() => _BloodSugarHomePageState(); +} + +class _BloodSugarHomePageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 3, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getBloodSugar(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Blood Sugar', + baseViewModel: model, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(60.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 55.0, + color: Colors.white, + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + indicatorColor: Colors.red[800], + labelColor: Theme.of(context).primaryColor, + labelPadding: EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Weekly'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Monthly'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Yearly'), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + BloodSugarWeeklyPage(data: model.getBloodWeeklySeries(),diabtecPatientResult: model.weekDiabtecPatientResult,), + BloodMonthlyPage(data: model.getBloodMonthlyTimeSeriesSales(),diabtecPatientResult: model.monthDiabtecPatientResult,), + BloodYearPage(data: model.getBloodYearTimeSeriesSales(),diabtecPatientResult: model.yearDiabtecPatientResult,) + ], + ), + ) + ], + ), + floatingActionButton: InkWell( + onTap: (){ + Navigator.push(context, FadePage(page: AddBloodSugarPage())); + }, + child: Container( + width: 55, + height: 55, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Hexcolor('515B5D') + ), + child: Center( + child: Icon(Icons.add,color: Colors.white,), + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart new file mode 100644 index 00000000..6b892162 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart @@ -0,0 +1,204 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class BloodSugarWeeklyPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const BloodSugarWeeklyPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.TimeSeriesChart( + data, + dateTimeFactory: const charts.LocalDateTimeFactory(), + ), + ), + SizedBox(height: 12,), + + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Time', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Measured', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Value', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts('Edit', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach((diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.dateChart.hour}:${diabtec.dateChart.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.measuredDesc}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.resultValue}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Icon(Icons.edit), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/my_trackers.dart b/lib/pages/medical/my_trackers/my_trackers.dart new file mode 100644 index 00000000..ecdf5a53 --- /dev/null +++ b/lib/pages/medical/my_trackers/my_trackers.dart @@ -0,0 +1,114 @@ +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'Weight/WeightHomePage.dart'; +import 'blood_pressure/BloodPressureHomePage.dart'; +import 'blood_suger/blood_sugar_home_page.dart'; + +class MyTrackers extends StatelessWidget { + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: 'My Tracker', + isShowAppBar: true, + body: SingleChildScrollView( + child: Container( + padding: EdgeInsets.all(12), + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: InkWell( + onTap: ()=> Navigator.push(context, FadePage(page: BloodSugarHomePage())), + child: Container( + margin: EdgeInsets.all(5), + width: MediaQuery.of(context).size.width*0.35, + height:MediaQuery.of(context).size.width*0.35 , + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + color: Colors.white + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset('assets/tracker/blood-suger.png',width: 60.0,), + SizedBox(height: 15,), + Text('Blood Sugar'), + ], + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: ()=> Navigator.push(context, FadePage(page: BloodPressureHomePage())), + child: Container( + margin: EdgeInsets.all(5), + width: MediaQuery.of(context).size.width*0.35, + height:MediaQuery.of(context).size.width*0.35 , + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + color: Colors.white + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset('assets/tracker/blood-pressure.png',width: 60.0,), + SizedBox(height: 15,), + Text('Blood Pressure'), + ], + ), + ), + ), + ), + ], + ), + Row( + //mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: InkWell( + onTap: ()=> Navigator.push(context, FadePage(page: WeightHomePage())), + child: Container( + margin: EdgeInsets.all(5), + width: MediaQuery.of(context).size.width*0.35, + height:MediaQuery.of(context).size.width*0.35 , + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + color: Colors.white + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset('assets/tracker/weight.png',width: 60.0,), + SizedBox(height: 15,), + Text('Weight'), + ], + ), + ), + ), + ), + Expanded( + child: Container(), + ), + ], + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 834cb0fe..a150086c 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -67,32 +67,71 @@ class DateUtil { static getMonth(int month) { switch (month) { case 1: - return "Jan"; + return "January"; case 2: - return "Feb"; + return "February"; case 3: - return "Mar"; + return "March"; case 4: - return "Apr"; + return "April"; case 5: return "May"; case 6: - return "Jun"; + return "June"; case 7: - return "Jul"; + return "July"; case 8: - return "Aug"; + return "August"; case 9: - return "Sep"; + return "September"; case 10: - return "Oct"; + return "October"; case 11: - return "Nov"; + return "November"; case 12: - return "Dec"; + return "December"; } } + static getMonthByName(String month) { + switch (month.toLowerCase()) { + case 'january': + return 1; + case 'february': + return 2; + case 'march': + return 3; + case 'april': + return 4; + case 'may': + return 5; + case 'june': + return 6; + case 'july': + return 7; + case 'august': + return 8; + case 'september': + return 9; + case 'october': + return 10; + case 'november': + return 11; + case 'december': + return 12; + } + } + + static getMonthDateTime(String month, yearName) { + DateTime date; + try { + date = DateTime(int.parse(yearName), getMonthByName(month)); + } catch (e) { + print(e); + } + return date ?? DateTime.now(); + } + /// get month by /// [weekDay] convert week day in int to week day name static getWeekDay(int weekDay) { diff --git a/lib/widgets/dialogs/RadioStringDialog.dart b/lib/widgets/dialogs/RadioStringDialog.dart new file mode 100644 index 00000000..912c3a72 --- /dev/null +++ b/lib/widgets/dialogs/RadioStringDialog.dart @@ -0,0 +1,150 @@ +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 RadioStringDialog extends StatefulWidget { + final List radioList; + final Function(String) onValueSelected; + final String title; + String selectedValue; + + RadioStringDialog( + {Key key, + this.radioList, + this.onValueSelected, + this.selectedValue, + this.title}); + + @override + _RadioStringDialogState createState() => _RadioStringDialogState(); +} + +class _RadioStringDialogState extends State { + @override + void initState() { + super.initState(); + widget.selectedValue = widget.selectedValue ?? widget.radioList[0]; + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + title: Container( + width: double.infinity, + child: Center( + child: Texts( + widget.title, + textAlign: TextAlign.center, + ))), + children: [ + Container( + height: widget.radioList.length > 3 + ? MediaQuery.of(context).size.height * 0.6 + : null, + child: SingleChildScrollView( + child: Column( + children: [ + Divider(), + ...List.generate( + widget.radioList.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedValue = + widget.radioList[index]; + }); + }, + child: ListTile( + title: Text(widget.radioList[index]), + leading: Radio( + value: widget.radioList[index], + groupValue: widget.selectedValue, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedValue = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context) + .cancel + .toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedValue); + 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 c47875e1..4204d4ad 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -23,7 +23,7 @@ dependencies: connectivity: ^0.4.9 # State Management - provider: ^4.3.1 + provider: ^4.3.2+2 #Dependency Injection get_it: ^4.0.2 @@ -110,7 +110,7 @@ dependencies: #Popup_window popup_box: ^0.1.0 - + flutter_datetime_picker: ^1.4.0 #Handle Geolocation From 7840ec4c3b64a9ab9688398d3768f5fe54aed20f Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 21 Sep 2020 12:32:44 +0300 Subject: [PATCH 04/33] 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 05/33] 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 9f06ce7d1db9b9bc8d25874abd23677a3c8d0a85 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 21 Sep 2020 18:02:07 +0300 Subject: [PATCH 06/33] done EyeMeasurements service --- lib/config/localized_values.dart | 16 +- .../model/eye/AppoimentAllHistoryResult.dart | 497 ++++++++++++++++++ lib/core/model/eye/AppointmentFilter.dart | 12 + lib/core/service/medical/EyeService.dart | 26 + lib/core/viewModels/medical/EyeViewModel.dart | 46 ++ lib/locator.dart | 4 + .../medical/doctor/doctor_home_page.dart | 28 - lib/pages/medical/eye/ClassesPage.dart | 126 +++++ lib/pages/medical/eye/ContactLensPage.dart | 129 +++++ lib/pages/medical/eye/EyeHomePage.dart | 128 +++++ .../medical/eye/EyeMeasurementsPage.dart | 123 +++++ lib/pages/medical/medical_profile_page.dart | 13 +- .../prescriptions_home_page.dart | 2 +- lib/uitl/translations_delegate_base.dart | 15 + .../data_display/medical/doctor_card.dart | 1 + 15 files changed, 1131 insertions(+), 35 deletions(-) create mode 100644 lib/core/model/eye/AppoimentAllHistoryResult.dart create mode 100644 lib/core/model/eye/AppointmentFilter.dart create mode 100644 lib/core/service/medical/EyeService.dart create mode 100644 lib/core/viewModels/medical/EyeViewModel.dart create mode 100644 lib/pages/medical/eye/ClassesPage.dart create mode 100644 lib/pages/medical/eye/ContactLensPage.dart create mode 100644 lib/pages/medical/eye/EyeHomePage.dart create mode 100644 lib/pages/medical/eye/EyeMeasurementsPage.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index baf3cc69..790da29f 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -488,5 +488,19 @@ const Map> localizedValues = { "Ok":{"en":"Ok","ar":"حسنا"}, "TheVerificationCodeExpiresIn":{"en":"The Verification Code Expires In","ar":"تنتهي صلاحية رمز التحقق في"}, "PleaseEnterTheVerificationCode":{"en":"Please enter the verification code send to","ar":"الرجاء إدخال رمز التحقق المرسل إلى"}, - + "EyeMeasurements":{"en":"Eye Measurements","ar":"قياسات النظر"}, + "Measurements":{"en":"Measurements","ar":"قياسات"}, + "Classes":{"en":"Classes","ar":"نظارات"}, + "ContactLens":{"en":"Contact Lens","ar":"العدسات اللاصقة"}, + "RightEye":{"en":"Right Eye","ar":"العين اليمين"}, + "Sphere":{"en":"Sphere","ar":"القوة"}, + "Cylinder":{"en":"Cylinder","ar":"الدائرية"}, + "Axis":{"en":"Axis","ar":"المحاور"}, + "Prism":{"en":"Prism","ar":"موشور"}, + "VA":{"en":"Prism","VA":"المحاور"}, + "LeftEye":{"en":"Left Eye","VA":"العين اليسرى"}, + "Brand":{"en":"Brand","VA":"النوع"}, + "Power":{"en":"Power","VA":"القوة"}, + "Diameter":{"en":"Diameter","VA":"القطر"}, + "Remarks":{"en":"Remarks","VA":"ملاحضات"}, }; diff --git a/lib/core/model/eye/AppoimentAllHistoryResult.dart b/lib/core/model/eye/AppoimentAllHistoryResult.dart new file mode 100644 index 00000000..ed123023 --- /dev/null +++ b/lib/core/model/eye/AppoimentAllHistoryResult.dart @@ -0,0 +1,497 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class AppoimentAllHistoryResultList { + String setupID; + int projectID; + int appointmentNo; + String appointmentDate; + Null appointmentDateN; + int appointmentType; + DateTime bookDate; + dynamic patientType; + int patientID; + dynamic clinicID; + int doctorID; + String endDate; + String startTime; + String endTime; + dynamic status; + dynamic visitType; + int visitFor; + int patientStatusType; + int companyID; + int bookedBy; + String bookedOn; + int confirmedBy; + String confirmedOn; + int arrivalChangedBy; + String arrivedOn; + Null editedBy; + Null editedOn; + Null doctorName; + Null doctorNameN; + String statusDesc; + Null statusDescN; + bool vitalStatus; + Null vitalSignAppointmentNo; + int episodeID; + int actualDoctorRate; + String clinicName; + bool complainExists; + String doctorImageURL; + String doctorNameObj; + int doctorRate; + List doctorSpeciality; + String doctorTitle; + int gender; + String genderDescription; + bool iSAllowOnlineCheckedIN; + bool isActiveDoctor; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + int isFollowup; + bool isLiveCareAppointment; + bool isMedicalReportRequested; + bool isOnlineCheckedIN; + String latitude; + List listHISGetContactLensPerscription; + List listHISGetGlassPerscription; + String longitude; + int nextAction; + int noOfPatientsRate; + int originalClinicID; + int originalProjectID; + String projectName; + String qR; + int remaniningHoursTocanPay; + bool sMSButtonVisable; + + AppoimentAllHistoryResultList( + {this.setupID, + this.projectID, + this.appointmentNo, + this.appointmentDate, + this.appointmentDateN, + this.appointmentType, + this.bookDate, + this.patientID, + this.doctorID, + this.endDate, + this.startTime, + this.endTime, + this.status, + this.visitFor, + this.patientStatusType, + this.companyID, + this.bookedBy, + this.bookedOn, + this.confirmedBy, + this.confirmedOn, + this.arrivalChangedBy, + this.arrivedOn, + this.editedBy, + this.editedOn, + this.doctorName, + this.doctorNameN, + this.statusDesc, + this.statusDescN, + this.vitalStatus, + this.vitalSignAppointmentNo, + this.episodeID, + this.actualDoctorRate, + this.clinicName, + this.complainExists, + this.doctorImageURL, + this.doctorNameObj, + this.doctorRate, + this.doctorSpeciality, + this.doctorTitle, + this.gender, + this.genderDescription, + this.iSAllowOnlineCheckedIN, + this.isActiveDoctor, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isFollowup, + this.isLiveCareAppointment, + this.isMedicalReportRequested, + this.isOnlineCheckedIN, + this.latitude, + this.listHISGetContactLensPerscription, + this.listHISGetGlassPerscription, + this.longitude, + this.nextAction, + this.noOfPatientsRate, + this.originalClinicID, + this.originalProjectID, + this.projectName, + this.qR, + this.remaniningHoursTocanPay, + this.sMSButtonVisable, + this.clinicID, + this.patientType, + + this.visitType}); + + AppoimentAllHistoryResultList.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + appointmentNo = json['AppointmentNo']; + appointmentDate = json['AppointmentDate']; + appointmentDateN = json['AppointmentDateN']; + appointmentType = json['AppointmentType']; + bookDate = DateUtil.convertStringToDate(json['BookDate']); + patientType = json['PatientType']; + patientID = json['PatientID']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + endDate = json['EndDate']; + startTime = json['StartTime']; + endTime = json['EndTime']; + status = json['Status']; + visitType = json['VisitType']; + visitFor = json['VisitFor']; + patientStatusType = json['PatientStatusType']; + companyID = json['CompanyID']; + bookedBy = json['BookedBy']; + bookedOn = json['BookedOn']; + confirmedBy = json['ConfirmedBy']; + confirmedOn = json['ConfirmedOn']; + arrivalChangedBy = json['ArrivalChangedBy']; + arrivedOn = json['ArrivedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + statusDesc = json['StatusDesc']; + statusDescN = json['StatusDescN']; + vitalStatus = json['VitalStatus']; + vitalSignAppointmentNo = json['VitalSignAppointmentNo']; + episodeID = json['EpisodeID']; + actualDoctorRate = json['ActualDoctorRate']; + clinicName = json['ClinicName']; + complainExists = json['ComplainExists']; + doctorImageURL = json['DoctorImageURL']; + doctorNameObj = json['DoctorNameObj']; + doctorRate = json['DoctorRate']; + // doctorSpeciality = json['DoctorSpeciality'].cast(); + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + iSAllowOnlineCheckedIN = json['ISAllowOnlineCheckedIN']; + isActiveDoctor = json['IsActiveDoctor']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + isFollowup = json['IsFollowup']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + isMedicalReportRequested = json['IsMedicalReportRequested']; + isOnlineCheckedIN = json['IsOnlineCheckedIN']; + latitude = json['Latitude']; + if (json['List_HIS_GetContactLensPerscription'] != null) { + listHISGetContactLensPerscription = + new List(); + json['List_HIS_GetContactLensPerscription'].forEach((v) { + listHISGetContactLensPerscription + .add(new ListHISGetContactLensPerscription.fromJson(v)); + }); + } + if (json['List_HIS_GetGlassPerscription'] != null) { + listHISGetGlassPerscription = new List(); + json['List_HIS_GetGlassPerscription'].forEach((v) { + listHISGetGlassPerscription + .add(new ListHISGetGlassPerscription.fromJson(v)); + }); + } + longitude = json['Longitude']; + nextAction = json['NextAction']; + noOfPatientsRate = json['NoOfPatientsRate']; + originalClinicID = json['OriginalClinicID']; + originalProjectID = json['OriginalProjectID']; + projectName = json['ProjectName']; + qR = json['QR']; + remaniningHoursTocanPay = json['RemaniningHoursTocanPay']; + sMSButtonVisable = json['SMSButtonVisable']; + clinicID = json['clinicID']; + patientType = json['patientType']; + status = json['status']; + visitType = json['visitType']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentDateN'] = this.appointmentDateN; + data['AppointmentType'] = this.appointmentType; + data['BookDate'] = this.bookDate; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['EndDate'] = this.endDate; + data['StartTime'] = this.startTime; + data['EndTime'] = this.endTime; + data['Status'] = this.status; + data['VisitType'] = this.visitType; + data['VisitFor'] = this.visitFor; + data['PatientStatusType'] = this.patientStatusType; + data['CompanyID'] = this.companyID; + data['BookedBy'] = this.bookedBy; + data['BookedOn'] = this.bookedOn; + data['ConfirmedBy'] = this.confirmedBy; + data['ConfirmedOn'] = this.confirmedOn; + data['ArrivalChangedBy'] = this.arrivalChangedBy; + data['ArrivedOn'] = this.arrivedOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['StatusDesc'] = this.statusDesc; + data['StatusDescN'] = this.statusDescN; + data['VitalStatus'] = this.vitalStatus; + data['VitalSignAppointmentNo'] = this.vitalSignAppointmentNo; + data['EpisodeID'] = this.episodeID; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['ClinicName'] = this.clinicName; + data['ComplainExists'] = this.complainExists; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorNameObj'] = this.doctorNameObj; + data['DoctorRate'] = this.doctorRate; + data['DoctorSpeciality'] = this.doctorSpeciality; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['ISAllowOnlineCheckedIN'] = this.iSAllowOnlineCheckedIN; + data['IsActiveDoctor'] = this.isActiveDoctor; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsFollowup'] = this.isFollowup; + data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + data['IsMedicalReportRequested'] = this.isMedicalReportRequested; + data['IsOnlineCheckedIN'] = this.isOnlineCheckedIN; + data['Latitude'] = this.latitude; + if (this.listHISGetContactLensPerscription != null) { + data['List_HIS_GetContactLensPerscription'] = this + .listHISGetContactLensPerscription + .map((v) => v.toJson()) + .toList(); + } + if (this.listHISGetGlassPerscription != null) { + data['List_HIS_GetGlassPerscription'] = + this.listHISGetGlassPerscription.map((v) => v.toJson()).toList(); + } + data['Longitude'] = this.longitude; + data['NextAction'] = this.nextAction; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['OriginalClinicID'] = this.originalClinicID; + data['OriginalProjectID'] = this.originalProjectID; + data['ProjectName'] = this.projectName; + data['QR'] = this.qR; + data['RemaniningHoursTocanPay'] = this.remaniningHoursTocanPay; + data['SMSButtonVisable'] = this.sMSButtonVisable; + data['clinicID'] = this.clinicID; + data['patientType'] = this.patientType; + data['status'] = this.status; + data['visitType'] = this.visitType; + return data; + } +} + +class ListHISGetContactLensPerscription { + String setupId; + int projectId; + int patientType; + int patientId; + int encounterType; + int encounterNo; + int oDOS; + dynamic brand; + dynamic baseCurve; + dynamic power; + dynamic diameter; + dynamic oZ; + dynamic cT; + dynamic blend; + String remarks; + int status; + bool isActive; + String createdOn; + + ListHISGetContactLensPerscription( + {this.setupId, + this.projectId, + this.patientType, + this.patientId, + this.encounterType, + this.encounterNo, + this.oDOS, + this.brand, + this.baseCurve, + this.power, + this.diameter, + this.oZ, + this.cT, + this.blend, + this.remarks, + this.status, + this.isActive, + this.createdOn}); + + ListHISGetContactLensPerscription.fromJson(Map json) { + setupId = json['SetupId']; + projectId = json['ProjectId']; + patientType = json['PatientType']; + patientId = json['PatientId']; + encounterType = json['EncounterType']; + encounterNo = json['EncounterNo']; + oDOS = json['OD_OS']; + brand = json['Brand']; + baseCurve = json['BaseCurve']; + power = json['Power']; + diameter = json['Diameter']; + oZ = json['OZ']; + cT = json['CT']; + blend = json['Blend']; + remarks = json['Remarks']; + status = json['Status']; + isActive = json['IsActive']; + createdOn = json['CreatedOn']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupId'] = this.setupId; + data['ProjectId'] = this.projectId; + data['PatientType'] = this.patientType; + data['PatientId'] = this.patientId; + data['EncounterType'] = this.encounterType; + data['EncounterNo'] = this.encounterNo; + data['OD_OS'] = this.oDOS; + data['Brand'] = this.brand; + data['BaseCurve'] = this.baseCurve; + data['Power'] = this.power; + data['Diameter'] = this.diameter; + data['OZ'] = this.oZ; + data['CT'] = this.cT; + data['Blend'] = this.blend; + data['Remarks'] = this.remarks; + data['Status'] = this.status; + data['IsActive'] = this.isActive; + data['CreatedOn'] = this.createdOn; + return data; + } +} + +class ListHISGetGlassPerscription { + dynamic projectID; + String setupID; + dynamic patientId; + dynamic encounterType; + dynamic encounterNo; + String visionType; + double rightEyeSpherical; + dynamic rightEyeCylinder; + dynamic rightEyeAxis; + dynamic rightEyePrism; + dynamic rightEyeVA; + String rightEyeRemarks; + dynamic leftEyeSpherical; + dynamic leftEyeCylinder; + dynamic leftEyeAxis; + dynamic leftEyePrism; + dynamic leftEyeVA; + String leftEyeRemarks; + dynamic pD; + dynamic bVD; + dynamic status; + bool isActive; + String createdOn; + + ListHISGetGlassPerscription( + {this.projectID, + this.setupID, + this.patientId, + this.encounterType, + this.encounterNo, + this.visionType, + this.rightEyeSpherical, + this.rightEyeCylinder, + this.rightEyeAxis, + this.rightEyePrism, + this.rightEyeVA, + this.rightEyeRemarks, + this.leftEyeSpherical, + this.leftEyeCylinder, + this.leftEyeAxis, + this.leftEyePrism, + this.leftEyeVA, + this.leftEyeRemarks, + this.pD, + this.bVD, + this.status, + this.isActive, + this.createdOn}); + + ListHISGetGlassPerscription.fromJson(Map json) { + projectID = json['ProjectID']; + setupID = json['SetupID']; + patientId = json['PatientId']; + encounterType = json['EncounterType']; + encounterNo = json['EncounterNo']; + visionType = json['VisionType']; + rightEyeSpherical = json['RightEyeSpherical']; + rightEyeCylinder = json['RightEyeCylinder']; + rightEyeAxis = json['RightEyeAxis']; + rightEyePrism = json['RightEyePrism']; + rightEyeVA = json['RightEyeVA']; + rightEyeRemarks = json['RightEyeRemarks']; + leftEyeSpherical = json['LeftEyeSpherical']; + leftEyeCylinder = json['LeftEyeCylinder']; + leftEyeAxis = json['LeftEyeAxis']; + leftEyePrism = json['LeftEyePrism']; + leftEyeVA = json['LeftEyeVA']; + leftEyeRemarks = json['LeftEyeRemarks']; + pD = json['PD']; + bVD = json['BVD']; + status = json['Status']; + isActive = json['IsActive']; + createdOn = json['CreatedOn']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['SetupID'] = this.setupID; + data['PatientId'] = this.patientId; + data['EncounterType'] = this.encounterType; + data['EncounterNo'] = this.encounterNo; + data['VisionType'] = this.visionType; + data['RightEyeSpherical'] = this.rightEyeSpherical; + data['RightEyeCylinder'] = this.rightEyeCylinder; + data['RightEyeAxis'] = this.rightEyeAxis; + data['RightEyePrism'] = this.rightEyePrism; + data['RightEyeVA'] = this.rightEyeVA; + data['RightEyeRemarks'] = this.rightEyeRemarks; + data['LeftEyeSpherical'] = this.leftEyeSpherical; + data['LeftEyeCylinder'] = this.leftEyeCylinder; + data['LeftEyeAxis'] = this.leftEyeAxis; + data['LeftEyePrism'] = this.leftEyePrism; + data['LeftEyeVA'] = this.leftEyeVA; + data['LeftEyeRemarks'] = this.leftEyeRemarks; + data['PD'] = this.pD; + data['BVD'] = this.bVD; + data['Status'] = this.status; + data['IsActive'] = this.isActive; + data['CreatedOn'] = this.createdOn; + return data; + } +} + + + diff --git a/lib/core/model/eye/AppointmentFilter.dart b/lib/core/model/eye/AppointmentFilter.dart new file mode 100644 index 00000000..1f4b0ae5 --- /dev/null +++ b/lib/core/model/eye/AppointmentFilter.dart @@ -0,0 +1,12 @@ +import 'AppoimentAllHistoryResult.dart'; + +class AppointmentFilter { + List appointmentAllHistoryResultList = List(); + String filterName; + + AppointmentFilter( + AppoimentAllHistoryResultList allHistoryResultList, String filterName) { + appointmentAllHistoryResultList.add(allHistoryResultList); + this.filterName = filterName; + } +} diff --git a/lib/core/service/medical/EyeService.dart b/lib/core/service/medical/EyeService.dart new file mode 100644 index 00000000..879acbbf --- /dev/null +++ b/lib/core/service/medical/EyeService.dart @@ -0,0 +1,26 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class EyeService extends BaseService { + List appoimentAllHistoryResultList = List(); + + getEyeMeasurement() async { + hasError = false; + super.error = ""; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['IsIrisPrescription'] = true; + await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, + onSuccess: (response, statusCode) async { + appoimentAllHistoryResultList.clear(); + response['AppoimentAllHistoryResultList'].forEach((appoitment) { + appoimentAllHistoryResultList + .add(AppoimentAllHistoryResultList.fromJson(appoitment)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/viewModels/medical/EyeViewModel.dart b/lib/core/viewModels/medical/EyeViewModel.dart new file mode 100644 index 00000000..d6c3bf80 --- /dev/null +++ b/lib/core/viewModels/medical/EyeViewModel.dart @@ -0,0 +1,46 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; +import 'package:diplomaticquarterapp/core/model/eye/AppointmentFilter.dart'; +import 'package:diplomaticquarterapp/core/service/medical/EyeService.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; + +class EyeViewModel extends BaseViewModel { + EyeService _eyeService = locator(); + + List get appoimentAllHistoryResultList => + _eyeService.appoimentAllHistoryResultList; + + List appointmentFilter = List(); + + getEyeMeasurement() async { + setState(ViewState.Busy); + await _eyeService.getEyeMeasurement(); + if (_eyeService.hasError) { + error = _eyeService.error; + setState(ViewState.Error); + } else { + _eyeService.appoimentAllHistoryResultList.forEach((element) { + List _appointmentFilter = appointmentFilter + .where( + (elementFilter) => + elementFilter.filterName == element.projectName, + ) + .toList(); + + if (_appointmentFilter.length != 0) { + appointmentFilter[appointmentFilter.indexOf(_appointmentFilter[0])] + .appointmentAllHistoryResultList + .add(element); + } else { + appointmentFilter.add(AppointmentFilter( + element, + element.projectName, + )); + } + }); + + setState(ViewState.Idle); + } + } +} diff --git a/lib/locator.dart b/lib/locator.dart index 6c27dfe0..4c5a1df3 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -11,6 +11,7 @@ import 'core/service/feedback/feedback_service.dart'; import 'core/service/hospital_service.dart'; import 'core/service/medical/BloodPressureService.dart'; import 'core/service/medical/BloodSugarService.dart'; +import 'core/service/medical/EyeService.dart'; import 'core/service/medical/PatientSickLeaveService.dart'; import 'core/service/medical/WeightPressureService.dart'; import 'core/service/medical/labs_service.dart'; @@ -27,6 +28,7 @@ import 'core/viewModels/er/near_hospital_view_model.dart'; import 'core/viewModels/feedback/feedback_view_model.dart'; import 'core/service/medical/reports_service.dart'; import 'core/viewModels/hospital_view_model.dart'; +import 'core/viewModels/medical/EyeViewModel.dart'; import 'core/viewModels/medical/blood_pressure_view_model.dart'; import 'core/viewModels/medical/labs_view_model.dart'; import 'core/viewModels/medical/medical_view_model.dart'; @@ -77,6 +79,7 @@ void setupLocator() { locator.registerLazySingleton(() => BloodSugarService()); locator.registerLazySingleton(() => BloodPressureService()); locator.registerLazySingleton(() => WeightService()); + locator.registerLazySingleton(() => EyeService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -102,5 +105,6 @@ void setupLocator() { locator.registerFactory(() => BloodSugarViewMode()); locator.registerFactory(() => BloodPressureViewMode()); locator.registerFactory(() => WeightPressureViewMode()); + locator.registerFactory(() => EyeViewModel()); } diff --git a/lib/pages/medical/doctor/doctor_home_page.dart b/lib/pages/medical/doctor/doctor_home_page.dart index 7a01ef90..d406b889 100644 --- a/lib/pages/medical/doctor/doctor_home_page.dart +++ b/lib/pages/medical/doctor/doctor_home_page.dart @@ -95,35 +95,7 @@ class DoctorHomePage extends StatelessWidget { return DoctorView( doctor: doctorList, ); - /* InkWell( - onTap: () async { - model - .getDoctorProfileAndRating( - doctorId: doctor.doctorID, - clinicID: doctor.clinicID, - projectID: doctor.projectID) - .then((value) { - var asd=""; - Navigator.push( - context, - FadePage( - page: DoctorView(doctor: model.doctorList,), - ), - ); - }).catchError((e){ - var asd=""; - }); - }, - child: DoctorCard( - name: doctor.doctorName, - profileUrl: doctor.doctorImageURL, - rat: doctor.doctorRate.toDouble(), - subName: DateUtil.getMonthDayYearDateFormatted( - doctor.appointmentDate), - ), - )*/ - ; }).toList(), )), ) diff --git a/lib/pages/medical/eye/ClassesPage.dart b/lib/pages/medical/eye/ClassesPage.dart new file mode 100644 index 00000000..7904178c --- /dev/null +++ b/lib/pages/medical/eye/ClassesPage.dart @@ -0,0 +1,126 @@ +import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ClassesPage extends StatelessWidget { + final ListHISGetGlassPerscription glassPerscription; + + const ClassesPage({Key key, this.glassPerscription}) : super(key: key); + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(top: 70, left: 15, right: 15, bottom: 15), + child: Column( + children: [ + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).rightEye, + fontSize: 23, + bold: true, + ), + ), + getRow(TranslationBase.of(context).sphere, '${glassPerscription.rightEyeSpherical}', '-'), + getRow(TranslationBase.of(context).cylinder, '${glassPerscription.rightEyeCylinder}', '-'), + getRow(TranslationBase.of(context).axis, '${glassPerscription.rightEyeAxis}', '-'), + getRow(TranslationBase.of(context).prism, '${glassPerscription.rightEyePrism}', '-'), + getRow(TranslationBase.of(context).va, '${glassPerscription.rightEyeVA}', '-'), + ], + ), + ), + SizedBox( + height: 17, + ), + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).leftEye, + fontSize: 23, + bold: true, + ), + ), + getRow(TranslationBase.of(context).sphere, '${glassPerscription.leftEyeSpherical}', '-'), + getRow(TranslationBase.of(context).cylinder, '${glassPerscription.leftEyeCylinder}', '-'), + getRow(TranslationBase.of(context).axis, '${glassPerscription.leftEyeAxis}', '-'), + getRow(TranslationBase.of(context).prism, '${glassPerscription.leftEyePrism}', '-'), + getRow(TranslationBase.of(context).va, '${glassPerscription.leftEyeVA}', '-'), + ], + ), + ), + SizedBox( + height: 17, + ), + Container( + width: double.infinity, + child: SecondaryButton( + label: TranslationBase.of(context).sendEmail, + textColor: Colors.white, + color: Colors.red[700], + icon: Icon( + Icons.email, + color: Colors.white, + ), + ), + ) + ], + ), + ), + ), + ), + ); + } + + Widget getRow(String title, String val1, String val2) => Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(flex: 4, child: Texts(title)), + Expanded( + flex: 2, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Texts(val1 == 'null' ? '-' : val1), + Texts(val2 != 'null' ? '-' :val2), + ], + ), + ) + ], + ), + Divider() + ], + ), + ); +} diff --git a/lib/pages/medical/eye/ContactLensPage.dart b/lib/pages/medical/eye/ContactLensPage.dart new file mode 100644 index 00000000..26503c89 --- /dev/null +++ b/lib/pages/medical/eye/ContactLensPage.dart @@ -0,0 +1,129 @@ +import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ContactLensPage extends StatelessWidget { + final ListHISGetContactLensPerscription listHISGetContactLensPerscription; + + const ContactLensPage({Key key, this.listHISGetContactLensPerscription}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(top: 70, left: 15, right: 15, bottom: 15), + child: Column( + children: [ + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).rightEye, + fontSize: 23, + bold: true, + ), + ), + getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription.brand}'), + getRow('B.C', '${listHISGetContactLensPerscription.baseCurve}'), + getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription.power}'), + getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription.diameter}'), + getRow('OZ', '${listHISGetContactLensPerscription.oZ}'), + getRow('CT', '${listHISGetContactLensPerscription.cT}'), + getRow('Blend', '${listHISGetContactLensPerscription.blend}'), + getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription.remarks}'), + + + ], + ), + ), + SizedBox( + height: 17, + ), + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).leftEye, + fontSize: 23, + bold: true, + ), + ), + getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription.brand}'), + getRow('B.C', '${listHISGetContactLensPerscription.baseCurve}'), + getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription.power}'), + getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription.diameter}'), + getRow('OZ', '${listHISGetContactLensPerscription.oZ}'), + getRow('CT', '${listHISGetContactLensPerscription.cT}'), + getRow('Blend', '${listHISGetContactLensPerscription.blend}'), + getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription.remarks}'), + ], + ), + ), + SizedBox( + height: 17, + ), + Container( + width: double.infinity, + child: SecondaryButton( + label: TranslationBase.of(context).sendEmail, + textColor: Colors.white, + color: Colors.red[700], + icon: Icon( + Icons.email, + color: Colors.white, + ), + ), + ) + ], + ), + ), + ), + ); + } + + Widget getRow(String title, String val1) => Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded(flex: 4, child: Texts(title)), + Expanded( + flex: 2, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(val1 == 'null' ? '-' : val1), + ], + ), + ) + ], + ), + Divider() + ], + ), + ); +} diff --git a/lib/pages/medical/eye/EyeHomePage.dart b/lib/pages/medical/eye/EyeHomePage.dart new file mode 100644 index 00000000..18cc9b77 --- /dev/null +++ b/lib/pages/medical/eye/EyeHomePage.dart @@ -0,0 +1,128 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'ClassesPage.dart'; +import 'ContactLensPage.dart'; + +class EyeHomePage extends StatefulWidget { + final AppoimentAllHistoryResultList appointmentAllHistoryResultList; + + const EyeHomePage({Key key, this.appointmentAllHistoryResultList}) + : super(key: key); + + @override + _EyeHomePageState createState() => _EyeHomePageState(); +} + +class _EyeHomePageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).measurements, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(60.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 55.0, + margin: EdgeInsets.only(left: 20,right: 20,top: 15), + color: Colors.white, + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + indicatorColor: Colors.red[800], + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts(TranslationBase.of(context).classes), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts(TranslationBase.of(context).contactLens), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + ClassesPage( + glassPerscription: widget.appointmentAllHistoryResultList + .listHISGetGlassPerscription[0], + ), + ContactLensPage( + listHISGetContactLensPerscription: widget + .appointmentAllHistoryResultList + .listHISGetContactLensPerscription[0], + ) + ], + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/medical/eye/EyeMeasurementsPage.dart b/lib/pages/medical/eye/EyeMeasurementsPage.dart new file mode 100644 index 00000000..8dbe0f16 --- /dev/null +++ b/lib/pages/medical/eye/EyeMeasurementsPage.dart @@ -0,0 +1,123 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import 'EyeHomePage.dart'; + +class EyeMeasurementsPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getEyeMeasurement(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBarTitle: TranslationBase.of(context).eyeMeasurements, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(8), + child: Column( + children: [ + ...List.generate( + model.appointmentFilter.length, + (index) => AppExpandableNotifier( + title: model.appointmentFilter[index].filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model.appointmentFilter[index] + .appointmentAllHistoryResultList + .map((appointment) { + return InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: EyeHomePage( + appointmentAllHistoryResultList: appointment, + ), + ), + ); + }, + child: Container( + margin: EdgeInsets.all(8), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + color: Colors.white, + border: Border.all(color: Colors.grey), + ), + child: Row( + children: [ + Expanded( + flex: 1, + child: LargeAvatar( + name: appointment.doctorNameObj, + url: appointment.doctorImageURL, + ), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + appointment.doctorNameObj, + bold: true, + ), + Texts( + appointment.clinicName, + variant: 'caption3', + ), + Texts( + DateUtil.getMonthDayYearDateFormatted( + appointment.bookDate), + variant: 'caption3', + ), + StarRating( + totalAverage: appointment + .actualDoctorRate + .toDouble(), + forceStars: true), + ], + ), + ), + ), + Icon( + projectViewModel.isArabic + ? Icons.arrow_forward_ios + : Icons.arrow_back_ios, + color: Colors.grey, + size: 18, + ) + ], + ), + ), + ); + }).toList(), + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 85bd0e95..2ac090b9 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -28,6 +28,8 @@ import 'balance/my_balance_page.dart'; import 'doctor/doctor_home_page.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; +import 'eye/EyeHomePage.dart'; +import 'eye/EyeMeasurementsPage.dart'; import 'labs/labs_home_page.dart'; import 'my_trackers/my_trackers.dart'; @@ -222,11 +224,12 @@ class _MedicalProfilePageState extends State { Expanded( flex: 1, child: InkWell( - //TODO -// onTap: () { -// Navigator.push(context, -// FadePage(page: InsuranceApproval())); -// }, + onTap: () { + Navigator.push( + context, + FadePage( + page: EyeMeasurementsPage())); + }, child: MedicalProfileItem( title: TranslationBase.of(context).eye, imagePath: diff --git a/lib/pages/medical/prescriptions/prescriptions_home_page.dart b/lib/pages/medical/prescriptions/prescriptions_home_page.dart index e6e3e6db..182fca30 100644 --- a/lib/pages/medical/prescriptions/prescriptions_home_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_home_page.dart @@ -37,7 +37,7 @@ class _HomePrescriptionsPageState extends State onModelReady: (model) => model.getPrescriptions(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).myDoctor, + appBarTitle: TranslationBase.of(context).prescriptions, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index ba89fc2c..adb1a5fc 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -557,6 +557,21 @@ class TranslationBase { String get ok => localizedValues['Ok'][locale.languageCode]; String get theVerificationCodeExpiresIn => localizedValues['TheVerificationCodeExpiresIn'][locale.languageCode]; String get pleaseEnterTheVerificationCode => localizedValues['PleaseEnterTheVerificationCode'][locale.languageCode]; + String get eyeMeasurements => localizedValues['EyeMeasurements'][locale.languageCode]; + String get measurements => localizedValues['Measurements'][locale.languageCode]; + String get classes => localizedValues['Classes'][locale.languageCode]; + String get contactLens => localizedValues['ContactLens'][locale.languageCode]; + String get rightEye => localizedValues['RightEye'][locale.languageCode]; + String get sphere => localizedValues['Sphere'][locale.languageCode]; + String get cylinder => localizedValues['Cylinder'][locale.languageCode]; + String get axis => localizedValues['Axis'][locale.languageCode]; + String get prism => localizedValues['Prism'][locale.languageCode]; + String get va => localizedValues['VA'][locale.languageCode]; + String get leftEye => localizedValues['LeftEye'][locale.languageCode]; + String get brand => localizedValues['Brand'][locale.languageCode]; + String get power => localizedValues['Power'][locale.languageCode]; + String get diameter => localizedValues['Diameter'][locale.languageCode]; + String get remarks => localizedValues['Remarks'][locale.languageCode]; } diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index b7c4a185..b9143682 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -117,6 +117,7 @@ class DoctorCard extends StatelessWidget { ), ), ), + if(onEmailTap!=null) InkWell( onTap: onEmailTap, child: Icon( From f582eee991db82c2f12c9bf3b8a198ee7ea2838b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 23 Sep 2020 09:39:51 +0300 Subject: [PATCH 07/33] 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 08/33] 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 2952fd56ab8981e217c2d57ddb04cf12f92349ff Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 24 Sep 2020 12:21:50 +0300 Subject: [PATCH 09/33] Done Active Medications Service --- android/app/src/main/AndroidManifest.xml | 12 +- .../diplomaticquarterapp/MainActivity.kt | 41 +- .../app/src/main/res/drawable/app_icon.png | Bin 0 -> 1912 bytes android/app/src/main/res/drawable/food.png | Bin 0 -> 1789 bytes android/app/src/main/res/drawable/me.png | Bin 0 -> 1021 bytes .../main/res/drawable/sample_large_icon.png | Bin 0 -> 180 bytes .../src/main/res/drawable/secondary_icon.png | Bin 0 -> 1073 bytes android/app/src/main/res/raw/keep.xml | 3 + .../src/main/res/raw/slow_spring_board.mp3 | Bin 0 -> 37616 bytes ios/Runner.xcodeproj/project.pbxproj | 618 ------------------ .../contents.xcworkspacedata | 7 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../xcshareddata/WorkspaceSettings.xcsettings | 8 - .../xcshareddata/xcschemes/Runner.xcscheme | 91 --- .../contents.xcworkspacedata | 10 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../xcshareddata/WorkspaceSettings.xcsettings | 8 - ios/Runner/AppDelegate.swift | 13 - ios/Runner/Info.plist | 2 + ios/Runner/Runner-Bridging-Header.h | 1 - lib/config/config.dart | 3 + .../ActivePrescriptionReport.dart | 146 +++++ .../medical/ActiveMedicationsService.dart | 27 + .../medical/ActiveMedicationsViewModel.dart | 28 + lib/locator.dart | 4 + lib/pages/landing/landing_page.dart | 70 +- lib/pages/login/login.dart | 3 +- .../ActiveMedicationsPage.dart | 129 ++++ .../active_medications/reminder_page.dart | 263 ++++++++ lib/pages/medical/medical_profile_page.dart | 5 +- lib/uitl/CalendarUtils.dart | 77 +++ lib/uitl/LocalNotification.dart | 97 +++ lib/uitl/utils.dart | 7 + pubspec.yaml | 4 + 34 files changed, 907 insertions(+), 786 deletions(-) create mode 100644 android/app/src/main/res/drawable/app_icon.png create mode 100644 android/app/src/main/res/drawable/food.png create mode 100644 android/app/src/main/res/drawable/me.png create mode 100644 android/app/src/main/res/drawable/sample_large_icon.png create mode 100644 android/app/src/main/res/drawable/secondary_icon.png create mode 100644 android/app/src/main/res/raw/keep.xml create mode 100644 android/app/src/main/res/raw/slow_spring_board.mp3 delete mode 100644 ios/Runner.xcodeproj/project.pbxproj delete mode 100644 ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings delete mode 100644 ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme delete mode 100644 ios/Runner.xcworkspace/contents.xcworkspacedata delete mode 100644 ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings delete mode 100644 ios/Runner/AppDelegate.swift delete mode 100644 ios/Runner/Runner-Bridging-Header.h create mode 100644 lib/core/model/active_medications/ActivePrescriptionReport.dart create mode 100644 lib/core/service/medical/ActiveMedicationsService.dart create mode 100644 lib/core/viewModels/medical/ActiveMedicationsViewModel.dart create mode 100644 lib/pages/medical/active_medications/ActiveMedicationsPage.dart create mode 100644 lib/pages/medical/active_medications/reminder_page.dart create mode 100644 lib/uitl/CalendarUtils.dart create mode 100644 lib/uitl/LocalNotification.dart diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 884c7e09..f1a5a3f8 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -15,7 +15,8 @@ - + + + + + + + + + + + diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt index b8a87c8c..35ce314d 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt @@ -1,11 +1,36 @@ package com.cloud.diplomaticquarterapp -import androidx.annotation.NonNull; - import io.flutter.embedding.android.FlutterFragmentActivity - import io.flutter.embedding.engine.FlutterEngine - import io.flutter.plugins.GeneratedPluginRegistrant +import android.content.ContentResolver +import android.content.Context +import android.media.RingtoneManager +import io.flutter.embedding.android.FlutterActivity +import io.flutter.embedding.engine.FlutterEngine +import io.flutter.plugin.common.MethodCall +import io.flutter.plugin.common.MethodChannel +import io.flutter.plugins.GeneratedPluginRegistrant -class MainActivity: FlutterFragmentActivity() { - override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { - GeneratedPluginRegistrant.registerWith(flutterEngine); - } +class MainActivity : FlutterActivity() { + override fun configureFlutterEngine(flutterEngine: FlutterEngine) { + GeneratedPluginRegistrant.registerWith(flutterEngine) + MethodChannel(flutterEngine.dartExecutor, "crossingthestreams.io/resourceResolver").setMethodCallHandler { call: MethodCall, result: MethodChannel.Result -> + if ("drawableToUri" == call.method) { + val resourceId = this@MainActivity.resources.getIdentifier(call.arguments as String, "drawable", this@MainActivity.packageName) + result.success(resourceToUriString(this@MainActivity.applicationContext, resourceId)) + } + if ("getAlarmUri" == call.method) { + result.success(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM).toString()) + } + } + } + + companion object { + private fun resourceToUriString(context: Context, resId: Int): String { + return (ContentResolver.SCHEME_ANDROID_RESOURCE + + "://" + + context.resources.getResourcePackageName(resId) + + "/" + + context.resources.getResourceTypeName(resId) + + "/" + + context.resources.getResourceEntryName(resId)) + } + } } \ No newline at end of file diff --git a/android/app/src/main/res/drawable/app_icon.png b/android/app/src/main/res/drawable/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c4cc798d7408b624d2be0ae7a5276c50aa9ee25b GIT binary patch literal 1912 zcmZuydpy(YAK!l1W(Xk)uQQXE>+HKNm7Q&}VU|mCZC>=t7@BNjn_TKtTb<&_QG_9v za*NZHNRlI3p)E^Fox2p^WQO;u^iA1@81^!ersIJd!T6xfn_Y4t$Kw1VW1A_`LnJ58rb|6E@ z@bSh+@;Hu67B3>oF_{yuM1w$tWV~|Ai4rmq$(%T@0G~`menjAvdzBlFM0|t@4-=6L zA3B1<<3}N!9CtVZND>@@KoIz>XuQ9h$LDb6iHJNT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cnE%htmWPcBJ znCul>Y%$3@lO9SR$<7{s_pVi-Q+(9nEnR>f?0*3C58Ew6!KE_Pbo)46k;UlIs|PLw zi60wkQzQoZJx6f$iQStIWzuhLj$e{5TFl5?FZpEbE`oJZO-lN8U|kDp;Le;72o<}# zN!`lgH;+l+r^HZ1?Vh2Y-(I@=GPW_9IPD|fl1{;qp5}W2*~`n5cba9xep_R`*i=N2 zJ^rvLb1}gqE#{t-C|#JhFOi!Y`1V3=jn36(xHRYF?Mn>3_Dr1HzD$kwjpmgeV6=hTos;d(ga)Ca!Ukfl3^NGDEM!n?5Y9#ifTss*Qb4vn4(> z#iNa4Tf^IF`RYAc$0v_<+`Sod{~JYoKo+puTko2*-DTIkyr)pGd}(4dsjh7mV_4;6 zV>D&<)6|>#xzv#Ya)PD*4^7U+hQGIEA5~*kH98VlV>Tj$L|gs4WhOg%bFFS{*)r?$ zmU&H+_aDqIdXUWoo6Dpy&KI3#C}(NFV#D+H-b`eF47I~pl(bROCR{|4%^)Mo>Zra7 z7JUH=(k(1T&>GmU!8`EtT)YksE+~cVi~l8>W1T8 z^l4FH*_#-WZSe5#e%t~ugl^Ue0prgM7VGM}VISXk>S7pZJ!(3hN3yz8H|}jowZ8K1 zYiMdaVA^bRDMjDodTWO442NUK)2keVd{O0f;oy0AJN3F@WdWs>KVSC?VS!mt0-olD zovc~VWOa(q;&?o`KDcsT!Mz{72+3jF%@gD3B-7~k7@&GI1?;HQLj z4D?8=C-$ewe|*Jy-jwT4UzydDa8Fsfdn}9xZIw$w=H{~ATenR~jLMm2j{P=qUVZEk ba&_LNsHUcTP+UHw`VMLCzHW8oaPhwYY>_fz literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable/food.png b/android/app/src/main/res/drawable/food.png new file mode 100644 index 0000000000000000000000000000000000000000..41b394d380a0ca9d6ebaa45c2ddb64d1ba7be0c2 GIT binary patch literal 1789 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D29il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g8FiREWz@w!Euz}MMmKGV*`|p3n90wIH~<7W&^;11NbD-H5X`=?-JAvzCEh4W zNqNxL-8)#U#IFSN0BQ3T$TifN|5C&c4*X<}+1$YUi&U#WIKzelzDOOf2M_G?dJ8SI f&_WCUV_4R|jPWVYtkgm#00000NkvXXu0mjfhB8mW literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable/me.png b/android/app/src/main/res/drawable/me.png new file mode 100644 index 0000000000000000000000000000000000000000..ba75bc55bf4433d4fc364089c7556b6e119da94d GIT binary patch literal 1021 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D1CmKZK~!i%?U-Lk zQ&AkpXF^dv^io7%^ks%)nGl7N;X^{GU_t+< zXp}kA{yjw`6(Q+^z9f;lQReyeJ9odq_4-rX+Rhg23m2y{gcaaf?!!d)u5GFrA-%eALPjTV$(F-0@j1 zv=KuSZ^>4jumSCxA4zB$)Pg;?4GUOr*AT9I)1-v*!GJH ztVhm~bGMxBd+qL@*-bX;V=nov-2w#g{-OmH#(+x*#22vafuRcoO)0 z9$*#4h+cSJ^Z5et$2}NyP>kq>J8_LOR{?&Nu2PKX<@N_(a^{K{q!`f)kI*DztcnSW r5xwvT1sP*S1cDSJrIb=)WitH*z#@M?8?WqE00000NkvXXu0mjfQ^nfk literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable/sample_large_icon.png b/android/app/src/main/res/drawable/sample_large_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f354ca234d31b0d663336c154933042eb1513bdb GIT binary patch literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDB3?!H8JlO)ID|0t=hP86DQPxDme>0B8wRq_>O=u<5X=vX`rBur;B5VMQ?I~ z1nc64qys8qix`vx88%lWJG(G-xJ)(>5=#wWpPX?ZaMQ+xv5YQ@PIt5#v8Xnj2sB7y ZWQg9zdAz9V#xviX literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable/secondary_icon.png b/android/app/src/main/res/drawable/secondary_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..9de9ff41bdae5d1b3a2bfceb45861d035b8ec7fc GIT binary patch literal 1073 zcmV-11kU@3P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGw)c^n-)dAs~2Fw5e02y>eSaefwW^{L9 za%BK;VQFr3E^cLXAT%y8E;2FkAZe8V00W^(L_t(oN7dI`$WB=p!12!vGfaa-j-!!s zm_mk>V{(i^j-`plG(|3^apzQW;gCe4kPDHBa)DwbB3y8T$eEF2&So5PX8iy4J@xk5 z-@Es_eQD;YUwysbT5GSp*0T<~B1e3Q`S>@*1bmkG&vobv%)reQV^AD5&;>m!|E{*E zg9a(SLSfW|qjn2_VHBz@9Hk#H35&4~YvELm$9E_mffhK8n9}{V&q{m`qdP9Z|386KmpPw&Gb=dn zg&lbghkOqfVtS=zIE;sQiNcN@gD>WE4~1>cMRBfG87AQrJU}$;-#rwk=_P z?S!3=`Zq8VcFNBAj7(vLX>drRF^9PyzCqTgkBM-^q8+z{z9=iY!MCx2w>W@iC=NUB zs#;ztDM1}ESL8{=v>%15E>pOg4#J8yup3F8G0d?wh_@eyqy+UhH^j?`vRhFLsqs5v zN&k(ms4B8{$nf`Ja7(bPNpC)tjK(+*D>yncQ7X#mP{e9Pc}J;aPMQx-Vc}D#Y9&SF z=}<@9hUKrKEfT{exD?U&Z1})Zk*7m-VP0C^Ss0GQIu_go3qHd@q(z<%`TqrQ^;*ZX z(AD};G=fXhLhcoATxpS~Lx!h*Y?yx{aVDDL8Z6}D*$Qcqw?l5Qk*g<=xMRE5M6!7b zyZxs{-VS-{$0^{dPV7(V}v|(6Fbxp-eD}{Nd1Vk$lIac@B-G^ zj>H`L7CT@echR4a7Czkb%PWeSBQ31sxfiFwJS46%d+BnFf{T#(dQe8V*?L&}43CjP zs4|AY^UK06eecHA9lh}wKI1InCYcyco6FF`T7ks*%^8mPHrTei^m?S8_@nU}R&phb zK$b*J3p?YbKT^WBdm%NfxDhc*XW*B^r-U!$i+K-^c0DpOkA6G2TSsL#N-tP>lDsxd zTyxU4oT`1Ohs@zJ^fGl1(J8+YX2E-M)^N99g?|w3IN}{pb{g2JKDdKu>=pdbn~L~c zcGMht`M1BhI{l#ZCE`?fWc)_+ew{lft>`j!--w2T`LGv$LYoguumOiq__ZQ8+AYX( zU}p-iwv!QGB3U^qo>lJR + \ No newline at end of file diff --git a/android/app/src/main/res/raw/slow_spring_board.mp3 b/android/app/src/main/res/raw/slow_spring_board.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..60dbf9794d2d1270b43308ab84425261ba2f5b19 GIT binary patch literal 37616 zcmZ6SWmHt(7x(YX&Q##mJHzN5-yrPPz^qp4D@; zb-t0XX(o9`K@PPwF%`zUJ_D47V4&0M&puF^*^7w6qj;OQMM_B8Dx64}h5|_=;-5ZQ z`+@WI?c#xevU!R>SyL*BE%dsqj#l_Pc=En<E93mZa1Q z-ruZBH~jtLj6{T7<0Yl(e7))#tBOf}m#+kpL{7_!$7C+4T$|DeYHw;PTYS&slO~g6 z#R9t{XOr@f=A@-^gP-$r=Y9^5Wp3pX?ka1D4P@#;a1DV?Pb4eaEn!fg_*GYa+v>E) z-B$2s=OA3pU*S5?@QpVIWmcxeIdO&nRXOdEKdtu=6;~(nO(YBQFqQxzk??h?Ku*~? zV>3%5snU+LJcZ*??0f^U_-O@=lwb~suJE`q?18E!PvV4zW+J?hoC~WWSg1>6^O`Nw zaE~KdJvR%bImzP}?h-S-3d8dcz^~V@IydQ$kJ7#KxZKJtKUtXwoubIKSS4c<`t=r$jzX(VQ} zSbA>k=Dd$pkj%XEOPvubMB3b+PRn^|l5Xmwu$MomA3Af?Kjv$m_<_>y`fk&avn7G} zIgfu2lPl$(% zn8rcnZ5DCOlQapA#6h|{d12K$W)m*!79LOX=qB>Km5$U>sN9p1Nmv}HlU$7c#QXlb zxXIJz8uzO!=$-aDPWhc@M?Bp4Q8~s-isQo_bp;+m3&adou1>8+B)Dc>Sm3cuwW&?{JT0 z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4^{l`$zc_`sBe~#Hrm*zsAhOEx)m*pS%v@gp4iYigSPfQH2&)xo} zYHG!qJes3+n2eG<4yp!$t<#*Vd?e-2Rz*LRpjYhU7)% z`A3g8x{BS97b_>{CwrAzSCPRng>h{djt6TRO|Bf{rqtO~(9<=SZ0pQ`&GjTtD0Uid->eAL zCyyYIq}j$`s3}NFm?sbS!5BU1jcmaL&xIup@%E2)CA5d+ChNC_xRcZ!72+qlu%X{u9yw)Bc63OVj=gngc2gG)v|FQjrKQkI zmp%8yMO{dwc#ecSYwZjfL6wWPSP_g+1)33-PZ$pz6Cs?z?rx&OLH%(}?U@4p`qteM zH6wAh$L2y8)}9@$N_V}|5Fi+W;8E!nfX{^97AL*{y;t=4ML2J~wrf=bpBQga%n+0^ zD+@TRDU>I%NdQ4$2SpV$(eKFD#1_?<5CObaNR{o237b1Z?&K<*iP5HYTlO3xeE9Ihdg#jmDO@;bfWx zhV&lfi=o&!!P7TKn{;Z(fXGStW-!@qlk$B#5w*vENeH1H+SwfLat;$X6<vL}O zsk*=YEJdg%@ew&Wqh)r#yd9 za!fKzV&;;C*b&KZ-pxUV z**E`Ihvh7!oJDT}jm))dmQcZNc6D^IN@d_un%<6MCUP z_lL=QKsAokHRM1)i4e^G*8&Y(^AW=f>=dDW`(l4u1Wo76`Q9bAkwd zNRRwJ#_eb;Vh{pU@3OIhPSrV=9AEIoQOCF_%2cv%UAWIT^y`KjC;Hm~{I^^BYwk0l ey3$9$RSwbAQKP5lQ>3Q{_+MB3zrg?94g3dACdG&V literal 0 HcmV?d00001 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 5ba52820..00000000 --- a/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,618 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 5A016D0DD1095D385566337C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AC606583E610E227F8186476 /* Pods_Runner.framework */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 09DDD2020D673759BD0E86B8 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A8949DBAE70E5B302D91F1DB /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - AC606583E610E227F8186476 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - E2D9C922B5D0172FE487333D /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 5A016D0DD1095D385566337C /* Pods_Runner.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 0A1F078D9C068A8B18DE1EDB /* Pods */ = { - isa = PBXGroup; - children = ( - A8949DBAE70E5B302D91F1DB /* Pods-Runner.debug.xcconfig */, - E2D9C922B5D0172FE487333D /* Pods-Runner.release.xcconfig */, - 09DDD2020D673759BD0E86B8 /* Pods-Runner.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; - 44EDA189DE1BB86E3A41BD4A /* Frameworks */ = { - isa = PBXGroup; - children = ( - AC606583E610E227F8186476 /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 0A1F078D9C068A8B18DE1EDB /* Pods */, - 44EDA189DE1BB86E3A41BD4A /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - B4860726BBF5BF6213BBC91C /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 72E9699567A7106FD141B9B3 /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1020; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1100; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 72E9699567A7106FD141B9B3 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../Flutter/Flutter.framework", - "${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework", - "${BUILT_PRODUCTS_DIR}/MTBBarcodeScanner/MTBBarcodeScanner.framework", - "${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework", - "${BUILT_PRODUCTS_DIR}/Protobuf/protobuf.framework", - "${BUILT_PRODUCTS_DIR}/Reachability/Reachability.framework", - "${BUILT_PRODUCTS_DIR}/SwiftProtobuf/SwiftProtobuf.framework", - "${BUILT_PRODUCTS_DIR}/TOCropViewController/TOCropViewController.framework", - "${BUILT_PRODUCTS_DIR}/barcode_scan/barcode_scan.framework", - "${BUILT_PRODUCTS_DIR}/connectivity/connectivity.framework", - "${BUILT_PRODUCTS_DIR}/device_info/device_info.framework", - "${BUILT_PRODUCTS_DIR}/flutter_flexible_toast/flutter_flexible_toast.framework", - "${BUILT_PRODUCTS_DIR}/flutter_inappwebview/flutter_inappwebview.framework", - "${BUILT_PRODUCTS_DIR}/flutter_local_notifications/flutter_local_notifications.framework", - "${BUILT_PRODUCTS_DIR}/flutter_plugin_android_lifecycle/flutter_plugin_android_lifecycle.framework", - "${BUILT_PRODUCTS_DIR}/hexcolor/hexcolor.framework", - "${BUILT_PRODUCTS_DIR}/image_cropper/image_cropper.framework", - "${BUILT_PRODUCTS_DIR}/image_picker/image_picker.framework", - "${BUILT_PRODUCTS_DIR}/local_auth/local_auth.framework", - "${BUILT_PRODUCTS_DIR}/manage_calendar_events/manage_calendar_events.framework", - "${BUILT_PRODUCTS_DIR}/map_launcher/map_launcher.framework", - "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", - "${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework", - "${BUILT_PRODUCTS_DIR}/url_launcher/url_launcher.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MTBBarcodeScanner.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/protobuf.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftProtobuf.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TOCropViewController.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/barcode_scan.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_flexible_toast.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_inappwebview.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_local_notifications.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_plugin_android_lifecycle.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hexcolor.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_cropper.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_picker.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/local_auth.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/manage_calendar_events.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/map_launcher.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - B4860726BBF5BF6213BBC91C /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.cloud.diplomaticquarterapp; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.cloud.diplomaticquarterapp; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.cloud.diplomaticquarterapp; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a16..00000000 --- a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d98100..00000000 --- a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c5..00000000 --- a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index a28140cf..00000000 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc14..00000000 --- a/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d98100..00000000 --- a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c5..00000000 --- a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift deleted file mode 100644 index 70693e4a..00000000 --- a/ios/Runner/AppDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -import UIKit -import Flutter - -@UIApplicationMain -@objc class AppDelegate: FlutterAppDelegate { - override func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - GeneratedPluginRegistrant.register(with: self) - return super.application(application, didFinishLaunchingWithOptions: launchOptions) - } -} diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 8f1009c3..792eb95e 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -22,6 +22,8 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + NSCalendarsUsageDescription + We Need to access the calender to add reminder for you UILaunchStoryboardName LaunchScreen UIMainStoryboardFile diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h deleted file mode 100644 index 308a2a56..00000000 --- a/ios/Runner/Runner-Bridging-Header.h +++ /dev/null @@ -1 +0,0 @@ -#import "GeneratedPluginRegistrant.h" diff --git a/lib/config/config.dart b/lib/config/config.dart index ca902b45..698ff8df 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -218,6 +218,9 @@ const GET_WEIGHT_PRESSURE_RESULT='Services/Patients.svc/REST/Patient_GetWeightMe const ADD_WEIGHT_PRESSURE_RESULT='Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; +const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID='Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID'; + + const TIMER_MIN = 10; diff --git a/lib/core/model/active_medications/ActivePrescriptionReport.dart b/lib/core/model/active_medications/ActivePrescriptionReport.dart new file mode 100644 index 00000000..866cb728 --- /dev/null +++ b/lib/core/model/active_medications/ActivePrescriptionReport.dart @@ -0,0 +1,146 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class ActivePrescriptionReport { + dynamic address; + int appointmentNo; + dynamic clinic; + dynamic companyName; + int days; + dynamic doctorName; + int doseDailyQuantity; + String frequency; + int frequencyNumber; + List image; + String imageExtension; + dynamic imageSRCUrl; + String imageString; + dynamic imageThumbUrl; + dynamic isCovered; + String itemDescription; + int itemID; + DateTime orderDate; + int patientID; + dynamic patientName; + dynamic phoneOffice1; + dynamic prescriptionQR; + int prescriptionTimes; + dynamic productImage; + String productImageBase64; + String productImageString; + int projectID; + dynamic projectName; + dynamic remarks; + String route; + String sKU; + int scaleOffset; + DateTime startDate; + + ActivePrescriptionReport( + {this.address, + this.appointmentNo, + this.clinic, + this.companyName, + this.days, + this.doctorName, + this.doseDailyQuantity, + this.frequency, + this.frequencyNumber, + this.image, + this.imageExtension, + this.imageSRCUrl, + this.imageString, + this.imageThumbUrl, + this.isCovered, + this.itemDescription, + this.itemID, + this.orderDate, + this.patientID, + this.patientName, + this.phoneOffice1, + this.prescriptionQR, + this.prescriptionTimes, + this.productImage, + this.productImageBase64, + this.productImageString, + this.projectID, + this.projectName, + this.remarks, + this.route, + this.sKU, + this.scaleOffset, + this.startDate}); + + ActivePrescriptionReport.fromJson(Map json) { + address = json['Address']; + appointmentNo = json['AppointmentNo']; + clinic = json['Clinic']; + companyName = json['CompanyName']; + days = json['Days']; + doctorName = json['DoctorName']; + doseDailyQuantity = json['DoseDailyQuantity']; + frequency = json['Frequency']; + frequencyNumber = json['FrequencyNumber']; + image = json['Image'].cast(); + imageExtension = json['ImageExtension']; + imageSRCUrl = json['ImageSRCUrl']; + imageString = json['ImageString']; + imageThumbUrl = json['ImageThumbUrl']; + isCovered = json['IsCovered']; + itemDescription = json['ItemDescription']; + itemID = json['ItemID']; + orderDate = DateUtil.convertStringToDate(json['OrderDate']); + patientID = json['PatientID']; + patientName = json['PatientName']; + phoneOffice1 = json['PhoneOffice1']; + prescriptionQR = json['PrescriptionQR']; + prescriptionTimes = json['PrescriptionTimes']; + productImage = json['ProductImage']; + productImageBase64 = json['ProductImageBase64']; + productImageString = json['ProductImageString']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + remarks = json['Remarks']; + route = json['Route']; + sKU = json['SKU']; + scaleOffset = json['ScaleOffset']; + startDate = DateUtil.convertStringToDate(json['StartDate']); + } + + Map toJson() { + final Map data = new Map(); + data['Address'] = this.address; + data['AppointmentNo'] = this.appointmentNo; + data['Clinic'] = this.clinic; + data['CompanyName'] = this.companyName; + data['Days'] = this.days; + data['DoctorName'] = this.doctorName; + data['DoseDailyQuantity'] = this.doseDailyQuantity; + data['Frequency'] = this.frequency; + data['FrequencyNumber'] = this.frequencyNumber; + data['Image'] = this.image; + data['ImageExtension'] = this.imageExtension; + data['ImageSRCUrl'] = this.imageSRCUrl; + data['ImageString'] = this.imageString; + data['ImageThumbUrl'] = this.imageThumbUrl; + data['IsCovered'] = this.isCovered; + data['ItemDescription'] = this.itemDescription; + data['ItemID'] = this.itemID; + data['OrderDate'] = this.orderDate; + data['PatientID'] = this.patientID; + data['PatientName'] = this.patientName; + data['PhoneOffice1'] = this.phoneOffice1; + data['PrescriptionQR'] = this.prescriptionQR; + data['PrescriptionTimes'] = this.prescriptionTimes; + data['ProductImage'] = this.productImage; + data['ProductImageBase64'] = this.productImageBase64; + data['ProductImageString'] = this.productImageString; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['Remarks'] = this.remarks; + data['Route'] = this.route; + data['SKU'] = this.sKU; + data['ScaleOffset'] = this.scaleOffset; + data['StartDate'] = this.startDate; + return data; + } +} diff --git a/lib/core/service/medical/ActiveMedicationsService.dart b/lib/core/service/medical/ActiveMedicationsService.dart new file mode 100644 index 00000000..070b7e5f --- /dev/null +++ b/lib/core/service/medical/ActiveMedicationsService.dart @@ -0,0 +1,27 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/active_medications/ActivePrescriptionReport.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class ActiveMedicationsService extends BaseService{ + + List activePrescriptionReport = List(); + + getActiveMedication() async { + hasError = false; + super.error = ""; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID, + onSuccess: (response, statusCode) async { + activePrescriptionReport.clear(); + response['List_ActiveGetPrescriptionReportByPatientID'].forEach((appoitment) { + activePrescriptionReport + .add(ActivePrescriptionReport.fromJson(appoitment)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + +} \ No newline at end of file diff --git a/lib/core/viewModels/medical/ActiveMedicationsViewModel.dart b/lib/core/viewModels/medical/ActiveMedicationsViewModel.dart new file mode 100644 index 00000000..ee4f37c5 --- /dev/null +++ b/lib/core/viewModels/medical/ActiveMedicationsViewModel.dart @@ -0,0 +1,28 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/active_medications/ActivePrescriptionReport.dart'; +import 'package:diplomaticquarterapp/core/service/medical/ActiveMedicationsService.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; + +class ActiveMedicationsViewModel extends BaseViewModel { + ActiveMedicationsService _activeMedicationsService = + locator(); + + List get activePrescriptionReport => + _activeMedicationsService.activePrescriptionReport; + + getActiveMedication() async { + setState(ViewState.Busy); + await _activeMedicationsService.getActiveMedication(); + if (_activeMedicationsService.hasError) { + error = _activeMedicationsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + + + +} diff --git a/lib/locator.dart b/lib/locator.dart index 4c5a1df3..79e92a63 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -9,6 +9,7 @@ import 'core/service/er/am_service.dart'; import 'core/service/er/er_service.dart'; import 'core/service/feedback/feedback_service.dart'; import 'core/service/hospital_service.dart'; +import 'core/service/medical/ActiveMedicationsService.dart'; import 'core/service/medical/BloodPressureService.dart'; import 'core/service/medical/BloodSugarService.dart'; import 'core/service/medical/EyeService.dart'; @@ -28,6 +29,7 @@ import 'core/viewModels/er/near_hospital_view_model.dart'; import 'core/viewModels/feedback/feedback_view_model.dart'; import 'core/service/medical/reports_service.dart'; import 'core/viewModels/hospital_view_model.dart'; +import 'core/viewModels/medical/ActiveMedicationsViewModel.dart'; import 'core/viewModels/medical/EyeViewModel.dart'; import 'core/viewModels/medical/blood_pressure_view_model.dart'; import 'core/viewModels/medical/labs_view_model.dart'; @@ -80,6 +82,7 @@ void setupLocator() { locator.registerLazySingleton(() => BloodPressureService()); locator.registerLazySingleton(() => WeightService()); locator.registerLazySingleton(() => EyeService()); + locator.registerLazySingleton(() => ActiveMedicationsService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -106,5 +109,6 @@ void setupLocator() { locator.registerFactory(() => BloodPressureViewMode()); locator.registerFactory(() => WeightPressureViewMode()); locator.registerFactory(() => EyeViewModel()); + locator.registerFactory(() => ActiveMedicationsViewModel()); } diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index d892be83..9cd88cd9 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -1,4 +1,5 @@ import 'dart:io'; +import 'dart:typed_data'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; @@ -13,6 +14,8 @@ import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart'; import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; +import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; @@ -21,12 +24,17 @@ import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; +import 'package:rxdart/rxdart.dart'; import 'home_page.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; + + + class LandingPage extends StatefulWidget { static bool isOpenCallPage = false; @@ -43,6 +51,16 @@ class _LandingPageState extends State with WidgetsBindingObserver { final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); final authService = new AuthProvider(); + void _requestIOSPermissions() { + flutterLocalNotificationsPlugin + .resolvePlatformSpecificImplementation< + IOSFlutterLocalNotificationsPlugin>() + ?.requestPermissions( + alert: true, + badge: true, + sound: true, + ); + } bool isPageNavigated = false; _changeCurrentTab(int tab) { @@ -106,6 +124,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { setState(() { AppGlobal.context = context; }); + _requestIOSPermissions(); pageController = PageController(keepPage: true); _firebaseMessaging.setAutoInitEnabled(true); @@ -245,7 +264,9 @@ class _LandingPageState extends State with WidgetsBindingObserver { ); } - showDialog(String message) { + + + showDialogs(String message) { ConfirmDialog dialog = new ConfirmDialog( context: context, confirmMessage: message, @@ -263,10 +284,55 @@ class _LandingPageState extends State with WidgetsBindingObserver { Permission.camera, Permission.photos, Permission.notification, - Permission.accessMediaLocation + Permission.accessMediaLocation, + Permission.calendar, ].request(); + + var permissionsGranted = await deviceCalendarPlugin.hasPermissions(); + if (permissionsGranted.isSuccess && !permissionsGranted.data) { + permissionsGranted = await deviceCalendarPlugin.requestPermissions(); + if (!permissionsGranted.isSuccess || !permissionsGranted.data) { + return; + } + } + } + Future _scheduleNotification() async { + var scheduledNotificationDateTime = + DateTime.now().add(Duration(seconds: 5)); + var vibrationPattern = Int64List(4); + vibrationPattern[0] = 0; + vibrationPattern[1] = 1000; + vibrationPattern[2] = 5000; + vibrationPattern[3] = 2000; + + var androidPlatformChannelSpecifics = AndroidNotificationDetails( + 'your other channel id', + 'your other channel name', + 'your other channel description', + // icon: 'secondary_icon', + sound: RawResourceAndroidNotificationSound('slow_spring_board'), + largeIcon: DrawableResourceAndroidBitmap('sample_large_icon'), + vibrationPattern: vibrationPattern, + enableLights: true, + color: const Color.fromARGB(255, 255, 0, 0), + ledColor: const Color.fromARGB(255, 255, 0, 0), + ledOnMs: 1000, + ledOffMs: 500); + var iOSPlatformChannelSpecifics = + IOSNotificationDetails(sound: 'slow_spring_board.aiff'); + var platformChannelSpecifics = NotificationDetails( + androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); + await flutterLocalNotificationsPlugin.schedule( + 0, + 'scheduled title', + 'scheduled body', + scheduledNotificationDateTime, + platformChannelSpecifics); + } + + @override Widget build(BuildContext context) { //final searchValue = Provider.of(context); diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 7510987c..c1f04a71 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -131,6 +131,7 @@ class _Login extends State { } void validateForm() { + //TODO fix login if (util.validateIDBox(nationalIDorFile.text, loginType) == true && mobileNo.length >= 9 && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) { @@ -139,7 +140,7 @@ class _Login extends State { }); } else { setState(() { - isButtonDisabled = true; + isButtonDisabled = false; }); } } diff --git a/lib/pages/medical/active_medications/ActiveMedicationsPage.dart b/lib/pages/medical/active_medications/ActiveMedicationsPage.dart new file mode 100644 index 00000000..3409c3db --- /dev/null +++ b/lib/pages/medical/active_medications/ActiveMedicationsPage.dart @@ -0,0 +1,129 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/ActiveMedicationsViewModel.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/active_medications/reminder_page.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ActiveMedicationsPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getActiveMedication(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: 'Active Medications', + isShowAppBar: true, + body: Container( + child: ListView.builder( + itemCount: model.activePrescriptionReport.length, + itemBuilder: (context, index) => Container( + padding: EdgeInsets.all(10), + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), color: Colors.white), + child: Row( + children: [ + Image.memory( + Utils.dataFromBase64String(model + .activePrescriptionReport[index].productImageBase64), + height: SizeConfig.imageSizeMultiplier * 19, + width: SizeConfig.imageSizeMultiplier * 18, + fit: BoxFit.cover, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + model.activePrescriptionReport[index].itemDescription, + bold: true, + ), + SizedBox( + height: 5, + ), + Texts( + 'Exp Date :' + + DateUtil.getDayMonthYearDateFormatted(model + .activePrescriptionReport[index].orderDate), + ), + SizedBox( + height: 5, + ), + Texts( + 'Route :' + + model.activePrescriptionReport[index].route, + ), + SizedBox( + height: 5, + ), + Texts( + 'Frequency :' + + model.activePrescriptionReport[index].frequency, + ), + SizedBox( + height: 5, + ), + Texts( + 'Daily Quantity :${model.activePrescriptionReport[index].doseDailyQuantity}', + ), + ], + ), + ), + InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: ReminderPage( + frequency: model.activePrescriptionReport[index] + .frequencyNumber, + days: model.activePrescriptionReport[index].days, + itemDescription: model + .activePrescriptionReport[index] + .itemDescription, + ), + ), + ); + }, + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Icon( + Icons.notifications, + color: Colors.red, + size: 28, + ), + Row( + children: [ + Icon( + Icons.notifications_active, + color: Colors.red, + size: 28, + ), + Texts( + 'Reminder', + color: Colors.red, + ) + ], + ) + ], + ), + ), + ) + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/active_medications/reminder_page.dart b/lib/pages/medical/active_medications/reminder_page.dart new file mode 100644 index 00000000..72f6c211 --- /dev/null +++ b/lib/pages/medical/active_medications/reminder_page.dart @@ -0,0 +1,263 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/ActiveMedicationsViewModel.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; +import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:provider/provider.dart'; + +// ignore: must_be_immutable +class ReminderPage extends StatefulWidget { + final int frequency; + final int days; + final String itemDescription; + + List _scheduleList = List(); + + DateTime startDay; + DateTime endDay; + + ReminderPage({Key key, this.frequency, this.days, this.itemDescription}) { + startDay = DateTime.now(); + endDay = DateTime.now().add(Duration(days: days)); + int hour = (24 ~/ frequency).round(); + int durations = 24 ~/ hour; + for (int count = 0; count < durations; count++) { + _scheduleList.add(DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day, (hour * count))); + } + } + + @override + _ReminderPageState createState() => _ReminderPageState(); +} + +class _ReminderPageState extends State { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBarTitle: 'Reminder', + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.maxFinite, + child: Texts( + 'Please select treatment start day and time to be notified when it\'s time to take the medicine'), + ), + Divider(), + SizedBox( + height: 12, + ), + Texts('Start day'), + InkWell( + onTap: () { + DatePicker.showDatePicker(context, + showTitleActions: true, + minTime: DateTime( + DateTime.now().year, DateTime.now().month - 1, 1), + maxTime: DateTime.now(), onConfirm: (date) { + print('confirm $date'); + setState(() { + widget.startDay = date; + }); + }, + currentTime: widget.startDay, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getStartDay()), + Icon( + Icons.calendar_today, + color: Colors.black, + ) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + Texts('End day'), + InkWell( + onTap: () { + DatePicker.showDatePicker(context, + showTitleActions: true, + minTime: DateTime( + DateTime.now().year, DateTime.now().month - 1, 1), + maxTime: DateTime.now(), onConfirm: (date) { + print('confirm $date'); + setState(() { + widget.endDay = date; + }); + }, + currentTime: widget.endDay, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getEndDay()), + Icon( + Icons.calendar_today, + color: Colors.black, + ) + ], + ), + ), + ), + ...List.generate( + widget._scheduleList.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 7, + ), + Texts('Schedule time'), + SizedBox( + height: 7, + ), + InkWell( + onTap: () { + DatePicker.showTimePicker(context, + showTitleActions: true, onConfirm: (date) { + print('confirm $date'); + setState(() { + widget._scheduleList[index] = date; + }); + }, + currentTime: widget._scheduleList[index], + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts(getDateTime( + widget._scheduleList[index])), + Icon( + Icons.access_time, + color: Colors.black, + ) + ], + ), + ), + ), + ], + )), + Container( + width: double.maxFinite, + height: MediaQuery.of(context).size.height * 0.12, + ), + ], + ), + ), + ), + bottomSheet: Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.1, + padding: EdgeInsets.all(10), + child: SecondaryButton( + label: 'OK', + color: Colors.grey[800], + onTap: () { + schedule(); + }, + ), + ), + ), + ); + } + + schedule() async { + List scheduleDateTime = + calculateDaysInterval(widget.startDay, widget.endDay); + + // scheduleDateTime.forEach((date) { + // LocalNotification.scheduleNotification( + // scheduledNotificationDateTime: date, + // title: 'Remainder', + // description: widget.itemDescription); + // return; + // }); + + CalendarUtils calendarUtils = await CalendarUtils.getInstance(); + + calendarUtils.createOrUpdateEvents( + scheduleList: widget._scheduleList, + description: widget.itemDescription, + title: widget.itemDescription, + scheduleDateTime: scheduleDateTime); + + + + var asd = calendarUtils.writableCalendars; + Navigator.pop(context); + } + + List calculateDaysInterval(DateTime startDate, DateTime endDate) { + List days = []; + for (int i = 0; i <= endDate.difference(startDate).inDays; i++) { + widget._scheduleList.forEach((element) { + days.add(startDate.add( + Duration(days: i, hours: element.hour, minutes: element.minute))); + }); + } + return days; + } + + String getStartDay() { + return "${DateUtil.getMonth(widget.startDay.month)} ${widget.startDay.day}, ${widget.startDay.year}"; + } + + String getEndDay() { + return "${DateUtil.getMonth(widget.endDay.month)} ${widget.endDay.day}, ${widget.endDay.year}"; + } + + String getDateTime(DateTime dateTime) { + return '${dateTime.hour}:${dateTime.minute}'; + } + + String getDays() { + return ''; + } +} diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 2ac090b9..cf9738df 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -24,6 +24,7 @@ import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart'; import 'package:provider/provider.dart'; import '../../locator.dart'; +import 'active_medications/ActiveMedicationsPage.dart'; import 'balance/my_balance_page.dart'; import 'doctor/doctor_home_page.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; @@ -186,8 +187,8 @@ class _MedicalProfilePageState extends State { Expanded( flex: 1, child: InkWell( -// onTap: () => Navigator.push( -// context, FadePage(page: RadiologyHomePage())), + onTap: () => Navigator.push(context, + FadePage(page: ActiveMedicationsPage())), child: MedicalProfileItem( title: TranslationBase.of(context) .myMedical, diff --git a/lib/uitl/CalendarUtils.dart b/lib/uitl/CalendarUtils.dart new file mode 100644 index 00000000..d61a19b6 --- /dev/null +++ b/lib/uitl/CalendarUtils.dart @@ -0,0 +1,77 @@ +import 'dart:async'; +import 'dart:ui'; + +import 'package:device_calendar/device_calendar.dart'; + +final DeviceCalendarPlugin deviceCalendarPlugin = DeviceCalendarPlugin(); + +class CalendarUtils { + static Completer _completer; + + Calendar get writableCalendars => calendars?.firstWhere((c) => !c.isReadOnly); + List calendars; + + CalendarUtils._(this.calendars); + + static Future getInstance() async { + if (_completer == null) { + _completer = Completer(); + try { + final calendarsResult = await deviceCalendarPlugin.retrieveCalendars(); + _completer.complete(CalendarUtils._(calendarsResult?.data)); + } on Exception catch (e) { + _completer.completeError(e); + final Future sharedPrefsFuture = _completer.future; + _completer = null; + return sharedPrefsFuture; + } + } + return _completer.future; + } + + Future createOrUpdateEvents( + {List scheduleList, + String title, + String description, + List scheduleDateTime}) async { + List events = List(); + scheduleDateTime.forEach((element) { + RecurrenceRule recurrenceRule = RecurrenceRule( + RecurrenceFrequency.Daily, + endDate: element, + ); + Event event = Event(writableCalendars.id, + recurrenceRule: recurrenceRule, + start: element, + end: element.add(Duration(minutes: 30)), + title: title, + description: description); + events.add(event); + }); + + events.forEach((element) { + deviceCalendarPlugin.createOrUpdateEvent(element); + }); + } + + deleteEvent(Calendar _calendar, Event _event) async { + await deviceCalendarPlugin.deleteEvent(_calendar.id, _event.eventId); + } + + Future retrieveEvents( + String calendarId, + RetrieveEventsParams retrieveEventsParams, + ) async { + return await deviceCalendarPlugin.retrieveEvents( + calendarId, retrieveEventsParams); + } + + Future createCalendar( + String calendarName, { + Color calendarColor, + String localAccountName, + }) async { + return await deviceCalendarPlugin.createCalendar(calendarName, + calendarColor: calendarColor, localAccountName: localAccountName); + } +} diff --git a/lib/uitl/LocalNotification.dart b/lib/uitl/LocalNotification.dart new file mode 100644 index 00000000..ac4f5860 --- /dev/null +++ b/lib/uitl/LocalNotification.dart @@ -0,0 +1,97 @@ +import 'dart:typed_data'; +import 'dart:ui'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter_local_notifications/flutter_local_notifications.dart'; + +final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); + +class LocalNotification { + + + static Future scheduleNotification( + {@required DateTime scheduledNotificationDateTime, + @required String title, + @required String description}) async { + + ///vibrationPattern + var vibrationPattern = Int64List(4); + vibrationPattern[0] = 0; + vibrationPattern[1] = 1000; + vibrationPattern[2] = 5000; + vibrationPattern[3] = 2000; + + var androidPlatformChannelSpecifics = AndroidNotificationDetails( + 'active-prescriptions', + 'ActivePrescriptions', + 'ActivePrescriptionsDescription', + // icon: 'secondary_icon', + sound: RawResourceAndroidNotificationSound('slow_spring_board'),///change it to be as ionic + // largeIcon: DrawableResourceAndroidBitmap('sample_large_icon'),///change it to be as ionic + vibrationPattern: vibrationPattern, + enableLights: true, + color: const Color.fromARGB(255, 255, 0, 0), + ledColor: const Color.fromARGB(255, 255, 0, 0), + ledOnMs: 1000, + ledOffMs: 500); + var iOSPlatformChannelSpecifics = + IOSNotificationDetails(sound: 'slow_spring_board.aiff');///change it to be as ionic + var platformChannelSpecifics = NotificationDetails( + androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); + await flutterLocalNotificationsPlugin.schedule( + 0, + title, + description, + scheduledNotificationDateTime, + platformChannelSpecifics); + } + + ///Repeat notification every day at approximately 10:00:00 am + static Future showDailyAtTime() async { + var time = Time(10, 0, 0); + var androidPlatformChannelSpecifics = AndroidNotificationDetails( + 'repeatDailyAtTime channel id', + 'repeatDailyAtTime channel name', + 'repeatDailyAtTime description'); + var iOSPlatformChannelSpecifics = IOSNotificationDetails(); + var platformChannelSpecifics = NotificationDetails( + androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); + await flutterLocalNotificationsPlugin.showDailyAtTime( + 0, + 'show daily title', + 'Daily notification shown at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}', + time, + platformChannelSpecifics); + } + + ///Repeat notification weekly on Monday at approximately 10:00:00 am + static Future showWeeklyAtDayAndTime() async { + var time = Time(10, 0, 0); + var androidPlatformChannelSpecifics = AndroidNotificationDetails( + 'show weekly channel id', + 'show weekly channel name', + 'show weekly description'); + var iOSPlatformChannelSpecifics = IOSNotificationDetails(); + var platformChannelSpecifics = NotificationDetails( + androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); + await flutterLocalNotificationsPlugin.showWeeklyAtDayAndTime( + 0, + 'show weekly title', + 'Weekly notification shown on Monday at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}', + Day.Monday, + time, + platformChannelSpecifics); + } + + static String _toTwoDigitString(int value) { + return value.toString().padLeft(2, '0'); + } + + static Future cancelNotification() async { + await flutterLocalNotificationsPlugin.cancel(0); + } + + static Future cancelAllNotifications() async { + await flutterLocalNotificationsPlugin.cancelAll(); + } +} diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 6958e67f..52138759 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -1,3 +1,6 @@ +import 'dart:convert'; +import 'dart:typed_data'; + import 'package:connectivity/connectivity.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -137,4 +140,8 @@ class Utils { // await pr.hide(); // } } + + static Uint8List dataFromBase64String(String base64String) { + return base64Decode(base64String); + } } diff --git a/pubspec.yaml b/pubspec.yaml index 4204d4ad..49710761 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -112,6 +112,10 @@ dependencies: flutter_datetime_picker: ^1.4.0 + flutter_local_notifications: ^1.4.4+4 + rxdart: ^0.24.1 + + device_calendar: ^3.1.0 #Handle Geolocation geolocator: ^6.0.0+1 From ae147b59888ab56c8a34b7d17ac91b28b99ef762 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 24 Sep 2020 17:02:37 +0300 Subject: [PATCH 10/33] 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 5f981c9248bed76375323e7fb0a624dfbf91e79a Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Sun, 27 Sep 2020 13:17:56 +0300 Subject: [PATCH 11/33] Contact us --- lib/pages/ContactUs/findus/findus_page.dart | 10 ++++++---- lib/pages/ContactUs/findus/hospitrals_page.dart | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/pages/ContactUs/findus/findus_page.dart b/lib/pages/ContactUs/findus/findus_page.dart index e8f52cb9..f9e154f9 100644 --- a/lib/pages/ContactUs/findus/findus_page.dart +++ b/lib/pages/ContactUs/findus/findus_page.dart @@ -60,12 +60,12 @@ class _FindUsPageState extends State with SingleTickerProviderStateM child: Container( height: 60.0, margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.9, + width: MediaQuery.of(context).size.width *0.92,// 0.9, decoration: BoxDecoration( border: Border( bottom: BorderSide( color: Theme.of(context).dividerColor, - width: 0.7), + width: 0.9),//width: 0.7 ), color: Colors.white), child: Center( @@ -73,11 +73,13 @@ class _FindUsPageState extends State with SingleTickerProviderStateM isScrollable: true, controller: _tabController, indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.label, + //indicatorSize: TabBarIndicatorSize.label, + indicatorSize: TabBarIndicatorSize.tab, + indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: - EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), + EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( diff --git a/lib/pages/ContactUs/findus/hospitrals_page.dart b/lib/pages/ContactUs/findus/hospitrals_page.dart index 315fe553..292a9106 100644 --- a/lib/pages/ContactUs/findus/hospitrals_page.dart +++ b/lib/pages/ContactUs/findus/hospitrals_page.dart @@ -23,6 +23,7 @@ class _HospitalsPageState extends State { baseViewModel: model, body: SingleChildScrollView( child: Container( + // margin: EdgeInsets.only(left: 15,right: 15,top: 70), margin: EdgeInsets.only(left: 15,right: 15,top: 70), child: Column( children: [ @@ -143,7 +144,7 @@ class _HospitalsPageState extends State { onPressed: () { setState(() { - launch("https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); + launch("https://www.linkedin.com/company/drsulaiman-alhabib-medical-group"); }); }, ), From 97d0c439c7aeeff3aff27f2984c2e181b2621154 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Sun, 27 Sep 2020 14:46:01 +0300 Subject: [PATCH 12/33] Contact us --- assets/images/new-design/call.png | Bin 0 -> 2160 bytes assets/images/new-design/navigate.png | Bin 0 -> 2623 bytes lib/pages/ContactUs/findus/hospitrals_page.dart | 6 ++++-- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 assets/images/new-design/call.png create mode 100644 assets/images/new-design/navigate.png diff --git a/assets/images/new-design/call.png b/assets/images/new-design/call.png new file mode 100644 index 0000000000000000000000000000000000000000..cf6713cb881cf8a9cb0155594b81dc8ac5caa0db GIT binary patch literal 2160 zcmV-$2#@!PP)Px-DoI2^RCodHoDFOfWf;fb_r2>FG9XhiDqGiXYfBhg3u+(^lo%JkH71IRiUCb9 zXcQA;2qA_TLllBBF{1H<1W3e0iTHtvh=9Zo6vMh@#CDx+VSoq`(E(#^@AY}Q9qD@g z?t9k{dP#G4@7?{M=l%8R`|;de38^d<0u=%!On_$V`vJ=o3nhFRrKFv6UPmbTm2kSV zdVs8(a?ypfCJN8uct0IH)S-k<2vNGH$6|A((=C_dX(O=H z;#d#u-NI}td@)60N`T!BwmTHYzQ_iidhW#nF)6^l#>R;QT=v2b^9mJ8w(E-lV$wEn zK#^AF0}o+e3~ge<2<$SOYZX>~gi<;-+o(%)emO^C!U*Ja%o0)X$~_Vj0wjzsP83P` zl$GnxSp#r*3`gtpftBpqa)hV>7$$6PG5{jV%MGFiAfdcP1gKOR2r*3A-g20+XaN%9 zNL6`($7;fazAaF%AW{hc(ptkjp>$@C#d4)#_H;0$0SL(hO{z)jsQO>|!K9}2Se@c{IvFIcP zX!H5b!;E3QP)9jgeb8!c5UN>Vv7`XeugD-@1;gL7qI|@A%|pcWt|+}?&`AjpQ%x}S zdRe5S&@pv%S!@eMY8Fx}ZKJ-Q5R=L3@PU(NQI29%L*{#0Ib>r}Mj!&amXHv%h0ltD zhdS`Q;U%2%Ezm1#=Hepl7@?IGAUe?&@NR|q$+sdMg7$E_+hP~mJc#r!Q>}~uq8K|L zStN2;gPPEOyx_Lj9>VQXT`~sPdbIB_BlHQO6@@T_)Y+!42K((obqy5D7$Ex8=J$LA znTCxb{R4&)WLdX#H#A)@Qr9T0tN=!xI(K>rw1ZY^`)ippYYk<*w zAy?*&BuPcOI9@R+I}g@1+C+-#t(7%EbjTU-{R~5qCq+94gX~E|vT09ueRGp&ZN2nz z0*KBy{oePWSAI>jWAMdX6_MC}cZ1_5(b^c@U1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;q-++OK(+7< z$E-`714^>c!T?OMS%*LYyy={EQs%{ zV7qD-Mv@@v;&a$rb7(l!@$sq(R|OKG&_b+9KVg~HTS)4$t5;Hv#HA*g`D4jE8;Ooa zL)CGc;mFzf+GN97H4!zHz#Ge6A*`2!mY6Vd=Jchho+vu@yXjlh9q{ACO!uekxrYa1BxzKhz& z+e1?X&NTv+U75>nR#macM_t{b?;9LQ#(wV>C|3#WpEz+8Pj{DF;JmP72y2U*c3mY< z0c)TXLRI>kd)zEkIa_%3+|!qg|E*j;C*5@d)$S{-@IT1`Ch;5;J`pedNM?gNIj4ICbd(3|*>W|vnEJR?v6 z?tVKyiq88{ufSKc3*VQ6B6DvwIVbs^5~zS7SovdwuK(o(BwLrn_g5tn<7|B!ik=gQ zrkpda+!ukx*QSjA_fY?M?58$3a3tb6feM{!%6P@w>IkWxaypQ;HmZJDPfcIi7XlTm zzGQ40`XttuM7qUN{ci6>{DiI^N8UFARa3_DZks=uYf5`go6 z`yiSVM)oew=15JhN{ZKvK!v7Rq_&{;jFv=ZGZB61g99f|#%zkaE>@F4q_7l6ZtZBd z%z)ZjvA8hZ)-}-!n6lhsOV%Tyn$|#7CN<$TEKB=yd)4nPGUuZ`9#Lb@Y|ROrCsFl> zmSuZ)1KxAb$&9tWGalFeu-YCi_N8jxgbSf!pP<@m@tMN3Yp*F~WaZi`yCJU4^*g05 zYGA(5X2L{&R{2|BJn_x-LY~51S2a)pQvXIY*ChT4U?u*0m7Ya(`F5yjXe=P=CHza#rvccv_uK;CWiRWh3FlF&_+fx@wkCV2klP;~$R002ovPDHLkV1oEm?xz3% literal 0 HcmV?d00001 diff --git a/lib/pages/ContactUs/findus/hospitrals_page.dart b/lib/pages/ContactUs/findus/hospitrals_page.dart index 292a9106..3af46f36 100644 --- a/lib/pages/ContactUs/findus/hospitrals_page.dart +++ b/lib/pages/ContactUs/findus/hospitrals_page.dart @@ -79,7 +79,8 @@ class _HospitalsPageState extends State { child: Row( children: [ IconButton( - icon: Icon(Icons.person_pin_circle_outlined,color: Colors.red,), + // icon: Icon(Icons.person_pin_circle_outlined,color: Colors.red,), + icon:new Image.asset('assets/images/new-design/navigate.png'), tooltip: 'Increase volume by 10', onPressed: () { setState(() { @@ -89,7 +90,8 @@ class _HospitalsPageState extends State { }, ), IconButton( - icon: Icon(Icons.phone,color: Colors.red,), + // icon: Icon(Icons.phone,color: Colors.red,), + icon:new Image.asset('assets/images/new-design/call.png'), tooltip: 'Increase volume by 10', onPressed: () { setState(() { From 50d862b076e696466630a0536f9b4755a84390b6 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Sun, 27 Sep 2020 15:56:17 +0300 Subject: [PATCH 13/33] Contact us --- lib/pages/ContactUs/findus/findus_page.dart | 150 +++---- .../ContactUs/findus/hospitrals_page.dart | 210 +++++----- .../ContactUs/findus/pharmacies_page.dart | 386 +++++++++--------- 3 files changed, 378 insertions(+), 368 deletions(-) diff --git a/lib/pages/ContactUs/findus/findus_page.dart b/lib/pages/ContactUs/findus/findus_page.dart index f9e154f9..3b58ea3b 100644 --- a/lib/pages/ContactUs/findus/findus_page.dart +++ b/lib/pages/ContactUs/findus/findus_page.dart @@ -1,7 +1,9 @@ import 'dart:ui'; +import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/findus/hospitrals_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/findus/pharmacies_page.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/feedback/send_feedback_page.dart'; import 'package:diplomaticquarterapp/pages/feedback/status_feedback_page.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -33,89 +35,93 @@ class _FindUsPageState extends State with SingleTickerProviderStateM @override @override Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: true, - appBarTitle: 'Locations', - 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, + return BaseView( + onModelReady: (model) => model.getFindUsRequestOrders(), //model.getCOC(), + builder: (_,model,w)=> AppScaffold( + isShowAppBar: true, + appBarTitle: 'Locations', + baseViewModel: model, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), ), ), - ), - Center( - child: Container( - height: 60.0, - margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width *0.92,// 0.9, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.9),//width: 0.7 - ), - color: Colors.white), - child: Center( - child: TabBar( - isScrollable: true, - controller: _tabController, - indicatorWeight: 5.0, - //indicatorSize: TabBarIndicatorSize.label, - indicatorSize: TabBarIndicatorSize.tab, + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width *0.92,// 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.9),//width: 0.7 + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + //indicatorSize: TabBarIndicatorSize.label, + indicatorSize: TabBarIndicatorSize.tab, - indicatorColor: Colors.red[800], - labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - Container( - width: MediaQuery.of(context).size.width * 0.30, - child: Center( - child: Texts(' Hospitals '), + indicatorColor: Colors.red[800], + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: Texts(' Hospitals '), + ), ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.30, - child: Center( - child: Texts(' Pharmacies '), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: Texts(' Pharmacies '), + ), ), - ), - ], + ], + ), ), ), ), - ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + HospitalsPage(findusHospitalModelList: model.FindusHospitalModelList,),//SendFeedbackPage(), + PharmaciesPage(findusPharmaciesModelList: model.FindusPharmaciesModelList,)//StatusFeedbackPage() + ], + ), + ) ], ), ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - HospitalsPage(),//SendFeedbackPage(), - PharmaciesPage()//StatusFeedbackPage() - ], - ), - ) - ], - ), ), ); } diff --git a/lib/pages/ContactUs/findus/hospitrals_page.dart b/lib/pages/ContactUs/findus/hospitrals_page.dart index 3af46f36..6e490872 100644 --- a/lib/pages/ContactUs/findus/hospitrals_page.dart +++ b/lib/pages/ContactUs/findus/hospitrals_page.dart @@ -1,4 +1,5 @@ +import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart'; import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; @@ -10,6 +11,11 @@ import 'package:giffy_dialog/giffy_dialog.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart'; class HospitalsPage extends StatefulWidget { + + final List findusHospitalModelList; + + HospitalsPage({Key key, this.findusHospitalModelList}); + @override _HospitalsPageState createState() => _HospitalsPageState(); } @@ -17,110 +23,113 @@ class HospitalsPage extends StatefulWidget { class _HospitalsPageState extends State { @override Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => model.getFindUsRequestOrders(),//model.getCOC(), - builder: (_, model, widget) => AppScaffold( - baseViewModel: model, - body: SingleChildScrollView( - child: Container( - // margin: EdgeInsets.only(left: 15,right: 15,top: 70), - margin: EdgeInsets.only(left: 15,right: 15,top: 70), - child: Column( - children: [ - ...List.generate(model.FindusHospitalModelList.length, (index) => Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(5)), - color: Colors.white, - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - InkWell( - onTap:(){ - showDialog( - context: context,builder: (_) => AssetGiffyDialog( - title: Text(model.FindusHospitalModelList[index].locationName, - style: TextStyle( - fontSize: 22.0, fontWeight: FontWeight.w600), - ),image:Image.network(model.FindusHospitalModelList[index].projectImageURL.toString(), fit: BoxFit.cover,), - buttonCancelText:Text('cancel') , - buttonCancelColor: Colors.grey, - onlyCancelButton: true, - - ) ); - }, + return AppScaffold( + body: SingleChildScrollView( + child: Container( + // margin: EdgeInsets.only(left: 15,right: 15,top: 70), + margin: EdgeInsets.only(left: 15,right: 15,top: 70), + child: Column( + children: [ + ...List.generate(widget.findusHospitalModelList.length, (index) => Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.white, + ), + + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + InkWell( + onTap:(){ + showDialog( + context: context,builder: (_) => AssetGiffyDialog( + title: Text(widget.findusHospitalModelList[index].locationName, + style: TextStyle( + fontSize: 22.0, fontWeight: FontWeight.w600), + ),image:Image.network(widget.findusHospitalModelList[index].projectImageURL.toString(), fit: BoxFit.cover,), + buttonCancelText:Text('cancel') , + buttonCancelColor: Colors.grey, + onlyCancelButton: true, + + ) ); + }, + child: Container( + width: 70, + height: 70, + child: Image.network(widget.findusHospitalModelList[index].projectImageURL.toString())), + ), + Expanded( + flex: 4, child: Container( - width: 70, - height: 70, - child: Image.network(model.FindusHospitalModelList[index].projectImageURL.toString())), - ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.only(left: 5,right: 5), - child: Texts('${model.FindusHospitalModelList[index].locationName}',textAlign: TextAlign.center,))),//model.cOCItemList[index].cOCTitl - Expanded( - flex: 2, - child: Row( - children: [ - IconButton( + margin: EdgeInsets.only(left: 5,right: 5,top: 10,bottom: 1), + child: Texts('${widget.findusHospitalModelList[index].locationName}',textAlign: TextAlign.center,))),//model.cOCItemList[index].cOCTitl + Expanded( + flex: 2, + child: Row( + crossAxisAlignment: + CrossAxisAlignment.center, + + children: [ + IconButton( // icon: Icon(Icons.person_pin_circle_outlined,color: Colors.red,), - icon:new Image.asset('assets/images/new-design/navigate.png'), - tooltip: 'Increase volume by 10', - onPressed: () { - setState(() { - MapsLauncher.launchCoordinates(double.parse(model.FindusHospitalModelList[index].latitude),double.parse(model.FindusHospitalModelList[index].longitude),model.FindusHospitalModelList[index].locationName); - // _volume += 10; - }); - }, - ), - IconButton( - // icon: Icon(Icons.phone,color: Colors.red,), - icon:new Image.asset('assets/images/new-design/call.png'), - tooltip: 'Increase volume by 10', - onPressed: () { - setState(() { - // _volume += 10; - launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - }); - }, - ), - ], - ), + icon:new Image.asset('assets/images/new-design/navigate.png'), + tooltip: '', + onPressed: () { + setState(() { + MapsLauncher.launchCoordinates(double.parse(widget.findusHospitalModelList[index].latitude),double.parse(widget.findusHospitalModelList[index].longitude),widget.findusHospitalModelList[index].locationName); + + }); + }, + ), + IconButton( + // icon: Icon(Icons.phone,color: Colors.red,), + icon:new Image.asset('assets/images/new-design/call.png'), + tooltip: '', + onPressed: () { + setState(() { + // _volume += 10; + launch("tel://" +widget.findusHospitalModelList[index].phoneNumber); + }); + }, + ), + ], ), + ), - ], - ), + ], ), + ), - ], - ), - // Texts('${model.FindusHospitalModelList[index].locationName}'), - Divider(height: 4.5,color: Colors.grey[500],) - ], - ), + ], + ), + // Texts('${model.FindusHospitalModelList[index].locationName}'), + Divider(height: 4.5,color: Colors.grey[500],) + ], ), - )), - SizedBox(height: 8,), - Container(width: double.infinity, - height: 100,color: Colors.white, + ), + )), + SizedBox(height: 8,), + Container(width: double.infinity, + height: 100,color: Colors.white, child: Row( mainAxisSize:MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceAround, @@ -128,7 +137,7 @@ class _HospitalsPageState extends State { children: [ IconButton( - icon: new Image.asset('assets/images/new-design/youtube.png'), + icon: new Image.asset('assets/images/new-design/youtube.png'), iconSize: 70, tooltip: 'Youtube', onPressed: () { @@ -157,7 +166,7 @@ class _HospitalsPageState extends State { onPressed: () { setState(() { - launch("https://twitter.com/HMG"); + launch("https://twitter.com/HMG"); }); }, ), @@ -168,19 +177,18 @@ class _HospitalsPageState extends State { onPressed: () { setState(() { - launch("https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); + launch("https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); }); }, ), ], ), - ), - ], - ), + ), + ], ), ), - ), + ); } diff --git a/lib/pages/ContactUs/findus/pharmacies_page.dart b/lib/pages/ContactUs/findus/pharmacies_page.dart index f127f842..40799f17 100644 --- a/lib/pages/ContactUs/findus/pharmacies_page.dart +++ b/lib/pages/ContactUs/findus/pharmacies_page.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart'; import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; @@ -11,6 +12,9 @@ import 'package:maps_launcher/maps_launcher.dart'; import 'package:url_launcher/url_launcher.dart'; class PharmaciesPage extends StatefulWidget { + final List findusPharmaciesModelList; + + PharmaciesPage({Key key, this.findusPharmaciesModelList}); @override _PharmaciesPageState createState() => _PharmaciesPageState(); } @@ -18,216 +22,208 @@ class PharmaciesPage extends StatefulWidget { class _PharmaciesPageState extends State { @override Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => model.getFindUsRequestOrders(), //model.getCOC(), - 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.FindusPharmaciesModelList.length, - (index) => Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(5)), - color: Colors.white, - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( + return AppScaffold( + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 15, right: 15, top: 70), + child: Column( + children: [ + ...List.generate( + widget.findusPharmaciesModelList.length, + (index) => Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.white, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, children: [ + InkWell( + onTap:(){ + showDialog( + context: context,builder: (_) => AssetGiffyDialog( + title: Text(widget.findusPharmaciesModelList[index].locationName, + style: TextStyle( + fontSize: 22.0, fontWeight: FontWeight.w600), + ), + image:widget.findusPharmaciesModelList[index].projectImageURL!= null? Image.network(widget.findusPharmaciesModelList[index].projectImageURL, fit: BoxFit.cover,): Image.network('https://hmgwebservices.com/Images/Hospitals/15.jpg', fit: BoxFit.cover,) , + buttonCancelText:Text('cancel') , + // buttonCancelText:Text(model.user.projectID) , + buttonCancelColor: Colors.grey, + onlyCancelButton: true, + + ) ); + }, + child: Container( + width: 70, + height: 70, + child: + Image.network(widget.findusPharmaciesModelList[index].projectImageURL!= null? widget.findusPharmaciesModelList[index].projectImageURL.toString(): 'https://hmgwebservices.com/Images/Hospitals/15.jpg') ), + ), Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.only( + left: 5, right: 5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + '${widget.findusPharmaciesModelList[index].locationName}', + textAlign: TextAlign.start, + ), + SizedBox(height: 4,), + Texts( + '${widget.findusPharmaciesModelList[index].cityName}', + textAlign: TextAlign.center, + ), + ], + ), + ), + ), + //model.cOCItemList[index].cOCTitl + Expanded( + flex: 2, child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - InkWell( - onTap:(){ - showDialog( - context: context,builder: (_) => AssetGiffyDialog( - title: Text(model.FindusPharmaciesModelList[index].locationName, - style: TextStyle( - fontSize: 22.0, fontWeight: FontWeight.w600), - ),image:Image.network(model.FindusPharmaciesModelList[index].projectImageURL.toString(), fit: BoxFit.cover,), - buttonCancelText:Text('cancel') , - // buttonCancelText:Text(model.user.projectID) , - buttonCancelColor: Colors.grey, - onlyCancelButton: true, - - ) ); + children: [ + IconButton( + // icon: Icon( + // Icons + // .person_pin_circle_outlined, + // color: Colors.red, + // ), + icon:new Image.asset('assets/images/new-design/navigate.png'), + tooltip: + '', + onPressed: () { + setState(() { + MapsLauncher.launchCoordinates( + double.parse(widget.findusPharmaciesModelList[ + index] + .latitude), + double.parse(widget.findusPharmaciesModelList[ + index] + .longitude), + widget.findusPharmaciesModelList[ + index] + .locationName); + // _volume += 10; + }); }, - child: Container( - width: 70, - height: 70, - child: Image.network(model - .FindusPharmaciesModelList[ - index] - .projectImageURL - .toString())), ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.only( - left: 5, right: 5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - '${model.FindusPharmaciesModelList[index].locationName}', - textAlign: TextAlign.start, - ), - SizedBox(height: 4,), - Texts( - '${model.FindusPharmaciesModelList[index].cityName}', - textAlign: TextAlign.center, - ), - ], - ), - ), - ), - //model.cOCItemList[index].cOCTitl - Expanded( - flex: 2, - child: Row( - children: [ - IconButton( - icon: Icon( - Icons - .person_pin_circle_outlined, - color: Colors.red, - ), - tooltip: - 'Increase volume by 10', - onPressed: () { - setState(() { - MapsLauncher.launchCoordinates( - double.parse(model - .FindusPharmaciesModelList[ - index] - .latitude), - double.parse(model - .FindusPharmaciesModelList[ - index] - .longitude), - model - .FindusPharmaciesModelList[ - index] - .locationName); - // _volume += 10; - }); - }, - ), - IconButton( - icon: Icon( - Icons.phone, - color: Colors.red, - ), - tooltip: - 'Increase volume by 10', - onPressed: () { - setState(() { - // _volume += 10; - launch("tel://" + - model - .FindusPharmaciesModelList[ - index] - .phoneNumber); - }); - }, - ), - ], - ), + IconButton( + // icon: Icon( + // Icons.phone, + // color: Colors.red, + // ), + icon:new Image.asset('assets/images/new-design/call.png'), + tooltip: + 'I', + onPressed: () { + setState(() { + // _volume += 10; + launch("tel://" + + widget.findusPharmaciesModelList[ + index] + .phoneNumber); + }); + }, ), ], ), ), ], ), - - Divider( - height: 4.5, - color: Colors.grey[500], - ) - ], - ), + ), + ], ), - )), - SizedBox( - height: 8, - ), - Container( - width: double.infinity, - height: 100, - color: Colors.white, - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - IconButton( - icon: new Image.asset( - 'assets/images/new-design/youtube.png'), - iconSize: 70, - tooltip: 'Youtube', - onPressed: () { - setState(() { - // _volume += 10; - launch( - "https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); - }); - }, - ), - IconButton( - icon: new Image.asset( - 'assets/images/new-design/linkedin.png'), - tooltip: 'LinkedIn', - iconSize: 70, - onPressed: () { - setState(() { - launch( - "https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); - }); - }, - ), - IconButton( - icon: new Image.asset( - 'assets/images/new-design/twitter.png'), - tooltip: 'Twitter', - iconSize: 70, - onPressed: () { - setState(() { - launch("https://twitter.com/HMG"); - }); - }, - ), - IconButton( - icon: new Image.asset( - 'assets/images/new-design/facebook.png'), - tooltip: 'facebook', - iconSize: 70, - onPressed: () { - setState(() { - launch( - "https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); - }); - }, + + Divider( + height: 4.5, + color: Colors.grey[500], + ) + ], ), - ], - ), + ), + )), + SizedBox( + height: 8, + ), + Container( + width: double.infinity, + height: 100, + color: Colors.white, + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + IconButton( + icon: new Image.asset( + 'assets/images/new-design/youtube.png'), + iconSize: 70, + tooltip: 'Youtube', + onPressed: () { + setState(() { + // _volume += 10; + launch( + "https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); + }); + }, + ), + IconButton( + icon: new Image.asset( + 'assets/images/new-design/linkedin.png'), + tooltip: 'LinkedIn', + iconSize: 70, + onPressed: () { + setState(() { + launch( + "https://www.linkedin.com/company/drsulaiman-alhabib-medical-group"); + }); + }, + ), + IconButton( + icon: new Image.asset( + 'assets/images/new-design/twitter.png'), + tooltip: 'Twitter', + iconSize: 70, + onPressed: () { + setState(() { + launch("https://twitter.com/HMG"); + }); + }, + ), + IconButton( + icon: new Image.asset( + 'assets/images/new-design/facebook.png'), + tooltip: 'facebook', + iconSize: 70, + onPressed: () { + setState(() { + launch( + "https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); + }); + }, + ), + ], ), - ], - ), + ), + ], ), ), ), From 5ce252d296866a4f2f67afff34340d32269fdba5 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Sun, 27 Sep 2020 17:03:05 +0300 Subject: [PATCH 14/33] Contact us --- .../LiveChat/hospitalsLivechat_page.dart | 180 ++++++++++-------- .../ContactUs/LiveChat/livechat_page.dart | 10 +- 2 files changed, 105 insertions(+), 85 deletions(-) diff --git a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart index 66ad31ee..0c17e637 100644 --- a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart @@ -36,110 +36,124 @@ class _HospitalsLiveChatPageState extends State { child: Container( margin: EdgeInsets.only(left: 15, right: 15), child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: 20, - ), - Container( - width: double.infinity, - height: 200, - decoration: BoxDecoration( - image: DecorationImage( - image: ExactAssetImage( - 'assets/images/dashboard_top_bg.png'), - fit: BoxFit.cover), - ), - child: Texts( - 'You can now talk directly to the appointments department by chat or request a call back\n \nChoose Hospital :', - color: Colors.white, - textAlign: TextAlign.center, - ), - ), - /////////// - ...List.generate( - model.LiveChatModelList.length, - (index) => Container( - margin: - EdgeInsets.only(left: 20, right: 20, bottom: 20), + Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + + children: [ + SizedBox( + height: 20, + ), + Container( + width: double.infinity, + height: 200, decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(5)), - color: tappedIndex == index - ? Colors.red - : Colors.white, + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/dashboard_top_bg.png'), + fit: BoxFit.cover), ), child: Padding( padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - InkWell( - onTap: () { - setState(() { - tappedIndex = index; - chat = - "http://chat.dshmg.com:7788/hmgchatapp/hmgchattest/Index.aspx?Name=${model.user.firstName}&PatientID=${model.user.patientID}&MobileNo=${model.user.mobileNumber}&Language=en&WorkGroup=${model.LiveChatModelList[index].value}"; - }); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.end, + child: Texts( + 'You can now talk directly to the appointments department by chat or request a call back\n \nChoose Hospital :', + color: Colors.white, + textAlign: TextAlign.start, + ), + ), + ), + SizedBox(height: MediaQuery.of(context).size.height*0.85,), + + SizedBox( + height: 100, + ), + ], + ), + Positioned( + left: 13, + right: 13, + top:200, + child: Container(width: double.maxFinite, + child: Column( + children: [ + ...List.generate( + model.LiveChatModelList.length, + (index) => Container( + margin: + EdgeInsets.only(left: 0, right: 0, bottom: 20), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: tappedIndex == index + ? Colors.red + : Colors.white, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceAround, - crossAxisAlignment: - CrossAxisAlignment.center, + InkWell( + onTap: () { + setState(() { + tappedIndex = index; + chat = + "http://chat.dshmg.com:7788/hmgchatapp/hmgchattest/Index.aspx?Name=${model.user.firstName}&PatientID=${model.user.patientID}&MobileNo=${model.user.mobileNumber}&Language=en&WorkGroup=${model.LiveChatModelList[index].value}"; + }); + }, + child:Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, children: [ + SizedBox(width: 20,), Expanded( - flex: 4, + child: Container( margin: EdgeInsets.only( left: 5, right: 5), child: Texts( '${model.LiveChatModelList[index].projectName}', color: - tappedIndex == index - ? Colors.white - : Colors.black, + tappedIndex == index + ? Colors.white + : Colors.black, textAlign: - TextAlign.center, + TextAlign.center, ))), //model.cOCItemList[index].cOCTitl - Expanded( - flex: 1, - child: Row( - children: [ - IconButton( - icon: Icon( - Icons - .arrow_forward_rounded, - color: - tappedIndex == index - ? Colors.white - : Colors.black, - ), - tooltip: '', - onPressed: () { - setState(() {}); - }, - ), - ], + IconButton( + icon: Icon( + Icons + .arrow_forward_rounded, + color: + tappedIndex == index + ? Colors.white + : Colors.black, ), + tooltip: '', + onPressed: () { + setState(() {}); + }, ), ], ), - ), + ) ], ), - ) - ], - ), - ), - )), - SizedBox( - height: 100, + ), + )), + ], + ),), + ), + ], ), + Container( + height: MediaQuery.of(context).size.height * 0.20, + width: double.maxFinite, + ) ], ), ), @@ -167,3 +181,7 @@ class _HospitalsLiveChatPageState extends State { ); } } + + + + diff --git a/lib/pages/ContactUs/LiveChat/livechat_page.dart b/lib/pages/ContactUs/LiveChat/livechat_page.dart index 154a03cd..20cd1181 100644 --- a/lib/pages/ContactUs/LiveChat/livechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/livechat_page.dart @@ -56,12 +56,12 @@ class _LiveChatPageState extends State with SingleTickerProviderSt child: Container( height: 60.0, margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.9, + width: MediaQuery.of(context).size.width *0.92,// 0.9, decoration: BoxDecoration( border: Border( bottom: BorderSide( color: Theme.of(context).dividerColor, - width: 0.7), + width: 0.9),//width: 0.7 ), color: Colors.white), child: Center( @@ -69,11 +69,13 @@ class _LiveChatPageState extends State with SingleTickerProviderSt isScrollable: true, controller: _tabController, indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.label, + //indicatorSize: TabBarIndicatorSize.label, + indicatorSize: TabBarIndicatorSize.tab, + indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: - EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), + EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( From 7c48a6f16afcfa5ca73d8e2c0b433c0afd1fcbfd Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Sun, 27 Sep 2020 17:47:45 +0300 Subject: [PATCH 15/33] Contact us --- .../LiveChat/hospitalsLivechat_page.dart | 159 +++++----- .../ContactUs/LiveChat/livechat_page.dart | 12 +- .../LiveChat/pharmaciesLivechat_page.dart | 39 ++- lib/pages/ContactUs/findus/findus_page.dart | 27 +- .../ContactUs/findus/hospitrals_page.dart | 285 +++++++++-------- .../ContactUs/findus/pharmacies_page.dart | 290 ++++++++++-------- 6 files changed, 455 insertions(+), 357 deletions(-) diff --git a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart index 0c17e637..206a95c4 100644 --- a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart @@ -1,4 +1,3 @@ -import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/contactus/livechat_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -42,7 +41,6 @@ class _HospitalsLiveChatPageState extends State { children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ SizedBox( height: 20, @@ -65,8 +63,9 @@ class _HospitalsLiveChatPageState extends State { ), ), ), - SizedBox(height: MediaQuery.of(context).size.height*0.85,), - + SizedBox( + height: MediaQuery.of(context).size.height * 0.85, + ), SizedBox( height: 100, ), @@ -75,78 +74,92 @@ class _HospitalsLiveChatPageState extends State { Positioned( left: 13, right: 13, - top:200, - child: Container(width: double.maxFinite, - child: Column( - children: [ - ...List.generate( - model.LiveChatModelList.length, - (index) => Container( - margin: - EdgeInsets.only(left: 0, right: 0, bottom: 20), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(5)), - color: tappedIndex == index - ? Colors.red - : Colors.white, - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - InkWell( - onTap: () { - setState(() { - tappedIndex = index; - chat = - "http://chat.dshmg.com:7788/hmgchatapp/hmgchattest/Index.aspx?Name=${model.user.firstName}&PatientID=${model.user.patientID}&MobileNo=${model.user.mobileNumber}&Language=en&WorkGroup=${model.LiveChatModelList[index].value}"; - }); - }, - child:Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.center, + top: 200, + child: Container( + width: double.maxFinite, + child: Column( + children: [ + ...List.generate( + model.LiveChatModelList.length, + (index) => Container( + margin: EdgeInsets.only( + left: 0, right: 0, bottom: 20), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all( + Radius.circular(5)), + color: tappedIndex == index + ? Colors.red + : Colors.white, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - SizedBox(width: 20,), - Expanded( - - child: Container( - margin: EdgeInsets.only( - left: 5, right: 5), - child: Texts( - '${model.LiveChatModelList[index].projectName}', + InkWell( + onTap: () { + setState(() { + tappedIndex = index; + chat = + "http://chat.dshmg.com:7788/hmgchatapp/hmgchattest/Index.aspx?Name=${model.user.firstName}&PatientID=${model.user.patientID}&MobileNo=${model.user.mobileNumber}&Language=en&WorkGroup=${model.LiveChatModelList[index].value}"; + }); + }, + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceAround, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + SizedBox( + width: 20, + ), + Expanded( + child: Container( + margin: + EdgeInsets.only( + left: 5, + right: 5), + child: Texts( + '${model.LiveChatModelList[index].projectName}', + color: + tappedIndex == + index + ? Colors + .white + : Colors + .black, + textAlign: TextAlign + .center, + ))), //model.cOCItemList[index].cOCTitl + IconButton( + icon: Icon( + Icons + .arrow_forward_rounded, color: - tappedIndex == index - ? Colors.white - : Colors.black, - textAlign: - TextAlign.center, - ))), //model.cOCItemList[index].cOCTitl - IconButton( - icon: Icon( - Icons - .arrow_forward_rounded, - color: - tappedIndex == index - ? Colors.white - : Colors.black, + tappedIndex == index + ? Colors.white + : Colors.black, + ), + tooltip: '', + onPressed: () { + setState(() {}); + }, + ), + ], ), - tooltip: '', - onPressed: () { - setState(() {}); - }, - ), + ) ], ), - ) - ], - ), - ), - )), - ], - ),), + ), + )), + ], + ), + ), ), ], ), @@ -181,7 +194,3 @@ class _HospitalsLiveChatPageState extends State { ); } } - - - - diff --git a/lib/pages/ContactUs/LiveChat/livechat_page.dart b/lib/pages/ContactUs/LiveChat/livechat_page.dart index 20cd1181..b870234a 100644 --- a/lib/pages/ContactUs/LiveChat/livechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/livechat_page.dart @@ -13,7 +13,8 @@ class LiveChatPage extends StatefulWidget { _LiveChatPageState createState() => _LiveChatPageState(); } -class _LiveChatPageState extends State with SingleTickerProviderStateMixin{ +class _LiveChatPageState extends State + with SingleTickerProviderStateMixin { TabController _tabController; @override void initState() { @@ -26,6 +27,7 @@ class _LiveChatPageState extends State with SingleTickerProviderSt super.dispose(); _tabController.dispose(); } + @override @override Widget build(BuildContext context) { @@ -56,12 +58,12 @@ class _LiveChatPageState extends State with SingleTickerProviderSt child: Container( height: 60.0, margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width *0.92,// 0.9, + width: MediaQuery.of(context).size.width * 0.92, // 0.9, decoration: BoxDecoration( border: Border( bottom: BorderSide( color: Theme.of(context).dividerColor, - width: 0.9),//width: 0.7 + width: 0.9), //width: 0.7 ), color: Colors.white), child: Center( @@ -75,7 +77,7 @@ class _LiveChatPageState extends State with SingleTickerProviderSt indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: - EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( @@ -105,7 +107,7 @@ class _LiveChatPageState extends State with SingleTickerProviderSt physics: BouncingScrollPhysics(), controller: _tabController, children: [ - HospitalsLiveChatPage(),//SendFeedbackPage(), + HospitalsLiveChatPage(), //SendFeedbackPage(), PhamaciesLiveChatPage() //StatusFeedbackPage() ], diff --git a/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart index c56123c9..cbda0828 100644 --- a/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart @@ -20,15 +20,13 @@ class _PhamaciesLiveChatPageState extends State { String chat; @override - void initState() - { + void initState() { super.initState(); - tappedIndex=-1; - chat=""; + tappedIndex = -1; + chat = ""; } @override - Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getLiveChatRequestOrders(), @@ -36,29 +34,31 @@ class _PhamaciesLiveChatPageState extends State { baseViewModel: model, body: SingleChildScrollView( child: Container( - margin: EdgeInsets.only(left: 15,right: 15), + margin: EdgeInsets.only(left: 15, right: 15), child: Column( children: [ - SizedBox(height: 20,), + SizedBox( + height: 20, + ), Container( width: double.infinity, height: 200, decoration: BoxDecoration( image: DecorationImage( - image: ExactAssetImage( - ''), - fit: BoxFit.cover), + image: ExactAssetImage(''), fit: BoxFit.cover), + ), + child: Texts( + 'You can now talk directly to the pharmacist by chat or request a call back', + color: Colors.black, + textAlign: TextAlign.center, ), - child: Texts('You can now talk directly to the pharmacist by chat or request a call back',color: Colors.black,textAlign: TextAlign.center,), - ), /////////// - SizedBox(height: 100,), - - + SizedBox( + height: 100, + ), ], - ), ), ), @@ -74,17 +74,16 @@ class _PhamaciesLiveChatPageState extends State { label: 'ٍStart', loading: model.state == ViewState.BusyLocal, onTap: () { - print("chat="+chat); - chat="http://chat.dshmg.com:7788/EPharmacyChat/EIndex.aspx?CustomerID=undefined&Name=${model.user.firstName}&MobileNo=${model.user.mobileNumber}&Language=1"; + print("chat=" + chat); + chat = + "http://chat.dshmg.com:7788/EPharmacyChat/EIndex.aspx?CustomerID=undefined&Name=${model.user.firstName}&MobileNo=${model.user.mobileNumber}&Language=1"; launch(chat); }, ), ), ), ), - ), ); - } } diff --git a/lib/pages/ContactUs/findus/findus_page.dart b/lib/pages/ContactUs/findus/findus_page.dart index 3b58ea3b..9b39de3a 100644 --- a/lib/pages/ContactUs/findus/findus_page.dart +++ b/lib/pages/ContactUs/findus/findus_page.dart @@ -4,22 +4,19 @@ import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model import 'package:diplomaticquarterapp/pages/ContactUs/findus/hospitrals_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/findus/pharmacies_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/pages/feedback/send_feedback_page.dart'; -import 'package:diplomaticquarterapp/pages/feedback/status_feedback_page.dart'; + import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - - - class FindUsPage extends StatefulWidget { @override _FindUsPageState createState() => _FindUsPageState(); } -class _FindUsPageState extends State with SingleTickerProviderStateMixin{ +class _FindUsPageState extends State + with SingleTickerProviderStateMixin { TabController _tabController; @override void initState() { @@ -32,12 +29,13 @@ class _FindUsPageState extends State with SingleTickerProviderStateM super.dispose(); _tabController.dispose(); } + @override @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getFindUsRequestOrders(), //model.getCOC(), - builder: (_,model,w)=> AppScaffold( + builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: 'Locations', baseViewModel: model, @@ -65,12 +63,12 @@ class _FindUsPageState extends State with SingleTickerProviderStateM child: Container( height: 60.0, margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width *0.92,// 0.9, + width: MediaQuery.of(context).size.width * 0.92, // 0.9, decoration: BoxDecoration( border: Border( bottom: BorderSide( color: Theme.of(context).dividerColor, - width: 0.9),//width: 0.7 + width: 0.9), //width: 0.7 ), color: Colors.white), child: Center( @@ -84,7 +82,7 @@ class _FindUsPageState extends State with SingleTickerProviderStateM indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: - EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( @@ -114,8 +112,13 @@ class _FindUsPageState extends State with SingleTickerProviderStateM physics: BouncingScrollPhysics(), controller: _tabController, children: [ - HospitalsPage(findusHospitalModelList: model.FindusHospitalModelList,),//SendFeedbackPage(), - PharmaciesPage(findusPharmaciesModelList: model.FindusPharmaciesModelList,)//StatusFeedbackPage() + HospitalsPage( + findusHospitalModelList: model.FindusHospitalModelList, + ), //SendFeedbackPage(), + PharmaciesPage( + findusPharmaciesModelList: + model.FindusPharmaciesModelList, + ) //StatusFeedbackPage() ], ), ) diff --git a/lib/pages/ContactUs/findus/hospitrals_page.dart b/lib/pages/ContactUs/findus/hospitrals_page.dart index 6e490872..b883ae41 100644 --- a/lib/pages/ContactUs/findus/hospitrals_page.dart +++ b/lib/pages/ContactUs/findus/hospitrals_page.dart @@ -1,4 +1,3 @@ - import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart'; import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -10,11 +9,11 @@ import 'package:flutter/material.dart'; import 'package:giffy_dialog/giffy_dialog.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart'; -class HospitalsPage extends StatefulWidget { - final List findusHospitalModelList; +class HospitalsPage extends StatefulWidget { + final List findusHospitalModelList; - HospitalsPage({Key key, this.findusHospitalModelList}); + HospitalsPage({Key key, this.findusHospitalModelList}); @override _HospitalsPageState createState() => _HospitalsPageState(); @@ -23,161 +22,209 @@ class HospitalsPage extends StatefulWidget { class _HospitalsPageState extends State { @override Widget build(BuildContext context) { - return AppScaffold( body: SingleChildScrollView( child: Container( // margin: EdgeInsets.only(left: 15,right: 15,top: 70), - margin: EdgeInsets.only(left: 15,right: 15,top: 70), + margin: EdgeInsets.only(left: 15, right: 15, top: 70), child: Column( children: [ - ...List.generate(widget.findusHospitalModelList.length, (index) => Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(5)), - color: Colors.white, - ), - - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - InkWell( - onTap:(){ - showDialog( - context: context,builder: (_) => AssetGiffyDialog( - title: Text(widget.findusHospitalModelList[index].locationName, - style: TextStyle( - fontSize: 22.0, fontWeight: FontWeight.w600), - ),image:Image.network(widget.findusHospitalModelList[index].projectImageURL.toString(), fit: BoxFit.cover,), - buttonCancelText:Text('cancel') , - buttonCancelColor: Colors.grey, - onlyCancelButton: true, - - ) ); - }, - child: Container( - width: 70, - height: 70, - child: Image.network(widget.findusHospitalModelList[index].projectImageURL.toString())), - ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.only(left: 5,right: 5,top: 10,bottom: 1), - child: Texts('${widget.findusHospitalModelList[index].locationName}',textAlign: TextAlign.center,))),//model.cOCItemList[index].cOCTitl - Expanded( - flex: 2, - child: Row( - crossAxisAlignment: - CrossAxisAlignment.center, - - children: [ - IconButton( - // icon: Icon(Icons.person_pin_circle_outlined,color: Colors.red,), - icon:new Image.asset('assets/images/new-design/navigate.png'), - tooltip: '', - onPressed: () { - setState(() { - MapsLauncher.launchCoordinates(double.parse(widget.findusHospitalModelList[index].latitude),double.parse(widget.findusHospitalModelList[index].longitude),widget.findusHospitalModelList[index].locationName); - - }); - }, - ), - IconButton( - // icon: Icon(Icons.phone,color: Colors.red,), - icon:new Image.asset('assets/images/new-design/call.png'), - tooltip: '', - onPressed: () { - setState(() { - // _volume += 10; - launch("tel://" +widget.findusHospitalModelList[index].phoneNumber); - }); - }, - ), - ], + ...List.generate( + widget.findusHospitalModelList.length, + (index) => Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.white, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + InkWell( + onTap: () { + showDialog( + context: context, + builder: (_) => + AssetGiffyDialog( + title: Text( + widget + .findusHospitalModelList[ + index] + .locationName, + style: TextStyle( + fontSize: 22.0, + fontWeight: + FontWeight + .w600), + ), + image: Image.network( + widget + .findusHospitalModelList[ + index] + .projectImageURL + .toString(), + fit: BoxFit.cover, + ), + buttonCancelText: + Text('cancel'), + buttonCancelColor: + Colors.grey, + onlyCancelButton: true, + )); + }, + child: Container( + width: 70, + height: 70, + child: Image.network(widget + .findusHospitalModelList[ + index] + .projectImageURL + .toString())), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.only( + left: 5, + right: 5, + top: 10, + bottom: 1), + child: Texts( + '${widget.findusHospitalModelList[index].locationName}', + textAlign: TextAlign.center, + ))), //model.cOCItemList[index].cOCTitl + Expanded( + flex: 2, + child: Row( + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + IconButton( + // icon: Icon(Icons.person_pin_circle_outlined,color: Colors.red,), + icon: new Image.asset( + 'assets/images/new-design/navigate.png'), + tooltip: '', + onPressed: () { + setState(() { + MapsLauncher.launchCoordinates( + double.parse(widget + .findusHospitalModelList[ + index] + .latitude), + double.parse(widget + .findusHospitalModelList[ + index] + .longitude), + widget + .findusHospitalModelList[ + index] + .locationName); + }); + }, + ), + IconButton( + // icon: Icon(Icons.phone,color: Colors.red,), + icon: new Image.asset( + 'assets/images/new-design/call.png'), + tooltip: '', + onPressed: () { + setState(() { + // _volume += 10; + launch("tel://" + + widget + .findusHospitalModelList[ + index] + .phoneNumber); + }); + }, + ), + ], + ), + ), + ], + ), ), - ), - - - - ], - ), + ], + ), + // Texts('${model.FindusHospitalModelList[index].locationName}'), + Divider( + height: 4.5, + color: Colors.grey[500], + ) + ], ), - - ], - ), - // Texts('${model.FindusHospitalModelList[index].locationName}'), - Divider(height: 4.5,color: Colors.grey[500],) - ], - ), - ), - )), - SizedBox(height: 8,), - Container(width: double.infinity, - height: 100,color: Colors.white, + ), + )), + SizedBox( + height: 8, + ), + Container( + width: double.infinity, + height: 100, + color: Colors.white, child: Row( - mainAxisSize:MainAxisSize.max, + mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - IconButton( - icon: new Image.asset('assets/images/new-design/youtube.png'), + icon: new Image.asset( + 'assets/images/new-design/youtube.png'), iconSize: 70, tooltip: 'Youtube', onPressed: () { setState(() { - - launch("https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); - + launch( + "https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); }); }, ), IconButton( - icon: new Image.asset('assets/images/new-design/linkedin.png'), + icon: new Image.asset( + 'assets/images/new-design/linkedin.png'), tooltip: 'LinkedIn', iconSize: 70, onPressed: () { setState(() { - - launch("https://www.linkedin.com/company/drsulaiman-alhabib-medical-group"); + launch( + "https://www.linkedin.com/company/drsulaiman-alhabib-medical-group"); }); }, ), IconButton( - icon: new Image.asset('assets/images/new-design/twitter.png'), + icon: new Image.asset( + 'assets/images/new-design/twitter.png'), tooltip: 'Twitter', iconSize: 70, onPressed: () { setState(() { - launch("https://twitter.com/HMG"); }); }, ), IconButton( - icon: new Image.asset('assets/images/new-design/facebook.png'), + icon: new Image.asset( + 'assets/images/new-design/facebook.png'), tooltip: 'facebook', iconSize: 70, onPressed: () { setState(() { - - launch("https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); + launch( + "https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); }); }, ), @@ -188,8 +235,6 @@ class _HospitalsPageState extends State { ), ), ), - ); - } } diff --git a/lib/pages/ContactUs/findus/pharmacies_page.dart b/lib/pages/ContactUs/findus/pharmacies_page.dart index 40799f17..5dc44019 100644 --- a/lib/pages/ContactUs/findus/pharmacies_page.dart +++ b/lib/pages/ContactUs/findus/pharmacies_page.dart @@ -12,9 +12,9 @@ import 'package:maps_launcher/maps_launcher.dart'; import 'package:url_launcher/url_launcher.dart'; class PharmaciesPage extends StatefulWidget { - final List findusPharmaciesModelList; + final List findusPharmaciesModelList; - PharmaciesPage({Key key, this.findusPharmaciesModelList}); + PharmaciesPage({Key key, this.findusPharmaciesModelList}); @override _PharmaciesPageState createState() => _PharmaciesPageState(); } @@ -30,137 +30,177 @@ class _PharmaciesPageState extends State { children: [ ...List.generate( widget.findusPharmaciesModelList.length, - (index) => Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(5)), - color: Colors.white, - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + (index) => Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.white, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - InkWell( - onTap:(){ - showDialog( - context: context,builder: (_) => AssetGiffyDialog( - title: Text(widget.findusPharmaciesModelList[index].locationName, - style: TextStyle( - fontSize: 22.0, fontWeight: FontWeight.w600), - ), - image:widget.findusPharmaciesModelList[index].projectImageURL!= null? Image.network(widget.findusPharmaciesModelList[index].projectImageURL, fit: BoxFit.cover,): Image.network('https://hmgwebservices.com/Images/Hospitals/15.jpg', fit: BoxFit.cover,) , - buttonCancelText:Text('cancel') , - // buttonCancelText:Text(model.user.projectID) , - buttonCancelColor: Colors.grey, - onlyCancelButton: true, - - ) ); - }, - child: Container( - width: 70, - height: 70, - child: - Image.network(widget.findusPharmaciesModelList[index].projectImageURL!= null? widget.findusPharmaciesModelList[index].projectImageURL.toString(): 'https://hmgwebservices.com/Images/Hospitals/15.jpg') ), - ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.only( - left: 5, right: 5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - '${widget.findusPharmaciesModelList[index].locationName}', - textAlign: TextAlign.start, - ), - SizedBox(height: 4,), - Texts( - '${widget.findusPharmaciesModelList[index].cityName}', - textAlign: TextAlign.center, - ), - ], + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + InkWell( + onTap: () { + showDialog( + context: context, + builder: (_) => + AssetGiffyDialog( + title: Text( + widget + .findusPharmaciesModelList[ + index] + .locationName, + style: TextStyle( + fontSize: 22.0, + fontWeight: + FontWeight + .w600), + ), + image: widget + .findusPharmaciesModelList[ + index] + .projectImageURL != + null + ? Image.network( + widget + .findusPharmaciesModelList[ + index] + .projectImageURL, + fit: BoxFit.cover, + ) + : Image.network( + 'https://hmgwebservices.com/Images/Hospitals/15.jpg', + fit: BoxFit.cover, + ), + buttonCancelText: + Text('cancel'), + // buttonCancelText:Text(model.user.projectID) , + buttonCancelColor: + Colors.grey, + onlyCancelButton: true, + )); + }, + child: Container( + width: 70, + height: 70, + child: Image.network(widget + .findusPharmaciesModelList[ + index] + .projectImageURL != + null + ? widget + .findusPharmaciesModelList[ + index] + .projectImageURL + .toString() + : 'https://hmgwebservices.com/Images/Hospitals/15.jpg')), ), - ), - ), - //model.cOCItemList[index].cOCTitl - Expanded( - flex: 2, - child: Row( - children: [ - IconButton( - // icon: Icon( - // Icons - // .person_pin_circle_outlined, - // color: Colors.red, - // ), - icon:new Image.asset('assets/images/new-design/navigate.png'), - tooltip: - '', - onPressed: () { - setState(() { - MapsLauncher.launchCoordinates( - double.parse(widget.findusPharmaciesModelList[ - index] - .latitude), - double.parse(widget.findusPharmaciesModelList[ - index] - .longitude), - widget.findusPharmaciesModelList[ - index] - .locationName); - // _volume += 10; - }); - }, + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.only( + left: 5, right: 5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + '${widget.findusPharmaciesModelList[index].locationName}', + textAlign: TextAlign.start, + ), + SizedBox( + height: 4, + ), + Texts( + '${widget.findusPharmaciesModelList[index].cityName}', + textAlign: TextAlign.center, + ), + ], + ), ), - IconButton( - // icon: Icon( - // Icons.phone, - // color: Colors.red, - // ), - icon:new Image.asset('assets/images/new-design/call.png'), - tooltip: - 'I', - onPressed: () { - setState(() { - // _volume += 10; - launch("tel://" + - widget.findusPharmaciesModelList[ - index] - .phoneNumber); - }); - }, + ), + //model.cOCItemList[index].cOCTitl + Expanded( + flex: 2, + child: Row( + children: [ + IconButton( + // icon: Icon( + // Icons + // .person_pin_circle_outlined, + // color: Colors.red, + // ), + icon: new Image.asset( + 'assets/images/new-design/navigate.png'), + tooltip: '', + onPressed: () { + setState(() { + MapsLauncher.launchCoordinates( + double.parse(widget + .findusPharmaciesModelList[ + index] + .latitude), + double.parse(widget + .findusPharmaciesModelList[ + index] + .longitude), + widget + .findusPharmaciesModelList[ + index] + .locationName); + // _volume += 10; + }); + }, + ), + IconButton( + // icon: Icon( + // Icons.phone, + // color: Colors.red, + // ), + icon: new Image.asset( + 'assets/images/new-design/call.png'), + tooltip: 'I', + onPressed: () { + setState(() { + // _volume += 10; + launch("tel://" + + widget + .findusPharmaciesModelList[ + index] + .phoneNumber); + }); + }, + ), + ], ), - ], - ), + ), + ], ), - ], - ), + ), + ], ), + Divider( + height: 4.5, + color: Colors.grey[500], + ) ], ), - - Divider( - height: 4.5, - color: Colors.grey[500], - ) - ], - ), - ), - )), + ), + )), SizedBox( height: 8, ), From 9a6eadc3fbba69f3124e7e0b1f4f7255c7a5691b Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Mon, 28 Sep 2020 11:07:29 +0300 Subject: [PATCH 16/33] Contact us and virtual tout --- .../all_habib_medical_service_page.dart | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 616b5fd8..70aa5855 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -16,6 +16,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/widgets/data_display/services)contaniner.dart'; +import 'package:url_launcher/url_launcher.dart'; class AllHabibMedicalService extends StatefulWidget { @override @@ -263,12 +264,7 @@ class _AllHabibMedicalServiceState extends State { title: TranslationBase.of(context).parking, ), ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage( - page: ParkingPage(), - ), - ), + onTap: () =>launch("https://hmgwebservices.com/vt_mobile/html/index.html"), imageLocation: 'assets/images/new-design/virtual_tour_icon.png', title: 'Virtual Tour', From 82c2577d3612bce62b3fd7dafc003332e8ffd1e6 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 28 Sep 2020 15:53:14 +0300 Subject: [PATCH 17/33] Done ask doctor service --- lib/config/config.dart | 6 + .../model/ask_doctor/AskDoctorReqTypes.dart | 92 +++++++ lib/core/model/ask_doctor/DoctorResponse.dart | 76 ++++++ lib/core/service/client/base_app_client.dart | 3 +- .../service/medical/ask_doctor_services.dart | 106 ++++++++ .../service/medical/my_doctor_service.dart | 30 +-- lib/core/viewModels/base_view_model.dart | 10 +- .../medical/ask_doctor_view_model.dart | 110 ++++++++ lib/locator.dart | 5 +- .../BookAppointment/widgets/DoctorView.dart | 1 + .../ask_doctor/ViewDoctorResponsesPage.dart | 32 +++ .../ask_doctor/ask_doctor_home_page.dart | 125 +++++++++ .../medical/ask_doctor/ask_doctor_page.dart | 243 ++++++++++++++++++ .../medical/ask_doctor/doctor_response.dart | 178 +++++++++++++ .../medical/ask_doctor/request_type.dart | 132 ++++++++++ lib/pages/medical/medical_profile_page.dart | 17 +- lib/uitl/date_uitl.dart | 10 + .../others/app_expandable_notifier.dart | 5 +- 18 files changed, 1147 insertions(+), 34 deletions(-) create mode 100644 lib/core/model/ask_doctor/AskDoctorReqTypes.dart create mode 100644 lib/core/model/ask_doctor/DoctorResponse.dart create mode 100644 lib/core/service/medical/ask_doctor_services.dart create mode 100644 lib/core/viewModels/medical/ask_doctor_view_model.dart create mode 100644 lib/pages/medical/ask_doctor/ViewDoctorResponsesPage.dart create mode 100644 lib/pages/medical/ask_doctor/ask_doctor_home_page.dart create mode 100644 lib/pages/medical/ask_doctor/ask_doctor_page.dart create mode 100644 lib/pages/medical/ask_doctor/doctor_response.dart create mode 100644 lib/pages/medical/ask_doctor/request_type.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 698ff8df..a34848d5 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -220,6 +220,12 @@ const ADD_WEIGHT_PRESSURE_RESULT='Services/Patients.svc/REST/Patient_AddWeightMe const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID='Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID'; +const GET_CALL_INFO_HOURS_RESULT = 'Services/Doctors.svc/REST/GetCallInfoHoursResult'; +const GET_CALL_REQUEST_TYPE_LOV = 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; +const GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse'; +const UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus'; +const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; + const TIMER_MIN = 10; diff --git a/lib/core/model/ask_doctor/AskDoctorReqTypes.dart b/lib/core/model/ask_doctor/AskDoctorReqTypes.dart new file mode 100644 index 00000000..b306f97b --- /dev/null +++ b/lib/core/model/ask_doctor/AskDoctorReqTypes.dart @@ -0,0 +1,92 @@ +class AskDoctorReqTypes { + dynamic setupID; + int parameterGroup; + int parameterType; + int parameterCode; + String description; + dynamic descriptionN; + dynamic alias; + dynamic aliasN; + dynamic prefix; + dynamic suffix; + dynamic isColorCodingRequired; + dynamic backColor; + dynamic foreColor; + bool isBuiltIn; + bool isActive; + int createdBy; + String createdOn; + dynamic editedBy; + dynamic editedOn; + dynamic rowVer; + + AskDoctorReqTypes( + {this.setupID, + this.parameterGroup, + this.parameterType, + this.parameterCode, + this.description, + this.descriptionN, + this.alias, + this.aliasN, + this.prefix, + this.suffix, + this.isColorCodingRequired, + this.backColor, + this.foreColor, + this.isBuiltIn, + this.isActive, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.rowVer}); + + AskDoctorReqTypes.fromJson(Map json) { + setupID = json['SetupID']; + parameterGroup = json['ParameterGroup']; + parameterType = json['ParameterType']; + parameterCode = json['ParameterCode']; + description = json['Description']; + descriptionN = json['DescriptionN']; + alias = json['Alias']; + aliasN = json['AliasN']; + prefix = json['Prefix']; + suffix = json['Suffix']; + isColorCodingRequired = json['IsColorCodingRequired']; + backColor = json['BackColor']; + foreColor = json['ForeColor']; + isBuiltIn = json['IsBuiltIn']; + isActive = json['IsActive']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + rowVer = json['RowVer']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ParameterGroup'] = this.parameterGroup; + data['ParameterType'] = this.parameterType; + data['ParameterCode'] = this.parameterCode; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['Alias'] = this.alias; + data['AliasN'] = this.aliasN; + data['Prefix'] = this.prefix; + data['Suffix'] = this.suffix; + data['IsColorCodingRequired'] = this.isColorCodingRequired; + data['BackColor'] = this.backColor; + data['ForeColor'] = this.foreColor; + data['IsBuiltIn'] = this.isBuiltIn; + data['IsActive'] = this.isActive; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['RowVer'] = this.rowVer; + return data; + } +} diff --git a/lib/core/model/ask_doctor/DoctorResponse.dart b/lib/core/model/ask_doctor/DoctorResponse.dart new file mode 100644 index 00000000..0dcd41b0 --- /dev/null +++ b/lib/core/model/ask_doctor/DoctorResponse.dart @@ -0,0 +1,76 @@ +class DoctorResponse { + int projectID; + int transactionNo; + int patientID; + int doctorID; + int requestType; + String requestTypeDescription; + dynamic requestTypeDescriptionN; + int status; + String remarks; + String createdOn; + dynamic readStatus; + String doctorName; + bool isDoctorRespond; + bool isPatientRead; + List transactions; + + DoctorResponse( + {this.projectID, + this.transactionNo, + this.patientID, + this.doctorID, + this.requestType, + this.requestTypeDescription, + this.requestTypeDescriptionN, + this.status, + this.remarks, + this.createdOn, + this.readStatus, + this.doctorName, + this.isDoctorRespond, + this.isPatientRead, + this.transactions}); + + DoctorResponse.fromJson(Map json) { + projectID = json['ProjectID']; + transactionNo = json['TransactionNo']; + patientID = json['PatientID']; + doctorID = json['DoctorID']; + requestType = json['RequestType']; + requestTypeDescription = json['RequestTypeDescription']; + requestTypeDescriptionN = json['RequestTypeDescriptionN']; + status = json['Status']; + remarks = json['Remarks']; + createdOn = json['CreatedOn']; + readStatus = json['ReadStatus']; + doctorName = json['DoctorName']; + isDoctorRespond = json['IsDoctorRespond']; + isPatientRead = json['IsPatientRead']; + if (json['Transactions'] != null) { + transactions = json['Transactions']; + } + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['TransactionNo'] = this.transactionNo; + data['PatientID'] = this.patientID; + data['DoctorID'] = this.doctorID; + data['RequestType'] = this.requestType; + data['RequestTypeDescription'] = this.requestTypeDescription; + data['RequestTypeDescriptionN'] = this.requestTypeDescriptionN; + data['Status'] = this.status; + data['Remarks'] = this.remarks; + data['CreatedOn'] = this.createdOn; + data['ReadStatus'] = this.readStatus; + data['DoctorName'] = this.doctorName; + data['IsDoctorRespond'] = this.isDoctorRespond; + data['IsPatientRead'] = this.isPatientRead; + if (this.transactions != null) { + data['Transactions'] = this.transactions.map((v) => v.toJson()).toList(); + } + return data; + } +} diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 8fde2166..289112ee 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -67,8 +67,7 @@ class BaseAppClient { if (user != null) { body['TokenID'] = token; - body['PatientID'] = - body['PatientID'] != null ? body['PatientID'] : user['PatientID']; + body['PatientID'] = user['PatientID']; body['PatientOutSA'] = user['OutSA']; body['SessionID'] = getSessionId(token); } diff --git a/lib/core/service/medical/ask_doctor_services.dart b/lib/core/service/medical/ask_doctor_services.dart new file mode 100644 index 00000000..9a819a6e --- /dev/null +++ b/lib/core/service/medical/ask_doctor_services.dart @@ -0,0 +1,106 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/ask_doctor/AskDoctorReqTypes.dart'; +import 'package:diplomaticquarterapp/core/model/ask_doctor/DoctorResponse.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class AskDoctorService extends BaseService { + List askDoctorReqTypes = List(); + List doctorResponseList = List(); + + Future getCallInfoHoursResult({int projectId, int doctorId}) async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['DoctorID'] = doctorId; + body['ProjectID'] = projectId; + + await baseAppClient.post(GET_CALL_INFO_HOURS_RESULT, + onSuccess: (dynamic response, int statusCode) { + ///OKAY + var asd=""; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getCallRequestTypeLOV() async { + hasError =false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_CALL_REQUEST_TYPE_LOV, + onSuccess: (dynamic response, int statusCode) { + askDoctorReqTypes.clear(); + response['ListReqTypes'].forEach((reqType) { + askDoctorReqTypes.add(AskDoctorReqTypes.fromJson(reqType)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getDoctorResponse() async { + hasError =false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['from'] = + "${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} 00:00:00"; + body['from'] = + "${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} ${DateTime.now().hour}:${DateTime.now().minute}:00"; + await baseAppClient.post(GET_DOCTOR_RESPONSE, + onSuccess: (dynamic response, int statusCode) { + doctorResponseList.clear(); + response['List_DoctorResponse'].forEach((reqType) { + doctorResponseList.add(DoctorResponse.fromJson(reqType)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future updateReadStatus({int transactionNo}) async { + hasError =false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['TransactionNo'] = transactionNo; + await baseAppClient.post(UPDATE_READ_STATUS, + onSuccess: (dynamic response, int statusCode) { + //TODO fix it + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + + Future sendRequestLOV({DoctorList doctorList,String requestType,String remark}) async { + hasError =false; + Map body = Map(); + body['ProjectID'] = doctorList.projectID; + body['SetupID'] = doctorList.setupID; + body['DoctorID'] = doctorList.doctorID; + body['PatientMobileNumber'] = user.mobileNumber; + body['IsMessageSent'] = false; + body['RequestDate'] = DateUtil.yearMonthDay(DateTime.now()); + body['RequestTime'] = DateUtil.time(DateTime.now()); + body['Remarks'] = remark; + body['Status'] = 2;// 4 for testing only.."cancelled status insert" else should be changed to 1 in live version + body['CreatedBy'] = 102; + body['CreatedOn'] = DateUtil.yearMonthDay(DateTime.now()); + body['EditedBy'] = 102; + body['EditedOn'] = DateUtil.yearMonthDay(DateTime.now()); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(INSERT_CALL_INFO, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + +} diff --git a/lib/core/service/medical/my_doctor_service.dart b/lib/core/service/medical/my_doctor_service.dart index 4df3ce8a..f2ba067a 100644 --- a/lib/core/service/medical/my_doctor_service.dart +++ b/lib/core/service/medical/my_doctor_service.dart @@ -15,22 +15,8 @@ class MyDoctorService extends BaseService { RequestPatientDoctorAppointment patientDoctorAppointmentRequest = RequestPatientDoctorAppointment( - top: 0, - versionID: 5.5, - beforeDays: 0, - exludType: 4, - channel: 3, - languageID: 2, - iPAdress: '10.20.10.20', - generalid: 'Cs2020@2016\$2958', - patientOutSA: 0, - sessionID: 'TMRhVmkGhOsvamErw', - isDentalAllowedBackend: false, - deviceTypeID: 1, - patientID: 1231755, - tokenID: '@dm!n', - patientType: 1, - patientTypeID: 1); + isDentalAllowedBackend: false, + ); RequestDoctorRating _requestDoctorRating = RequestDoctorRating( channel: 3, @@ -44,7 +30,12 @@ class MyDoctorService extends BaseService { generalid: 'Cs2020@2016\$2958', isDentalAllowedBackend: false); - Future getPatientDoctorAppointmentList() async { + Future getPatientDoctorAppointmentList({int top = 0, int beforeDays = 0,int exludType=4}) async { + hasError = false; + patientDoctorAppointmentRequest.top = top; + patientDoctorAppointmentRequest.beforeDays = beforeDays; + patientDoctorAppointmentRequest.exludType = exludType; + await baseAppClient.post(GET_MY_DOCTOR, onSuccess: (dynamic response, int statusCode) { patientDoctorAppointmentList.clear(); @@ -75,7 +66,8 @@ class MyDoctorService extends BaseService { deviceTypeID: 2, ); - Future getDoctorProfileAndRating({int doctorId,int clinicID,int projectID }) async { + Future getDoctorProfileAndRating( + {int doctorId, int clinicID, int projectID}) async { ///GET DOCTOR PROFILE _requestDoctorProfile.doctorID = doctorId; _requestDoctorProfile.clinicID = clinicID; @@ -89,8 +81,6 @@ class MyDoctorService extends BaseService { doctorList.doctorTitle = doctorProfile.doctorTitleForProfile; doctorList.name = doctorProfile.doctorName; doctorList.projectName = doctorProfile.projectName; - - }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModels/base_view_model.dart b/lib/core/viewModels/base_view_model.dart index 8e228512..3d7122bd 100644 --- a/lib/core/viewModels/base_view_model.dart +++ b/lib/core/viewModels/base_view_model.dart @@ -18,9 +18,11 @@ class BaseViewModel extends ChangeNotifier { void setState(ViewState viewState) { _state = viewState; - // this.removeListener(() { }); - if(hasListeners) - notifyListeners(); + + if (viewState == ViewState.Busy || viewState == ViewState.BusyLocal) + error = ""; + + if (hasListeners) notifyListeners(); } BaseViewModel() { @@ -39,7 +41,7 @@ class BaseViewModel extends ChangeNotifier { @override void dispose() { - removeListener(() { }); + removeListener(() {}); super.dispose(); } } diff --git a/lib/core/viewModels/medical/ask_doctor_view_model.dart b/lib/core/viewModels/medical/ask_doctor_view_model.dart new file mode 100644 index 00000000..629df0a9 --- /dev/null +++ b/lib/core/viewModels/medical/ask_doctor_view_model.dart @@ -0,0 +1,110 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/ask_doctor/AskDoctorReqTypes.dart'; +import 'package:diplomaticquarterapp/core/model/ask_doctor/DoctorResponse.dart'; +import 'package:diplomaticquarterapp/core/service/medical/ask_doctor_services.dart'; +import 'package:diplomaticquarterapp/core/service/medical/my_doctor_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +class AskDoctorViewModel extends BaseViewModel { + AskDoctorService _askDoctorService = locator(); + MyDoctorService _myDoctorService = locator(); + + List patientDoctorAppointmentListHospital = + List(); + + List get askDoctorReqTypes => + _askDoctorService.askDoctorReqTypes; + + List get doctorResponseList => + _askDoctorService.doctorResponseList; + + Future getMyDoctor() async { + setState(ViewState.Busy); + await _myDoctorService.getPatientDoctorAppointmentList( + top: 25, beforeDays: 15); + if (_myDoctorService.hasError) { + error = _myDoctorService.error; + setState(ViewState.Error); + } else + var asd = ""; + _myDoctorService.patientDoctorAppointmentList.forEach((element) { + List doctorByClinic = + patientDoctorAppointmentListHospital + .where((elementClinic) => + elementClinic.filterName == element.projectName) + .toList(); + + if (doctorByClinic.length != 0) { + patientDoctorAppointmentListHospital[ + patientDoctorAppointmentListHospital.indexOf(doctorByClinic[0])] + .patientDoctorAppointmentList + .add(element); + } else { + patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList( + filterName: element.projectName, + patientDoctorAppointment: element)); + } + + setState(ViewState.Idle); + }); + } + + Future getCallRequestTypeLOVs() async { + setState(ViewState.Busy); + await _askDoctorService.getCallRequestTypeLOV(); + if (_askDoctorService.hasError) { + error = _askDoctorService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else + setState(ViewState.Idle); + } + + Future getCallInfoHoursResult({int projectId, int doctorId}) async { + setState(ViewState.Busy); + await _askDoctorService.getCallInfoHoursResult( + projectId: projectId, doctorId: doctorId); + if (_askDoctorService.hasError) { + error = _askDoctorService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + getDoctorResponse() async { + setState(ViewState.Busy); + await _askDoctorService.getDoctorResponse(); + if (_askDoctorService.hasError) { + error = _askDoctorService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future updateReadStatus({int transactionNo}) async { + setState(ViewState.Busy); + await _askDoctorService.updateReadStatus(transactionNo: transactionNo); + if (_askDoctorService.hasError) { + error = _askDoctorService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future sendRequestLOV( + {DoctorList doctorList, String requestType, String remark}) async { + setState(ViewState.BusyLocal); + await _askDoctorService.sendRequestLOV( + doctorList: doctorList, requestType: requestType, remark: remark); + if (_askDoctorService.hasError) { + error = _askDoctorService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/locator.dart b/lib/locator.dart index 79e92a63..406dee3e 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -15,6 +15,7 @@ import 'core/service/medical/BloodSugarService.dart'; import 'core/service/medical/EyeService.dart'; import 'core/service/medical/PatientSickLeaveService.dart'; import 'core/service/medical/WeightPressureService.dart'; +import 'core/service/medical/ask_doctor_services.dart'; import 'core/service/medical/labs_service.dart'; import 'core/service/medical/medical_service.dart'; import 'core/service/medical/my_balance_service.dart'; @@ -31,6 +32,7 @@ import 'core/service/medical/reports_service.dart'; import 'core/viewModels/hospital_view_model.dart'; import 'core/viewModels/medical/ActiveMedicationsViewModel.dart'; import 'core/viewModels/medical/EyeViewModel.dart'; +import 'core/viewModels/medical/ask_doctor_view_model.dart'; import 'core/viewModels/medical/blood_pressure_view_model.dart'; import 'core/viewModels/medical/labs_view_model.dart'; import 'core/viewModels/medical/medical_view_model.dart'; @@ -83,6 +85,7 @@ void setupLocator() { locator.registerLazySingleton(() => WeightService()); locator.registerLazySingleton(() => EyeService()); locator.registerLazySingleton(() => ActiveMedicationsService()); + locator.registerLazySingleton(() => AskDoctorService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -110,5 +113,5 @@ void setupLocator() { locator.registerFactory(() => WeightPressureViewMode()); locator.registerFactory(() => EyeViewModel()); locator.registerFactory(() => ActiveMedicationsViewModel()); - + locator.registerFactory(() => AskDoctorViewModel()); } diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index d3150459..cad9da25 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -13,6 +13,7 @@ class DoctorView extends StatelessWidget { final DoctorList doctor; + DoctorView({@required this.doctor}); @override diff --git a/lib/pages/medical/ask_doctor/ViewDoctorResponsesPage.dart b/lib/pages/medical/ask_doctor/ViewDoctorResponsesPage.dart new file mode 100644 index 00000000..2551ebc9 --- /dev/null +++ b/lib/pages/medical/ask_doctor/ViewDoctorResponsesPage.dart @@ -0,0 +1,32 @@ +import 'package:diplomaticquarterapp/core/model/ask_doctor/DoctorResponse.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; + +class ViewDoctorResponsesPage extends StatelessWidget { + final DoctorResponse doctorResponse; + + const ViewDoctorResponsesPage({Key key, this.doctorResponse}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.updateReadStatus(transactionNo: doctorResponse.transactionNo), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: ' View Doctor Responses', + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart new file mode 100644 index 00000000..e934c78d --- /dev/null +++ b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart @@ -0,0 +1,125 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'ask_doctor_page.dart'; +import 'doctor_response.dart'; + +class AskDoctorHomPage extends StatefulWidget { + @override + _AskDoctorHomPageState createState() => _AskDoctorHomPageState(); +} + +class _AskDoctorHomPageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).prescriptions, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.9), + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + //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: [ + Tab( + child: Container( + width: MediaQuery.of(context).size.width * 0.36, + child: Center( + child: Texts('ASK Doctor'), + ), + ), + ), + Tab(child: Container( + width: MediaQuery.of(context).size.width * 0.36, + child: Center( + child: Texts('Doctor Responses',textAlign: TextAlign.start,), + ), + ),) + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + AskDoctorPage(), + DoctorResponse() + ], + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/medical/ask_doctor/ask_doctor_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_page.dart new file mode 100644 index 00000000..1aa0004b --- /dev/null +++ b/lib/pages/medical/ask_doctor/ask_doctor_page.dart @@ -0,0 +1,243 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/ask_doctor/request_type.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rating_bar/rating_bar.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +class AskDoctorPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getMyDoctor(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(10), + child: Column( + children: [ + SizedBox( + height: 70, + ), + ...List.generate( + model.patientDoctorAppointmentListHospital.length, + (index) => AppExpandableNotifier( + title: + model.patientDoctorAppointmentListHospital[index].filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: + model.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.map((doctor) { + return InkWell( + onTap: () { + model + .getCallInfoHoursResult( + doctorId: doctor.doctorID, + projectId: doctor.projectID) + .then((value) { + if (model.state != ViewState.ErrorLocal && + model.state != ViewState.Error) { + // Navigator.pop(context); + Navigator.push( + context, + FadePage( + page: RequestTypePage(doctorList: doctor,), + ), + ); + } else { + AppToast.showErrorToast(message: model.error); + } + }); + + ///.showProgressBar( + // text: "Loading", + // backgroundColor: + // Colors.blue.withOpacity(0.6)) + }, + child: Card( + margin: + EdgeInsets.fromLTRB(10.0, 16.0, 10.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + decoration: BoxDecoration(), + padding: EdgeInsets.all(7.0), + width: MediaQuery.of(context).size.width, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: + BorderRadius.circular(100.0), + child: Image.network( + doctor.doctorImageURL, + fit: BoxFit.fill, + height: 60.0, + width: 60.0), + ), + ), + Expanded( + flex: 4, + child: Container( + width: + MediaQuery.of(context).size.width * + 0.55, + margin: EdgeInsets.fromLTRB( + 20.0, 10.0, 10.0, 0.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + if (doctor.doctorTitle != null) + Text( + doctor.doctorTitle + + " " + + doctor.name, + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700], + letterSpacing: 1.0)), + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(doctor.clinicName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(doctor.projectName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + if (doctor.speciality != null) + Container( + margin: EdgeInsets.only( + top: 3.0, bottom: 3.0), + child: Text( + getDoctorSpeciality( + doctor.speciality) + .trim(), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + doctor.nearestFreeSlot != null + ? Container( + margin: EdgeInsets.only( + top: 3.0, bottom: 3.0), + child: Text( + getDate(doctor + .nearestFreeSlot), + style: TextStyle( + fontSize: 14.0, + fontWeight: + FontWeight.bold, + color: Colors + .green[600], + letterSpacing: + 1.0)), + ) + : Container(), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: doctor + .actualDoctorRate + .toDouble(), + size: 20.0, + filledColor: + Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: + Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + Container( + child: Image.network( + doctor.nationalityFlagURL, + width: 25.0, + height: 25.0), + ), + ], + ), + ], + ), + ), + ), + ], + ), + ), + ), + ); + }).toList(), + )), + ) + ], + ), + ), + ), + ), + ); + } + + String getDoctorSpeciality(List docSpecial) { + String docSpeciality = ""; + docSpecial.forEach((v) { + docSpeciality = docSpeciality + v + "\n"; + }); + return docSpeciality; + } + + String getDate(String date) { + DateTime dateObj = DateUtil.convertStringToDate(date); + return DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString() + + " " + + dateObj.hour.toString() + + ":" + + getMinute(dateObj); + } + + String getMinute(DateTime dateObj) { + if (dateObj.minute == 0) { + return dateObj.minute.toString() + "0"; + } else { + return dateObj.minute.toString(); + } + } +} + +/** + * + */ diff --git a/lib/pages/medical/ask_doctor/doctor_response.dart b/lib/pages/medical/ask_doctor/doctor_response.dart new file mode 100644 index 00000000..6993eb5b --- /dev/null +++ b/lib/pages/medical/ask_doctor/doctor_response.dart @@ -0,0 +1,178 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import 'ViewDoctorResponsesPage.dart'; + +class DoctorResponse extends StatelessWidget { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getDoctorResponse(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 65, + ), + AppExpandableNotifier( + header: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('New'), + Container( + width: 30, + height: 30, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.red[800], + ), + child: Center( + child: Texts( + '${model.doctorResponseList.length}', + color: Colors.white, + ), + ), + ) + ], + ), + ), + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model.doctorResponseList.map( + (doctor) { + return InkWell( + onTap: () { + ///go to page ViewDoctorResponsesPage + Navigator.push( + context, + FadePage( + page: ViewDoctorResponsesPage(doctorResponse: doctor,), + ), + ); + }, + child: Container( + height: 70, + margin: EdgeInsets.only(top: 8,bottom: 8), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + color: Colors.white, + border: Border.all(color: Colors.grey[300]), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('${doctor.doctorName}'), + SizedBox(height: 5,), + Texts('${doctor.requestTypeDescription}'), + ], + ), + ), + ), + Icon(projectViewModel.isArabic + ? Icons.arrow_forward_ios + : Icons.arrow_back_ios) + ], + ), + ), + ); + }, + ).toList(), + ), + ), + AppExpandableNotifier( + header: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('All'), + Container( + width: 30, + height: 30, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.red[800], + ), + child: Center( + child: Texts( + '${model.doctorResponseList.length}', + color: Colors.white, + ), + ), + ) + ], + ), + ), + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model.doctorResponseList.map( + (doctor) { + return InkWell( + onTap: () {}, + child: Container( + height: 70, + margin: EdgeInsets.only(top: 8,bottom: 8), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + color: Colors.white, + border: Border.all(color: Colors.grey[300]), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('${doctor.doctorName}'), + SizedBox(height: 5,), + Texts('${doctor.requestTypeDescription}'), + ], + ), + ), + ), + Icon(projectViewModel.isArabic + ? Icons.arrow_forward_ios + : Icons.arrow_back_ios) + ], + ), + ), + ); + }, + ).toList(), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/ask_doctor/request_type.dart b/lib/pages/medical/ask_doctor/request_type.dart new file mode 100644 index 00000000..cbf2e606 --- /dev/null +++ b/lib/pages/medical/ask_doctor/request_type.dart @@ -0,0 +1,132 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class RequestTypePage extends StatefulWidget { + final DoctorList doctorList; + + RequestTypePage({Key key, this.doctorList}); + + @override + _RequestTypePageState createState() => _RequestTypePageState(); +} + +class _RequestTypePageState extends State { + String selected = ""; + int parameterCode = -1; + String question = ""; + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getCallRequestTypeLOVs(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Request Type', + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ...List.generate( + model.askDoctorReqTypes.length, + (index) => Container( + width: double.maxFinite, + height: 55, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.0)), + margin: EdgeInsets.all(8.0), + child: InkWell( + onTap: () { + setState(() { + selected = model.askDoctorReqTypes[index].description; + parameterCode = + model.askDoctorReqTypes[index].parameterCode; + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + model.askDoctorReqTypes[index].description), + ), + Radio( + value: model.askDoctorReqTypes[index].description, + groupValue: selected, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + selected = value; + parameterCode = model + .askDoctorReqTypes[index].parameterCode; + }); + }, + ), + ], + ), + ), + ), + ), + if (parameterCode == 6) + Container( + margin: EdgeInsets.only(left: 10, right: 10), + child: NewTextFields( + hintText: 'Enter the question here...', + minLines: 2, + maxLines: 15, + onChanged: (value) { + setState(() { + question = value; + }); + }, + ), + ), + Container( + width: double.maxFinite, + height: MediaQuery.of(context).size.height * 0.2, + ), + ], + ), + ), + ), + bottomSheet: Container( + width: double.maxFinite, + height: MediaQuery.of(context).size.height * 0.1, + child: Padding( + padding: const EdgeInsets.all(12.0), + child: SecondaryButton( + label: 'Send', + loading: model.state == ViewState.BusyLocal, + textColor: Colors.white, + onTap: () { + model.sendRequestLOV( + doctorList: widget.doctorList, + requestType: parameterCode.toString(), + remark: question).then((value) { + if(model.state!=ViewState.ErrorLocal|| model.state!=ViewState.Error){ + Navigator.pop(context); + } + AppToast.showErrorToast(message: "The question add fine "); + + }); + }, + color: Colors.grey[800], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index cf9738df..2ac3b4de 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -25,6 +25,7 @@ import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart' import 'package:provider/provider.dart'; import '../../locator.dart'; import 'active_medications/ActiveMedicationsPage.dart'; +import 'ask_doctor/ask_doctor_home_page.dart'; import 'balance/my_balance_page.dart'; import 'doctor/doctor_home_page.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; @@ -434,11 +435,17 @@ class _MedicalProfilePageState extends State { ), Expanded( flex: 1, - child: MedicalProfileItem( - title: TranslationBase.of(context).askYour, - imagePath: 'medical_history_icon.png', - subTitle: TranslationBase.of(context) - .askYourSubtitle, + child: InkWell( + onTap: (){ + Navigator.push(context, + FadePage(page: AskDoctorHomPage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).askYour, + imagePath: 'medical_history_icon.png', + subTitle: TranslationBase.of(context) + .askYourSubtitle, + ), ), ), ]), diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index a150086c..65d018bf 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -26,6 +26,16 @@ class DateUtil { return start + "$milliseconds" + end; } + static String yearMonthDay(DateTime dateTime){ + String dateFormat = '${dateTime.year}-${dateTime.month}-${dateTime.day}'; + return dateFormat; + } + + static String time(DateTime dateTime){ + String dateFormat = '${dateTime.hour}:${dateTime.minute}:00'; + return dateFormat; + } + /// check Date /// [dateString] String we want to convert static String checkDate(DateTime checkedTime) { diff --git a/lib/widgets/others/app_expandable_notifier.dart b/lib/widgets/others/app_expandable_notifier.dart index 353846e1..0f6de09f 100644 --- a/lib/widgets/others/app_expandable_notifier.dart +++ b/lib/widgets/others/app_expandable_notifier.dart @@ -11,9 +11,10 @@ class AppExpandableNotifier extends StatelessWidget { final Widget bodyWidget; final String title; final Widget collapsed; + final Widget header; AppExpandableNotifier( - {this.headerWidget, this.bodyWidget, this.title, this.collapsed}); + {this.headerWidget, this.bodyWidget, this.title, this.collapsed,this.header}); @override Widget build(BuildContext context) { @@ -35,7 +36,7 @@ class AppExpandableNotifier extends StatelessWidget { headerAlignment: ExpandablePanelHeaderAlignment.center, tapBodyToCollapse: true, ), - header: Padding( + header: header ?? Padding( padding: EdgeInsets.all(10), child: Text( title?? 'Details', From 43689d19ce76930763c6371971f2bcdd5d151bce Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Mon, 28 Sep 2020 16:25:26 +0300 Subject: [PATCH 18/33] Contact us , virtual tout ,News --- .../all_habib_medical_service_page.dart | 19 ++++++---- .../AlHabibMedicalService/my_web_view.dart | 38 +++++++++++++++++++ pubspec.yaml | 5 ++- 3 files changed, 53 insertions(+), 9 deletions(-) create mode 100644 lib/pages/AlHabibMedicalService/my_web_view.dart diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 70aa5855..5ef49ab4 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/health_converter.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/my_web_view.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/parking_page.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; @@ -16,7 +17,9 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/widgets/data_display/services)contaniner.dart'; +import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:url_launcher/url_launcher.dart'; +import 'package:webview_flutter/webview_flutter.dart'; class AllHabibMedicalService extends StatefulWidget { @override @@ -264,18 +267,20 @@ class _AllHabibMedicalServiceState extends State { title: TranslationBase.of(context).parking, ), ServicesContainer( - onTap: () =>launch("https://hmgwebservices.com/vt_mobile/html/index.html"), + onTap: () => launch( + "https://hmgwebservices.com/vt_mobile/html/index.html"), imageLocation: 'assets/images/new-design/virtual_tour_icon.png', title: 'Virtual Tour', ), ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage( - page: ParkingPage(), - ), - ), + onTap: () { + Navigator.of(context).push(MaterialPageRoute( + builder: (BuildContext context) => MyWebView( + title: "HMG News", + selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + ))); + }, imageLocation: 'assets/images/new-design/twitter_dashboard_icon.png', title: 'Latest News', diff --git a/lib/pages/AlHabibMedicalService/my_web_view.dart b/lib/pages/AlHabibMedicalService/my_web_view.dart new file mode 100644 index 00000000..e614c8d0 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/my_web_view.dart @@ -0,0 +1,38 @@ +import 'dart:async'; +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; + final String selectedUrl; + + final Completer _controller = + Completer(); + + MyWebView({ + @required this.title, + @required this.selectedUrl, + }); + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: title, + + body: + WebView( + initialUrl: selectedUrl, + javascriptMode: JavascriptMode.unrestricted, + onWebViewCreated: (WebViewController webViewController) { + _controller.complete(webViewController); + }, + ) + + + ); + } +} \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 9b9588fd..b5a2444a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,8 +16,9 @@ dependencies: flutter_localizations: sdk: flutter 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 b853bede685a00dac336919bf37257bab1e4ae11 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 28 Sep 2020 17:55:24 +0300 Subject: [PATCH 19/33] 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 20/33] 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 21/33] 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 3ffff9686d23910785cfbebaf47467591e835a54 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 29 Sep 2020 16:28:16 +0300 Subject: [PATCH 22/33] Done allergies service --- assets/images/new-design/allergiesDetails.png | Bin 0 -> 2515 bytes lib/config/config.dart | 2 + lib/config/localized_values.dart | 33 +++- lib/core/model/Allergy/Allergy.dart | 48 ++++++ .../prescriptions/prescriptions_order.dart | 26 +-- .../service/medical/AllergiesService.dart | 25 +++ .../medical/AllergiesViewModel.dart | 22 +++ lib/locator.dart | 4 + .../ActiveMedicationsPage.dart | 72 ++++---- .../active_medications/DayCheckBoxDialog.dart | 161 ++++++++++++++++++ .../active_medications/reminder_page.dart | 129 ++++++++++---- lib/pages/medical/allergies_page.dart | 54 ++++++ .../ask_doctor/ViewDoctorResponsesPage.dart | 3 +- .../ask_doctor/ask_doctor_home_page.dart | 6 +- .../medical/ask_doctor/ask_doctor_page.dart | 3 - .../medical/ask_doctor/doctor_response.dart | 35 ++-- .../medical/ask_doctor/request_type.dart | 26 +-- lib/pages/medical/medical_profile_page.dart | 16 +- lib/uitl/CalendarUtils.dart | 4 +- lib/uitl/date_uitl.dart | 32 +++- lib/uitl/translations_delegate_base.dart | 17 ++ pubspec.yaml | 5 + 22 files changed, 597 insertions(+), 126 deletions(-) create mode 100644 assets/images/new-design/allergiesDetails.png create mode 100644 lib/core/model/Allergy/Allergy.dart create mode 100644 lib/core/service/medical/AllergiesService.dart create mode 100644 lib/core/viewModels/medical/AllergiesViewModel.dart create mode 100644 lib/pages/medical/active_medications/DayCheckBoxDialog.dart create mode 100644 lib/pages/medical/allergies_page.dart diff --git a/assets/images/new-design/allergiesDetails.png b/assets/images/new-design/allergiesDetails.png new file mode 100644 index 0000000000000000000000000000000000000000..fc268c9c7160f4c4b13c5f34953a8b2e0251ebdb GIT binary patch literal 2515 zcmV;^2`u)BP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T+hAm9E@}{XhUY7%OS5we-L)UT0tU_ zMGS#zyCB#_LK;;Rlv}t8UbmEE@O<*{vR z>E_PIOPa7*0WPqI;?!8;{^@ImH}#v`Od zOtYf1x!p5%>UcRknT&y@wOSps0kfY>CP$m8P(1ZIZ{dOYz~n{PIkI=b4%7mSlH)5_ z+w1pYb_L6!u5k-F1k`DFtf_?*!%{*>A}ZN*yK={a8V?WcE7oUBy+7!sZkl3^U^Z}+ z3JuOJSCWSZlTe7YDBA4FjZ+7-?o01?*3|Ke@nrn_<(WDn1-BzXZYUne&Nco7`!%9k zIeUPmPmr|Q$qdAL$6G3xG|~?l3lvBm zXAl`+bw{mzjp4M*ZnYuaG@BIO_>7dUvmm+BY*67<kVKR+UMp+~mIDChYo9X8Vr zcco!%*0EAJEp{(zHK%NNzDHQ9X*5qdM2=@}1qk*`O$bn3X57P;#fjF1})`|uuQ211mBjWGs+3Gok3l6pq!d8C%L zc3XvFIeKR63S3&8A;1ItBQK;=iv>zZWw=hGMr5d+o%4~HjV#8m!#K1*JS&(qoLLx9%N(P}=#r!rtO zB2%O_gH(qqs8#EdENy*1>!8GkGZ?~^I)lb&FZuFr*bm)@x@er%z)r zTd0ETeL3YL8oXk@c*g%e)2BBWundMo@D{2Sf?@V2zV!dDDD61T)AQrqM;hP%kH@#c dUu^s>t$P3f literal 0 HcmV?d00001 diff --git a/lib/config/config.dart b/lib/config/config.dart index a34848d5..3e58f203 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -226,6 +226,8 @@ const GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse'; const UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus'; const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; +const GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies'; + const TIMER_MIN = 10; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 790da29f..027d0e74 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -417,7 +417,7 @@ const Map> localizedValues = { "UpdateInsuranceSubtitle": {"en": "Card", "ar": "التأمين"}, "InsuranceApproval": {"en": "Insurance Approval", "ar": "موافقات"}, "InsuranceApprovalSubtitle": {"en": "Approvals", "ar": "موافقات التأمين"}, - "Allergies": {"en": "Approvals", "ar": "الحساسية"}, + "Allergies": {"en": "Allergies", "ar": "الحساسية"}, "AllergiesSubtitle": {"en": "Diagnosed", "ar": "مسجلة"}, "MyVaccines": {"en": "My Vaccines", "ar": "تطعيماتي"}, "MyVaccinesSubtitle": {"en": "List", "ar": "قائمة"}, @@ -497,10 +497,29 @@ const Map> localizedValues = { "Cylinder":{"en":"Cylinder","ar":"الدائرية"}, "Axis":{"en":"Axis","ar":"المحاور"}, "Prism":{"en":"Prism","ar":"موشور"}, - "VA":{"en":"Prism","VA":"المحاور"}, - "LeftEye":{"en":"Left Eye","VA":"العين اليسرى"}, - "Brand":{"en":"Brand","VA":"النوع"}, - "Power":{"en":"Power","VA":"القوة"}, - "Diameter":{"en":"Diameter","VA":"القطر"}, - "Remarks":{"en":"Remarks","VA":"ملاحضات"}, + "VA":{"en":"Prism","ar":"المحاور"}, + "LeftEye":{"en":"Left Eye","ar":"العين اليسرى"}, + "Brand":{"en":"Brand","ar":"النوع"}, + "Power":{"en":"Power","ar":"القوة"}, + "Diameter":{"en":"Diameter","ar":"القطر"}, + "Remarks":{"en":"Remarks","ar":"ملاحضات"}, + "ActiveMedications":{"en":"Active Medications","ar":"ادويتي النشطة"}, + "ExpDate":{"en":"Active Exp Date :","VA":"تاريخ الإنتهاء"}, + "Route":{"en":"Route :","ar":"الطريقة"}, + "Frequency":{"en":"Frequency :","ar":"المعدل"}, + "DailyQuantity":{"en":"Daily Quantity :","ar":"جرعات يومية"}, + "AddReminder":{"en":"Add Reminder","ar":"إضافة تذكير"}, + "reminderDes":{"en":"Please select treatment start day and time to be notified when it\'s time to take the medicine","ar":" يرجى تحديد يوم بدء العلاج والوقت ليتم ارسال تنبيه عندما يحين الوقت لتناول الدواء"}, + "StartDay":{"en":"Start Day","ar":"يوم البداية"}, + "EndDay":{"en":"End Day","ar":"يوم الانتهاء"}, + "Days":{"en":"Days ","ar":"أيام"}, + "ScheduleTime":{"en":"Schedule time","ar":"الجدول الزمني"}, + "AskDoctor":{"en":"Ask Doctor","ar":"اسأل طبيبك"}, + "DoctorResponses":{"en":"Doctor Responses","ar":"ردود الأطباء"}, + "New":{"en":"New","ar":"جديد"}, + "All":{"en":"All","ar":"الكل"}, + "QuestionHere":{"en":"Enter the question here...","ar":"اضف الاستفسار هنا"}, + "ViewDoctorResponses":{"en":"View Doctor Responses","ar":"الاطلاع على ردود الأطباء"}, + + }; diff --git a/lib/core/model/Allergy/Allergy.dart b/lib/core/model/Allergy/Allergy.dart new file mode 100644 index 00000000..be71c7fe --- /dev/null +++ b/lib/core/model/Allergy/Allergy.dart @@ -0,0 +1,48 @@ +class Allergy { + int patientID; + int allergyDiseaseType; + int allergyDiseaseID; + String description; + dynamic descriptionN; + dynamic remarks; + dynamic avgDoctorRatingList; + dynamic doctorRatingDetailsList; + dynamic notesDoctorRatingList; + + Allergy( + {this.patientID, + this.allergyDiseaseType, + this.allergyDiseaseID, + this.description, + this.descriptionN, + this.remarks, + this.avgDoctorRatingList, + this.doctorRatingDetailsList, + this.notesDoctorRatingList}); + + Allergy.fromJson(Map json) { + patientID = json['PatientID']; + allergyDiseaseType = json['AllergyDiseaseType']; + allergyDiseaseID = json['AllergyDiseaseID']; + description = json['Description']; + descriptionN = json['DescriptionN']; + remarks = json['Remarks']; + avgDoctorRatingList = json['AvgDoctorRatingList']; + doctorRatingDetailsList = json['DoctorRatingDetailsList']; + notesDoctorRatingList = json['NotesDoctorRatingList']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['AllergyDiseaseType'] = this.allergyDiseaseType; + data['AllergyDiseaseID'] = this.allergyDiseaseID; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['Remarks'] = this.remarks; + data['AvgDoctorRatingList'] = this.avgDoctorRatingList; + data['DoctorRatingDetailsList'] = this.doctorRatingDetailsList; + data['NotesDoctorRatingList'] = this.notesDoctorRatingList; + return data; + } +} diff --git a/lib/core/model/prescriptions/prescriptions_order.dart b/lib/core/model/prescriptions/prescriptions_order.dart index db2b1855..fdcbf203 100644 --- a/lib/core/model/prescriptions/prescriptions_order.dart +++ b/lib/core/model/prescriptions/prescriptions_order.dart @@ -2,35 +2,35 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; class PrescriptionsOrder { int iD; - String patientID; + dynamic patientID; bool patientOutSA; bool isOutPatient; int projectID; int nearestProjectID; double longitude; double latitude; - String appointmentNo; - String dischargeID; + dynamic appointmentNo; + dynamic dischargeID; int lineItemNo; int status; - String description; - String descriptionN; + dynamic description; + dynamic descriptionN; DateTime createdOn; int serviceID; int createdBy; DateTime editedOn; int editedBy; int channel; - String clientRequestID; + dynamic clientRequestID; bool returnedToQueue; - Null pickupDateTime; - Null pickupLocationName; - Null dropoffLocationName; + dynamic pickupDateTime; + dynamic pickupLocationName; + dynamic dropoffLocationName; int realRRTHaveTransactions; - String nearestProjectDescription; - String nearestProjectDescriptionN; - String projectDescription; - String projectDescriptionN; + dynamic nearestProjectDescription; + dynamic nearestProjectDescriptionN; + dynamic projectDescription; + dynamic projectDescriptionN; PrescriptionsOrder( {this.iD, diff --git a/lib/core/service/medical/AllergiesService.dart b/lib/core/service/medical/AllergiesService.dart new file mode 100644 index 00000000..d3deae2b --- /dev/null +++ b/lib/core/service/medical/AllergiesService.dart @@ -0,0 +1,25 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/Allergy/Allergy.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class AllergiesService extends BaseService { + List allergies = List(); + + getAllergies() async { + hasError = false; + super.error = ""; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['OutSA'] = 0; + await baseAppClient.post(GET_PATIENT_ALLERGIES, + onSuccess: (response, statusCode) async { + allergies.clear(); + response['Patient_Allergies'].forEach((allergy) { + allergies.add(Allergy.fromJson(allergy)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/viewModels/medical/AllergiesViewModel.dart b/lib/core/viewModels/medical/AllergiesViewModel.dart new file mode 100644 index 00000000..bc4666bc --- /dev/null +++ b/lib/core/viewModels/medical/AllergiesViewModel.dart @@ -0,0 +1,22 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/Allergy/Allergy.dart'; +import 'package:diplomaticquarterapp/core/service/medical/AllergiesService.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; + +import '../../../locator.dart'; + +class AllergiesViewModel extends BaseViewModel { + AllergiesService _allergiesService = locator(); + List get allergies => _allergiesService.allergies; + + getAllergies() async { + setState(ViewState.Busy); + await _allergiesService.getAllergies(); + if (_allergiesService.hasError) { + error = _allergiesService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } +} diff --git a/lib/locator.dart b/lib/locator.dart index 406dee3e..cf467ac8 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -10,6 +10,7 @@ import 'core/service/er/er_service.dart'; import 'core/service/feedback/feedback_service.dart'; import 'core/service/hospital_service.dart'; import 'core/service/medical/ActiveMedicationsService.dart'; +import 'core/service/medical/AllergiesService.dart'; import 'core/service/medical/BloodPressureService.dart'; import 'core/service/medical/BloodSugarService.dart'; import 'core/service/medical/EyeService.dart'; @@ -31,6 +32,7 @@ import 'core/viewModels/feedback/feedback_view_model.dart'; import 'core/service/medical/reports_service.dart'; import 'core/viewModels/hospital_view_model.dart'; import 'core/viewModels/medical/ActiveMedicationsViewModel.dart'; +import 'core/viewModels/medical/AllergiesViewModel.dart'; import 'core/viewModels/medical/EyeViewModel.dart'; import 'core/viewModels/medical/ask_doctor_view_model.dart'; import 'core/viewModels/medical/blood_pressure_view_model.dart'; @@ -86,6 +88,7 @@ void setupLocator() { locator.registerLazySingleton(() => EyeService()); locator.registerLazySingleton(() => ActiveMedicationsService()); locator.registerLazySingleton(() => AskDoctorService()); + locator.registerLazySingleton(() => AllergiesService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -114,4 +117,5 @@ void setupLocator() { locator.registerFactory(() => EyeViewModel()); locator.registerFactory(() => ActiveMedicationsViewModel()); locator.registerFactory(() => AskDoctorViewModel()); + locator.registerFactory(() => AllergiesViewModel()); } diff --git a/lib/pages/medical/active_medications/ActiveMedicationsPage.dart b/lib/pages/medical/active_medications/ActiveMedicationsPage.dart index 3409c3db..5bc9618d 100644 --- a/lib/pages/medical/active_medications/ActiveMedicationsPage.dart +++ b/lib/pages/medical/active_medications/ActiveMedicationsPage.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/ActiveMedicationsVi import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/active_medications/reminder_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -17,7 +18,7 @@ class ActiveMedicationsPage extends StatelessWidget { onModelReady: (model) => model.getActiveMedication(), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: 'Active Medications', + appBarTitle: TranslationBase.of(context).activeMedications, isShowAppBar: true, body: Container( child: ListView.builder( @@ -48,7 +49,7 @@ class ActiveMedicationsPage extends StatelessWidget { height: 5, ), Texts( - 'Exp Date :' + + TranslationBase.of(context).expDate+' :' + DateUtil.getDayMonthYearDateFormatted(model .activePrescriptionReport[index].orderDate), ), @@ -56,52 +57,53 @@ class ActiveMedicationsPage extends StatelessWidget { height: 5, ), Texts( - 'Route :' + + TranslationBase.of(context).route+ ' :' + model.activePrescriptionReport[index].route, ), SizedBox( height: 5, ), Texts( - 'Frequency :' + + TranslationBase.of(context).frequency+ ' :' + model.activePrescriptionReport[index].frequency, ), SizedBox( height: 5, ), Texts( - 'Daily Quantity :${model.activePrescriptionReport[index].doseDailyQuantity}', + TranslationBase.of(context).dailyQuantity + ' :${model.activePrescriptionReport[index].doseDailyQuantity}', ), ], ), ), - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: ReminderPage( - frequency: model.activePrescriptionReport[index] - .frequencyNumber, - days: model.activePrescriptionReport[index].days, - itemDescription: model - .activePrescriptionReport[index] - .itemDescription, - ), + Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Icon( + Icons.notifications, + color: Colors.red, + size: 28, ), - ); - }, - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Icon( - Icons.notifications, - color: Colors.red, - size: 28, - ), - Row( + SizedBox(height: 25,), + InkWell( + onTap: (){ + Navigator.push( + context, + FadePage( + page: ReminderPage( + frequency: model.activePrescriptionReport[index] + .frequencyNumber, + days: model.activePrescriptionReport[index].days, + itemDescription: model + .activePrescriptionReport[index] + .itemDescription, + ), + ), + ); + }, + child: Row( children: [ Icon( Icons.notifications_active, @@ -109,13 +111,13 @@ class ActiveMedicationsPage extends StatelessWidget { size: 28, ), Texts( - 'Reminder', + TranslationBase.of(context).addReminder, color: Colors.red, ) ], - ) - ], - ), + ), + ) + ], ), ) ], diff --git a/lib/pages/medical/active_medications/DayCheckBoxDialog.dart b/lib/pages/medical/active_medications/DayCheckBoxDialog.dart new file mode 100644 index 00000000..5cb4020c --- /dev/null +++ b/lib/pages/medical/active_medications/DayCheckBoxDialog.dart @@ -0,0 +1,161 @@ +import 'package:device_calendar/device_calendar.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class DayCheckBoxDialog extends StatefulWidget { + final Function(List) onValueSelected; + final String title; + final List selectedDaysOfWeek; + final List daysOfWeek = [ + DayOfWeek.Monday, + DayOfWeek.Tuesday, + DayOfWeek.Wednesday, + DayOfWeek.Thursday, + DayOfWeek.Friday, + DayOfWeek.Saturday, + DayOfWeek.Sunday, + ]; + + DayCheckBoxDialog( + {Key key, this.onValueSelected, this.selectedDaysOfWeek, this.title}); + + @override + _DayCheckBoxDialogState createState() => _DayCheckBoxDialogState(); +} + +class _DayCheckBoxDialogState extends State { + @override + Widget build(BuildContext context) { + return SimpleDialog( + title: Container( + width: double.infinity, + child: Center( + child: Texts( + widget.title, + textAlign: TextAlign.center, + ))), + children: [ + Container( + height: widget.daysOfWeek.length > 3 + ? MediaQuery.of(context).size.height * 0.6 + : null, + child: SingleChildScrollView( + child: Column( + children: [ + Divider(), + ...List.generate( + widget.daysOfWeek.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + if (widget.selectedDaysOfWeek + .contains(widget.daysOfWeek[index])) + widget.selectedDaysOfWeek + .remove(widget.daysOfWeek[index]); + else + widget.selectedDaysOfWeek + .add(widget.daysOfWeek[index]); + }); + }, + child: ListTile( + title: Text(DateUtil.getDay(widget.daysOfWeek[index])), + leading: Checkbox( + value: widget.selectedDaysOfWeek + .contains(widget.daysOfWeek[index]), + onChanged: (value) { + setState(() { + if (widget.selectedDaysOfWeek + .contains(widget.daysOfWeek[index])) + widget.selectedDaysOfWeek + .remove(widget.daysOfWeek[index]); + else + widget.selectedDaysOfWeek + .add(widget.daysOfWeek[index]); + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context) + .cancel + .toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedDaysOfWeek); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + ), + ), + ), + ), + ), + ], + ) + ], + ), + ), + ) + ], + ); + } + + +} diff --git a/lib/pages/medical/active_medications/reminder_page.dart b/lib/pages/medical/active_medications/reminder_page.dart index 72f6c211..7980d941 100644 --- a/lib/pages/medical/active_medications/reminder_page.dart +++ b/lib/pages/medical/active_medications/reminder_page.dart @@ -1,10 +1,10 @@ +import 'package:device_calendar/device_calendar.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/ActiveMedicationsViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; -import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -13,6 +13,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:provider/provider.dart'; +import 'DayCheckBoxDialog.dart'; + // ignore: must_be_immutable class ReminderPage extends StatefulWidget { final int frequency; @@ -20,6 +22,15 @@ class ReminderPage extends StatefulWidget { 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; @@ -48,7 +59,7 @@ class _ReminderPageState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBarTitle: 'Reminder', + appBarTitle: TranslationBase.of(context).reminder, body: SingleChildScrollView( child: Container( margin: EdgeInsets.all(8.0), @@ -57,14 +68,16 @@ class _ReminderPageState extends State { children: [ Container( width: double.maxFinite, - child: Texts( - 'Please select treatment start day and time to be notified when it\'s time to take the medicine'), + child: Texts(TranslationBase.of(context).reminderDes), ), Divider(), SizedBox( height: 12, ), - Texts('Start day'), + Texts(TranslationBase.of(context).startDay), + SizedBox( + height: 6, + ), InkWell( onTap: () { DatePicker.showDatePicker(context, @@ -72,7 +85,6 @@ class _ReminderPageState extends State { minTime: DateTime( DateTime.now().year, DateTime.now().month - 1, 1), maxTime: DateTime.now(), onConfirm: (date) { - print('confirm $date'); setState(() { widget.startDay = date; }); @@ -102,7 +114,10 @@ class _ReminderPageState extends State { SizedBox( height: 12, ), - Texts('End day'), + Texts(TranslationBase.of(context).endDay), + SizedBox( + height: 6, + ), InkWell( onTap: () { DatePicker.showDatePicker(context, @@ -110,7 +125,6 @@ class _ReminderPageState extends State { minTime: DateTime( DateTime.now().year, DateTime.now().month - 1, 1), maxTime: DateTime.now(), onConfirm: (date) { - print('confirm $date'); setState(() { widget.endDay = date; }); @@ -137,6 +151,37 @@ class _ReminderPageState extends State { ), ), ), + SizedBox( + height: 12, + ), + Texts(TranslationBase.of(context).days), + SizedBox( + height: 6, + ), + InkWell( + onTap: () => confirmSelectDayDialog(), + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Texts( + getDays(), + )), + Icon( + Icons.arrow_drop_down, + color: Colors.black, + ) + ], + ), + ), + ), ...List.generate( widget._scheduleList.length, (index) => Column( @@ -145,7 +190,7 @@ class _ReminderPageState extends State { SizedBox( height: 7, ), - Texts('Schedule time'), + Texts(TranslationBase.of(context).scheduleTime), SizedBox( height: 7, ), @@ -153,7 +198,6 @@ class _ReminderPageState extends State { onTap: () { DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) { - print('confirm $date'); setState(() { widget._scheduleList[index] = date; }); @@ -194,14 +238,31 @@ class _ReminderPageState extends State { ), bottomSheet: Container( width: double.infinity, - height: MediaQuery.of(context).size.height * 0.1, + height: MediaQuery.of(context).size.height * 0.2, padding: EdgeInsets.all(10), - child: SecondaryButton( - label: 'OK', - color: Colors.grey[800], - onTap: () { - schedule(); - }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SecondaryButton( + label: TranslationBase.of(context).ok, + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + schedule(); + }, + ), + SizedBox( + height: 15, + ), + SecondaryButton( + label: TranslationBase.of(context).cancel, + color: Colors.red[800], + textColor: Colors.white, + onTap: () { + Navigator.pop(context); + }, + ), + ], ), ), ), @@ -212,14 +273,6 @@ class _ReminderPageState extends State { List scheduleDateTime = calculateDaysInterval(widget.startDay, widget.endDay); - // scheduleDateTime.forEach((date) { - // LocalNotification.scheduleNotification( - // scheduledNotificationDateTime: date, - // title: 'Remainder', - // description: widget.itemDescription); - // return; - // }); - CalendarUtils calendarUtils = await CalendarUtils.getInstance(); calendarUtils.createOrUpdateEvents( @@ -228,9 +281,6 @@ class _ReminderPageState extends State { title: widget.itemDescription, scheduleDateTime: scheduleDateTime); - - - var asd = calendarUtils.writableCalendars; Navigator.pop(context); } @@ -258,6 +308,25 @@ class _ReminderPageState extends State { } String getDays() { - return ''; + String days = ""; + widget.daysOfWeek.forEach((element) { + days += "${DateUtil.getDay(element)},"; + }); + return days; + } + + void confirmSelectDayDialog() { + showDialog( + context: context, + child: DayCheckBoxDialog( + title: 'Select Day', + selectedDaysOfWeek: widget.daysOfWeek, + onValueSelected: (value) { + setState(() { + widget.daysOfWeek = value; + }); + }, + ), + ); } } diff --git a/lib/pages/medical/allergies_page.dart b/lib/pages/medical/allergies_page.dart new file mode 100644 index 00000000..ea063e19 --- /dev/null +++ b/lib/pages/medical/allergies_page.dart @@ -0,0 +1,54 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/AllergiesViewModel.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class AllergiesPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getAllergies(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).allergies, + baseViewModel: model, + body: ListView.builder( + itemCount: model.allergies.length, + itemBuilder: (context, index) => Container( + margin: EdgeInsets.all(15), + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + ), + child: Row( + children: [ + Image.asset( + 'assets/images/new-design/allergiesDetails.png', + width: 50, + height: 50, + fit: BoxFit.cover, + ), + SizedBox( + width: 15, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(TranslationBase.of(context).remarks+" :"), + Texts(TranslationBase.of(context).description + model.allergies[index].description ?? ''), + ], + ), + ) + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/ask_doctor/ViewDoctorResponsesPage.dart b/lib/pages/medical/ask_doctor/ViewDoctorResponsesPage.dart index 2551ebc9..fc47ed3c 100644 --- a/lib/pages/medical/ask_doctor/ViewDoctorResponsesPage.dart +++ b/lib/pages/medical/ask_doctor/ViewDoctorResponsesPage.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/model/ask_doctor/DoctorResponse.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -16,7 +17,7 @@ class ViewDoctorResponsesPage extends StatelessWidget { onModelReady: (model) => model.updateReadStatus(transactionNo: doctorResponse.transactionNo), builder: (_, model, w) => AppScaffold( isShowAppBar: true, - appBarTitle: ' View Doctor Responses', + appBarTitle: TranslationBase.of(context).viewDoctorResponses, baseViewModel: model, body: SingleChildScrollView( child: Container( diff --git a/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart index e934c78d..5f1938fd 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart @@ -39,7 +39,7 @@ class _AskDoctorHomPageState extends State Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescriptions, + appBarTitle: TranslationBase.of(context).askDoctor, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -87,14 +87,14 @@ class _AskDoctorHomPageState extends State child: Container( width: MediaQuery.of(context).size.width * 0.36, child: Center( - child: Texts('ASK Doctor'), + child: Texts(TranslationBase.of(context).askDoctor), ), ), ), Tab(child: Container( width: MediaQuery.of(context).size.width * 0.36, child: Center( - child: Texts('Doctor Responses',textAlign: TextAlign.start,), + child: Texts(TranslationBase.of(context).doctorResponses,textAlign: TextAlign.start,), ), ),) ], diff --git a/lib/pages/medical/ask_doctor/ask_doctor_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_page.dart index 1aa0004b..6beed0dc 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_page.dart @@ -238,6 +238,3 @@ class AskDoctorPage extends StatelessWidget { } } -/** - * - */ diff --git a/lib/pages/medical/ask_doctor/doctor_response.dart b/lib/pages/medical/ask_doctor/doctor_response.dart index 6993eb5b..b6071a4c 100644 --- a/lib/pages/medical/ask_doctor/doctor_response.dart +++ b/lib/pages/medical/ask_doctor/doctor_response.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -34,7 +35,7 @@ class DoctorResponse extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts('New'), + Texts(TranslationBase.of(context).newDes), Container( width: 30, height: 30, @@ -63,13 +64,15 @@ class DoctorResponse extends StatelessWidget { Navigator.push( context, FadePage( - page: ViewDoctorResponsesPage(doctorResponse: doctor,), + page: ViewDoctorResponsesPage( + doctorResponse: doctor, + ), ), ); }, child: Container( height: 70, - margin: EdgeInsets.only(top: 8,bottom: 8), + margin: EdgeInsets.only(top: 8, bottom: 8), decoration: BoxDecoration( borderRadius: BorderRadius.circular(8), color: Colors.white, @@ -82,11 +85,15 @@ class DoctorResponse extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(8.0), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Texts('${doctor.doctorName}'), - SizedBox(height: 5,), - Texts('${doctor.requestTypeDescription}'), + SizedBox( + height: 5, + ), + Texts( + '${doctor.requestTypeDescription}'), ], ), ), @@ -108,7 +115,7 @@ class DoctorResponse extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts('All'), + Texts(TranslationBase.of(context).all), Container( width: 30, height: 30, @@ -130,12 +137,12 @@ class DoctorResponse extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: model.doctorResponseList.map( - (doctor) { + (doctor) { return InkWell( onTap: () {}, child: Container( height: 70, - margin: EdgeInsets.only(top: 8,bottom: 8), + margin: EdgeInsets.only(top: 8, bottom: 8), decoration: BoxDecoration( borderRadius: BorderRadius.circular(8), color: Colors.white, @@ -148,11 +155,15 @@ class DoctorResponse extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(8.0), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Texts('${doctor.doctorName}'), - SizedBox(height: 5,), - Texts('${doctor.requestTypeDescription}'), + SizedBox( + height: 5, + ), + Texts( + '${doctor.requestTypeDescription}'), ], ), ), diff --git a/lib/pages/medical/ask_doctor/request_type.dart b/lib/pages/medical/ask_doctor/request_type.dart index cbf2e606..55e04a73 100644 --- a/lib/pages/medical/ask_doctor/request_type.dart +++ b/lib/pages/medical/ask_doctor/request_type.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -29,7 +30,7 @@ class _RequestTypePageState extends State { onModelReady: (model) => model.getCallRequestTypeLOVs(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, - appBarTitle: 'Request Type', + appBarTitle: TranslationBase.of(context).requestType, baseViewModel: model, body: SingleChildScrollView( child: Container( @@ -83,7 +84,7 @@ class _RequestTypePageState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10), child: NewTextFields( - hintText: 'Enter the question here...', + hintText: TranslationBase.of(context).questionHere, minLines: 2, maxLines: 15, onChanged: (value) { @@ -107,19 +108,20 @@ class _RequestTypePageState extends State { child: Padding( padding: const EdgeInsets.all(12.0), child: SecondaryButton( - label: 'Send', + label: TranslationBase.of(context).submit, loading: model.state == ViewState.BusyLocal, textColor: Colors.white, onTap: () { - model.sendRequestLOV( - doctorList: widget.doctorList, - requestType: parameterCode.toString(), - remark: question).then((value) { - if(model.state!=ViewState.ErrorLocal|| model.state!=ViewState.Error){ - Navigator.pop(context); - } - AppToast.showErrorToast(message: "The question add fine "); - + model + .sendRequestLOV( + doctorList: widget.doctorList, + requestType: parameterCode.toString(), + remark: question) + .then((value) { + if (model.state != ViewState.ErrorLocal || + model.state != ViewState.Error) { + Navigator.pop(context); + } }); }, color: Colors.grey[800], diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 2ac3b4de..cec19e8b 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -25,6 +25,7 @@ import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart' import 'package:provider/provider.dart'; import '../../locator.dart'; import 'active_medications/ActiveMedicationsPage.dart'; +import 'allergies_page.dart'; import 'ask_doctor/ask_doctor_home_page.dart'; import 'balance/my_balance_page.dart'; import 'doctor/doctor_home_page.dart'; @@ -294,12 +295,14 @@ class _MedicalProfilePageState extends State { ), Expanded( flex: 1, - child: MedicalProfileItem( - title: - TranslationBase.of(context).allergies, - imagePath: 'medical_history_icon.png', - subTitle: TranslationBase.of(context) - .allergiesSubtitle, + child: InkWell( + onTap:()=> Navigator.push(context, FadePage(page: AllergiesPage())) , + child: MedicalProfileItem( + title: TranslationBase.of(context).allergies, + imagePath: 'medical_history_icon.png', + subTitle: TranslationBase.of(context) + .allergiesSubtitle, + ), ), ), ]), @@ -357,7 +360,6 @@ class _MedicalProfilePageState extends State { Expanded( flex: 1, child: InkWell( - //TODO onTap: () { Navigator.push( context, diff --git a/lib/uitl/CalendarUtils.dart b/lib/uitl/CalendarUtils.dart index d61a19b6..546d9b2d 100644 --- a/lib/uitl/CalendarUtils.dart +++ b/lib/uitl/CalendarUtils.dart @@ -33,11 +33,13 @@ class CalendarUtils { {List scheduleList, String title, String description, - List scheduleDateTime}) async { + List scheduleDateTime, + List daysOfWeek}) async { List events = List(); scheduleDateTime.forEach((element) { RecurrenceRule recurrenceRule = RecurrenceRule( RecurrenceFrequency.Daily, + daysOfWeek: daysOfWeek, endDate: element, ); Event event = Event(writableCalendars.id, diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 65d018bf..0155ff10 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -1,3 +1,4 @@ +import 'package:device_calendar/device_calendar.dart'; import 'package:intl/intl.dart'; class DateUtil { @@ -26,12 +27,12 @@ class DateUtil { return start + "$milliseconds" + end; } - static String yearMonthDay(DateTime dateTime){ + static String yearMonthDay(DateTime dateTime) { String dateFormat = '${dateTime.year}-${dateTime.month}-${dateTime.day}'; return dateFormat; } - static String time(DateTime dateTime){ + static String time(DateTime dateTime) { String dateFormat = '${dateTime.hour}:${dateTime.minute}:00'; return dateFormat; } @@ -233,4 +234,31 @@ class DateUtil { .toString() + ")/"; } + + static String getDay(DayOfWeek dayOfWeek) { + switch (dayOfWeek) { + case DayOfWeek.Monday: + return "Monday"; + break; + case DayOfWeek.Tuesday: + return "Tuesday"; + break; + case DayOfWeek.Wednesday: + return "Wednesday"; + break; + case DayOfWeek.Thursday: + return "Thursday"; + break; + case DayOfWeek.Friday: + return "Friday"; + break; + case DayOfWeek.Saturday: + return "Saturday"; + break; + case DayOfWeek.Sunday: + return "Sunday"; + break; + } + return ""; + } } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index adb1a5fc..28b273e5 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -572,6 +572,23 @@ class TranslationBase { String get power => localizedValues['Power'][locale.languageCode]; String get diameter => localizedValues['Diameter'][locale.languageCode]; String get remarks => localizedValues['Remarks'][locale.languageCode]; + String get activeMedications => localizedValues['ActiveMedications'][locale.languageCode]; + String get expDate => localizedValues['ExpDate'][locale.languageCode]; + String get route => localizedValues['Route'][locale.languageCode]; + String get frequency => localizedValues['Frequency'][locale.languageCode]; + String get dailyQuantity => localizedValues['DailyQuantity'][locale.languageCode]; + String get addReminder => localizedValues['AddReminder'][locale.languageCode]; + String get reminderDes => localizedValues['reminderDes'][locale.languageCode]; + String get startDay => localizedValues['StartDay'][locale.languageCode]; + String get endDay => localizedValues['EndDay'][locale.languageCode]; + String get days => localizedValues['Days'][locale.languageCode]; + String get scheduleTime => localizedValues['ScheduleTime'][locale.languageCode]; + String get askDoctor => localizedValues['AskDoctor'][locale.languageCode]; + String get doctorResponses => localizedValues['DoctorResponses'][locale.languageCode]; + String get newDes => localizedValues['New'][locale.languageCode]; + String get all => localizedValues['All'][locale.languageCode]; + String get questionHere => localizedValues['QuestionHere'][locale.languageCode]; + String get viewDoctorResponses => localizedValues['ViewDoctorResponses'][locale.languageCode]; } diff --git a/pubspec.yaml b/pubspec.yaml index 49710761..1c1106f2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -110,11 +110,16 @@ dependencies: #Popup_window popup_box: ^0.1.0 + #datetime_picker flutter_datetime_picker: ^1.4.0 + #local_notifications flutter_local_notifications: ^1.4.4+4 + + #rxdart rxdart: ^0.24.1 + #device_calendar device_calendar: ^3.1.0 #Handle Geolocation From d6a27a8e289e7e834ada7bfafe13232292132467 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 30 Sep 2020 08:54:17 +0300 Subject: [PATCH 23/33] change medical profile icons --- assets/images/medical/active_medications.png | Bin 0 -> 2323 bytes assets/images/medical/ask_doctor_icon.png | Bin 0 -> 3460 bytes assets/images/medical/check-in.png | Bin 0 -> 2050 bytes .../eye_measurement_icon.png | Bin .../images/medical/insurance_update_icon_.png | Bin 0 -> 1362 bytes .../images/medical/medical_reports_icon.png | Bin 0 -> 2968 bytes .../images/medical/monthly_reports_icon.png | Bin 0 -> 3570 bytes assets/images/medical/my_allergies_icon.png | Bin 0 -> 2849 bytes assets/images/medical/my_tracker_icon.png | Bin 0 -> 1864 bytes assets/images/medical/my_vaccines_icon.png | Bin 0 -> 1837 bytes assets/images/medical/sick_leaves_icons.png | Bin 0 -> 3073 bytes assets/images/medical/smartwatch_icon.png | Bin 0 -> 2289 bytes assets/images/medical/vital_signs.png | Bin 0 -> 2103 bytes .../medical/medical_view_model.dart | 5 ++-- lib/pages/medical/medical_profile_page.dart | 27 +++++++++--------- .../medical/medical_profile_item.dart | 3 +- 16 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 assets/images/medical/active_medications.png create mode 100644 assets/images/medical/ask_doctor_icon.png create mode 100644 assets/images/medical/check-in.png rename assets/images/{new-design => medical}/eye_measurement_icon.png (100%) create mode 100644 assets/images/medical/insurance_update_icon_.png create mode 100644 assets/images/medical/medical_reports_icon.png create mode 100644 assets/images/medical/monthly_reports_icon.png create mode 100644 assets/images/medical/my_allergies_icon.png create mode 100644 assets/images/medical/my_tracker_icon.png create mode 100644 assets/images/medical/my_vaccines_icon.png create mode 100644 assets/images/medical/sick_leaves_icons.png create mode 100644 assets/images/medical/smartwatch_icon.png create mode 100644 assets/images/medical/vital_signs.png diff --git a/assets/images/medical/active_medications.png b/assets/images/medical/active_medications.png new file mode 100644 index 0000000000000000000000000000000000000000..67122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kaACvtt1LG~xXfu?@%b21pe~3;zs5QM^NzQscE3B7poab3RE3l;&Yn@EKxGd)V-vHDD z(*~kRKY#7%*-Fs;&?QMCmr0)XKp*6lgh~p&hoauQ@jXW~&;;(J2zCKqxP6Mo}$D;Po zI9u@s_TMb)Oqr*ejPag}4tv;o?&F z9}WRk_0pQ_@c$GX#sc^}18iAZ+i(@0 zs3!u90uPu935W8ty+)S%2#Wja*hZH(4uoo(VOfJy=x2)?*aK;SRVGKviaYNhf$k&po|avyoI$szvA z>Q3|s*-5w8wLI*F0lU3?v_K%bm&YQw6*Q2*Ui!&+dy$)T(Z;jXd#fT(65#rK*y@|S zJn>WTR9mrQR{)p~Ou+AFH26$iURCRTR^w5xg?eF5-)=pdz_LnuGY(HR#Br_1n!18V zC3FmVT|B>yF=hZBgWTtSTUoz^ewhhxGXVhmA}YsON;kpgBEk~$PWKRoJc$?XB_1l1 z+T27QSn?ja3h#an2D^jj4Cl3O+Zvm3uB6N0#>_6>8(<_|WD960vF0PAVOlW>`?LR8)hvG*orv1*MttH`)BU`bwq;`yDg+__%QdEO4& tg0>}URlIGYEr)A{&K8S(@G6d^_W+V7tPfy4Jfr{s002ovPDHLkV1mcAVu}C& literal 0 HcmV?d00001 diff --git a/assets/images/medical/ask_doctor_icon.png b/assets/images/medical/ask_doctor_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..bcb1f27960d4bc33f26847dbb19935618912465b GIT binary patch literal 3460 zcmV-~4SVv5P)( z3zSt=8OQ%K%m{5qX&@>JK9ICU(jrJq0aFfiQKcKx<%yF2IJbI&<~HVy zy*Fh_2ggb3C+U-tPLb4JQfo<7l7iZ(m$XaLHc9VFdR5Y2B)uYOdrEyeB+y3E1WC^@ zaG4aYwUQo^^f^gQ4)p=fhPIM!WCo`(@L|^yNn;NMX5=f5zAWhmNu2}!W<<=}l9ow& zlUe zqJ4mJysijdw3(ziUcVkIf_@bQ^Su}SQ4#gcc;L@_{rhGS^ea`2^Iq`L6o^+N*GEaZ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#m{bD^n69F-)>usVqkfy0wDO+#B?6MPS! z!z$PZsr2XK_5_s=L4u5s>-Lat1#qPw+s zf)?*GN3YhQl`spA1&Jc2%r=VFWsZ;o+8h5^mD8Qv>5$!BX^y`T?uCW02DDDJRkxz& zOPCL{;a1Q_Ar(c_JZP()W_=!{L((PFKyUjB8| zBZn7>c#7qcbIA2N)N8*{T98wgdb=4OhPkjCQc;9z>#D8na5xksilX7L4_ZJYUC|@M zuYr@`O^`eaGhq)jL$0C`wVh`zG*4MYI?!k|G7_@{EjT=2?klbf#&BoI)eZA#eZ85mKZRd6j8)zGZagHc%9nDZQ!eT6hbzrdj&c zZMY9Eg6zPR(`%!qQT^r!$##Txa)}xbO_rk2 z6QEOi?JlhkY1(3^BVTKRqG2$khTh4wrawiTc758O*UBgo9s(Ue^NOa;8F@1o&DUr& zgpj_SPU$o~4P?OfikzlfKl7nTq?scm9U<*iJe2bK8u+>d>9h^jW@t&$lrFN-t_5A^ z8f^mP%rT%dPgA9{Ii%Kj{YV&>Q2SYs?=>o-1Z08ekbs;aRiZ`2#F2}%mRU_6C)%rhj@G+qOU^r zOOh>#9t0B2=u zpH*qIx#*BKP1LRoy7O%kk10z}Bk5_TP-HTSly*)qc4~_;|9_8kSq1E{#BK}i-z@Gdt5`R@<2_y&lYip>WC3iW62WU?x2ogphvLH;<1L9mFQ#z z?w~(~oKe&cA^c)Ps5Q!2mjIZtMR@e;h gz$>7ib#jw`0VqW(eEQLBr2qf`07*qoM6N<$f{>Kj9smFU literal 0 HcmV?d00001 diff --git a/assets/images/new-design/eye_measurement_icon.png b/assets/images/medical/eye_measurement_icon.png similarity index 100% rename from assets/images/new-design/eye_measurement_icon.png rename to assets/images/medical/eye_measurement_icon.png diff --git a/assets/images/medical/insurance_update_icon_.png b/assets/images/medical/insurance_update_icon_.png new file mode 100644 index 0000000000000000000000000000000000000000..0001bcd226fc6910dc280494f2b858226a628c68 GIT binary patch literal 1362 zcmV-Y1+DstP)Px#IAvH#W=%~1DgX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bivCv*~{H}Bg=vxw?RyvZQ?_R&gE8nY#868XHq)$ literal 0 HcmV?d00001 diff --git a/assets/images/medical/my_allergies_icon.png b/assets/images/medical/my_allergies_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..689b5321d8048828d818d8ab9c0bc9509571ed0f GIT binary patch literal 2849 zcmV++3*PjJP)zE1*RSEz19vQW0xVS)|yil@y4In(AsvD$o+trlPGeih@Ae)Ywq1 zG*W*OTN_ARv=|Z4R!HNnQLz+?6p=+!Yr82(cegAn#mx4*o9W4!xik0P_ukeondH5D z=bkzD+?g}yXJ)D}I8X=RG5{9?7-5x{0GtJIn!iu5bXS_|N(k;k0Pg}Y2f#Z3%m8p{ zB#nOnH~`@H0QLcR96)c0_^l`!0JH$u&fapq;L-!2m2K4jKL~6lfGs5wmaB9Dcz|uc z<}eq)?lKC?RdxZGR|?@3t>dNwxEsI+1M8my@K*p&0XPKU?*L8$IK?sqz;F)r(Eug_ zn9O!AkKlg?fYoegP@xvU1^|5lz2I*EHUU@!;G!HaF%rN+eyEOsb`5Xq$?KrN+W;I+ zVfsbto#qnFd7$f&K z8q9ex3BXPdzq>j4loUp2Z4L&E5xOiwhgGphq$%|_x?*`?+FDK?U2TjgmEamYLOTjz zdL+HuBkZyEf@Z@j$ZOezH`Fsc_t7+n!2~Mk7-RN}1-;8C0DC>dwosktnh1WLu_t^> zp=EU1tpGj&;MdCiX8=?e^geau-8Eqpf|VYjW&Ju&3R+zZDG=~qgdvFgBwp&sF_ z%1eBfV@U1gSIdh32zozL=zL6RS99fz0Nw{+b_QN*scK|9y)^7Ip_W#*HW7@m4SCnVIrJQ_hPlnitcjm3797c3YG> zZ_2>ibcd<3A(qfIhr_$p#o}Yz1~O{=)aN_`J4anx&ZN>>g^%5756x5_>U1PP zs%Yc6!Z*gmxFmql2D)EuG*ixUV)$M`6HzQ084i>0N->o)OxQ1BTdh1skm~ zcvO_zBc5HOyvr6><$5K0+Qq=2#Oes8ek7-{oE4IfA4bq=WYpSzzS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c|H6x2JGuBC2O*LKioMr|l2 zadF^p0sNUuV!!6dt4cJ|7k)o3bCj#n@&Ku@g;oLJ5)?qXIfcYK&ol`wz}3Zb4H>(*+RuQBI9Gwp})fRg!I< zx-TfY=1bhms?D@nj>GV6yDaR42;WBEm=)!-xqo3@$_~W)BPNHA3}LIXl!q&?EHNA-Luww5F11c;+0*afp7Aamt2W;IMtIn1DB$7rM-pRv4P zBl$|YYO<|k5ncnx)3Qn(pOL_P72km^J4>+Ba4fS|i!$`=$&NL2_V6sZ&=Q0k5wx+w zrw2ANI5B9B2(qyV_VvOuu`FsZE8CJ?GKy#q=&qi$#L+3EPeF93pseN=&wJG3;RMALW3`M zkiFmtO@&VOnj}q_ER=p7cg!@gohcD3)qlwyj9JozWyL(l7WHzM-J$#G2ODNm?}T~* zMU-wPonDj2*-F$iLDK3mLi3bvCe&NXafluU!I9mwY0$**#bei8rx1 zv-sK+6Wla2rZG&-Z+j`dIg`oE%BI&=4gmfK6@jk@1uwf(00000NkvXXu0mjf3xr_4 literal 0 HcmV?d00001 diff --git a/assets/images/medical/my_tracker_icon.png b/assets/images/medical/my_tracker_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1d46b85950eff61eb7696a40b6df2f26bcbe086f GIT binary patch literal 1864 zcmV-O2e961p%67{Bq|1R!zCD$XyT3=5L_Y=6-AH$k{Dbf zs3ZnR#3dH^LrILd07?Z^K&n7n3Z+nU@Eg4yXXedY+V@QSlF4i5-aGf3bI(27odTk9 z5pW4G2sj$(2owR0NyeoD<8TPr18fD>0UzoLL>TEafk%K5KpWkw1$F@S5#!Q<37{D0 z1{|gF2Y`=&sX#@tXBwG1fNDML7vL31ya&)4Xw?jt38p)60q_#AP4n*q?gA1~q#sge zTdsM)30ahADmWgP4IC7o$HT^s7ugzMLXOD#ajSIQh~MdNJO%h&jd$mqYEw)QFC%}3 z*JApzSPhHwgs2~{i{HCIp|uSLs$?Bb$}6h>pg*t|*bSU*QXUC(29^Np^M$1k8-cfh z4#34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T;9$C6im0W1E57FZXf3dXis2u#uLW*mvC) z;v1F4(j>T)rWxsDlimnX;D-a|v0^#G+skqmrz6E>`L0J%RBTJo7Xbbb+gfe%c}Q4o P00000NkvXXu0mjfS3urD literal 0 HcmV?d00001 diff --git a/assets/images/medical/smartwatch_icon.png b/assets/images/medical/smartwatch_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c43fe468c64a0128c5378ab91664f1139c5a5f4c GIT binary patch literal 2289 zcmV zpb`@sil`_{upq^PvMjwwQJ00?{pON0=I-17%Dn&nf8Ue5{Mq;3+?hM&&bfEyZ61PQ zB7jii*8u1PU?+h2Y|U)pEC4sM ztf2swL|N`h0Cup~=44SRgVO<2vHbgOGw1s}m!Z&t=|4hOF+BbT@F#PhVJpQ?xz+$0 zG5vd%6w)}t=^!Yv&FrUKu}a6$bF}~}m~IQ8z$UYwa%L!0aqh)|EiAJYZ9rtob>i;< z0DEFm&P<0EoF;)0RJlEz+;PAtSLm1~X(=b;yB*WJIR4|nc2%a8QSnkv#`kGVZ;DAV zu;>0_x|7elb&&9Q))K(UOg8~=X^4u6DPQZjC!?XW1xIZR;3$Bm0J?;zLp{ji{aHkO z@(v}unCn(pS<-`J(pB!c2#NAtO0M+U!8GN`veY?<5^lrteE!N@n~+8$NlSmJ{;r_x zE|#v7C{+qzI<4l}0DcQwsTCCXX;=XnKo8Y>gM)}q)pN}`c|po^RgNfkj!GBVW){mh z6TmjEX>mKKUYC%HSJ?QzD5lBIWrb2*zi|GggiPuN06qe6319dIz-uI|aj_Dw`ijLJ z0bl^{{RH3wuBr7fRJF(=TBH91o>%pr=++YN(P#*N?5;dtkb-seVKUi3Ep36WTOlK2 zT>+E<=$C4wZKw9j9QQ|ZXjU^*oL3F&>Fl9dtov>N%~Cb;0lu(6-5Zd@M&wpi&&PRB zbU4MSSb`7X@DN7x_Yi=`0PKrtI2y?GmEa1De=gUS0I1$cRktKZSslb}1#RF(w8h_im>!2j$X6j^<-}Tz12BklMEth* zIX{lj8yF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UAOzc z?vCE{fOFB12(bv{WP35}{+xRSjQOw5@;BlJ4H%?t#?udCA=6%eTarGBpeG`$sy!O1 z1Fth|a(i{}5%slWk1Q(VL|1jhcWdx$-pUL$o;BDHtx9vZ@ z@Ka6;wE7q}A~aDWrrcJfpK^QEQNK8Pu1L-GEk5togI{dq5ET^f_hLG=$Fs;(`mpzq zss9ZzD@Gn^u47?N(gulYNz_V$sd6?s+uTwVlT+tX2Z_=J2Y`P8T@9%^p~qt>00000 LNkvXXu0mjf8XZ#M literal 0 HcmV?d00001 diff --git a/assets/images/medical/vital_signs.png b/assets/images/medical/vital_signs.png new file mode 100644 index 0000000000000000000000000000000000000000..7b642d6e73904974e2923e765ea920985bd0642e GIT binary patch literal 2103 zcmV-72*~$|P) z4~P{-9LK+2YTb4DFDoxFB=ZkRdKIQfnPpU_Wtl{ll15S*MPNb{mIMX{7Ezl0K`RRk zvQqO;1}PMoN>FB2_6MW7B0bHtJ3aM`vG2mXpR;@W-mY(V=FJC|ySF>@c4oitH#>iR zGt&-cIszC6U<`mk0J;OH4hd^J#{g^va3_G@L|)DZumr$>9ObbYz-|Cv0r&vGy8v3^ zM4Skqff=r(W1itz%(o!_4b-fFD(yoD0E_qwtxM&%Wf#92Qv0U`IjEy%i>Tpo^rCo) zLHSkyn*i*LYwi{j6vgumc{~-sgE=dT)oZdBfFZ>kEVq@S2-F!6;IYPq&hM~$Rz zQ-k!^0%#N$Cs+DYvxq4|yGCk?>EeQ^65+`=^Mr;@ia901V8i)bBPs9m6=(zKu$ zUS8=>$YPf3#j&bYb<^_lU8O%Ai_x{~CacTMmHu=rra(I>tj7_&u#VC`#cZkWtV;p( z2)X_ZfFDAxbpZ zE?IVx7mE!OHDCe%meX?EbC~fQPJU`Afc^`)y zHVWM8mse)=Q&3)Rna)?_)3%yD^*O}?O))sNIe8)zKx=ZtDUnt_8%y+Iy z)PPP*?~s#p@6<`+8Z#nAmy)kTyfE6)LS^{0#Z{tyEbh@lU#(K}RG)Ghqe$H~CJl5; zl_a%XCD_ZH@u0?hhlhlbma3cu#?#4eb7oH_0a;t@))@X$DA96FR@lTJQB;@~(K*tY z?^bIpHtovOGQ&C!VWe zQ8($$@682iTI`52WGIg1nygSBO)O%gEVWo}_V3uzY3rRE_P(3|V7+!uS?*vFMp~-1 z*gCosC9d+sHx;c*Sxm0Si8v)HEFZQD6Su$izZ9&=AnrleL`4oqcZwyfLWKw`Y-0D| zIL<&=17Jt~vX%_ng@q<=t0rvV9`EzyC|+1c@xnTa7uHd{u#Vz|brdhGqj+H*C8@A-t%-gW{yb&=k7SgN#63^j znfTy))ByOS?Bc65l#%q*^87D=AG3M}Nrl}@N3o#uU3oX0mqNN+;CT)SW&u;g>@7! ztfQpuK{1lPMi+5fgxVW!1NU9~H6+eJde{%;HY0oJ$o&R@FH=fa6_-7@m5W!Z4TpXK z@DbO$*pt$Iaz&Dv00C!nieZ@7y=u=rBKFc#tA)PQhPVE!DQs`rhrY&P_xRhio1=xy z7WqmnY|-9Z@D336tUX`3MKyNwncP;J=wccmBhf1VccFAoW~IHCxg5fW#b2sfq3 zw7sLnZQ-`ul6GQNUQ3pXMNeXGS?7ZL6* zk)BJ6yiZ;jrI$`gn>(jz|L=|n7j^BQkn_zfrfc}QHbL4NBf`mRNo(O*v4*d(3sn;? zX$OVAs8v1Nt|qRC_>N&A=j%055z!8gleS?IZFc$kFzwZD3u;@KIYAzh6vcA4;l-k@ z3JyLuh?=P$XN$oamDPMI!VN}oJQ*Wz^&Ain!ep}J#>payu(gI=u2j48HcmdCY1l#Q z1%w3?x89~>Ys5tvVwoNOBIWa`t z6mvK^e1Hz zlZAGTdWX+cLyd8v*c;Z9FY2g~)J get appoitmentAllHistoryResultList => _medicalService.appoitmentAllHistoryResultList; - getAppointmentHistory() async{ + getAppointmentHistory() async { setState(ViewState.Busy); - await _medicalService.getAppointmentHistory(); + if (_medicalService.appoitmentAllHistoryResultList.length == 0) + await _medicalService.getAppointmentHistory(); if (_medicalService.hasError) { error = _medicalService.error; setState(ViewState.Error); diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index cec19e8b..e0acb192 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -180,7 +180,7 @@ class _MedicalProfilePageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context) .vitalSigns, - imagePath: 'medical_history_icon.png', + imagePath: 'vital_signs.png', subTitle: TranslationBase.of(context) .vitalSignsSubtitle, ), @@ -194,7 +194,7 @@ class _MedicalProfilePageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context) .myMedical, - imagePath: 'radiology_icon.png', + imagePath: 'active_medications.png', subTitle: TranslationBase.of(context) .myMedicalSubtitle, ), @@ -235,8 +235,7 @@ class _MedicalProfilePageState extends State { }, child: MedicalProfileItem( title: TranslationBase.of(context).eye, - imagePath: - 'insurance_approvals_icon.png', + imagePath: 'eye_measurement_icon.png', subTitle: TranslationBase.of(context) .eyeSubtitle, ), @@ -271,7 +270,7 @@ class _MedicalProfilePageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context) .updateInsurance, - imagePath: 'insurance_card_icon.png', + imagePath: 'insurance_update_icon_.png', subTitle: TranslationBase.of(context) .updateInsuranceSubtitle, ), @@ -299,7 +298,7 @@ class _MedicalProfilePageState extends State { onTap:()=> Navigator.push(context, FadePage(page: AllergiesPage())) , child: MedicalProfileItem( title: TranslationBase.of(context).allergies, - imagePath: 'medical_history_icon.png', + imagePath: 'my_allergies_icon.png', subTitle: TranslationBase.of(context) .allergiesSubtitle, ), @@ -317,7 +316,7 @@ class _MedicalProfilePageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context) .myVaccines, - imagePath: 'insurance_card_icon.png', + imagePath: 'my_vaccines_icon.png', subTitle: TranslationBase.of(context) .myVaccinesSubtitle, ), @@ -333,7 +332,7 @@ class _MedicalProfilePageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context).medical, - imagePath: 'insurance_approvals_icon.png', + imagePath: 'medical_reports_icon.png', subTitle: TranslationBase.of(context) .medicalSubtitle, ), @@ -349,7 +348,7 @@ class _MedicalProfilePageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context).monthly, - imagePath: 'medical_history_icon.png', + imagePath: 'monthly_reports_icon.png', subTitle: TranslationBase.of(context) .monthlySubtitle, ), @@ -368,7 +367,7 @@ class _MedicalProfilePageState extends State { }, child: MedicalProfileItem( title: TranslationBase.of(context).sick, - imagePath: 'insurance_card_icon.png', + imagePath: 'sick_leaves_icons.png', subTitle: TranslationBase.of(context) .sickSubtitle, ), @@ -384,7 +383,7 @@ class _MedicalProfilePageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context).myBalance, - imagePath: 'insurance_approvals_icon.png', + imagePath: 'check-in.png', subTitle: TranslationBase.of(context) .myBalanceSubtitle, ), @@ -413,7 +412,7 @@ class _MedicalProfilePageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context) .smartWatches, - imagePath: 'insurance_card_icon.png', + imagePath: 'smartwatch_icon.png', subTitle: TranslationBase.of(context) .smartWatchesSubtitle, ), @@ -429,7 +428,7 @@ class _MedicalProfilePageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context) .myTrackers, - imagePath: 'insurance_approvals_icon.png', + imagePath: 'my_tracker_icon.png', subTitle: TranslationBase.of(context) .myTrackersSubtitle, ), @@ -444,7 +443,7 @@ class _MedicalProfilePageState extends State { }, child: MedicalProfileItem( title: TranslationBase.of(context).askYour, - imagePath: 'medical_history_icon.png', + imagePath: 'ask_doctor_icon.png', subTitle: TranslationBase.of(context) .askYourSubtitle, ), diff --git a/lib/widgets/data_display/medical/medical_profile_item.dart b/lib/widgets/data_display/medical/medical_profile_item.dart index e2baa1e4..be6ffba2 100644 --- a/lib/widgets/data_display/medical/medical_profile_item.dart +++ b/lib/widgets/data_display/medical/medical_profile_item.dart @@ -42,7 +42,8 @@ class MedicalProfileItem extends StatelessWidget { alignment: Alignment.bottomRight, child: Image.asset( "assets/images/medical/$imagePath", - height: SizeConfig.heightMultiplier * 7, + height: SizeConfig.heightMultiplier * 5, + width: SizeConfig.heightMultiplier * 5, ), ) ], From 37d9eae9eaa19c6484f664d8964fa60bb3db5e04 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 30 Sep 2020 09:02:51 +0300 Subject: [PATCH 24/33] 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 25/33] 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 bae6fe4ad62dbe735487b35318e3d014bdedb59d Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 30 Sep 2020 09:15:09 +0300 Subject: [PATCH 26/33] fix marge issues --- lib/config/config.dart | 2 +- lib/config/localized_values.dart | 38 ------------------- .../LiveChat/hospitalsLivechat_page.dart | 2 +- 3 files changed, 2 insertions(+), 40 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index e83d4292..961a386d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; const MAX_SMALL_SCREEN = 660; -const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index eb0ec2e6..40840423 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -534,44 +534,6 @@ const Map> localizedValues = { "en": "Please enter the verification code send to", "ar": "الرجاء إدخال رمز التحقق المرسل إلى" }, - "km":{"en":"KMs:","ar":"كم"}, - "PatientHealthSummaryReport":{"en":"Patient Health Summary Report","ar":" ملخص التقارير الشهرية"}, - "ToViewTheTermsAndConditions":{"en":"To View The Terms And Conditions Report","ar":" عرض الشروط والأحكام "}, - "ClickHere":{"en":"Click here","ar":"أنقر هنا"}, - "IAgreeToTheTermsAndConditions":{"en":"I agree to the terms and conditions ","ar":"أوافق على الشروط والاحكام "}, - "IAgreeToTheTermsAndConditionsSubtitle":{"en":"I agree to the terms and conditions ","ar":"هذا ملخص التقرير الصحي الشهري و الذي يسرد المؤشرات الصحية و نتائج التحاليل لأخر الزيارات. يرجى ملاحظة أن هذا التقرير هو تقرير يتم ارساله بشكل آلي من النظام و لا يعتبر رسمي و لا تؤخذ عليه أي قرارات طبية"}, - "Save":{"en":"Save","ar":"حفظ "}, - "UserAgreement":{"en":"User Agreement","ar":"اتفاقية الخصوصية "}, - "UpdateSuccessfully":{"en":"Update Successfully","ar":"تم التحديث بنجاح"}, - "CHECK_VACCINE_AVAILABILITY":{"en":"CHECK VACCINE AVAILABILITY","ar":"تحقق من توافر اللقاح"}, - "MyVaccinesAvailability":{"en":"MyVaccinesAvailability","ar":"توفر لقاحي"}, - "PaymentService":{"en":"Payment Service","ar":"خدمة المدفوعات"}, - "PaymentOnline":{"en":"Service","ar":"الالكتروني"}, - "OnlineCheckIn":{"en":"Online Check-In","ar":"مدفوعات معلقة"}, - "MyBalances":{"en":"My Balances","ar":"رصيدي"}, - "BalanceAmount":{"en":"Balance Amount","ar":"رصيدالحساب"}, - "TotalBalance":{"en":"Total Balance","ar":"الرصيد الكلي"}, - "CreateAdvancedPayment":{"en":"Create Advanced Payment","ar":"إنشاء دفعة مقدمة"}, - "AdvancePayment":{"en":"Advance Payment","ar":"الدفع مقدما"}, - "AdvancePaymentLabel":{ - "en":"You can create and add an Advanced Payment for you account or other accounts.", - "ar":"يمكنك تحويل مبلغ لحسابك لدى المجموعة أو لحساب احد المراجعين"}, - "FileNumber":{"en":"File Number","ar":"رقم الملف"}, - "Amount":{"en":"Amount *","ar":"المبلغ *"}, - "DepositorEmail":{"en":"Depositor Email *","ar":"البريد الإلكتروني للمودع *"}, - "Notes":{"en":"Notes","ar":"ملاحظات"}, - "SelectPatientName":{"en":"Select Patient Name","ar":"اختر اسم المريض"}, - "SelectFamilyPatientName":{"en":"Family Members","ar":"أفراد الأسرة"}, - "SelectHospital":{"en":"Select Hospital","ar":"اختر المستشفى"}, - "MyAccount":{"en":"My Account","ar":"حسابي"}, - "OtherAccount":{"en":"Other Account","ar":"حساب آخر"}, - "SelectBeneficiary":{"en":"Select Beneficiary","ar":"حدد المستفيد"}, - "ConfirmThePayment":{"en":"Confirm The Payment","ar":"تأكيد عملية الدفع"}, - "DepositorName":{"en":"Depositor Name","ar":"اسم المودع *"}, - "MobileNumber":{"en":"Mobile Number","ar":"رقم الجوال"}, - "Ok":{"en":"Ok","ar":"حسنا"}, - "TheVerificationCodeExpiresIn":{"en":"The Verification Code Expires In","ar":"تنتهي صلاحية رمز التحقق في"}, - "PleaseEnterTheVerificationCode":{"en":"Please enter the verification code send to","ar":"الرجاء إدخال رمز التحقق المرسل إلى"}, "EyeMeasurements":{"en":"Eye Measurements","ar":"قياسات النظر"}, "Measurements":{"en":"Measurements","ar":"قياسات"}, "Classes":{"en":"Classes","ar":"نظارات"}, diff --git a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart index 206a95c4..65e2d7b2 100644 --- a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart @@ -139,7 +139,7 @@ class _HospitalsLiveChatPageState extends State { IconButton( icon: Icon( Icons - .arrow_forward_rounded, + .arrow_forward, color: tappedIndex == index ? Colors.white From 5e50c0dc32ecd00652510633de187cfdc1a18d3c Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Wed, 30 Sep 2020 14:54:32 +0300 Subject: [PATCH 27/33] 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$^>dBiA#O3rZ$xsW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vEI8%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 28/33] 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 29/33] 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 30/33] 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 31/33] 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 32/33] 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 33/33] 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, ), ), );