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 +