Compare commits
67 Commits
dev_3.16.3
...
dev_v3.13.
| Author | SHA1 | Date |
|---|---|---|
|
|
8e3f20794d | 1 year ago |
|
|
c1dae542c9 | 1 year ago |
|
|
220c954a4a | 1 year ago |
|
|
303e9114a3 | 1 year ago |
|
|
fff45cd3a8 | 1 year ago |
|
|
1ee86d0813 | 1 year ago |
|
|
0c3ef15895 | 1 year ago |
|
|
f7599a47e7 | 1 year ago |
|
|
a0528da4cd | 1 year ago |
|
|
cb68731679 | 1 year ago |
|
|
f56a1627db | 1 year ago |
|
|
260edfa303 | 1 year ago |
|
|
5fc939bf1e | 1 year ago |
|
|
f621f8c8d1 | 1 year ago |
|
|
f8a66a58f8 | 1 year ago |
|
|
57415bd670 | 1 year ago |
|
|
390455e5a2 | 1 year ago |
|
|
ec96fecf2f | 1 year ago |
|
|
bdcda02b26 | 1 year ago |
|
|
68eab7639c | 1 year ago |
|
|
cb7a444d83 | 1 year ago |
|
|
c1212c2c6a | 1 year ago |
|
|
4564b42018 | 1 year ago |
|
|
d921b1d081 | 1 year ago |
|
|
b308079255 | 1 year ago |
|
|
7a821a4604 | 1 year ago |
|
|
a2dd8f2e35 | 1 year ago |
|
|
4cde49cb51 | 1 year ago |
|
|
bbf18baade | 1 year ago |
|
|
2e9f6bcb51 | 1 year ago |
|
|
8d23ea6fda | 1 year ago |
|
|
9074bf2e65 | 1 year ago |
|
|
b46eb6214e | 1 year ago |
|
|
4b40d5d5a0 | 1 year ago |
|
|
5dbd97aa46 | 1 year ago |
|
|
556ff02e64 | 1 year ago |
|
|
e3b75b18c8 | 1 year ago |
|
|
cb8eb316ec | 1 year ago |
|
|
159135bb77 | 1 year ago |
|
|
88cd6f811a | 1 year ago |
|
|
ca965a6d06 | 1 year ago |
|
|
e6fcb1fddf | 1 year ago |
|
|
951a5a4932 | 1 year ago |
|
|
ae4c287af2 | 1 year ago |
|
|
8ffcebc44e | 1 year ago |
|
|
9590d268a0 | 1 year ago |
|
|
a1600dbfce | 1 year ago |
|
|
0dc32e061f | 1 year ago |
|
|
d865bd9c3b | 1 year ago |
|
|
e876eaaa33 | 1 year ago |
|
|
d4c741e1ec | 1 year ago |
|
|
e5198f093a | 1 year ago |
|
|
e2efc3749c | 1 year ago |
|
|
81ddb81b8e | 1 year ago |
|
|
08965c72c8 | 1 year ago |
|
|
6cf86e2e84 | 1 year ago |
|
|
06192292d0 | 2 years ago |
|
|
2a37777b9a | 2 years ago |
|
|
c2f38f1b7f | 2 years ago |
|
|
2ab0d0b682 | 2 years ago |
|
|
0221cb1250 | 2 years ago |
|
|
7cafe3aaa9 | 2 years ago |
|
|
11b83d1276 | 2 years ago |
|
|
f52aed49fd | 2 years ago |
|
|
c6787ff966 | 2 years ago |
|
|
615f3bfa8e | 2 years ago |
|
|
cd460ee31b | 2 years ago |
@ -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
|
||||||
@ -0,0 +1,81 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.cloud.diplomaticquarterapp.whatsapp;
|
||||||
|
|
||||||
|
import static java.sql.DriverManager.println;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.ContextWrapper;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.content.pm.Signature;
|
||||||
|
import android.util.Base64;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
public class AppSignatureRetriever {
|
||||||
|
|
||||||
|
private static final String HASH_TYPE = "SHA-256";
|
||||||
|
public static final int NUM_HASHED_BYTES = 9;
|
||||||
|
public static final int NUM_BASE64_CHAR = 11;
|
||||||
|
|
||||||
|
|
||||||
|
public void logSignatures(Context context) {
|
||||||
|
Collection<String> appSignatures = getAppSignatures(context);
|
||||||
|
appSignatures.forEach(signature -> println("Signature: " + signature));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all the app signatures for the current package.
|
||||||
|
*
|
||||||
|
* @return signatures for current app
|
||||||
|
*/
|
||||||
|
public Collection<String> getAppSignatures(Context context) {
|
||||||
|
try {
|
||||||
|
// Get all package signatures for the current package
|
||||||
|
String packageName = context.getPackageName();
|
||||||
|
println("Package name: " + packageName);
|
||||||
|
PackageManager packageManager = context.getPackageManager();
|
||||||
|
Signature[] signatures = packageManager.getPackageInfo(packageName,
|
||||||
|
PackageManager.GET_SIGNATURES).signatures;
|
||||||
|
|
||||||
|
// For each signature create a compatible hash
|
||||||
|
Collection<String> appCodes = Arrays.stream(signatures)
|
||||||
|
.map(signature -> hash(packageName, signature.toCharsString()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
return appCodes;
|
||||||
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
|
println("Unable to find package to obtain hash.");
|
||||||
|
throw new RuntimeException("Unable to find package to obtain hash.", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private String hash(String packageName, String signature) {
|
||||||
|
String appInfo = packageName + " " + signature;
|
||||||
|
try {
|
||||||
|
MessageDigest messageDigest = MessageDigest.getInstance(HASH_TYPE);
|
||||||
|
messageDigest.update(appInfo.getBytes(StandardCharsets.UTF_8));
|
||||||
|
byte[] hashSignature = messageDigest.digest();
|
||||||
|
|
||||||
|
// truncated into NUM_HASHED_BYTES
|
||||||
|
hashSignature = Arrays.copyOfRange(hashSignature, 0, NUM_HASHED_BYTES);
|
||||||
|
// encode into Base64
|
||||||
|
String base64Hash = Base64.encodeToString(hashSignature, Base64.NO_PADDING | Base64.NO_WRAP);
|
||||||
|
base64Hash = base64Hash.substring(0, NUM_BASE64_CHAR);
|
||||||
|
|
||||||
|
println(String.format("pkg: %s -- hash: %s", packageName, base64Hash));
|
||||||
|
return base64Hash;
|
||||||
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
throw new RuntimeException("Unable to generate hash for application", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
package com.cloud.diplomaticquarterapp.whatsapp
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import com.whatsapp.otp.android.sdk.WhatsAppOtpHandler
|
||||||
|
import com.whatsapp.otp.android.sdk.WhatsAppOtpIncomingIntentHandler
|
||||||
|
import java.lang.ref.WeakReference
|
||||||
|
|
||||||
|
object WhatsApp {
|
||||||
|
val whatsAppOtpHandler = WhatsAppOtpHandler()
|
||||||
|
inline fun handleOTP ( intent: Intent, crossinline validateOTP:(code: String )-> Unit) =
|
||||||
|
WhatsAppOtpIncomingIntentHandler().processOtpCode(
|
||||||
|
intent,
|
||||||
|
// call your function to validate
|
||||||
|
{code -> validateOTP(code) },
|
||||||
|
{error,exception->
|
||||||
|
println("the error is ${error.name}")
|
||||||
|
println("the exception stacktrace is ${exception.message}")
|
||||||
|
println("the exception is cause ${exception.cause}")
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
fun performHandShake(context : WeakReference<Context>) = whatsAppOtpHandler.sendOtpIntentToWhatsApp(context.get()!!)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
fun isWhatsAppInstalled(context : WeakReference<Context>) : Boolean = whatsAppOtpHandler.isWhatsAppInstalled(context.get()!!)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
package com.cloud.diplomaticquarterapp.whatsapp
|
||||||
|
import android.app.PendingIntent
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import com.cloud.diplomaticquarterapp.whatsapp.WhatsApp
|
||||||
|
import com.cloud.diplomaticquarterapp.whatsapp.WhatsAppOtpPlatformBridge
|
||||||
|
import io.flutter.embedding.android.FlutterFragmentActivity
|
||||||
|
|
||||||
|
class WhatsAppCodeActivity : FlutterFragmentActivity() {
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
WhatsApp.handleOTP(intent){code ->
|
||||||
|
WhatsAppOtpPlatformBridge.result?.success(code);
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
package com.cloud.diplomaticquarterapp.whatsapp
|
||||||
|
|
||||||
|
import com.ejada.hmg.MainActivity
|
||||||
|
import io.flutter.embedding.engine.FlutterEngine
|
||||||
|
import io.flutter.plugin.common.MethodCall
|
||||||
|
import io.flutter.plugin.common.MethodChannel
|
||||||
|
import java.lang.ref.WeakReference
|
||||||
|
|
||||||
|
class WhatsAppOtpPlatformBridge(
|
||||||
|
private var flutterEngine: FlutterEngine,
|
||||||
|
private var mainActivity: MainActivity
|
||||||
|
) {
|
||||||
|
|
||||||
|
|
||||||
|
private lateinit var channel: MethodChannel
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private const val CHANNEL = "whats_app_otp"
|
||||||
|
var result: MethodChannel.Result? = null
|
||||||
|
}
|
||||||
|
|
||||||
|
fun invoke() {
|
||||||
|
channel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL)
|
||||||
|
channel.setMethodCallHandler { call: MethodCall, result: MethodChannel.Result ->
|
||||||
|
when (call.method) {
|
||||||
|
"isWhatsAppInstalled" -> {
|
||||||
|
val isAppInstalled =
|
||||||
|
WhatsApp.isWhatsAppInstalled(WeakReference(mainActivity))
|
||||||
|
result.success(isAppInstalled)
|
||||||
|
}
|
||||||
|
|
||||||
|
"performHandShake" -> {
|
||||||
|
WhatsApp.performHandShake(WeakReference(mainActivity))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
"startListening" -> {
|
||||||
|
WhatsAppOtpPlatformBridge.result = result
|
||||||
|
}
|
||||||
|
|
||||||
|
else -> {
|
||||||
|
result.notImplemented()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/main"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context="com.cloud.diplomaticquarterapp.whatsapp.WhatsAppCodeActivity">
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@ -1,23 +1,23 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">HMG Patient App</string>
|
<string name="app_name">HMG Patient App</string>
|
||||||
|
|
||||||
<string name="geofence_unknown_error">
|
<string name="geofence_unknown_error">
|
||||||
Unknown error: the Geofence service is not available now.
|
Unknown error: the Geofence service is not available now.
|
||||||
</string>
|
</string>
|
||||||
<string name="geofence_not_available">
|
<string name="geofence_not_available">
|
||||||
Geofence service is not available now. Go to Settings>Location>Mode and choose High accuracy.
|
Geofence service is not available now. Go to Settings>Location>Mode and choose High accuracy.
|
||||||
</string>
|
</string>
|
||||||
<string name="geofence_too_many_geofences">
|
<string name="geofence_too_many_geofences">
|
||||||
Your app has registered too many geofences.
|
Your app has registered too many geofences.
|
||||||
</string>
|
</string>
|
||||||
<string name="geofence_too_many_pending_intents">
|
<string name="geofence_too_many_pending_intents">
|
||||||
You have provided too many PendingIntents to the addGeofences() call.
|
You have provided too many PendingIntents to the addGeofences() call.
|
||||||
</string>
|
</string>
|
||||||
<string name="GEOFENCE_INSUFFICIENT_LOCATION_PERMISSION">
|
<string name="GEOFENCE_INSUFFICIENT_LOCATION_PERMISSION">
|
||||||
App do not have permission to access location service.
|
App do not have permission to access location service.
|
||||||
</string>
|
</string>
|
||||||
<string name="GEOFENCE_REQUEST_TOO_FREQUENT">
|
<string name="GEOFENCE_REQUEST_TOO_FREQUENT">
|
||||||
Geofence requests happened too frequently.
|
Geofence requests happened too frequently.
|
||||||
</string>
|
</string>
|
||||||
<string name="mapbox_access_token" translatable="false">sk.eyJ1IjoicndhaWQiLCJhIjoiY2x6NWo0bTMzMWZodzJrcGZpemYzc3Z4dSJ9.uSSZuwNSGCcCdPAiORECmg</string>
|
<string name="mapbox_access_token" translatable="false">sk.eyJ1IjoicndhaWQiLCJhIjoiY2x6NWo0bTMzMWZodzJrcGZpemYzc3Z4dSJ9.uSSZuwNSGCcCdPAiORECmg</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@ -0,0 +1,9 @@
|
|||||||
|
<svg id="route" xmlns="http://www.w3.org/2000/svg" width="27.521" height="27.521" viewBox="0 0 27.521 27.521">
|
||||||
|
<path id="Path_5246" data-name="Path 5246" d="M365.087,11.9a.806.806,0,0,0,1.457,0l2.916-6.138a4.034,4.034,0,1,0-7.288,0Zm.728-8.678a.806.806,0,1,1-.806.806A.806.806,0,0,1,365.815,3.225Z" transform="translate(-342.332)" fill="#28323a"/>
|
||||||
|
<ellipse id="Ellipse_225" data-name="Ellipse 225" cx="1.5" cy="1" rx="1.5" ry="1" transform="translate(14 21.522)" fill="#28323a"/>
|
||||||
|
<path id="Path_5247" data-name="Path 5247" d="M175.628,205.644a2.016,2.016,0,0,1,0-4.031h8.315L183.177,200h-7.549a3.628,3.628,0,0,0,0,7.257h4.537a3.235,3.235,0,0,1,0-1.613Z" transform="translate(-162.754 -189.249)" fill="#28323a"/>
|
||||||
|
<circle id="Ellipse_226" data-name="Ellipse 226" cx="1.5" cy="1.5" r="1.5" transform="translate(19 15.522)" fill="#28323a"/>
|
||||||
|
<path id="Path_5248" data-name="Path 5248" d="M350.39,305h-.183a3.236,3.236,0,0,1,0,1.613h.183a2.069,2.069,0,0,1,0,4.139H345.1a3.236,3.236,0,0,1,0,1.613h5.289a3.682,3.682,0,0,0,0-7.364Z" transform="translate(-326.551 -288.605)" fill="#28323a"/>
|
||||||
|
<path id="Path_5249" data-name="Path 5249" d="M167.02,412l.706,1.613h2.621a3.235,3.235,0,0,1,0-1.613Z" transform="translate(-158.042 -389.854)" fill="#28323a"/>
|
||||||
|
<path id="Path_5250" data-name="Path 5250" d="M5.311,322.415a.806.806,0,0,0-1.477,0l-3.763,8.6a.806.806,0,0,0,1.139,1.023l3.363-1.922,3.363,1.922a.806.806,0,0,0,1.139-1.023Z" transform="translate(0 -304.627)" fill="#28323a"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1,3 @@
|
|||||||
|
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M27.2568 32L25.1631 30.6091C27.9468 26.2666 29.4463 21.2154 29.4998 15.9999C29.4463 10.7844 27.9468 5.73315 25.1631 1.39067L27.2568 0C30.304 4.75302 31.9441 10.2814 31.9998 15.9875L32 16.0001L31.9998 16.0128C31.9441 21.7186 30.304 27.247 27.2568 32ZM25.0625 16.0165L25.0627 15.9999L25.0625 15.983C25.0051 11.5525 23.6995 7.27342 21.2869 3.60788L19.2097 5.02439C21.3494 8.27467 22.5085 12.0694 22.5625 15.9999C22.5085 19.9301 21.3494 23.7248 19.2097 26.9751L21.2869 28.3916C23.6995 24.7263 25.0051 20.447 25.0625 16.0165ZM16.7007 22.9666C17.719 20.7477 18.2334 18.3302 18.188 15.9748C18.1284 12.8761 17.1565 9.86638 15.3779 7.27168L13.3276 8.72795C14.822 10.9081 15.6384 13.4313 15.6885 16.0247C15.7163 17.4783 15.4875 18.9644 15.0205 20.3943L1.56543 9.86414L0.925293 11.3547C0.887451 11.4427 0 13.5424 0 16.4452C0 19.4569 1.69165 22.1483 1.76367 22.2614L3.86157 20.8772C3.8479 20.8558 2.5 18.6766 2.5 16.4452C2.5 15.5068 2.61401 14.6693 2.75073 14.0018L16.0413 24.4033L16.7007 22.9666Z" fill="#2E303A"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1124.14 1256.39">
|
||||||
|
<defs>
|
||||||
|
<style>
|
||||||
|
.cls-1 {
|
||||||
|
fill: #231f20;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</defs>
|
||||||
|
<path class="cls-1" d="M699.62,1113.02h0c-20.06,44.48-33.32,92.75-38.4,143.37l424.51-90.24c20.06-44.47,33.31-92.75,38.4-143.37l-424.51,90.24Z"/>
|
||||||
|
<path class="cls-1" d="M1085.73,895.8c20.06-44.47,33.32-92.75,38.4-143.37l-330.68,70.33v-135.2l292.27-62.11c20.06-44.47,33.32-92.75,38.4-143.37l-330.68,70.27V66.13c-50.67,28.45-95.67,66.32-132.25,110.99v403.35l-132.25,28.11V0c-50.67,28.44-95.67,66.32-132.25,110.99v525.69l-295.91,62.88c-20.06,44.47-33.33,92.75-38.42,143.37l334.33-71.05v170.26l-358.3,76.14c-20.06,44.47-33.32,92.75-38.4,143.37l375.04-79.7c30.53-6.35,56.77-24.4,73.83-49.24l68.78-101.97v-.02c7.14-10.55,11.3-23.27,11.3-36.97v-149.98l132.25-28.11v270.4l424.53-90.28Z"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 923 B |
@ -0,0 +1,5 @@
|
|||||||
|
<svg id="Download" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path
|
||||||
|
class="color000000 svgShape"
|
||||||
|
d="M1344 1344q0-26-19-45t-45-19-45 19-19 45 19 45 45 19 45-19 19-45zm256 0q0-26-19-45t-45-19-45 19-19 45 19 45 45 19 45-19 19-45zm128-224v320q0 40-28 68t-68 28H160q-40 0-68-28t-28-68v-320q0-40 28-68t68-28h465l135 136q58 56 136 56t136-56l136-136h464q40 0 68 28t28 68zm-325-569q17 41-14 70l-448 448q-18 19-45 19t-45-19L403 621q-31-29-14-70 17-39 59-39h256V64q0-26 19-45t45-19h256q26 0 45 19t19 45v448h256q42 0 59 39z" fill="#ffffff"></path>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 585 B |
@ -0,0 +1,3 @@
|
|||||||
|
<svg width="22" height="29" viewBox="0 0 22 29" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M15.5498 11.4402C17.4647 9.69433 20.0542 7.33316 20.2903 1.69231H22V0H0V1.69231H1.70974C1.94576 7.33316 4.53533 9.69433 6.45023 11.4402C7.73475 12.6113 8.46154 13.3281 8.46154 14.441C8.46154 15.5539 7.73475 16.2707 6.45023 17.4419C4.53533 19.1877 1.94576 21.5489 1.70974 27.1897H0V28.8821H22V27.1897H20.2903C20.0542 21.5489 17.4647 19.1877 15.5498 17.4419C14.2653 16.2707 13.5385 15.5539 13.5385 14.441C13.5385 13.3281 14.2653 12.6113 15.5498 11.4402ZM10.1538 20.7837C9.8925 20.8376 9.63431 20.9161 9.38232 21.0203L4.19952 23.165C5.0459 21.0129 6.40911 19.7695 7.5904 18.6925C8.9087 17.4906 10.1538 16.3553 10.1538 14.441V20.7837ZM14.4096 18.6925C15.5909 19.7695 16.954 21.0129 17.8005 23.1649L12.6177 21.0203C12.3657 20.916 12.1075 20.8376 11.8462 20.7836V14.441C11.8462 16.3553 13.0913 17.4906 14.4096 18.6925ZM4.16979 5.64103C3.76065 4.57493 3.47809 3.2877 3.40413 1.69231H18.5958C18.5219 3.2877 18.2394 4.57493 17.8302 5.64103H4.16979Z" fill="#2E303A"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.0 KiB |
@ -0,0 +1,11 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="31" height="31" viewBox="0 0 31 31">
|
||||||
|
<g id="route" transform="translate(0 0)">
|
||||||
|
<path id="Path_5246" data-name="Path 5246" d="M365.505,13.407a.908.908,0,0,0,1.641,0l3.284-6.914a4.544,4.544,0,1,0-8.209,0Zm.82-9.774a.908.908,0,1,1-.908.908A.908.908,0,0,1,366.326,3.633Z" transform="translate(-339.874)" fill="#da4a54"/>
|
||||||
|
<circle id="Ellipse_225" data-name="Ellipse 225" cx="1.5" cy="1.5" r="1.5" transform="translate(16 24)" fill="#2e303a"/>
|
||||||
|
<path id="Path_5247" data-name="Path 5247" d="M176.087,206.357a2.27,2.27,0,0,1,0-4.541h9.366L184.59,200h-8.5a4.087,4.087,0,0,0,0,8.174h5.11a3.644,3.644,0,0,1,0-1.816Z" transform="translate(-161.586 -187.891)" fill="#2e303a"/>
|
||||||
|
<circle id="Ellipse_226" data-name="Ellipse 226" cx="2" cy="2" r="2" transform="translate(21 17)" fill="#2e303a"/>
|
||||||
|
<path id="Path_5248" data-name="Path 5248" d="M351.059,305h-.206a3.644,3.644,0,0,1,0,1.816h.206a2.331,2.331,0,0,1,0,4.662H345.1a3.645,3.645,0,0,1,0,1.816h5.958a4.147,4.147,0,0,0,0-8.295Z" transform="translate(-324.206 -286.533)" fill="#2e303a"/>
|
||||||
|
<path id="Path_5249" data-name="Path 5249" d="M167.02,412l.795,1.816h2.952a3.644,3.644,0,0,1,0-1.816Z" transform="translate(-156.907 -387.055)" fill="#2e303a"/>
|
||||||
|
<path id="Path_5250" data-name="Path 5250" d="M5.982,322.476a.908.908,0,0,0-1.664,0L.08,332.164a.908.908,0,0,0,1.283,1.153l3.788-2.164,3.788,2.164a.908.908,0,0,0,1.283-1.153Z" transform="translate(0 -302.44)" fill="#2e303a"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1,3 @@
|
|||||||
|
<svg width="23" height="29" viewBox="0 0 23 29" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M19.2821 9.01172C18.9238 9.01172 18.5814 9.08629 18.2671 9.22183C17.9481 7.9542 16.8772 7.01953 15.6088 7.01953C14.9039 7.01953 14.2599 7.3082 13.7722 7.78227C13.2844 7.3082 12.6405 7.01953 11.9356 7.01953C11.6137 7.01953 11.3046 7.0797 11.0173 7.1902V3.96484C11.0173 2.31711 9.78138 0.976562 8.2623 0.976562C6.74323 0.976562 5.50736 2.31711 5.50736 3.96484V12.7547C5.06406 12.2739 4.70028 11.8793 4.70028 11.8793C3.68187 10.7746 2.03312 10.7115 0.9489 11.7334C-0.14065 12.7546 -0.316355 14.5345 0.548882 15.7856C0.558678 15.7998 0.568841 15.8136 0.57937 15.8272L4.66385 21.1185C5.1074 21.6931 5.74741 22.0491 6.31205 22.3632C6.72296 22.5918 7.34399 22.9373 7.34399 23.1565V26.0117C7.34399 27.6595 8.57986 29 10.0989 29H17.4455C18.9645 29 20.2004 27.6595 20.2004 26.0117V23.9531C20.2004 23.5591 20.5492 23.0843 20.9185 22.5818C21.4428 21.8683 22.037 21.0596 22.037 19.9688V12C22.037 10.3523 20.8012 9.01172 19.2821 9.01172ZM19.4823 21.3401C18.958 22.0536 18.3638 22.8623 18.3638 23.9531V26.0117C18.3638 26.561 17.9518 27.0078 17.4455 27.0078H10.0989C9.59258 27.0078 9.18062 26.561 9.18062 26.0117V23.1564C9.18062 21.72 8.00707 21.0672 7.1501 20.5904C6.72064 20.3515 6.2766 20.1046 6.072 19.8395L2.006 14.572C1.73131 14.1561 1.79259 13.5755 2.15165 13.2389C2.51304 12.8982 3.06213 12.9197 3.4016 13.2879C3.4016 13.2879 5.62662 15.7015 5.77685 15.8641C6.35294 16.4878 7.34393 16.0456 7.34393 15.1591V3.96484C7.34393 3.4156 7.75588 2.96875 8.26224 2.96875C8.7686 2.96875 9.18056 3.4156 9.18056 3.96484V12C9.18056 12.5501 9.59172 12.9961 10.0989 12.9961C10.606 12.9961 11.0172 12.5501 11.0172 12V10.0078C11.0172 9.45857 11.4291 9.01172 11.9355 9.01172C12.4419 9.01172 12.8538 9.45857 12.8538 10.0078V12C12.8538 12.5501 13.265 12.9961 13.7721 12.9961C14.2793 12.9961 14.6905 12.5501 14.6905 12V10.0078C14.6905 9.45857 15.1024 9.01172 15.6088 9.01172C16.1151 9.01172 16.5271 9.45857 16.5271 10.0078V12C16.5271 12.5501 16.9382 12.9961 17.4454 12.9961C17.9526 12.9961 18.3637 12.5501 18.3637 12C18.3637 11.4508 18.7757 11.0039 19.282 11.0039C19.7884 11.0039 20.2003 11.4508 20.2003 12V19.9688H20.2004C20.2004 20.3628 19.8516 20.8375 19.4823 21.3401Z" fill="#2E303A"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.2 KiB |
@ -0,0 +1,6 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="31" height="31" viewBox="0 0 31 31">
|
||||||
|
<g id="Group_8325" data-name="Group 8325" transform="translate(-75 -236)">
|
||||||
|
<circle id="Ellipse_223" data-name="Ellipse 223" cx="15.5" cy="15.5" r="15.5" transform="translate(75 236)" fill="#359846"/>
|
||||||
|
<path id="hour-glass" d="M8.73,10.811a1.46,1.46,0,0,0,0-2.122L8.647,8.61C7.085,7.119,5.878,5.968,5.515,3.556A1.413,1.413,0,0,1,6.992,2h7.091A1.413,1.413,0,0,1,15.56,3.556C15.2,5.968,13.99,7.119,12.429,8.61l-.083.079a1.46,1.46,0,0,0,0,2.122l.083.079c1.562,1.491,2.768,2.642,3.132,5.054A1.413,1.413,0,0,1,14.083,17.5H6.992a1.413,1.413,0,0,1-1.477-1.556c.364-2.412,1.57-3.563,3.132-5.054Zm.529,1.316-.006,0c-1.19,1.064-2.076,1.856-2.191,3.816a.363.363,0,0,0,.13.3.382.382,0,0,0,.247.09h6.194a.382.382,0,0,0,.282-.122.361.361,0,0,0,.1-.268c-.115-1.959-1-2.752-2.191-3.816-.315-.281-.651-.582-1-.928a.4.4,0,0,0-.569,0c-.347.344-.681.643-.993.923Z" transform="translate(80.35 241.75)" fill="#fff" fill-rule="evenodd"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1021 B |
@ -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/TermsConditionsViewModel.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
import 'package:diplomaticquarterapp/pages/base/base_view.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/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:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_html/flutter_html.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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
projectViewModel = Provider.of(context);
|
||||||
return BaseView<TermsConditionsViewModel>(
|
return BaseView<TermsConditionsViewModel>(
|
||||||
onModelReady: (model) => model.getUserTermsAndConditions(),
|
onModelReady: (model) => model.getUserTermsAndConditions(),
|
||||||
builder: (_, model, w) => AppScaffold(
|
builder: (_, model, w) => AppScaffold(
|
||||||
isShowAppBar: true,
|
isShowAppBar: true,
|
||||||
showNewAppBarTitle: true,
|
showNewAppBarTitle: true,
|
||||||
showNewAppBar: true,
|
showNewAppBar: true,
|
||||||
isShowDecPage: false,
|
isShowDecPage: false,
|
||||||
appBarTitle: TranslationBase.of(context).userAgreement,
|
appBarTitle: TranslationBase.of(context).termsConditions,
|
||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
child: Html(
|
child: Padding(
|
||||||
data: model.userAgreementContent,
|
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,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ));
|
||||||