Merge branch 'dev_v3.13.6' into dev_v3.13.6_CR_7211_Lab_report_changes
# Conflicts: # lib/config/config.dart # lib/config/localized_values.dart # lib/uitl/translations_delegate_base.dart # lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart # pubspec.yamlmerge-update-with-lab-changes
commit
dbfe9663a5
Binary file not shown.
@ -0,0 +1,15 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIICajCCAVICAQAwJTEjMCEGCSqGSIb3DQEJARYUSGFyb29uNjEzOEBnbWFpbC5j
|
||||
b20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4E8y9zluekbsXX6+i
|
||||
HLa0GrZE+r8rJsmcNyhiONDkpCTQuuidRb4PH+DWPpxwtndKpgzPemCXavaAPY8I
|
||||
vSf5/aLTzClLvuX4OqNsb9Y8v8jlt7uYud6hPYK+VKZmIyynqeHldur0+RQScVY7
|
||||
Z4MbgxWYAXd0K49o1Vj8KcYP1G37XIaUwOf+Ib3az4abnrsou7w9PSHnKREPU1A8
|
||||
syBR56/Zcm3I9e+4nLyk2kjhkp6zR8KKW3s0teqHkW+V2nqd6eU+ZwOOmP3FVuwl
|
||||
X+kfVabTc42Nb7toDaIvxEI+LlrNCUTCptE5uvY+vId0bwjcL88Ti9zshPETgLd8
|
||||
F7mHAgMBAAGgADANBgkqhkiG9w0BAQsFAAOCAQEAMTsBtXA79BL7aJoe87iHwCaR
|
||||
lyOoeG5vUVJhQxhkb7pXD6TT00H3DEn43MCD+Nu9KNq3ZAARTsbnoB1MzYQ+Qs0w
|
||||
uIx3K+sKKqzo3tKY78cjpKYW68qSY8QHPH8z0PJ/a18Mz1VGjhV9sanRc57fkf8Y
|
||||
SfzG+jKB+y9AeC4R5PAVkv/EScZKVyb8+hFNZRMBOfnME7QRWm51MlnzfgavB/Sr
|
||||
SSb9KrKzA65UKM9fv0JhNftiFVwsMDA42RuwSE7rVqzoejb47sFNnEBprt4Jel+5
|
||||
FJt/C//NKspMlW2cdRbPek7adaBuZCvEO+b0TDnvMQXnJTO5K0LCzGb5MRuGUg==
|
||||
-----END CERTIFICATE REQUEST-----
|
||||
@ -0,0 +1,8 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIH6MIGfAgEAMD0xIzAhBgkqhkiG9w0BCQEWFEhhcm9vbjYxMzhAZ21haWwuY29t
|
||||
MQkwBwYDVQQDDAAxCzAJBgNVBAYTAkFFMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcD
|
||||
QgAEiHGgNfm6LyD0k41YUNxGibQT5t2T9+QTVb6v5YrfCYslJIurcpeia8pzl/HJ
|
||||
p1f4qxCR04cEYE3tcunyzkJd26AAMAwGCCqGSM49BAMCBQADSAAwRQIhAJWZqbmD
|
||||
e9jyqPHW578V6xsf5Axgf64GBBFMpZ8+ZukDAiAYu0BbgeiU4RwCrezA71iH95yZ
|
||||
ge9MoPuNHejpDKGeQQ==
|
||||
-----END CERTIFICATE REQUEST-----
|
||||
@ -0,0 +1,8 @@
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf2758
|
||||
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
{\*\expandedcolortbl;;}
|
||||
\paperw11900\paperh16840\margl1440\margr1440\vieww11520\viewh8400\viewkind0
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
|
||||
\f0\fs24 \cf0 HMG@54321}
|
||||
@ -0,0 +1,74 @@
|
||||
MIIQaQYJKoZIhvcNAQcCoIIQWjCCEFYCAQExCzAJBgUrDgMCGgUAMHgGCSqGSIb3DQEHAaBrBGl7
|
||||
InRlYW1JZCI6IjNBMzU5RTg2WkYiLCJkb21haW4iOiJ1YXQuaG1nd2Vic2VydmljZXMuY29tIiwi
|
||||
ZGF0ZUNyZWF0ZWQiOiIyMDI1LTA0LTA5LDA4OjUzOjAzIiwidmVyc2lvbiI6MX2ggg0_MIIENDCC
|
||||
AxygAwIBAgIIPVn4N-rR2J8wDQYJKoZIhvcNAQELBQAwczEtMCsGA1UEAwwkQXBwbGUgaVBob25l
|
||||
IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MSAwHgYDVQQLDBdDZXJ0aWZpY2F0aW9uIEF1dGhvcml0
|
||||
eTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMwHhcNMjQxMjE2MTkyMTAxWhcNMjkx
|
||||
MjExMTgxMzU5WjBZMTUwMwYDVQQDDCxBcHBsZSBpUGhvbmUgT1MgUHJvdmlzaW9uaW5nIFByb2Zp
|
||||
bGUgU2lnbmluZzETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMwggEiMA0GCSqGSIb3
|
||||
DQEBAQUAA4IBDwAwggEKAoIBAQDQkzGr-FMe360eL2T3yU3Xlr5fSz15ZFxD7inDQNL6LxygtrwR
|
||||
c-_wIrDf3vn5zlXj9UIBtSNlQRI793xGfYkTRZVE7JaVYmaXkAMA2eCuxdmxnCAtluCF7W9r01LT
|
||||
gzzUASMl6eXG1BHYeaoIwt0VWPXvipNLDUvuDbaHk3UREFXLDHgH2zdwRjuX-sTreCng9Ox442Ha
|
||||
QFeAB7uInKXHSW3IJtOVH00hoo1oc4Me5llahZZVVLCVLiXcdw1hh4GNiaQDezwAdyyJalnTZETZ
|
||||
dKVbirFSYV9uBDDU8-IQNAyVjEvhe9YrhYPyJzmNcAgj4hSI_5P0LW1MJuKLN4YtAgMBAAGjgeUw
|
||||
geIwDAYDVR0TAQH_BAIwADAfBgNVHSMEGDAWgBRv8ZUYYlzgyPHF7WwYyeDTZFKYIDBABggrBgEF
|
||||
BQcBAQQ0MDIwMAYIKwYBBQUHMAGGJGh0dHA6Ly9vY3NwLmFwcGxlLmNvbS9vY3NwMDMtYWlwY2Ew
|
||||
NzAvBgNVHR8EKDAmMCSgIqAghh5odHRwOi8vY3JsLmFwcGxlLmNvbS9haXBjYS5jcmwwHQYDVR0O
|
||||
BBYEFLy1xem9_MvQntyUsB74IZRc_wkuMA4GA1UdDwEB_wQEAwIHgDAPBgkqhkiG92NkBjoEAgUA
|
||||
MA0GCSqGSIb3DQEBCwUAA4IBAQAyNMLpd6pf4MbKovN3WeeKZ7jxUfP7sPaXv7ERo-GhPLsjkukS
|
||||
k6JxHbzxmnFvpDxvNpK24EeCopPj57iPu98lRGICz8289_uNiglweGXCGU0ly3JiIeSpaPkQmi56
|
||||
Dyi-pgMG0VVhH698-JTUcQ7i0yVUi86t1WgHW70te8diRXm5qYdM-Bg7gK4QS3HYeCvmCq-a59lN
|
||||
zOpbt6OXVWvsDaB4x8Cwz8vcEEwwkhNxlNav4OzJ6cmbziUy7hENIRcki_GVLiJiRkV_4NvXFlTB
|
||||
uT7T2oq5Zfa0tCN_eF3ZcnZkY6cIVcfZt5TbI7_zk6fUBERDDcriVrIrlCikPXKHMIIERDCCAyyg
|
||||
AwIBAgIIXGPK5Eo3U8kwDQYJKoZIhvcNAQELBQAwYjELMAkGA1UEBhMCVVMxEzARBgNVBAoTCkFw
|
||||
cGxlIEluYy4xJjAkBgNVBAsTHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRYwFAYDVQQD
|
||||
Ew1BcHBsZSBSb290IENBMB4XDTE3MDUxMDIxMjczMFoXDTMwMTIzMTAwMDAwMFowczEtMCsGA1UE
|
||||
AwwkQXBwbGUgaVBob25lIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MSAwHgYDVQQLDBdDZXJ0aWZp
|
||||
Y2F0aW9uIEF1dGhvcml0eTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMwggEiMA0G
|
||||
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDJRWoBDz6DBIbH_L_cXvAege4XMHNjJi7ePXokzZM-
|
||||
TzlHunW-88DS8Vmiqx_-CoY82S2aB_IOa7kpkRpfIgqL8XJYBa5MS0TFeaeAPLCI4IwMJ4RdGeWH
|
||||
GTbL48V2t7D0QXJR9AVcg0uibaZRuPEm33terWUMxrKYUYy7fRtMwU7ICMfS7WQLtN0bjU9AfRuP
|
||||
SJaSW_PQmH7ZvKQZDplhu0FdAcxbd3p9JNDc01P_w9zFlCy2Wk2OGCM5vdnGUj7R8vQliqEqh_3Y
|
||||
DEYpUf_tF2yJJWuHv4ppFJ93n8MVt2iziEW9hOYGAkFkD60qKLgVyeCsp4q6cgQ0sniM-LKFAgMB
|
||||
AAGjgewwgekwDwYDVR0TAQH_BAUwAwEB_zAfBgNVHSMEGDAWgBQr0GlHlHYJ_vRrjS5ApvdHTX8I
|
||||
XjBEBggrBgEFBQcBAQQ4MDYwNAYIKwYBBQUHMAGGKGh0dHA6Ly9vY3NwLmFwcGxlLmNvbS9vY3Nw
|
||||
MDMtYXBwbGVyb290Y2EwLgYDVR0fBCcwJTAjoCGgH4YdaHR0cDovL2NybC5hcHBsZS5jb20vcm9v
|
||||
dC5jcmwwHQYDVR0OBBYEFG_xlRhiXODI8cXtbBjJ4NNkUpggMA4GA1UdDwEB_wQEAwIBBjAQBgoq
|
||||
hkiG92NkBgISBAIFADANBgkqhkiG9w0BAQsFAAOCAQEAOs-smI2-kiAhCa2V87FcIfo2LVcgRHRz
|
||||
ZJIIs5as922X-ls0OCfPEkbTPBHwB8mZkLHR6BEJpeOla2xjCD-eJfrVmZxM5uXOjrJNaOyLq6Oi
|
||||
T4oRFT7cFCscxkS2b2fFW0-VKS2HXD_cgx53T-3aVKct5xOBwWPEVAsbSwpqKCII1DeSfH9nKF-v
|
||||
PT-3rFkdODRkWu4zShlCRCnEyhhr4cFTLS30TcIV9jMyGHjxJm-KTeuUTKPo_w-zA4tl2usu2GVQ
|
||||
n9yfit8xqIRU3FJSQdKyEx0xRkeIXz7uw_KMIwSV66yKPoJsBp8u44tDmmJbNA30mc8s7rpyhhkj
|
||||
pfyOtTCCBLswggOjoAMCAQICAQIwDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UEBhMCVVMxEzARBgNV
|
||||
BAoTCkFwcGxlIEluYy4xJjAkBgNVBAsTHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRYw
|
||||
FAYDVQQDEw1BcHBsZSBSb290IENBMB4XDTA2MDQyNTIxNDAzNloXDTM1MDIwOTIxNDAzNlowYjEL
|
||||
MAkGA1UEBhMCVVMxEzARBgNVBAoTCkFwcGxlIEluYy4xJjAkBgNVBAsTHUFwcGxlIENlcnRpZmlj
|
||||
YXRpb24gQXV0aG9yaXR5MRYwFAYDVQQDEw1BcHBsZSBSb290IENBMIIBIjANBgkqhkiG9w0BAQEF
|
||||
AAOCAQ8AMIIBCgKCAQEA5JGpCR-R2x5HUOsF7V55hC3rNqJXTFXsixmJ3vlLbPUHqyIwAugYPvhQ
|
||||
CdN_QaiY-dHKZpwkaxHQo7vkGyrDH5WeegykR4tb1BY3M8vED03OFGnRyRly9V0O1X9fm_IlA7pV
|
||||
j01dDfFkNSMVSxVZHbOU9_acns9QusFYUGePCLQg98usLCBvcLY_ATCMt0PPD5098ytJKBrI_s61
|
||||
uQ7ZXhzWyz21Oq30Dw4AkguxIRYudNU8DdtiFqujcZJHU1XBry9Bs_j743DN5qNMRX4fTGtQlkGJ
|
||||
xHRiCxCDQYczioGxMFjsWgQyjGizjx3eZXP_Z15lvEnYdp8zFGWhd5TJLQIDAQABo4IBejCCAXYw
|
||||
DgYDVR0PAQH_BAQDAgEGMA8GA1UdEwEB_wQFMAMBAf8wHQYDVR0OBBYEFCvQaUeUdgn-9GuNLkCm
|
||||
90dNfwheMB8GA1UdIwQYMBaAFCvQaUeUdgn-9GuNLkCm90dNfwheMIIBEQYDVR0gBIIBCDCCAQQw
|
||||
ggEABgkqhkiG92NkBQEwgfIwKgYIKwYBBQUHAgEWHmh0dHBzOi8vd3d3LmFwcGxlLmNvbS9hcHBs
|
||||
ZWNhLzCBwwYIKwYBBQUHAgIwgbYagbNSZWxpYW5jZSBvbiB0aGlzIGNlcnRpZmljYXRlIGJ5IGFu
|
||||
eSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFy
|
||||
ZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRlIHBvbGljeSBhbmQgY2Vy
|
||||
dGlmaWNhdGlvbiBwcmFjdGljZSBzdGF0ZW1lbnRzLjANBgkqhkiG9w0BAQUFAAOCAQEAXDaZTC14
|
||||
t-2Mm9zzd5vydtJ3ME_BH4WDhRuZPUc38qmbQI4s1LGQEti-9HOb7tJkD8t5TzTYoj75eP9ryAfs
|
||||
fTmDi1Mg0zjEsb-aTwpr_yv8WacFCXwXQFYRHnTTt4sjO0ej1W8k4uvRt3DfD0XhJ8rxbXjt57UX
|
||||
F6jcfiI1yiXV2Q_Wa9SiJCMR96Gsj3OBYMYbWwkvkrL4REjwYDieFfU9JmcgijNq9w2Cz97roy_5
|
||||
U2pbZMBjM3f3OgcsVuvaDyEO2rpzGU-12TZ_wYdV2aeZuTJC-9jVcZ5-oVK3G72TQiQSKscPHbZN
|
||||
nF5jyEuAF1CqitXa5PzQCQc3sHV1ITGCAoUwggKBAgEBMH8wczEtMCsGA1UEAwwkQXBwbGUgaVBo
|
||||
b25lIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MSAwHgYDVQQLDBdDZXJ0aWZpY2F0aW9uIEF1dGhv
|
||||
cml0eTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMCCD1Z-Dfq0difMAkGBSsOAwIa
|
||||
BQCggdwwGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMjUwNDA5MDg1
|
||||
MzAzWjAjBgkqhkiG9w0BCQQxFgQUAFaGI1aIk0pvFl6XU5VvRpeio9QwKQYJKoZIhvcNAQk0MRww
|
||||
GjAJBgUrDgMCGgUAoQ0GCSqGSIb3DQEBAQUAMFIGCSqGSIb3DQEJDzFFMEMwCgYIKoZIhvcNAwcw
|
||||
DgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIHMA0GCCqGSIb3DQMCAgEoMA0G
|
||||
CSqGSIb3DQEBAQUABIIBAHdhBvowTL1e7Q-KFo3GAoa_c3I5iQH79ks6sZ9U4zu3xhpjrReRlA5d
|
||||
ORAcMvUnUT0sjDj2ISsLKzUnDXNlcPE8fqfkMI_7LYlWvnNalVtrJmL6CUheBuTKMQ_Z_lZLLI4o
|
||||
J46YUzCU9M4vpcgO6EpOQTNrqLx2sOs-V_my1p-Hig7UqdHNviX4gL4xjg7yUXNoevZ9ixPLXI4C
|
||||
aPmg5q2NCECPxS7g36hJ_gHtRC6awR8qvK3-mSZPPfMzh0sHih76h2RWcv13UHSNygn3SF0MLhsS
|
||||
5m9tf6r1sJOCAr2_ri-65d2GN1vhGXfoXQ0KFy9N2Cao3IsRs5unBb6pk5c
|
||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
<svg data-name="Group 8404" height="26" id="Group_8404" viewBox="0 0 26 26"
|
||||
width="26" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect data-name="Rectangle 17531" fill="#69a6e2" height="26" id="Rectangle_17531" rx="4"
|
||||
width="26" />
|
||||
<path d="M2.914,17.807s.731-.005,1.246-.005l3.9.019c.466,0,.854-.488.876-1.193l0-3.213c0-.685.311-1.221.793-1.252l1.2-.009c.483.029.814.572.814,1.253l0,3.231c.021.7.346,1.165.814,1.165l5.254.014.01-3.971c0-.683-.333-1.214-.82-1.245l-2.11-.01c-.467,0-.834-.486-.854-1.191l-.008-1.074c.023-.7.392-1.189.86-1.189l2.122.006c.482-.031.8-.592.8-1.274l.005-4.957a2.126,2.126,0,0,1-.693.69,2.164,2.164,0,0,1-.933.312l-3.569,0c-.465,0-.854.5-.876,1.2V8.295c-.022.7-.387,1.2-.854,1.2l-1.08-.008c-.468,0-.842-.482-.864-1.183l0-3.218c-.021-.705-.392-1.178-.859-1.178l-5.179,0V7.87c0,.684.324,1.231.808,1.263l2.122-.009c.48.031.82.595.82,1.275l-.007.916c0,.683-.328,1.23-.81,1.261l-2.126-.005c-.484.034-.808.572-.808,1.256Z" data-name="Path 5276"
|
||||
fill="#fff"
|
||||
id="Path_5276" transform="translate(2.327 2.327)" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@ -0,0 +1,8 @@
|
||||
<svg data-name="Group 8404" height="26" id="Group_8404" viewBox="0 0 26 26"
|
||||
width="26" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect data-name="Rectangle 17531" fill="#cc2229" height="26" id="Rectangle_17531" rx="4"
|
||||
width="26" />
|
||||
<path d="M2.914,17.807s.731-.005,1.246-.005l3.9.019c.466,0,.854-.488.876-1.193l0-3.213c0-.685.311-1.221.793-1.252l1.2-.009c.483.029.814.572.814,1.253l0,3.231c.021.7.346,1.165.814,1.165l5.254.014.01-3.971c0-.683-.333-1.214-.82-1.245l-2.11-.01c-.467,0-.834-.486-.854-1.191l-.008-1.074c.023-.7.392-1.189.86-1.189l2.122.006c.482-.031.8-.592.8-1.274l.005-4.957a2.126,2.126,0,0,1-.693.69,2.164,2.164,0,0,1-.933.312l-3.569,0c-.465,0-.854.5-.876,1.2V8.295c-.022.7-.387,1.2-.854,1.2l-1.08-.008c-.468,0-.842-.482-.864-1.183l0-3.218c-.021-.705-.392-1.178-.859-1.178l-5.179,0V7.87c0,.684.324,1.231.808,1.263l2.122-.009c.48.031.82.595.82,1.275l-.007.916c0,.683-.328,1.23-.81,1.261l-2.126-.005c-.484.034-.808.572-.808,1.256Z" data-name="Path 5276"
|
||||
fill="#fff"
|
||||
id="Path_5276" transform="translate(2.327 2.327)" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@ -0,0 +1,10 @@
|
||||
<svg height="11" viewBox="0 0 8.442 11" width="8.442" xmlns="http://www.w3.org/2000/svg">
|
||||
<g data-name="Group 8411" id="Group_8411" transform="translate(-3.75 -1.25)">
|
||||
<path d="M3.75,5.515A4.281,4.281,0,0,1,7.971,1.25a4.281,4.281,0,0,1,4.221,4.265c0,2.386-1.969,4-3.623,5.036l-.006,0-.006,0a1.175,1.175,0,0,1-1.173,0l-.007,0-.007,0C5.724,9.51,3.75,7.91,3.75,5.515Zm2.43-.044A1.791,1.791,0,1,1,7.971,7.262,1.791,1.791,0,0,1,6.18,5.471Z" data-name="Path 5277"
|
||||
fill="#2d343d"
|
||||
fill-rule="evenodd" id="Path_5277" />
|
||||
<path d="M6.021,19.214A.512.512,0,0,0,5,19.262a1.032,1.032,0,0,0,.436.8,2.707,2.707,0,0,0,.813.409,7.651,7.651,0,0,0,2.332.326,7.651,7.651,0,0,0,2.332-.326,2.708,2.708,0,0,0,.813-.409,1.032,1.032,0,0,0,.436-.8.512.512,0,0,0-1.021-.047.408.408,0,0,1-.048.044,1.727,1.727,0,0,1-.5.242,6.648,6.648,0,0,1-2.009.273A6.648,6.648,0,0,1,6.573,19.5a1.727,1.727,0,0,1-.5-.242A.407.407,0,0,1,6.021,19.214Z" data-name="Path 5278"
|
||||
fill="#2d343d"
|
||||
id="Path_5278" transform="translate(-0.61 -8.547)" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@ -1,26 +1,523 @@
|
||||
import 'package:diplomaticquarterapp/core/viewModels/TermsConditionsViewModel.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/theme/colors.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_html/flutter_html.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class UserAgreementPage extends StatefulWidget {
|
||||
@override
|
||||
State<UserAgreementPage> createState() => _UserAgreementPageState();
|
||||
}
|
||||
|
||||
class _UserAgreementPageState extends State<UserAgreementPage> {
|
||||
late ProjectViewModel projectViewModel;
|
||||
|
||||
bool acceptTerms = false;
|
||||
|
||||
class UserAgreementPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
projectViewModel = Provider.of(context);
|
||||
return BaseView<TermsConditionsViewModel>(
|
||||
onModelReady: (model) => model.getUserTermsAndConditions(),
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
isShowAppBar: true,
|
||||
showNewAppBarTitle: true,
|
||||
showNewAppBar: true,
|
||||
isShowDecPage: false,
|
||||
appBarTitle: TranslationBase.of(context).userAgreement,
|
||||
body: SingleChildScrollView(
|
||||
child: Html(
|
||||
data: model.userAgreementContent,
|
||||
isShowAppBar: true,
|
||||
showNewAppBarTitle: true,
|
||||
showNewAppBar: true,
|
||||
isShowDecPage: false,
|
||||
appBarTitle: TranslationBase.of(context).termsConditions,
|
||||
body: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
TranslationBase.of(context).termsHeading,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions1,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions2,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions3,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions4,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions5,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsHeading2,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions6,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsHeading3,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions7,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions8,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions9,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions10,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions11,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions12,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions12a,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions12b,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions12c,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions13,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions14,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions14a,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions14b,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsHeading4,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions15,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions16,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions16a,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions16b,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions17,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions18,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions19,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions19a,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions19b,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsHeading5,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions20,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions21,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsHeading6,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions21,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions22,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions23,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions24,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsHeading7,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions25,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions25a,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions25b,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions25c,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions26,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions27,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions28,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions29,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions30,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions31,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions32,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsHeading8,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions33,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions33a,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions33b,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions34,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions34a,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions34b,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions34c,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions34d,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions34e,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions35,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions35a,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions35b,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions35c,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions35d,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions35e,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions36,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions37,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions38,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions39,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions39a,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions39b,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions39c,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions39d,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsHeading9,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions40,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions41,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsHeading10,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions42,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions43,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsHeading11,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions44,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsHeading12,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).termsConditions45,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(24.0),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Checkbox(
|
||||
value: acceptTerms,
|
||||
onChanged: (v) {
|
||||
setState(() => acceptTerms = v!);
|
||||
}),
|
||||
Expanded(
|
||||
child: Text(
|
||||
TranslationBase.of(context).termsConditionsRead,
|
||||
style: TextStyle(
|
||||
fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
mHeight(75.0),
|
||||
],
|
||||
),
|
||||
)),
|
||||
),
|
||||
),
|
||||
bottomSheet: Container(
|
||||
color: CustomColors.white,
|
||||
padding: EdgeInsets.fromLTRB(12.0, 1.0, 12.0, 25.0),
|
||||
child: DefaultButton(
|
||||
TranslationBase.of(context).acceptLbl.toUpperCase(),
|
||||
acceptTerms
|
||||
? () {
|
||||
Navigator.pop(context);
|
||||
}
|
||||
: null,
|
||||
color: CustomColors.green,
|
||||
disabledColor: CustomColors.grey2,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,380 @@
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
|
||||
import 'package:diplomaticquarterapp/theme/colors.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class SearchResultsByRegion extends StatelessWidget {
|
||||
List<DoctorList> doctorsList = [];
|
||||
RegionList patientDoctorAppointmentListHospital;
|
||||
bool isLiveCareAppointment;
|
||||
bool isObGyneAppointment;
|
||||
bool isDoctorNameSearch;
|
||||
OBGyneProcedureListResponse? obGyneProcedureListResponse;
|
||||
bool isDoctorSearchResult;
|
||||
|
||||
SearchResultsByRegion(
|
||||
{required this.doctorsList,
|
||||
required this.patientDoctorAppointmentListHospital,
|
||||
this.isObGyneAppointment = false,
|
||||
this.isDoctorNameSearch = false,
|
||||
required this.isLiveCareAppointment,
|
||||
required this.isDoctorSearchResult,
|
||||
this.obGyneProcedureListResponse});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).bookAppo,
|
||||
isShowDecPage: false,
|
||||
isShowAppBar: true,
|
||||
showNewAppBarTitle: true,
|
||||
showNewAppBar: true,
|
||||
backgroundColor: CustomColors.appBackgroudGrey2Color,
|
||||
body: patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap?.isNotEmpty ==
|
||||
true
|
||||
? ListView.separated(
|
||||
addAutomaticKeepAlives: true,
|
||||
physics: BouncingScrollPhysics(),
|
||||
separatorBuilder: (context, index) {
|
||||
return Material(
|
||||
color: Color(0xFFf5f5f5),
|
||||
child: SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
);
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
String key = patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap?.keys
|
||||
.toList()[index] ??
|
||||
'';
|
||||
|
||||
return AppExpandableNotifier(
|
||||
paddingValue: 10,
|
||||
applyBackgroundToOnlyHeader: true,
|
||||
completeHeaderColor: CustomColors.appBackgroudGrey2Color,
|
||||
headerWidget: RegionTitle(
|
||||
title: key,
|
||||
hmcCount:
|
||||
"${patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmcSize ?? 0}",
|
||||
hmgCount:
|
||||
"${patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmgSize ?? 0}",
|
||||
),
|
||||
showDropDownIconWithCustomHeader: true,
|
||||
isTitleSingleLine: false,
|
||||
isDoctorSearchResult: isDoctorSearchResult,
|
||||
widgetColor: Color(0xFFF8F8F8),
|
||||
bodyWidget: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: AppExpandableNotifier(
|
||||
paddingValue: 8,
|
||||
applyBackgroundColor: false,
|
||||
applyBackgroundToOnlyHeader: true,
|
||||
completeHeaderColor: Colors.white,
|
||||
headerRadius: BorderRadius.circular(16),
|
||||
headerWidget: HospitalTitle(
|
||||
iconUrl: 'assets/images/svg/HMG.svg',
|
||||
title: TranslationBase.of(context).hmgHospital,
|
||||
isHMC: false,
|
||||
itemCount:
|
||||
"${patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmgSize ?? 0}",
|
||||
),
|
||||
showDropDownIconWithCustomHeader: true,
|
||||
bodyWidget: HospitalBodyWidget(
|
||||
patientDoctorAppointmentListHospital:
|
||||
patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap?[key]?.hmgDoctorList,
|
||||
isLiveCareAppointment: isLiveCareAppointment,
|
||||
isObGyneAppointment: isObGyneAppointment,
|
||||
isDoctorNameSearch: isDoctorNameSearch,
|
||||
isDoctorSearchResult: isDoctorSearchResult,
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
bottom: 8.0, left: 8, right: 8),
|
||||
child: AppExpandableNotifier(
|
||||
paddingValue: 8,
|
||||
applyBackgroundColor: false,
|
||||
applyBackgroundToOnlyHeader: true,
|
||||
completeHeaderColor: Colors.white,
|
||||
headerRadius: BorderRadius.circular(16),
|
||||
headerWidget: HospitalTitle(
|
||||
iconUrl: 'assets/images/svg/HMC.svg',
|
||||
title: TranslationBase.of(context).hmcHospital,
|
||||
isHMC: true,
|
||||
itemCount:
|
||||
"${patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmcSize ?? 0}",
|
||||
),
|
||||
showDropDownIconWithCustomHeader: true,
|
||||
bodyWidget: HospitalBodyWidget(
|
||||
patientDoctorAppointmentListHospital:
|
||||
patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap?[key]?.hmcDoctorList,
|
||||
isLiveCareAppointment: isLiveCareAppointment,
|
||||
isObGyneAppointment: isObGyneAppointment,
|
||||
isDoctorNameSearch: isDoctorNameSearch,
|
||||
isDoctorSearchResult: isDoctorSearchResult,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
));
|
||||
// return AppExpandableNotifier(
|
||||
// title: (patientDoctorAppointmentListHospital[index].distanceInKMs != "0")
|
||||
// ? patientDoctorAppointmentListHospital[index].filterName! + " - " + patientDoctorAppointmentListHospital[index].distanceInKMs! + " " + TranslationBase.of(context).km
|
||||
// : patientDoctorAppointmentListHospital[index].filterName,
|
||||
// projectTitleTop: patientDoctorAppointmentListHospital[index].projectTopName,
|
||||
// projectTitleBottom: (patientDoctorAppointmentListHospital[index].distanceInKMs != "0")
|
||||
// ? patientDoctorAppointmentListHospital[index].projectBottomName.toString() +
|
||||
// " - " +
|
||||
// patientDoctorAppointmentListHospital[index].distanceInKMs! +
|
||||
// " " +
|
||||
// TranslationBase.of(context).km
|
||||
// : patientDoctorAppointmentListHospital[index].projectBottomName.toString(),
|
||||
// isTitleSingleLine: false,
|
||||
// isDoctorSearchResult: isDoctorSearchResult,
|
||||
// isExpand: patientDoctorAppointmentListHospital.length == 1 ? true : false,
|
||||
// bodyWidget: ListView.separated(
|
||||
// shrinkWrap: true,
|
||||
// physics: NeverScrollableScrollPhysics(),
|
||||
// padding: EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21),
|
||||
// itemBuilder: (context, _index) {
|
||||
// final doctor = patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList![_index];
|
||||
// return DoctorView(
|
||||
// doctor: doctor,
|
||||
// isLiveCareAppointment: isLiveCareAppointment,
|
||||
// isObGyneAppointment: isObGyneAppointment,
|
||||
// isDoctorNameSearch: isDoctorNameSearch,
|
||||
// obGyneProcedureListResponse: obGyneProcedureListResponse,
|
||||
// isShowDate: false,
|
||||
// onTap: () {
|
||||
// context.read<ProjectViewModel>().analytics.appointment.book_appointment_select_doctor(appointment_type: 'regular', doctor: doctor);
|
||||
// });
|
||||
// },
|
||||
// separatorBuilder: (context, index) => SizedBox(height: 14),
|
||||
// itemCount: patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList!.length),
|
||||
// );
|
||||
},
|
||||
itemCount: patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap?.length ??
|
||||
0,
|
||||
)
|
||||
: getNoDataWidget(context),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class HospitalBodyWidget extends StatelessWidget {
|
||||
final List<PatientDoctorAppointmentList>?
|
||||
patientDoctorAppointmentListHospital;
|
||||
final bool isLiveCareAppointment;
|
||||
final bool isObGyneAppointment;
|
||||
final bool isDoctorNameSearch;
|
||||
final bool isDoctorSearchResult;
|
||||
final OBGyneProcedureListResponse? obGyneProcedureListResponse;
|
||||
|
||||
const HospitalBodyWidget({
|
||||
super.key,
|
||||
this.patientDoctorAppointmentListHospital,
|
||||
required this.isLiveCareAppointment,
|
||||
required this.isObGyneAppointment,
|
||||
required this.isDoctorNameSearch,
|
||||
required this.isDoctorSearchResult,
|
||||
this.obGyneProcedureListResponse,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView.separated(
|
||||
addAutomaticKeepAlives: true,
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
itemCount: patientDoctorAppointmentListHospital?.length ?? 0,
|
||||
separatorBuilder: (context, index) {
|
||||
return Container(
|
||||
height: 12,
|
||||
margin: EdgeInsets.only(left: 21, right: 21),
|
||||
);
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
return AppExpandableNotifier(
|
||||
applyBackgroundColor: false,
|
||||
widgetColor: CustomColors.appBackgroudGrey2Color,
|
||||
title: (patientDoctorAppointmentListHospital?[index].distanceInKMs !=
|
||||
"0")
|
||||
? patientDoctorAppointmentListHospital![index].filterName! +
|
||||
" - " +
|
||||
patientDoctorAppointmentListHospital![index].distanceInKMs! +
|
||||
" " +
|
||||
TranslationBase.of(context).km
|
||||
: patientDoctorAppointmentListHospital![index].filterName,
|
||||
projectTitleTop:
|
||||
patientDoctorAppointmentListHospital![index].projectTopName,
|
||||
projectTitleBottom: (patientDoctorAppointmentListHospital![index]
|
||||
.distanceInKMs !=
|
||||
"0")
|
||||
? patientDoctorAppointmentListHospital![index]
|
||||
.projectBottomName
|
||||
.toString() +
|
||||
" - " +
|
||||
patientDoctorAppointmentListHospital![index].distanceInKMs! +
|
||||
" " +
|
||||
TranslationBase.of(context).km
|
||||
: patientDoctorAppointmentListHospital![index]
|
||||
.projectBottomName
|
||||
.toString(),
|
||||
isTitleSingleLine: false,
|
||||
isDoctorSearchResult: isDoctorSearchResult,
|
||||
isExpand:
|
||||
patientDoctorAppointmentListHospital?.length == 1 ? true : false,
|
||||
bodyWidget: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
padding:
|
||||
EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21),
|
||||
itemBuilder: (context, _index) {
|
||||
// print("the index of patientDoctorAppointmentList is ${_index}");
|
||||
// print("the index of parent is ${index}");
|
||||
final doctor = patientDoctorAppointmentListHospital![index]
|
||||
.patientDoctorAppointmentList![_index];
|
||||
// print('the doctor is ${doctor.toJson()}');
|
||||
return DoctorView(
|
||||
doctor: doctor,
|
||||
isLiveCareAppointment: isLiveCareAppointment,
|
||||
isObGyneAppointment: isObGyneAppointment,
|
||||
isDoctorNameSearch: isDoctorNameSearch,
|
||||
obGyneProcedureListResponse: obGyneProcedureListResponse,
|
||||
isShowDate: false,
|
||||
onTap: () {
|
||||
context
|
||||
.read<ProjectViewModel>()
|
||||
.analytics
|
||||
.appointment
|
||||
.book_appointment_select_doctor(
|
||||
appointment_type: 'regular', doctor: doctor);
|
||||
});
|
||||
},
|
||||
separatorBuilder: (context, index) => SizedBox(height: 14),
|
||||
itemCount: patientDoctorAppointmentListHospital?[index].patientDoctorAppointmentList?.length ?? 0),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class RegionTitle extends StatelessWidget {
|
||||
final String title;
|
||||
final String hmcCount;
|
||||
final String hmgCount;
|
||||
|
||||
const RegionTitle(
|
||||
{super.key,
|
||||
required this.title,
|
||||
required this.hmcCount,
|
||||
required this.hmgCount});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 22, color: Colors.black, fontWeight: FontWeight.w700),
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"${TranslationBase.of(context).HospitalString(num.parse(hmgCount)).replaceAll("@", hmgCount)} ,",
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Color(0xFFD02127),
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
Text(
|
||||
"${TranslationBase.of(context).MedicalCenterString(num.parse(hmcCount)).replaceAll("@", hmcCount)}",
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Color(0xFF40ACC9),
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class HospitalTitle extends StatelessWidget {
|
||||
final String title;
|
||||
final String iconUrl;
|
||||
final bool isHMC;
|
||||
final String itemCount;
|
||||
|
||||
const HospitalTitle(
|
||||
{super.key,
|
||||
required this.title,
|
||||
required this.iconUrl,
|
||||
required this.isHMC,
|
||||
required this.itemCount});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
SvgPicture.asset(iconUrl),
|
||||
SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: isHMC ? Color(0xFF40ACC9) : Color(0xFFD02127),
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 6,
|
||||
),
|
||||
Text(
|
||||
isHMC
|
||||
? "${TranslationBase.of(context).MedicalCenterString(num.parse(itemCount)).replaceAll("@", itemCount)}"
|
||||
: "${TranslationBase.of(context).HospitalString(num.parse(itemCount)).replaceAll("@", itemCount)}",
|
||||
style: TextStyle(
|
||||
fontSize: 12, color: Colors.black, fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,261 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart';
|
||||
import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/components/LaserClinic.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/components/LiveCareBookAppointment.dart';
|
||||
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
|
||||
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
|
||||
import 'package:diplomaticquarterapp/services/appointment_services/doctor_response_mapper.dart';
|
||||
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../config/shared_pref_kay.dart';
|
||||
import '../../../models/Appointments/DoctorListResponse.dart';
|
||||
import '../../../services/authentication/auth_provider.dart';
|
||||
import '../../../theme/colors.dart';
|
||||
import '../../../uitl/gif_loader_dialog_utils.dart';
|
||||
|
||||
class ResultByClinic extends StatefulWidget {
|
||||
HospitalsModel? selectedValue;
|
||||
Function(RegionList, int?) onClinicSelected;
|
||||
|
||||
ResultByClinic({super.key, this.selectedValue, required this.onClinicSelected});
|
||||
|
||||
@override
|
||||
State<ResultByClinic> createState() => _ResultByClinicState();
|
||||
}
|
||||
|
||||
class _ResultByClinicState extends State<ResultByClinic> {
|
||||
List<ListClinicCentralized>? clinicIds = List.empty();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) => getClinicWrtHospital(widget.selectedValue));
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: clinicIds?.isNotEmpty == true
|
||||
? ListView.builder(
|
||||
itemBuilder: (_, index) => InkWell(
|
||||
onTap: () {
|
||||
getDoctorsList(
|
||||
context,
|
||||
"${clinicIds?[index].clinicID.toString() ?? ''}-${clinicIds?[index].isLiveCareClinicAndOnline!.toString()}-${clinicIds?[index].liveCareClinicID.toString()}-${clinicIds?[index].liveCareServiceID.toString()}",
|
||||
clinicIds?[index].clinicDescription!,
|
||||
widget.selectedValue,
|
||||
clinicIds?[index]);
|
||||
},
|
||||
child: Material(
|
||||
color: CustomColors.white,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
clinicIds?[index].clinicDescription ?? '',
|
||||
style: TextStyle(fontSize: 22, color: Colors.black, fontWeight: FontWeight.w700),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.all(8),
|
||||
child: Center(
|
||||
child: Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
color: CustomColors.black,
|
||||
size: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
),
|
||||
),
|
||||
itemCount: clinicIds?.length ?? 0,
|
||||
)
|
||||
: getNoDataWidget(context)),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
getDoctorsList(BuildContext context, String? dropdownValue, String? dropdownTitle, HospitalsModel? selectedHospital, ListClinicCentralized? selectedClinic) {
|
||||
SearchInfo searchInfo = new SearchInfo();
|
||||
if (dropdownValue != null) if (dropdownValue!.split("-")[0] == "17") {
|
||||
searchInfo.ProjectID = int.parse(selectedHospital?.mainProjectID.toString() ?? "");
|
||||
searchInfo.ClinicID = int.parse(dropdownValue!.split("-")[0]);
|
||||
searchInfo.hospital = selectedHospital;
|
||||
searchInfo.clinic = selectedClinic;
|
||||
searchInfo.date = DateTime.now();
|
||||
|
||||
if (context.read<ProjectViewModel>().isLogin) {
|
||||
if (context.read<ProjectViewModel>().user.age! > 12) {
|
||||
navigateToDentalComplaints(context, searchInfo);
|
||||
} else {
|
||||
callDoctorsSearchAPI(17);
|
||||
}
|
||||
} else {
|
||||
navigateToDentalComplaints(context, searchInfo);
|
||||
}
|
||||
} else if (dropdownValue!.split("-")[0] == "253") {
|
||||
navigateToLaserClinic(context);
|
||||
// callDoctorsSearchAPI();
|
||||
} else if (dropdownValue!.split("-")[1] == "true"
|
||||
// && authProvider.isLogin &&
|
||||
// authUser.patientType == 1
|
||||
) {
|
||||
Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: LiveCareBookAppointment(clinicName: dropdownTitle, liveCareClinicID: dropdownValue!.split("-")[2], liveCareServiceID: dropdownValue!.split("-")[3]),
|
||||
),
|
||||
).then((value) {
|
||||
print("navigation return ");
|
||||
if (value == "false") return;
|
||||
|
||||
// setState(() {
|
||||
// });
|
||||
if (value == "livecare") {
|
||||
Navigator.push(context, FadePage(page: LiveCareHome()));
|
||||
}
|
||||
if (value == "schedule") {
|
||||
callDoctorsSearchAPI(int.parse(dropdownValue!.split("-")[0]));
|
||||
}
|
||||
});
|
||||
setState(() {});
|
||||
} else {
|
||||
callDoctorsSearchAPI(int.parse(dropdownValue!.split("-")[0]));
|
||||
}
|
||||
}
|
||||
|
||||
Future navigateToLaserClinic(BuildContext context) async {
|
||||
Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: LaserClinic(selectedHospital: widget.selectedValue!),
|
||||
),
|
||||
).then((value) {});
|
||||
}
|
||||
|
||||
Future navigateToDentalComplaints(BuildContext context, SearchInfo searchInfo) async {
|
||||
Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: DentalComplaints(
|
||||
searchInfo: searchInfo,
|
||||
isFromHospitalSearchPage: true,
|
||||
),
|
||||
),
|
||||
).then((value) {
|
||||
if (value is RegionList) {
|
||||
widget.onClinicSelected(value,null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
callDoctorsSearchAPI(int clinicID) {
|
||||
var isArabic = context.read<ProjectViewModel>().isArabic;
|
||||
int languageID = isArabic ? 1 : 2;
|
||||
GifLoaderDialogUtils.showMyDialog(context);
|
||||
List<DoctorList> doctorsList = [];
|
||||
List<String> arr = [];
|
||||
List<String> arrDistance = [];
|
||||
List<String> result;
|
||||
int numAll;
|
||||
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = [];
|
||||
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
service
|
||||
.getDoctorsList(clinicID, widget.selectedValue?.mainProjectID.toString() != "" ? int.parse(widget.selectedValue?.mainProjectID.toString() ?? "-1") : 0, false, languageID, null)
|
||||
.then((res) async {
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
if (res['MessageStatus'] == 1) {
|
||||
RegionList regionHospitalList = RegionList();
|
||||
|
||||
if (res['DoctorList'].length != 0) {
|
||||
res['DoctorList'].forEach((v) {
|
||||
doctorsList.add(new DoctorList.fromJson(
|
||||
v,
|
||||
));
|
||||
});
|
||||
|
||||
regionHospitalList = await DoctorMapper.getMappedDoctor(doctorsList, isArabic: isArabic);
|
||||
var lat = await sharedPref.getDouble(USER_LAT);
|
||||
|
||||
var lng = await sharedPref.getDouble(USER_LONG);
|
||||
var isLocationEnabled = (lat != null && lat != 0.0) && (lng != null && lng != 0.0);
|
||||
regionHospitalList = await DoctorMapper.sortList(isLocationEnabled, regionHospitalList);
|
||||
widget.onClinicSelected(regionHospitalList, clinicID);
|
||||
setState(() {});
|
||||
} else {
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
AppToast.showErrorToast(message: res['ErrorSearchMsg']);
|
||||
}
|
||||
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
// navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital);
|
||||
} else {
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
||||
}
|
||||
}).catchError((err) {
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
print(err);
|
||||
AppToast.showErrorToast(message: err, localContext: context);
|
||||
});
|
||||
}
|
||||
|
||||
void getClinicWrtHospital(HospitalsModel? newValue) async {
|
||||
AppGlobal.context = context;
|
||||
GifLoaderDialogUtils.showMyDialog(context);
|
||||
ClinicListService service = new ClinicListService();
|
||||
List<HospitalsModel> projectsListLocal = [];
|
||||
clinicIds = List.empty();
|
||||
List<ListClinicCentralized> clinicId = [];
|
||||
try {
|
||||
Map res = await service.getClinicByHospital(projectID: newValue?.mainProjectID.toString() ?? "");
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
if (res['MessageStatus'] == 1) {
|
||||
List list = res['ListClinic'];
|
||||
|
||||
if (list.isEmpty) {
|
||||
AppToast.showErrorToast(
|
||||
message: TranslationBase.of(context).NoClinicFound,
|
||||
);
|
||||
}
|
||||
res['ListClinic'].forEach((v) {
|
||||
clinicId.add(ListClinicCentralized.fromJson(v));
|
||||
});
|
||||
clinicIds = clinicId;
|
||||
setState(() {});
|
||||
} else {
|
||||
AppToast.showErrorToast(
|
||||
message: TranslationBase.of(context).NoClinicFound,
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
print("the error is $e");
|
||||
AppToast.showErrorToast(
|
||||
message: TranslationBase.of(context).NoClinicFound,
|
||||
);
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,130 @@
|
||||
import 'package:auto_size_text/auto_size_text.dart';
|
||||
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
|
||||
import 'package:diplomaticquarterapp/theme/colors.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class ResultByDoctor extends StatefulWidget {
|
||||
List<DoctorList> doctorsList = [];
|
||||
List<DoctorList>? patientDoctorAppointmentListHospital;
|
||||
final bool isLiveCareAppointment;
|
||||
final bool isObGyneAppointment;
|
||||
final bool isDoctorNameSearch;
|
||||
final bool isDoctorSearchResult;
|
||||
final bool showNearestAppointment;
|
||||
final bool nearestAppointmentDoctors;
|
||||
final OBGyneProcedureListResponse? obGyneProcedureListResponse;
|
||||
final Function(bool)? refreshDoctorList;
|
||||
|
||||
ResultByDoctor({
|
||||
required this.doctorsList,
|
||||
required this.patientDoctorAppointmentListHospital,
|
||||
required this.isLiveCareAppointment,
|
||||
required this.isObGyneAppointment,
|
||||
required this.isDoctorNameSearch,
|
||||
required this.isDoctorSearchResult,
|
||||
this.showNearestAppointment = false,
|
||||
this.nearestAppointmentDoctors = false,
|
||||
this.obGyneProcedureListResponse,
|
||||
this.refreshDoctorList
|
||||
});
|
||||
|
||||
@override
|
||||
State<ResultByDoctor> createState() => _ResultByDoctorState();
|
||||
}
|
||||
|
||||
class _ResultByDoctorState extends State<ResultByDoctor> {
|
||||
|
||||
bool nearestAppo = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
nearestAppo = widget.nearestAppointmentDoctors;
|
||||
super.initState();
|
||||
}
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
|
||||
Visibility(
|
||||
visible: widget.showNearestAppointment,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 6, right: 6,),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Checkbox(
|
||||
activeColor: CustomColors.accentColor,
|
||||
value: nearestAppo,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
nearestAppo = value ?? false;
|
||||
});
|
||||
widget.refreshDoctorList?.call(nearestAppo);
|
||||
},
|
||||
),
|
||||
AutoSizeText(
|
||||
TranslationBase.of(context).nearestAppo.trim(),
|
||||
maxLines: 1,
|
||||
minFontSize: 10,
|
||||
style: TextStyle(
|
||||
fontSize: SizeConfig.textMultiplier! * 1.4,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.39,
|
||||
height: 0.8,
|
||||
),
|
||||
),
|
||||
// Text(TranslationBase.of(context).nearestAppo, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
widget.patientDoctorAppointmentListHospital?.isNotEmpty == true
|
||||
? Expanded(
|
||||
child: ListView.separated(
|
||||
addAutomaticKeepAlives: true,
|
||||
physics: BouncingScrollPhysics(),
|
||||
separatorBuilder: (context, index) {
|
||||
return Material(
|
||||
color: Color(0xFFf5f5f5),
|
||||
child: SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
);
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
final doctor = widget.patientDoctorAppointmentListHospital![index];
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12.0),
|
||||
child: DoctorView(
|
||||
doctor: doctor,
|
||||
isLiveCareAppointment: widget.isLiveCareAppointment,
|
||||
isObGyneAppointment: widget.isObGyneAppointment,
|
||||
isDoctorNameSearch: widget.isDoctorNameSearch,
|
||||
obGyneProcedureListResponse: widget.obGyneProcedureListResponse,
|
||||
isShowDate: false,
|
||||
onTap: () {
|
||||
context.read<ProjectViewModel>().analytics.appointment.book_appointment_select_doctor(appointment_type: 'regular', doctor: doctor);
|
||||
}),
|
||||
);
|
||||
},
|
||||
itemCount: widget.patientDoctorAppointmentListHospital?.length ?? 0,
|
||||
),
|
||||
)
|
||||
: getNoDataWidget(context),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,173 @@
|
||||
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/theme/colors.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
typedef OnFacilitySelected = Function(bool);
|
||||
|
||||
class ResultByFacility extends StatelessWidget {
|
||||
List<DoctorList> doctorsList = [];
|
||||
String selectedRegion = '';
|
||||
RegionList patientDoctorAppointmentListHospital;
|
||||
OnFacilitySelected onFacilitySelected;
|
||||
|
||||
ResultByFacility(
|
||||
{required this.doctorsList,
|
||||
required this.patientDoctorAppointmentListHospital,
|
||||
required this.onFacilitySelected,
|
||||
required this.selectedRegion});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Visibility(
|
||||
visible: patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap?[selectedRegion]?.hmgSize !=
|
||||
0,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
if (patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap?[selectedRegion]?.hmgSize ==
|
||||
0) return;
|
||||
onFacilitySelected(false);
|
||||
},
|
||||
child: HospitalTitle(
|
||||
iconUrl: 'assets/images/svg/HMG.svg',
|
||||
title: TranslationBase.of(context).hmgHospital,
|
||||
isHMC: false,
|
||||
itemCount:
|
||||
"${patientDoctorAppointmentListHospital.registeredDoctorMap?[selectedRegion]?.hmgSize ?? 0}",
|
||||
nearest: patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap?[selectedRegion]?.hmgDistance),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16,),
|
||||
Visibility(
|
||||
visible: patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap?[selectedRegion]?.hmcSize !=
|
||||
0,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
if (patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap?[selectedRegion]?.hmcSize ==
|
||||
0) return;
|
||||
onFacilitySelected(true);
|
||||
},
|
||||
child: HospitalTitle(
|
||||
iconUrl: 'assets/images/svg/HMC.svg',
|
||||
title: TranslationBase.of(context).hmcHospital,
|
||||
isHMC: true,
|
||||
itemCount:
|
||||
"${patientDoctorAppointmentListHospital.registeredDoctorMap?[selectedRegion]?.hmcSize ?? 0}",
|
||||
nearest: patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap?[selectedRegion]?.hmcDistance),
|
||||
),
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
class HospitalTitle extends StatelessWidget {
|
||||
final String title;
|
||||
final String iconUrl;
|
||||
final bool isHMC;
|
||||
final num? nearest;
|
||||
final String itemCount;
|
||||
|
||||
const HospitalTitle(
|
||||
{super.key,
|
||||
required this.title,
|
||||
required this.iconUrl,
|
||||
required this.isHMC,
|
||||
required this.itemCount,this.nearest});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Material(
|
||||
color: Colors.white,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
SvgPicture.asset(iconUrl),
|
||||
SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color:
|
||||
isHMC ? Color(0xFF40ACC9) : Color(0xFFD02127),
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 6,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
isHMC
|
||||
? "${TranslationBase.of(context).MedicalCenterString(num.parse(itemCount)).replaceAll("@", itemCount)}"
|
||||
: "${TranslationBase.of(context).HospitalString(num.parse(itemCount)).replaceAll("@", itemCount)}",
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
Visibility(
|
||||
visible: nearest != double.infinity &&
|
||||
nearest != "0" &&
|
||||
nearest != 0,
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
SvgPicture.asset(
|
||||
'assets/images/svg/location.svg',
|
||||
),
|
||||
SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
Text(
|
||||
"${TranslationBase.of(context).nearest}: $nearest ${TranslationBase.of(context).kilometerUnit}",
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.all(8),
|
||||
child: Center(
|
||||
child: Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
color: CustomColors.black,
|
||||
size: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,248 @@
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/theme/colors.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
typedef OnHospitalSelected = Function(String, int);
|
||||
|
||||
class ResultByHospital extends StatelessWidget {
|
||||
List<DoctorList> doctorsList = [];
|
||||
List<PatientDoctorAppointmentList>? paitientDoctorAppointmentList;
|
||||
bool isHMCSelected;
|
||||
|
||||
bool isLiveCareAppointment;
|
||||
bool isObGyneAppointment;
|
||||
bool isDoctorNameSearch;
|
||||
OBGyneProcedureListResponse? obGyneProcedureListResponse;
|
||||
bool isDoctorSearchResult;
|
||||
OnHospitalSelected onHospitalSelected;
|
||||
|
||||
ResultByHospital(
|
||||
{required this.doctorsList,
|
||||
required this.paitientDoctorAppointmentList,
|
||||
required this.isHMCSelected,
|
||||
this.isObGyneAppointment = false,
|
||||
this.isDoctorNameSearch = false,
|
||||
required this.isLiveCareAppointment,
|
||||
required this.isDoctorSearchResult,
|
||||
this.obGyneProcedureListResponse,
|
||||
required this.onHospitalSelected});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: HospitalBodyWidget(
|
||||
patientDoctorAppointmentListHospital: paitientDoctorAppointmentList,
|
||||
isLiveCareAppointment: isLiveCareAppointment,
|
||||
isObGyneAppointment: isObGyneAppointment,
|
||||
isDoctorNameSearch: isDoctorNameSearch,
|
||||
isDoctorSearchResult: isDoctorSearchResult,
|
||||
onHospitalSelected: onHospitalSelected,
|
||||
isHMC: isHMCSelected),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class HospitalBodyWidget extends StatelessWidget {
|
||||
final List<PatientDoctorAppointmentList>?
|
||||
patientDoctorAppointmentListHospital;
|
||||
final bool isLiveCareAppointment;
|
||||
final bool isObGyneAppointment;
|
||||
final bool isDoctorNameSearch;
|
||||
final bool isDoctorSearchResult;
|
||||
final OBGyneProcedureListResponse? obGyneProcedureListResponse;
|
||||
final OnHospitalSelected onHospitalSelected;
|
||||
final bool isHMC;
|
||||
|
||||
const HospitalBodyWidget(
|
||||
{super.key,
|
||||
this.patientDoctorAppointmentListHospital,
|
||||
required this.isLiveCareAppointment,
|
||||
required this.isObGyneAppointment,
|
||||
required this.isDoctorNameSearch,
|
||||
required this.isDoctorSearchResult,
|
||||
this.obGyneProcedureListResponse,
|
||||
required this.onHospitalSelected,
|
||||
required this.isHMC});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView.separated(
|
||||
addAutomaticKeepAlives: true,
|
||||
shrinkWrap: true,
|
||||
physics: BouncingScrollPhysics(),
|
||||
itemCount: patientDoctorAppointmentListHospital?.length ?? 0,
|
||||
separatorBuilder: (context, index) {
|
||||
return Container(
|
||||
height: 12,
|
||||
margin: EdgeInsets.only(left: 21, right: 21),
|
||||
);
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
onHospitalSelected(
|
||||
patientDoctorAppointmentListHospital![index].filterName ?? '',
|
||||
index);
|
||||
},
|
||||
child: Material(
|
||||
color: CustomColors.white,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(6.0),
|
||||
child: SvgPicture.asset(
|
||||
isHMC
|
||||
? 'assets/images/svg/HMC.svg'
|
||||
: 'assets/images/svg/HMG.svg',
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Directionality(
|
||||
textDirection: (context
|
||||
.read<ProjectViewModel>()
|
||||
.isArabic ==
|
||||
true)
|
||||
? TextDirection.rtl
|
||||
: TextDirection.ltr,
|
||||
child: Text(
|
||||
patientDoctorAppointmentListHospital![index]
|
||||
.filterName ??
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
color: isHMC
|
||||
? Color(0xFF40ACC9)
|
||||
: Color(0xFFD02127),
|
||||
fontWeight: FontWeight.w700),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
(patientDoctorAppointmentListHospital?[index]
|
||||
.distanceInKMs !=
|
||||
"0"),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
'assets/images/svg/location.svg',
|
||||
),
|
||||
SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
Text(
|
||||
// "${TranslationBase.of(context).nearest}: ${patientDoctorAppointmentListHospital?[index].distanceInKMs} ${TranslationBase.of(context).kilometerUnit}",
|
||||
"${patientDoctorAppointmentListHospital?[index].distanceInKMs} ${TranslationBase.of(context).kilometerUnit}",
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.all(8),
|
||||
child: Center(
|
||||
child: Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
color: CustomColors.black,
|
||||
size: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
),
|
||||
);
|
||||
// return AppExpandableNotifier(
|
||||
// applyBackgroundColor: false,
|
||||
// widgetColor: CustomColors.appBackgroudGrey2Color,
|
||||
// title: (patientDoctorAppointmentListHospital?[index].distanceInKMs !=
|
||||
// "0")
|
||||
// ? patientDoctorAppointmentListHospital![index].filterName! +
|
||||
// " - " +
|
||||
// patientDoctorAppointmentListHospital![index].distanceInKMs! +
|
||||
// " " +
|
||||
// TranslationBase.of(context).km
|
||||
// : patientDoctorAppointmentListHospital![index].filterName,
|
||||
// projectTitleTop:
|
||||
// patientDoctorAppointmentListHospital![index].projectTopName,
|
||||
// projectTitleBottom: (patientDoctorAppointmentListHospital![index]
|
||||
// .distanceInKMs !=
|
||||
// "0")
|
||||
// ? patientDoctorAppointmentListHospital![index]
|
||||
// .projectBottomName
|
||||
// .toString() +
|
||||
// " - " +
|
||||
// patientDoctorAppointmentListHospital![index].distanceInKMs! +
|
||||
// " " +
|
||||
// TranslationBase.of(context).km
|
||||
// : patientDoctorAppointmentListHospital![index]
|
||||
// .projectBottomName
|
||||
// .toString(),
|
||||
// isTitleSingleLine: false,
|
||||
// isDoctorSearchResult: isDoctorSearchResult,
|
||||
// isDisabled: true,
|
||||
// isExpand:
|
||||
// patientDoctorAppointmentListHospital?.length == 1 ? true : false,
|
||||
// // bodyWidget: ListView.separated(
|
||||
// // shrinkWrap: true,
|
||||
// // physics: NeverScrollableScrollPhysics(),
|
||||
// // padding:
|
||||
// // EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21),
|
||||
// // itemBuilder: (context, _index) {
|
||||
// // // print("the index of patientDoctorAppointmentList is ${_index}");
|
||||
// // // print("the index of parent is ${index}");
|
||||
// // final doctor = patientDoctorAppointmentListHospital![index]
|
||||
// // .patientDoctorAppointmentList![_index];
|
||||
// // // print('the doctor is ${doctor.toJson()}');
|
||||
// // return DoctorView(
|
||||
// // doctor: doctor,
|
||||
// // isLiveCareAppointment: isLiveCareAppointment,
|
||||
// // isObGyneAppointment: isObGyneAppointment,
|
||||
// // isDoctorNameSearch: isDoctorNameSearch,
|
||||
// // obGyneProcedureListResponse: obGyneProcedureListResponse,
|
||||
// // isShowDate: false,
|
||||
// // onTap: () {
|
||||
// // context
|
||||
// // .read<ProjectViewModel>()
|
||||
// // .analytics
|
||||
// // .appointment
|
||||
// // .book_appointment_select_doctor(
|
||||
// // appointment_type: 'regular', doctor: doctor);
|
||||
// // });
|
||||
// // },
|
||||
// // separatorBuilder: (context, index) => SizedBox(height: 14),
|
||||
// // itemCount: patientDoctorAppointmentListHospital?[index].patientDoctorAppointmentList?.length ?? 0),
|
||||
// );
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,170 @@
|
||||
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/theme/colors.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
typedef OnRegionSelected = Function(String);
|
||||
class ResultByRegion extends StatelessWidget {
|
||||
List<DoctorList> doctorsList = [];
|
||||
RegionList patientDoctorAppointmentListHospital;
|
||||
OnRegionSelected onRegionSelected;
|
||||
ResultByRegion(
|
||||
{required this.doctorsList,
|
||||
required this.patientDoctorAppointmentListHospital,
|
||||
required this.onRegionSelected
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap?.isNotEmpty ==
|
||||
true
|
||||
? ListView.separated(
|
||||
addAutomaticKeepAlives: true,
|
||||
physics: BouncingScrollPhysics(),
|
||||
separatorBuilder: (context, index) {
|
||||
return Material(
|
||||
color: Color(0xFFf5f5f5),
|
||||
child: SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
);
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
String key = patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap?.keys
|
||||
.toList()[index] ??
|
||||
'';
|
||||
|
||||
return InkWell(
|
||||
onTap: (){
|
||||
onRegionSelected(key);
|
||||
},
|
||||
child: RegionTitle(
|
||||
title: key,
|
||||
hmcCount:
|
||||
"${patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmcSize ?? 0}",
|
||||
hmgCount:
|
||||
"${patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmgSize ?? 0}",
|
||||
),
|
||||
);
|
||||
|
||||
},
|
||||
itemCount: patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap?.length ??
|
||||
0,
|
||||
)
|
||||
: getNoDataWidget(context),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class RegionTitle extends StatelessWidget {
|
||||
final String title;
|
||||
final String hmcCount;
|
||||
final String hmgCount;
|
||||
|
||||
const RegionTitle(
|
||||
{super.key,
|
||||
required this.title,
|
||||
required this.hmcCount,
|
||||
required this.hmgCount});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Material(
|
||||
color: CustomColors.white,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 22, color: Colors.black, fontWeight: FontWeight.w700),
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Visibility(
|
||||
visible: hmgCount != "0",
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
'assets/images/svg/HMG.svg',
|
||||
width: 10,
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
Text(
|
||||
"${TranslationBase.of(context).HospitalString(num.parse(hmgCount)).replaceAll("@", hmgCount)}",
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Color(0xFFD02127),
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: hmcCount != "0" && hmgCount != "0",
|
||||
child: Text(", ")),
|
||||
Visibility(
|
||||
visible: hmcCount != "0",
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
'assets/images/svg/HMC.svg',
|
||||
width: 10,
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
Text(
|
||||
"${TranslationBase.of(context).MedicalCenterString(num.parse(hmcCount)).replaceAll("@", hmcCount)}",
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Color(0xFF40ACC9),
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.all(8),
|
||||
child: Center(
|
||||
child: Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
color: CustomColors.black,
|
||||
size: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,725 @@
|
||||
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByDoctors.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByFacility.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByHospital.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByRegion.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
|
||||
import 'package:diplomaticquarterapp/theme/colors.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class SearchResultWithTab extends StatefulWidget {
|
||||
List<DoctorList> doctorsList = [];
|
||||
RegionList patientDoctorAppointmentListHospital;
|
||||
bool isLiveCareAppointment;
|
||||
bool isObGyneAppointment;
|
||||
bool isDoctorNameSearch;
|
||||
OBGyneProcedureListResponse? obGyneProcedureListResponse;
|
||||
bool isDoctorSearchResult;
|
||||
|
||||
bool isForHospital;
|
||||
|
||||
SearchResultWithTab({required this.doctorsList,
|
||||
required this.patientDoctorAppointmentListHospital,
|
||||
this.isObGyneAppointment = false,
|
||||
this.isDoctorNameSearch = false,
|
||||
required this.isLiveCareAppointment,
|
||||
required this.isDoctorSearchResult,
|
||||
this.obGyneProcedureListResponse,
|
||||
this.isForHospital = false,
|
||||
});
|
||||
|
||||
@override
|
||||
State<SearchResultWithTab> createState() => _SearchResultWithTabState();
|
||||
}
|
||||
|
||||
class _SearchResultWithTabState extends State<SearchResultWithTab> {
|
||||
int _currentIndex = 0;
|
||||
late PageController _controller;
|
||||
String selectedRegion = "";
|
||||
bool isHMCSelected = false;
|
||||
int selectedHospitalIndex = -1;
|
||||
ScrollController scrollController = ScrollController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = new PageController();
|
||||
}
|
||||
|
||||
changePageViewIndex(pageIndex) {
|
||||
_controller.jumpToPage(pageIndex);
|
||||
// scrollController.jumpTo(pageIndex);
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).bookAppo,
|
||||
isShowDecPage: false,
|
||||
isShowAppBar: true,
|
||||
showNewAppBarTitle: true,
|
||||
showNewAppBar: true,
|
||||
backgroundColor: CustomColors.appBackgroudGrey2Color,
|
||||
body: widget.patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap?.isNotEmpty ==
|
||||
true
|
||||
? SizedBox(
|
||||
height: SizeConfig.realScreenHeight! * .9,
|
||||
width: SizeConfig.realScreenWidth,
|
||||
child: Column(children: <Widget>[
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(left: 20, right: 20, top: 12),
|
||||
child: SizedBox(
|
||||
height: 100,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
controller: scrollController,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 4,
|
||||
child: showProgress(
|
||||
title: TranslationBase.of(context).selectRegion,
|
||||
status: _currentIndex == 0
|
||||
? TranslationBase.of(context).inPrgress
|
||||
: _currentIndex > 0
|
||||
? TranslationBase.of(context).completed
|
||||
: TranslationBase.of(context).locked,
|
||||
color: _currentIndex == 0
|
||||
? CustomColors.orange
|
||||
: CustomColors.green,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
selectedHospitalIndex = -1;
|
||||
selectedRegion = "";
|
||||
_currentIndex = 0;
|
||||
changePageViewIndex(0);
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 4,
|
||||
child: showProgress(
|
||||
title: TranslationBase.of(context).selectFacitlity,
|
||||
status: _currentIndex == 1
|
||||
? TranslationBase.of(context).inPrgress
|
||||
: _currentIndex > 1
|
||||
? TranslationBase.of(context).completed
|
||||
: TranslationBase.of(context).locked,
|
||||
color: _currentIndex == 1
|
||||
? CustomColors.orange
|
||||
: _currentIndex > 1
|
||||
? CustomColors.green
|
||||
: CustomColors.grey2,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
selectedHospitalIndex = -1;
|
||||
_currentIndex = 1;
|
||||
changePageViewIndex(1);
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 4,
|
||||
child: showProgress(
|
||||
title: TranslationBase.of(context).selectBranch,
|
||||
status: _currentIndex == 2
|
||||
? TranslationBase.of(context).inPrgress
|
||||
: _currentIndex > 1
|
||||
? TranslationBase.of(context).completed
|
||||
: TranslationBase.of(context).locked,
|
||||
color: _currentIndex == 2
|
||||
? CustomColors.orange
|
||||
: _currentIndex > 2
|
||||
? CustomColors.green
|
||||
: CustomColors.grey2,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
selectedHospitalIndex = -1;
|
||||
_currentIndex = 2;
|
||||
changePageViewIndex(2);
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
(widget.isForHospital)
|
||||
? SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 4,
|
||||
child: showProgress(
|
||||
title:
|
||||
TranslationBase.of(context).selectClinic,
|
||||
status: _currentIndex == 3
|
||||
? TranslationBase.of(context).inPrgress
|
||||
: TranslationBase.of(context).locked,
|
||||
color: _currentIndex == 3
|
||||
? CustomColors.orange
|
||||
: _currentIndex > 4
|
||||
? CustomColors.green
|
||||
: CustomColors.grey2,
|
||||
isNeedBorder: false,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_currentIndex = 3;
|
||||
changePageViewIndex(3);
|
||||
});
|
||||
},
|
||||
),
|
||||
)
|
||||
: SizedBox.shrink(),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 4,
|
||||
child: showProgress(
|
||||
title: TranslationBase.of(context).selectDoctor,
|
||||
status: _currentIndex ==
|
||||
((widget.isForHospital) ? 4 : 3)
|
||||
? TranslationBase.of(context).inPrgress
|
||||
: TranslationBase.of(context).locked,
|
||||
color: _currentIndex ==
|
||||
((widget.isForHospital) ? 4 : 3)
|
||||
? CustomColors.orange
|
||||
: _currentIndex ==
|
||||
((widget.isForHospital) ? 5 : 4)
|
||||
? CustomColors.green
|
||||
: CustomColors.grey2,
|
||||
isNeedBorder: false,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_currentIndex =
|
||||
((widget.isForHospital) ? 4 : 3);
|
||||
changePageViewIndex(_currentIndex);
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(10.0, 18, 0, 24),
|
||||
child: Row(
|
||||
children: [
|
||||
(_currentIndex != 0)
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
handleBackClick();
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0, 0, 04, 0),
|
||||
child: Icon(
|
||||
Icons.arrow_back,
|
||||
color: Theme.of(context).primaryColor,
|
||||
),
|
||||
),
|
||||
)
|
||||
: mWidth(24),
|
||||
Text(
|
||||
getTitle(),
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.black),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
// mHeight(24),
|
||||
Expanded(
|
||||
child: PageView(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
controller: _controller,
|
||||
onPageChanged: (index) {
|
||||
setState(() {
|
||||
_currentIndex = index;
|
||||
});
|
||||
},
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
ResultByRegion(
|
||||
doctorsList: widget.doctorsList,
|
||||
patientDoctorAppointmentListHospital:
|
||||
widget.patientDoctorAppointmentListHospital,
|
||||
onRegionSelected: (key) {
|
||||
setState(() {
|
||||
selectedRegion = key;
|
||||
_currentIndex = 1;
|
||||
changePageViewIndex(1);
|
||||
});
|
||||
}),
|
||||
(selectedRegion != "")
|
||||
? ResultByFacility(
|
||||
doctorsList: widget.doctorsList,
|
||||
patientDoctorAppointmentListHospital:
|
||||
widget.patientDoctorAppointmentListHospital,
|
||||
selectedRegion: selectedRegion,
|
||||
onFacilitySelected: (isHMCSelected) {
|
||||
setState(() {
|
||||
this.isHMCSelected = isHMCSelected;
|
||||
_currentIndex = 2;
|
||||
changePageViewIndex(2);
|
||||
});
|
||||
},
|
||||
) : SizedBox.shrink(),
|
||||
(selectedRegion != '') ?
|
||||
ResultByHospital(doctorsList: widget.doctorsList,
|
||||
paitientDoctorAppointmentList: (isHMCSelected) ?
|
||||
widget.patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap![selectedRegion]!
|
||||
.hmcDoctorList ??
|
||||
[]
|
||||
: widget
|
||||
.patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap?[selectedRegion]
|
||||
?.hmgDoctorList ??
|
||||
[],
|
||||
isHMCSelected: isHMCSelected,
|
||||
isLiveCareAppointment: widget.isLiveCareAppointment,
|
||||
isDoctorSearchResult: widget.isDoctorSearchResult,
|
||||
onHospitalSelected: (hospital, index) {
|
||||
setState(() {
|
||||
selectedHospitalIndex = index;
|
||||
_currentIndex = 3;
|
||||
changePageViewIndex(3);
|
||||
});
|
||||
})
|
||||
: SizedBox.shrink(),
|
||||
(selectedRegion != '' && selectedHospitalIndex != -1)
|
||||
? ResultByDoctor(
|
||||
doctorsList: widget.doctorsList,
|
||||
patientDoctorAppointmentListHospital: (!isHMCSelected)
|
||||
? widget
|
||||
.patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap![selectedRegion]!
|
||||
.hmgDoctorList![selectedHospitalIndex]
|
||||
.patientDoctorAppointmentList ??
|
||||
[]
|
||||
: widget
|
||||
.patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap?[selectedRegion]
|
||||
?.hmcDoctorList?[
|
||||
selectedHospitalIndex]
|
||||
.patientDoctorAppointmentList ??
|
||||
[],
|
||||
isLiveCareAppointment:
|
||||
widget.isLiveCareAppointment,
|
||||
isDoctorSearchResult: widget.isDoctorSearchResult,
|
||||
isObGyneAppointment: widget.isObGyneAppointment,
|
||||
isDoctorNameSearch: widget.isDoctorNameSearch)
|
||||
: SizedBox.shrink(),
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
)
|
||||
: getNoDataWidget(context),);
|
||||
}
|
||||
|
||||
String getTitle() {
|
||||
switch (_currentIndex) {
|
||||
case 0:
|
||||
return TranslationBase
|
||||
.of(context)
|
||||
.selectRegion;
|
||||
case 1:
|
||||
return TranslationBase
|
||||
.of(context)
|
||||
.selectFacitlity;
|
||||
case 2:
|
||||
return TranslationBase
|
||||
.of(context)
|
||||
.selectBranch;
|
||||
case 3:
|
||||
return TranslationBase
|
||||
.of(context)
|
||||
.selectDoctor;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
void handleBackClick() {
|
||||
switch (_currentIndex) {
|
||||
case 1:
|
||||
selectedHospitalIndex = -1;
|
||||
selectedRegion = "";
|
||||
_currentIndex = 0;
|
||||
changePageViewIndex(0);
|
||||
break;
|
||||
case 2:
|
||||
selectedHospitalIndex = -1;
|
||||
_currentIndex = 1;
|
||||
changePageViewIndex(1);
|
||||
break;
|
||||
case 3:
|
||||
selectedHospitalIndex = -1;
|
||||
_currentIndex = 2;
|
||||
changePageViewIndex(2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Widget showProgress(
|
||||
{String? title,
|
||||
String? status,
|
||||
Color? color,
|
||||
bool isNeedBorder = true,
|
||||
Function()? onTap}) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
if (status == TranslationBase
|
||||
.of(context)
|
||||
.completed) {
|
||||
onTap?.call();
|
||||
}
|
||||
},
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 26,
|
||||
height: 26,
|
||||
decoration: containerRadius(color!, 200),
|
||||
child: Icon(
|
||||
Icons.done,
|
||||
color: Colors.white,
|
||||
size: 16,
|
||||
),
|
||||
),
|
||||
if (isNeedBorder)
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: mDivider(Colors.grey),
|
||||
)),
|
||||
],
|
||||
),
|
||||
mHeight(8),
|
||||
Text(
|
||||
title!,
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.44,
|
||||
),
|
||||
),
|
||||
mHeight(2),
|
||||
Container(
|
||||
padding: EdgeInsets.all(5),
|
||||
decoration: containerRadius(color!.withOpacity(0.2), 4),
|
||||
child: Text(
|
||||
status!,
|
||||
style: TextStyle(
|
||||
fontSize: 8,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.32,
|
||||
color: color,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class HospitalBodyWidget extends StatelessWidget {
|
||||
final List<PatientDoctorAppointmentList>?
|
||||
patientDoctorAppointmentListHospital;
|
||||
final bool isLiveCareAppointment;
|
||||
final bool isObGyneAppointment;
|
||||
final bool isDoctorNameSearch;
|
||||
final bool isDoctorSearchResult;
|
||||
final OBGyneProcedureListResponse? obGyneProcedureListResponse;
|
||||
|
||||
const HospitalBodyWidget({
|
||||
super.key,
|
||||
this.patientDoctorAppointmentListHospital,
|
||||
required this.isLiveCareAppointment,
|
||||
required this.isObGyneAppointment,
|
||||
required this.isDoctorNameSearch,
|
||||
required this.isDoctorSearchResult,
|
||||
this.obGyneProcedureListResponse,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView.separated(
|
||||
addAutomaticKeepAlives: true,
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
itemCount: patientDoctorAppointmentListHospital?.length ?? 0,
|
||||
separatorBuilder: (context, index) {
|
||||
return Container(
|
||||
height: 12,
|
||||
margin: EdgeInsets.only(left: 21, right: 21),
|
||||
);
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
return AppExpandableNotifier(
|
||||
applyBackgroundColor: false,
|
||||
widgetColor: CustomColors.appBackgroudGrey2Color,
|
||||
title: (patientDoctorAppointmentListHospital?[index].distanceInKMs !=
|
||||
"0")
|
||||
? patientDoctorAppointmentListHospital![index].filterName! +
|
||||
" - " +
|
||||
patientDoctorAppointmentListHospital![index].distanceInKMs! +
|
||||
" " +
|
||||
TranslationBase
|
||||
.of(context)
|
||||
.km
|
||||
: patientDoctorAppointmentListHospital![index].filterName,
|
||||
projectTitleTop:
|
||||
patientDoctorAppointmentListHospital![index].projectTopName,
|
||||
projectTitleBottom: (patientDoctorAppointmentListHospital![index]
|
||||
.distanceInKMs !=
|
||||
"0")
|
||||
? patientDoctorAppointmentListHospital![index]
|
||||
.projectBottomName
|
||||
.toString() +
|
||||
" - " +
|
||||
patientDoctorAppointmentListHospital![index].distanceInKMs! +
|
||||
" " +
|
||||
TranslationBase
|
||||
.of(context)
|
||||
.km
|
||||
: patientDoctorAppointmentListHospital![index]
|
||||
.projectBottomName
|
||||
.toString(),
|
||||
isTitleSingleLine: false,
|
||||
isDoctorSearchResult: isDoctorSearchResult,
|
||||
isExpand:
|
||||
patientDoctorAppointmentListHospital?.length == 1 ? true : false,
|
||||
bodyWidget: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
padding:
|
||||
EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21),
|
||||
itemBuilder: (context, _index) {
|
||||
// print("the index of patientDoctorAppointmentList is ${_index}");
|
||||
// print("the index of parent is ${index}");
|
||||
final doctor = patientDoctorAppointmentListHospital![index]
|
||||
.patientDoctorAppointmentList![_index];
|
||||
// print('the doctor is ${doctor.toJson()}');
|
||||
return DoctorView(
|
||||
doctor: doctor,
|
||||
isLiveCareAppointment: isLiveCareAppointment,
|
||||
isObGyneAppointment: isObGyneAppointment,
|
||||
isDoctorNameSearch: isDoctorNameSearch,
|
||||
obGyneProcedureListResponse: obGyneProcedureListResponse,
|
||||
isShowDate: false,
|
||||
onTap: () {
|
||||
context
|
||||
.read<ProjectViewModel>()
|
||||
.analytics
|
||||
.appointment
|
||||
.book_appointment_select_doctor(
|
||||
appointment_type: 'regular', doctor: doctor);
|
||||
});
|
||||
},
|
||||
separatorBuilder: (context, index) => SizedBox(height: 14),
|
||||
itemCount: patientDoctorAppointmentListHospital?[index]
|
||||
.patientDoctorAppointmentList?.length ?? 0),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class RegionTitle extends StatelessWidget {
|
||||
final String title;
|
||||
final String hmcCount;
|
||||
final String hmgCount;
|
||||
|
||||
const RegionTitle({super.key,
|
||||
required this.title,
|
||||
required this.hmcCount,
|
||||
required this.hmgCount});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 22, color: Colors.black, fontWeight: FontWeight.w700),
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"${TranslationBase.of(context).HospitalString(num.parse(hmgCount)).replaceAll("@", hmgCount)} ,",
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Color(0xFFD02127),
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
Text(
|
||||
"${TranslationBase.of(context).MedicalCenterString(num.parse(hmcCount)).replaceAll("@", hmcCount)}",
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Color(0xFF40ACC9),
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class HospitalTitle extends StatelessWidget {
|
||||
final String title;
|
||||
final String iconUrl;
|
||||
final bool isHMC;
|
||||
final String itemCount;
|
||||
|
||||
const HospitalTitle({super.key,
|
||||
required this.title,
|
||||
required this.iconUrl,
|
||||
required this.isHMC,
|
||||
required this.itemCount});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
SvgPicture.asset(iconUrl),
|
||||
SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: isHMC ? Color(0xFF40ACC9) : Color(0xFFD02127),
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 6,
|
||||
),
|
||||
Text(
|
||||
isHMC
|
||||
? "${TranslationBase.of(context).MedicalCenterString(num.parse(itemCount)).replaceAll("@", itemCount)}"
|
||||
: "${TranslationBase.of(context).HospitalString(num.parse(itemCount)).replaceAll("@", itemCount)}",
|
||||
style: TextStyle(
|
||||
fontSize: 12, color: Colors.black, fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///todo the current content of the application
|
||||
/// return AppExpandableNotifier(
|
||||
// paddingValue: 10,
|
||||
// applyBackgroundToOnlyHeader: true,
|
||||
// completeHeaderColor: CustomColors.appBackgroudGrey2Color,
|
||||
// headerWidget: RegionTitle(
|
||||
// title: key,
|
||||
// hmcCount:
|
||||
// "${widget.patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmcSize ?? 0}",
|
||||
// hmgCount:
|
||||
// "${widget.patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmgSize ?? 0}",
|
||||
// ),
|
||||
// showDropDownIconWithCustomHeader: true,
|
||||
// isTitleSingleLine: false,
|
||||
// isDoctorSearchResult: widget.isDoctorSearchResult,
|
||||
// widgetColor: Color(0xFFF8F8F8),
|
||||
// bodyWidget: Column(
|
||||
// children: [
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.all(8.0),
|
||||
// child: AppExpandableNotifier(
|
||||
// paddingValue: 8,
|
||||
// applyBackgroundColor: false,
|
||||
// applyBackgroundToOnlyHeader: true,
|
||||
// completeHeaderColor: Colors.white,
|
||||
// headerRadius: BorderRadius.circular(16),
|
||||
// headerWidget: HospitalTitle(
|
||||
// iconUrl: 'assets/images/svg/HMG.svg',
|
||||
// title: TranslationBase.of(context).hmgHospital,
|
||||
// isHMC: false,
|
||||
// itemCount:
|
||||
// "${widget.patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmgSize ?? 0}",
|
||||
// ),
|
||||
// showDropDownIconWithCustomHeader: true,
|
||||
// bodyWidget: HospitalBodyWidget(
|
||||
// patientDoctorAppointmentListHospital:
|
||||
// widget.patientDoctorAppointmentListHospital
|
||||
// .registeredDoctorMap?[key]?.hmgDoctorList,
|
||||
// isLiveCareAppointment: widget.isLiveCareAppointment,
|
||||
// isObGyneAppointment: widget.isObGyneAppointment,
|
||||
// isDoctorNameSearch: widget.isDoctorNameSearch,
|
||||
// isDoctorSearchResult: widget.isDoctorSearchResult,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(
|
||||
// bottom: 8.0, left: 8, right: 8),
|
||||
// child: AppExpandableNotifier(
|
||||
// paddingValue: 8,
|
||||
// applyBackgroundColor: false,
|
||||
// applyBackgroundToOnlyHeader: true,
|
||||
// completeHeaderColor: Colors.white,
|
||||
// headerRadius: BorderRadius.circular(16),
|
||||
// headerWidget: HospitalTitle(
|
||||
// iconUrl: 'assets/images/svg/HMC.svg',
|
||||
// title: TranslationBase.of(context).hmcHospital,
|
||||
// isHMC: true,
|
||||
// itemCount:
|
||||
// "${widget.patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmcSize ?? 0}",
|
||||
// ),
|
||||
// showDropDownIconWithCustomHeader: true,
|
||||
// bodyWidget: HospitalBodyWidget(
|
||||
// patientDoctorAppointmentListHospital:
|
||||
// widget.patientDoctorAppointmentListHospital
|
||||
// .registeredDoctorMap?[key]?.hmcDoctorList,
|
||||
// isLiveCareAppointment: widget.isLiveCareAppointment,
|
||||
// isObGyneAppointment: widget.isObGyneAppointment,
|
||||
// isDoctorNameSearch: widget.isDoctorNameSearch,
|
||||
// isDoctorSearchResult: widget.isDoctorSearchResult,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ));
|
||||
@ -0,0 +1,853 @@
|
||||
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByClinic.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByDoctors.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByFacility.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByHospital.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByRegion.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
|
||||
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
|
||||
import 'package:diplomaticquarterapp/services/appointment_services/doctor_response_mapper.dart';
|
||||
import 'package:diplomaticquarterapp/theme/colors.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../config/shared_pref_kay.dart';
|
||||
import '../../../core/service/client/base_app_client.dart';
|
||||
|
||||
class SearchResultWithTabForHospital extends StatefulWidget {
|
||||
List<DoctorList> doctorsList = [];
|
||||
RegionList patientDoctorAppointmentListHospital;
|
||||
bool isLiveCareAppointment;
|
||||
bool isObGyneAppointment;
|
||||
bool isDoctorNameSearch;
|
||||
OBGyneProcedureListResponse? obGyneProcedureListResponse;
|
||||
bool isDoctorSearchResult;
|
||||
|
||||
bool isForHospital;
|
||||
|
||||
SearchResultWithTabForHospital({
|
||||
required this.doctorsList,
|
||||
required this.patientDoctorAppointmentListHospital,
|
||||
this.isObGyneAppointment = false,
|
||||
this.isDoctorNameSearch = false,
|
||||
required this.isLiveCareAppointment,
|
||||
required this.isDoctorSearchResult,
|
||||
this.obGyneProcedureListResponse,
|
||||
this.isForHospital = true,
|
||||
});
|
||||
|
||||
@override
|
||||
State<SearchResultWithTabForHospital> createState() =>
|
||||
_SearchResultWithTabForHospitalState();
|
||||
}
|
||||
|
||||
class _SearchResultWithTabForHospitalState
|
||||
extends State<SearchResultWithTabForHospital> {
|
||||
int _currentIndex = 0;
|
||||
late PageController _controller;
|
||||
String selectedRegion = "";
|
||||
HospitalsModel? selectedHospital;
|
||||
bool isHMCSelected = false;
|
||||
int selectedHospitalIndex = -1;
|
||||
ScrollController scrollController = ScrollController();
|
||||
RegionList? doctorList;
|
||||
bool nearestAppointment= false;
|
||||
int clinicId = -1;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = new PageController();
|
||||
}
|
||||
|
||||
changePageViewIndex(pageIndex) {
|
||||
_controller.jumpToPage(pageIndex);
|
||||
// if (scrollController.hasClients) {
|
||||
// print("it has clients");
|
||||
// scrollController.animateTo(pageIndex.toDouble(),curve: Curves.easeOut,
|
||||
// duration: const Duration(milliseconds: 300),);}
|
||||
}
|
||||
|
||||
void handleBackClick() {
|
||||
switch (_currentIndex) {
|
||||
case 1:
|
||||
selectedHospitalIndex = -1;
|
||||
selectedRegion = "";
|
||||
doctorList = null;
|
||||
_currentIndex = 0;
|
||||
changePageViewIndex(0);
|
||||
break;
|
||||
case 2:
|
||||
selectedHospitalIndex = -1;
|
||||
doctorList = null;
|
||||
_currentIndex = 1;
|
||||
changePageViewIndex(1);
|
||||
break;
|
||||
case 3:
|
||||
selectedHospitalIndex = -1;
|
||||
doctorList = null;
|
||||
_currentIndex = 2;
|
||||
changePageViewIndex(2);
|
||||
break;
|
||||
case 4:
|
||||
_currentIndex = 3;
|
||||
doctorList = null;
|
||||
changePageViewIndex(3);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
child: widget.patientDoctorAppointmentListHospital.registeredDoctorMap
|
||||
?.isNotEmpty ==
|
||||
true
|
||||
? SizedBox(
|
||||
height: SizeConfig.realScreenHeight! * .9,
|
||||
width: SizeConfig.realScreenWidth,
|
||||
child: Column(children: <Widget>[
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(left: 20, right: 20, top: 12),
|
||||
child: SizedBox(
|
||||
height: 100,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
controller: scrollController,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 5.2,
|
||||
child: showProgress(
|
||||
title: TranslationBase.of(context).selectRegion,
|
||||
status: _currentIndex == 0
|
||||
? TranslationBase.of(context).inPrgress
|
||||
: _currentIndex > 0
|
||||
? TranslationBase.of(context).completed
|
||||
: TranslationBase.of(context).locked,
|
||||
color: _currentIndex == 0
|
||||
? CustomColors.orange
|
||||
: CustomColors.green,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
selectedHospitalIndex = -1;
|
||||
selectedRegion = "";
|
||||
doctorList = null;
|
||||
_currentIndex = 0;
|
||||
changePageViewIndex(0);
|
||||
nearestAppointment = false;
|
||||
clinicId = -1;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 5.2,
|
||||
child: showProgress(
|
||||
title: TranslationBase.of(context).selectFacitlity,
|
||||
status: _currentIndex == 1
|
||||
? TranslationBase.of(context).inPrgress
|
||||
: _currentIndex > 1
|
||||
? TranslationBase.of(context).completed
|
||||
: TranslationBase.of(context).locked,
|
||||
color: _currentIndex == 1
|
||||
? CustomColors.orange
|
||||
: _currentIndex > 1
|
||||
? CustomColors.green
|
||||
: CustomColors.grey2,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
selectedHospitalIndex = -1;
|
||||
doctorList = null;
|
||||
_currentIndex = 1;
|
||||
changePageViewIndex(1);
|
||||
nearestAppointment = false;
|
||||
clinicId = -1;
|
||||
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 5.2,
|
||||
child: showProgress(
|
||||
title: TranslationBase.of(context).selectBranch,
|
||||
status: _currentIndex == 2
|
||||
? TranslationBase.of(context).inPrgress
|
||||
: _currentIndex > 1
|
||||
? TranslationBase.of(context).completed
|
||||
: TranslationBase.of(context).locked,
|
||||
color: _currentIndex == 2
|
||||
? CustomColors.orange
|
||||
: _currentIndex > 2
|
||||
? CustomColors.green
|
||||
: CustomColors.grey2,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
selectedHospitalIndex = -1;
|
||||
doctorList = null;
|
||||
_currentIndex = 2;
|
||||
changePageViewIndex(2);
|
||||
nearestAppointment = false;
|
||||
clinicId = -1;
|
||||
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 5.2,
|
||||
child: showProgress(
|
||||
title: TranslationBase.of(context).selectClinic,
|
||||
status: _currentIndex == 3
|
||||
? TranslationBase.of(context).inPrgress
|
||||
: _currentIndex > 3
|
||||
? TranslationBase.of(context).completed
|
||||
: TranslationBase.of(context).locked,
|
||||
color: _currentIndex == 3
|
||||
? CustomColors.orange
|
||||
: _currentIndex > 3
|
||||
? CustomColors.green
|
||||
: CustomColors.grey2,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
doctorList = null;
|
||||
changePageViewIndex(3);
|
||||
_currentIndex = 3;
|
||||
nearestAppointment= false;
|
||||
clinicId = -1;
|
||||
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 5.2,
|
||||
child: showProgress(
|
||||
title: TranslationBase.of(context).selectDoctor,
|
||||
status: _currentIndex ==
|
||||
((widget.isForHospital) ? 4 : 3)
|
||||
? TranslationBase.of(context).inPrgress
|
||||
: TranslationBase.of(context).locked,
|
||||
color: _currentIndex ==
|
||||
((widget.isForHospital) ? 4 : 3)
|
||||
? CustomColors.orange
|
||||
: _currentIndex ==
|
||||
((widget.isForHospital) ? 5 : 4)
|
||||
? CustomColors.green
|
||||
: CustomColors.grey2,
|
||||
isNeedBorder: false,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_currentIndex =
|
||||
((widget.isForHospital) ? 4 : 3);
|
||||
changePageViewIndex(_currentIndex);
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(10.0, 18, 0, 24),
|
||||
child: Row(
|
||||
children: [
|
||||
(_currentIndex != 0)
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
handleBackClick();
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0, 0, 04, 0),
|
||||
child: Icon(
|
||||
Icons.arrow_back,
|
||||
color: Theme.of(context).primaryColor,
|
||||
),
|
||||
),
|
||||
)
|
||||
: mWidth(24),
|
||||
Text(
|
||||
getTitle(),
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.black),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
// mHeight(24),
|
||||
Expanded(
|
||||
child: PageView(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
controller: _controller,
|
||||
onPageChanged: (index) {
|
||||
setState(() {
|
||||
_currentIndex = index;
|
||||
});
|
||||
},
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
ResultByRegion(
|
||||
doctorsList: widget.doctorsList,
|
||||
patientDoctorAppointmentListHospital:
|
||||
widget.patientDoctorAppointmentListHospital,
|
||||
onRegionSelected: (key) {
|
||||
setState(() {
|
||||
selectedRegion = key;
|
||||
_currentIndex = 1;
|
||||
changePageViewIndex(1);
|
||||
});
|
||||
}),
|
||||
(selectedRegion != "")
|
||||
? ResultByFacility(
|
||||
doctorsList: widget.doctorsList,
|
||||
patientDoctorAppointmentListHospital:
|
||||
widget.patientDoctorAppointmentListHospital,
|
||||
selectedRegion: selectedRegion,
|
||||
onFacilitySelected: (isHMCSelected) {
|
||||
setState(() {
|
||||
this.isHMCSelected = isHMCSelected;
|
||||
_currentIndex = 2;
|
||||
changePageViewIndex(2);
|
||||
});
|
||||
},
|
||||
)
|
||||
: SizedBox.shrink(),
|
||||
(selectedRegion != '')
|
||||
? ResultByHospital(
|
||||
doctorsList: widget.doctorsList,
|
||||
paitientDoctorAppointmentList: (isHMCSelected)
|
||||
? widget
|
||||
.patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap![selectedRegion]!
|
||||
.hmcDoctorList ??
|
||||
[]
|
||||
: widget
|
||||
.patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap?[selectedRegion]
|
||||
?.hmgDoctorList ??
|
||||
[],
|
||||
isHMCSelected: isHMCSelected,
|
||||
isLiveCareAppointment:
|
||||
widget.isLiveCareAppointment,
|
||||
isDoctorSearchResult: widget.isDoctorSearchResult,
|
||||
onHospitalSelected: (hospitalName, index) {
|
||||
setState(() {
|
||||
selectedHospitalIndex = index;
|
||||
selectedHospital = (!isHMCSelected)
|
||||
? widget
|
||||
.patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap![selectedRegion]!
|
||||
.hmgDoctorList![selectedHospitalIndex]
|
||||
.hospitalList
|
||||
.first
|
||||
: widget
|
||||
.patientDoctorAppointmentListHospital
|
||||
.registeredDoctorMap![selectedRegion]!
|
||||
.hmcDoctorList![selectedHospitalIndex]
|
||||
.hospitalList
|
||||
.first;
|
||||
_currentIndex = 3;
|
||||
changePageViewIndex(3);
|
||||
});
|
||||
})
|
||||
: SizedBox.shrink(),
|
||||
(selectedHospital != null &&
|
||||
selectedRegion != '' &&
|
||||
selectedHospitalIndex != -1)
|
||||
? ResultByClinic(
|
||||
onClinicSelected: (doctorList, clinicId) {
|
||||
setState(() {
|
||||
this.nearestAppointment = false;
|
||||
this.doctorList = doctorList;
|
||||
_currentIndex = 4;
|
||||
changePageViewIndex(4);
|
||||
if(clinicId != null)
|
||||
this.clinicId = clinicId;
|
||||
});
|
||||
},
|
||||
selectedValue: selectedHospital)
|
||||
: SizedBox.shrink(),
|
||||
(selectedRegion != '' &&
|
||||
selectedHospitalIndex != -1 &&
|
||||
doctorList != null)
|
||||
? ResultByDoctor(
|
||||
doctorsList: widget.doctorsList,
|
||||
patientDoctorAppointmentListHospital:
|
||||
(!isHMCSelected)
|
||||
? doctorList!
|
||||
.registeredDoctorMap![
|
||||
selectedRegion]!
|
||||
.hmgDoctorList!
|
||||
.first
|
||||
.patientDoctorAppointmentList ??
|
||||
[]
|
||||
: doctorList!
|
||||
.registeredDoctorMap?[
|
||||
selectedRegion]
|
||||
?.hmcDoctorList!
|
||||
.first
|
||||
.patientDoctorAppointmentList ??
|
||||
[],
|
||||
isLiveCareAppointment:
|
||||
widget.isLiveCareAppointment,
|
||||
isDoctorSearchResult: widget.isDoctorSearchResult,
|
||||
isObGyneAppointment: widget.isObGyneAppointment,
|
||||
isDoctorNameSearch: widget.isDoctorNameSearch,
|
||||
showNearestAppointment: clinicId != -1 ,
|
||||
nearestAppointmentDoctors: nearestAppointment,
|
||||
refreshDoctorList: (isNearestAppointmentChecked){
|
||||
setState(() {
|
||||
// changePageViewIndex(3);
|
||||
// _currentIndex = 3;
|
||||
nearestAppointment= false;
|
||||
});
|
||||
callDoctorsSearchAPI(clinicId, isNearestAppointmentChecked);
|
||||
},
|
||||
|
||||
)
|
||||
: SizedBox.shrink(),
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
)
|
||||
: getNoDataWidget(context),
|
||||
);
|
||||
}
|
||||
|
||||
callDoctorsSearchAPI(int clinicID, bool nearestAppointment) {
|
||||
var isArabic = context.read<ProjectViewModel>().isArabic;
|
||||
int languageID = isArabic ? 1 : 2;
|
||||
GifLoaderDialogUtils.showMyDialog(context);
|
||||
List<DoctorList> doctorsList = [];
|
||||
List<String> arr = [];
|
||||
List<String> arrDistance = [];
|
||||
List<String> result;
|
||||
int numAll;
|
||||
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = [];
|
||||
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
service
|
||||
.getDoctorsList(clinicID, selectedHospital?.mainProjectID.toString() != "" ? int.parse(selectedHospital?.mainProjectID.toString() ?? "-1") : 0, nearestAppointment, languageID, null)
|
||||
.then((res) async {
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
if (res['MessageStatus'] == 1) {
|
||||
RegionList regionHospitalList = RegionList();
|
||||
|
||||
if (res['DoctorList'].length != 0) {
|
||||
res['DoctorList'].forEach((v) {
|
||||
doctorsList.add(new DoctorList.fromJson(
|
||||
v,
|
||||
));
|
||||
});
|
||||
|
||||
regionHospitalList = await DoctorMapper.getMappedDoctor(doctorsList, isArabic: isArabic);
|
||||
var lat = await sharedPref.getDouble(USER_LAT);
|
||||
|
||||
var lng = await sharedPref.getDouble(USER_LONG);
|
||||
var isLocationEnabled = (lat != null && lat != 0.0) && (lng != null && lng != 0.0);
|
||||
regionHospitalList = await DoctorMapper.sortList(isLocationEnabled, regionHospitalList);
|
||||
|
||||
setState(() {
|
||||
this.doctorList = regionHospitalList;
|
||||
_currentIndex = 4;
|
||||
changePageViewIndex(4);
|
||||
this.nearestAppointment = nearestAppointment;
|
||||
});
|
||||
} else {
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
AppToast.showErrorToast(message: res['ErrorSearchMsg']);
|
||||
}
|
||||
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
// navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital);
|
||||
} else {
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
||||
}
|
||||
}).catchError((err) {
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
print(err);
|
||||
AppToast.showErrorToast(message: err, localContext: context);
|
||||
});
|
||||
}
|
||||
String getTitle() {
|
||||
switch (_currentIndex) {
|
||||
case 0:
|
||||
return TranslationBase.of(context).selectRegion;
|
||||
case 1:
|
||||
return TranslationBase.of(context).selectFacitlity;
|
||||
case 2:
|
||||
return TranslationBase.of(context).selectBranch;
|
||||
case 3:
|
||||
return TranslationBase.of(context).selectClinic;
|
||||
case 4:
|
||||
return TranslationBase.of(context).selectDoctor;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
Widget showProgress(
|
||||
{String? title,
|
||||
String? status,
|
||||
Color? color,
|
||||
bool isNeedBorder = true,
|
||||
Function()? onTap}) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
if (status == TranslationBase.of(context).completed) {
|
||||
onTap?.call();
|
||||
}
|
||||
},
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 26,
|
||||
height: 26,
|
||||
decoration: containerRadius(color!, 200),
|
||||
child: Icon(
|
||||
Icons.done,
|
||||
color: Colors.white,
|
||||
size: 16,
|
||||
),
|
||||
),
|
||||
if (isNeedBorder)
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: mDivider(Colors.grey),
|
||||
)),
|
||||
],
|
||||
),
|
||||
mHeight(8),
|
||||
Text(
|
||||
title!,
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.w500,
|
||||
letterSpacing: -0.44,
|
||||
),
|
||||
),
|
||||
mHeight(2),
|
||||
Container(
|
||||
padding: EdgeInsets.all(5),
|
||||
decoration: containerRadius(color!.withOpacity(0.2), 4),
|
||||
child: Text(
|
||||
status!,
|
||||
style: TextStyle(
|
||||
fontSize: 8,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.32,
|
||||
color: color,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class HospitalBodyWidget extends StatelessWidget {
|
||||
final List<PatientDoctorAppointmentList>?
|
||||
patientDoctorAppointmentListHospital;
|
||||
final bool isLiveCareAppointment;
|
||||
final bool isObGyneAppointment;
|
||||
final bool isDoctorNameSearch;
|
||||
final bool isDoctorSearchResult;
|
||||
final OBGyneProcedureListResponse? obGyneProcedureListResponse;
|
||||
|
||||
const HospitalBodyWidget({
|
||||
super.key,
|
||||
this.patientDoctorAppointmentListHospital,
|
||||
required this.isLiveCareAppointment,
|
||||
required this.isObGyneAppointment,
|
||||
required this.isDoctorNameSearch,
|
||||
required this.isDoctorSearchResult,
|
||||
this.obGyneProcedureListResponse,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView.separated(
|
||||
addAutomaticKeepAlives: true,
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
itemCount: patientDoctorAppointmentListHospital?.length ?? 0,
|
||||
separatorBuilder: (context, index) {
|
||||
return Container(
|
||||
height: 12,
|
||||
margin: EdgeInsets.only(left: 21, right: 21),
|
||||
);
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
return AppExpandableNotifier(
|
||||
applyBackgroundColor: false,
|
||||
widgetColor: CustomColors.appBackgroudGrey2Color,
|
||||
title: (patientDoctorAppointmentListHospital?[index].distanceInKMs !=
|
||||
"0")
|
||||
? patientDoctorAppointmentListHospital![index].filterName! +
|
||||
" - " +
|
||||
patientDoctorAppointmentListHospital![index].distanceInKMs! +
|
||||
" " +
|
||||
TranslationBase.of(context).km
|
||||
: patientDoctorAppointmentListHospital![index].filterName,
|
||||
projectTitleTop:
|
||||
patientDoctorAppointmentListHospital![index].projectTopName,
|
||||
projectTitleBottom: (patientDoctorAppointmentListHospital![index]
|
||||
.distanceInKMs !=
|
||||
"0")
|
||||
? patientDoctorAppointmentListHospital![index]
|
||||
.projectBottomName
|
||||
.toString() +
|
||||
" - " +
|
||||
patientDoctorAppointmentListHospital![index].distanceInKMs! +
|
||||
" " +
|
||||
TranslationBase.of(context).km
|
||||
: patientDoctorAppointmentListHospital![index]
|
||||
.projectBottomName
|
||||
.toString(),
|
||||
isTitleSingleLine: false,
|
||||
isDoctorSearchResult: isDoctorSearchResult,
|
||||
isExpand:
|
||||
patientDoctorAppointmentListHospital?.length == 1 ? true : false,
|
||||
bodyWidget: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
padding:
|
||||
EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21),
|
||||
itemBuilder: (context, _index) {
|
||||
// print("the index of patientDoctorAppointmentList is ${_index}");
|
||||
// print("the index of parent is ${index}");
|
||||
final doctor = patientDoctorAppointmentListHospital![index]
|
||||
.patientDoctorAppointmentList![_index];
|
||||
// print('the doctor is ${doctor.toJson()}');
|
||||
return DoctorView(
|
||||
doctor: doctor,
|
||||
isLiveCareAppointment: isLiveCareAppointment,
|
||||
isObGyneAppointment: isObGyneAppointment,
|
||||
isDoctorNameSearch: isDoctorNameSearch,
|
||||
obGyneProcedureListResponse: obGyneProcedureListResponse,
|
||||
isShowDate: false,
|
||||
onTap: () {
|
||||
context
|
||||
.read<ProjectViewModel>()
|
||||
.analytics
|
||||
.appointment
|
||||
.book_appointment_select_doctor(
|
||||
appointment_type: 'regular', doctor: doctor);
|
||||
});
|
||||
},
|
||||
separatorBuilder: (context, index) => SizedBox(height: 14),
|
||||
itemCount: patientDoctorAppointmentListHospital?[index]
|
||||
.patientDoctorAppointmentList
|
||||
?.length ??
|
||||
0),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class RegionTitle extends StatelessWidget {
|
||||
final String title;
|
||||
final String hmcCount;
|
||||
final String hmgCount;
|
||||
|
||||
const RegionTitle(
|
||||
{super.key,
|
||||
required this.title,
|
||||
required this.hmcCount,
|
||||
required this.hmgCount});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 22, color: Colors.black, fontWeight: FontWeight.w700),
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"${TranslationBase.of(context).HospitalString(num.parse(hmgCount)).replaceAll("@", hmgCount)} ,",
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Color(0xFFD02127),
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
Text(
|
||||
"${TranslationBase.of(context).MedicalCenterString(num.parse(hmcCount)).replaceAll("@", hmcCount)}",
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Color(0xFF40ACC9),
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class HospitalTitle extends StatelessWidget {
|
||||
final String title;
|
||||
final String iconUrl;
|
||||
final bool isHMC;
|
||||
final String itemCount;
|
||||
|
||||
const HospitalTitle(
|
||||
{super.key,
|
||||
required this.title,
|
||||
required this.iconUrl,
|
||||
required this.isHMC,
|
||||
required this.itemCount});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
SvgPicture.asset(iconUrl),
|
||||
SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: isHMC ? Color(0xFF40ACC9) : Color(0xFFD02127),
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 6,
|
||||
),
|
||||
Text(
|
||||
isHMC
|
||||
? "${TranslationBase.of(context).MedicalCenterString(num.parse(itemCount)).replaceAll("@", itemCount)}"
|
||||
: "${TranslationBase.of(context).HospitalString(num.parse(itemCount)).replaceAll("@", itemCount)}",
|
||||
style: TextStyle(
|
||||
fontSize: 12, color: Colors.black, fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
///todo the current content of the application
|
||||
/// return AppExpandableNotifier(
|
||||
// paddingValue: 10,
|
||||
// applyBackgroundToOnlyHeader: true,
|
||||
// completeHeaderColor: CustomColors.appBackgroudGrey2Color,
|
||||
// headerWidget: RegionTitle(
|
||||
// title: key,
|
||||
// hmcCount:
|
||||
// "${widget.patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmcSize ?? 0}",
|
||||
// hmgCount:
|
||||
// "${widget.patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmgSize ?? 0}",
|
||||
// ),
|
||||
// showDropDownIconWithCustomHeader: true,
|
||||
// isTitleSingleLine: false,
|
||||
// isDoctorSearchResult: widget.isDoctorSearchResult,
|
||||
// widgetColor: Color(0xFFF8F8F8),
|
||||
// bodyWidget: Column(
|
||||
// children: [
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.all(8.0),
|
||||
// child: AppExpandableNotifier(
|
||||
// paddingValue: 8,
|
||||
// applyBackgroundColor: false,
|
||||
// applyBackgroundToOnlyHeader: true,
|
||||
// completeHeaderColor: Colors.white,
|
||||
// headerRadius: BorderRadius.circular(16),
|
||||
// headerWidget: HospitalTitle(
|
||||
// iconUrl: 'assets/images/svg/HMG.svg',
|
||||
// title: TranslationBase.of(context).hmgHospital,
|
||||
// isHMC: false,
|
||||
// itemCount:
|
||||
// "${widget.patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmgSize ?? 0}",
|
||||
// ),
|
||||
// showDropDownIconWithCustomHeader: true,
|
||||
// bodyWidget: HospitalBodyWidget(
|
||||
// patientDoctorAppointmentListHospital:
|
||||
// widget.patientDoctorAppointmentListHospital
|
||||
// .registeredDoctorMap?[key]?.hmgDoctorList,
|
||||
// isLiveCareAppointment: widget.isLiveCareAppointment,
|
||||
// isObGyneAppointment: widget.isObGyneAppointment,
|
||||
// isDoctorNameSearch: widget.isDoctorNameSearch,
|
||||
// isDoctorSearchResult: widget.isDoctorSearchResult,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(
|
||||
// bottom: 8.0, left: 8, right: 8),
|
||||
// child: AppExpandableNotifier(
|
||||
// paddingValue: 8,
|
||||
// applyBackgroundColor: false,
|
||||
// applyBackgroundToOnlyHeader: true,
|
||||
// completeHeaderColor: Colors.white,
|
||||
// headerRadius: BorderRadius.circular(16),
|
||||
// headerWidget: HospitalTitle(
|
||||
// iconUrl: 'assets/images/svg/HMC.svg',
|
||||
// title: TranslationBase.of(context).hmcHospital,
|
||||
// isHMC: true,
|
||||
// itemCount:
|
||||
// "${widget.patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmcSize ?? 0}",
|
||||
// ),
|
||||
// showDropDownIconWithCustomHeader: true,
|
||||
// bodyWidget: HospitalBodyWidget(
|
||||
// patientDoctorAppointmentListHospital:
|
||||
// widget.patientDoctorAppointmentListHospital
|
||||
// .registeredDoctorMap?[key]?.hmcDoctorList,
|
||||
// isLiveCareAppointment: widget.isLiveCareAppointment,
|
||||
// isObGyneAppointment: widget.isObGyneAppointment,
|
||||
// isDoctorNameSearch: widget.isDoctorNameSearch,
|
||||
// isDoctorSearchResult: widget.isDoctorSearchResult,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ));
|
||||
@ -0,0 +1,462 @@
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class LiveCareUserAgreementPage extends StatefulWidget {
|
||||
const LiveCareUserAgreementPage({super.key});
|
||||
|
||||
@override
|
||||
State<LiveCareUserAgreementPage> createState() => _LiveCareUserAgreementPageState();
|
||||
}
|
||||
|
||||
class _LiveCareUserAgreementPageState extends State<LiveCareUserAgreementPage> {
|
||||
late ProjectViewModel projectViewModel;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
projectViewModel = Provider.of(context);
|
||||
return AppScaffold(
|
||||
isShowAppBar: true,
|
||||
showNewAppBarTitle: true,
|
||||
showNewAppBar: true,
|
||||
isShowDecPage: false,
|
||||
appBarTitle: TranslationBase.of(context).termsConditions,
|
||||
body: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsHeading,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsIntroHeading,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions1,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions2,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsHeading2,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions3,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions3a,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions3b,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions3c,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions3d,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions4,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions5,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions6,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsHeading3,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions7,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions8,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions9,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions10,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions11,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions12,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions13,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsHeading4,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions14,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions15,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions16,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsHeading5,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions17,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions18,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions19,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions19a,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions19b,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions19c,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions19d,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions19e,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions20,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsHeading6,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions21,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions22,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions23,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsHeading7,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions24,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions25,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions26,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions27,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions28,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions29,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions30,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsHeading8,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions31,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsHeading9,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions32,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions33,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions34,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions35,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsHeading10,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions36,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsHeading11,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions37,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions38,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsHeading12,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions39,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions40,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions41,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsHeading13,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions42,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsHeading14,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions43,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions43a,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions43b,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions43c,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions43d,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions43e,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions43f,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions43g,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsHeading15,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions44,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions45,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions46,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsHeading16,
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions47,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
Text(
|
||||
TranslationBase.of(context).liveCareTermsConditions48,
|
||||
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
|
||||
),
|
||||
mHeight(12.0),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,211 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
|
||||
class DoctorMapper{
|
||||
static Future<RegionList> getMappedDoctor(List<DoctorList> doctorList,
|
||||
{bool isArabic = false}) async {
|
||||
RegionList regionList = RegionList();
|
||||
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||
|
||||
for (var element in doctorList) {
|
||||
String? region = element.getRegionName(isArabic);
|
||||
if (region == null) continue;
|
||||
|
||||
var regionDoctorList = regionList.registeredDoctorMap?.putIfAbsent(region, () => PatientDoctorAppointmentListByRegion());
|
||||
|
||||
List<PatientDoctorAppointmentList>? targetList = element.isHMC == true
|
||||
? regionDoctorList?.hmcDoctorList
|
||||
: regionDoctorList?.hmgDoctorList;
|
||||
|
||||
var doctorByHospital = targetList
|
||||
?.where((clinic) =>
|
||||
clinic.filterName ==
|
||||
element.getProjectCompleteNameWithLocale(isArabic: isArabic))
|
||||
.toList() ??
|
||||
[];
|
||||
|
||||
if (doctorByHospital.isNotEmpty) {
|
||||
doctorByHospital.first.patientDoctorAppointmentList?.add(element);
|
||||
} else {
|
||||
var newAppointment = PatientDoctorAppointmentList(
|
||||
filterName:
|
||||
element.getProjectCompleteNameWithLocale(isArabic: isArabic),
|
||||
distanceInKMs: element.projectDistanceInKiloMeters.toString(),
|
||||
projectTopName: element.projectTopName,
|
||||
projectBottomName: element.projectBottomName,
|
||||
patientDoctorAppointment: element,
|
||||
);
|
||||
if(element.projectDistanceInKiloMeters!= null ){
|
||||
if(regionDoctorList!.distance>element.projectDistanceInKiloMeters){
|
||||
regionDoctorList!.distance = element.projectDistanceInKiloMeters;
|
||||
}
|
||||
if (element.isHMC == true &&
|
||||
element.projectDistanceInKiloMeters <
|
||||
regionDoctorList.hmcDistance)
|
||||
regionDoctorList.hmcDistance = element.projectDistanceInKiloMeters;
|
||||
else if (element.projectDistanceInKiloMeters <
|
||||
regionDoctorList.hmgDistance)
|
||||
regionDoctorList.hmgDistance = element.projectDistanceInKiloMeters;
|
||||
}else
|
||||
if (await sharedPref.getDouble(USER_LAT) != null && await sharedPref.getDouble(USER_LONG) != null && element.latitude != null && element.longitude != null) {
|
||||
var lat = await sharedPref.getDouble(USER_LAT);
|
||||
var long = await sharedPref.getDouble(USER_LONG);
|
||||
|
||||
double distance = calculateDistance(lat, long, double.parse(element.latitude!), double.parse(element.longitude!));
|
||||
if(distance<0){
|
||||
distance *= -1;
|
||||
}
|
||||
if(regionDoctorList!.distance>distance){
|
||||
regionDoctorList!.distance = distance;
|
||||
}
|
||||
if (element.isHMC == true &&
|
||||
element.projectDistanceInKiloMeters <
|
||||
regionDoctorList.hmcDistance)
|
||||
regionDoctorList.hmcDistance = element.projectDistanceInKiloMeters;
|
||||
else if (element.projectDistanceInKiloMeters <
|
||||
regionDoctorList.hmgDistance)
|
||||
regionDoctorList.hmgDistance = element.projectDistanceInKiloMeters;
|
||||
print("the distance is $distance");
|
||||
}
|
||||
targetList?.add(newAppointment);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
regionDoctorList?.hmcSize = regionDoctorList.hmcDoctorList?.length ?? 0;
|
||||
regionDoctorList?.hmgSize = regionDoctorList.hmgDoctorList?.length ?? 0;
|
||||
|
||||
regionList.registeredDoctorMap?[region] = regionDoctorList;
|
||||
}
|
||||
|
||||
return regionList;
|
||||
}
|
||||
static double calculateDistance(double lat1, double lon1, double lat2, double lon2) {
|
||||
var pi = 3.142;
|
||||
const double R = 6371;
|
||||
double dLat = (lat2 - lat1) * pi / 180;
|
||||
double dLon = (lon2 - lon1) * pi / 180;
|
||||
double a = sin(dLat / 2) * sin(dLat / 2) +
|
||||
cos(lat1 * pi / 180) * cos(lat2 * pi / 180) * sin(dLon / 2) * sin(dLon / 2);
|
||||
double c = 2 * atan2(sqrt(a), sqrt(1 - a));
|
||||
return R * c;
|
||||
}
|
||||
|
||||
static Future<RegionList> sortList(bool isGPSEnabled, RegionList unsorted, ) async {
|
||||
if(isGPSEnabled){
|
||||
if(unsorted.registeredDoctorMap == null) return unsorted;
|
||||
var sortedMap = Map.fromEntries(
|
||||
unsorted.registeredDoctorMap!.entries.toList()
|
||||
..sort((a, b) => a.value!.distance.compareTo(b.value!.distance)),
|
||||
);
|
||||
|
||||
unsorted.registeredDoctorMap = sortedMap;
|
||||
return unsorted;
|
||||
|
||||
}
|
||||
|
||||
List<String>? keys = unsorted.registeredDoctorMap?.keys.toList();
|
||||
keys?.sort();
|
||||
|
||||
if (keys == null) return unsorted;
|
||||
Map<String, PatientDoctorAppointmentListByRegion> sortedMap = {};
|
||||
for (var key in keys) {
|
||||
sortedMap[key] = unsorted.registeredDoctorMap![key]!;
|
||||
}
|
||||
unsorted.registeredDoctorMap = sortedMap;
|
||||
return unsorted;
|
||||
}
|
||||
|
||||
static Future<RegionList> getMappedHospitals(
|
||||
List<HospitalsModel> hospitalList, {
|
||||
bool isArabic = false,
|
||||
}) async {
|
||||
final regionList = RegionList();
|
||||
final sharedPref = AppSharedPreferences();
|
||||
|
||||
for (final hospital in hospitalList) {
|
||||
final region = hospital.getRegionName(isArabic);
|
||||
if (region == null) continue;
|
||||
|
||||
final regionData = regionList.registeredDoctorMap?.putIfAbsent(
|
||||
region,
|
||||
() => PatientDoctorAppointmentListByRegion(),
|
||||
);
|
||||
|
||||
List<PatientDoctorAppointmentList>? targetList = hospital.isHMC == true
|
||||
? regionData?.hmcDoctorList
|
||||
: regionData?.hmgDoctorList;
|
||||
|
||||
List<PatientDoctorAppointmentList> existingEntry = targetList
|
||||
?.where(
|
||||
(entry) => entry.filterName == hospital.getName(isArabic),
|
||||
)
|
||||
.toList() ??
|
||||
[];
|
||||
|
||||
if (existingEntry.isNotEmpty) {
|
||||
existingEntry.first.hospitalList.add(hospital);
|
||||
} else {
|
||||
final newEntry = PatientDoctorAppointmentList(
|
||||
filterName: hospital.name,
|
||||
distanceInKMs: hospital.distanceInKilometers?.toString(),
|
||||
projectTopName: hospital.name,
|
||||
projectBottomName: hospital.name,
|
||||
model: hospital);
|
||||
|
||||
final distance = hospital.distanceInKilometers;
|
||||
|
||||
if (distance != null) {
|
||||
if (regionData!.distance > distance) {
|
||||
regionData.distance = distance;
|
||||
}
|
||||
|
||||
if (hospital.isHMC == true && distance < regionData.hmcDistance) {
|
||||
regionData.hmcDistance = distance;
|
||||
} else if (distance < regionData.hmgDistance) {
|
||||
regionData.hmgDistance = distance;
|
||||
}
|
||||
} else if (await sharedPref.getDouble(USER_LAT) != null &&
|
||||
await sharedPref.getDouble(USER_LONG) != null &&
|
||||
hospital.latitude != null &&
|
||||
hospital.longitude != null) {
|
||||
final lat = await sharedPref.getDouble(USER_LAT);
|
||||
final long = await sharedPref.getDouble(USER_LONG);
|
||||
|
||||
double calculatedDistance = calculateDistance(
|
||||
lat,
|
||||
long,
|
||||
double.parse(hospital.latitude!),
|
||||
double.parse(hospital.longitude!),
|
||||
).abs();
|
||||
|
||||
if (regionData!.distance > calculatedDistance) {
|
||||
regionData.distance = calculatedDistance;
|
||||
}
|
||||
|
||||
if (hospital.isHMC == true &&
|
||||
calculatedDistance < regionData.hmcDistance) {
|
||||
regionData.hmcDistance = calculatedDistance;
|
||||
} else if (calculatedDistance < regionData.hmgDistance) {
|
||||
regionData.hmgDistance = calculatedDistance;
|
||||
}
|
||||
|
||||
print("Calculated distance: $calculatedDistance");
|
||||
}
|
||||
|
||||
targetList?.add(newEntry);
|
||||
}
|
||||
|
||||
regionData?.hmcSize = regionData.hmcDoctorList?.length ?? 0;
|
||||
regionData?.hmgSize = regionData.hmgDoctorList?.length ?? 0;
|
||||
regionList.registeredDoctorMap?[region] = regionData;
|
||||
}
|
||||
|
||||
return regionList;
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,100 @@
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/penguin_method_channel.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../pages/BookAppointment/Search.dart';
|
||||
import 'app-permissions.dart';
|
||||
|
||||
enum DeepLinkNavigation {
|
||||
APPOINTMENT("/appointment", false),
|
||||
LIVE_CARE("/livecare", true),
|
||||
NAVIGATE("/navigate", false);
|
||||
|
||||
final String name;
|
||||
final bool isLoginRequired;
|
||||
|
||||
const DeepLinkNavigation(this.name, this.isLoginRequired);
|
||||
}
|
||||
|
||||
class DeepLinkHandler {
|
||||
final projectID = "projectID";
|
||||
final clinicId = "clinicId";
|
||||
|
||||
DeepLinkNavigation? navigationType;
|
||||
Uri? uri;
|
||||
|
||||
DeepLinkHandler._();
|
||||
|
||||
static final DeepLinkHandler _instance = DeepLinkHandler._();
|
||||
|
||||
static DeepLinkHandler get instance => _instance;
|
||||
|
||||
void handleDeepLinkAndNavigation(
|
||||
NavigatorState? currentState, Uri uri, BuildContext context) async {
|
||||
var url = uri.toString().replaceFirst(
|
||||
"https://hmg.com/Pages/PageNotFoundError.aspx?requestUrl=", "");
|
||||
|
||||
uri = Uri.parse(url);
|
||||
this.uri = uri;
|
||||
print(
|
||||
"the uri contains ${uri.path.toLowerCase() == DeepLinkNavigation.NAVIGATE.name}");
|
||||
print("the uri.path ${uri.path}");
|
||||
if (uri.path.toLowerCase() == DeepLinkNavigation.NAVIGATE.name) {
|
||||
await Future.delayed(Duration(seconds: 1));
|
||||
navigationType = DeepLinkNavigation.NAVIGATE;
|
||||
var queryParam = uri.queryParameters;
|
||||
print("the query params are $queryParam");
|
||||
initPenguinSDK(
|
||||
queryParam[projectID] ?? "", queryParam[clinicId] ?? "", context);
|
||||
removeDeepLinkData();
|
||||
return;
|
||||
}
|
||||
if (uri.path.toLowerCase() == DeepLinkNavigation.APPOINTMENT.name) {
|
||||
navigationType = DeepLinkNavigation.NAVIGATE;
|
||||
currentState?.push(FadePage(page: Search()));
|
||||
removeDeepLinkData();
|
||||
return;
|
||||
}
|
||||
if (uri.path.toLowerCase() == DeepLinkNavigation.LIVE_CARE.name) {
|
||||
var viewModel = Provider.of(context);
|
||||
if (viewModel.isLogin) {
|
||||
currentState?.push(FadePage(page: Search()));
|
||||
removeDeepLinkData();
|
||||
return;
|
||||
} else {}
|
||||
}
|
||||
}
|
||||
|
||||
void removeDeepLinkData() {
|
||||
navigationType = null;
|
||||
uri = null;
|
||||
}
|
||||
|
||||
initPenguinSDK(
|
||||
String projectId, String clinicID, BuildContext context) async {
|
||||
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||
NavigationClinicDetails data = NavigationClinicDetails();
|
||||
data.clinicId = clinicID;
|
||||
|
||||
data.projectId = projectId;
|
||||
final bool permited = await AppPermission.askPenguinPermissions();
|
||||
if (!permited) {
|
||||
Map<Permission, PermissionStatus> statuses = await [
|
||||
Permission.location,
|
||||
Permission.bluetooth,
|
||||
Permission.bluetoothConnect,
|
||||
Permission.bluetoothScan,
|
||||
Permission.activityRecognition,
|
||||
].request().whenComplete(() async {
|
||||
final currentLanguage =
|
||||
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
|
||||
PenguinMethodChannel()
|
||||
.launch("penguin", currentLanguage, "null", details: data);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue