Merge remote-tracking branch 'refs/remotes/origin/master' into fatima

fatima
Fatimah.Alshammari 2 months ago
commit cb56503622

@ -0,0 +1 @@
{"nm":"Comp 1","ddd":0,"h":100,"w":100,"meta":{"g":"@lottiefiles/toolkit-js 0.33.2"},"layers":[{"ty":4,"nm":"Shape Layer 2","sr":1,"st":0,"op":300,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[5.277,-32.723,0],"ix":1},"s":{"a":0,"k":[4.91,4.91,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[50.2,50.18,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 2","ix":1,"cix":2,"np":3,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"s":{"a":0,"k":[102.555,102.555],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.0941,0.7608,0.451],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[3.277,-34.527],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":2,"cix":2,"np":3,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"s":{"a":0,"k":[102.555,102.555],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.0941,0.7608,0.451],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[100,100],"t":0},{"s":[295,295],"t":60}],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[3.277,-34.527],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[100],"t":0},{"s":[0],"t":60}],"ix":7}}]}],"ind":1}],"v":"5.5.7","fr":60,"op":61,"ip":0,"assets":[]}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

@ -0,0 +1,3 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.9375 9C0.9375 13.4528 4.54725 17.0625 9 17.0625C13.4528 17.0625 17.0625 13.4528 17.0625 9C17.0625 4.54725 13.4528 0.9375 9 0.9375C4.54725 0.9375 0.9375 4.54725 0.9375 9ZM12.507 6.19724C12.8123 6.47699 12.8325 6.95173 12.5528 7.25698L8.42776 11.757C8.28976 11.9077 8.0955 11.9955 7.8915 12C7.68675 12.0045 7.4895 11.925 7.34475 11.7803L5.46975 9.90527C5.1765 9.61277 5.1765 9.13723 5.46975 8.84473C5.76225 8.55148 6.23776 8.55148 6.53026 8.84473L7.85175 10.1655L11.4472 6.24302C11.727 5.93777 12.2018 5.91749 12.507 6.19724Z" fill="#8F9AA3"/>
</svg>

After

Width:  |  Height:  |  Size: 697 B

@ -0,0 +1,3 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.04288 1.3125C10.6859 1.31249 11.9764 1.31248 12.984 1.44795C14.0165 1.58676 14.8357 1.87704 15.4793 2.52069C16.123 3.16433 16.4132 3.98352 16.5521 5.01602C16.6875 6.02358 16.6875 7.31408 16.6875 8.9571V9.04288C16.6875 10.6859 16.6875 11.9764 16.5521 12.984C16.4132 14.0165 16.123 14.8357 15.4793 15.4793C14.8357 16.123 14.0165 16.4132 12.984 16.5521C11.9764 16.6875 10.6859 16.6875 9.0429 16.6875H8.95712C7.3141 16.6875 6.02358 16.6875 5.01602 16.5521C3.98352 16.4132 3.16433 16.123 2.52068 15.4793C1.87704 14.8357 1.58676 14.0165 1.44795 12.984C1.31248 11.9764 1.31249 10.6859 1.3125 9.04288V8.95712C1.31249 7.31409 1.31248 6.02358 1.44795 5.01602C1.58676 3.98352 1.87704 3.16433 2.52068 2.52069C3.16433 1.87704 3.98352 1.58676 5.01602 1.44795C6.02358 1.31248 7.31409 1.31249 8.95712 1.3125H9.04288ZM8.25 12.375C8.25 11.9608 8.58428 11.625 8.99665 11.625H9.00335C9.41571 11.625 9.75 11.9608 9.75 12.375C9.75 12.7892 9.41571 13.125 9.00335 13.125H8.99665C8.58428 13.125 8.25 12.7892 8.25 12.375ZM8.25009 9.375C8.25009 9.78921 8.58588 10.125 9.00009 10.125C9.4143 10.125 9.75009 9.78921 9.75009 9.375V6.375C9.75009 5.96079 9.4143 5.625 9.00009 5.625C8.58588 5.625 8.25009 5.96079 8.25009 6.375V9.375Z" fill="#ED1C2B"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -0,0 +1,3 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.41841 13.0471C6.53944 12.9557 6.90075 12.6828 7.10903 12.5202C7.52619 12.1947 8.08051 11.7498 8.63318 11.27C9.18864 10.7877 9.72961 10.2811 10.1273 9.83098C10.3267 9.6053 10.4782 9.40705 10.5769 9.24345C10.6696 9.08959 10.6889 8.9987 10.6889 8.9987C10.6889 8.9987 10.6696 8.91048 10.5769 8.75662C10.4782 8.59303 10.3267 8.39477 10.1273 8.16909C9.72961 7.71901 9.18864 7.21237 8.63317 6.73009C8.08049 6.25024 7.52617 5.80541 7.10901 5.47985C6.90072 5.31731 6.53992 5.04475 6.41889 4.95334C6.16875 4.76911 6.1148 4.41661 6.29902 4.16647C6.48325 3.91633 6.83537 3.86289 7.08551 4.04711L7.08742 4.04855C7.21436 4.14443 7.58862 4.42711 7.80114 4.59296C8.22772 4.92586 8.7984 5.38369 9.37073 5.8806C9.94026 6.37509 10.5243 6.91935 10.9704 7.42418C11.1928 7.67596 11.3929 7.93118 11.5403 8.1758C11.6785 8.40499 11.8144 8.69516 11.8144 9.00004C11.8144 9.30492 11.6785 9.59509 11.5403 9.82427C11.3929 10.0689 11.1928 10.3241 10.9704 10.5759C10.5243 11.0807 9.94027 11.625 9.37074 12.1195C8.79842 12.6164 8.22775 13.0742 7.80117 13.4071C7.5885 13.5731 7.21423 13.8558 7.08755 13.9515L7.08591 13.9527C6.83577 14.1369 6.48329 14.0837 6.29906 13.8336C6.11484 13.5835 6.16829 13.2313 6.41841 13.0471Z" fill="#161616"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 1.25C6.06294 1.25 1.25 6.06294 1.25 12C1.25 17.9371 6.06294 22.75 12 22.75C17.9371 22.75 22.75 17.9371 22.75 12C22.75 6.06294 17.9371 1.25 12 1.25ZM9.20711 7.79289C8.81658 7.40237 8.18342 7.40237 7.79289 7.79289C7.40237 8.18342 7.40237 8.81658 7.79289 9.20711L10.5858 12L7.79289 14.7929C7.40237 15.1834 7.40237 15.8166 7.79289 16.2071C8.18342 16.5976 8.81658 16.5976 9.20711 16.2071L12 13.4142L14.7929 16.2071C15.1834 16.5976 15.8166 16.5976 16.2071 16.2071C16.5976 15.8166 16.5976 15.1834 16.2071 14.7929L13.4142 12L16.2071 9.20711C16.5976 8.81658 16.5976 8.18342 16.2071 7.79289C15.8166 7.40237 15.1834 7.40237 14.7929 7.79289L12 10.5858L9.20711 7.79289Z" fill="#8F9AA3"/>
</svg>

After

Width:  |  Height:  |  Size: 835 B

@ -0,0 +1,3 @@
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M11 0.25C5.06294 0.25 0.25 5.06294 0.25 11C0.25 16.9371 5.06294 21.75 11 21.75C16.9371 21.75 21.75 16.9371 21.75 11C21.75 5.06294 16.9371 0.25 11 0.25ZM7 10C6.44772 10 6 10.4477 6 11C6 11.5523 6.44772 12 7 12H15C15.5523 12 16 11.5523 16 11C16 10.4477 15.5523 10 15 10H7Z" fill="#ED1C2B"/>
</svg>

After

Width:  |  Height:  |  Size: 441 B

@ -0,0 +1,5 @@
<svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 2.75H11.9278C9.92082 2.74998 8.31557 2.74996 7.0558 2.91933C5.75291 3.0945 4.67453 3.46676 3.82064 4.32064C2.96676 5.17453 2.5945 6.25291 2.41933 7.5558C2.24996 8.81557 2.24998 10.4208 2.25 12.4278V12.5722C2.24998 14.5792 2.24996 16.1844 2.41933 17.4442C2.5945 18.7471 2.96676 19.8255 3.82064 20.6794C4.67453 21.5332 5.75291 21.9055 7.0558 22.0807C8.31558 22.25 9.92083 22.25 11.9278 22.25H12.0722C14.0792 22.25 15.6844 22.25 16.9442 22.0807C18.2471 21.9055 19.3255 21.5332 20.1794 20.6794C21.0332 19.8255 21.4055 18.7471 21.5807 17.4442C21.75 16.1844 21.75 14.5792 21.75 12.5722V12.5C21.75 11.9615 21.3135 11.525 20.775 11.525C20.2365 11.525 19.8 11.9615 19.8 12.5C19.8 14.5959 19.7979 16.0697 19.6481 17.1844C19.502 18.271 19.2317 18.8693 18.8005 19.3005C18.3693 19.7317 17.771 20.002 16.6844 20.1481C15.5697 20.2979 14.0959 20.3 12 20.3C9.90415 20.3 8.43035 20.2979 7.31564 20.1481C6.22898 20.002 5.63068 19.7317 5.1995 19.3005C4.76831 18.8693 4.49804 18.271 4.35194 17.1844C4.20207 16.0697 4.2 14.5959 4.2 12.5C4.2 10.4042 4.20207 8.93035 4.35194 7.81564C4.49804 6.72898 4.76831 6.13068 5.1995 5.6995C5.63068 5.26831 6.22898 4.99804 7.31564 4.85194C8.43035 4.70207 9.90415 4.7 12 4.7C12.5385 4.7 12.975 4.26348 12.975 3.725C12.975 3.18652 12.5385 2.75 12 2.75Z" fill="#2E3039"/>
<path d="M17.0855 3.5503C18.1526 2.48323 19.8827 2.48323 20.9497 3.5503C22.0168 4.61736 22.0168 6.34742 20.9497 7.41448L20.078 8.28615L16.2139 4.42188L17.0855 3.5503Z" fill="#2E3039"/>
<path d="M15.1533 5.48254L19.0174 9.34682L14.2337 14.1306C13.2653 15.0992 12.6734 15.6912 11.9448 16.0983C11.5383 16.3255 10.9218 16.5239 10.291 16.6994C9.64198 16.88 8.89524 17.0578 8.18242 17.2275L8.17373 17.2296C7.92037 17.2899 7.65385 17.2145 7.46969 17.0303C7.28552 16.8462 7.21009 16.5796 7.27041 16.3263L7.27249 16.3175C7.44221 15.6047 7.62 14.858 7.8006 14.209C7.97615 13.5782 8.17455 12.9617 8.40167 12.5553C8.80884 11.8266 9.40083 11.2348 10.3694 10.2664L15.1533 5.48254Z" fill="#2E3039"/>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

@ -0,0 +1,8 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.75 3.47825C16.75 3.26399 16.75 3.06711 16.7387 2.90179C16.7266 2.72415 16.699 2.52881 16.6168 2.33031C16.4392 1.90151 16.0985 1.56083 15.6697 1.38321C15.4712 1.30099 15.2759 1.27338 15.0982 1.26126C14.9329 1.24998 14.7361 1.24999 14.5218 1.25L14.4782 1.25C14.264 1.24999 14.0671 1.24998 13.9018 1.26126C13.7241 1.27338 13.5288 1.30099 13.3303 1.38321C12.9015 1.56083 12.5608 1.90151 12.3832 2.33031C12.301 2.52881 12.2734 2.72415 12.2613 2.90179C12.2541 3.00643 12.2515 3.12369 12.2505 3.25L3 3.25C2.58579 3.25 2.25 3.58579 2.25 4C2.25 4.41421 2.58579 4.75 3 4.75L12.2505 4.75C12.2515 4.87632 12.2541 4.99358 12.2613 5.09821C12.2734 5.27585 12.301 5.4712 12.3832 5.6697C12.5608 6.0985 12.9015 6.43918 13.3303 6.61679C13.5288 6.69902 13.7241 6.72663 13.9018 6.73875C14.0671 6.75003 14.264 6.75002 14.4782 6.75H14.5218C14.736 6.75002 14.9329 6.75003 15.0982 6.73875C15.2759 6.72663 15.4712 6.69902 15.6697 6.61679C16.0985 6.43918 16.4392 6.0985 16.6168 5.6697C16.699 5.4712 16.7266 5.27586 16.7387 5.09821C16.75 4.9329 16.75 4.73607 16.75 4.52182V3.47825ZM13.75 4.00171V4.5C13.75 4.74323 13.7504 4.8881 13.7578 4.9961C13.7623 5.06293 13.7684 5.09134 13.7703 5.09869C13.7956 5.15753 13.8425 5.20442 13.9013 5.2297C13.9087 5.23157 13.9371 5.23767 14.0039 5.24223C14.1119 5.2496 14.2568 5.25 14.5 5.25C14.7432 5.25 14.8881 5.2496 14.9961 5.24223C15.0629 5.23767 15.0913 5.23157 15.0987 5.2297C15.1575 5.20442 15.2044 5.15753 15.2297 5.09869C15.2316 5.09134 15.2377 5.06294 15.2422 4.9961C15.2496 4.8881 15.25 4.74323 15.25 4.5V3.5C15.25 3.25677 15.2496 3.11191 15.2422 3.0039C15.2377 2.93707 15.2316 2.90867 15.2297 2.90131C15.2044 2.84248 15.1575 2.79558 15.0987 2.77031C15.0913 2.76844 15.0629 2.76234 14.9961 2.75778C14.8881 2.75041 14.7432 2.75 14.5 2.75C14.2568 2.75 14.1119 2.75041 14.0039 2.75778C13.9371 2.76234 13.9087 2.76844 13.9013 2.77031C13.8425 2.79558 13.7956 2.84248 13.7703 2.90131C13.7684 2.90867 13.7623 2.93707 13.7578 3.0039C13.7504 3.11191 13.75 3.25677 13.75 3.5V3.99829L13.75 4L13.75 4.00171Z" fill="#2E3039"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.2505 19.75L3 19.75C2.58579 19.75 2.25 19.4142 2.25 19C2.25 18.5858 2.58579 18.25 3 18.25L10.2505 18.25C10.2515 18.1237 10.2541 18.0064 10.2613 17.9018C10.2734 17.7241 10.301 17.5288 10.3832 17.3303C10.5608 16.9015 10.9015 16.5608 11.3303 16.3832C11.5288 16.301 11.7241 16.2734 11.9018 16.2613C12.0671 16.25 12.264 16.25 12.4782 16.25H12.5218C12.736 16.25 12.9329 16.25 13.0982 16.2613C13.2759 16.2734 13.4712 16.301 13.6697 16.3832C14.0985 16.5608 14.4392 16.9015 14.6168 17.3303C14.699 17.5288 14.7266 17.7241 14.7387 17.9018C14.75 18.0671 14.75 18.2639 14.75 18.4782L14.75 19.5218C14.75 19.736 14.75 19.9329 14.7387 20.0982C14.7266 20.2759 14.699 20.4712 14.6168 20.6697C14.4392 21.0985 14.0985 21.4392 13.6697 21.6168C13.4712 21.699 13.2759 21.7266 13.0982 21.7387C12.9329 21.75 12.736 21.75 12.5218 21.75H12.4782C12.264 21.75 12.0671 21.75 11.9018 21.7387C11.7241 21.7266 11.5288 21.699 11.3303 21.6168C10.9015 21.4392 10.5608 21.0985 10.3832 20.6697C10.301 20.4712 10.2734 20.2759 10.2613 20.0982C10.2541 19.9936 10.2515 19.8763 10.2505 19.75ZM11.75 19.5L11.75 19.0017L11.75 19L11.75 18.9983V18.5C11.75 18.2568 11.7504 18.1119 11.7578 18.0039C11.7623 17.9371 11.7684 17.9087 11.7703 17.9013C11.7956 17.8425 11.8425 17.7956 11.9013 17.7703C11.9087 17.7684 11.9371 17.7623 12.0039 17.7578C12.1119 17.7504 12.2568 17.75 12.5 17.75C12.7432 17.75 12.8881 17.7504 12.9961 17.7578C13.0629 17.7623 13.0913 17.7684 13.0987 17.7703C13.1575 17.7956 13.2044 17.8425 13.2297 17.9013C13.2316 17.9087 13.2377 17.9371 13.2422 18.0039C13.2496 18.1119 13.25 18.2568 13.25 18.5L13.25 19.5C13.25 19.7432 13.2496 19.8881 13.2422 19.9961C13.2377 20.0629 13.2316 20.0913 13.2297 20.0987C13.2044 20.1575 13.1575 20.2044 13.0987 20.2297C13.0913 20.2316 13.0629 20.2377 12.9961 20.2422C12.8881 20.2496 12.7432 20.25 12.5 20.25C12.2568 20.25 12.1119 20.2496 12.0039 20.2422C11.9371 20.2377 11.9087 20.2316 11.9013 20.2297C11.8425 20.2044 11.7956 20.1575 11.7703 20.0987C11.7684 20.0913 11.7623 20.0629 11.7578 19.9961C11.7504 19.8881 11.75 19.7432 11.75 19.5Z" fill="#2E3039"/>
<path d="M21 19.75C21.4142 19.75 21.75 19.4142 21.75 19C21.75 18.5858 21.4142 18.25 21 18.25H17C16.5858 18.25 16.25 18.5858 16.25 19C16.25 19.4142 16.5858 19.75 17 19.75H21Z" fill="#2E3039"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.75 11.5C21.75 11.9142 21.4142 12.25 21 12.25L11.7495 12.25C11.7485 12.3763 11.7459 12.4936 11.7387 12.5982C11.7266 12.7759 11.699 12.9712 11.6168 13.1697C11.4392 13.5985 11.0985 13.9392 10.6697 14.1168C10.4712 14.199 10.2759 14.2266 10.0982 14.2387C9.93288 14.25 9.73603 14.25 9.52176 14.25H9.47824C9.26396 14.25 9.06711 14.25 8.90179 14.2387C8.72415 14.2266 8.52881 14.199 8.3303 14.1168C7.9015 13.9392 7.56082 13.5985 7.38321 13.1697C7.30099 12.9712 7.27337 12.7759 7.26125 12.5982C7.24997 12.4329 7.24998 12.236 7.25 12.0218V10.9782C7.24998 10.764 7.24997 10.5671 7.26125 10.4018C7.27337 10.2242 7.30099 10.0288 7.38321 9.83031C7.56082 9.40151 7.9015 9.06083 8.3303 8.88321C8.52881 8.80099 8.72415 8.77338 8.90179 8.76126C9.06711 8.74998 9.26396 8.74999 9.47824 8.75H9.52175C9.73603 8.74999 9.93288 8.74998 10.0982 8.76126C10.2759 8.77338 10.4712 8.80099 10.6697 8.88321C11.0985 9.06083 11.4392 9.40151 11.6168 9.83031C11.699 10.0288 11.7266 10.2242 11.7387 10.4018C11.7459 10.5064 11.7485 10.6237 11.7495 10.75L21 10.75C21.4142 10.75 21.75 11.0858 21.75 11.5ZM10.0987 10.2703C10.1575 10.2956 10.2044 10.3425 10.2297 10.4013C10.2316 10.4087 10.2377 10.4371 10.2422 10.5039C10.2496 10.6119 10.25 10.7568 10.25 11V12C10.25 12.2432 10.2496 12.3881 10.2422 12.4961C10.2377 12.5629 10.2316 12.5913 10.2297 12.5987C10.2044 12.6575 10.1575 12.7044 10.0987 12.7297C10.0913 12.7316 10.0629 12.7377 9.9961 12.7422C9.88809 12.7496 9.74323 12.75 9.5 12.75C9.25677 12.75 9.1119 12.7496 9.0039 12.7422C8.93707 12.7377 8.90867 12.7316 8.90131 12.7297C8.84248 12.7044 8.79558 12.6575 8.7703 12.5987C8.76843 12.5913 8.76233 12.5629 8.75777 12.4961C8.7504 12.3881 8.75 12.2432 8.75 12V11C8.75 10.7568 8.7504 10.6119 8.75777 10.5039C8.76233 10.4371 8.76843 10.4087 8.7703 10.4013C8.79558 10.3425 8.84247 10.2956 8.90131 10.2703C8.90866 10.2684 8.93706 10.2623 9.0039 10.2578C9.1119 10.2504 9.25677 10.25 9.5 10.25C9.74323 10.25 9.88809 10.2504 9.9961 10.2578C10.0629 10.2623 10.0913 10.2684 10.0987 10.2703Z" fill="#2E3039"/>
<path d="M21 4.75C21.4142 4.75 21.75 4.41421 21.75 4C21.75 3.58579 21.4142 3.25 21 3.25L19 3.25C18.5858 3.25 18.25 3.58579 18.25 4C18.25 4.41421 18.5858 4.75 19 4.75L21 4.75Z" fill="#2E3039"/>
<path d="M5.75 11.5C5.75 11.9142 5.41421 12.25 5 12.25H3C2.58579 12.25 2.25 11.9142 2.25 11.5C2.25 11.0858 2.58579 10.75 3 10.75H5C5.41421 10.75 5.75 11.0858 5.75 11.5Z" fill="#2E3039"/>
</svg>

After

Width:  |  Height:  |  Size: 6.8 KiB

@ -1,3 +1,3 @@
<svg width="18" height="12" viewBox="0 0 18 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17.7495 6.00047C17.7495 5.62691 17.5839 5.28034 17.427 5.02011C17.2577 4.7393 17.0301 4.44937 16.7803 4.16669C16.2794 3.59962 15.6257 2.99064 14.9913 2.43977C14.3532 1.88567 13.7173 1.37546 13.2423 1.00468C13.0044 0.818986 12.8059 0.66755 12.6665 0.562239C12.5968 0.509569 12.5418 0.468397 12.5039 0.440203L12.4604 0.407818L12.4488 0.399264L12.4448 0.396304C12.1113 0.150642 11.6414 0.221533 11.3957 0.555035C11.1501 0.888521 11.2213 1.358 11.5547 1.60367L11.5674 1.61308L11.6075 1.64285C11.6429 1.66925 11.6953 1.7085 11.7623 1.75911C11.8964 1.86036 12.0885 2.00695 12.3193 2.18713C12.7818 2.5481 13.3959 3.04099 14.0078 3.57235C14.6234 4.10694 15.2197 4.66576 15.6562 5.15983C15.6838 5.19108 15.7105 5.2218 15.7364 5.25195L0.999512 5.25196C0.585298 5.25196 0.249512 5.58774 0.249512 6.00195C0.249512 6.41617 0.585299 6.75196 0.999512 6.75196L15.7338 6.75195C15.7088 6.78116 15.6829 6.81088 15.6562 6.84111C15.2197 7.33518 14.6234 7.89401 14.0078 8.4286C13.3959 8.95995 12.7818 9.45285 12.3193 9.81382C12.0885 9.99399 11.8964 10.1406 11.7623 10.2418C11.6953 10.2925 11.6429 10.3317 11.6075 10.3581L11.5674 10.3879L11.5547 10.3973C11.2213 10.6429 11.1501 11.1124 11.3957 11.4459C11.6414 11.7794 12.1113 11.8503 12.4448 11.6046L12.4488 11.6017L12.4604 11.5931L12.5039 11.5607C12.5418 11.5326 12.5968 11.4914 12.6665 11.4387C12.8059 11.3334 13.0044 11.182 13.2423 10.9963C13.7173 10.6255 14.3532 10.1153 14.9913 9.56118C15.6257 9.01031 16.2794 8.40133 16.7803 7.83425C17.0301 7.55158 17.2577 7.26165 17.427 6.98083C17.5829 6.72217 17.7475 6.37819 17.7495 6.0072" fill="white"/>
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M28.7495 19.9995C28.7495 19.6259 28.5839 19.2794 28.427 19.0191C28.2577 18.7383 28.0301 18.4484 27.7803 18.1657C27.2794 17.5986 26.6257 16.9897 25.9913 16.4388C25.3532 15.8847 24.7173 15.3745 24.2423 15.0037C24.0044 14.818 23.8059 14.6666 23.6665 14.5613C23.5968 14.5086 23.5418 14.4674 23.5039 14.4392L23.4604 14.4068L23.4488 14.3983L23.4448 14.3953C23.1113 14.1497 22.6414 14.2206 22.3957 14.5541C22.1501 14.8875 22.2213 15.357 22.5547 15.6027L22.5674 15.6121L22.6075 15.6419C22.6429 15.6683 22.6953 15.7075 22.7623 15.7581C22.8964 15.8594 23.0885 16.006 23.3193 16.1862C23.7818 16.5471 24.3959 17.04 25.0078 17.5714C25.6234 18.106 26.2197 18.6648 26.6562 19.1589C26.6838 19.1901 26.7105 19.2208 26.7364 19.251L11.9995 19.251C11.5853 19.251 11.2495 19.5868 11.2495 20.001C11.2495 20.4152 11.5853 20.751 11.9995 20.751L26.7338 20.751C26.7088 20.7802 26.6829 20.8099 26.6562 20.8401C26.2197 21.3342 25.6234 21.893 25.0078 22.4276C24.3959 22.959 23.7818 23.4519 23.3193 23.8128C23.0885 23.993 22.8964 24.1396 22.7623 24.2409C22.6953 24.2915 22.6429 24.3307 22.6075 24.3571L22.5674 24.3869L22.5547 24.3963C22.2213 24.642 22.1501 25.1115 22.3957 25.4449C22.6414 25.7784 23.1113 25.8493 23.4448 25.6037L23.4488 25.6007L23.4604 25.5922L23.5039 25.5598C23.5418 25.5316 23.5968 25.4904 23.6665 25.4377C23.8059 25.3324 24.0044 25.181 24.2423 24.9953C24.7173 24.6245 25.3532 24.1143 25.9913 23.5602C26.6257 23.0093 27.2794 22.4003 27.7803 21.8333C28.0301 21.5506 28.2577 21.2607 28.427 20.9799C28.5829 20.7212 28.7475 20.3772 28.7495 20.0062" fill="#2E3039"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

@ -0,0 +1,4 @@
<svg width="20" height="14" viewBox="0 0 20 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12.43 13.823C12.24 13.823 12.05 13.753 11.9 13.603C11.61 13.313 11.61 12.833 11.9 12.543L17.44 7.00305L11.9 1.46305C11.61 1.17305 11.61 0.693047 11.9 0.403047C12.19 0.113047 12.67 0.113047 12.96 0.403047L19.03 6.47305C19.32 6.76305 19.32 7.24305 19.03 7.53305L12.96 13.603C12.81 13.753 12.62 13.823 12.43 13.823Z" fill="#2E3039"/>
<path d="M18.33 7.75305H1.5C1.09 7.75305 0.75 7.41305 0.75 7.00305C0.75 6.59305 1.09 6.25305 1.5 6.25305H18.33C18.74 6.25305 19.08 6.59305 19.08 7.00305C19.08 7.41305 18.74 7.75305 18.33 7.75305Z" fill="#2E3039"/>
</svg>

After

Width:  |  Height:  |  Size: 666 B

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.29289 7.29289C7.68342 6.90237 8.31658 6.90237 8.70711 7.29289L16 14.5858L23.2929 7.29289C23.6834 6.90237 24.3166 6.90237 24.7071 7.29289C25.0976 7.68342 25.0976 8.31658 24.7071 8.70711L17.4142 16L24.7071 23.2929C25.0976 23.6834 25.0976 24.3166 24.7071 24.7071C24.3166 25.0976 23.6834 25.0976 23.2929 24.7071L16 17.4142L8.70711 24.7071C8.31658 25.0976 7.68342 25.0976 7.29289 24.7071C6.90237 24.3166 6.90237 23.6834 7.29289 23.2929L14.5858 16L7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289Z" fill="#2E3039"/>
</svg>

After

Width:  |  Height:  |  Size: 684 B

@ -0,0 +1,4 @@
<svg width="19" height="19" viewBox="0 0 19 19" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="9.5" cy="9.5" r="6.5" fill="#18C273"/>
<circle cx="9.5" cy="9.5" r="8" stroke="#18C273" stroke-opacity="0.31" stroke-width="3"/>
</svg>

After

Width:  |  Height:  |  Size: 252 B

@ -0,0 +1,8 @@
<svg width="17" height="18" viewBox="0 0 17 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.37427 0.9375C3.12631 0.9375 2.12427 1.95016 2.12427 3.1875C2.12427 4.42484 3.12631 5.4375 4.37427 5.4375C5.62222 5.4375 6.62427 4.42484 6.62427 3.1875C6.62427 1.95016 5.62222 0.9375 4.37427 0.9375Z" fill="#ED1C2B"/>
<path d="M6.67566 6.3702C5.2645 5.6266 3.48447 5.6266 2.0733 6.3702C2.03796 6.38882 1.99128 6.41204 1.93632 6.43938C1.67362 6.57008 1.22162 6.79494 0.913308 7.062C0.724359 7.22567 0.488314 7.48646 0.444083 7.84456C0.394558 8.24552 0.602042 8.58044 0.898469 8.83036C1.3683 9.22647 1.95554 9.5625 2.72106 9.5625L6.02791 9.5625C6.79342 9.5625 7.38067 9.22647 7.85049 8.83035C8.14692 8.58044 8.35441 8.24552 8.30488 7.84456C8.26065 7.48646 8.0246 7.22567 7.83565 7.062C7.52733 6.79493 7.07534 6.57007 6.81264 6.43938C6.75768 6.41204 6.71101 6.38882 6.67566 6.3702Z" fill="#ED1C2B"/>
<path d="M9.36201 1.8557C9.49867 1.63459 9.74007 1.5 10 1.5C12.9021 1.5 15.25 3.84793 15.25 6.75C15.25 7.16421 14.9142 7.5 14.5 7.5C14.0858 7.5 13.75 7.16421 13.75 6.75C13.75 5.30962 12.9412 4.06093 11.7522 3.43259L11.1504 4.03441C11.0364 4.14842 10.9065 4.25631 10.7469 4.27867C10.4366 4.32214 10.1199 4.16679 9.97204 3.87112L9.32918 2.58541C9.21293 2.35292 9.22536 2.07681 9.36201 1.8557Z" fill="#ED1C2B"/>
<path d="M2.5 10.5C2.91421 10.5 3.25 10.8358 3.25 11.25C3.25 12.6904 4.05882 13.9391 5.24779 14.5674L5.84961 13.9656C5.96361 13.8516 6.09348 13.7437 6.25314 13.7213C6.56336 13.6779 6.88013 13.8332 7.02796 14.1289L7.67082 15.4146C7.78707 15.6471 7.77464 15.9232 7.63799 16.1443C7.50133 16.3654 7.25993 16.5 7 16.5C4.09793 16.5 1.75 14.1521 1.75 11.25C1.75 10.8358 2.08579 10.5 2.5 10.5Z" fill="#ED1C2B"/>
<path d="M10.375 10.6875C10.375 9.45016 11.377 8.4375 12.625 8.4375C13.873 8.4375 14.875 9.45016 14.875 10.6875C14.875 11.9248 13.873 12.9375 12.625 12.9375C11.377 12.9375 10.375 11.9248 10.375 10.6875Z" fill="#ED1C2B"/>
<path d="M10.324 13.8702C11.7352 13.1266 13.5152 13.1266 14.9264 13.8702C14.9617 13.8888 15.0084 13.912 15.0634 13.9394C15.3261 14.0701 15.7781 14.2949 16.0864 14.562C16.2753 14.7257 16.5114 14.9865 16.5556 15.3446C16.6051 15.7455 16.3977 16.0804 16.1012 16.3304C15.6314 16.7265 15.0442 17.0625 14.2786 17.0625H10.9718C10.2063 17.0625 9.61903 16.7265 9.1492 16.3304C8.85277 16.0804 8.64529 15.7455 8.69482 15.3446C8.73905 14.9865 8.97509 14.7257 9.16404 14.562C9.47235 14.2949 9.92433 14.0701 10.187 13.9394C10.242 13.9121 10.2887 13.8888 10.324 13.8702Z" fill="#ED1C2B"/>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

@ -0,0 +1,3 @@
<svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 1.75C3.58579 1.75 3.25 2.08579 3.25 2.5C3.25 2.91421 3.58579 3.25 4 3.25H4.25L4.25 5.5C4.25 8.58811 6.05618 11.2544 8.66976 12.5C6.05618 13.7456 4.25 16.4119 4.25 19.5L4.25 21.75H4C3.58579 21.75 3.25 22.0858 3.25 22.5C3.25 22.9142 3.58579 23.25 4 23.25L20 23.25C20.4142 23.25 20.75 22.9142 20.75 22.5C20.75 22.0858 20.4142 21.75 20 21.75H19.75V19.5C19.75 16.4119 17.9438 13.7456 15.3302 12.5C17.9438 11.2544 19.75 8.58811 19.75 5.5V3.25H20C20.4142 3.25 20.75 2.91421 20.75 2.5C20.75 2.08579 20.4142 1.75 20 1.75L4 1.75ZM18.25 3.25L5.75 3.25L5.75 5.5C5.75 8.95178 8.54822 11.75 12 11.75C15.4518 11.75 18.25 8.95178 18.25 5.5V3.25ZM18.25 21.75L18.25 19.5C18.25 16.0482 15.4518 13.25 12 13.25C8.54822 13.25 5.75 16.0482 5.75 19.5L5.75 21.75L18.25 21.75Z" fill="#2B353E"/>
</svg>

After

Width:  |  Height:  |  Size: 927 B

@ -856,5 +856,23 @@
"onboardingHeading1": "حجز المواعيد لم يكن أسهل من قبل",
"onboardingBody1": "ببضع نقرات فقط يمكنك استشارة الطبيب الذي تختاره.",
"onboardingHeading2": "الوصول إلى السجل الطبي بين يديك",
"onboardingBody2": "تتبع تاريخك الطبي بما في ذلك الفحوصات المخبرية، الوصفات الطبية، التأمين، وغيرها."
"onboardingBody2": "تتبع تاريخك الطبي بما في ذلك الفحوصات المخبرية، الوصفات الطبية، التأمين، وغيرها.",
"hmgHospitals": "مستشفيات HMG",
"hmcMedicalClinic": "مراكز HMC الطبية",
"applyFilter": "تطبيق الفلتر",
"facilityAndLocation": "المرفق والموقع",
"regionAndLocation": "المنطقة والمواقع",
"clearAllFilters": "مسح جميع الفلاتر",
"filters": "فلاتر",
"searchClinic": "بحث عن عيادة",
"normal": "عادي",
"attention": "انتباه",
"monitor": "مراقبة",
"noSpecialResult": "لا توجد نتائج خاصة",
"setTheDateRange": "تعيين النطاق الزمني",
"historyFlowchart": "مخطط تدفق التاريخ",
"to": "إلى",
"startDate": "تاريخ البدء",
"endDate": "تاريخ الانتهاء",
"walkin": "زيارة بدون موعد"
}

@ -852,5 +852,24 @@
"onboardingHeading1": "Booking appointment has never been easy",
"onboardingBody1": "In few clicks find yourself having consultation with the doctor of your choice.",
"onboardingHeading2": "Access the medical history on finger tips",
"onboardingBody2": "Keep track on your medical history including labs, prescription, insurance, etc"
"onboardingBody2": "Keep track on your medical history including labs, prescription, insurance, etc",
"normal": "Normal",
"attention": "Attention",
"monitor": "Monitor",
"noSpecialResult": "No Special Results",
"setTheDateRange": "Set The Date Range",
"historyFlowchart": "History FlowChart",
"to": "to",
"startDate" : "Start Date",
"endDate": "End Date",
"hmgHospitals": "HMG Hospitals",
"hmcMedicalClinic": "HMC Medical Centers",
"applyFilter": "AppLy Filter",
"facilityAndLocation": "Facility and Location",
"regionAndLocation": "Region And Locations",
"clearAllFilters": "Clear all filters",
"filters": "Filters",
"searchClinic": "Search Clinic",
"walkin": "Walk In"
}

@ -10,12 +10,12 @@
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
40721B3F0DC8DB0598443DBF /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E824BDA50EF77318022F59D /* Pods_Runner.framework */; };
478CFA942E638C8E0064F3D7 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 478CFA932E638C8E0064F3D7 /* GoogleService-Info.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
B976FB9C47411C32B24D5E01 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ACE60DF9393168FD748550B3 /* Pods_Runner.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -44,16 +44,17 @@
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
1E824BDA50EF77318022F59D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
478CFA932E638C8E0064F3D7 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
478CFA952E6E20A60064F3D7 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
62D069322AC3B532E0B4F137 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7595037DD52211B91157B0F3 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
769C9BF82E6F106D009F68A9 /* RunnerDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerDebug.entitlements; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
8E12CEEB8E334EE22D5259D7 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
@ -61,8 +62,8 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
B35471C63C8DD1B1DECDB3A5 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
D0FB40CE52522242F351743B /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
ACE60DF9393168FD748550B3 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D6BB17A036DF7FCE75271203 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -70,7 +71,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
40721B3F0DC8DB0598443DBF /* Pods_Runner.framework in Frameworks */,
B976FB9C47411C32B24D5E01 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -88,9 +89,9 @@
79DD2093A1D9674C94359FC8 /* Pods */ = {
isa = PBXGroup;
children = (
62D069322AC3B532E0B4F137 /* Pods-Runner.debug.xcconfig */,
D0FB40CE52522242F351743B /* Pods-Runner.release.xcconfig */,
B35471C63C8DD1B1DECDB3A5 /* Pods-Runner.profile.xcconfig */,
8E12CEEB8E334EE22D5259D7 /* Pods-Runner.debug.xcconfig */,
7595037DD52211B91157B0F3 /* Pods-Runner.release.xcconfig */,
D6BB17A036DF7FCE75271203 /* Pods-Runner.profile.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
@ -114,7 +115,7 @@
97C146EF1CF9000F007C117D /* Products */,
331C8082294A63A400263BE5 /* RunnerTests */,
79DD2093A1D9674C94359FC8 /* Pods */,
C1312CE4ABEB9ED47FF21174 /* Frameworks */,
A07D637C76A0ABB38659D189 /* Frameworks */,
);
sourceTree = "<group>";
};
@ -130,6 +131,7 @@
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
769C9BF82E6F106D009F68A9 /* RunnerDebug.entitlements */,
478CFA952E6E20A60064F3D7 /* Runner.entitlements */,
478CFA932E638C8E0064F3D7 /* GoogleService-Info.plist */,
97C146FA1CF9000F007C117D /* Main.storyboard */,
@ -144,10 +146,10 @@
path = Runner;
sourceTree = "<group>";
};
C1312CE4ABEB9ED47FF21174 /* Frameworks */ = {
A07D637C76A0ABB38659D189 /* Frameworks */ = {
isa = PBXGroup;
children = (
1E824BDA50EF77318022F59D /* Pods_Runner.framework */,
ACE60DF9393168FD748550B3 /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@ -176,15 +178,15 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
E3E41B3FF6C30233949963A9 /* [CP] Check Pods Manifest.lock */,
BFED6CCFE59BB148875A533B /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
968C3FBB62CE1E0E307ECBCE /* [CP] Embed Pods Frameworks */,
CC3E3923FDE40035D0CA6762 /* [CP] Copy Pods Resources */,
8372B02399CDF54531650AD4 /* [CP] Embed Pods Frameworks */,
81DE7C26F41956799E954FCE /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@ -273,7 +275,24 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
968C3FBB62CE1E0E307ECBCE /* [CP] Embed Pods Frameworks */ = {
81DE7C26F41956799E954FCE /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
8372B02399CDF54531650AD4 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@ -305,24 +324,7 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
CC3E3923FDE40035D0CA6762 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
E3E41B3FF6C30233949963A9 /* [CP] Check Pods Manifest.lock */ = {
BFED6CCFE59BB148875A533B /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@ -635,7 +637,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_ENTITLEMENTS = Runner/RunnerDebug.entitlements;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO;

@ -34,6 +34,7 @@ abstract class ApiClient {
required Function(dynamic response, int statusCode) onSuccess,
required Function(String error, int statusCode) onFailure,
Map<String, dynamic>? queryParams,
bool isAllowAny,
bool isExternal,
bool isRCService,
});
@ -87,16 +88,16 @@ class ApiClientImp implements ApiClient {
@override
post(
String endPoint, {
required Map<String, dynamic> body,
required Function(dynamic response, int statusCode, {int? messageStatus, String? errorMessage}) onSuccess,
required Function(String error, int statusCode, {int? messageStatus, Failure? failureType}) onFailure,
bool isAllowAny = false,
bool isExternal = false,
bool isRCService = false,
bool isPaymentServices = false,
bool bypassConnectionCheck = false,
}) async {
String endPoint, {
required Map<String, dynamic> body,
required Function(dynamic response, int statusCode, {int? messageStatus, String? errorMessage}) onSuccess,
required Function(String error, int statusCode, {int? messageStatus, Failure? failureType}) onFailure,
bool isAllowAny = false,
bool isExternal = false,
bool isRCService = false,
bool isPaymentServices = false,
bool bypassConnectionCheck = false,
}) async {
String url;
if (isExternal) {
url = endPoint;
@ -173,7 +174,11 @@ class ApiClientImp implements ApiClient {
}
// body['TokenID'] = "@dm!n";
// body['PatientID'] = 4767477;
// body['PatientID'] = 4772172;
// body['PatientTypeID'] = 1;
//
// body['PatientOutSA'] = 0;
// body['SessionID'] = "45786230487560q";
}
body.removeWhere((key, value) => value == null);
@ -324,6 +329,7 @@ class ApiClientImp implements ApiClient {
{required Function(dynamic response, int statusCode) onSuccess,
required Function(String error, int statusCode) onFailure,
Map<String, dynamic>? queryParams,
bool isAllowAny = false,
bool isExternal = false,
bool isRCService = false}) async {
String url;

@ -119,7 +119,7 @@ var GET_STATUS_FOR_COCO = 'Services/COCWS.svc/REST/GetStatusforCOC';
// var GET_PATIENT_AppointmentHistory = 'Services'
// '/Doctors.svc/REST/PateintHasAppoimentHistory';
var GET_PATIENT_AppointmentHistory = 'Services'
var GET_PATIENT_APPOINTMENT_HISTORY_ASYNC = 'Services'
'/Doctors.svc/REST/PateintHasAppoimentHistory_Async';
///VITAL SIGN
@ -727,7 +727,7 @@ const FAMILY_FILES= 'Services/Authentication.svc/REST/GetAllSharedRecordsByStatu
class ApiConsts {
static const maxSmallScreen = 660;
static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.uat;
static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod;
// static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT
@ -743,6 +743,12 @@ class ApiConsts {
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String TAMARA_URL = "https://mdlaboratories.com/tamaralive/Home/Checkout";
static String GET_TAMARA_INSTALLMENTS_URL = "https://mdlaboratories.com/tamaralive/Home/GetInstallments";
static String GET_TAMARA_PAYMENT_STATUS = 'https://mdlaboratories.com/tamaralive/api/OnlineTamara/order_status?orderid=';
// static String GET_TAMARA_INSTALLMENTS_URL = "https://epharmacy.hmg.com/tamara/Home/getinstallments";
// var payFortEnvironment = FortEnvironment.test;
// var applePayMerchantId = "merchant.com.hmgwebservices.uat";
@ -753,37 +759,55 @@ class ApiConsts {
payFortEnvironment = FortEnvironment.production;
applePayMerchantId = "merchant.com.hmgwebservices";
SERVICE_URL = "https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx";
TAMARA_URL = "https://mdlaboratories.com/tamaralive/Home/Checkout";
GET_TAMARA_INSTALLMENTS_URL = "https://mdlaboratories.com/tamaralive/Home/GetInstallments";
GET_TAMARA_PAYMENT_STATUS = 'https://mdlaboratories.com/tamaralive/api/OnlineTamara/order_status?orderid=';
break;
case AppEnvironmentTypeEnum.dev:
baseUrl = "https://uat.hmgwebservices.com/";
payFortEnvironment = FortEnvironment.test;
applePayMerchantId = "merchant.com.hmgwebservices.uat";
SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx';
TAMARA_URL = "https://epharmacy.hmg.com/tamara/Home/Checkout";
GET_TAMARA_INSTALLMENTS_URL = "https://epharmacy.hmg.com/tamara/Home/getinstallments";
GET_TAMARA_PAYMENT_STATUS = 'https://epharmacy.hmg.com/tamara/api/OnlineTamara/order_status?orderid=';
break;
case AppEnvironmentTypeEnum.uat:
baseUrl = "https://uat.hmgwebservices.com/";
payFortEnvironment = FortEnvironment.test;
applePayMerchantId = "merchant.com.hmgwebservices.uat";
SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx';
TAMARA_URL = "https://epharmacy.hmg.com/tamara/Home/Checkout";
GET_TAMARA_INSTALLMENTS_URL = "https://epharmacy.hmg.com/tamara/Home/getinstallments";
GET_TAMARA_PAYMENT_STATUS = 'https://epharmacy.hmg.com/tamara/api/OnlineTamara/order_status?orderid=';
break;
case AppEnvironmentTypeEnum.preProd:
baseUrl = "https://webservices.hmg.com/";
payFortEnvironment = FortEnvironment.production;
applePayMerchantId = "merchant.com.hmgwebservices";
SERVICE_URL = "https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx";
TAMARA_URL = "https://epharmacy.hmg.com/tamara/Home/Checkout";
GET_TAMARA_INSTALLMENTS_URL = "https://epharmacy.hmg.com/tamara/Home/getinstallments";
GET_TAMARA_PAYMENT_STATUS = 'https://epharmacy.hmg.com/tamara/api/OnlineTamara/order_status?orderid=';
break;
case AppEnvironmentTypeEnum.qa:
baseUrl = "https://uat.hmgwebservices.com/";
payFortEnvironment = FortEnvironment.test;
applePayMerchantId = "merchant.com.hmgwebservices.uat";
SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx';
TAMARA_URL = "https://epharmacy.hmg.com/tamara/Home/Checkout";
GET_TAMARA_INSTALLMENTS_URL = "https://epharmacy.hmg.com/tamara/Home/getinstallments";
GET_TAMARA_PAYMENT_STATUS = 'https://epharmacy.hmg.com/tamara/api/OnlineTamara/order_status?orderid=';
break;
case AppEnvironmentTypeEnum.staging:
baseUrl = "https://uat.hmgwebservices.com/";
payFortEnvironment = FortEnvironment.test;
applePayMerchantId = "merchant.com.hmgwebservices.uat";
SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx';
TAMARA_URL = "https://epharmacy.hmg.com/tamara/Home/Checkout";
GET_TAMARA_INSTALLMENTS_URL = "https://epharmacy.hmg.com/tamara/Home/getinstallments";
GET_TAMARA_PAYMENT_STATUS = 'https://epharmacy.hmg.com/tamara/api/OnlineTamara/order_status?orderid=';
break;
}
}
@ -808,6 +832,13 @@ class ApiConsts {
static final String registerUser = 'Services/Authentication.svc/REST/PatientRegistration';
static final String addFamilyFile = 'Services/Patients.svc/REST/ShareFamilyFileService';
static final String sendFamilyFileActivation = 'Services/Authentication.svc/REST/SendActivationCodeForFamilyFile';
static final String checkActivationCodeForFamily = 'Services/Authentication.svc/REST/CheckActivationCodeForFamilyFile';
static final String getAllPendingRecordsByResponseId = 'Services/Authentication.svc/REST/GetAllPendingRecordsByResponseId';
static final String getAllSharedRecordsByStatus = 'Services/Authentication.svc/REST/GetAllSharedRecordsByStatus';
static final String removeFileFromFamilyMembers = 'Services/Authentication.svc/REST/ActiveDeactive_PatientFile';
static final String acceptAndRejectFamilyFile = 'Services/Authentication.svc/REST/Update_FileStatus';
// static values for Api
static final double appVersionID = 18.7;

@ -145,6 +145,16 @@ class AppAssets {
static const String ic_normal_result = '$svgBasePath/normal_result.svg';
static const String ic_low_result = '$svgBasePath/low_result.svg';
static const String ic_critical_low_result = '$svgBasePath/critical_low_result.svg';
static const String livecare_online_icon = '$svgBasePath/livecare_online_icon.svg';
static const String edit_icon = '$svgBasePath/edit_icon.svg';
static const String waiting_icon = '$svgBasePath/waiting_icon.svg';
static const String forward_arrow_icon_small = '$svgBasePath/forward_arrow_icon_small.svg';
static const String ic_filters = '$svgBasePath/filters.svg';
static const String ic_close = '$svgBasePath/ic_close.svg';
static const String ic_cross_circle = '$svgBasePath/cross_circle.svg';
static const String switch_user = '$svgBasePath/switch_user.svg';
static const String activeCheck = '$svgBasePath/active-check.svg';
static const String deleteIcon = '$svgBasePath/delete_icon.svg';
//bottom navigation//
static const String homeBottom = '$svgBasePath/home_bottom.svg';
@ -156,6 +166,8 @@ class AppAssets {
static const String feedback = '$svgBasePath/feedback.svg';
static const String news = '$svgBasePath/news.svg';
static const String heart = '$svgBasePath/heart.svg';
static const String alertSquare = '$svgBasePath/alert-square.svg';
static const String arrowRight = '$svgBasePath/arrow-right.svg';
// PNGS //
static const String hmg_logo = '$pngBasePath/hmg_logo.png';
@ -170,6 +182,7 @@ class AppAssets {
static const String tamara_en = '$pngBasePath/tamara_en.png';
static const String visa = '$pngBasePath/visa.png';
static const String lockIcon = '$pngBasePath/lock-icon.png';
static const String dummy_user = '$pngBasePath/dummy_user.png';
}
class AppAnimations {
@ -184,4 +197,6 @@ class AppAnimations {
static const String warningAnimation = '$lottieBasePath/warningAnimation.json';
static const String splashLaunching = '$lottieBasePath/splash_launching.json';
static const String noData = '$lottieBasePath/Nodata.json';
static const String ripple = '$lottieBasePath/Ripple.json';
static const String pending_loading_animation = '$lottieBasePath/pending_loading_animation.json';
}

@ -37,14 +37,16 @@ class AppState {
AuthenticatedUser? _authenticatedRootUser;
AuthenticatedUser? _authenticatedChildUser;
void setAuthenticatedUser(AuthenticatedUser authenticatedUser, {bool isFamily = false}) {
int? _superUserID;
bool isChildLoggedIn = false;
void setAuthenticatedUser(AuthenticatedUser? authenticatedUser, {bool isFamily = false}) {
if (isFamily) {
_authenticatedChildUser = authenticatedUser;
} else {
setIsAuthenticated = true;
_authenticatedRootUser = authenticatedUser;
}
}
AuthenticatedUser? getAuthenticatedUser({bool isFamily = false}) {
@ -55,6 +57,14 @@ class AppState {
}
}
int? get getSuperUserID => _superUserID;
bool get getIsChildLoggedIn => isChildLoggedIn;
set setSuperUserID(int? value) => _superUserID = value;
set setIsChildLoggedIn(bool value) => isChildLoggedIn = value;
String _userBloodGroup = "";
String get getUserBloodGroup => _userBloodGroup;
@ -97,6 +107,14 @@ class AppState {
set setDeviceTypeID(v) => deviceTypeID = v;
String _familyFileTokenID = "";
String get getFamilyFileTokenID => _familyFileTokenID;
set setFamilyFileTokenID(String value) {
_familyFileTokenID = value;
}
List<VidaPlusProjectListModel> vidaPlusProjectList = [];
List<ListPrivilege> privilegeModelList = [];
List<HMCProjectListModel> hMCProjectListModel = [];
@ -135,9 +153,8 @@ class AppState {
}
///this will be called if there is any problem in getting the user location
void resetLocation(){
void resetLocation() {
userLong = 0.0;
userLong = 0.0;
}
}

@ -8,20 +8,25 @@ import 'package:hmg_patient_app_new/features/authentication/authentication_view_
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_repo.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/common/common_repo.dart';
import 'package:hmg_patient_app_new/features/doctor_filter/doctor_filter_view_model.dart';
import 'package:hmg_patient_app_new/features/habib_wallet/habib_wallet_repo.dart';
import 'package:hmg_patient_app_new/features/habib_wallet/habib_wallet_view_model.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/immediate_livecare_repo.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/immediate_livecare_view_model.dart';
import 'package:hmg_patient_app_new/features/insurance/insurance_repo.dart';
import 'package:hmg_patient_app_new/features/insurance/insurance_view_model.dart';
import 'package:hmg_patient_app_new/features/lab/lab_repo.dart';
import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart';
import 'package:hmg_patient_app_new/features/medical_file/medical_file_repo.dart';
import 'package:hmg_patient_app_new/features/medical_file/medical_file_view_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/appointment_via_region_viewmodel.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_repo.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/payfort/payfort_repo.dart';
import 'package:hmg_patient_app_new/features/payfort/payfort_view_model.dart';
import 'package:hmg_patient_app_new/features/prescriptions/prescriptions_repo.dart';
import 'package:hmg_patient_app_new/features/prescriptions/prescriptions_view_model.dart';
import 'package:hmg_patient_app_new/features/profile_settings/profile_settings_view_model.dart';
import 'package:hmg_patient_app_new/features/radiology/radiology_repo.dart';
import 'package:hmg_patient_app_new/features/radiology/radiology_view_model.dart';
import 'package:hmg_patient_app_new/services/analytics/analytics_service.dart';
@ -32,6 +37,7 @@ import 'package:hmg_patient_app_new/services/firebase_service.dart';
import 'package:hmg_patient_app_new/services/localauth_service.dart';
import 'package:hmg_patient_app_new/services/logger_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';
import 'package:hmg_patient_app_new/widgets/date_range_selector/viewmodel/date_range_view_model.dart';
import 'package:local_auth/local_auth.dart';
import 'package:logger/web.dart';
import 'package:shared_preferences/shared_preferences.dart';
@ -92,16 +98,13 @@ class AppDependencies {
getIt.registerLazySingleton<LocalAuthService>(() => LocalAuthService(loggerService: getIt<LoggerService>(), localAuth: getIt<LocalAuthentication>()));
getIt.registerLazySingleton<HabibWalletRepo>(() => HabibWalletRepoImp(loggerService: getIt<LoggerService>(), apiClient: getIt()));
getIt.registerLazySingleton<MedicalFileRepo>(() => MedicalFileRepoImp(loggerService: getIt<LoggerService>(), apiClient: getIt()));
getIt.registerLazySingleton<ImmediateLiveCareRepo>(() => ImmediateLiveCareRepoImp(loggerService: getIt<LoggerService>(), apiClient: getIt()));
// ViewModels
// Global/shared VMs LazySingleton
getIt.registerLazySingleton<LabViewModel>(
() => LabViewModel(
labRepo: getIt(),
errorHandlerService: getIt(),
navigationService: getIt()
),
() => LabViewModel(labRepo: getIt(), errorHandlerService: getIt(), navigationService: getIt()),
);
getIt.registerLazySingleton<RadiologyViewModel>(
@ -154,10 +157,32 @@ class AppDependencies {
() => BookAppointmentsViewModel(bookAppointmentsRepo: getIt(), errorHandlerService: getIt(), navigationService: getIt(), myAppointmentsViewModel: getIt(), locationUtils: getIt()),
);
getIt.registerLazySingleton<ImmediateLiveCareViewModel>(
() => ImmediateLiveCareViewModel(
immediateLiveCareRepo: getIt(),
errorHandlerService: getIt(),
navigationService: getIt(),
myAppointmentsViewModel: getIt(),
),
);
getIt.registerLazySingleton<AuthenticationViewModel>(
() => AuthenticationViewModel(
authenticationRepo: getIt(), cacheService: getIt(), navigationService: getIt(), dialogService: getIt(), appState: getIt(), errorHandlerService: getIt(), localAuthService: getIt()),
);
getIt.registerLazySingleton<ProfileSettingsViewModel>(() => ProfileSettingsViewModel());
getIt.registerLazySingleton<DateRangeSelectorRangeViewModel>(
() => DateRangeSelectorRangeViewModel(),
);
getIt.registerLazySingleton<DoctorFilterViewModel>(
() => DoctorFilterViewModel(),
);
getIt.registerLazySingleton<AppointmentViaRegionViewmodel>(
() => AppointmentViaRegionViewmodel(navigationService: getIt(), appState: getIt()),
);
// Screen-specific VMs Factory
// getIt.registerFactory<BookAppointmentsViewModel>(

@ -30,6 +30,8 @@ enum LoginTypeEnum { sms, whatsapp, face, fingerprint }
enum AppEnvironmentTypeEnum { dev, uat, preProd, qa, staging, prod }
enum FamilyFileEnum { active, inactive, blocked, deleted, pending, rejected }
extension CalenderExtension on CalenderEnum {
int get toInt {
switch (this) {
@ -138,6 +140,61 @@ extension OTPTypeEnumExtension on OTPTypeEnum {
}
}
extension FamilyFileEnumExtenshion on FamilyFileEnum {
int get toInt {
switch (this) {
case FamilyFileEnum.active:
return 3;
case FamilyFileEnum.blocked:
return 1;
case FamilyFileEnum.deleted:
return 0;
case FamilyFileEnum.pending:
return 2;
case FamilyFileEnum.inactive:
return 6;
case FamilyFileEnum.rejected:
return 4;
}
}
String get displayName {
AppState appState = getIt.get<AppState>();
bool isArabic = appState.getLanguageID() == 1 ? true : false;
switch (this) {
case FamilyFileEnum.active:
return isArabic ? 'نشط' : 'Active';
case FamilyFileEnum.inactive:
return isArabic ? 'غير نشط' : 'Inactive';
case FamilyFileEnum.blocked:
return isArabic ? 'محظور' : 'Blocked';
case FamilyFileEnum.deleted:
return isArabic ? 'محذوف' : 'Deleted';
case FamilyFileEnum.pending:
return isArabic ? 'قيد الانتظار' : 'Pending';
case FamilyFileEnum.rejected:
return isArabic ? 'مرفوض' : 'Rejected';
}
}
static FamilyFileEnum? fromValue(int value) {
switch (value) {
case 0:
return FamilyFileEnum.pending;
case 2:
return FamilyFileEnum.blocked;
case 1:
return FamilyFileEnum.deleted;
case 3:
return FamilyFileEnum.active;
case 4:
return FamilyFileEnum.inactive;
default:
return null;
}
}
}
enum ServiceTypeEnum {
advancePayment, //3
ancillaryOrder, //3

@ -485,3 +485,11 @@ class DateUtil {
return "";
}
}
extension OnlyDate on DateTime{
DateTime provideDateOnly(){
return DateTime(this.year, month, day);
}
}

@ -8,11 +8,14 @@ import 'package:firebase_messaging/firebase_messaging.dart' as fir;
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_ios_voip_kit_karmm/call_state_type.dart';
import 'package:flutter_ios_voip_kit_karmm/flutter_ios_voip_kit.dart';
// import 'package:flutter_callkit_incoming/flutter_callkit_incoming.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:hmg_patient_app_new/core/utils/local_notifications.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/services/cache_service.dart';
import 'package:permission_handler/permission_handler.dart';
import '../cache_consts.dart';
@ -139,7 +142,7 @@ class PushNotificationHandler {
// late HmsApiAvailability hmsApiAvailability;
// final voIPKit = FlutterIOSVoIPKit.instance;
final voIPKit = FlutterIOSVoIPKit.instance;
late Timer timeOutTimer;
bool isTalking = false;
@ -188,55 +191,56 @@ class PushNotificationHandler {
this.context = context;
if (Platform.isIOS) {
// voIPKit.getVoIPToken().then((value) {
// print("APNS VOIP KIT TOKEN: $value");
// AppSharedPreferences().setString(APNS_TOKEN, value!);
// });
//
// voIPKit.onDidUpdatePushToken = (String token) {
// print('🎈 example: onDidUpdatePushToken: $token');
// };
//
// voIPKit.onDidReceiveIncomingPush = (
// Map<String, dynamic> payload,
// ) async {
// print('🎈 example: onDidReceiveIncomingPush $payload');
// _timeOut();
// };
//
// voIPKit.onDidRejectIncomingCall = (
// String uuid,
// String callerId,
// ) async {
// try {
// print('🎈 example: onDidRejectIncomingCall $uuid - $callerId');
// timeOutTimer.cancel();
// } catch (err) {}
// };
//
// voIPKit.onDidAcceptIncomingCall = (
// String uuid,
// String callerId,
// ) async {
// print('🎈 example: onDidAcceptIncomingCall $uuid - $callerId');
// await voIPKit.acceptIncomingCall(callerState: CallStateType.calling);
// await voIPKit.callConnected();
// await Future.delayed(Duration(seconds: 1));
//
// Navigator.pushNamed(
// locator<NavigationService>().navigatorKey.currentContext!,
// "zoom_call_page",
// arguments: CallArguments("hoover-dam", "123", "Patient", "40", "1", false),
// );
//
// await voIPKit.endCall();
//
// // Navigator.pushNamed(navigatorKey.currentContext!, VIDEO_CALL_SCREEN,
// // arguments: VideoArgus(
// // reservationId: int.parse(callerId), token: null, isVideo: true));
//
// timeOutTimer.cancel();
// };
voIPKit.getVoIPToken().then((value) {
print("🎈 APNS VOIP KIT TOKEN: $value");
Utils.saveStringFromPrefs(CacheConst.voipToken, value ?? "");
// AppSharedPreferences().setString(APNS_TOKEN, value!);
});
voIPKit.onDidUpdatePushToken = (String token) {
print('🎈 example: onDidUpdatePushToken: $token');
};
voIPKit.onDidReceiveIncomingPush = (
Map<String, dynamic> payload,
) async {
print('🎈 example: onDidReceiveIncomingPush $payload');
// _timeOut();
};
voIPKit.onDidRejectIncomingCall = (
String uuid,
String callerId,
) async {
try {
print('🎈 example: onDidRejectIncomingCall $uuid - $callerId');
timeOutTimer.cancel();
} catch (err) {}
};
voIPKit.onDidAcceptIncomingCall = (
String uuid,
String callerId,
) async {
print('🎈 example: onDidAcceptIncomingCall $uuid - $callerId');
await voIPKit.acceptIncomingCall(callerState: CallStateType.calling);
await voIPKit.callConnected();
await Future.delayed(Duration(seconds: 1));
// Navigator.pushNamed(
// locator<NavigationService>().navigatorKey.currentContext!,
// "zoom_call_page",
// arguments: CallArguments("hoover-dam", "123", "Patient", "40", "1", false),
// );
await voIPKit.endCall();
// Navigator.pushNamed(navigatorKey.currentContext!, VIDEO_CALL_SCREEN,
// arguments: VideoArgus(
// reservationId: int.parse(callerId), token: null, isVideo: true));
// timeOutTimer.cancel();
};
}
if (Platform.isAndroid) {

@ -9,6 +9,7 @@ import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/features/authentication/models/request_models/registration_payload_model.dart';
import 'package:hmg_patient_app_new/features/authentication/models/request_models/send_activation_request_model.dart';
import 'package:hmg_patient_app_new/features/common/models/commong_authanticated_req_model.dart';
import 'package:hmg_patient_app_new/features/common/models/family_file_request.dart';
class RequestUtils {
static dynamic getPatientAuthenticationRequest({
@ -125,6 +126,9 @@ class RequestUtils {
required bool isForRegister,
required bool isFileNo,
dynamic payload,
required bool isExcludedUser,
required bool isFormFamilyFile,
int? responseID,
}) {
AppState _appState = getIt.get<AppState>();
var request = SendActivationRequest();
@ -156,6 +160,15 @@ class RequestUtils {
request.isRegister = false;
}
request.deviceTypeID = request.searchType;
if (isFormFamilyFile) {
//INFO: Only for Excluded User Family Member Addition
request.isPatientExcluded = isExcludedUser;
request.responseID = responseID;
request.status = 2;
request.familyRegionID = zipCode == CountryEnum.saudiArabia.countryCode ? 1 : 2;
}
return request;
}
@ -247,19 +260,29 @@ class RequestUtils {
};
}
static dynamic getAddFamilyRequest({required String nationalIDorFile, required String mobileNo, required String countryCode, required int loginType}) {
var request = <String, dynamic>{};
static Future<FamilyFileRequest> getAddFamilyRequest({required String nationalIDorFile, required String mobileNo, required String countryCode}) async {
FamilyFileRequest request = FamilyFileRequest();
int? loginType = 0;
if (countryCode == CountryEnum.saudiArabia.countryCode || countryCode == '+966') {
loginType = (nationalIDorFile.length == 10) ? 1 : 2;
} else if (countryCode == CountryEnum.unitedArabEmirates.countryCode || countryCode == '+971') {
loginType = (nationalIDorFile.length == 15) ? 1 : 2;
}
if (loginType == 1) {
request["sharedPatientID"] = 0;
request["sharedPatientIdentificationID"] = nationalIDorFile;
request.sharedPatientId = 0;
request.sharedPatientIdentificationId = nationalIDorFile;
} else if (loginType == 2) {
request["sharedPatientID"] = int.parse(nationalIDorFile);
request["sharedPatientIdentificationID"] = '';
request.sharedPatientId = int.parse(nationalIDorFile);
request.sharedPatientIdentificationId = '';
}
request["searchType"] = loginType;
request["sharedPatientMobileNumber"] = mobileNo;
request["zipCode"] = countryCode;
request["isRegister"] = false;
request["patientStatus"] = 2;
request.searchType = loginType;
request.sharedPatientMobileNumber = mobileNo;
request.zipCode = countryCode;
request.isRegister = false;
request.patientStatus = 2;
request.isDentalAllowedBackend = false;
return request;
}
}

@ -1,8 +1,8 @@
import 'package:flutter/material.dart'; // These are the Viewport values of your Figma Design.
// These are used in the code as a reference to create your UI Responsively.
const num FIGMA_DESIGN_WIDTH = 375;
const num FIGMA_DESIGN_HEIGHT = 667;
final num FIGMA_DESIGN_WIDTH = SizeUtils.width;
final num FIGMA_DESIGN_HEIGHT = SizeUtils.height;
const num FIGMA_DESIGN_STATUS_BAR = 0;
extension ResponsiveExtension on num {
@ -70,10 +70,10 @@ class SizeUtils {
static late DeviceType deviceType;
/// Device's Height
static late double height;
static double height = 667;
/// Device's Width
static late double width;
static double width = 375;
static void setScreenSize(
BoxConstraints constraints,

@ -323,7 +323,7 @@ class Utils {
children: [
Lottie.asset(AppAnimations.loadingAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill),
SizedBox(height: 8.h),
(loadingText ?? LocaleKeys.loadingText.tr()).toText16(color: AppColors.blackColor),
(loadingText ?? LocaleKeys.loadingText.tr()).toText16(color: AppColors.blackColor, isCenter: true),
SizedBox(height: 8.h),
],
).center;
@ -355,15 +355,17 @@ class Utils {
).center;
}
static Widget getWarningWidget({String? loadingText, bool isShowActionButtons = false, Function? onConfirmTap, Function? onCancelTap}) {
static Widget getWarningWidget({String? loadingText, bool isShowActionButtons = false, Widget? bodyWidget, Function? onConfirmTap, Function? onCancelTap}) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Lottie.asset(AppAnimations.warningAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 128.h, height: 128.h, fit: BoxFit.fill),
Lottie.asset(AppAnimations.warningAnimation, repeat: false, reverse: false, frameRate: FrameRate(60), width: 128.h, height: 128.h, fit: BoxFit.fill),
SizedBox(height: 8.h),
(loadingText ?? LocaleKeys.loadingText.tr()).toText14(color: AppColors.blackColor, letterSpacing: 0),
SizedBox(height: 16.h),
bodyWidget ?? SizedBox.shrink(),
SizedBox(height: 16.h),
isShowActionButtons
? Row(
children: [
@ -627,8 +629,17 @@ class Utils {
double width = 24,
double height = 24,
BoxFit fit = BoxFit.cover,
double? border,
double? borderRadius,
}) {
return Image.asset(icon, width: width, height: height, fit: fit);
return Container(
decoration: BoxDecoration(
border: border != null ? Border.all(color: AppColors.whiteColor, width: border) : null,
borderRadius: border != null ? BorderRadius.circular(borderRadius ?? 0) : null,
),
child: Image.asset(icon, width: width, height: height, fit: fit),
);
// return Image.asset(icon, width: width, height: height, fit: fit, );
}
/// Widget to build an SVG from network
@ -658,7 +669,6 @@ class Utils {
static Widget getPaymentAmountWithSymbol(Widget paymentAmountWidget, Color iconColor, double iconSize, {bool isSaudiCurrency = true, bool isExpanded = true}) {
return Row(
mainAxisAlignment: isExpanded ? MainAxisAlignment.spaceBetween : MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
appState.isArabic()
? Container()
@ -756,4 +766,5 @@ class Utils {
}
return isHavePrivilege;
}
}

@ -1,4 +1,6 @@
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/enums.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:auto_size_text/auto_size_text.dart';
@ -365,7 +367,8 @@ extension DynamicTextStyleExtension on BuildContext {
TextBaseline? textBaseline,
FontStyle? fontStyle,
bool isLanguageSwitcher = false}) {
final family = FontUtils.getFontFamilyForLanguage(false); // TODO: @Aamir make it dynamic based on app language
AppState appState = getIt.get<AppState>();
final family = appState.getLanguageCode() == "ar" ? 'GESSTwo' : 'Poppins';
return TextStyle(
fontFamily: family,
fontSize: fontSize,

@ -3,8 +3,10 @@ import 'dart:async';
import 'package:dartz/dartz.dart';
import 'package:hmg_patient_app_new/core/api/api_client.dart';
import 'package:hmg_patient_app_new/core/api_consts.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/common_models/generic_api_model.dart';
import 'package:hmg_patient_app_new/core/common_models/privilege/PrivilegeModel.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/exceptions/api_failure.dart';
import 'package:hmg_patient_app_new/features/authentication/models/request_models/check_activation_code_register_request_model.dart';
import 'package:hmg_patient_app_new/features/authentication/models/resp_models/select_device_by_imei.dart';
@ -17,12 +19,18 @@ abstract class AuthenticationRepo {
Future<Either<Failure, GenericApiModel<dynamic>>> checkPatientAuthentication({required dynamic checkPatientAuthenticationReq});
Future<Either<Failure, GenericApiModel<dynamic>>> sendActivationCodeRepo({required dynamic sendActivationCodeReq, String? languageID, bool isRegister = false});
Future<Either<Failure, GenericApiModel<dynamic>>> sendActivationCodeRepo({required dynamic sendActivationCodeReq, String? languageID, bool isRegister = false, bool isFormFamilyFile = false});
Future<Either<Failure, GenericApiModel<dynamic>>> checkActivationCodeRepo(
{required dynamic newRequest, // could be CheckActivationCodeReq or CheckActivationCodeRegisterReq
{required dynamic newRequest,
required String? activationCode,
required bool isRegister});
required bool isRegister,
bool isFormFamilyFile = false,
int? patientShareRequestID,
int? responseID,
bool isSwitchUser = false,
int? patientID,
int? loginType});
Future<Either<Failure, GenericApiModel<dynamic>>> checkIfUserAgreed({required dynamic commonAuthanticatedRequest});
@ -134,18 +142,33 @@ class AuthenticationRepoImp implements AuthenticationRepo {
required dynamic sendActivationCodeReq,
String? languageID,
bool isRegister = false,
bool isFormFamilyFile = false,
}) async {
int isOutKsa = (sendActivationCodeReq.zipCode == '966' || sendActivationCodeReq.zipCode == '+966') ? 0 : 1;
sendActivationCodeReq.patientOutSA = isOutKsa;
sendActivationCodeReq.isDentalAllowedBackend = false;
final payload = sendActivationCodeReq.toJson();
if (isFormFamilyFile) {
payload.remove("MobileNo");
payload.remove("NationalID");
payload.remove("SMSSignature");
payload.remove("ResponseID");
print("=================== Final Payload ===================");
print(payload);
print("=====================================================");
}
try {
GenericApiModel<dynamic>? apiResponse;
Failure? failure;
await apiClient.post(
isRegister ? ApiConsts.sendActivationCodeRegister : ApiConsts.sendActivationCode,
body: sendActivationCodeReq.toJson(),
isFormFamilyFile
? ApiConsts.sendFamilyFileActivation
: isRegister
? ApiConsts.sendActivationCodeRegister
: ApiConsts.sendActivationCode,
body: isFormFamilyFile ? payload : sendActivationCodeReq.toJson(),
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
},
@ -172,24 +195,122 @@ class AuthenticationRepoImp implements AuthenticationRepo {
}
@override
Future<Either<Failure, GenericApiModel<dynamic>>> checkActivationCodeRepo({
required dynamic newRequest, // could be CheckActivationCodeReq or CheckActivationCodeRegisterReq
required String? activationCode,
required bool isRegister,
}) async {
Future<Either<Failure, GenericApiModel<dynamic>>> checkActivationCodeRepo(
{required dynamic newRequest, // could be CheckActivationCodeReq or CheckActivationCodeRegisterReq
required String? activationCode,
required bool isRegister,
bool isFormFamilyFile = false,
int? patientShareRequestID,
int? responseID,
bool isSwitchUser = false,
int? patientID,
int? loginType}) async {
AppState appState = getIt.get<AppState>();
// if (isRegister) {
// newRequest["activationCode"] = activationCode ?? "0000";
// newRequest["isSilentLogin"] = activationCode != null ? false : true;
// } else {
// newRequest.activationCode = activationCode ?? "0000";
// newRequest.isSilentLogin = activationCode != null ? false : true;
// newRequest.projectOutSA = newRequest.zipCode == '966' ? false : true;
// newRequest.isDentalAllowedBackend = false;
// newRequest.forRegisteration = newRequest.isRegister ?? false;
// newRequest.isRegister = false;
// }
// Map<String, dynamic> familyRequest = {};
// if (isFormFamilyFile) {
// AppState appState = getIt.get<AppState>();
// familyRequest = {};
// familyRequest['PatientShareRequestID'] = patientShareRequestID;
// familyRequest['ResponseID'] = responseID;
// familyRequest['Status'] = 3;
// familyRequest["PatientID"] = appState.getAuthenticatedUser()!.patientId ?? 0;
// familyRequest["LogInTokenID"] = appState.getFamilyFileTokenID;
// familyRequest["activationCode"] = activationCode ?? "0000";
// familyRequest["PatientMobileNumber"] = newRequest.patientMobileNumber;
// familyRequest["PatientIdentificationID"] = newRequest.patientIdentificationID;
// }
// Map<String, dynamic> switchRequest = {};
// if (isSwitchUser) {
// switchRequest = newRequest.toJson();
//
// switchRequest['PatientID'] = responseID;
// switchRequest['IsSilentLogin'] = true;
// switchRequest['LogInTokenID'] = null;
// switchRequest['SearchType'] = 2;
// if (loginType != 0) {
// switchRequest['SuperUser'] = patientID;
// switchRequest['DeviceToken'] = null;
// } else {
// switchRequest["LoginType"] = 2;
// }
//
// if (appState.getSuperUserID == responseID) {
// // switchRequest['LoginType'] = 3;
// switchRequest['PatientIdentificationID'] = "";
// // switchRequest['ProjectOutSA'] = newRequest.zipCode == '966' ? false : true;
// switchRequest.remove('NationalID');
// switchRequest.remove('isDentalAllowedBackend');
// switchRequest.remove('ProjectOutSA');
// switchRequest.remove('ForRegisteration');
// appState.setSuperUserID = null;
// }
// }
if (isRegister) {
newRequest["activationCode"] = activationCode ?? "0000";
newRequest["isSilentLogin"] = activationCode != null ? false : true;
newRequest["isSilentLogin"] = activationCode == null;
} else {
newRequest.activationCode = activationCode ?? "0000";
newRequest.isSilentLogin = activationCode != null ? false : true;
newRequest.projectOutSA = newRequest.zipCode == '966' ? false : true;
newRequest.isSilentLogin = activationCode == null;
newRequest.projectOutSA = newRequest.zipCode != '966';
newRequest.isDentalAllowedBackend = false;
newRequest.forRegisteration = newRequest.isRegister ?? false;
newRequest.isRegister = false;
}
final endpoint = isRegister ? ApiConsts.checkActivationCodeRegister : ApiConsts.checkActivationCode;
Map<String, dynamic> familyRequest = {};
if (isFormFamilyFile) {
familyRequest = {
'PatientShareRequestID': patientShareRequestID,
'ResponseID': responseID,
'Status': 3,
// 'PatientID': appState.getAuthenticatedUser()?.patientId ?? 0,
'LogInTokenID': appState.getFamilyFileTokenID,
'activationCode': activationCode ?? "0000",
'PatientMobileNumber': newRequest.patientMobileNumber,
'PatientIdentificationID': newRequest.patientIdentificationID,
};
}
Map<String, dynamic> switchRequest = {};
if (isSwitchUser) {
switchRequest = newRequest.toJson();
switchRequest.addAll({
'PatientID': responseID,
'IsSilentLogin': true,
'LogInTokenID': null,
'SearchType': 2,
});
if (loginType != 0) {
switchRequest['SuperUser'] = patientID;
switchRequest['DeviceToken'] = null;
} else {
switchRequest['LoginType'] = 2;
}
if (appState.getSuperUserID == responseID) {
switchRequest['PatientIdentificationID'] = "";
switchRequest.removeWhere((key, value) => ['NationalID', 'isDentalAllowedBackend', 'ProjectOutSA', 'ForRegisteration'].contains(key));
}
}
final endpoint = isFormFamilyFile
? ApiConsts.checkActivationCodeForFamily
: isRegister
? ApiConsts.checkActivationCodeRegister
: ApiConsts.checkActivationCode;
try {
GenericApiModel<dynamic>? apiResponse;
@ -197,7 +318,13 @@ class AuthenticationRepoImp implements AuthenticationRepo {
await apiClient.post(
endpoint,
body: isRegister ? newRequest : newRequest.toJson(),
body: isFormFamilyFile
? familyRequest
: isRegister
? newRequest
: isSwitchUser
? switchRequest
: newRequest.toJson(),
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
},
@ -226,7 +353,6 @@ class AuthenticationRepoImp implements AuthenticationRepo {
@override
Future<Either<Failure, GenericApiModel<dynamic>>> checkIfUserAgreed({required dynamic commonAuthanticatedRequest}) async {
commonAuthanticatedRequest['Region'] = 1;
print("dsfsdd");
try {
GenericApiModel<dynamic>? apiResponse;
Failure? failure;
@ -261,7 +387,6 @@ class AuthenticationRepoImp implements AuthenticationRepo {
@override
Future<Either<Failure, GenericApiModel<dynamic>>> getUserAgreementContent({required dynamic commonAuthanticatedRequest}) async {
commonAuthanticatedRequest['Region'] = 1;
print("dsfsdd");
try {
GenericApiModel<dynamic>? apiResponse;
Failure? failure;

@ -13,6 +13,7 @@ import 'package:hmg_patient_app_new/core/common_models/nationality_country_model
import 'package:hmg_patient_app_new/core/common_models/privilege/HMCProjectListModel.dart';
import 'package:hmg_patient_app_new/core/common_models/privilege/ProjectDetailListModel.dart';
import 'package:hmg_patient_app_new/core/common_models/privilege/VidaPlusProjectListModel.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/enums.dart';
import 'package:hmg_patient_app_new/core/utils/loading_utils.dart';
import 'package:hmg_patient_app_new/core/utils/request_utils.dart';
@ -26,6 +27,9 @@ import 'package:hmg_patient_app_new/features/authentication/models/resp_models/a
import 'package:hmg_patient_app_new/features/authentication/models/resp_models/check_activation_code_resp_model.dart';
import 'package:hmg_patient_app_new/features/authentication/models/resp_models/check_user_staus_nhic_response_model.dart';
import 'package:hmg_patient_app_new/features/authentication/models/resp_models/select_device_by_imei.dart';
import 'package:hmg_patient_app_new/features/medical_file/medical_file_repo.dart';
import 'package:hmg_patient_app_new/features/medical_file/medical_file_view_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/authentication/login.dart';
import 'package:hmg_patient_app_new/presentation/authentication/saved_login_screen.dart';
@ -243,7 +247,7 @@ class AuthenticationViewModel extends ChangeNotifier {
await selectDeviceImei(onSuccess: (dynamic respData) async {
try {
if (respData != null) {
dynamic data = SelectDeviceByImeiRespModelElement.fromJson(respData.toJson());
dynamic data = await SelectDeviceByImeiRespModelElement.fromJson(respData.toJson());
_appState.setSelectDeviceByImeiRespModelElement(data);
LoaderBottomSheet.hideLoader();
@ -342,24 +346,33 @@ class AuthenticationViewModel extends ChangeNotifier {
);
}
Future<void> sendActivationCode(
{required OTPTypeEnum otpTypeEnum, required String nationalIdOrFileNumber, required String phoneNumber, required bool isForRegister, dynamic payload, bool isComingFromResendOTP = false}) async {
Future<void> sendActivationCode({required OTPTypeEnum otpTypeEnum,
required String nationalIdOrFileNumber,
required String phoneNumber,
required bool isForRegister,
dynamic payload,
bool isComingFromResendOTP = false,
bool isExcludedUser = false,
bool isFormFamilyFile = false,
int? responseID}) async {
var request = RequestUtils.getCommonRequestSendActivationCode(
otpTypeEnum: otpTypeEnum,
mobileNumber: phoneNumber,
selectedLoginType: otpTypeEnum.toInt(),
zipCode: selectedCountrySignup.countryCode,
nationalId: int.parse(nationalIdOrFileNumber),
isFileNo: isForRegister ? isPatientHasFile(request: payload) : false,
patientId: 0,
isForRegister: isForRegister,
patientOutSA: isForRegister
? isPatientOutsideSA(request: payload)
: selectedCountrySignup.countryCode == CountryEnum.saudiArabia
? false
: true,
payload: payload,
);
otpTypeEnum: otpTypeEnum,
mobileNumber: phoneNumber,
selectedLoginType: otpTypeEnum.toInt(),
zipCode: selectedCountrySignup.countryCode,
nationalId: int.parse(nationalIdOrFileNumber),
isFileNo: isForRegister ? isPatientHasFile(request: payload) : false,
patientId: 0,
isForRegister: isForRegister,
patientOutSA: isForRegister
? isPatientOutsideSA(request: payload)
: selectedCountrySignup.countryCode == CountryEnum.saudiArabia.countryCode
? false
: true,
payload: payload,
isExcludedUser: isExcludedUser,
isFormFamilyFile: isFormFamilyFile,
responseID: responseID);
// TODO: GET APP SMS SIGNATURE HERE
request.sMSSignature = await getSignature();
@ -368,11 +381,17 @@ class AuthenticationViewModel extends ChangeNotifier {
_appState.setUserRegistrationPayload = RegistrationDataModelPayload.fromJson(payload);
}
final resultEither = await _authenticationRepo.sendActivationCodeRepo(sendActivationCodeReq: request, isRegister: checkIsUserComingForRegister(request: payload), languageID: 'er');
final resultEither = await _authenticationRepo.sendActivationCodeRepo(
sendActivationCodeReq: request, isRegister: checkIsUserComingForRegister(request: payload), languageID: 'er', isFormFamilyFile: isFormFamilyFile);
resultEither.fold(
(failure) async => await _errorHandlerService.handleError(failure: failure),
(apiResponse) async {
int? patientShareRequestID = 0;
if (isFormFamilyFile) {
patientShareRequestID = apiResponse.data['PatientShareRequestID'];
_appState.setFamilyFileTokenID = apiResponse.data['LogInTokenID'];
}
if (apiResponse.messageStatus == 2) {
LoaderBottomSheet.hideLoader();
await _dialogService.showCommonBottomSheetWithoutH(
@ -383,7 +402,18 @@ class AuthenticationViewModel extends ChangeNotifier {
} else {
if (apiResponse.data != null && apiResponse.data['isSMSSent'] == true) {
LoaderBottomSheet.hideLoader();
if (!isComingFromResendOTP) navigateToOTPScreen(otpTypeEnum: otpTypeEnum, phoneNumber: phoneNumber, isComingFromRegister: checkIsUserComingForRegister(request: payload), payload: payload);
if (!isComingFromResendOTP) {
navigateToOTPScreen(
otpTypeEnum: otpTypeEnum,
phoneNumber: phoneNumber,
isComingFromRegister: checkIsUserComingForRegister(request: payload),
payload: payload,
isFormFamilyFile: isFormFamilyFile,
isExcludedUser: isExcludedUser,
responseID: responseID,
patientShareRequestID: patientShareRequestID,
);
}
} else {
// TODO: Handle isSMSSent false
// navigateToOTPScreen(otpTypeEnum: otpTypeEnum, phoneNumber: phoneNumber);
@ -401,8 +431,17 @@ class AuthenticationViewModel extends ChangeNotifier {
return isUserComingForRegister;
}
Future<void> checkActivationCode(
{required String? activationCode, required OTPTypeEnum otpTypeEnum, required Function(String? message) onWrongActivationCode, Function()? onResendActivation}) async {
Future<void> checkActivationCode({
required String? activationCode,
required OTPTypeEnum otpTypeEnum,
required Function(String? message) onWrongActivationCode,
Function()? onResendActivation,
bool isFormFamilyFile = false,
dynamic patientShareRequestID,
dynamic responseID,
bool isSwitchUser = false,
int? patientID,
}) async {
bool isForRegister = (_appState.getUserRegistrationPayload.healthId != null || _appState.getUserRegistrationPayload.patientOutSa == true || _appState.getUserRegistrationPayload.patientOutSa == 1);
final request = RequestUtils.getCommonRequestWelcome(
@ -428,6 +467,7 @@ class AuthenticationViewModel extends ChangeNotifier {
//TODO: Error Here IN Zip Code.
loginType: loginTypeEnum.toInt)
.toJson();
LoaderBottomSheet.showLoader();
if (isForRegister) {
if (_appState.getUserRegistrationPayload.patientOutSa == 0) request['DOB'] = _appState.getUserRegistrationPayload.dob;
@ -463,7 +503,17 @@ class AuthenticationViewModel extends ChangeNotifier {
}
});
} else {
final resultEither = await _authenticationRepo.checkActivationCodeRepo(newRequest: CheckActivationCodeRegisterReq.fromJson(request), activationCode: activationCode, isRegister: false);
final resultEither = await _authenticationRepo.checkActivationCodeRepo(
newRequest: CheckActivationCodeRegisterReq.fromJson(request),
activationCode: activationCode,
isRegister: false,
isFormFamilyFile: isFormFamilyFile,
patientShareRequestID: patientShareRequestID,
responseID: responseID,
isSwitchUser: isSwitchUser,
patientID: patientID,
loginType: _appState.getSuperUserID != null ? 0 : 2,
);
resultEither.fold(
(failure) async => await _errorHandlerService.handleError(
@ -494,48 +544,86 @@ class AuthenticationViewModel extends ChangeNotifier {
// Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew));
return;
} else {
if (activation.list != null && activation.list!.isNotEmpty) {
_appState.setAuthenticatedUser(activation.list!.first);
_appState.setPrivilegeModelList(activation.list!.first.listPrivilege!);
}
_appState.setUserBloodGroup = (activation.patientBlodType ?? "");
_appState.setAppAuthToken = activation.authenticationTokenId;
final request = RequestUtils.getAuthanticatedCommonRequest().toJson();
bool isUserAgreedBefore = await checkIfUserAgreedBefore(request: request);
//updating the last login type in app state to show the fingerprint/face id option on home screen
if (_appState.getSelectDeviceByImeiRespModelElement != null) {
_appState.getSelectDeviceByImeiRespModelElement!.logInType = loginTypeEnum.toInt;
}
LoaderBottomSheet.hideLoader();
insertPatientIMEIData(loginTypeEnum.toInt);
await clearDefaultInputValues();
if (isUserAgreedBefore) {
navigateToHomeScreen();
if (isFormFamilyFile) {
// await navigateToFamilyFilePage();
MedicalFileViewModel medicalVm = getIt<MedicalFileViewModel>();
if (!_appState.getIsChildLoggedIn) {
await medicalVm.getFamilyFiles(status: 0);
await medicalVm.getAllPendingRecordsByResponseId();
_navigationService.popUntilNamed(AppRoutes.landingScreen);
}
} else {
navigateToHomeScreen();
//Agreement page not designed yet so we are navigating to home screen directly
// getUserAgreementContent(request: request);
if (activation.list != null && activation.list!.isNotEmpty) {
if (isSwitchUser) {
if (_appState.getIsChildLoggedIn) {
_appState.setSuperUserID = null;
_appState.setIsChildLoggedIn = false;
activation.list!.first.isParentUser = true;
} else {
_appState.setSuperUserID = _appState.getAuthenticatedUser()?.patientId;
_appState.setIsChildLoggedIn = true;
activation.list!.first.isParentUser = false;
}
} else {
activation.list!.first.isParentUser = true;
}
activation.list!.first.bloodGroup = activation.patientBlodType;
_appState.setAuthenticatedUser(activation.list!.first);
_appState.setPrivilegeModelList(activation.list!.first.listPrivilege!);
}
// _appState.setUserBloodGroup = (activation.patientBlodType ?? "");
_appState.setAppAuthToken = activation.authenticationTokenId;
final request = await RequestUtils.getAuthanticatedCommonRequest().toJson();
bool isUserAgreedBefore = await checkIfUserAgreedBefore(request: request);
//updating the last login type in app state to show the fingerprint/face id option on home screen
if (_appState.getSelectDeviceByImeiRespModelElement != null) {
_appState.getSelectDeviceByImeiRespModelElement!.logInType = loginTypeEnum.toInt;
}
LoaderBottomSheet.hideLoader();
//
if (!isSwitchUser && !_appState.getIsChildLoggedIn) {
MedicalFileViewModel medicalVm = getIt<MedicalFileViewModel>();
await insertPatientIMEIData(loginTypeEnum.toInt);
await medicalVm.getFamilyFiles(status: 0); //TODO: Remove status: 1 by Aamir Need to Discuss With Sultan
await medicalVm.getAllPendingRecordsByResponseId();
}
await clearDefaultInputValues();
if (isUserAgreedBefore) {
navigateToHomeScreen();
} else {
MyAppointmentsViewModel myAppointmentsVM = getIt<MyAppointmentsViewModel>();
myAppointmentsVM.setIsAppointmentDataToBeLoaded(true);
navigateToHomeScreen();
//Agreement page not designed yet so we are navigating to home screen directly
// getUserAgreementContent(request: request);
}
// TODO: setPreferences and stuff
// sharedPref.remove(FAMILY_FILE);
// activation.list!.isFamily = false;
// userData = activation.list;
// sharedPref.setString(BLOOD_TYPE, activation.patientBloodType ?? "");
// authenticatedUserObject.user = activation.list!;
// projectViewModel.setPrivilege(privilegeList: res);
// await sharedPref.setObject(MAIN_USER, activation.list);
// await sharedPref.setObject(USER_PROFILE, activation.list);
// loginTokenID = activation.logInTokenID;
// await sharedPref.setObject(LOGIN_TOKEN_ID, activation.logInTokenID);
// await sharedPref.setString(TOKEN, activation.authenticationTokenID!);
// projectViewModel.analytics.loginRegistration.login_successful();
}
// TODO: setPreferences and stuff
// sharedPref.remove(FAMILY_FILE);
// activation.list!.isFamily = false;
// userData = activation.list;
// sharedPref.setString(BLOOD_TYPE, activation.patientBloodType ?? "");
// authenticatedUserObject.user = activation.list!;
// projectViewModel.setPrivilege(privilegeList: res);
// await sharedPref.setObject(MAIN_USER, activation.list);
// await sharedPref.setObject(USER_PROFILE, activation.list);
// loginTokenID = activation.logInTokenID;
// await sharedPref.setObject(LOGIN_TOKEN_ID, activation.logInTokenID);
// await sharedPref.setString(TOKEN, activation.authenticationTokenID!);
// projectViewModel.analytics.loginRegistration.login_successful();
}
});
}
}
Future<void> navigateToFamilyFilePage() async {
MedicalFileViewModel medicalFileVM = GetIt.instance<MedicalFileViewModel>();
medicalFileVM.handleFamilyFileRequestOTPVerification();
}
Future<bool> checkIfUserAgreedBefore({required dynamic request}) async {
bool isAgreed = false;
if (havePrivilege(109)) {
@ -573,13 +661,25 @@ class AuthenticationViewModel extends ChangeNotifier {
_navigationService.pushAndReplace(AppRoutes.landingScreen);
}
Future<void> navigateToOTPScreen({required OTPTypeEnum otpTypeEnum, required String phoneNumber, required bool isComingFromRegister, dynamic payload}) async {
Future<void> navigateToOTPScreen(
{required OTPTypeEnum otpTypeEnum,
required String phoneNumber,
required bool isComingFromRegister,
dynamic payload,
bool isFormFamilyFile = false,
bool isExcludedUser = false,
int? responseID,
int? patientShareRequestID}) async {
_navigationService.pushToOtpScreen(
phoneNumber: phoneNumber,
isFormFamilyFile: isFormFamilyFile,
checkActivationCode: (int activationCode) async {
await checkActivationCode(
activationCode: activationCode.toString(),
isFormFamilyFile: isFormFamilyFile,
otpTypeEnum: otpTypeEnum,
responseID: responseID,
patientShareRequestID: patientShareRequestID,
onWrongActivationCode: (String? value) {
onWrongActivationCode(message: value);
},
@ -587,12 +687,16 @@ class AuthenticationViewModel extends ChangeNotifier {
},
onResendOTPPressed: (String phoneNumber) async {
await sendActivationCode(
otpTypeEnum: otpTypeEnum,
phoneNumber: phoneNumberController.text,
nationalIdOrFileNumber: nationalIdController.text,
isForRegister: isComingFromRegister,
isComingFromResendOTP: true,
payload: payload);
otpTypeEnum: otpTypeEnum,
phoneNumber: phoneNumberController.text,
nationalIdOrFileNumber: nationalIdController.text,
isForRegister: isComingFromRegister,
isComingFromResendOTP: true,
payload: payload,
isFormFamilyFile: isFormFamilyFile,
isExcludedUser: isExcludedUser,
responseID: responseID,
);
},
);
}

@ -69,6 +69,8 @@ class AuthenticatedUser {
dynamic authenticatedUserPatientPayType;
dynamic authenticatedUserPatientType;
dynamic authenticatedUserStatus;
int? superUser;
bool? isParentUser;
AuthenticatedUser({
this.setupId,
@ -139,6 +141,8 @@ class AuthenticatedUser {
this.authenticatedUserPatientPayType,
this.authenticatedUserPatientType,
this.authenticatedUserStatus,
this.superUser,
this.isParentUser,
});
factory AuthenticatedUser.fromRawJson(String str) => AuthenticatedUser.fromJson(json.decode(str));
@ -146,146 +150,150 @@ class AuthenticatedUser {
String toRawJson() => json.encode(toJson());
factory AuthenticatedUser.fromJson(Map<String, dynamic> json) => AuthenticatedUser(
setupId: json["SetupID"],
patientType: json["PatientType"],
patientId: json["PatientID"],
firstName: json["FirstName"],
middleName: json["MiddleName"],
lastName: json["LastName"],
firstNameN: json["FirstNameN"],
middleNameN: json["MiddleNameN"],
lastNameN: json["LastNameN"],
relationshipId: json["RelationshipID"],
gender: json["Gender"],
dateofBirth: json["DateofBirth"],
dateofBirthN: json["DateofBirthN"],
nationalityId: json["NationalityID"],
phoneResi: json["PhoneResi"],
phoneOffice: json["PhoneOffice"],
mobileNumber: json["MobileNumber"],
faxNumber: json["FaxNumber"],
emailAddress: json["EmailAddress"],
bloodGroup: json["BloodGroup"],
rhFactor: json["RHFactor"],
isEmailAlertRequired: json["IsEmailAlertRequired"],
isSmsAlertRequired: json["IsSMSAlertRequired"],
preferredLanguage: json["PreferredLanguage"],
isPrivilegedMember: json["IsPrivilegedMember"],
memberId: json["MemberID"],
expiryDate: json["ExpiryDate"],
isHmgEmployee: json["IsHmgEmployee"],
employeeId: json["EmployeeID"],
emergencyContactName: json["EmergencyContactName"],
emergencyContactNo: json["EmergencyContactNo"],
patientPayType: json["PatientPayType"],
dhccPatientRefId: json["DHCCPatientRefID"],
isPatientDummy: json["IsPatientDummy"],
status: json["Status"],
isStatusCleared: json["IsStatusCleared"],
patientIdentificationType: json["PatientIdentificationType"],
patientIdentificationNo: json["PatientIdentificationNo"],
projectId: json["ProjectID"],
infoSourceId: json["InfoSourceID"],
address: json["Address"],
age: json["Age"],
ageDesc: json["AgeDesc"],
areaId: json["AreaID"],
crsVerificationStatus: json["CRSVerificationStatus"],
crsVerificationStatusDesc: json["CRSVerificationStatusDesc"],
crsVerificationStatusDescN: json["CRSVerificationStatusDescN"],
createdBy: json["CreatedBy"],
genderDescription: json["GenderDescription"],
healthIdFromNhicViaVida: json["HealthIDFromNHICViaVida"],
ir: json["IR"],
isoCityId: json["ISOCityID"],
isoCountryId: json["ISOCountryID"],
isVerfiedFromNhic: json["IsVerfiedFromNHIC"],
listPrivilege: json["ListPrivilege"] == null ? [] : List<ListPrivilege>.from(json["ListPrivilege"]!.map((x) => ListPrivilege.fromJson(x))),
marital: json["Marital"],
occupationId: json["OccupationID"],
outSa: json["OutSA"],
poBox: json["POBox"],
receiveHealthSummaryReport: json["ReceiveHealthSummaryReport"],
sourceType: json["SourceType"],
strDateofBirth: json["StrDateofBirth"],
tempAddress: json["TempAddress"],
zipCode: json["ZipCode"],
eHealthIdField: json["eHealthIDField"],
authenticatedUserPatientPayType: json["patientPayType"],
authenticatedUserPatientType: json["patientType"],
authenticatedUserStatus: json["status"],
);
setupId: json["SetupID"],
patientType: json["PatientType"],
patientId: json["PatientID"],
firstName: json["FirstName"],
middleName: json["MiddleName"],
lastName: json["LastName"],
firstNameN: json["FirstNameN"],
middleNameN: json["MiddleNameN"],
lastNameN: json["LastNameN"],
relationshipId: json["RelationshipID"],
gender: json["Gender"],
dateofBirth: json["DateofBirth"],
dateofBirthN: json["DateofBirthN"],
nationalityId: json["NationalityID"],
phoneResi: json["PhoneResi"],
phoneOffice: json["PhoneOffice"],
mobileNumber: json["MobileNumber"],
faxNumber: json["FaxNumber"],
emailAddress: json["EmailAddress"],
bloodGroup: json["BloodGroup"],
rhFactor: json["RHFactor"],
isEmailAlertRequired: json["IsEmailAlertRequired"],
isSmsAlertRequired: json["IsSMSAlertRequired"],
preferredLanguage: json["PreferredLanguage"],
isPrivilegedMember: json["IsPrivilegedMember"],
memberId: json["MemberID"],
expiryDate: json["ExpiryDate"],
isHmgEmployee: json["IsHmgEmployee"],
employeeId: json["EmployeeID"],
emergencyContactName: json["EmergencyContactName"],
emergencyContactNo: json["EmergencyContactNo"],
patientPayType: json["PatientPayType"],
dhccPatientRefId: json["DHCCPatientRefID"],
isPatientDummy: json["IsPatientDummy"],
status: json["Status"],
isStatusCleared: json["IsStatusCleared"],
patientIdentificationType: json["PatientIdentificationType"],
patientIdentificationNo: json["PatientIdentificationNo"],
projectId: json["ProjectID"],
infoSourceId: json["InfoSourceID"],
address: json["Address"],
age: json["Age"],
ageDesc: json["AgeDesc"],
areaId: json["AreaID"],
crsVerificationStatus: json["CRSVerificationStatus"],
crsVerificationStatusDesc: json["CRSVerificationStatusDesc"],
crsVerificationStatusDescN: json["CRSVerificationStatusDescN"],
createdBy: json["CreatedBy"],
genderDescription: json["GenderDescription"],
healthIdFromNhicViaVida: json["HealthIDFromNHICViaVida"],
ir: json["IR"],
isoCityId: json["ISOCityID"],
isoCountryId: json["ISOCountryID"],
isVerfiedFromNhic: json["IsVerfiedFromNHIC"],
listPrivilege: json["ListPrivilege"] == null ? [] : List<ListPrivilege>.from(json["ListPrivilege"]!.map((x) => ListPrivilege.fromJson(x))),
marital: json["Marital"],
occupationId: json["OccupationID"],
outSa: json["OutSA"],
poBox: json["POBox"],
receiveHealthSummaryReport: json["ReceiveHealthSummaryReport"],
sourceType: json["SourceType"],
strDateofBirth: json["StrDateofBirth"],
tempAddress: json["TempAddress"],
zipCode: json["ZipCode"],
eHealthIdField: json["eHealthIDField"],
authenticatedUserPatientPayType: json["patientPayType"],
authenticatedUserPatientType: json["patientType"],
authenticatedUserStatus: json["status"],
superUser: json["superUser"],
isParentUser: json["isParentUser"] ?? false,
);
Map<String, dynamic> toJson() => {
"SetupID": setupId,
"PatientType": patientType,
"PatientID": patientId,
"FirstName": firstName,
"MiddleName": middleName,
"LastName": lastName,
"FirstNameN": firstNameN,
"MiddleNameN": middleNameN,
"LastNameN": lastNameN,
"RelationshipID": relationshipId,
"Gender": gender,
"DateofBirth": dateofBirth,
"DateofBirthN": dateofBirthN,
"NationalityID": nationalityId,
"PhoneResi": phoneResi,
"PhoneOffice": phoneOffice,
"MobileNumber": mobileNumber,
"FaxNumber": faxNumber,
"EmailAddress": emailAddress,
"BloodGroup": bloodGroup,
"RHFactor": rhFactor,
"IsEmailAlertRequired": isEmailAlertRequired,
"IsSMSAlertRequired": isSmsAlertRequired,
"PreferredLanguage": preferredLanguage,
"IsPrivilegedMember": isPrivilegedMember,
"MemberID": memberId,
"ExpiryDate": expiryDate,
"IsHmgEmployee": isHmgEmployee,
"EmployeeID": employeeId,
"EmergencyContactName": emergencyContactName,
"EmergencyContactNo": emergencyContactNo,
"PatientPayType": patientPayType,
"DHCCPatientRefID": dhccPatientRefId,
"IsPatientDummy": isPatientDummy,
"Status": status,
"IsStatusCleared": isStatusCleared,
"PatientIdentificationType": patientIdentificationType,
"PatientIdentificationNo": patientIdentificationNo,
"ProjectID": projectId,
"InfoSourceID": infoSourceId,
"Address": address,
"Age": age,
"AgeDesc": ageDesc,
"AreaID": areaId,
"CRSVerificationStatus": crsVerificationStatus,
"CRSVerificationStatusDesc": crsVerificationStatusDesc,
"CRSVerificationStatusDescN": crsVerificationStatusDescN,
"CreatedBy": createdBy,
"GenderDescription": genderDescription,
"HealthIDFromNHICViaVida": healthIdFromNhicViaVida,
"IR": ir,
"ISOCityID": isoCityId,
"ISOCountryID": isoCountryId,
"IsVerfiedFromNHIC": isVerfiedFromNhic,
"ListPrivilege": listPrivilege == null ? [] : List<dynamic>.from(listPrivilege!.map((x) => x.toJson())),
"Marital": marital,
"OccupationID": occupationId,
"OutSA": outSa,
"POBox": poBox,
"ReceiveHealthSummaryReport": receiveHealthSummaryReport,
"SourceType": sourceType,
"StrDateofBirth": strDateofBirth,
"TempAddress": tempAddress,
"ZipCode": zipCode,
"eHealthIDField": eHealthIdField,
"patientPayType": authenticatedUserPatientPayType,
"patientType": authenticatedUserPatientType,
"status": authenticatedUserStatus,
};
"SetupID": setupId,
"PatientType": patientType,
"PatientID": patientId,
"FirstName": firstName,
"MiddleName": middleName,
"LastName": lastName,
"FirstNameN": firstNameN,
"MiddleNameN": middleNameN,
"LastNameN": lastNameN,
"RelationshipID": relationshipId,
"Gender": gender,
"DateofBirth": dateofBirth,
"DateofBirthN": dateofBirthN,
"NationalityID": nationalityId,
"PhoneResi": phoneResi,
"PhoneOffice": phoneOffice,
"MobileNumber": mobileNumber,
"FaxNumber": faxNumber,
"EmailAddress": emailAddress,
"BloodGroup": bloodGroup,
"RHFactor": rhFactor,
"IsEmailAlertRequired": isEmailAlertRequired,
"IsSMSAlertRequired": isSmsAlertRequired,
"PreferredLanguage": preferredLanguage,
"IsPrivilegedMember": isPrivilegedMember,
"MemberID": memberId,
"ExpiryDate": expiryDate,
"IsHmgEmployee": isHmgEmployee,
"EmployeeID": employeeId,
"EmergencyContactName": emergencyContactName,
"EmergencyContactNo": emergencyContactNo,
"PatientPayType": patientPayType,
"DHCCPatientRefID": dhccPatientRefId,
"IsPatientDummy": isPatientDummy,
"Status": status,
"IsStatusCleared": isStatusCleared,
"PatientIdentificationType": patientIdentificationType,
"PatientIdentificationNo": patientIdentificationNo,
"ProjectID": projectId,
"InfoSourceID": infoSourceId,
"Address": address,
"Age": age,
"AgeDesc": ageDesc,
"AreaID": areaId,
"CRSVerificationStatus": crsVerificationStatus,
"CRSVerificationStatusDesc": crsVerificationStatusDesc,
"CRSVerificationStatusDescN": crsVerificationStatusDescN,
"CreatedBy": createdBy,
"GenderDescription": genderDescription,
"HealthIDFromNHICViaVida": healthIdFromNhicViaVida,
"IR": ir,
"ISOCityID": isoCityId,
"ISOCountryID": isoCountryId,
"IsVerfiedFromNHIC": isVerfiedFromNhic,
"ListPrivilege": listPrivilege == null ? [] : List<dynamic>.from(listPrivilege!.map((x) => x.toJson())),
"Marital": marital,
"OccupationID": occupationId,
"OutSA": outSa,
"POBox": poBox,
"ReceiveHealthSummaryReport": receiveHealthSummaryReport,
"SourceType": sourceType,
"StrDateofBirth": strDateofBirth,
"TempAddress": tempAddress,
"ZipCode": zipCode,
"eHealthIDField": eHealthIdField,
"patientPayType": authenticatedUserPatientPayType,
"patientType": authenticatedUserPatientType,
"status": authenticatedUserStatus,
"superUser": superUser,
"isParentUser": isParentUser,
};
}
class ListPrivilege {
@ -306,16 +314,16 @@ class ListPrivilege {
String toRawJson() => json.encode(toJson());
factory ListPrivilege.fromJson(Map<String, dynamic> json) => ListPrivilege(
id: json["ID"],
serviceName: json["ServiceName"],
previlege: json["Previlege"],
region: json["Region"],
);
id: json["ID"],
serviceName: json["ServiceName"],
previlege: json["Previlege"],
region: json["Region"],
);
Map<String, dynamic> toJson() => {
"ID": id,
"ServiceName": serviceName,
"Previlege": previlege,
"Region": region,
};
"ID": id,
"ServiceName": serviceName,
"Previlege": previlege,
"Region": region,
};
}

@ -428,13 +428,9 @@ class OTPVerificationScreen extends StatefulWidget {
final String phoneNumber;
final Function(int code) checkActivationCode;
final Function(String phoneNumber) onResendOTPPressed;
final bool isFormFamilyFile;
const OTPVerificationScreen({
super.key,
required this.phoneNumber,
required this.checkActivationCode,
required this.onResendOTPPressed,
});
const OTPVerificationScreen({super.key, required this.phoneNumber, required this.checkActivationCode, required this.onResendOTPPressed, required this.isFormFamilyFile});
@override
State<OTPVerificationScreen> createState() => _OTPVerificationScreenState();
@ -559,7 +555,7 @@ class _OTPVerificationScreenState extends State<OTPVerificationScreen> {
LocaleKeys.weHaveSendOTP.tr().toText15(color: AppColors.inputLabelTextColor, letterSpacing: -0.4),
_getMaskedPhoneNumber().toText15(color: AppColors.inputLabelTextColor, isBold: true),
LocaleKeys.via.tr().toText15(color: AppColors.inputLabelTextColor, letterSpacing: -0.4),
authVM.loginTypeEnum.displayName.toText15(color: AppColors.inputLabelTextColor, isBold: true, letterSpacing: -0.4),
(widget.isFormFamilyFile ? LoginTypeEnum.sms.displayName : authVM.loginTypeEnum.displayName).toText15(color: AppColors.inputLabelTextColor, isBold: true, letterSpacing: -0.4),
appState.getUserRegistrationPayload.isRegister != null && appState.getUserRegistrationPayload.isRegister == true
? LocaleKeys.forRegistrationVerification.tr().toText15(color: AppColors.inputLabelTextColor, letterSpacing: -0.4)
: LocaleKeys.forLoginVerification.tr().toText15(color: AppColors.inputLabelTextColor, letterSpacing: -0.4),

@ -1,13 +1,17 @@
import 'dart:io';
import 'package:dartz/dartz.dart';
import 'package:hmg_patient_app_new/core/api/api_client.dart';
import 'package:hmg_patient_app_new/core/api_consts.dart';
import 'package:hmg_patient_app_new/core/common_models/generic_api_model.dart';
import 'package:hmg_patient_app_new/core/exceptions/api_failure.dart';
import 'package:hmg_patient_app_new/core/utils/date_util.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/dental_chief_complaints_response_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/doctor_profile_response_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/doctors_list_response_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/get_clinic_list_response_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/get_livecare_clinics_response_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/get_patient_dental_plan_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/hospital_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart';
import 'package:hmg_patient_app_new/services/logger_service.dart';
@ -21,7 +25,7 @@ abstract class BookAppointmentsRepo {
Future<Either<Failure, GenericApiModel<DoctorsProfileResponseModel>>> getDoctorProfile(int clinicID, int projectID, int doctorId, {Function(dynamic)? onSuccess, Function(String)? onError});
Future<Either<Failure, GenericApiModel<dynamic>>> getDoctorFreeSlots(int clinicID, int projectID, int doctorId, bool isBookingForLiveCare, {Function(dynamic)? onSuccess, Function(String)? onError});
Future<Either<Failure, GenericApiModel<dynamic>>> getDoctorFreeSlots(int clinicID, int projectID, int doctorId, bool isBookingForLiveCare, {bool continueDentalPlan = false, Function(dynamic)? onSuccess, Function(String)? onError});
Future<Either<Failure, GenericApiModel<dynamic>>> cancelAppointment({required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel});
@ -66,6 +70,15 @@ abstract class BookAppointmentsRepo {
required int serviceID,
Function(dynamic)? onSuccess,
Function(String)? onError});
Future<Either<Failure, GenericApiModel<List<PatientDentalPlanEstimationResponseModel>>>> getPatientDentalEstimation(
{required int projectID, Function(dynamic)? onSuccess, Function(String)? onError});
Future<Either<Failure, GenericApiModel<List<DentalChiefComplaintsListResponseModel>>>> getDentalChiefComplaintsList(
{required int projectID, required int clinicID, required int patientID, Function(dynamic)? onSuccess, Function(String)? onError});
Future<Either<Failure, GenericApiModel<List<DoctorsListResponseModel>>>> getDentalChiefComplaintDoctorsList(int projectID, int chiefComplaintID,
{Function(dynamic)? onSuccess, Function(String)? onError});
}
class BookAppointmentsRepoImp implements BookAppointmentsRepo {
@ -149,9 +162,6 @@ class BookAppointmentsRepoImp implements BookAppointmentsRepo {
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
final list = response['DoctorList'];
// if (list == null || list.isEmpty) {
// throw Exception("lab list is empty");
// }
final doctorsList = list.map((item) => DoctorsListResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<DoctorsListResponseModel>();
@ -226,7 +236,7 @@ class BookAppointmentsRepoImp implements BookAppointmentsRepo {
//TODO: Implement the logic for Dental & laser clinics
@override
Future<Either<Failure, GenericApiModel<dynamic>>> getDoctorFreeSlots(int clinicID, int projectID, int doctorId, bool isBookingForLiveCare,
{Function(dynamic)? onSuccess, Function(String)? onError}) async {
{bool continueDentalPlan = false, Function(dynamic)? onSuccess, Function(String)? onError}) async {
Map<String, dynamic> mapDevice = {
"DoctorID": doctorId,
"IsBookingForLiveCare": isBookingForLiveCare,
@ -235,6 +245,7 @@ class BookAppointmentsRepoImp implements BookAppointmentsRepo {
"OriginalClinicID": clinicID,
"days": 0,
"isReschadual": false,
"ContinueDentalPlan": continueDentalPlan
};
try {
@ -657,4 +668,136 @@ class BookAppointmentsRepoImp implements BookAppointmentsRepo {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel<List<PatientDentalPlanEstimationResponseModel>>>> getPatientDentalEstimation(
{required int projectID, Function(dynamic)? onSuccess, Function(String)? onError}) async {
Map<String, dynamic> mapDevice = {
"ProjectID": projectID,
};
try {
GenericApiModel<List<PatientDentalPlanEstimationResponseModel>>? apiResponse;
Failure? failure;
await apiClient.post(
HAS_DENTAL_PLAN,
body: mapDevice,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
onError!(error);
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
final list = response['List_IsPatientHasOnGoingEstimation'];
final estimationList = list.map((item) => PatientDentalPlanEstimationResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<PatientDentalPlanEstimationResponseModel>();
apiResponse = GenericApiModel<List<PatientDentalPlanEstimationResponseModel>>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: estimationList,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel<List<DentalChiefComplaintsListResponseModel>>>> getDentalChiefComplaintsList(
{required int projectID, required int clinicID, required int patientID, Function(dynamic)? onSuccess, Function(String)? onError}) async {
Map<String, dynamic> mapDevice = {
"PatientID": patientID,
"ClinicID": clinicID,
"ProjectID": projectID,
"isDentalAllowedBackend": true,
"ContinueDentalPlan": false,
"IsSearchAppointmnetByClinicID": false,
};
try {
GenericApiModel<List<DentalChiefComplaintsListResponseModel>>? apiResponse;
Failure? failure;
await apiClient.post(
GET_DOCTORS_LIST_URL,
body: mapDevice,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
onError!(error);
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
final list = response['List_DentalChiefComplain'];
final chiefComplaintsList = list.map((item) => DentalChiefComplaintsListResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<DentalChiefComplaintsListResponseModel>();
apiResponse = GenericApiModel<List<DentalChiefComplaintsListResponseModel>>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: chiefComplaintsList,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel<List<DoctorsListResponseModel>>>> getDentalChiefComplaintDoctorsList(int projectID, int chiefComplaintID,
{Function(dynamic)? onSuccess, Function(String)? onError}) async {
Map<String, dynamic> mapDevice = {
"ProjectID": projectID,
"ChiefComplaintID": chiefComplaintID,
"isDentalAllowedBackend": true,
"IsPublicRequest": true,
};
try {
GenericApiModel<List<DoctorsListResponseModel>>? apiResponse;
Failure? failure;
await apiClient.post(
GET_DENTAL_DOCTORS_LIST_URL,
body: mapDevice,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
onError!(error);
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
final list = response['List_DentalDoctorChiefComplaintMapping'];
final doctorsList = list.map((item) => DoctorsListResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<DoctorsListResponseModel>();
apiResponse = GenericApiModel<List<DoctorsListResponseModel>>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: doctorsList,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
}

@ -12,9 +12,11 @@ import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_repo.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/free_slot.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/dental_chief_complaints_response_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/doctor_profile_response_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/doctors_list_response_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/get_clinic_list_response_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/get_patient_dental_plan_response_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/timeslots.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/facility_selection.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/doctor_list_api_response.dart';
@ -26,8 +28,6 @@ import 'package:hmg_patient_app_new/services/error_handler_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
import 'package:location/location.dart' show Location;
import 'models/resp_models/get_livecare_clinics_response_model.dart';
@ -53,9 +53,17 @@ class BookAppointmentsViewModel extends ChangeNotifier {
List<GetClinicsListResponseModel> get filteredClinicsList => _filteredClinicsList;
List<DoctorsListResponseModel> doctorsList = [];
List<DoctorsListResponseModel> filteredDoctorList = [];
List<DoctorsListResponseModel> liveCareDoctorsList = [];
List<PatientDentalPlanEstimationResponseModel> patientDentalPlanEstimationList = [];
List<DentalChiefComplaintsListResponseModel> dentalChiefComplaintsList = [];
int totalTimeNeededForDentalProcedure = 0;
bool isContinueDentalPlan = false;
bool isChiefComplaintsListLoading = false;
int selectedChiefComplaintID = 0;
GetClinicsListResponseModel selectedClinic = GetClinicsListResponseModel();
DoctorsListResponseModel selectedDoctor = DoctorsListResponseModel();
GetLiveCareClinicsResponseModel selectedLiveCareClinic = GetLiveCareClinicsResponseModel();
@ -87,9 +95,21 @@ class BookAppointmentsViewModel extends ChangeNotifier {
bool shouldLoadSpecificClinic = false;
String? currentlySelectedHospitalFromRegionFlow;
///variables for doctor filter
List<String> searchedRegionList = [];
List<String> facilityList = ["hmgHospitals", "hmcMedicalClinic"];
List<String> searchedHospitalList = [];
List<PatientDoctorAppointmentList>
searchedPatientDoctorAppointmentHospitalsList = [];
List<String> searchedClinicList = [];
PatientDoctorAppointmentList? selectedHospitalForFilters;
List<String>? selectedFacilityForFilters = [], selectedRegionForFilters = [];
String? selectedClinicForFilters;
bool applyFilters = false;
BookAppointmentsViewModel(
{required this.bookAppointmentsRepo, required this.errorHandlerService, required this.navigationService, required this.myAppointmentsViewModel, required this.locationUtils}) {
;
initBookAppointmentViewModel();
}
@ -117,6 +137,10 @@ class BookAppointmentsViewModel extends ChangeNotifier {
clinicsList.clear();
doctorsList.clear();
liveCareClinicsList.clear();
patientDentalPlanEstimationList.clear();
dentalChiefComplaintsList.clear();
isContinueDentalPlan = false;
isChiefComplaintsListLoading = true;
// getLocation();
notifyListeners();
}
@ -178,6 +202,21 @@ class BookAppointmentsViewModel extends ChangeNotifier {
notifyListeners();
}
setIsContinueDentalPlan(bool value) {
isContinueDentalPlan = value;
notifyListeners();
}
setIsChiefComplaintsListLoading(bool value) {
isChiefComplaintsListLoading = value;
notifyListeners();
}
setSelectedChiefComplaintID(int id) {
selectedChiefComplaintID = id;
notifyListeners();
}
void onTabChanged(int index) {
selectedTabIndex = index;
notifyListeners();
@ -264,11 +303,10 @@ class BookAppointmentsViewModel extends ChangeNotifier {
}
//TODO: Make the API dynamic with parameters for ProjectID, isNearest, languageID, doctorId, doctorName
Future<void> getDoctorsList(
{int projectID = 0, bool isNearest = false, int doctorId = 0, String doctorName = "", isContinueDentalPlan = false, Function(dynamic)? onSuccess, Function(String)? onError}) async {
Future<void> getDoctorsList({int projectID = 0, bool isNearest = false, int doctorId = 0, String doctorName = "", Function(dynamic)? onSuccess, Function(String)? onError}) async {
doctorsList.clear();
projectID = currentlySelectedHospitalFromRegionFlow != null ? int.parse(currentlySelectedHospitalFromRegionFlow!) : projectID;
final result = await bookAppointmentsRepo.getDoctorsList(selectedClinic.clinicID ?? 0, projectID, isNearest, doctorId, doctorName);
final result = await bookAppointmentsRepo.getDoctorsList(selectedClinic.clinicID ?? 0, projectID, isNearest, doctorId, doctorName, isContinueDentalPlan: isContinueDentalPlan);
result.fold(
(failure) async {
@ -279,8 +317,11 @@ class BookAppointmentsViewModel extends ChangeNotifier {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
doctorsList = apiResponse.data!;
filteredDoctorList = doctorsList;
isDoctorsListLoading = false;
initializeFilteredList();
clearSearchFilters();
getFiltersFromDoctorList();
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
@ -353,7 +394,14 @@ class BookAppointmentsViewModel extends ChangeNotifier {
final DateFormat dateFormatter = DateFormat('yyyy-MM-dd');
Map<DateTime, List> _eventsParsed;
final result = await bookAppointmentsRepo.getDoctorFreeSlots(selectedDoctor.clinicID ?? 0, selectedDoctor.projectID ?? 0, selectedDoctor.doctorID ?? 0, isBookingForLiveCare, onError: onError);
final result = await bookAppointmentsRepo.getDoctorFreeSlots(
selectedDoctor.clinicID ?? 0,
selectedDoctor.projectID ?? 0,
selectedDoctor.doctorID ?? 0,
isBookingForLiveCare,
continueDentalPlan: isContinueDentalPlan,
onError: onError,
);
result.fold(
(failure) async {
@ -757,4 +805,216 @@ class BookAppointmentsViewModel extends ChangeNotifier {
void getLocation() {
locationUtils.getLocation();
}
void clearSearchFilters() {
searchedRegionList.clear();
searchedHospitalList.clear();
searchedPatientDoctorAppointmentHospitalsList.clear();
searchedClinicList.clear();
notifyListeners();
}
void clearSelection() {
selectedFacilityForFilters = [];
selectedClinicForFilters = null;
selectedHospitalForFilters = null;
selectedRegionForFilters = [];
applyFilters = false;
notifyListeners();
}
void setSelections(
List<String>? selectedFacilityForFilters,
List<String>? selectedRegionForFilters,
String? selectedClinicForFilters,
PatientDoctorAppointmentList? selectedHospitalForFilters,
bool applyFilters) {
this.selectedFacilityForFilters = selectedFacilityForFilters;
this.selectedClinicForFilters = selectedClinicForFilters;
this.selectedHospitalForFilters = selectedHospitalForFilters;
this.selectedRegionForFilters = selectedRegionForFilters;
this.applyFilters = applyFilters;
notifyListeners();
}
void getFiltersFromDoctorList() {
doctorsList.forEach((element) {
if (!searchedRegionList
.contains(element.getRegionName(_appState.isArabic()))) {
searchedRegionList
.add(element.getRegionName(_appState.isArabic()) ?? "");
}
if (!searchedHospitalList.contains(element.projectName)) {
searchedPatientDoctorAppointmentHospitalsList
.add(PatientDoctorAppointmentList()
..filterName = element.projectName
..isHMC = element.isHMC
..distanceInKMs = "0");
searchedHospitalList.add(element.projectName ?? "");
}
if (!searchedClinicList.contains(element.clinicName)) {
searchedClinicList.add(element.clinicName ?? "");
}
});
}
void updateApplyFilters(bool applyFilters) {
this.applyFilters = applyFilters;
notifyListeners();
}
void setSelectedRegion(String region) {
if (selectedRegionForFilters?.contains(region) == true) {
selectedRegionForFilters?.remove(region);
} else {
selectedRegionForFilters?.add(region);
}
notifyListeners();
}
void setSelectedHospital(PatientDoctorAppointmentList? hospital) {
selectedHospitalForFilters = hospital;
notifyListeners();
}
void setSelectedFacilityForFilter(String facility) {
if (selectedFacilityForFilters?.contains(facility) == true) {
selectedFacilityForFilters?.remove(facility);
} else {
selectedFacilityForFilters?.add(facility);
}
notifyListeners();
}
void setSelectedClinicForFilter(String? clinic) {
selectedClinicForFilters = clinic;
notifyListeners();
}
bool isArabic() {
return _appState.isArabic();
}
List<DoctorsListResponseModel> getDoctorListAsPerSelection() {
if (!applyFilters) return doctorsList;
if ((selectedRegionForFilters?.isEmpty == true) &&
(selectedFacilityForFilters?.isEmpty == true) &&
selectedClinicForFilters == null &&
selectedHospitalForFilters == null) {
return doctorsList;
}
var list = doctorsList.where((element) {
var isInSelectedRegion = (selectedRegionForFilters?.isEmpty == true)
? true
: selectedRegionForFilters
?.any((region) => region == element.getRegionName(isArabic()));
var shouldApplyFacilityFilter =
(selectedFacilityForFilters?.isEmpty == true) ? false : true;
var isHMC = (selectedFacilityForFilters?.isEmpty == true)
? true
: selectedFacilityForFilters?.any((item) => item.contains("hmc"));
var isInSelectedClinic = (selectedClinicForFilters == null)
? true
: selectedClinicForFilters == element.clinicName;
var isInSelectedHospital = (selectedHospitalForFilters == null)
? true
: element.projectName == selectedHospitalForFilters?.filterName;
var facilityFilter = ((shouldApplyFacilityFilter == true) ? isHMC : true);
return (isInSelectedRegion ?? true) &&
(facilityFilter ?? true) &&
isInSelectedClinic &&
isInSelectedHospital;
}).toList();
return list;
}
void updateList() {
filteredDoctorList = getDoctorListAsPerSelection();
notifyListeners();
}
Future<void> getPatientDentalEstimation({required int projectID, Function(dynamic)? onSuccess, Function(String)? onError}) async {
patientDentalPlanEstimationList.clear();
totalTimeNeededForDentalProcedure = 0;
isContinueDentalPlan = false;
notifyListeners();
final result = await bookAppointmentsRepo.getPatientDentalEstimation(projectID: projectID);
result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure),
(apiResponse) {
if (apiResponse.messageStatus == 2) {
onError!(apiResponse.errorMessage!);
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
patientDentalPlanEstimationList = apiResponse.data!;
patientDentalPlanEstimationList.forEach((v) {
totalTimeNeededForDentalProcedure += (v.neededTime ?? 0);
});
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
}
}
},
);
}
Future<void> getDentalChiefComplaintsList({Function(dynamic)? onSuccess, Function(String)? onError}) async {
dentalChiefComplaintsList.clear();
notifyListeners();
int patientID = _appState.isAuthenticated ? _appState.getAuthenticatedUser()!.patientId ?? -1 : -1;
final result = await bookAppointmentsRepo.getDentalChiefComplaintsList(patientID: patientID, projectID: int.parse(currentlySelectedHospitalFromRegionFlow ?? "0"), clinicID: 17);
result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure),
(apiResponse) {
if (apiResponse.messageStatus == 2) {
onError!(apiResponse.errorMessage!);
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
dentalChiefComplaintsList = apiResponse.data!;
isChiefComplaintsListLoading = false;
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
}
}
},
);
}
Future<void> getDentalChiefComplaintDoctorsList({int projectID = 0, Function(dynamic)? onSuccess, Function(String)? onError}) async {
doctorsList.clear();
projectID = currentlySelectedHospitalFromRegionFlow != null ? int.parse(currentlySelectedHospitalFromRegionFlow!) : projectID;
final result = await bookAppointmentsRepo.getDentalChiefComplaintDoctorsList(projectID, selectedChiefComplaintID);
result.fold(
(failure) async {
onError!("No doctors found for the search criteria...".needTranslation);
},
(apiResponse) {
if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
doctorsList = apiResponse.data!;
filteredDoctorList = doctorsList;
isDoctorsListLoading = false;
// initializeFilteredList();
// clearSearchFilters();
// getFiltersFromDoctorList();
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
}
}
},
);
}
}

@ -0,0 +1,24 @@
class DentalChiefComplaintsListResponseModel {
int? projectID;
int? iD;
String? name;
dynamic nameN;
DentalChiefComplaintsListResponseModel({this.projectID, this.iD, this.name, this.nameN});
DentalChiefComplaintsListResponseModel.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID'];
iD = json['ID'];
name = json['Name'];
nameN = json['NameN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ProjectID'] = this.projectID;
data['ID'] = this.iD;
data['Name'] = this.name;
data['NameN'] = this.nameN;
return data;
}
}

@ -0,0 +1,40 @@
class PatientDentalPlanEstimationResponseModel {
dynamic setupID;
dynamic estimationNo;
int? projectID;
String? procedureId;
int? patientID;
int? sequenceNo;
int? neededTime;
String? procedureName;
String? procedureNameN;
PatientDentalPlanEstimationResponseModel(
{this.setupID, this.estimationNo, this.projectID, this.procedureId, this.patientID, this.sequenceNo, this.neededTime, this.procedureName, this.procedureNameN});
PatientDentalPlanEstimationResponseModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
estimationNo = json['EstimationNo'];
projectID = json['ProjectID'];
procedureId = json['ProcedureId'];
patientID = json['PatientID'];
sequenceNo = json['sequenceNo'];
neededTime = json['NeededTime'];
procedureName = json['ProcedureName'];
procedureNameN = json['ProcedureNameN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['EstimationNo'] = this.estimationNo;
data['ProjectID'] = this.projectID;
data['ProcedureId'] = this.procedureId;
data['PatientID'] = this.patientID;
data['sequenceNo'] = this.sequenceNo;
data['NeededTime'] = this.neededTime;
data['ProcedureName'] = this.procedureName;
data['ProcedureNameN'] = this.procedureNameN;
return data;
}
}

@ -0,0 +1,57 @@
import 'dart:convert';
class FamilyFileRequest {
int? sharedPatientId;
String? sharedPatientIdentificationId;
int? searchType;
String? sharedPatientMobileNumber;
String? zipCode;
bool? isRegister;
int? patientStatus;
bool? isDentalAllowedBackend;
bool? isPatientExcluded;
int? responseID;
FamilyFileRequest({
this.sharedPatientId,
this.sharedPatientIdentificationId,
this.searchType,
this.sharedPatientMobileNumber,
this.zipCode,
this.isRegister,
this.patientStatus,
this.isDentalAllowedBackend,
this.isPatientExcluded,
this.responseID,
});
factory FamilyFileRequest.fromRawJson(String str) => FamilyFileRequest.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory FamilyFileRequest.fromJson(Map<String, dynamic> json) => FamilyFileRequest(
sharedPatientId: json["sharedPatientID"],
sharedPatientIdentificationId: json["sharedPatientIdentificationID"],
searchType: json["searchType"],
sharedPatientMobileNumber: json["sharedPatientMobileNumber"],
zipCode: json["zipCode"],
isRegister: json["isRegister"],
patientStatus: json["patientStatus"],
isDentalAllowedBackend: json["isDentalAllowedBackend"],
isPatientExcluded: json["IsPatientExcluded"],
responseID: json["ReponseID"],
);
Map<String, dynamic> toJson() => {
"SharedPatientID": sharedPatientId,
"SharedPatientIdentificationID": sharedPatientIdentificationId,
"SearchType": searchType,
"SharedPatientMobileNumber": sharedPatientMobileNumber,
"zipCode": zipCode,
"isRegister": isRegister,
"PatientStatus": patientStatus,
"isDentalAllowedBackend": isDentalAllowedBackend,
"IsPatientExcluded": isPatientExcluded,
"ReponseID": responseID,
};
}

@ -0,0 +1,110 @@
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/doctors_list_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/doctor_list_api_response.dart' show PatientDoctorAppointmentList;
class DoctorFilterViewModel extends ChangeNotifier{
late AppState appState;
DoctorFilterViewModel(){
appState = getIt();
}
List<String> searchedRegionList = [];
List<String> facilityList = ["hmgHospitals", "hmcMedicalClinic"];
List<String> searchedHospitalList = [];
List<PatientDoctorAppointmentList>
searchedPatientDoctorAppointmentHospitalsList = [];
List<String> searchedClinicList = [];
PatientDoctorAppointmentList? selectedHospitalForFilters;
List<String>? selectedFacilityForFilters = [] , selectedRegionForFilters = [];
String? selectedClinicForFilters;
bool applyFilters = false;
void clearSearchFilters() {
searchedRegionList.clear();
searchedHospitalList.clear();
searchedPatientDoctorAppointmentHospitalsList.clear();
searchedClinicList.clear();
notifyListeners();
}
void clearSelection() {
selectedFacilityForFilters = [];
selectedClinicForFilters = null;
selectedHospitalForFilters = null;
selectedRegionForFilters = [];
applyFilters = false;
notifyListeners();
}
void getFiltersFromDoctorList(List<DoctorsListResponseModel> doctorsList) {
doctorsList.forEach((element) {
if (!searchedRegionList
.contains(element.getRegionName(appState.isArabic()))) {
searchedRegionList
.add(element.getRegionName(appState.isArabic()) ?? "");
}
if (!searchedHospitalList.contains(element.projectName)) {
searchedPatientDoctorAppointmentHospitalsList
.add(PatientDoctorAppointmentList()
..filterName = element.projectName
..isHMC = element.isHMC
..distanceInKMs = "0");
searchedHospitalList.add(element.projectName ?? "");
}
if (!searchedClinicList.contains(element.clinicName)) {
searchedClinicList.add(element.clinicName ?? "");
}
});
}
void updateApplyFilters(bool applyFilters) {
this.applyFilters = applyFilters;
notifyListeners();
}
void setSelectedRegion(String region) {
if (selectedRegionForFilters?.contains(region) == true) {
selectedRegionForFilters?.remove(region);
} else {
selectedRegionForFilters?.add(region);
}
notifyListeners();
}
void setSelectedHospital(PatientDoctorAppointmentList? hospital) {
selectedHospitalForFilters = hospital;
notifyListeners();
}
void setSelectedFacilityForFilter(String facility) {
if (selectedFacilityForFilters?.contains(facility) == true) {
selectedFacilityForFilters?.remove(facility);
} else {
selectedFacilityForFilters?.add(facility);
}
notifyListeners();
}
void setSelectedClinicForFilter(String? clinic) {
selectedClinicForFilters = clinic;
notifyListeners();
}
void setSelections(
List<String>? selectedFacilityForFilters,
List<String>? selectedRegionForFilters,
String? selectedClinicForFilters,
PatientDoctorAppointmentList? selectedHospitalForFilters,
bool applyFilters) {
this.selectedFacilityForFilters = selectedFacilityForFilters;
this.selectedClinicForFilters = selectedClinicForFilters;
this.selectedHospitalForFilters = selectedHospitalForFilters;
this.selectedRegionForFilters = selectedRegionForFilters;
this.applyFilters = applyFilters;
notifyListeners();
}
}

@ -0,0 +1,206 @@
import 'dart:io';
import 'package:dartz/dartz.dart';
import 'package:hmg_patient_app_new/core/api/api_client.dart';
import 'package:hmg_patient_app_new/core/api_consts.dart';
import 'package:hmg_patient_app_new/core/common_models/generic_api_model.dart';
import 'package:hmg_patient_app_new/core/exceptions/api_failure.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/models/resp_models/get_livecare_immediate_clinics_response_model.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/models/resp_models/get_livecare_immediate_fees_response_model.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/models/resp_models/get_patient_livecare_history_response_model.dart';
import 'package:hmg_patient_app_new/services/logger_service.dart';
abstract class ImmediateLiveCareRepo {
Future<Either<Failure, GenericApiModel<List<GetLiveCareClinicListResponseModel>>>> getLiveCareImmediateClinicsList(int age, int genderID, {Function(dynamic)? onSuccess, Function(String)? onError});
Future<Either<Failure, GenericApiModel<LiveCareImmediateAppointmentFeesList>>> getLiveCareImmediateAppointmentFees(int age, int genderID, int serviceID,
{Function(dynamic)? onSuccess, Function(String)? onError});
Future<Either<Failure, GenericApiModel<dynamic>>> addNewCallRequestForImmediateLiveCare(
int age, int gender, int serviceID, String clientRequestID, int callTypeID, bool isPharma, String deviceToken, String voipToken,
{Function(dynamic)? onSuccess, Function(String)? onError});
Future<Either<Failure, GenericApiModel<List<PatientLiveCareHistory>>>> getPatientLiveCareHistory({Function(dynamic)? onSuccess, Function(String)? onError});
}
class ImmediateLiveCareRepoImp implements ImmediateLiveCareRepo {
final ApiClient apiClient;
final LoggerService loggerService;
ImmediateLiveCareRepoImp({required this.loggerService, required this.apiClient});
@override
Future<Either<Failure, GenericApiModel<List<GetLiveCareClinicListResponseModel>>>> getLiveCareImmediateClinicsList(int age, int genderID,
{Function(dynamic)? onSuccess, Function(String)? onError}) async {
Map<String, dynamic> mapDevice = {
"Age": age,
"Gender": genderID,
};
try {
GenericApiModel<List<GetLiveCareClinicListResponseModel>>? apiResponse;
Failure? failure;
await apiClient.post(
GET_LIVECARE_CLINICS,
body: mapDevice,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
onError!(error);
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
final list = response['PatientER_GetClinicsList'];
final clinicsList = list.map((item) => GetLiveCareClinicListResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<GetLiveCareClinicListResponseModel>();
apiResponse = GenericApiModel<List<GetLiveCareClinicListResponseModel>>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: clinicsList,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel<LiveCareImmediateAppointmentFeesList>>> getLiveCareImmediateAppointmentFees(int age, int genderID, int serviceID,
{Function(dynamic)? onSuccess, Function(String)? onError}) async {
Map<String, dynamic> mapDevice = {
"Age": age,
"Gender": genderID,
"ServiceID": serviceID,
};
try {
GenericApiModel<LiveCareImmediateAppointmentFeesList>? apiResponse;
Failure? failure;
await apiClient.post(
GET_ER_APPOINTMENT_FEES,
body: mapDevice,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
onError!(error);
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
final respObject = response['GetERAppointmentFeesList'];
final liveCareFeesObj = LiveCareImmediateAppointmentFeesList.fromJson(respObject);
apiResponse = GenericApiModel<LiveCareImmediateAppointmentFeesList>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: liveCareFeesObj,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel>> addNewCallRequestForImmediateLiveCare(
int age, int gender, int serviceID, String clientRequestID, int callTypeID, bool isPharma, String deviceToken, String voipToken,
{Function(dynamic p1)? onSuccess, Function(String p1)? onError}) async {
Map<String, dynamic> mapDevice = {
"IsPharmacy": isPharma,
"ErServiceID": serviceID,
"ClientRequestID": clientRequestID,
"DeviceToken": deviceToken,
"VoipToken": voipToken,
"IsFlutter": true,
"DeviceType": Platform.isIOS ? 'iOS' : 'Android',
"Age": age,
"Gender": gender,
"IsVoip": Platform.isIOS ? true : false,
"CallTypeID": callTypeID
};
try {
GenericApiModel<dynamic>? apiResponse;
Failure? failure;
await apiClient.post(
ADD_NEW_CALL_FOR_PATIENT_ER,
body: mapDevice,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
onError!(error);
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
apiResponse = GenericApiModel<dynamic>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: true,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel<List<PatientLiveCareHistory>>>> getPatientLiveCareHistory({Function(dynamic)? onSuccess, Function(String)? onError}) async {
Map<String, dynamic> mapDevice = {};
try {
GenericApiModel<List<PatientLiveCareHistory>>? apiResponse;
Failure? failure;
await apiClient.post(
GET_LIVECARE_HISTORY,
body: mapDevice,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
onError!(error);
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
final list = response['ErRequestHistoryList'];
final liveCareHistoryList = list.map((item) => PatientLiveCareHistory.fromJson(item as Map<String, dynamic>)).toList().cast<PatientLiveCareHistory>();
apiResponse = GenericApiModel<List<PatientLiveCareHistory>>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: liveCareHistoryList,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
}

@ -0,0 +1,162 @@
import 'package:flutter/cupertino.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/cache_consts.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/immediate_livecare_repo.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/models/resp_models/get_livecare_immediate_clinics_response_model.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/models/resp_models/get_livecare_immediate_fees_response_model.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/models/resp_models/get_patient_livecare_history_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart';
import 'package:hmg_patient_app_new/services/error_handler_service.dart';
import '../../services/navigation_service.dart';
class ImmediateLiveCareViewModel extends ChangeNotifier {
ImmediateLiveCareViewModel({
required this.immediateLiveCareRepo,
required this.errorHandlerService,
required this.navigationService,
required this.myAppointmentsViewModel,
});
ImmediateLiveCareRepo immediateLiveCareRepo;
ErrorHandlerService errorHandlerService;
final NavigationService navigationService;
MyAppointmentsViewModel myAppointmentsViewModel;
List<GetLiveCareClinicListResponseModel> immediateLiveCareClinicsList = [];
bool isImmediateLiveCareClinicsLoading = false;
int liveCareSelectedCallType = 0; // 1- Video, 2- Audio, 3- Phone
late GetLiveCareClinicListResponseModel immediateLiveCareSelectedClinic;
late LiveCareImmediateAppointmentFeesList liveCareImmediateAppointmentFeesList;
List<PatientLiveCareHistory> patientLiveCareHistoryList = [];
bool patientHasPendingLiveCareRequest = false;
late AppState _appState;
initImmediateLiveCare() {
_appState = getIt<AppState>();
immediateLiveCareClinicsList = [];
patientLiveCareHistoryList = [];
isImmediateLiveCareClinicsLoading = true;
patientHasPendingLiveCareRequest = false;
liveCareSelectedCallType = 0; // 1- Video, 2- Audio, 3- Phone
immediateLiveCareSelectedClinic = GetLiveCareClinicListResponseModel();
liveCareImmediateAppointmentFeesList = LiveCareImmediateAppointmentFeesList();
}
setLiveCareSelectedCallType(int value) {
liveCareSelectedCallType = value;
notifyListeners();
}
setImmediateLiveCareSelectedClinic(GetLiveCareClinicListResponseModel clinic) {
immediateLiveCareSelectedClinic = clinic;
notifyListeners();
}
Future<void> getLiveCareImmediateClinicsList({Function(dynamic)? onSuccess, Function(String)? onError}) async {
immediateLiveCareClinicsList.clear();
isImmediateLiveCareClinicsLoading = true;
notifyListeners();
final result = await immediateLiveCareRepo.getLiveCareImmediateClinicsList(_appState.getAuthenticatedUser()!.age!, _appState.getAuthenticatedUser()!.gender!);
result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure),
(apiResponse) {
if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
immediateLiveCareClinicsList = apiResponse.data!;
immediateLiveCareClinicsList.sort((a, b) => b.isOnline!.compareTo(a.isOnline!));
isImmediateLiveCareClinicsLoading = false;
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
}
}
},
);
}
Future<void> getLiveCareImmediateAppointmentFees({Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result =
await immediateLiveCareRepo.getLiveCareImmediateAppointmentFees(_appState.getAuthenticatedUser()!.age!, _appState.getAuthenticatedUser()!.gender!, immediateLiveCareSelectedClinic.serviceID!);
result.fold(
(failure) async {
onError!(failure.message);
},
(apiResponse) {
if (apiResponse.messageStatus == 2) {
onError!(apiResponse.errorMessage ?? "Unknown error occurred");
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
liveCareImmediateAppointmentFeesList = apiResponse.data!;
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
}
}
},
);
}
Future<void> addNewCallRequestForImmediateLiveCare(String transID, {Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await immediateLiveCareRepo.addNewCallRequestForImmediateLiveCare(_appState.getAuthenticatedUser()!.age!, _appState.getAuthenticatedUser()!.gender!,
immediateLiveCareSelectedClinic.serviceID!, transID, liveCareSelectedCallType, false, _appState.deviceToken, await Utils.getStringFromPrefs(CacheConst.voipToken));
result.fold(
(failure) async {
onError!(failure.message);
},
(apiResponse) {
if (apiResponse.messageStatus == 2) {
onError!(apiResponse.errorMessage ?? "Unknown error occurred");
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
}
}
},
);
}
Future<void> getPatientLiveCareHistory({Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await immediateLiveCareRepo.getPatientLiveCareHistory();
result.fold(
(failure) async {
onError!(failure.message);
},
(apiResponse) {
if (apiResponse.messageStatus == 2) {
onError!(apiResponse.errorMessage ?? "Unknown error occurred");
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
patientLiveCareHistoryList = apiResponse.data!;
if (patientLiveCareHistoryList.isNotEmpty) {
if (patientLiveCareHistoryList[0].callStatus! < 4) {
patientHasPendingLiveCareRequest = true;
} else {
patientHasPendingLiveCareRequest = false;
}
} else {
patientHasPendingLiveCareRequest = false;
}
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
}
}
},
);
}
}

@ -0,0 +1,97 @@
class GetLiveCareClinicListResponseModel {
int? iD;
int? serviceID;
String? serviceName;
String? serviceNameN;
int? clinicID;
int? age;
bool? isCheckAgeBelow;
int? gender;
bool? isActive;
String? createdOn;
String? createdBy;
int? isOnline;
bool? projectOutSA;
List<ShiftTimings>? shiftTimings;
GetLiveCareClinicListResponseModel(
{this.iD,
this.serviceID,
this.serviceName,
this.serviceNameN,
this.clinicID,
this.age,
this.isCheckAgeBelow,
this.gender,
this.isActive,
this.createdOn,
this.createdBy,
this.isOnline,
this.projectOutSA,
this.shiftTimings});
GetLiveCareClinicListResponseModel.fromJson(Map<String, dynamic> json) {
iD = json['ID'];
serviceID = json['ServiceID'];
serviceName = json['ServiceName'];
serviceNameN = json['ServiceNameN'];
clinicID = json['ClinicID'];
age = json['Age'];
isCheckAgeBelow = json['IsCheckAgeBelow'];
gender = json['Gender'];
isActive = json['IsActive'];
createdOn = json['CreatedOn'];
createdBy = json['CreatedBy'];
isOnline = json['IsOnline'];
projectOutSA = json['ProjectOutSA'];
if (json['ShiftTimings'] != null) {
shiftTimings = <ShiftTimings>[];
json['ShiftTimings'].forEach((v) {
shiftTimings!.add(new ShiftTimings.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
data['ID'] = this.iD;
data['ServiceID'] = this.serviceID;
data['ServiceName'] = this.serviceName;
data['ServiceNameN'] = this.serviceNameN;
data['ClinicID'] = this.clinicID;
data['Age'] = this.age;
data['IsCheckAgeBelow'] = this.isCheckAgeBelow;
data['Gender'] = this.gender;
data['IsActive'] = this.isActive;
data['CreatedOn'] = this.createdOn;
data['CreatedBy'] = this.createdBy;
data['IsOnline'] = this.isOnline;
data['ProjectOutSA'] = this.projectOutSA;
if (this.shiftTimings != null) {
data['ShiftTimings'] = this.shiftTimings!.map((v) => v.toJson()).toList();
}
return data;
}
}
class ShiftTimings {
String? endTime;
int? shiftID;
String? startTime;
ShiftTimings({this.endTime, this.shiftID, this.startTime});
ShiftTimings.fromJson(Map<String, dynamic> json) {
endTime = json['EndTime'];
shiftID = json['ShiftID'];
startTime = json['StartTime'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
data['EndTime'] = this.endTime;
data['ShiftID'] = this.shiftID;
data['StartTime'] = this.startTime;
return data;
}
}

@ -0,0 +1,37 @@
class LiveCareImmediateAppointmentFeesList {
String? amount;
String? companyName;
bool? isInsured;
bool? isShowInsuranceUpdateModule;
bool? isCash;
bool? isEligible;
String? tax;
String? total;
String? currency;
LiveCareImmediateAppointmentFeesList({this.amount, this.companyName, this.isInsured, this.isShowInsuranceUpdateModule, this.tax, this.total, this.currency});
LiveCareImmediateAppointmentFeesList.fromJson(Map<String, dynamic> json) {
amount = json['Amount'];
companyName = json['CompanyName'];
isInsured = json['IsInsured'];
isCash = json['IsCash'];
isEligible = json['IsEligible'];
isShowInsuranceUpdateModule = json['IsShowInsuranceUpdateModule'];
tax = json['Tax'];
total = json['Total'];
currency = json['currency'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Amount'] = this.amount;
data['CompanyName'] = this.companyName;
data['IsInsured'] = this.isInsured;
data['IsShowInsuranceUpdateModule'] = this.isShowInsuranceUpdateModule;
data['Tax'] = this.tax;
data['Total'] = this.total;
data['currency'] = this.currency;
return data;
}
}

@ -0,0 +1,84 @@
class PatientLiveCareHistory {
String? appointmentNo;
String? arrivalTime;
num? callDuration;
int? callStatus;
String? clientRequestID;
String? doctorID;
String? doctorName;
String? doctorNameN;
String? doctorTitle;
String? exWaitingTime;
bool? isAppointmentHaveRating;
int? patCount;
int? projectID;
String? sArrivalTime;
int? serviceID;
String? stringCallStatus;
int? vCID;
int? watingtimeInteger;
PatientLiveCareHistory(
{this.appointmentNo,
this.arrivalTime,
this.callDuration,
this.callStatus,
this.clientRequestID,
this.doctorID,
this.doctorName,
this.doctorNameN,
this.doctorTitle,
this.exWaitingTime,
this.isAppointmentHaveRating,
this.patCount,
this.projectID,
this.sArrivalTime,
this.serviceID,
this.stringCallStatus,
this.vCID,
this.watingtimeInteger});
PatientLiveCareHistory.fromJson(Map<String, dynamic> json) {
appointmentNo = json['AppointmentNo'];
arrivalTime = json['ArrivalTime'];
callDuration = json['CallDuration'];
callStatus = json['CallStatus'];
clientRequestID = json['ClientRequestID'];
doctorID = json['DoctorID'];
doctorName = json['DoctorName'];
doctorNameN = json['DoctorNameN'];
doctorTitle = json['DoctorTitle'];
exWaitingTime = json['Ex_WaitingTime'];
isAppointmentHaveRating = json['IsAppointmentHaveRating'];
patCount = json['Pat_Count'];
projectID = json['ProjectID'];
sArrivalTime = json['SArrivalTime'];
serviceID = json['ServiceID'];
stringCallStatus = json['StringCallStatus'];
vCID = json['VC_ID'];
watingtimeInteger = json['WatingtimeInteger'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['AppointmentNo'] = this.appointmentNo;
data['ArrivalTime'] = this.arrivalTime;
data['CallDuration'] = this.callDuration;
data['CallStatus'] = this.callStatus;
data['ClientRequestID'] = this.clientRequestID;
data['DoctorID'] = this.doctorID;
data['DoctorName'] = this.doctorName;
data['DoctorNameN'] = this.doctorNameN;
data['DoctorTitle'] = this.doctorTitle;
data['Ex_WaitingTime'] = this.exWaitingTime;
data['IsAppointmentHaveRating'] = this.isAppointmentHaveRating;
data['Pat_Count'] = this.patCount;
data['ProjectID'] = this.projectID;
data['SArrivalTime'] = this.sArrivalTime;
data['ServiceID'] = this.serviceID;
data['StringCallStatus'] = this.stringCallStatus;
data['VC_ID'] = this.vCID;
data['WatingtimeInteger'] = this.watingtimeInteger;
return data;
}
}

@ -3,6 +3,7 @@ import 'package:hmg_patient_app_new/core/api/api_client.dart';
import 'package:hmg_patient_app_new/core/api_consts.dart';
import 'package:hmg_patient_app_new/core/common_models/generic_api_model.dart';
import 'package:hmg_patient_app_new/core/exceptions/api_failure.dart';
import 'package:hmg_patient_app_new/features/insurance/models/resp_models/patient_insurance_approval_response_model.dart';
import 'package:hmg_patient_app_new/features/insurance/models/resp_models/patient_insurance_card_history.dart';
import 'package:hmg_patient_app_new/features/insurance/models/resp_models/patient_insurance_details_response_model.dart';
import 'package:hmg_patient_app_new/features/insurance/models/resp_models/patient_insurance_update_response_model.dart';
@ -11,9 +12,11 @@ import 'package:hmg_patient_app_new/services/logger_service.dart';
abstract class InsuranceRepo {
Future<Either<Failure, GenericApiModel<List<PatientInsuranceDetailsResponseModel>>>> getPatientInsuranceDetails();
Future<Either<Failure, GenericApiModel<List<PatientInsuranceCardHistoryResponseModel>>>> getPatientInsuranceCardHistory({required String patientId});
Future<Either<Failure, GenericApiModel<List<PatientInsuranceCardHistoryResponseModel>>>> getPatientInsuranceCardHistory();
Future<Either<Failure, GenericApiModel<PatientInsuranceUpdateResponseModel>>> getPatientInsuranceDetailsForUpdate({required String patientId, required String identificationNo});
Future<Either<Failure, GenericApiModel<List<InsuranceApprovalResponseModel>>>> getPatientInsuranceApprovalsList();
}
class InsuranceRepoImp implements InsuranceRepo {
@ -64,9 +67,8 @@ class InsuranceRepoImp implements InsuranceRepo {
}
@override
Future<Either<Failure, GenericApiModel<List<PatientInsuranceCardHistoryResponseModel>>>> getPatientInsuranceCardHistory({required String patientId}) async {
Future<Either<Failure, GenericApiModel<List<PatientInsuranceCardHistoryResponseModel>>>> getPatientInsuranceCardHistory() async {
Map<String, dynamic> mapDevice = {};
try {
GenericApiModel<List<PatientInsuranceCardHistoryResponseModel>>? apiResponse;
Failure? failure;
@ -144,4 +146,41 @@ class InsuranceRepoImp implements InsuranceRepo {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel<List<InsuranceApprovalResponseModel>>>> getPatientInsuranceApprovalsList() async {
Map<String, dynamic> mapDevice = {};
try {
GenericApiModel<List<InsuranceApprovalResponseModel>>? apiResponse;
Failure? failure;
await apiClient.post(
GET_PAtIENTS_INSURANCE_APPROVALS,
body: mapDevice,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
final list = response['HIS_Approval_List'];
final insuranceCardsList = list.map((item) => InsuranceApprovalResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<InsuranceApprovalResponseModel>();
apiResponse = GenericApiModel<List<InsuranceApprovalResponseModel>>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: insuranceCardsList,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
}

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/features/insurance/insurance_repo.dart';
import 'package:hmg_patient_app_new/features/insurance/models/resp_models/patient_insurance_approval_response_model.dart';
import 'package:hmg_patient_app_new/features/insurance/models/resp_models/patient_insurance_card_history.dart';
import 'package:hmg_patient_app_new/features/insurance/models/resp_models/patient_insurance_details_response_model.dart';
import 'package:hmg_patient_app_new/features/insurance/models/resp_models/patient_insurance_update_response_model.dart';
@ -12,24 +13,32 @@ class InsuranceViewModel extends ChangeNotifier {
bool isInsuranceDetailsLoading = false;
bool isInsuranceUpdateDetailsLoading = false;
bool isInsuranceDataToBeLoaded = true;
bool isInsuranceApprovalsLoading = false;
InsuranceRepo insuranceRepo;
ErrorHandlerService errorHandlerService;
List<PatientInsuranceDetailsResponseModel> patientInsuranceList = [];
List<PatientInsuranceCardHistoryResponseModel> patientInsuranceCardHistoryList = [];
List<InsuranceApprovalResponseModel> patientInsuranceApprovalsList = [];
PatientInsuranceUpdateResponseModel? patientInsuranceUpdateResponseModel;
InsuranceViewModel({required this.insuranceRepo, required this.errorHandlerService});
initInsuranceProvider() {
patientInsuranceList.clear();
if (isInsuranceDataToBeLoaded) {
patientInsuranceList.clear();
isInsuranceLoading = true;
getPatientInsuranceDetails();
}
patientInsuranceCardHistoryList.clear();
isInsuranceLoading = true;
isInsuranceHistoryLoading = true;
isInsuranceDetailsLoading = true;
isInsuranceUpdateDetailsLoading = true;
getPatientInsuranceDetails();
isInsuranceApprovalsLoading = true;
notifyListeners();
}
@ -48,13 +57,26 @@ class InsuranceViewModel extends ChangeNotifier {
notifyListeners();
}
setIsInsuranceDataToBeLoaded(bool val) {
isInsuranceDataToBeLoaded = val;
notifyListeners();
}
setIsInsuranceApprovalsLoading(bool val) {
isInsuranceApprovalsLoading = val;
notifyListeners();
}
Future<void> getPatientInsuranceDetails({Function(dynamic)? onSuccess, Function(String)? onError}) async {
if (!isInsuranceDataToBeLoaded) return;
final result = await insuranceRepo.getPatientInsuranceDetails();
result.fold(
// (failure) async => await errorHandlerService.handleError(failure: failure),
(failure) async {
isInsuranceLoading = false;
notifyListeners();
},
(apiResponse) {
if (apiResponse.messageStatus == 2) {
@ -62,6 +84,7 @@ class InsuranceViewModel extends ChangeNotifier {
} else if (apiResponse.messageStatus == 1) {
patientInsuranceList = apiResponse.data!;
isInsuranceLoading = false;
isInsuranceDataToBeLoaded = false;
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
@ -72,10 +95,13 @@ class InsuranceViewModel extends ChangeNotifier {
}
Future<void> getPatientInsuranceCardHistory({Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await insuranceRepo.getPatientInsuranceCardHistory(patientId: "1231755");
final result = await insuranceRepo.getPatientInsuranceCardHistory();
result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure),
(failure) async {
isInsuranceHistoryLoading = false;
notifyListeners();
},
(apiResponse) {
if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
@ -96,7 +122,10 @@ class InsuranceViewModel extends ChangeNotifier {
final result = await insuranceRepo.getPatientInsuranceDetailsForUpdate(patientId: patientID, identificationNo: identificationNo);
result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure),
(failure) async {
isInsuranceUpdateDetailsLoading = false;
notifyListeners();
},
(apiResponse) {
if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
@ -111,4 +140,27 @@ class InsuranceViewModel extends ChangeNotifier {
},
);
}
Future<void> getPatientInsuranceApprovalsList({Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await insuranceRepo.getPatientInsuranceApprovalsList();
result.fold(
(failure) async {
isInsuranceApprovalsLoading = false;
notifyListeners();
},
(apiResponse) {
if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
patientInsuranceApprovalsList = apiResponse.data!;
isInsuranceApprovalsLoading = false;
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
}
}
},
);
}
}

@ -0,0 +1,465 @@
class InsuranceApprovalResponseModel {
String? setupID;
int? projectID;
int? approvalNo;
String? approvalDate;
int? patientType;
int? patientID;
int? companyID;
int? subCategoryID;
int? doctorID;
int? clinicID;
int? approvalType;
String? inpatientApprovalSubType;
String? validFrom;
String? vaildDays;
String? validTo;
bool? isApprovalOnGross;
bool? isPackage;
int? requestedAmount;
int? actualApprovedAmount;
int? aviliableAmount;
String? companyApprovalNo;
int? progNoteOrderNo;
String? submitOn;
String? receiptOn;
String? remarks1;
String? remarks2;
int? status;
String? feedbackStatusBy;
String? feedbackStatus;
String? feedbackStatusOn;
int? authorizerID;
String? expiryDate;
int? appointmentNo;
int? admissionNo;
int? admissionRequestNo;
int? createdBy;
String? createdOn;
int? editedBy;
String? editedOn;
String? rowVer;
bool? isAddlDiscApplied;
int? inProgressReasonID;
String? extendedBy;
String? extendedOn;
int? subPolicyNo;
int? noOrderAuthorizerID;
bool? isVerbalApproval;
String? subStatus;
bool? isNotificationSend;
String? eApprovalStatus;
String? eApprovalRemarks;
bool? isEmailSentOnDelayApproval;
int? eAuthorizationID;
InsuranceApprovalDetails? apporvalDetails;
String? approvalStatusDescption;
String? clinicName;
String? clinicNameN;
String? companyName;
String? doctorImageURL;
String? doctorName;
String? doctorNameN;
int? doctorRate;
String? doctorTitle;
int? gender;
String? genderDescription;
bool? isActiveDoctorProfile;
bool? isExecludeDoctor;
bool? isInOutPatient;
String? isInOutPatientDescription;
String? isInOutPatientDescriptionN;
bool? isLiveCareAppointment;
String? projectName;
String? projectNameN;
String? qR;
List<String>? speciality;
String? strApprovalDate;
String? strExpiryDate;
String? strSubmitDate;
int? totaUnUsedCount;
int? unUsedCount;
InsuranceApprovalResponseModel(
{this.setupID,
this.projectID,
this.approvalNo,
this.approvalDate,
this.patientType,
this.patientID,
this.companyID,
this.subCategoryID,
this.doctorID,
this.clinicID,
this.approvalType,
this.inpatientApprovalSubType,
this.validFrom,
this.vaildDays,
this.validTo,
this.isApprovalOnGross,
this.isPackage,
this.requestedAmount,
this.actualApprovedAmount,
this.aviliableAmount,
this.companyApprovalNo,
this.progNoteOrderNo,
this.submitOn,
this.receiptOn,
this.remarks1,
this.remarks2,
this.status,
this.feedbackStatusBy,
this.feedbackStatus,
this.feedbackStatusOn,
this.authorizerID,
this.expiryDate,
this.appointmentNo,
this.admissionNo,
this.admissionRequestNo,
this.createdBy,
this.createdOn,
this.editedBy,
this.editedOn,
this.rowVer,
this.isAddlDiscApplied,
this.inProgressReasonID,
this.extendedBy,
this.extendedOn,
this.subPolicyNo,
this.noOrderAuthorizerID,
this.isVerbalApproval,
this.subStatus,
this.isNotificationSend,
this.eApprovalStatus,
this.eApprovalRemarks,
this.isEmailSentOnDelayApproval,
this.eAuthorizationID,
this.apporvalDetails,
this.approvalStatusDescption,
this.clinicName,
this.clinicNameN,
this.companyName,
this.doctorImageURL,
this.doctorName,
this.doctorNameN,
this.doctorRate,
this.doctorTitle,
this.gender,
this.genderDescription,
this.isActiveDoctorProfile,
this.isExecludeDoctor,
this.isInOutPatient,
this.isInOutPatientDescription,
this.isInOutPatientDescriptionN,
this.isLiveCareAppointment,
this.projectName,
this.projectNameN,
this.qR,
this.speciality,
this.strApprovalDate,
this.strExpiryDate,
this.strSubmitDate,
this.totaUnUsedCount,
this.unUsedCount});
InsuranceApprovalResponseModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
approvalNo = json['ApprovalNo'];
approvalDate = json['ApprovalDate'];
patientType = json['PatientType'];
patientID = json['PatientID'];
companyID = json['CompanyID'];
subCategoryID = json['SubCategoryID'];
doctorID = json['DoctorID'];
clinicID = json['ClinicID'];
approvalType = json['ApprovalType'];
inpatientApprovalSubType = json['InpatientApprovalSubType'];
validFrom = json['ValidFrom'];
vaildDays = json['VaildDays'];
validTo = json['ValidTo'];
isApprovalOnGross = json['IsApprovalOnGross'];
isPackage = json['IsPackage'];
requestedAmount = json['RequestedAmount'];
actualApprovedAmount = json['ActualApprovedAmount'];
aviliableAmount = json['AviliableAmount'];
companyApprovalNo = json['CompanyApprovalNo'];
progNoteOrderNo = json['ProgNoteOrderNo'];
submitOn = json['SubmitOn'];
receiptOn = json['ReceiptOn'];
remarks1 = json['Remarks1'];
remarks2 = json['Remarks2'];
status = json['Status'];
feedbackStatusBy = json['FeedbackStatusBy'];
feedbackStatus = json['FeedbackStatus'];
feedbackStatusOn = json['FeedbackStatusOn'];
authorizerID = json['AuthorizerID'];
expiryDate = json['ExpiryDate'];
appointmentNo = json['AppointmentNo'];
admissionNo = json['AdmissionNo'];
admissionRequestNo = json['AdmissionRequestNo'];
createdBy = json['CreatedBy'];
createdOn = json['CreatedOn'];
editedBy = json['EditedBy'];
editedOn = json['EditedOn'];
rowVer = json['RowVer'];
isAddlDiscApplied = json['IsAddlDiscApplied'];
inProgressReasonID = json['InProgressReasonID'];
extendedBy = json['ExtendedBy'];
extendedOn = json['ExtendedOn'];
subPolicyNo = json['SubPolicyNo'];
noOrderAuthorizerID = json['NoOrderAuthorizerID'];
isVerbalApproval = json['isVerbalApproval'];
subStatus = json['SubStatus'];
isNotificationSend = json['IsNotificationSend'];
eApprovalStatus = json['EApprovalStatus'];
eApprovalRemarks = json['EApprovalRemarks'];
isEmailSentOnDelayApproval = json['IsEmailSentOnDelayApproval'];
eAuthorizationID = json['EAuthorizationID'];
if (json['ApporvalDetails'] != null && json['ApporvalDetails'].length != 0) {
apporvalDetails = InsuranceApprovalDetails.fromJson(json['ApporvalDetails'][0]);
}
approvalStatusDescption = json['ApprovalStatusDescption'];
clinicName = json['ClinicName'];
clinicNameN = json['ClinicNameN'];
companyName = json['CompanyName'];
doctorImageURL = json['DoctorImageURL'];
doctorName = json['DoctorName'];
doctorNameN = json['DoctorNameN'];
doctorRate = json['DoctorRate'];
doctorTitle = json['DoctorTitle'];
gender = json['Gender'];
genderDescription = json['GenderDescription'];
isActiveDoctorProfile = json['IsActiveDoctorProfile'];
isExecludeDoctor = json['IsExecludeDoctor'];
isInOutPatient = json['IsInOutPatient'];
isInOutPatientDescription = json['IsInOutPatientDescription'];
isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN'];
isLiveCareAppointment = json['IsLiveCareAppointment'];
projectName = json['ProjectName'];
projectNameN = json['ProjectNameN'];
qR = json['QR'];
if (json['Speciality'] != null) speciality = json['Speciality'].cast<String>();
strApprovalDate = json['StrApprovalDate'];
strExpiryDate = json['StrExpiryDate'];
strSubmitDate = json['StrSubmitDate'];
totaUnUsedCount = json['TotaUnUsedCount'];
unUsedCount = json['UnUsedCount'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['ApprovalNo'] = this.approvalNo;
data['ApprovalDate'] = this.approvalDate;
data['PatientType'] = this.patientType;
data['PatientID'] = this.patientID;
data['CompanyID'] = this.companyID;
data['SubCategoryID'] = this.subCategoryID;
data['DoctorID'] = this.doctorID;
data['ClinicID'] = this.clinicID;
data['ApprovalType'] = this.approvalType;
data['InpatientApprovalSubType'] = this.inpatientApprovalSubType;
data['ValidFrom'] = this.validFrom;
data['VaildDays'] = this.vaildDays;
data['ValidTo'] = this.validTo;
data['IsApprovalOnGross'] = this.isApprovalOnGross;
data['IsPackage'] = this.isPackage;
data['RequestedAmount'] = this.requestedAmount;
data['ActualApprovedAmount'] = this.actualApprovedAmount;
data['AviliableAmount'] = this.aviliableAmount;
data['CompanyApprovalNo'] = this.companyApprovalNo;
data['ProgNoteOrderNo'] = this.progNoteOrderNo;
data['SubmitOn'] = this.submitOn;
data['ReceiptOn'] = this.receiptOn;
data['Remarks1'] = this.remarks1;
data['Remarks2'] = this.remarks2;
data['Status'] = this.status;
data['FeedbackStatusBy'] = this.feedbackStatusBy;
data['FeedbackStatus'] = this.feedbackStatus;
data['FeedbackStatusOn'] = this.feedbackStatusOn;
data['AuthorizerID'] = this.authorizerID;
data['ExpiryDate'] = this.expiryDate;
data['AppointmentNo'] = this.appointmentNo;
data['AdmissionNo'] = this.admissionNo;
data['AdmissionRequestNo'] = this.admissionRequestNo;
data['CreatedBy'] = this.createdBy;
data['CreatedOn'] = this.createdOn;
data['EditedBy'] = this.editedBy;
data['EditedOn'] = this.editedOn;
data['RowVer'] = this.rowVer;
data['IsAddlDiscApplied'] = this.isAddlDiscApplied;
data['InProgressReasonID'] = this.inProgressReasonID;
data['ExtendedBy'] = this.extendedBy;
data['ExtendedOn'] = this.extendedOn;
data['SubPolicyNo'] = this.subPolicyNo;
data['NoOrderAuthorizerID'] = this.noOrderAuthorizerID;
data['isVerbalApproval'] = this.isVerbalApproval;
data['SubStatus'] = this.subStatus;
data['IsNotificationSend'] = this.isNotificationSend;
data['EApprovalStatus'] = this.eApprovalStatus;
data['EApprovalRemarks'] = this.eApprovalRemarks;
data['IsEmailSentOnDelayApproval'] = this.isEmailSentOnDelayApproval;
data['EAuthorizationID'] = this.eAuthorizationID;
if (this.apporvalDetails != null) {
data['ApporvalDetails'] = this.apporvalDetails!.toJson;
}
data['ApprovalStatusDescption'] = this.approvalStatusDescption;
data['ClinicName'] = this.clinicName;
data['ClinicNameN'] = this.clinicNameN;
data['CompanyName'] = this.companyName;
data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorName'] = this.doctorName;
data['DoctorNameN'] = this.doctorNameN;
data['DoctorRate'] = this.doctorRate;
data['DoctorTitle'] = this.doctorTitle;
data['Gender'] = this.gender;
data['GenderDescription'] = this.genderDescription;
data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile;
data['IsExecludeDoctor'] = this.isExecludeDoctor;
data['IsInOutPatient'] = this.isInOutPatient;
data['IsInOutPatientDescription'] = this.isInOutPatientDescription;
data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN;
data['IsLiveCareAppointment'] = this.isLiveCareAppointment;
data['ProjectName'] = this.projectName;
data['ProjectNameN'] = this.projectNameN;
data['QR'] = this.qR;
data['Speciality'] = this.speciality;
data['StrApprovalDate'] = this.strApprovalDate;
data['StrExpiryDate'] = this.strExpiryDate;
data['StrSubmitDate'] = this.strSubmitDate;
data['TotaUnUsedCount'] = this.totaUnUsedCount;
data['UnUsedCount'] = this.unUsedCount;
return data;
}
}
class InsuranceApprovalDetails {
int? setupID;
int? projectID;
int? approvalNo;
int? lineItemNo;
int? orderType;
int? procedureID;
int? toothNo;
int? price;
int? approvedAmount;
String? unapprovedPatientShare;
int? waivedAmount;
String? discountType;
int? discountValue;
String? shareType;
String? patientShareTypeValue;
String? companyShareTypeValue;
String? patientShare;
String? companyShare;
int? deductableAmount;
String? disapprovedRemarks;
int? progNoteOrderNo;
int? progNoteLineItemNo;
String? invoiceTransactionType;
int? invoiceNo;
String? procedureName;
String? procedureNameN;
String? status;
bool? isInvoiced;
String? isInvoicedDesc;
InsuranceApprovalDetails(
{this.setupID,
this.projectID,
this.approvalNo,
this.lineItemNo,
this.orderType,
this.procedureID,
this.toothNo,
this.price,
this.approvedAmount,
this.unapprovedPatientShare,
this.waivedAmount,
this.discountType,
this.discountValue,
this.shareType,
this.patientShareTypeValue,
this.companyShareTypeValue,
this.patientShare,
this.companyShare,
this.deductableAmount,
this.disapprovedRemarks,
this.progNoteOrderNo,
this.progNoteLineItemNo,
this.invoiceTransactionType,
this.invoiceNo,
this.procedureName,
this.procedureNameN,
this.status,
this.isInvoiced,
this.isInvoicedDesc});
InsuranceApprovalDetails.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
approvalNo = json['ApprovalNo'];
lineItemNo = json['LineItemNo'];
orderType = json['OrderType'];
procedureID = json['ProcedureID'];
toothNo = json['ToothNo'];
price = json['Price'];
approvedAmount = json['ApprovedAmount'];
unapprovedPatientShare = json['UnapprovedPatientShare'];
waivedAmount = json['WaivedAmount'];
discountType = json['DiscountType'];
discountValue = json['DiscountValue'];
shareType = json['ShareType'];
patientShareTypeValue = json['PatientShareTypeValue'];
companyShareTypeValue = json['CompanyShareTypeValue'];
patientShare = json['PatientShare'];
companyShare = json['CompanyShare'];
deductableAmount = json['DeductableAmount'];
disapprovedRemarks = json['DisapprovedRemarks'];
progNoteOrderNo = json['ProgNoteOrderNo'];
progNoteLineItemNo = json['ProgNoteLineItemNo'];
invoiceTransactionType = json['InvoiceTransactionType'];
invoiceNo = json['InvoiceNo'];
procedureName = json['ProcedureName'];
procedureNameN = json['ProcedureNameN'];
status = json['Status'];
isInvoiced = json['IsInvoiced'];
isInvoicedDesc = json['IsInvoicedDesc'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['ApprovalNo'] = this.approvalNo;
data['LineItemNo'] = this.lineItemNo;
data['OrderType'] = this.orderType;
data['ProcedureID'] = this.procedureID;
data['ToothNo'] = this.toothNo;
data['Price'] = this.price;
data['ApprovedAmount'] = this.approvedAmount;
data['UnapprovedPatientShare'] = this.unapprovedPatientShare;
data['WaivedAmount'] = this.waivedAmount;
data['DiscountType'] = this.discountType;
data['DiscountValue'] = this.discountValue;
data['ShareType'] = this.shareType;
data['PatientShareTypeValue'] = this.patientShareTypeValue;
data['CompanyShareTypeValue'] = this.companyShareTypeValue;
data['PatientShare'] = this.patientShare;
data['CompanyShare'] = this.companyShare;
data['DeductableAmount'] = this.deductableAmount;
data['DisapprovedRemarks'] = this.disapprovedRemarks;
data['ProgNoteOrderNo'] = this.progNoteOrderNo;
data['ProgNoteLineItemNo'] = this.progNoteLineItemNo;
data['InvoiceTransactionType'] = this.invoiceTransactionType;
data['InvoiceNo'] = this.invoiceNo;
data['ProcedureName'] = this.procedureName;
data['ProcedureNameN'] = this.procedureNameN;
data['Status'] = this.status;
data['IsInvoiced'] = this.isInvoiced;
data['IsInvoicedDesc'] = this.isInvoicedDesc;
return data;
}
}

@ -4,6 +4,7 @@ import 'package:hmg_patient_app_new/core/exceptions/api_failure.dart';
import 'package:hmg_patient_app_new/core/common_models/generic_api_model.dart';
import 'package:dartz/dartz.dart';
import 'package:hmg_patient_app_new/features/lab/models/resp_models/patient_lab_orders_response_model.dart';
import 'package:hmg_patient_app_new/features/lab/models/resp_models/patient_lab_special_result.dart';
import 'package:hmg_patient_app_new/services/logger_service.dart';
import 'models/resp_models/lab_result.dart' show LabResult;
@ -11,6 +12,14 @@ import 'models/resp_models/lab_result.dart' show LabResult;
abstract class LabRepo {
Future<Either<Failure, GenericApiModel<List<PatientLabOrdersResponseModel>>>> getPatientLabOrders();
Future<Either<Failure, GenericApiModel<List<LabResult>>>> getPatientLabResults(PatientLabOrdersResponseModel laborder, bool isVidaPlus, String procedureName);
Future<Either<Failure, GenericApiModel<List<LabResult>>>>
getPatientLabResultsByHospitals(
PatientLabOrdersResponseModel laborder, bool isVidaPlus);
Future<Either<Failure, GenericApiModel<List<PatientLabSpecialResult>>>>
getSpecialLabResult(
PatientLabOrdersResponseModel laborder, bool isVidaPlus);
}
class LabRepoImp implements LabRepo {
@ -73,7 +82,6 @@ class LabRepoImp implements LabRepo {
request['ProjectID'] = laborder.projectID;
request['ClinicID'] = laborder.clinicID;
request['Procedure'] = procedureName;
request['LanguageID'] = 1;
try {
GenericApiModel<List<LabResult>>? apiResponse;
Failure? failure;
@ -90,6 +98,58 @@ class LabRepoImp implements LabRepo {
throw Exception("lab list is empty");
}
final labOrders = list
.map((item) => LabResult.fromJson(item as Map<String, dynamic>))
.toList()
.cast<LabResult>();
apiResponse = GenericApiModel<List<LabResult>>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: labOrders,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel<List<LabResult>>>>
getPatientLabResultsByHospitals(
PatientLabOrdersResponseModel laborder, bool isVidaPlus) async {
Map<String, dynamic> request = Map();
request['InvoiceNo_VP'] = isVidaPlus ? laborder!.invoiceNo : "0";
request['InvoiceNo'] = isVidaPlus ? "0" : laborder!.invoiceNo;
request['OrderNo'] = laborder!.orderNo;
request['isDentalAllowedBackend'] = false;
request['SetupID'] = laborder!.setupID;
request['ProjectID'] = laborder.projectID;
request['ClinicID'] = laborder.clinicID;
try {
GenericApiModel<List<LabResult>>? apiResponse;
Failure? failure;
await apiClient.post(
GET_Patient_LAB_RESULT,
body: request,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
final list = response['ListPLR'];
if (list == null || list.isEmpty) {
throw Exception("lab list is empty");
}
final labOrders = list.map((item) => LabResult.fromJson(item as Map<String, dynamic>)).toList().cast<LabResult>();
apiResponse = GenericApiModel<List<LabResult>>(
@ -110,4 +170,57 @@ class LabRepoImp implements LabRepo {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel<List<PatientLabSpecialResult>>>>
getSpecialLabResult(
PatientLabOrdersResponseModel laborder, bool isVidaPlus) async {
Map<String, dynamic> request = Map();
request['InvoiceNo_VP'] = isVidaPlus ? laborder!.invoiceNo : "0";
request['InvoiceNo'] = isVidaPlus ? "0" : laborder!.invoiceNo;
request['OrderNo'] = laborder!.orderNo;
request['isDentalAllowedBackend'] = false;
request['SetupID'] = laborder!.setupID;
request['ProjectID'] = laborder.projectID;
request['ClinicID'] = laborder.clinicID;
try {
GenericApiModel<List<PatientLabSpecialResult>>? apiResponse;
Failure? failure;
await apiClient.post(
GET_Patient_LAB_SPECIAL_RESULT,
body: request,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
final list = response['ListPLSR'];
if (list == null || list.isEmpty) {
throw Exception("lab list is empty");
}
final labOrders = list
.map((item) => PatientLabSpecialResult.fromJson(
item as Map<String, dynamic>))
.toList()
.cast<PatientLabSpecialResult>();
apiResponse = GenericApiModel<List<PatientLabSpecialResult>>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: labOrders,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
}

@ -20,6 +20,12 @@ import 'package:logger/logger.dart';
class LabViewModel extends ChangeNotifier {
bool isLabOrdersLoading = false;
bool isLabResultsLoading = false;
bool isLabResultByHospitalLoading = false;
bool isSpecialResultsLoading = false;
bool isGraphVisible = true;
bool shouldShowGraph = true;
bool isLabNeedToLoad = true;
LabRepo labRepo;
ErrorHandlerService errorHandlerService;
@ -28,6 +34,12 @@ class LabViewModel extends ChangeNotifier {
List<PatientLabOrdersResponseModel> patientLabOrders = [];
List<PatientLabOrdersResponseModel> filteredLabOrders = [];
List<PatientLabOrdersResponseModel> tempLabOrdersList = [];
String labSpecialResult = "";
List<String> labOrderTests = [];
PatientLabOrdersResponseModel? currentlySelectedPatientOrder;
List<LabResult> mainLabResultsByHospitals = [];
List<LabResult> mainLabResults = [];
List<DataPoint> mainGraphPoints = [];
@ -51,7 +63,7 @@ class LabViewModel extends ChangeNotifier {
List<String> get labSuggestions => _labSuggestionsList;
Set<TestDetails> uniqueTests = {};
Set<TestDetails> uniqueTests = {};
double maxY = 0.0;
double maxX = double.infinity;
@ -62,15 +74,32 @@ class LabViewModel extends ChangeNotifier {
required this.navigationService});
initLabProvider() {
patientLabOrders.clear();
filteredLabOrders.clear();
isLabOrdersLoading = true;
isLabResultsLoading = true;
getPatientLabOrders();
if (isLabNeedToLoad) {
patientLabOrders.clear();
filteredLabOrders.clear();
labOrderTests.clear();
isLabOrdersLoading = true;
isLabResultsLoading = true;
getPatientLabOrders();
}
notifyListeners();
}
setIsLabNeedToLoad(bool value) {
isLabNeedToLoad = value;
notifyListeners();
}
Future<void> getPatientLabOrders({Function(dynamic)? onSuccess, Function(String)? onError}) async {
if (!isLabNeedToLoad) return;
isLabOrdersLoading = true;
patientLabOrders.clear();
uniqueTests.clear();
labOrderTests.clear();
uniqueTests = {};
notifyListeners();
final result = await labRepo.getPatientLabOrders();
result.fold(
@ -91,6 +120,7 @@ class LabViewModel extends ChangeNotifier {
isLabResultsLoading = false;
filterSuggestions();
getUniqueTestDescription();
isLabNeedToLoad = false;
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
@ -125,21 +155,50 @@ class LabViewModel extends ChangeNotifier {
}
getUniqueTestDescription() {
uniqueTests = {
uniqueTests = {
for (var item in patientLabOrders)
if (item.testDetails != null)
...?item.testDetails?.map<TestDetails>((test) => TestDetails(
testDescriptionEn: test.testDescriptionEn.toString(),
testDescriptionAr: test.testDescriptionAr.toString(),
description: test.description.toString(),
testCode: test.testCode.toString(),
testID: test.testID,
createdOn: item.createdOn,
model: item))
};
for (var element in uniqueTests) {
labOrderTests.add(element.description ?? "");
}
}
Future<void> getPatientLabResultByHospital(
PatientLabOrdersResponseModel laborder) async {
isLabResultByHospitalLoading = true;
notifyListeners();
mainLabResultsByHospitals.clear;
final result = await labRepo.getPatientLabResultsByHospitals(laborder,
Utils.isVidaPlusProject(int.parse(laborder.projectID ?? "0")));
result.fold(
(failure) async {
isLabResultByHospitalLoading = false;
notifyListeners();
// await errorHandlerService.handleError(failure: failure);
},
(apiResponse) {
isLabResultByHospitalLoading = false;
if (apiResponse.messageStatus == 2) {
} else if (apiResponse.messageStatus == 1) {
mainLabResultsByHospitals = apiResponse.data ?? [];
notifyListeners();
}
},
);
}
Future<void> getPatientLabResult(
PatientLabOrdersResponseModel laborder, String procedureName) async {
Future<void> getPatientLabResult(PatientLabOrdersResponseModel laborder, String procedureName, String testDescription) async {
LoaderBottomSheet.showLoader();
mainLabResults.clear();
filteredGraphValues.clear();
@ -188,13 +247,57 @@ class LabViewModel extends ChangeNotifier {
} catch (e) {}
});
LabResult recentResult = recentThree.first;
checkIfGraphShouldBeDisplayed(recentResult);
recentResult.verifiedOn = resultDate(DateUtil.convertStringToDate(recentResult.verifiedOnDateTime!));
// filteredGraphValues = [filteredGraphValues.first];
navigationService.push(MaterialPageRoute(
builder: (_) =>
LabResultDetails(recentLabResult: recentResult)));
builder: (_) => LabResultDetails(recentLabResult: recentResult, testDescription: testDescription),
),
);
notifyListeners();
}
},
);
}
void checkIfGraphShouldBeDisplayed(LabResult recentResult){
shouldShowGraph = recentResult.checkIfGraphShouldBeDisplayed();
isGraphVisible = shouldShowGraph;
notifyListeners();
}
Future<void> getPatientSpecialResult(
PatientLabOrdersResponseModel laborder) async {
isSpecialResultsLoading = true;
labSpecialResult = "";
notifyListeners();
final result = await labRepo.getSpecialLabResult(
laborder,
Utils.isVidaPlusProject(int.parse(laborder.projectID ?? "0")),
);
result.fold(
(failure) async {
isSpecialResultsLoading = false;
notifyListeners();
// await errorHandlerService.handleError(failure: failure);
},
(apiResponse) {
isSpecialResultsLoading = false;
if (apiResponse.messageStatus == 2) {
} else if (apiResponse.messageStatus == 1) {
StringBuffer htmlbuffer = StringBuffer("");
apiResponse.data?.forEach((element) {
if(element.resultDataHTML != null && element.resultDataHTML?.isNotEmpty == true)
htmlbuffer.write("${element.resultDataHTML} <br/> <br/>");
});
labSpecialResult = htmlbuffer.toString();
notifyListeners();
}
notifyListeners();
},
);
}
@ -460,4 +563,26 @@ class LabViewModel extends ChangeNotifier {
return true;
}
}
String getSeverityText(String refernceValue) {
switch (refernceValue) {
case 'N':
return "normal";
case 'L':
case 'H':
return "monitor";
case 'CL':
case 'LCL':
case 'CH':
case 'HCH':
return "attention";
default:
return "normal";
}
}
alterGraphVisibility(){
isGraphVisible = !isGraphVisible;
notifyListeners();
}
}

@ -24,6 +24,8 @@ class LabResult {
String? referenceHigh;
String? criticalLow;
String? referenceLow;
num? resultTypeID;
String? packageShortDescription;
LabResult(
{this.description,
@ -78,6 +80,8 @@ class LabResult {
referenceHigh = json['ReferenceHigh'];
criticalLow = json['CriticalLow'];
referenceLow = json['ReferenceLow'];
packageShortDescription = json['PackageShortDescription'];
resultTypeID = json['ResultTypeID'];
}
Map<String, dynamic> toJson() {
@ -109,6 +113,21 @@ class LabResult {
return data;
}
bool checkIfGraphShouldBeDisplayed(){
if (resultTypeID == null) return false;
if (resultTypeID == 6) return false;
if (referanceRange == null || referanceRange == "" || referanceRange == "\n") return false;
bool isDigit = RegExp(r"\\d+").hasMatch("$resultValue");
if(isDigit) return true;
try {
num.parse(resultValue ?? "");
} catch (e) {
return false;
}
return true;
}
@override
String toString() {
return 'LabOrderResult(flag: $calculatedResultFlag, value: $resultValue, verifiedOn: $verifiedOnDateTime)';

@ -224,21 +224,26 @@ class PatientLabOrdersResponseModel {
class TestDetails {
String? description;
String? testDescriptionEn;
String? testDescriptionAr;
String? testCode;
String? testID;
String? createdOn;
PatientLabOrdersResponseModel? model;
TestDetails({this.description, this.testCode, this.testID, this.createdOn, this.model});
TestDetails({this.description, this.testDescriptionEn, this.testDescriptionAr, this.testCode, this.testID, this.createdOn, this.model});
TestDetails.fromJson(Map<String, dynamic> json) {
description = json['Description'];
testDescriptionEn = json['TestDescriptionEn'] ?? "";
testDescriptionAr = json['TestDescriptionAr'] ?? "";
testCode = json['TestCode'];
testID = json['TestID'];
createdOn = json['CreatedOn'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['Description'] = this.description;
data['TestCode'] = this.testCode;
data['TestID'] = this.testID;

@ -0,0 +1,32 @@
class PatientLabSpecialResult {
String? invoiceNo;
String? moduleID;
String? resultData;
String? resultDataHTML;
dynamic resultDataTxt;
PatientLabSpecialResult(
{this.invoiceNo,
this.moduleID,
this.resultData,
this.resultDataHTML,
this.resultDataTxt});
PatientLabSpecialResult.fromJson(Map<String, dynamic> json) {
invoiceNo = json['InvoiceNo'];
moduleID = json['ModuleID'];
resultData = json['ResultData'];
resultDataHTML = json['ResultDataHTML'];
resultDataTxt = json['ResultDataTxt'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['InvoiceNo'] = this.invoiceNo;
data['ModuleID'] = this.moduleID;
data['ResultData'] = this.resultData;
data['ResultDataHTML'] = this.resultDataHTML;
data['ResultDataTxt'] = this.resultDataTxt;
return data;
}
}

@ -8,6 +8,7 @@ import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/features/medical_file/models/patient_medical_response_model.dart';
import 'package:hmg_patient_app_new/features/medical_file/models/patient_sickleave_response_model.dart';
import 'package:hmg_patient_app_new/features/medical_file/models/patient_vaccine_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart';
import 'package:hmg_patient_app_new/services/logger_service.dart';
import '../authentication/models/resp_models/authenticated_user_resp_model.dart';
@ -24,9 +25,19 @@ abstract class MedicalFileRepo {
Future<Either<Failure, GenericApiModel<dynamic>>> getPatientMedicalReportPDF(PatientMedicalReportResponseModel patientMedicalReportResponseModel, AuthenticatedUser authenticatedUser);
Future<Either<Failure, GenericApiModel<List<FamilyFileResponseModelLists>>>> getPatientFamilyFiles();
Future<Either<Failure, GenericApiModel<List<FamilyFileResponseModelLists>>>> getPatientFamilyFiles(int? status, int patientId);
Future<Either<Failure, GenericApiModel<List<dynamic>>>> addFamilyFile({required dynamic request});
Future<Either<Failure, GenericApiModel<List<FamilyFileResponseModelLists>>>> getAllPendingRecordsByResponseId({required Map<String, dynamic> request});
Future<Either<Failure, GenericApiModel<dynamic>>> addFamilyFile({required dynamic request});
Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientAppointmentsForMedicalReport();
Future<Either<Failure, GenericApiModel<dynamic>>> insertRequestForMedicalReport({required PatientAppointmentHistoryResponseModel appointmentHistoryResponseModel});
Future<Either<Failure, GenericApiModel<dynamic>>> removeFamilyFile({required int? id});
Future<Either<Failure, GenericApiModel<dynamic>>> acceptRejectFamilyFile({required int? id, required int? status});
}
class MedicalFileRepoImp implements MedicalFileRepo {
@ -274,13 +285,13 @@ class MedicalFileRepoImp implements MedicalFileRepo {
}
@override
Future<Either<Failure, GenericApiModel<List<FamilyFileResponseModelLists>>>> getPatientFamilyFiles() async {
Future<Either<Failure, GenericApiModel<List<FamilyFileResponseModelLists>>>> getPatientFamilyFiles(int? status, int patientID) async {
try {
GenericApiModel<List<FamilyFileResponseModelLists>>? apiResponse;
Failure? failure;
await apiClient.post(
FAMILY_FILES,
body: {"Status": 3},
ApiConsts.getAllSharedRecordsByStatus,
body: {if (status != null) "Status": status, "PatientID": patientID},
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
},
@ -313,9 +324,44 @@ class MedicalFileRepoImp implements MedicalFileRepo {
}
@override
Future<Either<Failure, GenericApiModel<List<dynamic>>>> addFamilyFile({dynamic request}) async {
Future<Either<Failure, GenericApiModel<List<FamilyFileResponseModelLists>>>> getAllPendingRecordsByResponseId({required Map<String, dynamic> request}) async {
try {
GenericApiModel<List<dynamic>>? apiResponse;
GenericApiModel<List<FamilyFileResponseModelLists>>? apiResponse;
Failure? failure;
await apiClient.post(
ApiConsts.getAllPendingRecordsByResponseId,
body: request,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
final list = response['GetAllPendingRecordsList'];
final familyLists = list.map((item) => FamilyFileResponseModelLists.fromJson(item as Map<String, dynamic>)).toList().cast<FamilyFileResponseModelLists>();
apiResponse = GenericApiModel<List<FamilyFileResponseModelLists>>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: familyLists,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel<dynamic>>> addFamilyFile({dynamic request}) async {
try {
GenericApiModel<dynamic>? apiResponse;
Failure? failure;
await apiClient.post(
ApiConsts.addFamilyFile,
@ -325,17 +371,174 @@ class MedicalFileRepoImp implements MedicalFileRepo {
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
print(response);
// final list = response['GetAllSharedRecordsByStatusList'];
//
// final familyLists = list.map((item) => FamilyFileResponseModelLists.fromJson(item as Map<String, dynamic>)).toList().cast<FamilyFileResponseModelLists>();
//
// apiResponse = GenericApiModel<List<FamilyFileResponseModelLists>>(
// messageStatus: messageStatus,
// statusCode: statusCode,
// errorMessage: null,
// data: familyLists,
// );
apiResponse = GenericApiModel<dynamic>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: errorMessage,
data: response["ShareFamilyFileObj"] ?? null,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel<dynamic>>> removeFamilyFile({required int? id}) async {
Map<String, dynamic> request = {};
request["ID"] = id;
request['IsActive'] = false;
try {
GenericApiModel<dynamic>? apiResponse;
Failure? failure;
await apiClient.post(
ApiConsts.removeFileFromFamilyMembers,
body: request,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
apiResponse = GenericApiModel<dynamic>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: errorMessage,
data: response,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel<dynamic>>> acceptRejectFamilyFile({required int? id, required int? status}) async {
Map<String, dynamic> request = {};
request["ID"] = id;
request['Status'] = status;
try {
GenericApiModel<dynamic>? apiResponse;
Failure? failure;
await apiClient.post(
ApiConsts.acceptAndRejectFamilyFile,
body: request,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
apiResponse = GenericApiModel<dynamic>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: errorMessage,
data: response,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientAppointmentsForMedicalReport() async {
Map<String, dynamic> mapDevice = {
"IsActiveAppointment": false,
"IsComingFromCOC": false,
"isForUpcomming": false,
"IsForMedicalReport": true,
"IsForArrived": false,
};
try {
GenericApiModel<List<PatientAppointmentHistoryResponseModel>>? apiResponse;
Failure? failure;
await apiClient.post(
GET_PATIENT_APPOINTMENT_HISTORY_ASYNC,
body: mapDevice,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
final list = response['AppoimentAllHistoryResultList'];
final appointmentsList = list.map((item) => PatientAppointmentHistoryResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<PatientAppointmentHistoryResponseModel>();
apiResponse = GenericApiModel<List<PatientAppointmentHistoryResponseModel>>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: appointmentsList,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel<dynamic>>> insertRequestForMedicalReport({required PatientAppointmentHistoryResponseModel appointmentHistoryResponseModel}) async {
Map<String, dynamic> mapDevice = {
"ClinicID": appointmentHistoryResponseModel.clinicID,
"DoctorID": appointmentHistoryResponseModel.doctorID,
"SetupID": appointmentHistoryResponseModel.setupID,
"EncounterNo": appointmentHistoryResponseModel.appointmentNo,
"EncounterType": 1,
"IsActive": appointmentHistoryResponseModel.isActiveDoctor,
"ProjectID": appointmentHistoryResponseModel.projectID,
"Remarks": "",
"ProcedureId": "",
"RequestType": 1,
"Source": 2,
"Status": 1,
"CreatedBy": 102
};
try {
GenericApiModel<dynamic>? apiResponse;
Failure? failure;
await apiClient.post(
INSERT_REQUEST_FOR_MEDICAL_REPORT,
body: mapDevice,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
apiResponse = GenericApiModel<dynamic>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: response,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}

@ -1,15 +1,25 @@
import 'dart:convert';
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/enums.dart';
import 'package:hmg_patient_app_new/core/utils/request_utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart';
import 'package:hmg_patient_app_new/features/authentication/models/resp_models/authenticated_user_resp_model.dart';
import 'package:hmg_patient_app_new/features/common/models/family_file_request.dart';
import 'package:hmg_patient_app_new/features/medical_file/medical_file_repo.dart';
import 'package:hmg_patient_app_new/features/medical_file/models/family_file_response_model.dart';
import 'package:hmg_patient_app_new/features/medical_file/models/patient_medical_response_model.dart';
import 'package:hmg_patient_app_new/features/medical_file/models/patient_sickleave_response_model.dart';
import 'package:hmg_patient_app_new/features/medical_file/models/patient_vaccine_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart';
import 'package:hmg_patient_app_new/services/dialog_service.dart';
import 'package:hmg_patient_app_new/services/error_handler_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
class MedicalFileViewModel extends ChangeNotifier {
int selectedTabIndex = 0;
@ -30,18 +40,35 @@ class MedicalFileViewModel extends ChangeNotifier {
List<PatientMedicalReportResponseModel> patientMedicalReportReadyList = [];
List<PatientMedicalReportResponseModel> patientMedicalReportCancelledList = [];
List<PatientAppointmentHistoryResponseModel> patientMedicalReportAppointmentHistoryList = [];
PatientAppointmentHistoryResponseModel? patientMedicalReportSelectedAppointment;
List<FamilyFileResponseModelLists> patientFamilyFiles = [];
List<FamilyFileResponseModelLists> pendingFamilyFiles = [];
String patientSickLeavePDFBase64 = "";
String patientMedicalReportPDFBase64 = "";
int selectedMedicalReportsTabIndex = 0;
int _selectedFamilyFileTabIndex = 0;
int get getSelectedFamilyFileTabIndex => _selectedFamilyFileTabIndex;
set setSelectedFamilyFileTabIndex(int value) {
if (_selectedFamilyFileTabIndex != value) {
_selectedFamilyFileTabIndex = value;
notifyListeners();
}
}
static final DialogService _dialogService = getIt.get<DialogService>();
AppState _appState = getIt<AppState>();
final AppState _appState = getIt<AppState>();
AuthenticationViewModel authVM = getIt.get<AuthenticationViewModel>();
MedicalFileViewModel({required this.medicalFileRepo, required this.errorHandlerService});
initMedicalFileProvider() {
patientMedicalReportAppointmentHistoryList.clear();
isPatientVaccineListLoading = true;
isPatientMedicalReportsListLoading = true;
notifyListeners();
@ -49,6 +76,7 @@ class MedicalFileViewModel extends ChangeNotifier {
void onMedicalReportTabChange(int index) {
selectedMedicalReportsTabIndex = index;
print("Selected Medical Report Tab Index: $selectedMedicalReportsTabIndex");
if (index == 0) {
patientMedicalReportList = patientMedicalReportRequestedList;
} else if (index == 1) {
@ -59,6 +87,11 @@ class MedicalFileViewModel extends ChangeNotifier {
notifyListeners();
}
void onFamilyFileTabChange(int index) {
setSelectedFamilyFileTabIndex = index;
notifyListeners();
}
setIsPatientVaccineListLoading(bool isLoading) {
isPatientVaccineListLoading = isLoading;
notifyListeners();
@ -80,6 +113,7 @@ class MedicalFileViewModel extends ChangeNotifier {
setIsPatientMedicalReportsLoading(bool val) {
if (val) {
onMedicalReportTabChange(0);
patientMedicalReportList.clear();
patientMedicalReportPDFBase64 = "";
}
@ -87,6 +121,11 @@ class MedicalFileViewModel extends ChangeNotifier {
notifyListeners();
}
setSelectedMedicalReportAppointment(PatientAppointmentHistoryResponseModel? val) {
patientMedicalReportSelectedAppointment = val;
notifyListeners();
}
void onTabChanged(int index) {
selectedTabIndex = index;
notifyListeners();
@ -97,12 +136,17 @@ class MedicalFileViewModel extends ChangeNotifier {
final result = await medicalFileRepo.getPatientVaccinesList();
result.fold(
(failure) async => await errorHandlerService.handleError(
failure: failure,
onOkPressed: () {
onError!(failure.message);
},
),
// (failure) async => await errorHandlerService.handleError(
// failure: failure,
// onOkPressed: () {
// onError!(failure.message);
// },
// ),
(failure) async {
// onError!(failure.message);
isPatientVaccineListLoading = false;
notifyListeners();
},
(apiResponse) {
if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
@ -123,12 +167,16 @@ class MedicalFileViewModel extends ChangeNotifier {
final result = await medicalFileRepo.getPatientSickLeavesList();
result.fold(
(failure) async => await errorHandlerService.handleError(
failure: failure,
onOkPressed: () {
onError!(failure.message);
},
),
// (failure) async => await errorHandlerService.handleError(
// failure: failure,
// onOkPressed: () {
// onError!(failure.message);
// },
// ),
(failure) async {
isPatientSickLeaveListLoading = false;
notifyListeners();
},
(apiResponse) {
if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
@ -227,8 +275,8 @@ class MedicalFileViewModel extends ChangeNotifier {
);
}
Future<void> getFamilyFiles({Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await medicalFileRepo.getPatientFamilyFiles();
Future<void> getFamilyFiles({int? status, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await medicalFileRepo.getPatientFamilyFiles(status, _appState.getSuperUserID != null ? _appState.getSuperUserID! : _appState.getAuthenticatedUser()!.patientId!);
result.fold(
(failure) async => await errorHandlerService.handleError(
@ -241,16 +289,85 @@ class MedicalFileViewModel extends ChangeNotifier {
if (apiResponse.messageStatus == 2) {
_dialogService.showErrorBottomSheet(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
patientFamilyFiles = apiResponse.data!;
patientFamilyFiles.insert(
0,
FamilyFileResponseModelLists(
patientId: _appState.getAuthenticatedUser()!.patientId,
patientName: '${_appState.getAuthenticatedUser()!.firstName!} ${_appState.getAuthenticatedUser()!.lastName!}',
isActive: true,
gender: _appState.getAuthenticatedUser()!.gender!,
responseId: _appState.getAuthenticatedUser()!.patientId),
);
if (apiResponse.data != null) {
// Add current user as the first active family file
final currentUser = _appState.getAuthenticatedUser()!;
final currentUserFamilyFile = FamilyFileResponseModelLists(
patientId: currentUser.patientId,
patientName: '${currentUser.firstName!} ${currentUser.lastName!}',
isActive: true,
gender: currentUser.gender!,
responseId: currentUser.patientId,
age: currentUser.age,
mobileNumber: currentUser.mobileNumber,
patientIdenficationNumber: currentUser.patientIdentificationNo,
emaiLAddress: currentUser.emailAddress,
genderDescription: currentUser.genderDescription,
);
// Clear and start fresh with current user
patientFamilyFiles.clear();
patientFamilyFiles.add(currentUserFamilyFile);
final List<FamilyFileResponseModelLists> activeFamilyFiles = [];
final List<FamilyFileResponseModelLists> pendingFamilyFiles = [];
for (var element in apiResponse.data!) {
if (element.status == null) {
continue;
}
final isPending = element.status == FamilyFileEnum.pending.toInt || element.status == FamilyFileEnum.rejected.toInt;
final isActive = element.status == FamilyFileEnum.active.toInt;
if (!isPending && !isActive) {
continue;
}
final familyFile = FamilyFileResponseModelLists(
id: element.id,
patientId: element.patientId,
patientName: element.patientName!,
isActive: element.isActive,
gender: element.gender!,
responseId: element.responseId,
mobileNumber: element.mobileNumber,
age: element.age,
patientIdenficationNumber: element.patientIdenficationNumber,
relationship: element.relationship,
relationshipId: element.relationshipId,
relationshipN: element.relationshipN,
status: element.status,
statusDescription: element.statusDescription,
createdOn: element.createdOn,
editedOn: element.editedOn,
patientDataVerified: element.patientDataVerified,
regionId: element.regionId,
familyRegionId: element.familyRegionId,
genderDescription: element.genderDescription,
genderImage: element.genderImage,
emaiLAddress: element.emaiLAddress,
);
if (isPending) {
familyFile.isRequestFromMySide = true;
pendingFamilyFiles.add(familyFile);
}
if (isActive) {
activeFamilyFiles.add(familyFile);
}
}
for (var activeFile in activeFamilyFiles) {
if (!patientFamilyFiles.any((e) => e.responseId == activeFile.responseId)) {
patientFamilyFiles.add(activeFile);
}
}
this.pendingFamilyFiles.clear();
this.pendingFamilyFiles.addAll(pendingFamilyFiles);
}
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
@ -260,30 +377,166 @@ class MedicalFileViewModel extends ChangeNotifier {
);
}
Future<void> switchFamilyFiles({Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await medicalFileRepo.getPatientFamilyFiles();
Future<void> getAllPendingRecordsByResponseId() async {
AppState appState = getIt<AppState>();
final result = await medicalFileRepo.getAllPendingRecordsByResponseId(request: {'ResponseID': appState.getAuthenticatedUser()!.patientId ?? "0", "Status": 2});
result.fold(
(failure) async => await errorHandlerService.handleError(
failure: failure,
onOkPressed: () {
onError!(failure.message);
},
),
(failure) async => await errorHandlerService.handleError(failure: failure),
(apiResponse) {
if (apiResponse.messageStatus == 2) {
_dialogService.showErrorBottomSheet(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
patientFamilyFiles = apiResponse.data!;
patientFamilyFiles.insert(
0,
FamilyFileResponseModelLists(
patientId: _appState.getAuthenticatedUser()!.patientId,
patientName: '${_appState.getAuthenticatedUser()!.firstName!} ${_appState.getAuthenticatedUser()!.lastName!}',
isActive: true,
gender: _appState.getAuthenticatedUser()!.gender!,
responseId: _appState.getAuthenticatedUser()!.patientId),
if (apiResponse.data != null) {
final List<FamilyFileResponseModelLists> tempPendingFamilyFiles = [];
for (var element in apiResponse.data!) {
if (element.status != null && element.status == FamilyFileEnum.pending.toInt || element.status == FamilyFileEnum.active.toInt) {
tempPendingFamilyFiles.add(FamilyFileResponseModelLists(
id: element.id,
patientId: element.patientId,
patientName: element.patientName!,
isActive: element.status,
gender: element.gender,
responseId: element.patientId,
mobileNumber: element.mobileNumber,
age: element.age,
patientIdenficationNumber: element.patientIdenficationNumber,
relationship: element.relationship,
relationshipId: element.relationshipId,
relationshipN: element.relationshipN,
status: element.status,
statusDescription: element.statusDescription,
createdOn: element.createdOn,
editedOn: element.editedOn,
patientDataVerified: element.patientDataVerified,
regionId: element.regionId,
familyRegionId: element.familyRegionId,
genderDescription: element.genderDescription,
genderImage: element.genderImage,
emaiLAddress: element.emaiLAddress));
}
}
// pendingFamilyFiles.addAll(tempPendingFamilyFiles.where((element) => !pendingFamilyFiles.any((e) => e.responseId == element.responseId)));
pendingFamilyFiles.addAll(tempPendingFamilyFiles.where((element) => !pendingFamilyFiles.any((e) => e.patientId == element.patientId)));
}
notifyListeners();
}
},
);
}
Future<void> switchFamilyFiles({Function(dynamic)? onSuccess, int? responseID, int? patientID, String? phoneNumber, Function(String)? onError}) async {
authVM.phoneNumberController.text = phoneNumber!.startsWith("0") ? phoneNumber.replaceFirst("0", "") : phoneNumber;
await authVM.checkActivationCode(
activationCode: '0000',
otpTypeEnum: OTPTypeEnum.sms,
onWrongActivationCode: (String? str) {},
responseID: responseID,
isFormFamilyFile: false,
isSwitchUser: true,
patientID: patientID,
);
}
Future<void> addFamilyFile({required OTPTypeEnum otpTypeEnum}) async {
LoaderBottomSheet.showLoader();
AuthenticationViewModel authVM = getIt.get<AuthenticationViewModel>();
NavigationService navigationService = getIt.get<NavigationService>();
FamilyFileRequest request =
await RequestUtils.getAddFamilyRequest(nationalIDorFile: authVM.nationalIdController.text, mobileNo: authVM.phoneNumberController.text, countryCode: authVM.selectedCountrySignup.countryCode);
final resultEither = await medicalFileRepo.addFamilyFile(request: request.toJson());
resultEither.fold((failure) async => await errorHandlerService.handleError(failure: failure), (apiResponse) async {
if (apiResponse.messageStatus == 2) {
LoaderBottomSheet.hideLoader();
_dialogService.showErrorBottomSheet(
message: apiResponse.errorMessage!,
onOkPressed: () {
navigationService.pop();
});
} else if (apiResponse.messageStatus == 1) {
if (apiResponse.data != null) {
request.isPatientExcluded = apiResponse.data["IsPatientExcluded"];
request.responseID = apiResponse.data["ReponseID"];
LoaderBottomSheet.hideLoader();
_dialogService.showExceptionBottomSheet(
message: apiResponse.data["Message"],
onOkPressed: () {
LoaderBottomSheet.showLoader();
authVM.sendActivationCode(
otpTypeEnum: otpTypeEnum,
nationalIdOrFileNumber: request.sharedPatientIdentificationId!,
phoneNumber: request.sharedPatientMobileNumber!,
isForRegister: false,
isExcludedUser: apiResponse.data['IsPatientExcluded'],
responseID: apiResponse.data["ReponseID"],
isFormFamilyFile: true);
},
onCancelPressed: () {
navigationService.pop();
});
}
}
});
}
Future<void> handleFamilyFileRequestOTPVerification() async {
LoaderBottomSheet.showLoader();
if (!_appState.getIsChildLoggedIn) {
await getFamilyFiles(status: 0);
await getAllPendingRecordsByResponseId();
}
LoaderBottomSheet.hideLoader();
}
Future<void> removeFileFromFamilyMembers({int? id}) async {
NavigationService navigationService = getIt.get<NavigationService>();
_dialogService.showExceptionBottomSheet(
message: "Remove this member?",
onOkPressed: () async {
LoaderBottomSheet.showLoader();
final result = await medicalFileRepo.removeFamilyFile(id: id);
result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure),
(apiResponse) {
if (apiResponse.messageStatus == 2) {
LoaderBottomSheet.hideLoader();
_dialogService.showErrorBottomSheet(
message: apiResponse.errorMessage!,
onOkPressed: () {
navigationService.pop();
});
} else if (apiResponse.messageStatus == 1) {
patientFamilyFiles.removeWhere((element) => element.id == id);
LoaderBottomSheet.hideLoader();
notifyListeners();
navigationService.pop();
}
},
);
},
onCancelPressed: () {
navigationService.pop();
});
}
Future<void> getPatientMedicalReportAppointmentsList({Function(dynamic)? onSuccess, Function(String)? onError}) async {
patientMedicalReportAppointmentHistoryList.clear();
notifyListeners();
final result = await medicalFileRepo.getPatientAppointmentsForMedicalReport();
result.fold(
(failure) async {
onError!(failure.message);
},
(apiResponse) {
if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
patientMedicalReportAppointmentHistoryList = apiResponse.data!;
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
@ -293,9 +546,53 @@ class MedicalFileViewModel extends ChangeNotifier {
);
}
Future<void> addFamilyFile() async {
final resultEither = await medicalFileRepo.addFamilyFile(request: {});
resultEither.fold((failure) async => await errorHandlerService.handleError(failure: failure), (apiResponse) async {});
Future<void> insertRequestForMedicalReport({Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await medicalFileRepo.insertRequestForMedicalReport(appointmentHistoryResponseModel: patientMedicalReportSelectedAppointment!);
result.fold(
(failure) async {
onError!(failure.message);
},
(apiResponse) {
if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
}
}
},
);
}
Future<void> acceptRejectFileFromFamilyMembers({int? id, int? status}) async {
NavigationService navigationService = getIt.get<NavigationService>();
LoaderBottomSheet.showLoader();
final result = await medicalFileRepo.acceptRejectFamilyFile(id: id, status: status);
result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure),
(apiResponse) {
if (apiResponse.messageStatus == 2) {
LoaderBottomSheet.hideLoader();
_dialogService.showErrorBottomSheet(
message: apiResponse.errorMessage!,
onOkPressed: () {
navigationService.pop();
});
} else if (apiResponse.messageStatus == 1) {
// FamilyFileResponseModelLists moveProfile = pendingFamilyFiles.firstWhere((element) => element.id == patientID);
// moveProfile.status = 3;
// moveProfile.statusDescription = "Approved";
// patientFamilyFiles.add(moveProfile);
pendingFamilyFiles.removeWhere((element) => element.id == id);
//TODO: Call Api Here To Load Family Members
getFamilyFiles(status: 0);
getAllPendingRecordsByResponseId();
LoaderBottomSheet.hideLoader();
onFamilyFileTabChange(0);
}
},
);
}
}

@ -23,83 +23,90 @@ class FamilyFileResponseModelLists {
String? patientIdenficationNumber;
String? patientName;
String? statusDescription;
bool? isSuperUser = false;
bool? isRequestFromMySide;
FamilyFileResponseModelLists({
this.id,
this.patientId,
this.responseId,
this.relationshipId,
this.relationship,
this.relationshipN,
this.regionId,
this.familyRegionId,
this.status,
this.isActive,
this.editedOn,
this.createdOn,
this.age,
this.emaiLAddress,
this.gender,
this.genderDescription,
this.genderImage,
this.mobileNumber,
this.patientDataVerified,
this.patientIdenficationNumber,
this.patientName,
this.statusDescription,
});
FamilyFileResponseModelLists(
{this.id,
this.patientId,
this.responseId,
this.relationshipId,
this.relationship,
this.relationshipN,
this.regionId,
this.familyRegionId,
this.status,
this.isActive,
this.editedOn,
this.createdOn,
this.age,
this.emaiLAddress,
this.gender,
this.genderDescription,
this.genderImage,
this.mobileNumber,
this.patientDataVerified,
this.patientIdenficationNumber,
this.patientName,
this.statusDescription,
this.isSuperUser,
this.isRequestFromMySide});
factory FamilyFileResponseModelLists.fromRawJson(String str) => FamilyFileResponseModelLists.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory FamilyFileResponseModelLists.fromJson(Map<String, dynamic> json) => FamilyFileResponseModelLists(
id: json["ID"],
patientId: json["PatientID"],
responseId: json["ResponseID"],
relationshipId: json["RelationshipID"],
relationship: json["Relationship"],
relationshipN: json["RelationshipN"],
regionId: json["RegionID"],
familyRegionId: json["FamilyRegionID"],
status: json["Status"],
isActive: json["IsActive"],
editedOn: json["EditedOn"],
createdOn: json["CreatedOn"],
age: json["Age"],
emaiLAddress: json["EmaiLAddress"],
gender: json["Gender"],
genderDescription: json["GenderDescription"],
genderImage: json["GenderImage"],
mobileNumber: json["MobileNumber"],
patientDataVerified: json["PatientDataVerified"],
patientIdenficationNumber: json["PatientIdenficationNumber"],
patientName: json["PatientName"],
statusDescription: json["StatusDescription"],
);
id: json["ID"],
patientId: json["PatientID"],
responseId: json["ResponseID"],
relationshipId: json["RelationshipID"],
relationship: json["Relationship"],
relationshipN: json["RelationshipN"],
regionId: json["RegionID"],
familyRegionId: json["FamilyRegionID"],
status: json["Status"],
isActive: json["IsActive"],
editedOn: json["EditedOn"],
createdOn: json["CreatedOn"],
age: json["Age"],
emaiLAddress: json["EmaiLAddress"],
gender: json["Gender"],
genderDescription: json["GenderDescription"],
genderImage: json["GenderImage"],
mobileNumber: json["MobileNumber"],
patientDataVerified: json["PatientDataVerified"],
patientIdenficationNumber: json["PatientIdenficationNumber"],
patientName: json["PatientName"],
statusDescription: json["StatusDescription"],
isSuperUser: json["isSuperUser"] ?? false,
isRequestFromMySide: json["isRequestFromMySide"] ?? false,
);
Map<String, dynamic> toJson() => {
"ID": id,
"PatientID": patientId,
"ResponseID": responseId,
"RelationshipID": relationshipId,
"Relationship": relationship,
"RelationshipN": relationshipN,
"RegionID": regionId,
"FamilyRegionID": familyRegionId,
"Status": status,
"IsActive": isActive,
"EditedOn": editedOn,
"CreatedOn": createdOn,
"Age": age,
"EmaiLAddress": emaiLAddress,
"Gender": gender,
"GenderDescription": genderDescription,
"GenderImage": genderImage,
"MobileNumber": mobileNumber,
"PatientDataVerified": patientDataVerified,
"PatientIdenficationNumber": patientIdenficationNumber,
"PatientName": patientName,
"StatusDescription": statusDescription,
};
"ID": id,
"PatientID": patientId,
"ResponseID": responseId,
"RelationshipID": relationshipId,
"Relationship": relationship,
"RelationshipN": relationshipN,
"RegionID": regionId,
"FamilyRegionID": familyRegionId,
"Status": status,
"IsActive": isActive,
"EditedOn": editedOn,
"CreatedOn": createdOn,
"Age": age,
"EmaiLAddress": emaiLAddress,
"Gender": gender,
"GenderDescription": genderDescription,
"GenderImage": genderImage,
"MobileNumber": mobileNumber,
"PatientDataVerified": patientDataVerified,
"PatientIdenficationNumber": patientIdenficationNumber,
"PatientName": patientName,
"StatusDescription": statusDescription,
"isSuperUser": isSuperUser,
"isRequestFromMySide": isRequestFromMySide,
};
}

@ -17,7 +17,8 @@ enum AppointmentViaRegionState {
enum RegionBottomSheetType{
FOR_REGION,
FOR_CLINIIC
REGION_FOR_DENTAL_AND_LASER,
FOR_CLINIIC,
}
class AppointmentViaRegionViewmodel extends ChangeNotifier {
@ -94,4 +95,19 @@ class AppointmentViaRegionViewmodel extends ChangeNotifier {
page: SelectDoctorPage(),
),);
}
void handleLastStepForClinicForDentalAndLaser() {
//todo handle the routing here
navigationService.pop();
}
void handleLastStepForDentalAndLaser() {
//todo handle the routing here
navigationService.pop();
navigationService.push(
CustomPageRoute(
page: SelectDoctorPage(),
),
);
}
}

@ -0,0 +1,17 @@
import 'package:hmg_patient_app_new/core/app_assets.dart';
enum AppointmentListingFilters{
WALKIN("walkin", AppAssets.walkin_appointment_icon),
BOOKED("booked", AppAssets.calendar),
CONFIRMED("confirmed", AppAssets.calendar),
ARRIVED("arrived", AppAssets.calendar),
LIVECARE("livecare", AppAssets.small_livecare_icon),
DATESELECTION("",AppAssets.calendar, trailingIcon: AppAssets.arrow_down);
final String labelText;
final String leadingIcon;
final String trailingIcon;
const AppointmentListingFilters(this.labelText, this.leadingIcon,
{this.trailingIcon = ""});
}

@ -0,0 +1,83 @@
class GetTamaraInstallmentsDetailsResponseModel {
String? name;
String? description;
MinLimit? minLimit;
MinLimit? maxLimit;
List<SupportedInstalments>? supportedInstalments;
GetTamaraInstallmentsDetailsResponseModel({this.name, this.description, this.minLimit, this.maxLimit, this.supportedInstalments});
GetTamaraInstallmentsDetailsResponseModel.fromJson(Map<String, dynamic> json) {
name = json['name'];
description = json['description'];
minLimit = json['minLimit'] != null ? new MinLimit.fromJson(json['minLimit']) : null;
maxLimit = json['maxLimit'] != null ? new MinLimit.fromJson(json['maxLimit']) : null;
if (json['supportedInstalments'] != null) {
supportedInstalments = <SupportedInstalments>[];
json['supportedInstalments'].forEach((v) {
supportedInstalments!.add(new SupportedInstalments.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['name'] = this.name;
data['description'] = this.description;
if (this.minLimit != null) {
data['minLimit'] = this.minLimit!.toJson();
}
if (this.maxLimit != null) {
data['maxLimit'] = this.maxLimit!.toJson();
}
if (this.supportedInstalments != null) {
data['supportedInstalments'] = this.supportedInstalments!.map((v) => v.toJson()).toList();
}
return data;
}
}
class MinLimit {
String? currency;
num? amount;
MinLimit({this.currency, this.amount});
MinLimit.fromJson(Map<String, dynamic> json) {
currency = json['currency'];
amount = json['amount'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['currency'] = this.currency;
data['amount'] = this.amount;
return data;
}
}
class SupportedInstalments {
int? instalments;
MinLimit? minLimit;
MinLimit? maxLimit;
SupportedInstalments({this.instalments, this.minLimit, this.maxLimit});
SupportedInstalments.fromJson(Map<String, dynamic> json) {
instalments = json['instalments'];
minLimit = json['minLimit'] != null ? new MinLimit.fromJson(json['minLimit']) : null;
maxLimit = json['maxLimit'] != null ? new MinLimit.fromJson(json['maxLimit']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['instalments'] = this.instalments;
if (this.minLimit != null) {
data['minLimit'] = this.minLimit!.toJson();
}
if (this.maxLimit != null) {
data['maxLimit'] = this.maxLimit!.toJson();
}
return data;
}
}

@ -7,6 +7,7 @@ import 'package:hmg_patient_app_new/core/cache_consts.dart';
import 'package:hmg_patient_app_new/core/common_models/generic_api_model.dart';
import 'package:hmg_patient_app_new/core/exceptions/api_failure.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/get_tamara_installments_details_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/hospital_model.dart' show HospitalsModel;
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_share_response_model.dart';
@ -44,6 +45,8 @@ abstract class MyAppointmentsRepo {
Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientDoctorsList();
Future<Either<Failure, GenericApiModel<dynamic>>> insertLiveCareVIDARequest({required clientRequestID, required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel});
Future<Either<Failure, GenericApiModel<GetTamaraInstallmentsDetailsResponseModel>>> getTamaraInstallmentsDetails();
}
class MyAppointmentsRepoImp implements MyAppointmentsRepo {
@ -56,13 +59,10 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientAppointments({required bool isActiveAppointment, required bool isArrivedAppointments}) async {
Map<String, dynamic> mapDevice = {
"IsActiveAppointment": isActiveAppointment,
"isDentalAllowedBackend": false,
"PatientTypeID": 1,
"IsComingFromCOC": false,
"PatientType": 1,
"isForUpcomming": false,
"IsForMedicalReport": false,
"IsForArrived": isArrivedAppointments,
"PatientOutSA": 0
};
try {
@ -546,4 +546,41 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel<GetTamaraInstallmentsDetailsResponseModel>>> getTamaraInstallmentsDetails() async {
try {
GenericApiModel<GetTamaraInstallmentsDetailsResponseModel>? apiResponse;
Failure? failure;
await apiClient.get(
ApiConsts.GET_TAMARA_INSTALLMENTS_URL,
isExternal: true,
isAllowAny: true,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
final list = response;
final tamaraInstallmentsList = GetTamaraInstallmentsDetailsResponseModel.fromJson(list.first);
apiResponse = GenericApiModel<GetTamaraInstallmentsDetailsResponseModel>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: tamaraInstallmentsList,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
}

@ -1,14 +1,17 @@
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/get_tamara_installments_details_response_model.dart';
import 'package:hmg_patient_app_new/core/utils/date_util.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/appointemnet_filters.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_share_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_repo.dart';
import 'package:hmg_patient_app_new/features/my_appointments/utils/appointment_type.dart';
import 'package:hmg_patient_app_new/services/error_handler_service.dart';
import '../../core/utils/doctor_response_mapper.dart' show DoctorMapper;
class MyAppointmentsViewModel extends ChangeNotifier {
int selectedTabIndex = 0;
int previouslySelectedTab = -1;
MyAppointmentsRepo myAppointmentsRepo;
ErrorHandlerService errorHandlerService;
@ -21,7 +24,14 @@ class MyAppointmentsViewModel extends ChangeNotifier {
bool isAppointmentDataToBeLoaded = true;
List<AppointmentListingFilters> availableFilters = [];
List<AppointmentListingFilters>? selectedFilter = [];
bool isDateFilterSelected = false;
DateTime? start =null;
DateTime? end =null;
List<PatientAppointmentHistoryResponseModel> patientAppointmentsHistoryList = [];
List<PatientAppointmentHistoryResponseModel> filteredAppointmentList = [];
List<PatientAppointmentHistoryResponseModel> patientUpcomingAppointmentsHistoryList = [];
List<PatientAppointmentHistoryResponseModel> patientArrivedAppointmentsHistoryList = [];
@ -32,10 +42,16 @@ class MyAppointmentsViewModel extends ChangeNotifier {
PatientAppointmentShareResponseModel? patientAppointmentShareResponseModel;
GetTamaraInstallmentsDetailsResponseModel? getTamaraInstallmentsDetailsResponseModel;
bool isTamaraDetailsLoading = false;
MyAppointmentsViewModel({required this.myAppointmentsRepo, required this.errorHandlerService, required this.appState});
void onTabChange(int index) {
previouslySelectedTab = selectedTabIndex;
selectedTabIndex = index;
start = null;
end = null;
notifyListeners();
}
@ -50,6 +66,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
patientMyDoctorsList.clear();
isPatientMyDoctorsLoading = true;
}
isTamaraDetailsLoading = true;
isAppointmentPatientShareLoading = true;
notifyListeners();
}
@ -75,10 +92,18 @@ class MyAppointmentsViewModel extends ChangeNotifier {
}
setIsAppointmentDataToBeLoaded(bool val) {
if (val) {
isMyAppointmentsLoading = true;
}
isAppointmentDataToBeLoaded = val;
notifyListeners();
}
setIsTamaraDetailsLoading(bool val) {
isTamaraDetailsLoading = val;
notifyListeners();
}
setAppointmentReminder(bool value, PatientAppointmentHistoryResponseModel item) {
int index = patientAppointmentsHistoryList.indexOf(item);
if (index != -1) {
@ -90,9 +115,11 @@ class MyAppointmentsViewModel extends ChangeNotifier {
Future<void> getPatientAppointments(bool isActiveAppointment, bool isArrivedAppointments, {Function(dynamic)? onSuccess, Function(String)? onError}) async {
if (!isAppointmentDataToBeLoaded) return;
filteredAppointmentList.clear();
patientAppointmentsHistoryList.clear();
patientUpcomingAppointmentsHistoryList.clear();
patientArrivedAppointmentsHistoryList.clear();
notifyListeners();
final result = await myAppointmentsRepo.getPatientAppointments(isActiveAppointment: isActiveAppointment, isArrivedAppointments: isArrivedAppointments);
final resultArrived = await myAppointmentsRepo.getPatientAppointments(isActiveAppointment: false, isArrivedAppointments: true);
@ -132,17 +159,57 @@ class MyAppointmentsViewModel extends ChangeNotifier {
patientAppointmentsHistoryList.addAll(patientUpcomingAppointmentsHistoryList);
patientAppointmentsHistoryList.addAll(patientArrivedAppointmentsHistoryList);
filteredAppointmentList.addAll(patientAppointmentsHistoryList);
print('Upcoming Appointments: ${patientUpcomingAppointmentsHistoryList.length}');
print('Arrived Appointments: ${patientArrivedAppointmentsHistoryList.length}');
print('All Appointments: ${patientAppointmentsHistoryList.length}');
getFiltersForSelectedAppointmentList(filteredAppointmentList);
}
void getFiltersForSelectedAppointmentList(
List<PatientAppointmentHistoryResponseModel> filteredAppointmentList) {
availableFilters.clear();
if (filteredAppointmentList.isEmpty == true) return;
availableFilters.add(AppointmentListingFilters.DATESELECTION);
if (filteredAppointmentList
.any((element) => element.isLiveCareAppointment == true)) {
availableFilters.add(AppointmentListingFilters.LIVECARE);
}
if (filteredAppointmentList
.any((element) => element.isLiveCareAppointment == false)) {
availableFilters.add(AppointmentListingFilters.WALKIN);
}
if (filteredAppointmentList
.any((element) => AppointmentType.isArrived(element) == true)) {
availableFilters.add(AppointmentListingFilters.ARRIVED);
}
if (filteredAppointmentList
.any((element) => AppointmentType.isBooked(element) == true)) {
availableFilters.add(AppointmentListingFilters.BOOKED);
}
if (filteredAppointmentList
.any((element) => AppointmentType.isConfirmed(element) == true)) {
availableFilters.add(AppointmentListingFilters.CONFIRMED);
}
notifyListeners();
}
Future<void> getPatientShareAppointment(int projectID, int clinicID, String appointmentNo, bool isLiveCareAppointment, {Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.getPatientShareAppointment(projectID: projectID, clinicID: clinicID, appointmentNo: appointmentNo, isLiveCareAppointment: isLiveCareAppointment);
result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure),
(failure) async {
await errorHandlerService.handleError(
failure: failure,
onOkPressed: () {
onError!(failure.message);
});
},
(apiResponse) {
if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
@ -337,4 +404,141 @@ class MyAppointmentsViewModel extends ChangeNotifier {
},
);
}
void updateListWRTTab(int index) {
isDateFilterSelected = false;
selectedFilter = [];
// if(previouslySelectedTab == selectedTabIndex ) return;
switch (index) {
case 0:
filteredAppointmentList.clear();
filteredAppointmentList.addAll(patientAppointmentsHistoryList);
break;
case 1:
filteredAppointmentList.clear();
filteredAppointmentList.addAll(patientUpcomingAppointmentsHistoryList);
break;
case 2:
filteredAppointmentList.clear();
filteredAppointmentList.addAll(patientArrivedAppointmentsHistoryList);
break;
}
getFiltersForSelectedAppointmentList(filteredAppointmentList);
notifyListeners();
}
void setSelectedFilter(AppointmentListingFilters availableFilter) {
if (selectedFilter?.contains(availableFilter) == true) {
selectedFilter?.remove(availableFilter);
notifyListeners();
return;
}
selectedFilter?.add(availableFilter) ;
notifyListeners();
}
void getSelectedDateRange(DateTime? start, DateTime? end) {
this.start = start;
this.end = end;
isDateFilterSelected = true;
List<PatientAppointmentHistoryResponseModel> sourceList = [];
if (selectedTabIndex == 0) {
sourceList = patientAppointmentsHistoryList;
} else if (selectedTabIndex == 1) {
sourceList = patientUpcomingAppointmentsHistoryList;
} else if (selectedTabIndex == 2) {
sourceList = patientArrivedAppointmentsHistoryList;
}
// if (isDateFilterSelected) sourceList = filteredAppointmentList;
if (start == null && end == null) {
isDateFilterSelected = false;
filteredAppointmentList.clear();
sourceList.forEach((element) {
if (isUnderFilter(element)) {
filteredAppointmentList.add(element);
}
});
} else {
filteredAppointmentList.clear();
sourceList.forEach((element) {
try {
var dateTime = DateUtil.convertStringToDate(element.appointmentDate).provideDateOnly();
if (start != null && end == null) {
if (dateTime.isAtSameMomentAs(start)) {
if (isUnderFilter(element)) {
filteredAppointmentList.add(element);
}
}
} else if (start != null && end != null) {
if ((dateTime.isAfter(start)) && ((dateTime.isBefore(end))||((dateTime.isAtSameMomentAs(end))))) {
if (isUnderFilter(element)) {
filteredAppointmentList.add(element);
}
}
}
} catch (e) {}
});
}
notifyListeners();
}
void filterTheListAsPerSelection() {
getSelectedDateRange(start, end);
}
bool isUnderFilter(PatientAppointmentHistoryResponseModel element) {
bool isUnderTheFilter = false;
if (selectedFilter == null || selectedFilter!.isEmpty) return true;
int count = 0;
for (var filter in selectedFilter ?? []) {
switch (filter) {
case AppointmentListingFilters.WALKIN:
if (element.isLiveCareAppointment == false) return true;
case AppointmentListingFilters.BOOKED:
if (AppointmentType.isBooked(element))return true;
case AppointmentListingFilters.CONFIRMED:
if (AppointmentType.isConfirmed(element))return true;
case AppointmentListingFilters.ARRIVED:
if (AppointmentType.isArrived(element))return true;
case AppointmentListingFilters.LIVECARE:
if (element.isLiveCareAppointment == true) return true;
case AppointmentListingFilters.DATESELECTION:
}
}
return false;
}
Future<void> getTamaraInstallmentsDetails({Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.getTamaraInstallmentsDetails();
result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure),
(apiResponse) {
getTamaraInstallmentsDetailsResponseModel = apiResponse.data!;
isTamaraDetailsLoading = false;
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
}
// if (apiResponse.messageStatus == 2) {
// onError!(apiResponse.errorMessage!);
// // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
// } else if (apiResponse.messageStatus == 1) {
// getTamaraInstallmentsDetailsResponseModel = apiResponse.data!;
// notifyListeners();
// if (onSuccess != null) {
// onSuccess(apiResponse);
// }
// }
},
);
}
}

@ -18,6 +18,13 @@ abstract class PayfortRepo {
Future<Either<Failure, GenericApiModel<SdkTokenResponse>>> generateSdkSignatureFromAPI({required SdkTokenRequest tokenRequest});
Future<Either<Failure, GenericApiModel<PayfortCheckPaymentStatusResponseModel>>> checkPaymentStatus({required String transactionID});
Future<Either<Failure, GenericApiModel<dynamic>>> checkTamaraPaymentStatus({required String transactionID});
Future<Either<Failure, GenericApiModel<dynamic>>> markAppointmentAsTamaraPaid({required int projectID, required int appointmentNo});
Future<Either<Failure, GenericApiModel<dynamic>>> updateTamaraRequestStatus(
{required String responseMessage, required String status, required String clientRequestID, required String tamaraOrderID});
}
class PayfortRepoImp implements PayfortRepo {
@ -147,4 +154,100 @@ class PayfortRepoImp implements PayfortRepo {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel>> checkTamaraPaymentStatus({required String transactionID}) async {
try {
GenericApiModel<dynamic>? apiResponse;
Failure? failure;
await apiClient.get(
'${ApiConsts.GET_TAMARA_PAYMENT_STATUS}$transactionID',
isExternal: true,
isAllowAny: true,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
apiResponse = GenericApiModel<dynamic>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: response,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel>> updateTamaraRequestStatus({required String responseMessage, required String status, required String clientRequestID, required String tamaraOrderID}) async {
Map<String, dynamic> body = {
"Response_Message": responseMessage,
"ClientRequestID": clientRequestID,
"Status": status,
"FortID": tamaraOrderID, // Tamara order ID
"LanguageID": 1,
"Installments_Number": 3,
};
try {
GenericApiModel<dynamic>? apiResponse;
Failure? failure;
await apiClient.post(UPDATE_TAMARA_STATUS, body: body, onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
}, onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
apiResponse = GenericApiModel<dynamic>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: response,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
}, isAllowAny: true, isPaymentServices: true);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel>> markAppointmentAsTamaraPaid({required int projectID, required int appointmentNo}) async {
Map<String, dynamic> body = {"ProjectID": projectID, "AppointmentNo": appointmentNo, "LanguageID": 1};
try {
GenericApiModel<dynamic>? apiResponse;
Failure? failure;
await apiClient.post(MARK_APPOINTMENT_TAMARA_STATUS, body: body, onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
}, onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
apiResponse = GenericApiModel<dynamic>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: response,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
}, isAllowAny: true, isPaymentServices: true);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
}

@ -94,6 +94,40 @@ class PayfortViewModel extends ChangeNotifier {
);
}
Future<void> checkTamaraPaymentStatus({required String transactionID, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await payfortRepo.checkTamaraPaymentStatus(transactionID: transactionID);
result.fold(
(failure) async {
onError!(failure.message);
},
(apiResponse) {
print(apiResponse.data);
if (onSuccess != null) {
onSuccess(apiResponse);
}
// }
},
);
}
Future<void> updateTamaraRequestStatus(
{required String responseMessage, required String status, required String clientRequestID, required String tamaraOrderID, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await payfortRepo.updateTamaraRequestStatus(responseMessage: responseMessage, status: status, clientRequestID: clientRequestID, tamaraOrderID: tamaraOrderID);
result.fold(
(failure) async {
onError!(failure.message);
},
(apiResponse) {
print(apiResponse.data);
if (onSuccess != null) {
onSuccess(apiResponse);
}
},
);
}
Future<SdkTokenResponse?> _generateSdkResponse({
String? applePayAccessCode,
String? merchantIdentifier,
@ -199,4 +233,20 @@ class PayfortViewModel extends ChangeNotifier {
onFailed!(e.toString() as PayFortFailureResult);
}
}
Future<void> markAppointmentAsTamaraPaid({required int projectID, required int appointmentNo, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await payfortRepo.markAppointmentAsTamaraPaid(projectID: projectID, appointmentNo: appointmentNo);
result.fold(
(failure) async {
onError!(failure.message);
},
(apiResponse) {
print(apiResponse.data);
if (onSuccess != null) {
onSuccess(apiResponse);
}
},
);
}
}

@ -849,5 +849,29 @@ abstract class LocaleKeys {
static const selectCountry = 'selectCountry';
static const forLoginVerification = 'forLoginVerification';
static const searchHospital = 'searchHospital';
static const skip = 'skip';
static const getStarted = 'getStarted';
static const onboardingHeading1 = 'onboardingHeading1';
static const onboardingBody1 = 'onboardingBody1';
static const onboardingHeading2 = 'onboardingHeading2';
static const onboardingBody2 = 'onboardingBody2';
static const hmgHospitals = 'hmgHospitals';
static const hmcMedicalClinic = 'hmcMedicalClinic';
static const applyFilter = 'applyFilter';
static const facilityAndLocation = 'facilityAndLocation';
static const regionAndLocation = 'regionAndLocation';
static const clearAllFilters = 'clearAllFilters';
static const filters = 'filters';
static const searchClinic = 'searchClinic';
static const walkin = 'walkin';
static const normal = 'normal';
static const attention = 'attention';
static const monitor = 'monitor';
static const noSpecialResult = 'noSpecialResult';
static const setTheDateRange = 'setTheDateRange';
static const historyFlowchart = 'historyFlowchart';
static const to = 'to';
static const startDate = 'startDate';
static const endDate = 'endDate';
}

@ -10,10 +10,11 @@ import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/doctor_filter/doctor_filter_view_model.dart';
import 'package:hmg_patient_app_new/features/habib_wallet/habib_wallet_view_model.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/immediate_livecare_view_model.dart';
import 'package:hmg_patient_app_new/features/insurance/insurance_view_model.dart';
import 'package:hmg_patient_app_new/features/lab/history/lab_history_viewmodel.dart';
import 'package:hmg_patient_app_new/features/lab/lab_range_view_model.dart';
import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart';
import 'package:hmg_patient_app_new/features/medical_file/medical_file_view_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/appointment_via_region_viewmodel.dart';
@ -26,6 +27,7 @@ import 'package:hmg_patient_app_new/routes/app_routes.dart';
import 'package:hmg_patient_app_new/services/logger_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';
import 'package:hmg_patient_app_new/theme/app_theme.dart';
import 'package:hmg_patient_app_new/widgets/date_range_selector/viewmodel/date_range_view_model.dart' show DateRangeSelectorRangeViewModel;
import 'package:provider/provider.dart';
import 'package:provider/single_child_widget.dart';
@ -77,84 +79,53 @@ void main() async {
fallbackLocale: Locale('en', 'US'),
child: MultiProvider(providers: <SingleChildWidget>[
ChangeNotifierProvider<LabViewModel>(
create: (_) => LabViewModel(
labRepo: getIt(),
errorHandlerService: getIt(),
navigationService: getIt()),
create: (_) => getIt.get<LabViewModel>(),
),
ChangeNotifierProvider<RadiologyViewModel>(
create: (_) => RadiologyViewModel(
radiologyRepo: getIt(),
errorHandlerService: getIt(),
),
create: (_) => getIt.get<RadiologyViewModel>(),
),
ChangeNotifierProvider<PrescriptionsViewModel>(
create: (_) => PrescriptionsViewModel(
prescriptionsRepo: getIt(),
errorHandlerService: getIt(),
),
create: (_) => getIt.get<PrescriptionsViewModel>(),
),
ChangeNotifierProvider<InsuranceViewModel>(
create: (_) => InsuranceViewModel(
insuranceRepo: getIt(),
errorHandlerService: getIt(),
),
create: (_) => getIt.get<InsuranceViewModel>(),
),
ChangeNotifierProvider<MedicalFileViewModel>(
create: (_) => MedicalFileViewModel(
medicalFileRepo: getIt(),
errorHandlerService: getIt(),
),
create: (_) => getIt.get<MedicalFileViewModel>(),
),
ChangeNotifierProvider<ProfileSettingsViewModel>(
create: (_) => ProfileSettingsViewModel(),
create: (_) => getIt.get<ProfileSettingsViewModel>(),
),
ChangeNotifierProvider<MyAppointmentsViewModel>(
create: (_) => MyAppointmentsViewModel(
myAppointmentsRepo: getIt(),
errorHandlerService: getIt(),
appState: getIt(),
),
create: (_) => getIt.get<MyAppointmentsViewModel>(),
),
ChangeNotifierProvider<PayfortViewModel>(
create: (_) => PayfortViewModel(
payfortRepo: getIt(),
errorHandlerService: getIt(),
),
create: (_) => getIt.get<PayfortViewModel>(),
),
ChangeNotifierProvider<HabibWalletViewModel>(
create: (_) => HabibWalletViewModel(
habibWalletRepo: getIt(),
errorHandlerService: getIt(),
),
create: (_) => getIt.get<HabibWalletViewModel>(),
),
ChangeNotifierProvider<BookAppointmentsViewModel>(
create: (_) => BookAppointmentsViewModel(
bookAppointmentsRepo: getIt(),
errorHandlerService: getIt(),
navigationService: getIt(),
myAppointmentsViewModel: getIt(),
locationUtils: getIt(),
),
create: (_) => getIt.get<BookAppointmentsViewModel>(),
),
ChangeNotifierProvider<ImmediateLiveCareViewModel>(
create: (_) => getIt.get<ImmediateLiveCareViewModel>(),
),
ChangeNotifierProvider<AuthenticationViewModel>(
create: (_) => AuthenticationViewModel(
authenticationRepo: getIt(),
appState: getIt(),
dialogService: getIt(),
errorHandlerService: getIt(),
navigationService: getIt(),
cacheService: getIt(),
localAuthService: getIt(),
),
create: (_) => getIt.get<AuthenticationViewModel>(),
),
ChangeNotifierProvider<AppointmentViaRegionViewmodel>(
create: (_) => AppointmentViaRegionViewmodel(
navigationService: getIt(), appState: getIt())),
create: (_) => getIt.get<AppointmentViaRegionViewmodel>(),
),
ChangeNotifierProvider<LabHistoryViewModel>(
create: (_) => LabHistoryViewModel()),
ChangeNotifierProvider<LabRangeViewModel>(
create: (_) => LabRangeViewModel())
create: (_) => getIt.get<LabHistoryViewModel>(),
),
ChangeNotifierProvider<DateRangeSelectorRangeViewModel>(
create: (_) => getIt.get<DateRangeSelectorRangeViewModel>(),
),
ChangeNotifierProvider<DoctorFilterViewModel>(
create: (_) => getIt.get<DoctorFilterViewModel>(),
)
], child: MyApp()),
),
);

@ -313,7 +313,7 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
),
SizedBox(width: 68.h),
Transform.flip(
flipX: appState.isArabic() ? true : false,
flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon,
iconColor: AppColors.blackColor,
@ -419,7 +419,7 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Total amount to pay".needTranslation.toText18(isBold: true),
"Amount before tax".needTranslation.toText18(isBold: true),
Utils.getPaymentAmountWithSymbol(widget.patientAppointmentHistoryResponseModel.patientShare!.toString().toText16(isBold: true), AppColors.blackColor, 13,
isSaudiCurrency: true),
],

@ -51,17 +51,30 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
String transID = "";
bool isShowTamara = false;
String tamaraPaymentStatus = "";
String tamaraOrderID = "";
@override
void initState() {
scheduleMicrotask(() {
payfortViewModel.initPayfortViewModel();
myAppointmentsViewModel.getTamaraInstallmentsDetails().then((val) {
if (myAppointmentsViewModel.patientAppointmentShareResponseModel!.patientShareWithTax! >= myAppointmentsViewModel.getTamaraInstallmentsDetailsResponseModel!.minLimit!.amount! &&
myAppointmentsViewModel.patientAppointmentShareResponseModel!.patientShareWithTax! <= myAppointmentsViewModel.getTamaraInstallmentsDetailsResponseModel!.maxLimit!.amount!) {
setState(() {
isShowTamara = true;
});
}
});
payfortViewModel.setIsApplePayConfigurationLoading(false);
myAppointmentsViewModel.getPatientShareAppointment(
widget.patientAppointmentHistoryResponseModel.projectID,
widget.patientAppointmentHistoryResponseModel.clinicID,
widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(),
widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment ?? false,
);
widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(), widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment ?? false, onError: (err) {
Navigator.of(context).pop();
Navigator.of(context).pop();
});
});
super.initState();
}
@ -104,9 +117,9 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
SizedBox(width: 8.h),
const Spacer(),
Transform.flip(
flipX: appState.isArabic() ? true : false,
flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon,
icon: AppAssets.forward_arrow_icon_small,
iconColor: AppColors.blackColor,
width: 18.h,
height: 13.h,
@ -146,9 +159,9 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
SizedBox(width: 8.h),
const Spacer(),
Transform.flip(
flipX: appState.isArabic() ? true : false,
flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon,
icon: AppAssets.forward_arrow_icon_small,
iconColor: AppColors.blackColor,
width: 18.h,
height: 13.h,
@ -162,11 +175,12 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
openPaymentURL("visa");
}),
SizedBox(height: 16.h),
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 20.h,
hasShadow: false,
isShowTamara
? Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 20.h,
hasShadow: false,
),
child: Row(
mainAxisSize: MainAxisSize.max,
@ -182,21 +196,22 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
SizedBox(width: 8.h),
const Spacer(),
Transform.flip(
flipX: appState.isArabic() ? true : false,
flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon,
iconColor: AppColors.blackColor,
width: 18.h,
height: 13.h,
fit: BoxFit.contain,
).toShimmer2(isShow: myAppointmentsVM.isAppointmentPatientShareLoading),
),
],
).paddingSymmetrical(16.h, 16.h),
).paddingSymmetrical(24.h, 0.h).onPress(() {
selectedPaymentMethod = "TAMARA";
openPaymentURL("tamara");
}),
icon: AppAssets.forward_arrow_icon_small,
iconColor: AppColors.blackColor,
width: 18.h,
height: 13.h,
fit: BoxFit.contain,
).toShimmer2(isShow: myAppointmentsVM.isAppointmentPatientShareLoading),
),
],
).paddingSymmetrical(16.h, 16.h),
).paddingSymmetrical(24.h, 0.h).onPress(() {
selectedPaymentMethod = "TAMARA";
openPaymentURL("tamara");
})
: SizedBox.shrink(),
],
),
),
@ -257,7 +272,7 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Total amount to pay".needTranslation.toText14(isBold: true),
"Amount before tax".needTranslation.toText14(isBold: true),
Utils.getPaymentAmountWithSymbol(myAppointmentsVM.patientAppointmentShareResponseModel!.patientShare!.toString().toText16(isBold: true), AppColors.blackColor, 13,
isSaudiCurrency: true),
],
@ -293,7 +308,7 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
if (Utils.havePrivilege(103)) {
startApplePay();
} else {
openPaymentURL(selectedPaymentMethod);
openPaymentURL("ApplePay");
}
})
: SizedBox(height: 12.h),
@ -315,12 +330,12 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
if (selectedPaymentMethod == "tamara") {
if (Platform.isAndroid) {
Uri uri = new Uri.dataFromString(url);
// tamaraPaymentStatus = uri.queryParameters['status']!;
// tamaraOrderID = uri.queryParameters['AuthorizePaymentId']!;
tamaraPaymentStatus = uri.queryParameters['status']!;
tamaraOrderID = uri.queryParameters['AuthorizePaymentId']!;
} else {
Uri uri = new Uri.dataFromString(url);
// tamaraPaymentStatus = uri.queryParameters['paymentStatus']!;
// tamaraOrderID = uri.queryParameters['orderId']!;
tamaraPaymentStatus = uri.queryParameters['paymentStatus']!;
tamaraOrderID = uri.queryParameters['orderId']!;
}
}
@ -346,95 +361,155 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
}
onBrowserExit(bool isPaymentMade) async {
print("onBrowserExit Called!!!!");
if (selectedPaymentMethod == "TAMARA") {
// checkTamaraPaymentStatus(transID!, appo);
// if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
// updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo);
// } else {
// updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo);
// }
} else {
checkPaymentStatus();
// checkPaymentStatus(appo);
}
checkPaymentStatus();
}
void checkPaymentStatus() async {
LoaderBottomSheet.showLoader();
await payfortViewModel.checkPaymentStatus(
transactionID: transID,
onSuccess: (apiResponse) async {
print(apiResponse.data);
if (payfortViewModel.payfortCheckPaymentStatusResponseModel!.responseMessage!.toLowerCase() == "success") {
await myAppointmentsViewModel.createAdvancePayment(
paymentMethodName: selectedPaymentMethod,
projectID: widget.patientAppointmentHistoryResponseModel.projectID,
clinicID: widget.patientAppointmentHistoryResponseModel.clinicID,
appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(),
payedAmount: payfortViewModel.payfortCheckPaymentStatusResponseModel!.amount!,
paymentReference: payfortViewModel.payfortCheckPaymentStatusResponseModel!.fortId!,
patientID: appState.getAuthenticatedUser()!.patientId.toString(),
patientType: appState.getAuthenticatedUser()!.patientType!,
onSuccess: (value) async {
print(value);
await myAppointmentsViewModel.addAdvanceNumberRequest(
advanceNumber: Utils.isVidaPlusProject(widget.patientAppointmentHistoryResponseModel.projectID)
? value.data['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: value.data['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference: payfortViewModel.payfortCheckPaymentStatusResponseModel!.fortId!,
appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(),
onSuccess: (value) async {
if (widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment!) {
//TODO: Implement LiveCare Check-In API Call
await myAppointmentsViewModel.insertLiveCareVIDARequest(
clientRequestID: transID,
patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel,
onSuccess: (apiResponse) {
Future.delayed(Duration(milliseconds: 500), () {
LoaderBottomSheet.hideLoader();
Navigator.pushAndRemoveUntil(
context,
CustomPageRoute(
page: LandingNavigation(),
),
(r) => false);
});
},
onError: (error) {});
} else {
await myAppointmentsViewModel.generateAppointmentQR(
clinicID: widget.patientAppointmentHistoryResponseModel.clinicID,
projectID: widget.patientAppointmentHistoryResponseModel.projectID,
appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(),
isFollowUp: myAppointmentsViewModel.patientAppointmentShareResponseModel!.isFollowup!,
onSuccess: (apiResponse) {
Future.delayed(Duration(milliseconds: 500), () {
LoaderBottomSheet.hideLoader();
Navigator.pushAndRemoveUntil(
context,
CustomPageRoute(
page: LandingNavigation(),
),
(r) => false);
// Navigator.of(context).push(
// CustomPageRoute(page: MyAppointmentsPage()),
// );
});
});
}
});
});
} else {
LoaderBottomSheet.showLoader(loadingText: "Checking payment status, Please wait...".needTranslation);
if (selectedPaymentMethod == "TAMARA") {
await payfortViewModel.checkTamaraPaymentStatus(
transactionID: transID,
onSuccess: (apiResponse) async {
if (apiResponse.data["status"].toString().toLowerCase() == "success") {
tamaraOrderID = apiResponse.data["tamara_order_id"].toString();
await payfortViewModel.updateTamaraRequestStatus(responseMessage: "success", status: "14", clientRequestID: transID, tamaraOrderID: tamaraOrderID);
await payfortViewModel.markAppointmentAsTamaraPaid(
projectID: widget.patientAppointmentHistoryResponseModel.projectID, appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo);
await myAppointmentsViewModel.addAdvanceNumberRequest(
advanceNumber: "Tamara-Advance-0000",
paymentReference: tamaraOrderID,
appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(),
onSuccess: (value) async {
if (widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment!) {
//TODO: Implement LiveCare Check-In API Call
await myAppointmentsViewModel.insertLiveCareVIDARequest(
clientRequestID: tamaraOrderID,
patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel,
onSuccess: (apiResponse) {
Future.delayed(Duration(milliseconds: 500), () {
LoaderBottomSheet.hideLoader();
Navigator.pushAndRemoveUntil(
context,
CustomPageRoute(
page: LandingNavigation(),
),
(r) => false);
});
},
onError: (error) {});
} else {
await myAppointmentsViewModel.generateAppointmentQR(
clinicID: widget.patientAppointmentHistoryResponseModel.clinicID,
projectID: widget.patientAppointmentHistoryResponseModel.projectID,
appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(),
isFollowUp: myAppointmentsViewModel.patientAppointmentShareResponseModel!.isFollowup!,
onSuccess: (apiResponse) {
Future.delayed(Duration(milliseconds: 500), () {
LoaderBottomSheet.hideLoader();
Navigator.pushAndRemoveUntil(
context,
CustomPageRoute(
page: LandingNavigation(),
),
(r) => false);
});
});
}
});
} else {
await payfortViewModel.updateTamaraRequestStatus(responseMessage: "Failed", status: "00", clientRequestID: transID, tamaraOrderID: tamaraOrderID);
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: "Payment Failed! Please try again.".needTranslation),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
}
},
onError: (err) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: "Payment Failed! Please try again.".needTranslation),
child: Utils.getErrorWidget(loadingText: err),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
}
});
});
} else {
await payfortViewModel.checkPaymentStatus(
transactionID: transID,
onSuccess: (apiResponse) async {
print(apiResponse.data);
if (payfortViewModel.payfortCheckPaymentStatusResponseModel!.responseMessage!.toLowerCase() == "success") {
await myAppointmentsViewModel.createAdvancePayment(
paymentMethodName: selectedPaymentMethod,
projectID: widget.patientAppointmentHistoryResponseModel.projectID,
clinicID: widget.patientAppointmentHistoryResponseModel.clinicID,
appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(),
payedAmount: payfortViewModel.payfortCheckPaymentStatusResponseModel!.amount!,
paymentReference: payfortViewModel.payfortCheckPaymentStatusResponseModel!.fortId!,
patientID: appState.getAuthenticatedUser()!.patientId.toString(),
patientType: appState.getAuthenticatedUser()!.patientType!,
onSuccess: (value) async {
print(value);
await myAppointmentsViewModel.addAdvanceNumberRequest(
advanceNumber: Utils.isVidaPlusProject(widget.patientAppointmentHistoryResponseModel.projectID)
? value.data['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: value.data['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference: payfortViewModel.payfortCheckPaymentStatusResponseModel!.fortId!,
appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(),
onSuccess: (value) async {
if (widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment!) {
//TODO: Implement LiveCare Check-In API Call
await myAppointmentsViewModel.insertLiveCareVIDARequest(
clientRequestID: transID,
patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel,
onSuccess: (apiResponse) {
Future.delayed(Duration(milliseconds: 500), () {
LoaderBottomSheet.hideLoader();
Navigator.pushAndRemoveUntil(
context,
CustomPageRoute(
page: LandingNavigation(),
),
(r) => false);
});
},
onError: (error) {});
} else {
await myAppointmentsViewModel.generateAppointmentQR(
clinicID: widget.patientAppointmentHistoryResponseModel.clinicID,
projectID: widget.patientAppointmentHistoryResponseModel.projectID,
appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(),
isFollowUp: myAppointmentsViewModel.patientAppointmentShareResponseModel!.isFollowup!,
onSuccess: (apiResponse) {
Future.delayed(Duration(milliseconds: 500), () {
LoaderBottomSheet.hideLoader();
Navigator.pushAndRemoveUntil(
context,
CustomPageRoute(
page: LandingNavigation(),
),
(r) => false);
});
});
}
});
});
} else {
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: "Payment Failed! Please try again.".needTranslation),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
}
});
}
}
openPaymentURL(String paymentMethod) {

@ -8,19 +8,27 @@ import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/appointemnet_filters.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/appointments/widgets/AppointmentFilter.dart';
import 'package:hmg_patient_app_new/presentation/appointments/widgets/appointment_card.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/book_appointment_page.dart';
import 'package:hmg_patient_app_new/widgets/date_range_selector/date_range_calender.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/custom_tab_bar.dart';
import 'package:hmg_patient_app_new/widgets/date_range_selector/viewmodel/date_range_view_model.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:hmg_patient_app_new/widgets/shimmer/movies_shimmer_widget.dart';
import 'package:provider/provider.dart';
import '../../widgets/common_bottom_sheet.dart'
show showCommonBottomSheetWithoutHeight;
class MyAppointmentsPage extends StatefulWidget {
const MyAppointmentsPage({super.key});
@ -30,6 +38,7 @@ class MyAppointmentsPage extends StatefulWidget {
class _MyAppointmentsPageState extends State<MyAppointmentsPage> {
late MyAppointmentsViewModel myAppointmentsViewModel;
late BookAppointmentsViewModel bookAppointmentsViewModel;
@override
void initState() {
@ -43,6 +52,7 @@ class _MyAppointmentsPageState extends State<MyAppointmentsPage> {
@override
Widget build(BuildContext context) {
myAppointmentsViewModel = Provider.of<MyAppointmentsViewModel>(context, listen: false);
bookAppointmentsViewModel = Provider.of<BookAppointmentsViewModel>(context, listen: false);
return Scaffold(
backgroundColor: AppColors.bgScaffoldColor,
body: CollapsingListView(
@ -61,6 +71,8 @@ class _MyAppointmentsPageState extends State<MyAppointmentsPage> {
],
onTabChange: (index) {
myAppointmentsViewModel.onTabChange(index);
myAppointmentsViewModel.updateListWRTTab(index);
context.read<DateRangeSelectorRangeViewModel>().flush();
},
).paddingSymmetrical(24.h, 0.h),
Consumer<MyAppointmentsViewModel>(builder: (context, myAppointmentsVM, child) {
@ -74,218 +86,149 @@ class _MyAppointmentsPageState extends State<MyAppointmentsPage> {
}
Widget getSelectedTabData(int index, MyAppointmentsViewModel myAppointmentsVM) {
switch (index) {
case 0:
//All Appointments Tab Data
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Expandable list
ListView.separated(
padding: EdgeInsets.only(top: 24.h),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: myAppointmentsVM.isMyAppointmentsLoading
? 5
: myAppointmentsVM.patientAppointmentsHistoryList.isNotEmpty
? myAppointmentsVM.patientAppointmentsHistoryList.length
: 1,
itemBuilder: (context, index) {
return myAppointmentsVM.isMyAppointmentsLoading
? Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
child: AppointmentCard(
patientAppointmentHistoryResponseModel: PatientAppointmentHistoryResponseModel(),
myAppointmentsViewModel: myAppointmentsViewModel,
isLoading: true,
isFromHomePage: false,
),
).paddingSymmetrical(24.h, 0.h)
: myAppointmentsVM.patientAppointmentsHistoryList.isNotEmpty
? AnimationConfiguration.staggeredList(
position: index,
duration: const Duration(milliseconds: 500),
child: SlideAnimation(
verticalOffset: 100.0,
child: FadeInAnimation(
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOut,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
child: AppointmentCard(
patientAppointmentHistoryResponseModel: myAppointmentsVM.patientAppointmentsHistoryList[index],
myAppointmentsViewModel: myAppointmentsViewModel,
isLoading: false,
isFromHomePage: false,
),
).paddingSymmetrical(24.h, 0.h),
return getAppointList(
myAppointmentsVM, myAppointmentsVM.filteredAppointmentList);
}
Widget getAppointList(MyAppointmentsViewModel myAppointmentsVM,
List<PatientAppointmentHistoryResponseModel> filteredAppointmentList) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Visibility(
visible: myAppointmentsVM.availableFilters.isNotEmpty,
child: getAppointmentFilters(myAppointmentsVM)),
ListView.separated(
padding: EdgeInsets.only(top: 24.h),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: myAppointmentsVM.isMyAppointmentsLoading
? 5
: filteredAppointmentList.isNotEmpty
? filteredAppointmentList.length
: 1,
itemBuilder: (context, index) {
return myAppointmentsVM.isMyAppointmentsLoading
? Container(
decoration: RoundedRectangleBorder()
.toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.h,
hasShadow: true),
child: AppointmentCard(
patientAppointmentHistoryResponseModel:
PatientAppointmentHistoryResponseModel(),
myAppointmentsViewModel: myAppointmentsViewModel,
bookAppointmentsViewModel: bookAppointmentsViewModel,
isLoading: true,
isFromHomePage: false,
),
).paddingSymmetrical(24.h, 0.h)
: filteredAppointmentList.isNotEmpty
? AnimationConfiguration.staggeredList(
position: index,
duration: const Duration(milliseconds: 500),
child: SlideAnimation(
verticalOffset: 100.0,
child: FadeInAnimation(
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOut,
decoration: RoundedRectangleBorder()
.toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.h,
hasShadow: true),
child: AppointmentCard(
patientAppointmentHistoryResponseModel:
filteredAppointmentList[index],
myAppointmentsViewModel:
myAppointmentsViewModel,
bookAppointmentsViewModel: bookAppointmentsViewModel,
isLoading: false,
isFromHomePage: false,
),
),
)
: Utils.getNoDataWidget(
context,
noDataText: "You don't have any appointments yet.".needTranslation,
callToActionButton: CustomButton(
text: LocaleKeys.bookAppo.tr(context: context),
onPressed: () {
Navigator.of(context).push(
CustomPageRoute(
page: BookAppointmentPage(),
),
);
},
backgroundColor: Color(0xffFEE9EA),
borderColor: Color(0xffFEE9EA),
textColor: Color(0xffED1C2B),
fontSize: 14,
fontWeight: FontWeight.w500,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 40,
icon: AppAssets.add_icon,
iconColor: AppColors.primaryRedColor,
).paddingSymmetrical(48.h, 0.h),
);
},
separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h),
),
],
);
case 1:
//Upcoming Appointments Tab Data
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Expandable list
ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: myAppointmentsVM.isMyAppointmentsLoading
? 5
: myAppointmentsVM.patientUpcomingAppointmentsHistoryList.isNotEmpty
? myAppointmentsVM.patientUpcomingAppointmentsHistoryList.length
: 1,
itemBuilder: (context, index) {
return myAppointmentsVM.isMyAppointmentsLoading
? const MoviesShimmerWidget().paddingSymmetrical(24.h, 0.h)
: myAppointmentsVM.patientUpcomingAppointmentsHistoryList.isNotEmpty
? AnimationConfiguration.staggeredList(
position: index,
duration: const Duration(milliseconds: 500),
child: SlideAnimation(
verticalOffset: 100.0,
child: FadeInAnimation(
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOut,
margin: EdgeInsets.symmetric(vertical: 8.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
child: AppointmentCard(
patientAppointmentHistoryResponseModel: myAppointmentsVM.patientUpcomingAppointmentsHistoryList[index],
myAppointmentsViewModel: myAppointmentsViewModel,
),
).paddingSymmetrical(24.h, 0.h),
).paddingSymmetrical(24.h, 0.h),
),
),
)
: Utils.getNoDataWidget(
context,
noDataText: "You don't have any appointments yet."
.needTranslation,
callToActionButton: CustomButton(
text: LocaleKeys.bookAppo.tr(context: context),
onPressed: () {
Navigator.of(context).push(
CustomPageRoute(
page: BookAppointmentPage(),
),
),
)
: Utils.getNoDataWidget(
context,
noDataText: "You don't have any appointments yet.".needTranslation,
callToActionButton: CustomButton(
text: LocaleKeys.bookAppo.tr(context: context),
onPressed: () {
Navigator.of(context).push(
CustomPageRoute(
page: BookAppointmentPage(),
),
);
},
backgroundColor: Color(0xffFEE9EA),
borderColor: Color(0xffFEE9EA),
textColor: Color(0xffED1C2B),
fontSize: 14,
fontWeight: FontWeight.w500,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 40,
icon: AppAssets.add_icon,
iconColor: AppColors.primaryRedColor,
).paddingSymmetrical(48.h, 0.h),
);
},
separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h),
),
],
);
case 2:
//Completed Appointments Tab Data
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
);
},
backgroundColor: Color(0xffFEE9EA),
borderColor: Color(0xffFEE9EA),
textColor: Color(0xffED1C2B),
fontSize: 14,
fontWeight: FontWeight.w500,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 40,
icon: AppAssets.add_icon,
iconColor: AppColors.primaryRedColor,
).paddingSymmetrical(48.h, 0.h),
);
},
separatorBuilder: (BuildContext cxt, int index) =>
SizedBox(height: 16.h),
),
SizedBox(height: 24.h),
],
);
}
Widget getAppointmentFilters(MyAppointmentsViewModel myAppointmentsVM) {
return SizedBox(
height: 56.h,
child: Row(
children: [
// Expandable list
ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: myAppointmentsVM.isMyAppointmentsLoading
? 5
: myAppointmentsVM.patientArrivedAppointmentsHistoryList.isNotEmpty
? myAppointmentsVM.patientArrivedAppointmentsHistoryList.length
: 1,
itemBuilder: (context, index) {
return myAppointmentsVM.isMyAppointmentsLoading
? const MoviesShimmerWidget().paddingSymmetrical(24.h, 0.h)
: myAppointmentsVM.patientArrivedAppointmentsHistoryList.isNotEmpty
? AnimationConfiguration.staggeredList(
position: index,
duration: const Duration(milliseconds: 500),
child: SlideAnimation(
verticalOffset: 100.0,
child: FadeInAnimation(
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOut,
margin: EdgeInsets.symmetric(vertical: 8.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
child: AppointmentCard(
patientAppointmentHistoryResponseModel: myAppointmentsVM.patientArrivedAppointmentsHistoryList[index],
myAppointmentsViewModel: myAppointmentsViewModel,
),
).paddingSymmetrical(24.h, 0.h),
Expanded(
child: ListView.separated(
separatorBuilder: (_, index) => SizedBox(
width: 8.h,
),
scrollDirection: Axis.horizontal,
itemCount: myAppointmentsVM.availableFilters.length,
itemBuilder: (_, index) => AppointmentFilters(
selectedFilter: myAppointmentsVM.selectedFilter,
item: myAppointmentsVM.availableFilters[index],
onClicked: () {
if (myAppointmentsVM.availableFilters[index] ==
AppointmentListingFilters.DATESELECTION) {
showCommonBottomSheetWithoutHeight(
title: "Set The Date Range".needTranslation,
context,
child: DateRangeSelector(
onRangeSelected: (start, end) {
// if (start != null) {
myAppointmentsVM.getSelectedDateRange(
start, end);
// }
},
),
),
)
: Utils.getNoDataWidget(
context,
noDataText: "You don't have any appointments yet.".needTranslation,
callToActionButton: CustomButton(
text: LocaleKeys.bookAppo.tr(context: context),
onPressed: () {
Navigator.of(context).push(
CustomPageRoute(
page: BookAppointmentPage(),
),
);
},
backgroundColor: Color(0xffFEE9EA),
borderColor: Color(0xffFEE9EA),
textColor: Color(0xffED1C2B),
fontSize: 14,
fontWeight: FontWeight.w500,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 40,
icon: AppAssets.add_icon,
iconColor: AppColors.primaryRedColor,
).paddingSymmetrical(48.h, 0.h),
);
},
separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h),
isFullScreen: false,
isCloseButtonVisible: true,
callBackFunc: () {},
);
} else {
myAppointmentsVM.setSelectedFilter(
myAppointmentsVM.availableFilters[index]);
myAppointmentsVM.filterTheListAsPerSelection();
}
},
)),
),
],
);
default:
return Container();
}
)).paddingOnly(top: 24.h, left: 24.h, right: 24.h);
}
}

@ -61,7 +61,7 @@ class MyDoctorsPage extends StatelessWidget {
"https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png",
width: 63.h,
height: 63.h,
fit: BoxFit.fill,
fit: BoxFit.cover,
).circle(100).toShimmer2(isShow: true),
SizedBox(width: 16.h),
Expanded(
@ -112,7 +112,7 @@ class MyDoctorsPage extends StatelessWidget {
myAppointmentsVM.patientMyDoctorsList[index].doctorImageURL!,
width: 63.h,
height: 63.h,
fit: BoxFit.fill,
fit: BoxFit.cover,
).circle(100).toShimmer2(isShow: false),
SizedBox(width: 16.h),
Expanded(
@ -140,7 +140,7 @@ class MyDoctorsPage extends StatelessWidget {
children: [
"".toText16(),
Transform.flip(
flipX: appState.isArabic() ? true : false,
flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, width: 15.h, height: 15.h, fit: BoxFit.contain, iconColor: AppColors.textColor)),
],
),

@ -0,0 +1,48 @@
import 'package:easy_localization/easy_localization.dart' show tr, StringTranslateExtension;
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/appointemnet_filters.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:smooth_corner/smooth_corner.dart';
class AppointmentFilters extends StatelessWidget {
final AppointmentListingFilters item;
final List<AppointmentListingFilters>? selectedFilter;
final VoidCallback onClicked;
const AppointmentFilters(
{super.key,
required this.item,
required this.onClicked,
required this.selectedFilter});
@override
Widget build(BuildContext context) {
return AppCustomChipWidget(
backgroundColor: selectedFilter?.contains(item) == true?AppColors.chipSecondaryLightRedColor:AppColors.whiteColor,
icon: item.leadingIcon,
textColor: selectedFilter?.contains(item) == true
? AppColors.chipPrimaryRedBorderColor: AppColors.blackColor,
labelText: item.labelText.isNotEmpty?item.labelText.tr():"",
iconHasColor: true,
iconColor: selectedFilter?.contains(item) == true
? AppColors.chipPrimaryRedBorderColor:AppColors.blackColor,
iconSize: 16,
deleteIcon: item.trailingIcon,
labelPadding: EdgeInsetsDirectional.only(start: 8.h, end: 0.h),
padding: EdgeInsets.symmetric(vertical: 12.h, horizontal: 8.h),
deleteIconSize: Size(18.h, 18.h),
shape: SmoothRectangleBorder(
borderRadius: BorderRadius.circular(10.h),
smoothness: 10.h,
side: BorderSide(
color: selectedFilter?.contains(item) == true
? AppColors.chipPrimaryRedBorderColor
: AppColors.borderGrayColor,
width: 1),
)).onPress(onClicked);
}
}

@ -8,25 +8,42 @@ import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/doctors_list_response_model.dart';
import 'package:hmg_patient_app_new/features/medical_file/medical_file_view_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/utils/appointment_type.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/appointments/appointment_details_page.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/appointment_calendar.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
import 'package:smooth_corner/smooth_corner.dart';
class AppointmentCard extends StatefulWidget {
AppointmentCard({super.key, required this.patientAppointmentHistoryResponseModel, required this.myAppointmentsViewModel, this.isLoading = false, this.isFromHomePage = false});
AppointmentCard(
{super.key,
required this.patientAppointmentHistoryResponseModel,
required this.myAppointmentsViewModel,
required this.bookAppointmentsViewModel,
this.isLoading = false,
this.isFromHomePage = false,
this.isFromMedicalReport = false,
this.medicalFileViewModel});
PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel;
MyAppointmentsViewModel myAppointmentsViewModel;
bool isLoading;
bool isFromHomePage;
bool isFromMedicalReport;
MedicalFileViewModel? medicalFileViewModel;
BookAppointmentsViewModel bookAppointmentsViewModel;
@override
State<AppointmentCard> createState() => _AppointmentCardState();
@ -130,7 +147,7 @@ class _AppointmentCardState extends State<AppointmentCard> {
widget.isLoading ? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png" : widget.patientAppointmentHistoryResponseModel.doctorImageURL!,
width: 63.h,
height: 63.h,
fit: BoxFit.fill,
fit: BoxFit.cover,
).circle(100).toShimmer2(isShow: widget.isLoading),
SizedBox(width: 16.h),
Expanded(
@ -157,9 +174,11 @@ class _AppointmentCardState extends State<AppointmentCard> {
labelText:
widget.isLoading ? "Cardiology" : DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.patientAppointmentHistoryResponseModel.appointmentDate), false))
.toShimmer2(isShow: widget.isLoading),
AppCustomChipWidget(
icon: AppAssets.appointment_time_icon,
labelText: widget.isLoading
widget.isFromMedicalReport
? SizedBox.shrink()
: AppCustomChipWidget(
icon: AppAssets.appointment_time_icon,
labelText: widget.isLoading
? "Cardiology"
: DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(widget.patientAppointmentHistoryResponseModel.appointmentDate), false))
.toShimmer2(isShow: widget.isLoading),
@ -171,75 +190,91 @@ class _AppointmentCardState extends State<AppointmentCard> {
],
),
SizedBox(height: 16.h),
Row(
children: [
Expanded(
flex: 6,
child: AppointmentType.isArrived(widget.patientAppointmentHistoryResponseModel)
? getArrivedAppointmentButton().toShimmer2(isShow: widget.isLoading)
: CustomButton(
text: AppointmentType.getNextActionText(widget.patientAppointmentHistoryResponseModel.nextAction),
onPressed: () {
Navigator.of(context)
.push(CustomPageRoute(
page: AppointmentDetailsPage(patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel),
))
.then((val) {
widget.myAppointmentsViewModel.initAppointmentsViewModel();
widget.myAppointmentsViewModel.getPatientAppointments(true, false);
});
},
backgroundColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.15),
borderColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.01),
textColor: AppointmentType.getNextActionTextColor(widget.patientAppointmentHistoryResponseModel.nextAction),
fontSize: 14,
fontWeight: FontWeight.w500,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 40.h,
icon: AppointmentType.getNextActionIcon(widget.patientAppointmentHistoryResponseModel.nextAction),
iconColor: AppointmentType.getNextActionTextColor(widget.patientAppointmentHistoryResponseModel.nextAction),
iconSize: 15.h,
).toShimmer2(isShow: widget.isLoading),
),
SizedBox(width: 8.h),
Expanded(
flex: 1,
child: Container(
widget.isFromMedicalReport
? CustomButton(
text: "Select appointment".needTranslation,
onPressed: () {
widget.medicalFileViewModel!.setSelectedMedicalReportAppointment(widget.patientAppointmentHistoryResponseModel);
Navigator.pop(context, false);
},
backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor,
fontSize: 14,
fontWeight: FontWeight.w500,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 40.h,
width: 40.h,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.textColor,
borderRadius: 10.h,
),
child: Padding(
padding: EdgeInsets.all(10.h),
child: Transform.flip(
flipX: appState.isArabic() ? true : false,
child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon,
iconColor: AppColors.whiteColor,
width: 10.h,
height: 10.h,
fit: BoxFit.contain,
),
icon: AppAssets.checkmark_icon,
iconColor: AppColors.primaryRedColor,
iconSize: 16.h,
)
: Row(
children: [
Expanded(
flex: 6,
child: AppointmentType.isArrived(widget.patientAppointmentHistoryResponseModel)
? getArrivedAppointmentButton().toShimmer2(isShow: widget.isLoading)
: CustomButton(
text: AppointmentType.getNextActionText(widget.patientAppointmentHistoryResponseModel.nextAction),
onPressed: () {
Navigator.of(context)
.push(CustomPageRoute(
page: AppointmentDetailsPage(patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel),
))
.then((val) {
widget.myAppointmentsViewModel.initAppointmentsViewModel();
widget.myAppointmentsViewModel.getPatientAppointments(true, false);
});
},
backgroundColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.15),
borderColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.01),
textColor: AppointmentType.getNextActionTextColor(widget.patientAppointmentHistoryResponseModel.nextAction),
fontSize: 14,
fontWeight: FontWeight.w500,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 40.h,
icon: AppointmentType.getNextActionIcon(widget.patientAppointmentHistoryResponseModel.nextAction),
iconColor: AppointmentType.getNextActionTextColor(widget.patientAppointmentHistoryResponseModel.nextAction),
iconSize: 15.h,
).toShimmer2(isShow: widget.isLoading),
),
),
).toShimmer2(isShow: widget.isLoading).onPress(() {
Navigator.of(context)
.push(
CustomPageRoute(
page: AppointmentDetailsPage(patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel),
SizedBox(width: 8.h),
Expanded(
flex: 1,
child: Container(
height: 40.h,
width: 40.h,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.textColor,
borderRadius: 10.h,
),
child: Transform.flip(
flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon,
iconColor: AppColors.whiteColor,
width: 40.h,
height: 40.h,
fit: BoxFit.cover,
),
),
).toShimmer2(isShow: widget.isLoading).onPress(() {
Navigator.of(context)
.push(
CustomPageRoute(
page: AppointmentDetailsPage(patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel),
),
)
.then((val) {
widget.myAppointmentsViewModel.initAppointmentsViewModel();
widget.myAppointmentsViewModel.getPatientAppointments(true, false);
});
}),
),
)
.then((val) {
widget.myAppointmentsViewModel.initAppointmentsViewModel();
widget.myAppointmentsViewModel.getPatientAppointments(true, false);
});
}),
),
],
),
],
),
],
),
),
@ -265,7 +300,9 @@ class _AppointmentCardState extends State<AppointmentCard> {
)
: CustomButton(
text: "Rebook with same doctor".needTranslation,
onPressed: () {},
onPressed: () {
openDoctorScheduleCalendar();
},
backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor,
textColor: AppColors.blackColor,
@ -280,5 +317,45 @@ class _AppointmentCardState extends State<AppointmentCard> {
);
}
openDoctorScheduleCalendar() async {
DoctorsListResponseModel doctor = DoctorsListResponseModel(
clinicID: widget.patientAppointmentHistoryResponseModel.clinicID,
projectID: widget.patientAppointmentHistoryResponseModel.projectID,
doctorID: widget.patientAppointmentHistoryResponseModel.doctorID,
doctorImageURL: widget.patientAppointmentHistoryResponseModel.doctorImageURL,
doctorTitle: widget.patientAppointmentHistoryResponseModel.doctorTitle,
name: widget.patientAppointmentHistoryResponseModel.doctorNameObj,
nationalityFlagURL: "https://hmgwebservices.com/Images/flag/SYR.png",
speciality: [],
clinicName: widget.patientAppointmentHistoryResponseModel.clinicName,
projectName: widget.patientAppointmentHistoryResponseModel.projectName,
);
widget.bookAppointmentsViewModel.setSelectedDoctor(doctor);
LoaderBottomSheet.showLoader();
await widget.bookAppointmentsViewModel.getDoctorFreeSlots(
isBookingForLiveCare: false,
onSuccess: (dynamic respData) async {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
title: "Pick a Date".needTranslation,
context,
child: AppointmentCalendar(),
isFullScreen: false,
isCloseButtonVisible: true,
callBackFunc: () {},
);
},
onError: (err) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: err),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
});
}
void performAppointmentNextAction(nextAction) {}
}

@ -122,9 +122,9 @@ class AppointmentCheckinBottomSheet extends StatelessWidget {
),
),
Transform.flip(
flipX: appState.isArabic() ? true : false,
flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon,
icon: AppAssets.forward_arrow_icon_small,
iconColor: AppColors.blackColor,
width: 18.h,
height: 13.h,

@ -40,7 +40,7 @@ class AppointmentDoctorCard extends StatelessWidget {
patientAppointmentHistoryResponseModel.doctorImageURL!,
width: 63.h,
height: 63.h,
fit: BoxFit.fill,
fit: BoxFit.cover,
).circle(100),
SizedBox(width: 16.h),
Expanded(

@ -46,9 +46,9 @@ class FacilitySelectionItem extends StatelessWidget {
children: [
info,
Transform.flip(
flipX: appState.isArabic() ? true : false,
flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon,
icon: AppAssets.forward_arrow_icon_small,
iconColor: AppColors.blackColor,
width: 18,
height: 13,

@ -99,11 +99,13 @@ class HospitalBottomSheetBody extends StatelessWidget {
if (regionalViewModel.regionBottomSheetType == RegionBottomSheetType.FOR_REGION) {
regionalViewModel.setBottomSheetState(AppointmentViaRegionState.CLINIC_SELECTION);
regionalViewModel.handleLastStepForRegion();
}else if (regionalViewModel.regionBottomSheetType == RegionBottomSheetType.FOR_CLINIIC) {
} else if (regionalViewModel.regionBottomSheetType == RegionBottomSheetType.FOR_CLINIIC) {
regionalViewModel.setBottomSheetState(AppointmentViaRegionState.DOCTOR_SELECTION);
regionalViewModel.handleLastStepForClinic();
} else if (regionalViewModel.regionBottomSheetType == RegionBottomSheetType.REGION_FOR_DENTAL_AND_LASER) {
regionalViewModel.setBottomSheetState(AppointmentViaRegionState.DOCTOR_SELECTION);
regionalViewModel.handleLastStepForClinicForDentalAndLaser();
// regionalViewModel.handleLastStepForClinic();
}
});},
separatorBuilder: (_, __) => SizedBox(

@ -0,0 +1,66 @@
import 'package:easy_localization/easy_localization.dart'
show tr, StringTranslateExtension;
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/enums.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/doctor_filter/doctor_filter_view_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/appointment_via_region_viewmodel.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/facility_selection.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/appointments/widgets/hospital_bottom_sheet/hospital_list_items.dart';
import 'package:hmg_patient_app_new/presentation/appointments/widgets/hospital_bottom_sheet/type_selection_widget.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/theme/colors.dart' show AppColors;
import 'package:hmg_patient_app_new/widgets/input_widget.dart';
import 'package:provider/provider.dart';
class HospitalBottomSheetBodyForDoctorFilter extends StatelessWidget {
late BookAppointmentsViewModel appointmentsViewModel;
late AppointmentViaRegionViewmodel regionalViewModel;
final TextEditingController searchText = TextEditingController();
HospitalBottomSheetBodyForDoctorFilter({super.key});
@override
Widget build(BuildContext context) {
appointmentsViewModel = Provider.of<BookAppointmentsViewModel>(context);
regionalViewModel = Provider.of<AppointmentViaRegionViewmodel>(context);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
LocaleKeys.selectHospital.tr(),
style: TextStyle(
fontSize: 21,
fontWeight: FontWeight.w600,
color: AppColors.blackColor,
),
),
SizedBox(height: 24.h),
SizedBox(
height: MediaQuery.sizeOf(context).height * .4,
child: ListView.separated(
itemBuilder: (_, index)
{
var hospital = appointmentsViewModel.searchedPatientDoctorAppointmentHospitalsList[index];
return HospitalListItem(
hospitalData: hospital,
isLocationEnabled: appointmentsViewModel.isLocationEnabled(),
).onPress(() {
regionalViewModel.setHospitalModel(hospital);
context.read<DoctorFilterViewModel>().setSelectedHospital(hospital);
Navigator.pop(context);
});},
separatorBuilder: (_, __) => SizedBox(
height: 16.h,
),
itemCount: appointmentsViewModel.searchedPatientDoctorAppointmentHospitalsList?.length ?? 0),
)
],
);
}
}

@ -39,12 +39,12 @@ class HospitalListItem extends StatelessWidget {
),
),
Transform.flip(
flipX: appState.isArabic() ? true : false,
flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon,
icon: AppAssets.forward_arrow_icon_small,
iconColor: AppColors.blackColor,
width: 18,
height: 13,
width: 18.h,
height: 13.h,
fit: BoxFit.contain,
),
),

@ -43,9 +43,9 @@ class RegionListItem extends StatelessWidget {
],
),
Transform.flip(
flipX: appState.isArabic() ? true : false,
flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon,
icon: AppAssets.forward_arrow_icon_small,
iconColor: AppColors.blackColor,
width: 18,
height: 13,

@ -24,7 +24,7 @@ class _RegionBottomSheetBodyState extends State<RegionBottomSheetBody> {
@override
void initState() {
scheduleMicrotask(() {
if (regionalViewModel.regionBottomSheetType == RegionBottomSheetType.FOR_REGION) {
if (regionalViewModel.regionBottomSheetType == RegionBottomSheetType.FOR_REGION || regionalViewModel.regionBottomSheetType == RegionBottomSheetType.REGION_FOR_DENTAL_AND_LASER ) {
myAppointmentsViewModel.getRegionMappedProjectList();
} else if (regionalViewModel.regionBottomSheetType == RegionBottomSheetType.FOR_CLINIIC) {
myAppointmentsViewModel.getMappedDoctors();

@ -9,18 +9,24 @@ import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/immediate_livecare_view_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/appointment_via_region_viewmodel.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/doctor_list_api_response.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/appointments/widgets/faculity_selection/facility_type_selection_widget.dart';
import 'package:hmg_patient_app_new/presentation/appointments/widgets/region_bottomsheet/region_list_widget.dart' show RegionBottomSheetBody;
import 'package:hmg_patient_app_new/presentation/book_appointment/livecare/immediate_livecare_pending_request_page.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/livecare/select_immediate_livecare_clinic_page.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/search_doctor_by_name.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/select_clinic_page.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart' show showCommonBottomSheetWithoutHeight;
import 'package:hmg_patient_app_new/widgets/custom_tab_bar.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
import 'package:provider/provider.dart';
@ -38,13 +44,17 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
late AppState appState;
late AppointmentViaRegionViewmodel regionalViewModel;
late BookAppointmentsViewModel bookAppointmentsViewModel;
late ImmediateLiveCareViewModel immediateLiveCareViewModel;
late final AuthenticationViewModel authVM;
@override
void initState() {
authVM = context.read<AuthenticationViewModel>();
scheduleMicrotask(() {
bookAppointmentsViewModel.selectedTabIndex = 0;
bookAppointmentsViewModel.initBookAppointmentViewModel();
bookAppointmentsViewModel.getLocation();
immediateLiveCareViewModel.initImmediateLiveCare();
});
super.initState();
}
@ -52,6 +62,7 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
@override
Widget build(BuildContext context) {
bookAppointmentsViewModel = Provider.of<BookAppointmentsViewModel>(context, listen: false);
immediateLiveCareViewModel = Provider.of<ImmediateLiveCareViewModel>(context, listen: false);
appState = getIt.get<AppState>();
regionalViewModel = Provider.of<AppointmentViaRegionViewmodel>(context, listen: true);
return Scaffold(
@ -119,7 +130,7 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
],
),
Transform.flip(
flipX: appState.isArabic() ? true : false, child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 15.h, height: 15.h)),
flipX: appState.isArabic(), child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 40.h, height: 40.h)),
],
).onPress(() {
bookAppointmentsViewModel.setIsClinicsListLoading(true);
@ -152,7 +163,7 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
],
),
Transform.flip(
flipX: appState.isArabic() ? true : false, child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 15.h, height: 15.h)),
flipX: appState.isArabic(), child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 40.h, height: 40.h)),
],
).onPress(() {
bookAppointmentsViewModel.setIsDoctorSearchByNameStarted(false);
@ -183,7 +194,7 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
],
),
Transform.flip(
flipX: appState.isArabic() ? true : false, child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 15.h, height: 15.h)),
flipX: appState.isArabic(), child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 40.h, height: 40.h)),
],
).onPress(() {
bookAppointmentsViewModel.setProjectID(null);
@ -197,11 +208,12 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
).paddingSymmetrical(24.h, 0.h);
case 1:
//TODO: Get LiveCare type Select UI from Hussain
return Column(
children: [
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
return appState.isAuthenticated
? Column(
children: [
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.h,
hasShadow: false,
),
@ -227,17 +239,28 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
],
),
Transform.flip(
flipX: appState.isArabic() ? true : false, child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 15.h, height: 15.h)),
flipX: appState.isArabic(), child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 40.h, height: 40.h)),
],
).onPress(() {
// bookAppointmentsViewModel.setIsClinicsListLoading(true);
// bookAppointmentsViewModel.setLoadSpecificClinic(false);
// bookAppointmentsViewModel.setProjectID(null);
// Navigator.of(context).push(
// CustomPageRoute(
// page: SelectClinicPage(),
// ),
// );
).onPress(() async {
//TODO Implement API to check for existing LiveCare Requests
LoaderBottomSheet.showLoader();
await immediateLiveCareViewModel.getPatientLiveCareHistory();
LoaderBottomSheet.hideLoader();
if (immediateLiveCareViewModel.patientHasPendingLiveCareRequest) {
Navigator.of(context).push(
CustomPageRoute(
page: ImmediateLiveCarePendingRequestPage(),
),
);
} else {
Navigator.of(context).push(
CustomPageRoute(
page: SelectImmediateLiveCareClinicPage(),
),
);
}
}),
SizedBox(height: 16.h),
Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.1), height: 1.h),
@ -259,7 +282,7 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
],
),
Transform.flip(
flipX: appState.isArabic() ? true : false, child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 15.h, height: 15.h)),
flipX: appState.isArabic(), child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 40.h, height: 40.h)),
],
).onPress(() {
bookAppointmentsViewModel.setIsClinicsListLoading(true);
@ -290,7 +313,7 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
],
),
Transform.flip(
flipX: appState.isArabic() ? true : false, child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 15.h, height: 15.h)),
flipX: appState.isArabic(), child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 40.h, height: 40.h)),
],
).onPress(() {
openRegionListBottomSheet(context, RegionBottomSheetType.FOR_REGION);
@ -300,7 +323,8 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
),
),
],
).paddingSymmetrical(24.h, 0.h);
).paddingSymmetrical(24.h, 0.h)
: getLiveCareNotLoggedInUI();
default:
SizedBox.shrink();
}
@ -357,4 +381,93 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
});
}
}
Widget getLiveCareNotLoggedInUI() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Utils.buildSvgWithAssets(icon: AppAssets.immediate_service_icon, width: 58.h, height: 58.h),
SizedBox(width: 18.h),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Immediate service".needTranslation.toText18(color: AppColors.textColor, isBold: true),
"No need to wait, you will get medical consultation immediately via video call".needTranslation.toText14(color: AppColors.greyTextColor, weight: FontWeight.w500),
],
),
),
],
),
SizedBox(height: 24.h),
Row(
children: [
Utils.buildSvgWithAssets(icon: AppAssets.no_visit_icon, width: 58.h, height: 58.h),
SizedBox(width: 18.h),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"No visit required".needTranslation.toText18(color: AppColors.textColor, isBold: true),
LocaleKeys.livecarePoint5.tr(context: context).toText14(color: AppColors.greyTextColor, weight: FontWeight.w500),
],
),
),
],
),
SizedBox(height: 24.h),
Row(
children: [
Utils.buildSvgWithAssets(icon: AppAssets.doctor_contact_icon, width: 58.h, height: 58.h),
SizedBox(width: 18.h),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Doctor will contact".needTranslation.toText18(color: AppColors.textColor, isBold: true),
"A specialised doctor will contact you and will be able to view your medical history".needTranslation.toText14(color: AppColors.greyTextColor, weight: FontWeight.w500),
],
),
),
],
),
SizedBox(height: 24.h),
Row(
children: [
Utils.buildSvgWithAssets(icon: AppAssets.free_med_delivery_icon, width: 58.h, height: 58.h),
SizedBox(width: 18.h),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Free medicine delivery".needTranslation.toText18(color: AppColors.textColor, isBold: true),
"Offers free medicine delivery for the LiveCare appointment".needTranslation.toText14(color: AppColors.greyTextColor, weight: FontWeight.w500),
],
),
),
],
),
SizedBox(height: 36.h),
CustomButton(
text: "Login to use this service".needTranslation,
onPressed: () async {
await authVM.onLoginPressed();
},
backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedColor,
textColor: AppColors.whiteColor,
fontSize: 16,
fontWeight: FontWeight.w500,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 50.h,
icon: AppAssets.login1,
iconColor: AppColors.whiteColor,
iconSize: 24.h,
),
],
).paddingSymmetrical(24.h, 0.h);
}
}

@ -0,0 +1,95 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/dental_chief_complaints_response_model.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/select_doctor_page.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/chief_complaint_card.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:provider/provider.dart';
class DentalChiefComplaintsPage extends StatefulWidget {
const DentalChiefComplaintsPage({super.key});
@override
State<DentalChiefComplaintsPage> createState() => _DentalChiefComplaintsPageState();
}
class _DentalChiefComplaintsPageState extends State<DentalChiefComplaintsPage> {
late AppState appState;
late BookAppointmentsViewModel bookAppointmentsViewModel;
@override
void initState() {
scheduleMicrotask(() {
bookAppointmentsViewModel.getDentalChiefComplaintsList();
});
super.initState();
}
@override
Widget build(BuildContext context) {
bookAppointmentsViewModel = Provider.of<BookAppointmentsViewModel>(context, listen: false);
appState = getIt.get<AppState>();
return CollapsingListView(
title: "Dental Chief Complaints".needTranslation,
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 24.h),
child: Consumer<BookAppointmentsViewModel>(builder: (context, bookAppointmentsVM, child) {
return ListView.separated(
padding: EdgeInsets.only(top: 24.h),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: bookAppointmentsVM.isChiefComplaintsListLoading ? 5 : bookAppointmentsVM.dentalChiefComplaintsList.length,
itemBuilder: (context, index) {
return bookAppointmentsVM.isChiefComplaintsListLoading
? ChiefComplaintCard(
bookAppointmentsVM: bookAppointmentsVM,
dentalChiefComplaintsListResponseModel: DentalChiefComplaintsListResponseModel(),
isLoading: bookAppointmentsVM.isChiefComplaintsListLoading,
)
: AnimationConfiguration.staggeredList(
position: index,
duration: const Duration(milliseconds: 500),
child: SlideAnimation(
verticalOffset: 100.0,
child: FadeInAnimation(
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOut,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
child: ChiefComplaintCard(
bookAppointmentsVM: bookAppointmentsVM,
dentalChiefComplaintsListResponseModel: bookAppointmentsVM.dentalChiefComplaintsList[index],
isLoading: bookAppointmentsVM.isChiefComplaintsListLoading,
).onPress(() {
bookAppointmentsVM.setSelectedChiefComplaintID(bookAppointmentsVM.dentalChiefComplaintsList[index].iD!);
bookAppointmentsViewModel.setIsDoctorsListLoading(true);
Navigator.of(context).push(
CustomPageRoute(
page: SelectDoctorPage(),
),
);
}),
),
),
),
);
},
separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h),
);
}),
),
),
);
}
}

@ -0,0 +1,60 @@
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart'
show BookAppointmentsViewModel;
import 'package:hmg_patient_app_new/features/doctor_filter/doctor_filter_view_model.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:provider/provider.dart';
class RegionChips extends StatelessWidget {
const RegionChips({super.key});
@override
Widget build(BuildContext context) {
return Selector<DoctorFilterViewModel, List<String>>(
selector: (_, model) => model.searchedRegionList,
builder: (__, data, ___) =>
Selector<DoctorFilterViewModel, List<String>?>(
selector: (_, model) => model.selectedRegionForFilters,
builder: (context, selectRegion, ___) => Row(
children: [
Expanded(
child: ListView.separated(
scrollDirection: Axis.horizontal,
itemCount: data.length,
separatorBuilder: (_, __)=>SizedBox(width: 8.h,),
itemBuilder: (_, index) => AppCustomChipWidget(
labelText: data[index],
textColor: selectRegion?.any((selectedRegion)=>data[index] == selectedRegion) == true
? AppColors.primaryRedColor
: AppColors.textColor,
backgroundColor:
selectRegion?.any((selectedRegion)=>data[index] == selectedRegion) == true
? AppColors.primaryRedColor
.withOpacity(0.1)
: AppColors.whiteColor,
shape: RoundedRectangleBorder(
side: BorderSide(
color: selectRegion?.any((selectedRegion)=>data[index] == selectedRegion) == true
? AppColors
.primaryRedBorderColor
: AppColors
.chipBorderColorOpacity20,
width: 1,
),
borderRadius:
BorderRadius.circular(10)))
.onPress(() {
context
.read<DoctorFilterViewModel>()
.setSelectedRegion(data[index]);
})))
],
),
));
}
}

@ -0,0 +1,85 @@
import 'package:easy_localization/easy_localization.dart'
show tr, StringTranslateExtension;
import 'package:flutter/material.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
import 'package:hmg_patient_app_new/core/enums.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/doctor_filter/doctor_filter_view_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/appointment_via_region_viewmodel.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/facility_selection.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/appointments/widgets/hospital_bottom_sheet/hospital_list_items.dart';
import 'package:hmg_patient_app_new/presentation/appointments/widgets/hospital_bottom_sheet/type_selection_widget.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/doctor_filter/clinic_item.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/clinic_card.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/theme/colors.dart' show AppColors;
import 'package:hmg_patient_app_new/widgets/input_widget.dart';
import 'package:provider/provider.dart';
import '../../../features/book_appointments/models/resp_models/get_clinic_list_response_model.dart' show GetClinicsListResponseModel;
class ClinicBottomSheet extends StatelessWidget {
late BookAppointmentsViewModel appointmentsViewModel;
late AppointmentViaRegionViewmodel regionalViewModel;
final TextEditingController searchText = TextEditingController();
ClinicBottomSheet({super.key});
@override
Widget build(BuildContext context) {
appointmentsViewModel = Provider.of<BookAppointmentsViewModel>(context);
regionalViewModel = Provider.of<AppointmentViaRegionViewmodel>(context);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
LocaleKeys.selectClinic.tr(),
style: TextStyle(
fontSize: 21,
fontWeight: FontWeight.w600,
color: AppColors.blackColor,
),
),
SizedBox(height: 24.h),
SizedBox(
height: MediaQuery.sizeOf(context).height * .4,
child: ListView.separated(
itemBuilder: (_, index)
{
return AnimationConfiguration.staggeredList(
position: index,
duration: const Duration(milliseconds: 500),
child: SlideAnimation(
verticalOffset: 100.0,
child: FadeInAnimation(
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOut,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
child: ClinicItem(
isArabic: appointmentsViewModel.isArabic(),
clinicName: appointmentsViewModel.searchedClinicList[index],
),
),
),
),
).onPress(() {
context.read<DoctorFilterViewModel>()
.setSelectedClinicForFilter(appointmentsViewModel.searchedClinicList[index]);
Navigator.pop(context);
});},
separatorBuilder: (_, __) => SizedBox(
height: 16.h,
),
itemCount: appointmentsViewModel.searchedClinicList.length ?? 0),
)
],
);
}
}

@ -0,0 +1,52 @@
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/theme/colors.dart' show AppColors;
class ClinicItem extends StatelessWidget {
final String clinicName;
final bool isArabic;
ClinicItem({super.key, required this.clinicName, required this.isArabic});
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(16.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.h,
hasShadow: false,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Utils.buildSvgWithAssets(
icon: AppAssets.generic_clinic_icon,
width: 24.h,
height: 24.h,
fit: BoxFit.contain),
SizedBox(height: 16.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(child: clinicName.toText16(isBold: true)),
Transform.flip(
flipX: isArabic,
child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon,
width: 15.h,
height: 15.h,
fit: BoxFit.contain,
iconColor: AppColors.textColor),
),
],
),
],
),
);
}
}

@ -0,0 +1,249 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/doctor_filter/doctor_filter_view_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/appointment_via_region_viewmodel.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/appointments/widgets/hospital_bottom_sheet/hospital_bottom_sheet_body.dart';
import 'package:hmg_patient_app_new/presentation/appointments/widgets/hospital_bottom_sheet/hospital_bottom_sheet_body_for_doctor_filter.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/doctor_filter/RegionChips.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/doctor_filter/clinic_bottomsheet.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/doctor_filter/facility_Chips.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/input_widget.dart';
import 'package:provider/provider.dart';
import '../../../widgets/buttons/custom_button.dart';
class DoctorsFilters extends StatelessWidget{
TextEditingController hospitalController = TextEditingController();
TextEditingController clinicController = TextEditingController();
DoctorsFilters({super.key,});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.bgScaffoldColor,
appBar: AppBar(
backgroundColor: AppColors.bgScaffoldColor,
automaticallyImplyLeading: false,
centerTitle: false,
title: Utils.buildSvgWithAssets(icon: AppAssets.ic_close, height: 32.h, width: 32.h).onPress((){
context.read<DoctorFilterViewModel>()
.clearSelection()
;
Navigator.pop(context);
})
),
body: Column(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
LocaleKeys.filters.tr(),
style:TextStyle(
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 27.fSize,
color: AppColors.textColor,
letterSpacing: -1
)
),
Text(
LocaleKeys.clearAllFilters.tr(),
style:TextStyle(
fontFamily: 'Poppins',
fontWeight: FontWeight.w500,
fontSize: 14.fSize,
color: AppColors.errorColor
)
).onPress((){
context.read<DoctorFilterViewModel>().clearSelection();
context.read<DoctorFilterViewModel>().updateApplyFilters(false);
// context.read<BookAppointmentsViewModel>().setSelections(
// context.read<DoctorFilterViewModel>().selectedFacilityForFilters,
// context.read<DoctorFilterViewModel>().selectedRegionForFilters,
// context.read<DoctorFilterViewModel>().selectedClinicForFilters,
// context.read<DoctorFilterViewModel>().selectedHospitalForFilters,
// context.read<DoctorFilterViewModel>().applyFilters);
context.read<BookAppointmentsViewModel>().updateList();
})
],
),
titleWidget(LocaleKeys.regionAndLocation.tr()),
SizedBox(
height: 42.h,
child: RegionChips()),
titleWidget(LocaleKeys.facilityAndLocation.tr()),
SizedBox(
height: 42.h,
child: FacilityChip()),
titleWidget(LocaleKeys.hospital.tr()),
TextInputWidget(
controller: TextEditingController()..text =context.watch<DoctorFilterViewModel>().selectedHospitalForFilters?.filterName??'',
labelText: LocaleKeys.hospital.tr(context: context),
hintText: LocaleKeys.searchHospital.tr(context: context),
isEnable: false,
prefix: null,
autoFocus: false,
isBorderAllowed: false,
keyboardType: TextInputType.text,
suffix:context.watch<DoctorFilterViewModel>().selectedHospitalForFilters != null
? GestureDetector(
onTap: () {
context.read<DoctorFilterViewModel>().setSelectedHospital(null);
},
child: Utils.buildSvgWithAssets(icon: AppAssets.ic_cross_circle, width: 24.h, height: 24.h, fit: BoxFit.scaleDown),
)
: null,
onChange: (value) {
// DoctorFilterViewModel.filterClinics(value!);
},
padding: EdgeInsets.symmetric(
vertical: ResponsiveExtension(8).h,
horizontal: ResponsiveExtension(10).h,
),
).onPress((){
openRegionListBottomSheet(context, RegionBottomSheetType.FOR_REGION);
}),
titleWidget(LocaleKeys.clinic.tr()),
TextInputWidget(
controller: TextEditingController()..text =context.watch<DoctorFilterViewModel>().selectedClinicForFilters ??'',
labelText: LocaleKeys.clinicName.tr(context: context),
hintText: LocaleKeys.searchClinic.tr().needTranslation,
isEnable: false,
prefix: null,
autoFocus: false,
isBorderAllowed: false,
keyboardType: TextInputType.text,
suffix:context.read<DoctorFilterViewModel>().selectedClinicForFilters?.isNotEmpty == true
? GestureDetector(
onTap: () {
context.read<DoctorFilterViewModel>().setSelectedClinicForFilter(null);
},
child: Utils.buildSvgWithAssets(icon: AppAssets.ic_cross_circle, width: 20.h, height: 20.h, fit: BoxFit.scaleDown),
)
: null,
onChange: (value) {
// DoctorFilterViewModel.filterClinics(value!);
},
padding: EdgeInsets.symmetric(
vertical: 8.h,
horizontal: 10.h,
),
).onPress((){
openClinicListBottomSheet(context,);
}),
],
).paddingSymmetrical(24.h, 0.h),
Spacer(),
DecoratedBox(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: Colors.white,
customBorder: BorderRadius.only(topLeft: Radius.circular(24.h), topRight: Radius.circular(24.h)) ,
),
child: CustomButton(
text: LocaleKeys.applyFilter.tr(),
onPressed: () {
context.read<DoctorFilterViewModel>().updateApplyFilters(true);
context.read<BookAppointmentsViewModel>().setSelections(
context.read<DoctorFilterViewModel>().selectedFacilityForFilters?.toList()??[],
context.read<DoctorFilterViewModel>().selectedRegionForFilters?.toList()??[],
context.read<DoctorFilterViewModel>().selectedClinicForFilters,
context.read<DoctorFilterViewModel>().selectedHospitalForFilters,
context.read<DoctorFilterViewModel>().applyFilters);
context.read<BookAppointmentsViewModel>().updateList();
Navigator.pop(context);
},
backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedColor,
textColor: Colors.white,
fontSize: 16,
padding: EdgeInsets.zero,
fontWeight: FontWeight.w500,
borderRadius: 12,
icon: AppAssets.add_icon,
iconColor: AppColors.primaryRedColor,
).paddingAll(24.h),
),
],
),
);
}
Widget titleWidget(String title){
return Column(
children: [
SizedBox(height: 24.h,),
Text(
title,
style:TextStyle(
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 16.fSize,
color: AppColors.textColor,
letterSpacing:-1
)
),
SizedBox(height: 8.h,),
],
);
}
void openRegionListBottomSheet(BuildContext context, RegionBottomSheetType type) {
context.read<AppointmentViaRegionViewmodel>().flush();
context.read<AppointmentViaRegionViewmodel>().setBottomSheetType(type);
context.read<AppointmentViaRegionViewmodel>().setBottomSheetState(AppointmentViaRegionState.HOSPITAL_SELECTION);
// AppointmentViaRegionViewmodel? viewmodel = null;
showCommonBottomSheetWithoutHeight(context, title: "", titleWidget: Consumer<AppointmentViaRegionViewmodel>(builder: (_, data, __) => getTitle(data)), isDismissible: false,
child: Consumer<AppointmentViaRegionViewmodel>(builder: (_, data, __) {
return getRegionalSelectionWidget(data);
}), callBackFunc: () {});
}
Widget getRegionalSelectionWidget(AppointmentViaRegionViewmodel data) {
if (data.bottomSheetState == AppointmentViaRegionState.HOSPITAL_SELECTION) {
return HospitalBottomSheetBodyForDoctorFilter();
}
if (data.bottomSheetState == AppointmentViaRegionState.CLINIC_SELECTION) {
} else {
SizedBox.shrink();
}
return SizedBox.shrink();
}
getTitle(AppointmentViaRegionViewmodel data) {
return SizedBox.shrink();
}
void openClinicListBottomSheet(BuildContext context) {
showCommonBottomSheetWithoutHeight(context, title: "", titleWidget: Consumer<AppointmentViaRegionViewmodel>(builder: (_, data, __) => getTitle(data)), isDismissible: false,
child: Consumer<AppointmentViaRegionViewmodel>(builder: (_, data, __) {
return ClinicBottomSheet();
}), callBackFunc: () {});
}
}

@ -0,0 +1,65 @@
import 'package:easy_localization/easy_localization.dart' show tr, StringTranslateExtension;
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart'
show BookAppointmentsViewModel;
import 'package:hmg_patient_app_new/features/doctor_filter/doctor_filter_view_model.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:provider/provider.dart';
class FacilityChip extends StatelessWidget {
const FacilityChip({super.key});
@override
Widget build(BuildContext context) {
return Selector<DoctorFilterViewModel, List<String>>(
selector: (_, model) => model.facilityList,
builder: (__, data, ___) =>
Selector<DoctorFilterViewModel, List<String>?>(
selector: (_, model) => model.selectedFacilityForFilters,
builder: (context, selectRegion, ___) => Row(
children: [
Expanded(
child: ListView.separated(
scrollDirection: Axis.horizontal,
itemCount: data.length,
separatorBuilder: (_, __)=>SizedBox(width: 8.h,),
itemBuilder: (_, index) => AppCustomChipWidget(
icon: data[index].contains("hmg")?AppAssets.hmg: AppAssets.hmc,
iconHasColor: false,
iconSize: 18,
labelText: data[index].tr(),
textColor: selectRegion?.any((selectedRegion)=>data[index] == selectedRegion) == true
? AppColors.primaryRedColor
: AppColors.textColor,
backgroundColor:
data[index] == selectRegion
? AppColors.primaryRedColor
.withOpacity(0.1)
: AppColors.whiteColor,
shape: RoundedRectangleBorder(
side: BorderSide(
color: selectRegion?.any((selectedRegion)=>data[index] == selectedRegion) == true
? AppColors
.primaryRedBorderColor
: AppColors
.chipBorderColorOpacity20,
width: 1,
),
borderRadius:
BorderRadius.circular(10)))
.onPress(() {
context
.read<DoctorFilterViewModel>()
.setSelectedFacilityForFilter(data[index]);
})))
],
),
));
}
}

@ -53,7 +53,7 @@ class DoctorProfilePage extends StatelessWidget {
bookAppointmentsViewModel.doctorsProfileResponseModel.doctorImageURL!,
width: 63.h,
height: 63.h,
fit: BoxFit.fill,
fit: BoxFit.cover,
).circle(100),
SizedBox(width: 8.h),
Column(
@ -73,7 +73,7 @@ class DoctorProfilePage extends StatelessWidget {
bookAppointmentsViewModel.doctorsProfileResponseModel.nationalityFlagURL!,
width: 32.h,
height: 32.h,
fit: BoxFit.fill,
fit: BoxFit.cover,
),
],
),

@ -0,0 +1,304 @@
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/immediate_livecare_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/livecare/immediate_livecare_payment_page.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/livecare/widgets/select_livecare_call_type.dart';
import 'package:hmg_patient_app_new/presentation/insurance/insurance_home_page.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:smooth_corner/smooth_corner.dart';
class ImmediateLiveCarePaymentDetails extends StatelessWidget {
ImmediateLiveCarePaymentDetails({super.key});
late ImmediateLiveCareViewModel immediateLiveCareViewModel;
late AppState appState;
@override
Widget build(BuildContext context) {
immediateLiveCareViewModel = Provider.of<ImmediateLiveCareViewModel>(context, listen: false);
appState = getIt.get<AppState>();
return Scaffold(
backgroundColor: AppColors.scaffoldBgColor,
body: Column(
children: [
Expanded(
child: CollapsingListView(
title: "Review LiveCare Request".needTranslation,
child: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 24.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 24.h),
LocaleKeys.patientInfo.tr(context: context).toText16(isBold: true),
SizedBox(height: 16.h),
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.h,
hasShadow: false,
),
child: Padding(
padding: EdgeInsets.all(16.h),
child: Row(
children: [
Image.asset(
appState.getAuthenticatedUser()?.gender == 1 ? AppAssets.male_img : AppAssets.femaleImg,
width: 52.h,
height: 52.h,
),
SizedBox(width: 8.h),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}".toText16(isBold: true),
SizedBox(height: 8.h),
AppCustomChipWidget(labelText: "${appState.getAuthenticatedUser()!.age} Years Old"),
],
),
],
),
),
),
SizedBox(height: 24.h),
"Clinic Information".needTranslation.toText16(isBold: true),
SizedBox(height: 16.h),
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.h,
hasShadow: false,
),
child: Padding(
padding: EdgeInsets.all(16.h),
child: Row(
children: [
Utils.buildSvgWithAssets(icon: AppAssets.generic_clinic_icon, width: 32.h, height: 32.h, fit: BoxFit.contain),
SizedBox(width: 8.h),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
(appState.isArabic()
? immediateLiveCareViewModel.immediateLiveCareSelectedClinic.serviceNameN
: immediateLiveCareViewModel.immediateLiveCareSelectedClinic.serviceName)!
.toText16(isBold: true),
// SizedBox(height: 8.h),
// AppCustomChipWidget(labelText: "${appState.getAuthenticatedUser()!.age} Years Old"),
],
),
],
),
),
),
SizedBox(height: 24.h),
"Selected LiveCare Type".needTranslation.toText16(isBold: true),
SizedBox(height: 16.h),
Consumer<BookAppointmentsViewModel>(builder: (context, bookAppointmentsVM, child) {
return Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.h,
hasShadow: false,
),
child: Padding(
padding: EdgeInsets.all(16.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Utils.buildSvgWithAssets(icon: AppAssets.livecare_clinic_icon, width: 32.h, height: 32.h, fit: BoxFit.contain),
SizedBox(width: 8.h),
getLiveCareType(immediateLiveCareViewModel.liveCareSelectedCallType).toText16(isBold: true),
],
),
Utils.buildSvgWithAssets(icon: AppAssets.edit_icon, width: 24.h, height: 24.h, fit: BoxFit.contain),
],
),
),
).onPress(() {
showCommonBottomSheetWithoutHeight(context, child: SelectLiveCareCallType(immediateLiveCareViewModel: immediateLiveCareViewModel), callBackFunc: () async {
debugPrint("Selected Call Type: ${immediateLiveCareViewModel.liveCareSelectedCallType}");
}, title: "Select LiveCare call type".needTranslation, isCloseButtonVisible: true, isFullScreen: false);
});
}),
SizedBox(height: 24.h)
],
),
),
),
),
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.h,
hasShadow: false,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
(immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.isCash ?? true)
? Container(
height: 50.h,
decoration: ShapeDecoration(
color: AppColors.secondaryLightRedBorderColor,
shape: SmoothRectangleBorder(
borderRadius: BorderRadius.only(topLeft: Radius.circular(24), topRight: Radius.circular(24)),
smoothness: 1,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Insurance expired or inactive".needTranslation.toText14(color: AppColors.primaryRedColor, weight: FontWeight.w500).paddingSymmetrical(24.h, 0.h),
CustomButton(
text: LocaleKeys.updateInsurance.tr(context: context),
onPressed: () {
Navigator.of(context).push(
CustomPageRoute(
page: InsuranceHomePage(),
),
);
},
backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.secondaryLightRedBorderColor,
textColor: AppColors.whiteColor,
fontSize: 10,
fontWeight: FontWeight.w500,
borderRadius: 8,
padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
height: 30.h,
).paddingSymmetrical(24.h, 0.h),
],
),
)
: const SizedBox(),
SizedBox(height: 24.h),
"Total amount to pay".needTranslation.toText18(isBold: true).paddingSymmetrical(24.h, 0.h),
SizedBox(height: 17.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Amount before tax".needTranslation.toText14(isBold: true),
Utils.getPaymentAmountWithSymbol(immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.amount!.toText16(isBold: true), AppColors.blackColor, 13,
isSaudiCurrency: immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "sar"),
],
).paddingSymmetrical(24.h, 0.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"VAT 15%".needTranslation.toText14(isBold: true, color: AppColors.greyTextColor),
Utils.getPaymentAmountWithSymbol(
immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.tax!.toText14(isBold: true, color: AppColors.greyTextColor), AppColors.greyTextColor, 13,
isSaudiCurrency: immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "sar"),
],
).paddingSymmetrical(24.h, 0.h),
SizedBox(height: 17.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(width: 150.h, child: Utils.getPaymentMethods()),
Utils.getPaymentAmountWithSymbol(immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.total!.toText24(isBold: true), AppColors.blackColor, 17,
isSaudiCurrency: immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "sar"),
],
).paddingSymmetrical(24.h, 0.h),
CustomButton(
text: LocaleKeys.payNow.tr(context: context),
onPressed: () async {
await askVideoCallPermission().then((val) {
if (val) {
Navigator.of(context).push(
CustomPageRoute(
page: ImmediateLiveCarePaymentPage(),
),
);
} else {
showCommonBottomSheetWithoutHeight(
title: LocaleKeys.notice.tr(context: context),
context,
child: Utils.getWarningWidget(
loadingText:
"LiveCare requires Camera, Microphone & Location permissions to enable virtual consultation between patient & doctor, Please allow these to proceed.".needTranslation,
isShowActionButtons: true,
onCancelTap: () {
Navigator.pop(context);
},
onConfirmTap: () async {
openAppSettings();
}),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
}
});
},
backgroundColor: AppColors.infoColor,
borderColor: AppColors.infoColor,
textColor: AppColors.whiteColor,
fontSize: 16,
fontWeight: FontWeight.w500,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 50.h,
icon: AppAssets.appointment_pay_icon,
iconColor: AppColors.whiteColor,
iconSize: 18.h,
).paddingSymmetrical(24.h, 24.h),
],
),
),
],
),
);
}
Future<bool> askVideoCallPermission() async {
Map<Permission, PermissionStatus> statuses = await [
Permission.camera,
Permission.microphone,
].request();
if (statuses[Permission.camera] == PermissionStatus.granted && statuses[Permission.microphone] == PermissionStatus.granted) {
// Camera permission granted
return true;
} else {
return false;
}
// if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted)) {
// return false;
// }
}
String getLiveCareType(int callType) {
switch (callType) {
case 1:
return "Video Call".needTranslation;
case 2:
return "Audio Call".needTranslation;
case 3:
return "Phone Call".needTranslation;
default:
return "Video Call".needTranslation;
}
}
}

@ -0,0 +1,580 @@
import 'dart:async';
import 'dart:developer';
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/api_consts.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/cache_consts.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/enums.dart';
import 'package:hmg_patient_app_new/core/utils/date_util.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/immediate_livecare_view_model.dart';
import 'package:hmg_patient_app_new/features/payfort/models/apple_pay_request_insert_model.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/payfort/payfort_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/appointments/my_appointments_page.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/livecare/immediate_livecare_pending_request_page.dart';
import 'package:hmg_patient_app_new/presentation/home/navigation_screen.dart';
import 'package:hmg_patient_app_new/presentation/insurance/insurance_home_page.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/services/cache_service.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/in_app_browser/InAppBrowser.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:smooth_corner/smooth_corner.dart';
class ImmediateLiveCarePaymentPage extends StatefulWidget {
ImmediateLiveCarePaymentPage({super.key});
@override
State<ImmediateLiveCarePaymentPage> createState() => _ImmediateLiveCarePaymentPageState();
}
class _ImmediateLiveCarePaymentPageState extends State<ImmediateLiveCarePaymentPage> {
late PayfortViewModel payfortViewModel;
late ImmediateLiveCareViewModel immediateLiveCareViewModel;
late MyAppointmentsViewModel myAppointmentsViewModel;
late AppState appState;
MyInAppBrowser? browser;
String selectedPaymentMethod = "";
String transID = "";
bool isShowTamara = false;
String tamaraPaymentStatus = "";
String tamaraOrderID = "";
@override
void initState() {
scheduleMicrotask(() {
payfortViewModel.initPayfortViewModel();
myAppointmentsViewModel.getTamaraInstallmentsDetails().then((val) {
if (num.parse(immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.total!) >= myAppointmentsViewModel.getTamaraInstallmentsDetailsResponseModel!.minLimit!.amount! &&
num.parse(immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.total!) <= myAppointmentsViewModel.getTamaraInstallmentsDetailsResponseModel!.maxLimit!.amount!) {
setState(() {
isShowTamara = true;
});
}
});
});
super.initState();
}
@override
Widget build(BuildContext context) {
appState = getIt.get<AppState>();
myAppointmentsViewModel = Provider.of<MyAppointmentsViewModel>(context, listen: false);
immediateLiveCareViewModel = Provider.of<ImmediateLiveCareViewModel>(context, listen: false);
payfortViewModel = Provider.of<PayfortViewModel>(context, listen: false);
return Scaffold(
backgroundColor: AppColors.bgScaffoldColor,
body: Consumer<MyAppointmentsViewModel>(builder: (context, myAppointmentsVM, child) {
return Column(
children: [
Expanded(
child: CollapsingListView(
title: "LiveCare Payment".needTranslation,
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 24.h),
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 20.h,
hasShadow: false,
),
child: Row(
mainAxisSize: MainAxisSize.max,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(AppAssets.mada, width: 72.h, height: 25.h),
SizedBox(height: 16.h),
"Mada".needTranslation.toText16(isBold: true),
],
),
SizedBox(width: 8.h),
const Spacer(),
Transform.flip(
flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon,
iconColor: AppColors.blackColor,
width: 40.h,
height: 40.h,
fit: BoxFit.contain,
),
),
],
).paddingSymmetrical(16.h, 16.h),
).paddingSymmetrical(24.h, 0.h).onPress(() {
selectedPaymentMethod = "MADA";
openPaymentURL("mada");
}),
SizedBox(height: 16.h),
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 20.h,
hasShadow: false,
),
child: Row(
mainAxisSize: MainAxisSize.max,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Image.asset(AppAssets.visa, width: 50.h, height: 50.h),
SizedBox(width: 8.h),
Image.asset(AppAssets.Mastercard, width: 40.h, height: 40.h),
],
),
SizedBox(height: 16.h),
"Visa or Mastercard".needTranslation.toText16(isBold: true),
],
),
SizedBox(width: 8.h),
const Spacer(),
Transform.flip(
flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon,
iconColor: AppColors.blackColor,
width: 40.h,
height: 40.h,
fit: BoxFit.contain,
),
),
],
).paddingSymmetrical(16.h, 16.h),
).paddingSymmetrical(24.h, 0.h).onPress(() {
selectedPaymentMethod = "VISA";
openPaymentURL("visa");
}),
SizedBox(height: 16.h),
isShowTamara
? Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 20.h,
hasShadow: false,
),
child: Row(
mainAxisSize: MainAxisSize.max,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(AppAssets.tamara_en, width: 72.h, height: 25.h),
SizedBox(height: 16.h),
"Tamara".needTranslation.toText16(isBold: true),
],
),
SizedBox(width: 8.h),
const Spacer(),
Transform.flip(
flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon,
iconColor: AppColors.blackColor,
width: 40.h,
height: 40.h,
fit: BoxFit.contain,
),
),
],
).paddingSymmetrical(16.h, 16.h),
).paddingSymmetrical(24.h, 0.h).onPress(() {
selectedPaymentMethod = "TAMARA";
openPaymentURL("tamara");
})
: SizedBox.shrink(),
],
),
),
),
),
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.h,
hasShadow: false,
),
child: Consumer<PayfortViewModel>(builder: (context, payfortVM, child) {
//TODO: Need to add loading state & animation for Apple Pay Configuration
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
(immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.isCash ?? true)
? Container(
height: 50.h,
decoration: ShapeDecoration(
color: AppColors.secondaryLightRedBorderColor,
shape: SmoothRectangleBorder(
borderRadius: BorderRadius.only(topLeft: Radius.circular(24), topRight: Radius.circular(24)),
smoothness: 1,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Insurance expired or inactive".needTranslation.toText14(color: AppColors.primaryRedColor, weight: FontWeight.w500).paddingSymmetrical(24.h, 0.h),
CustomButton(
text: LocaleKeys.updateInsurance.tr(context: context),
onPressed: () {
Navigator.of(context).push(
CustomPageRoute(
page: InsuranceHomePage(),
),
);
},
backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.secondaryLightRedBorderColor,
textColor: AppColors.whiteColor,
fontSize: 10,
fontWeight: FontWeight.w500,
borderRadius: 8,
padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
height: 30.h,
).paddingSymmetrical(24.h, 0.h),
],
),
)
: const SizedBox(),
SizedBox(height: 24.h),
"Total amount to pay".needTranslation.toText18(isBold: true).paddingSymmetrical(24.h, 0.h),
SizedBox(height: 17.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Amount before tax".needTranslation.toText14(isBold: true),
Utils.getPaymentAmountWithSymbol(immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.amount!.toString().toText16(isBold: true), AppColors.blackColor, 13,
isSaudiCurrency: true),
],
).paddingSymmetrical(24.h, 0.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"VAT 15%".needTranslation.toText14(isBold: true, color: AppColors.greyTextColor),
Utils.getPaymentAmountWithSymbol(
immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.tax!.toString().toText14(isBold: true, color: AppColors.greyTextColor), AppColors.greyTextColor, 13,
isSaudiCurrency: true),
],
).paddingSymmetrical(24.h, 0.h),
SizedBox(height: 17.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"".needTranslation.toText14(isBold: true),
Utils.getPaymentAmountWithSymbol(immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.total!.toString().toText24(isBold: true), AppColors.blackColor, 17,
isSaudiCurrency: true),
],
).paddingSymmetrical(24.h, 0.h),
Platform.isIOS
? Utils.buildSvgWithAssets(
icon: AppAssets.apple_pay_button,
width: 200.h,
height: 80.h,
fit: BoxFit.contain,
).paddingSymmetrical(24.h, 0.h).onPress(() {
// payfortVM.setIsApplePayConfigurationLoading(true);
if (Utils.havePrivilege(103)) {
startApplePay();
} else {
openPaymentURL("ApplePay");
}
})
: SizedBox(height: 12.h),
SizedBox(height: 12.h),
],
);
}),
),
],
);
}),
);
}
onBrowserLoadStart(String url) {
print("onBrowserLoadStart");
print(url);
if (selectedPaymentMethod == "TAMARA") {
if (Platform.isAndroid) {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['status']!;
tamaraOrderID = uri.queryParameters['AuthorizePaymentId']!;
} else {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus']!;
tamaraOrderID = uri.queryParameters['orderId']!;
}
}
// if(selectedPaymentMethod != "TAMARA") {
MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) {
browser?.close();
MyInAppBrowser.isPaymentDone = true;
return;
}
});
// }
// if(selectedPaymentMethod != "TAMARA") {
MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) {
browser?.close();
MyInAppBrowser.isPaymentDone = false;
return;
}
});
// }
}
onBrowserExit(bool isPaymentMade) async {
debugPrint("onBrowserExit Called!!!!");
checkPaymentStatus();
}
void checkPaymentStatus() async {
LoaderBottomSheet.showLoader(loadingText: "Checking payment status, Please wait...".needTranslation);
if (selectedPaymentMethod == "TAMARA") {
await payfortViewModel.checkTamaraPaymentStatus(
transactionID: transID,
onSuccess: (apiResponse) async {
if (apiResponse.data["status"].toString().toLowerCase() == "success") {
tamaraOrderID = apiResponse.data["tamara_order_id"].toString();
await payfortViewModel.updateTamaraRequestStatus(responseMessage: "success", status: "14", clientRequestID: transID, tamaraOrderID: tamaraOrderID);
await immediateLiveCareViewModel.addNewCallRequestForImmediateLiveCare(transID);
await immediateLiveCareViewModel.getPatientLiveCareHistory();
LoaderBottomSheet.hideLoader();
if (immediateLiveCareViewModel.patientHasPendingLiveCareRequest) {
Navigator.pushAndRemoveUntil(
context,
CustomPageRoute(
page: LandingNavigation(),
),
(r) => false);
Navigator.of(context).push(
CustomPageRoute(
page: ImmediateLiveCarePendingRequestPage(),
),
);
} else {
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: "Unknown error occurred...".needTranslation),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
}
} else {
await payfortViewModel.updateTamaraRequestStatus(responseMessage: "Failed", status: "00", clientRequestID: transID, tamaraOrderID: tamaraOrderID);
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: "Payment Failed! Please try again.".needTranslation),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
}
},
onError: (err) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: err),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
});
} else {
await payfortViewModel.checkPaymentStatus(
transactionID: transID,
onSuccess: (apiResponse) async {
debugPrint(apiResponse.data.toString());
if (payfortViewModel.payfortCheckPaymentStatusResponseModel!.responseMessage!.toLowerCase() == "success") {
await immediateLiveCareViewModel.addNewCallRequestForImmediateLiveCare(transID);
await immediateLiveCareViewModel.getPatientLiveCareHistory();
LoaderBottomSheet.hideLoader();
if (immediateLiveCareViewModel.patientHasPendingLiveCareRequest) {
Navigator.pushAndRemoveUntil(
context,
CustomPageRoute(
page: LandingNavigation(),
),
(r) => false);
Navigator.of(context).push(
CustomPageRoute(
page: ImmediateLiveCarePendingRequestPage(),
),
);
} else {
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: "Unknown error occurred...".needTranslation),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
}
} else {
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: "Payment Failed! Please try again.".needTranslation),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
}
});
}
}
openPaymentURL(String paymentMethod) {
browser = MyInAppBrowser(onExitCallback: onBrowserExit, onLoadStartCallback: onBrowserLoadStart, context: context);
transID = Utils.getAppointmentTransID(
immediateLiveCareViewModel.immediateLiveCareSelectedClinic.serviceID!,
ApiConsts.appEnvironmentType == AppEnvironmentTypeEnum.uat ? 15 : 12,
DateTime.now().millisecondsSinceEpoch,
);
//TODO: Need to pass dynamic params to the payment request instead of static values
browser?.openPaymentBrowser(
num.parse(immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.total!),
"LiveCare Payment",
transID,
"12",
"CustID_${appState.getAuthenticatedUser()!.patientId.toString()}@HMG.com",
selectedPaymentMethod,
appState.getAuthenticatedUser()!.patientType.toString(),
"${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}",
appState.getAuthenticatedUser()!.patientId.toString(),
appState.getAuthenticatedUser()!,
browser!,
false,
"4",
immediateLiveCareViewModel.immediateLiveCareSelectedClinic.serviceID.toString(),
context,
"3");
}
startApplePay() async {
LoaderBottomSheet.showLoader(loadingText: "Fetching Apple Pay details, Please wait...".needTranslation);
transID = Utils.getAppointmentTransID(
immediateLiveCareViewModel.immediateLiveCareSelectedClinic.serviceID!,
ApiConsts.appEnvironmentType == AppEnvironmentTypeEnum.uat ? 15 : 12,
DateTime.now().millisecondsSinceEpoch,
);
ApplePayInsertRequest applePayInsertRequest = ApplePayInsertRequest();
await payfortViewModel.getPayfortConfigurations(
serviceId: ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum(), projectId: ApiConsts.appEnvironmentType == AppEnvironmentTypeEnum.uat ? 15 : 12, integrationId: 2);
applePayInsertRequest.clientRequestID = transID;
applePayInsertRequest.clinicID = immediateLiveCareViewModel.immediateLiveCareSelectedClinic.serviceID!;
// TODO: Need to pass dynamic currency coming from the API
applePayInsertRequest.currency = appState.getAuthenticatedUser()!.outSa! == 0 ? "SAR" : "AED";
applePayInsertRequest.customerEmail = "CustID_${appState.getAuthenticatedUser()!.patientId.toString()}@HMG.com";
applePayInsertRequest.customerID = appState.getAuthenticatedUser()!.patientId.toString();
applePayInsertRequest.customerName = "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}";
applePayInsertRequest.deviceToken = await Utils.getStringFromPrefs(CacheConst.pushToken);
applePayInsertRequest.voipToken = await Utils.getStringFromPrefs(CacheConst.voipToken);
applePayInsertRequest.doctorID = 0;
applePayInsertRequest.projectID = "12";
applePayInsertRequest.serviceID = ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum().toString();
applePayInsertRequest.channelID = 3;
applePayInsertRequest.patientID = appState.getAuthenticatedUser()!.patientId.toString();
applePayInsertRequest.patientTypeID = appState.getAuthenticatedUser()!.patientType;
applePayInsertRequest.patientOutSA = appState.getAuthenticatedUser()!.outSa;
applePayInsertRequest.appointmentDate = DateUtil.convertDateToString(DateTime.now());
applePayInsertRequest.appointmentNo = 0;
applePayInsertRequest.orderDescription = "LiveCare Payment";
applePayInsertRequest.liveServiceID = immediateLiveCareViewModel.immediateLiveCareSelectedClinic.serviceID!.toString();
applePayInsertRequest.latitude = "0.0";
applePayInsertRequest.longitude = "0.0";
applePayInsertRequest.amount = immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.total.toString();
applePayInsertRequest.isSchedule = "0";
applePayInsertRequest.language = appState.isArabic() ? 'ar' : 'en';
applePayInsertRequest.languageID = appState.isArabic() ? 1 : 2;
applePayInsertRequest.userName = appState.getAuthenticatedUser()!.patientId;
applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html";
applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html";
applePayInsertRequest.paymentOption = "ApplePay";
applePayInsertRequest.isMobSDK = true;
applePayInsertRequest.merchantReference = transID;
applePayInsertRequest.merchantIdentifier = payfortViewModel.payfortProjectDetailsRespModel!.merchantIdentifier;
applePayInsertRequest.commandType = "PURCHASE";
applePayInsertRequest.signature = payfortViewModel.payfortProjectDetailsRespModel!.signature;
applePayInsertRequest.accessCode = payfortViewModel.payfortProjectDetailsRespModel!.accessCode;
applePayInsertRequest.shaRequestPhrase = payfortViewModel.payfortProjectDetailsRespModel!.shaRequest;
applePayInsertRequest.shaResponsePhrase = payfortViewModel.payfortProjectDetailsRespModel!.shaResponse;
applePayInsertRequest.returnURL = "";
//TODO: Need to pass dynamic params to the Apple Pay instead of static values
await payfortViewModel.applePayRequestInsert(applePayInsertRequest: applePayInsertRequest).then((value) {
payfortViewModel.paymentWithApplePay(
customerName: "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}",
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${appState.getAuthenticatedUser()!.patientId.toString()}@HMG.com",
orderDescription: "LiveCare Payment",
orderAmount: double.parse(immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.total!),
merchantReference: transID,
merchantIdentifier: payfortViewModel.payfortProjectDetailsRespModel!.merchantIdentifier,
applePayAccessCode: payfortViewModel.payfortProjectDetailsRespModel!.accessCode,
applePayShaRequestPhrase: payfortViewModel.payfortProjectDetailsRespModel!.shaRequest,
currency: appState.getAuthenticatedUser()!.outSa! == 0 ? "SAR" : "AED",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.message.toString()}");
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: failureResult.message.toString()),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
},
onSucceeded: (successResult) async {
LoaderBottomSheet.hideLoader();
log("successResult: ${successResult.responseMessage.toString()}");
selectedPaymentMethod = successResult.paymentOption ?? "VISA";
checkPaymentStatus();
},
// projectId: appo.projectID,
// serviceTypeEnum: ServiceTypeEnum.appointmentPayment,
);
});
}
}

@ -0,0 +1,305 @@
import 'dart:async';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/date_util.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/immediate_livecare_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:lottie/lottie.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
class ImmediateLiveCarePendingRequestPage extends StatefulWidget {
ImmediateLiveCarePendingRequestPage({super.key});
@override
State<ImmediateLiveCarePendingRequestPage> createState() => _ImmediateLiveCarePendingRequestPageState();
}
class _ImmediateLiveCarePendingRequestPageState extends State<ImmediateLiveCarePendingRequestPage> {
late ImmediateLiveCareViewModel immediateLiveCareViewModel;
late AppState appState;
static Duration countdownDuration = Duration(minutes: 1, seconds: 0);
ValueNotifier<Duration> durationNotifier = ValueNotifier<Duration>(countdownDuration);
Timer? timer;
@override
void initState() {
super.initState();
scheduleMicrotask(() {
countdownDuration = Duration(minutes: immediateLiveCareViewModel.patientLiveCareHistoryList[0].watingtimeInteger!, seconds: 0);
durationNotifier = ValueNotifier<Duration>(countdownDuration);
startTimer();
});
}
@override
void dispose() {
timer?.cancel();
durationNotifier.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
immediateLiveCareViewModel = Provider.of<ImmediateLiveCareViewModel>(context, listen: false);
appState = getIt.get<AppState>();
return Scaffold(
backgroundColor: AppColors.bgScaffoldColor,
body: Consumer<ImmediateLiveCareViewModel>(builder: (context, immediateLiveCareVM, child) {
return Column(
children: [
Expanded(
child: CollapsingListView(
title: "LiveCare Pending Request".needTranslation,
child: Padding(
padding: EdgeInsets.all(24.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 20.h,
hasShadow: false,
side: BorderSide(color: AppColors.ratingColorYellow, width: 3.h),
),
child: Padding(
padding: EdgeInsets.all(16.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Expected waiting time: ".toText16(isBold: true),
SizedBox(height: 8.h),
ValueListenableBuilder<Duration>(
valueListenable: durationNotifier,
builder: (context, duration, child) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
buildTime(duration),
],
);
},
),
SizedBox(height: 8.h),
],
),
),
),
SizedBox(height: 16.h),
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 20.h,
hasShadow: false,
side: BorderSide(color: AppColors.ratingColorYellow, width: 3.h),
),
child: Padding(
padding: EdgeInsets.all(16.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppCustomChipWidget(
labelText: immediateLiveCareViewModel.patientLiveCareHistoryList[0].stringCallStatus,
backgroundColor: AppColors.warningColorYellow.withValues(alpha: 0.20),
textColor: AppColors.alertColor,
),
Utils.buildSvgWithAssets(icon: AppAssets.waiting_icon, width: 24.h, height: 24.h),
// Lottie.asset(AppAnimations.pending_loading_animation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 80.h, height: 80.h, fit: BoxFit.cover),
],
),
SizedBox(height: 8.h),
"Hala ${appState.getAuthenticatedUser()!.firstName}!!!".needTranslation.toText16(isBold: true),
SizedBox(height: 8.h),
AppCustomChipWidget(
icon: AppAssets.appointment_calendar_icon,
labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(immediateLiveCareViewModel.patientLiveCareHistoryList[0].arrivalTime), false)),
SizedBox(height: 8.h),
"Your turn is after ${immediateLiveCareViewModel.patientLiveCareHistoryList[0].patCount} patients.".toText16(isBold: true),
SizedBox(height: 8.h),
],
),
),
)
],
),
),
),
),
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.h,
hasShadow: true,
),
child: CustomButton(
text: "Call LiveCare Support".needTranslation,
onPressed: () async {
launchUrl(Uri.parse("tel://" + "011 525 9553"));
},
backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedColor,
textColor: AppColors.whiteColor,
fontSize: 16,
fontWeight: FontWeight.w500,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 50.h,
icon: AppAssets.call_fill,
iconColor: AppColors.whiteColor,
iconSize: 21.h,
).paddingSymmetrical(24.h, 24.h),
),
],
);
}),
);
}
void startTimer() {
timer = Timer.periodic(const Duration(seconds: 1), (_) => addTime());
setState(() {});
}
void addTime() {
final seconds = durationNotifier.value.inSeconds - 1;
if (seconds < 0) {
timer?.cancel();
// Handle end of timer here
// showEndMessage();
} else {
durationNotifier.value = Duration(seconds: seconds);
}
}
Future<bool> _onWillPop() async {
timer?.cancel();
Navigator.of(context).pop();
return true;
}
Widget buildTime(Duration duration) {
String twoDigits(int n) => n.toString().padLeft(2, '0');
final hours = twoDigits(duration.inHours);
final minutes = twoDigits(duration.inMinutes.remainder(60));
final seconds = twoDigits(duration.inSeconds.remainder(60));
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
buildTimeColumn(hours, "Hours".needTranslation),
buildTimeColumn(minutes, "Mins".needTranslation),
buildTimeColumn(seconds, "Secs".needTranslation, isLast: true),
],
);
}
Widget buildTimeColumn(String time, String label, {bool isLast = false}) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
buildDigit(time[0]),
buildDigit(time[1]),
if (!isLast) buildTimeSeparator(),
],
),
buildLabel(label),
],
);
}
Widget buildDigit(String digit) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
// margin: const EdgeInsets.symmetric(horizontal: 2),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: ClipRect(
child: AnimatedSwitcher(
duration: const Duration(milliseconds: 600),
switchInCurve: Curves.easeOutExpo,
switchOutCurve: Curves.easeInExpo,
transitionBuilder: (Widget child, Animation<double> animation) {
return Stack(
children: <Widget>[
SlideTransition(
position: Tween<Offset>(
begin: const Offset(0, -1),
end: const Offset(0, 1),
).animate(CurvedAnimation(
parent: animation,
curve: Curves.easeOutCubic,
)),
child: FadeTransition(
opacity: animation,
child: child,
),
),
SlideTransition(
position: Tween<Offset>(
begin: const Offset(0, -1),
end: const Offset(0, 0),
).animate(CurvedAnimation(
parent: animation,
curve: Curves.bounceIn,
)),
child: FadeTransition(
opacity: animation,
child: child,
),
),
],
);
},
child: Text(
digit,
key: ValueKey<String>(digit),
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 20.fSize,
),
),
),
),
);
}
Widget buildLabel(String label) {
return label.toText14(isBold: true);
}
Widget buildTimeSeparator() {
return const Padding(
padding: EdgeInsets.symmetric(horizontal: 2.0),
child: Text(
":",
style: TextStyle(
color: Colors.black,
fontSize: 20,
),
),
);
}
}

@ -0,0 +1,173 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/get_clinic_list_response_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/get_livecare_clinics_response_model.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/models/resp_models/get_livecare_immediate_clinics_response_model.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/immediate_livecare_view_model.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/livecare/immediate_livecare_payment_details.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/livecare/widgets/select_livecare_call_type.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/clinic_card.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/livecare/widgets/livecare_clinic_card.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:provider/provider.dart';
class SelectImmediateLiveCareClinicPage extends StatefulWidget {
const SelectImmediateLiveCareClinicPage({super.key});
@override
State<SelectImmediateLiveCareClinicPage> createState() => _SelectImmediateLiveCareClinicPageState();
}
class _SelectImmediateLiveCareClinicPageState extends State<SelectImmediateLiveCareClinicPage> {
TextEditingController searchEditingController = TextEditingController();
FocusNode textFocusNode = FocusNode();
late AppState appState;
late ImmediateLiveCareViewModel immediateLiveCareViewModel;
@override
void initState() {
scheduleMicrotask(() {
immediateLiveCareViewModel.getLiveCareImmediateClinicsList();
immediateLiveCareViewModel.setLiveCareSelectedCallType(0);
});
super.initState();
}
@override
void dispose() {
textFocusNode.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
immediateLiveCareViewModel = Provider.of<ImmediateLiveCareViewModel>(context, listen: false);
appState = getIt.get<AppState>();
return Scaffold(
backgroundColor: AppColors.bgScaffoldColor,
body: CollapsingListView(
title: "Select LiveCare Clinic".needTranslation,
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.all(24.h),
child: Consumer<ImmediateLiveCareViewModel>(builder: (context, immediateLiveCareVM, child) {
return Column(
children: [
// SizedBox(height: 16.h),
// TextInputWidget(
// labelText: LocaleKeys.search.tr(context: context),
// hintText: LocaleKeys.clinicName.tr(context: context),
// controller: searchEditingController,
// isEnable: true,
// prefix: null,
// autoFocus: false,
// isBorderAllowed: false,
// keyboardType: TextInputType.text,
// focusNode: textFocusNode,
// suffix: searchEditingController.text.isNotEmpty
// ? GestureDetector(
// onTap: () {
// searchEditingController.clear();
// bookAppointmentsViewModel.filterClinics("");
// textFocusNode.unfocus();
// },
// child: Utils.buildSvgWithAssets(icon: AppAssets.close_bottom_sheet_icon, width: 20.h, height: 20.h, fit: BoxFit.scaleDown),
// )
// : null,
// onChange: (value) {
// bookAppointmentsViewModel.filterClinics(value!);
// },
// padding: EdgeInsets.symmetric(
// vertical: ResponsiveExtension(10).h,
// horizontal: ResponsiveExtension(15).h,
// ),
// ),
ListView.separated(
padding: EdgeInsets.only(top: 16.h),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: immediateLiveCareVM.isImmediateLiveCareClinicsLoading ? 5 : immediateLiveCareVM.immediateLiveCareClinicsList.length,
itemBuilder: (context, index) {
return immediateLiveCareVM.isImmediateLiveCareClinicsLoading
? ClinicCard(
bookAppointmentsVM: getIt.get<BookAppointmentsViewModel>(),
liveCareClinicsResponseModel: GetLiveCareClinicsResponseModel(),
clinicsListResponseModel: GetClinicsListResponseModel(),
isLoading: immediateLiveCareVM.isImmediateLiveCareClinicsLoading,
)
: AnimationConfiguration.staggeredList(
position: index,
duration: const Duration(milliseconds: 500),
child: SlideAnimation(
verticalOffset: 100.0,
child: FadeInAnimation(
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOut,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
child: LiveCareClinicCard(
immediateLiveCareViewModel: immediateLiveCareVM,
liveCareClinicListResponseModel: immediateLiveCareVM.immediateLiveCareClinicsList[index],
isLoading: immediateLiveCareVM.isImmediateLiveCareClinicsLoading,
).onPress(() {
onImmediateLiveCareClinicSelected(immediateLiveCareVM.immediateLiveCareClinicsList[index]);
}),
),
),
),
);
},
separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h),
),
],
);
}),
),
),
),
);
}
onImmediateLiveCareClinicSelected(GetLiveCareClinicListResponseModel liveCareClinic) {
//TODO: add implementation to show clinic schedule
if (liveCareClinic.isOnline == 1) {
showCommonBottomSheetWithoutHeight(context, child: SelectLiveCareCallType(immediateLiveCareViewModel: immediateLiveCareViewModel), callBackFunc: () async {
if (immediateLiveCareViewModel.liveCareSelectedCallType != 0) {
immediateLiveCareViewModel.setImmediateLiveCareSelectedClinic(liveCareClinic);
LoaderBottomSheet.showLoader(loadingText: "Fetching fees, Please wait...".needTranslation);
await immediateLiveCareViewModel.getLiveCareImmediateAppointmentFees(onSuccess: (val) {
LoaderBottomSheet.hideLoader();
Navigator.of(context).push(
CustomPageRoute(
page: ImmediateLiveCarePaymentDetails(),
),
);
}, onError: (err) {
LoaderBottomSheet.hideLoader();
});
}
}, title: "Select LiveCare call type".needTranslation, isCloseButtonVisible: true, isFullScreen: false);
} else {
showCommonBottomSheetWithoutHeight(context,
child: Utils.getErrorWidget(
loadingText: "The selected clinic is only available between ${liveCareClinic.shiftTimings!.first.startTime} & ${liveCareClinic.shiftTimings!.first.endTime} hours.".needTranslation),
callBackFunc: () {},
title: "",
isCloseButtonVisible: true,
isFullScreen: false);
}
}
}

@ -0,0 +1,67 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/models/resp_models/get_livecare_immediate_clinics_response_model.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/immediate_livecare_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
class LiveCareClinicCard extends StatelessWidget {
LiveCareClinicCard({super.key, required this.liveCareClinicListResponseModel, required this.isLoading, required this.immediateLiveCareViewModel});
GetLiveCareClinicListResponseModel liveCareClinicListResponseModel;
bool isLoading;
ImmediateLiveCareViewModel immediateLiveCareViewModel;
@override
Widget build(BuildContext context) {
AppState appState = getIt.get<AppState>();
return Container(
padding: EdgeInsets.all(16.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.h,
hasShadow: false,
),
child: Column(
children: [
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Utils.buildSvgWithAssets(icon: AppAssets.generic_clinic_icon, width: 24.h, height: 24.h, fit: BoxFit.contain).toShimmer2(isShow: isLoading),
Column(
children: [
Utils.buildSvgWithAssets(
icon: AppAssets.livecare_online_icon,
width: 16.h,
height: 16.h,
fit: BoxFit.contain,
iconColor: liveCareClinicListResponseModel.isOnline == 1 ? AppColors.successColor : AppColors.primaryRedColor)
.toShimmer2(isShow: isLoading),
SizedBox(height: 4.h),
liveCareClinicListResponseModel.isOnline == 1
? LocaleKeys.online.tr(context: context).toText10(isBold: true, color: AppColors.successColor).toShimmer2(isShow: isLoading)
: "Offline".toText10(isBold: true, color: AppColors.primaryRedColor).toShimmer2(isShow: isLoading),
],
),
]),
SizedBox(height: 8.h),
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Expanded(
child: (isLoading ? "Cardiology" : (appState.isArabic() ? liveCareClinicListResponseModel.serviceNameN : liveCareClinicListResponseModel.serviceName))!
.toText16(isBold: true)
.toShimmer2(isShow: isLoading)),
Transform.flip(
flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, width: 40.h, height: 40.h, fit: BoxFit.contain, iconColor: AppColors.textColor).toShimmer2(isShow: isLoading)),
]),
],
),
);
}
}

@ -0,0 +1,66 @@
import 'package:flutter/cupertino.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/immediate_livecare_view_model.dart';
import 'package:hmg_patient_app_new/presentation/medical_file/widgets/medical_file_card.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
class SelectLiveCareCallType extends StatelessWidget {
SelectLiveCareCallType({super.key, required this.immediateLiveCareViewModel});
ImmediateLiveCareViewModel immediateLiveCareViewModel;
@override
Widget build(BuildContext context) {
//TODO: Replace with actual icons
return GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
crossAxisSpacing: 16,
mainAxisSpacing: 16,
mainAxisExtent: 130,
),
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.zero,
shrinkWrap: true,
children: [
MedicalFileCard(
label: "Video Call".needTranslation,
textColor: AppColors.blackColor,
backgroundColor: AppColors.whiteColor,
svgIcon: AppAssets.eye_result_icon,
isLargeText: true,
iconSize: 36.h,
).onPress(() {
Navigator.of(context).pop();
immediateLiveCareViewModel.setLiveCareSelectedCallType(1);
}),
MedicalFileCard(
label: "Audio Call".needTranslation,
textColor: AppColors.blackColor,
backgroundColor: AppColors.whiteColor,
svgIcon: AppAssets.allergy_info_icon,
isLargeText: true,
iconSize: 36.h,
).onPress(() {
Navigator.of(context).pop();
immediateLiveCareViewModel.setLiveCareSelectedCallType(2);
}),
MedicalFileCard(
label: "Phone Call".needTranslation,
textColor: AppColors.blackColor,
backgroundColor: AppColors.whiteColor,
svgIcon: AppAssets.vaccine_info_icon,
isLargeText: true,
iconSize: 36.h,
).onPress(() {
Navigator.of(context).pop();
immediateLiveCareViewModel.setLiveCareSelectedCallType(3);
}),
],
);
}
}

@ -71,7 +71,7 @@ class _ReviewAppointmentPageState extends State<ReviewAppointmentPage> {
bookAppointmentsViewModel.selectedDoctor.doctorImageURL!,
width: 50.h,
height: 50.h,
fit: BoxFit.fill,
fit: BoxFit.cover,
).circle(100),
SizedBox(width: 8.h),
Column(
@ -88,7 +88,7 @@ class _ReviewAppointmentPageState extends State<ReviewAppointmentPage> {
bookAppointmentsViewModel.selectedDoctor.nationalityFlagURL!,
width: 20.h,
height: 15.h,
fit: BoxFit.fill,
fit: BoxFit.cover,
),
],
),
@ -144,6 +144,7 @@ class _ReviewAppointmentPageState extends State<ReviewAppointmentPage> {
),
SizedBox(width: 8.h),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}".toText16(isBold: true),
SizedBox(height: 8.h),
@ -228,6 +229,7 @@ class _ReviewAppointmentPageState extends State<ReviewAppointmentPage> {
});
});
} else {
//TODO: Add patient Derma package check API Here
await bookAppointmentsViewModel.insertSpecificAppointment(onError: (err) {
print(err.data["ErrorEndUserMessage"]);
LoadingUtils.hideFullScreenLoader();

@ -9,7 +9,9 @@ import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/doctor_filter/doctor_filter_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/doctor_filter/doctors_filter.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/doctor_profile_page.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/doctor_card.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
@ -33,16 +35,12 @@ class SearchDoctorByName extends StatefulWidget {
class _SearchDoctorByNameState extends State<SearchDoctorByName> {
TextEditingController searchEditingController = TextEditingController();
FocusNode textFocusNode = FocusNode();
late AppState appState;
late BookAppointmentsViewModel bookAppointmentsViewModel;
@override
Widget build(BuildContext context) {
bookAppointmentsViewModel = Provider.of<BookAppointmentsViewModel>(context, listen: false);
appState = getIt.get<AppState>();
return Scaffold(
backgroundColor: AppColors.bgScaffoldColor,
body: Column(
@ -56,33 +54,85 @@ class _SearchDoctorByNameState extends State<SearchDoctorByName> {
child: Column(
children: [
SizedBox(height: 16.h),
TextInputWidget(
labelText: LocaleKeys.search.tr(context: context),
hintText: LocaleKeys.doctorName.tr(context: context),
controller: searchEditingController,
isEnable: true,
prefix: null,
autoFocus: false,
isBorderAllowed: false,
keyboardType: TextInputType.text,
focusNode: textFocusNode,
suffix: searchEditingController.text.isNotEmpty
? GestureDetector(
onTap: () {
searchEditingController.clear();
// bookAppointmentsViewModel.filterClinics("");
textFocusNode.unfocus();
},
child: Utils.buildSvgWithAssets(icon: AppAssets.close_bottom_sheet_icon, width: 20.h, height: 20.h, fit: BoxFit.scaleDown),
)
: null,
onChange: (value) {
// bookAppointmentsViewModel.filterClinics(value!);
},
padding: EdgeInsets.symmetric(
vertical: ResponsiveExtension(10).h,
horizontal: ResponsiveExtension(15).h,
),
Row(
spacing: 8.h,
children: [
Expanded(
child: TextInputWidget(
labelText: LocaleKeys.search.tr(context: context),
hintText: LocaleKeys.doctorName.tr(context: context),
controller: searchEditingController,
isEnable: true,
prefix: null,
autoFocus: false,
isBorderAllowed: false,
keyboardType: TextInputType.text,
focusNode: textFocusNode,
suffix: searchEditingController.text.isNotEmpty
? GestureDetector(
onTap: () {
searchEditingController.clear();
// bookAppointmentsViewModel.filterClinics("");
textFocusNode.unfocus();
},
child: Utils.buildSvgWithAssets(icon: AppAssets.close_bottom_sheet_icon, width: 20.h, height: 20.h, fit: BoxFit.scaleDown),
)
: null,
onChange: (value) {
// bookAppointmentsViewModel.filterClinics(value!);
},
padding: EdgeInsets.symmetric(
vertical: ResponsiveExtension(10).h,
horizontal: ResponsiveExtension(15).h,
),
),
),
Visibility(
visible: context.watch<BookAppointmentsViewModel>().doctorsList.isNotEmpty,
child: SizedBox(
height: 56.h,
width: 56.h,
child: DecoratedBox(decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 10.h,
hasShadow: false,
),
child: Utils.buildSvgWithAssets(icon: AppAssets.ic_filters,
height: 24.h,
width: 24.h, ).paddingAll(16.h).onPress((){
context.read<DoctorFilterViewModel>()
..clearSelection()
..clearSearchFilters()
..getFiltersFromDoctorList(
bookAppointmentsViewModel.doctorsList
)..setSelections(
bookAppointmentsViewModel.selectedFacilityForFilters?.toList(),
bookAppointmentsViewModel.selectedRegionForFilters?.toList(),
bookAppointmentsViewModel.selectedClinicForFilters,
bookAppointmentsViewModel.selectedHospitalForFilters,
bookAppointmentsViewModel.applyFilters) ;
Navigator.of(context).push(
PageRouteBuilder(
pageBuilder: (context, animation, secondaryAnimation) => DoctorsFilters(), // Replace YourNewPage with your actual page widget
transitionsBuilder: (context, animation, secondaryAnimation, child) {
const begin = Offset(0.0, 1.0); // Start from the bottom (y=1.0)
const end = Offset.zero; // End at the original position (y=0.0)
final tween = Tween(begin: begin, end: end);
final offsetAnimation = animation.drive(tween);
return SlideTransition(
position: offsetAnimation,
child: child,
);
},
transitionDuration: Duration(milliseconds: 200), // Adjust duration as needed
),
);
}),
),
),
)
],
),
SizedBox(height: 16.h),
Consumer<BookAppointmentsViewModel>(builder: (context, bookAppointmentsVM, child) {
@ -94,7 +144,7 @@ class _SearchDoctorByNameState extends State<SearchDoctorByName> {
padding: EdgeInsets.only(top: 24.h),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: bookAppointmentsVM.isDoctorsListLoading ? 5 : bookAppointmentsVM.doctorsList.length,
itemCount: bookAppointmentsVM.isDoctorsListLoading ? 5 : bookAppointmentsVM.filteredDoctorList.length,
itemBuilder: (context, index) {
return bookAppointmentsVM.isDoctorsListLoading
? DoctorCard(
@ -113,11 +163,11 @@ class _SearchDoctorByNameState extends State<SearchDoctorByName> {
curve: Curves.easeInOut,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
child: DoctorCard(
doctorsListResponseModel: bookAppointmentsVM.doctorsList[index],
doctorsListResponseModel: bookAppointmentsVM.filteredDoctorList[index],
isLoading: false,
bookAppointmentsViewModel: bookAppointmentsViewModel,
).onPress(() async {
bookAppointmentsVM.setSelectedDoctor(bookAppointmentsVM.doctorsList[index]);
bookAppointmentsVM.setSelectedDoctor(bookAppointmentsVM.filteredDoctorList[index]);
// bookAppointmentsVM.setSelectedDoctor(DoctorsListResponseModel());
LoaderBottomSheet.showLoader();
await bookAppointmentsVM.getDoctorProfile(onSuccess: (dynamic respData) {
@ -166,7 +216,11 @@ class _SearchDoctorByNameState extends State<SearchDoctorByName> {
text: LocaleKeys.search.tr(context: context),
onPressed: () async {
textFocusNode.unfocus();
print("the value is empty ${searchEditingController.text.isNotEmpty}");
if (searchEditingController.text.isNotEmpty) {
bookAppointmentsViewModel.updateApplyFilters(false);
bookAppointmentsViewModel.clearSelection();
bookAppointmentsViewModel.updateList();
bookAppointmentsViewModel.setIsDoctorSearchByNameStarted(true);
bookAppointmentsViewModel.setIsDoctorsListLoading(true);
// LoaderBottomSheet.showLoader();
@ -210,4 +264,9 @@ class _SearchDoctorByNameState extends State<SearchDoctorByName> {
),
);
}
@override
void dispose() {
bookAppointmentsViewModel.doctorsList.clear();
super.dispose();
}
}

@ -18,13 +18,17 @@ import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/appointments/widgets/faculity_selection/facility_type_selection_widget.dart';
import 'package:hmg_patient_app_new/presentation/appointments/widgets/hospital_bottom_sheet/hospital_bottom_sheet_body.dart';
import 'package:hmg_patient_app_new/presentation/appointments/widgets/region_bottomsheet/region_list_widget.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/dental_chief_complaints_page.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/select_doctor_page.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/select_livecare_clinic_page.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/clinic_card.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/input_widget.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
import 'package:provider/provider.dart';
@ -206,24 +210,35 @@ class _SelectClinicPageState extends State<SelectClinicPage> {
Navigator.of(context).push(
CustomPageRoute(
page: SelectLivecareClinicPage(onNegativeClicked: (){
handleDoctorScreen();
handleDoctorScreen(clinic);
},),
),
);
} else {
handleDoctorScreen();
handleDoctorScreen(clinic);
}
}
void handleDoctorScreen() {
//17 and 235
void handleDoctorScreen(GetClinicsListResponseModel clinic) async {
if (widget.isFromRegionFlow) {
Navigator.of(context).push(
CustomPageRoute(
page: SelectDoctorPage(),
),
);
//Dental Clinic Flow
if (clinic.clinicID == 17 && appState.isAuthenticated) {
initDentalAppointmentBookingFlow(int.parse(bookAppointmentsViewModel.currentlySelectedHospitalFromRegionFlow ?? "0"));
} else {
bookAppointmentsViewModel.setIsChiefComplaintsListLoading(true);
Navigator.of(context).push(
CustomPageRoute(
page: DentalChiefComplaintsPage(),
),
);
}
} else {
openRegionListBottomSheet(context, RegionBottomSheetType.FOR_CLINIIC);
var bottomSheetType = RegionBottomSheetType.FOR_CLINIIC;
if (clinic.clinicID == 17 || clinic.clinicID == 235) {
bottomSheetType = RegionBottomSheetType.REGION_FOR_DENTAL_AND_LASER;
}
openRegionListBottomSheet(context, bottomSheetType);
}
}
@ -236,7 +251,18 @@ class _SelectClinicPageState extends State<SelectClinicPage> {
showCommonBottomSheetWithoutHeight(context, title: "", titleWidget: Consumer<AppointmentViaRegionViewmodel>(builder: (_, data, __) => getTitle(data)), isDismissible: false,
child: Consumer<AppointmentViaRegionViewmodel>(builder: (_, data, __) {
return getRegionalSelectionWidget(data);
}), callBackFunc: () {});
}), callBackFunc: () {
if (type == RegionBottomSheetType.REGION_FOR_DENTAL_AND_LASER && appState.isAuthenticated) {
initDentalAppointmentBookingFlow(regionalViewModel.selectedHospital?.hospitalList.first.iD);
} else {
bookAppointmentsViewModel.setIsChiefComplaintsListLoading(true);
Navigator.of(context).push(
CustomPageRoute(
page: DentalChiefComplaintsPage(),
),
);
}
});
}
Widget getRegionalSelectionWidget(AppointmentViaRegionViewmodel data) {
@ -252,8 +278,16 @@ class _SelectClinicPageState extends State<SelectClinicPage> {
if (data.bottomSheetState == AppointmentViaRegionState.HOSPITAL_SELECTION) {
return HospitalBottomSheetBody();
}
if(data.bottomSheetState == AppointmentViaRegionState.DOCTOR_SELECTION){
bookAppointmentsViewModel.setProjectID(regionalViewModel.selectedHospital?.patientDoctorAppointmentList?.first.projectID.toString());
if (data.bottomSheetState == AppointmentViaRegionState.DOCTOR_SELECTION) {
//if the region screen is opened for the dental clinic then the project id will be in the hospital list as the list is formed form the get project api
var id = "";
if (data.regionBottomSheetType == RegionBottomSheetType.REGION_FOR_DENTAL_AND_LASER) {
id = regionalViewModel.selectedHospital?.hospitalList.first.iD?.toString() ?? "";
} else {
id = regionalViewModel.selectedHospital?.patientDoctorAppointmentList?.first.projectID?.toString() ?? "";
}
bookAppointmentsViewModel.setProjectID(id);
return SizedBox.shrink();
}
else {
return SizedBox.shrink();
@ -277,4 +311,128 @@ class _SelectClinicPageState extends State<SelectClinicPage> {
});
}
}
void initDentalAppointmentBookingFlow(int projectID) async {
bookAppointmentsViewModel.setProjectID(projectID.toString());
LoaderBottomSheet.showLoader(loadingText: "Checking for an existing dental plan, Please wait...".needTranslation);
await bookAppointmentsViewModel.getPatientDentalEstimation(projectID: projectID).then((value) {
LoaderBottomSheet.hideLoader();
if (bookAppointmentsViewModel.patientDentalPlanEstimationList.isNotEmpty) {
showCommonBottomSheetWithoutHeight(
// title: LocaleKeys.notice.tr(context: context),
title: "Dental treatment plan".needTranslation,
context,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"You have an existing treatment plan: ".needTranslation.toText14(weight: FontWeight.w500),
SizedBox(height: 8.h),
Container(
width: double.infinity,
padding: EdgeInsets.all(16.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 20.h,
hasShadow: true,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: bookAppointmentsViewModel.patientDentalPlanEstimationList.length,
separatorBuilder: (_, __) {
return Column(
children: [
SizedBox(height: 8.h),
Divider(height: 1, color: AppColors.greyColor),
SizedBox(height: 8.h),
],
);
},
itemBuilder: (context, index) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
bookAppointmentsViewModel.patientDentalPlanEstimationList[index].procedureName!.toText12(isBold: true),
AppCustomChipWidget(icon: AppAssets.appointment_time_icon, labelText: "${bookAppointmentsViewModel.totalTimeNeededForDentalProcedure} Mins".needTranslation),
],
);
},
),
SizedBox(
height: 16.h,
),
Divider(height: 1, color: AppColors.greyColor),
SizedBox(
height: 8.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Total time required".needTranslation.toText14(isBold: true),
AppCustomChipWidget(icon: AppAssets.appointment_time_icon, labelText: "30 Mins".needTranslation),
],
)
],
),
),
SizedBox(height: 16.h),
"Would you like to continue it?".needTranslation.toText14(weight: FontWeight.w500),
SizedBox(height: 16.h),
Row(
children: [
Expanded(
child: CustomButton(
text: LocaleKeys.cancel.tr(),
onPressed: () {
bookAppointmentsViewModel.setIsContinueDentalPlan(false);
bookAppointmentsViewModel.setIsChiefComplaintsListLoading(true);
Navigator.of(context).pop();
Navigator.of(context).push(
CustomPageRoute(
page: DentalChiefComplaintsPage(),
),
);
},
backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedColor,
textColor: AppColors.whiteColor,
icon: AppAssets.cancel,
iconColor: AppColors.whiteColor,
),
),
SizedBox(width: 8.h),
Expanded(
child: CustomButton(
text: LocaleKeys.confirm.tr(),
onPressed: () async {
bookAppointmentsViewModel.setIsContinueDentalPlan(true);
Navigator.of(context).pop();
Navigator.of(context).push(
CustomPageRoute(
page: SelectDoctorPage(),
),
);
},
backgroundColor: AppColors.bgGreenColor,
borderColor: AppColors.bgGreenColor,
textColor: Colors.white,
icon: AppAssets.confirm,
),
),
],
)
],
),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
} else {
// Navigate to Chief Complaint Screen
}
});
}
}

@ -21,7 +21,6 @@ import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/input_widget.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
import 'package:provider/provider.dart';
class SelectDoctorPage extends StatefulWidget {
@ -45,7 +44,11 @@ class _SelectDoctorPageState extends State<SelectDoctorPage> {
if (bookAppointmentsViewModel.isLiveCareSchedule) {
bookAppointmentsViewModel.getLiveCareDoctorsList();
} else {
bookAppointmentsViewModel.getDoctorsList();
if (bookAppointmentsViewModel.selectedClinic.clinicID == 17) {
bookAppointmentsViewModel.getDentalChiefComplaintDoctorsList();
} else {
bookAppointmentsViewModel.getDoctorsList();
}
}
});
super.initState();
@ -66,42 +69,51 @@ class _SelectDoctorPageState extends State<SelectDoctorPage> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// TODO: Implement doctor filter functionality
SizedBox(height: 16.h),
TextInputWidget(
labelText: LocaleKeys.search.tr(context: context),
hintText: LocaleKeys.doctorName.tr(context: context),
controller: searchEditingController,
isEnable: true,
prefix: null,
autoFocus: false,
isBorderAllowed: false,
keyboardType: TextInputType.text,
focusNode: textFocusNode,
suffix: searchEditingController.text.isNotEmpty
? GestureDetector(
onTap: () {
searchEditingController.clear();
bookAppointmentsViewModel.filterClinics("");
textFocusNode.unfocus();
},
child: Utils.buildSvgWithAssets(icon: AppAssets.close_bottom_sheet_icon, width: 20.h, height: 20.h, fit: BoxFit.scaleDown),
)
: null,
onChange: (value) {
bookAppointmentsViewModel.filterClinics(value!);
},
padding: EdgeInsets.symmetric(
vertical: ResponsiveExtension(10).h,
horizontal: ResponsiveExtension(15).h,
),
Row(
spacing: 8.h,
children: [
Expanded(
child: TextInputWidget(
labelText: LocaleKeys.search.tr(context: context),
hintText: LocaleKeys.doctorName.tr(context: context),
controller: searchEditingController,
isEnable: true,
prefix: null,
autoFocus: false,
isBorderAllowed: false,
keyboardType: TextInputType.text,
focusNode: textFocusNode,
suffix: searchEditingController.text.isNotEmpty
? GestureDetector(
onTap: () {
searchEditingController.clear();
bookAppointmentsViewModel.filterClinics("");
textFocusNode.unfocus();
},
child: Utils.buildSvgWithAssets(icon: AppAssets.close_bottom_sheet_icon, width: 20.h, height: 20.h, fit: BoxFit.scaleDown),
)
: null,
onChange: (value) {
bookAppointmentsViewModel.filterClinics(value!);
},
padding: EdgeInsets.symmetric(
vertical: ResponsiveExtension(10).h,
horizontal: ResponsiveExtension(15).h,
),
),
),
],
),
ListView.separated(
padding: EdgeInsets.only(top: 24.h),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount:
bookAppointmentsVM.isDoctorsListLoading ? 5 : (bookAppointmentsVM.isLiveCareSchedule ? bookAppointmentsVM.liveCareDoctorsList.length : bookAppointmentsVM.doctorsList.length),
itemCount: bookAppointmentsVM.isDoctorsListLoading
? 5
: (bookAppointmentsVM.isLiveCareSchedule
? (bookAppointmentsVM.liveCareDoctorsList.isNotEmpty ? bookAppointmentsVM.liveCareDoctorsList.length : 1)
: (bookAppointmentsVM.doctorsList.isNotEmpty ? bookAppointmentsVM.doctorsList.length : 1)),
itemBuilder: (context, index) {
return bookAppointmentsVM.isDoctorsListLoading
? DoctorCard(
@ -109,47 +121,49 @@ class _SelectDoctorPageState extends State<SelectDoctorPage> {
isLoading: true,
bookAppointmentsViewModel: bookAppointmentsViewModel,
)
: AnimationConfiguration.staggeredList(
position: index,
duration: const Duration(milliseconds: 500),
child: SlideAnimation(
verticalOffset: 100.0,
child: FadeInAnimation(
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOut,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
child: DoctorCard(
doctorsListResponseModel: bookAppointmentsVM.isLiveCareSchedule ? bookAppointmentsVM.liveCareDoctorsList[index] : bookAppointmentsVM.doctorsList[index],
isLoading: false,
bookAppointmentsViewModel: bookAppointmentsViewModel,
).onPress(() async {
bookAppointmentsVM
.setSelectedDoctor(bookAppointmentsVM.isLiveCareSchedule ? bookAppointmentsVM.liveCareDoctorsList[index] : bookAppointmentsVM.doctorsList[index]);
// bookAppointmentsVM.setSelectedDoctor(DoctorsListResponseModel());
LoaderBottomSheet.showLoader();
await bookAppointmentsVM.getDoctorProfile(onSuccess: (dynamic respData) {
LoaderBottomSheet.hideLoader();
Navigator.of(context).push(
CustomPageRoute(
page: DoctorProfilePage(),
),
);
}, onError: (err) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: err),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
});
}),
: checkIsDoctorsListEmpty()
? Utils.getNoDataWidget(context, noDataText: "No Doctor found for selected criteria...".needTranslation)
: AnimationConfiguration.staggeredList(
position: index,
duration: const Duration(milliseconds: 500),
child: SlideAnimation(
verticalOffset: 100.0,
child: FadeInAnimation(
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOut,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
child: DoctorCard(
doctorsListResponseModel: bookAppointmentsVM.isLiveCareSchedule ? bookAppointmentsVM.liveCareDoctorsList[index] : bookAppointmentsVM.doctorsList[index],
isLoading: false,
bookAppointmentsViewModel: bookAppointmentsViewModel,
).onPress(() async {
bookAppointmentsVM
.setSelectedDoctor(bookAppointmentsVM.isLiveCareSchedule ? bookAppointmentsVM.liveCareDoctorsList[index] : bookAppointmentsVM.doctorsList[index]);
// bookAppointmentsVM.setSelectedDoctor(DoctorsListResponseModel());
LoaderBottomSheet.showLoader();
await bookAppointmentsVM.getDoctorProfile(onSuccess: (dynamic respData) {
LoaderBottomSheet.hideLoader();
Navigator.of(context).push(
CustomPageRoute(
page: DoctorProfilePage(),
),
);
}, onError: (err) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: err),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
});
}),
),
),
),
),
),
);
);
},
separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h),
),
@ -162,4 +176,12 @@ class _SelectDoctorPageState extends State<SelectDoctorPage> {
),
);
}
bool checkIsDoctorsListEmpty() {
if (bookAppointmentsViewModel.isLiveCareSchedule) {
return bookAppointmentsViewModel.liveCareDoctorsList.isEmpty;
} else {
return bookAppointmentsViewModel.doctorsList.isEmpty;
}
}
}

@ -6,12 +6,9 @@ import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/select_doctor_page.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
class SelectLivecareClinicPage extends StatelessWidget {

@ -0,0 +1,38 @@
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/dental_chief_complaints_response_model.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
class ChiefComplaintCard extends StatelessWidget {
ChiefComplaintCard({super.key, required this.isLoading, required this.bookAppointmentsVM, required this.dentalChiefComplaintsListResponseModel});
bool isLoading;
BookAppointmentsViewModel bookAppointmentsVM;
DentalChiefComplaintsListResponseModel dentalChiefComplaintsListResponseModel;
@override
Widget build(BuildContext context) {
AppState appState = getIt.get<AppState>();
return Container(
padding: EdgeInsets.all(16.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.h,
hasShadow: false,
),
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Expanded(child: (isLoading ? "Cardiology" : dentalChiefComplaintsListResponseModel.name)!.toText16(isBold: true).toShimmer2(isShow: isLoading)),
Transform.flip(
flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, width: 40.h, height: 40.h, fit: BoxFit.contain, iconColor: AppColors.textColor).toShimmer2(isShow: isLoading)),
]),
);
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save