commit
						9aadb37a2b
					
				| @ -0,0 +1,5 @@ | ||||
| <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="M7.50024 0.84375C7.08603 0.84375 6.75024 1.17954 6.75024 1.59375C6.75024 2.00796 7.08603 2.34375 7.50024 2.34375H8.25024V2.56924C4.56399 2.94479 1.68774 6.05838 1.68774 9.84375C1.68774 11.4006 2.17429 12.8439 3.00361 14.0297L1.71991 15.3134C1.42702 15.6063 1.42702 16.0812 1.71991 16.3741C2.01281 16.667 2.48768 16.667 2.78057 16.3741L3.98717 15.1675C5.2962 16.4006 7.05997 17.1562 9.00024 17.1562C10.9405 17.1562 12.7043 16.4006 14.0133 15.1675L15.2199 16.3741C15.5128 16.667 15.9877 16.667 16.2806 16.3741C16.5735 16.0812 16.5735 15.6063 16.2806 15.3134L14.9969 14.0297C15.8262 12.8439 16.3127 11.4006 16.3127 9.84375C16.3127 6.05838 13.4365 2.94479 9.75024 2.56924V2.34375L10.5002 2.34375C10.9145 2.34375 11.2502 2.00796 11.2502 1.59375C11.2502 1.17954 10.9145 0.84375 10.5002 0.84375L7.50024 0.84375ZM9.75024 7.21875C9.75024 6.80454 9.41446 6.46875 9.00024 6.46875C8.58603 6.46875 8.25024 6.80454 8.25024 7.21875L8.25024 10.2187C8.25024 10.4177 8.32926 10.6084 8.46991 10.7491L9.96991 12.2491C10.2628 12.542 10.7377 12.542 11.0306 12.2491C11.3235 11.9562 11.3235 11.4813 11.0306 11.1884L9.75024 9.90809V7.21875Z" fill="#ED1C2B"/> | ||||
|     <path d="M3.63891 1.87677C3.31491 1.71477 2.90547 1.53727 2.44764 1.6109C1.98924 1.68461 1.65565 1.98199 1.39707 2.24057C1.13848 2.49916 0.841106 2.83274 0.767389 3.29115C0.693766 3.74898 0.871267 4.15842 1.03327 4.48242L1.25658 4.92904C1.44182 5.29952 1.89232 5.44969 2.26281 5.26445C2.63329 5.07921 2.78346 4.6287 2.59822 4.25822L2.37491 3.8116C2.30362 3.66903 2.27107 3.58504 2.25679 3.53387L2.25589 3.53059L2.25771 3.52787C2.28727 3.4839 2.34472 3.41424 2.45773 3.30123C2.57073 3.18823 2.64039 3.13077 2.68436 3.10121L2.68708 3.0994L2.69037 3.1003C2.74153 3.11457 2.82552 3.14713 2.96809 3.21841L3.41471 3.44172C3.7852 3.62697 4.2357 3.4768 4.42094 3.10631C4.60619 2.73583 4.45602 2.28532 4.08553 2.10008L3.63891 1.87677Z" fill="#ED1C2B"/> | ||||
|     <path d="M15.0322 3.21841C15.1747 3.14713 15.2587 3.11457 15.3099 3.1003L15.3132 3.0994L15.3159 3.10121C15.3599 3.13077 15.4295 3.18823 15.5425 3.30123C15.6555 3.41424 15.713 3.4839 15.7425 3.52787L15.7444 3.53059L15.7435 3.53387C15.7292 3.58504 15.6966 3.66903 15.6253 3.8116L15.402 4.25822C15.2168 4.6287 15.367 5.07921 15.7374 5.26445C16.1079 5.44969 16.5584 5.29952 16.7437 4.92904L16.967 4.48242C17.129 4.15842 17.3065 3.74898 17.2329 3.29115C17.1591 2.83275 16.8618 2.49916 16.6032 2.24057C16.3446 1.98199 16.011 1.68461 15.5526 1.6109C15.0948 1.53727 14.6853 1.71477 14.3613 1.87677L13.9147 2.10008C13.5442 2.28532 13.3941 2.73583 13.5793 3.10631C13.7645 3.4768 14.215 3.62697 14.5855 3.44172L15.0322 3.21841Z" fill="#ED1C2B"/> | ||||
| </svg> | ||||
| After Width: | Height: | Size: 2.7 KiB | 
| @ -0,0 +1,4 @@ | ||||
| <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||||
|     <rect width="40" height="40" rx="10" fill="#EFEFF0"/> | ||||
|     <path fill-rule="evenodd" clip-rule="evenodd" d="M22.6823 10.7868C20.7265 10.7377 19.2735 10.7377 17.3177 10.7868L17.2429 10.7887C15.7335 10.8265 14.4916 10.8576 13.4906 11.0318C12.4283 11.2165 11.5388 11.5764 10.7854 12.3317C10.0359 13.0831 9.67705 13.9586 9.49526 15.0042C9.32465 15.9854 9.29883 17.1962 9.26758 18.6617L9.26597 18.7371C9.24467 19.7351 9.24468 20.265 9.26599 21.2629L9.2676 21.3383C9.29884 22.8038 9.32466 24.0146 9.49527 24.9959C9.67707 26.0414 10.0359 26.9169 10.7854 27.6683C11.5388 28.4236 12.4283 28.7835 13.4907 28.9683C14.4916 29.1424 15.7335 29.1735 17.2429 29.2113L17.3177 29.2132C19.2735 29.2623 20.7265 29.2623 22.6823 29.2132L22.7571 29.2113C24.2665 29.1735 25.5084 29.1423 26.5094 28.9682C27.5717 28.7835 28.4612 28.4236 29.2146 27.6683C29.9641 26.9169 30.323 26.0414 30.5047 24.9958C30.6754 24.0146 30.7012 22.8038 30.7324 21.3383L30.734 21.2629C30.7553 20.2649 30.7553 19.7351 30.734 18.7371L30.7324 18.6618C30.7012 17.1963 30.6753 15.9854 30.5047 15.0042C30.3229 13.9586 29.9641 13.0831 29.2146 12.3317C28.7913 11.9073 28.3249 11.6077 27.809 11.3939C27.7305 11.351 27.6464 11.3187 27.5587 11.2981C27.2289 11.1818 26.8796 11.0962 26.5093 11.0318C25.5084 10.8576 24.2665 10.8265 22.7571 10.7887L22.6823 10.7868ZM28.6798 16.8503C28.6604 16.4448 28.6507 16.242 28.5039 16.1611C28.3571 16.0801 28.1765 16.1824 27.8155 16.387L23.5798 18.787C22.2801 19.5234 21.181 20 19.9998 20C18.8186 20 17.7195 19.5234 16.4199 18.787L12.1845 16.3872C11.8234 16.1826 11.6429 16.0804 11.4961 16.1613C11.3492 16.2422 11.3396 16.445 11.3202 16.8505C11.2942 17.397 11.28 18.0306 11.264 18.7797C11.2433 19.7492 11.2433 20.2508 11.264 21.2203C11.2974 22.7803 11.3226 23.8393 11.4643 24.6543C11.5978 25.4218 11.8204 25.8777 12.2012 26.2595C12.5781 26.6374 13.0403 26.8638 13.8335 27.0018C14.6717 27.1476 15.765 27.1776 17.3679 27.2178C19.2902 27.266 20.7098 27.266 22.6321 27.2178C24.235 27.1776 25.3283 27.1476 26.1665 27.0018C26.9597 26.8638 27.4219 26.6374 27.7988 26.2595C28.1796 25.8777 28.4023 25.4218 28.5357 24.6543C28.6774 23.8393 28.7027 22.7803 28.736 21.2203C28.7567 20.2508 28.7567 19.7492 28.736 18.7797C28.72 18.0305 28.7058 17.3969 28.6798 16.8503Z" fill="#8F9AA3"/> | ||||
| </svg> | ||||
| After Width: | Height: | Size: 2.3 KiB | 
| @ -0,0 +1,3 @@ | ||||
| <svg width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||||
|     <path d="M0.555285 12.3963C0.716659 12.2744 1.1984 11.9105 1.47611 11.6938C2.03233 11.2597 2.77142 10.6666 3.50831 10.0268C4.24893 9.38373 4.97022 8.70822 5.50046 8.10811C5.76634 7.80719 5.96837 7.54286 6.09987 7.32473C6.22355 7.11958 6.24926 6.99839 6.24926 6.99839C6.24926 6.99839 6.22355 6.88077 6.09988 6.67563C5.96838 6.4575 5.76635 6.19316 5.50047 5.89225C4.97022 5.29214 4.24892 4.61663 3.5083 3.97359C2.7714 3.33378 2.0323 2.74067 1.47608 2.3066C1.19837 2.08987 0.717303 1.72647 0.555928 1.60458C0.222405 1.35895 0.150469 0.888943 0.396101 0.555421C0.641734 0.221898 1.11123 0.150649 1.44476 0.396282L1.44729 0.3982C1.61655 0.52604 2.11556 0.90294 2.39892 1.12407C2.9677 1.56795 3.72861 2.17838 4.49171 2.84093C5.25109 3.50025 6.02979 4.22592 6.62454 4.89904C6.92116 5.23474 7.18788 5.57503 7.3845 5.9012C7.56872 6.20678 7.75 6.59367 7.75 7.00018C7.75 7.40669 7.56871 7.79358 7.3845 8.09916C7.18787 8.42532 6.92116 8.76561 6.62454 9.10131C6.02979 9.77443 5.2511 10.5001 4.49173 11.1594C3.72863 11.822 2.96774 12.4324 2.39896 12.8763C2.11541 13.0976 1.61637 13.4745 1.44747 13.6021L1.44528 13.6037C1.11176 13.8494 0.641787 13.7785 0.396152 13.4449C0.150526 13.1114 0.221792 12.6419 0.555285 12.3963Z" fill="#2E3039"/> | ||||
| </svg> | ||||
| After Width: | Height: | Size: 1.3 KiB | 
| @ -0,0 +1,4 @@ | ||||
| <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||||
|     <rect width="40" height="40" rx="10" fill="#EFEFF0"/> | ||||
|     <path fill-rule="evenodd" clip-rule="evenodd" d="M20 9.25C14.0629 9.25 9.25 14.0629 9.25 20C9.25 25.9371 14.0629 30.75 20 30.75C25.9371 30.75 30.75 25.9371 30.75 20C30.75 14.0629 25.9371 9.25 20 9.25ZM19.9916 14.25C18.1958 14.25 16.7381 15.7041 16.7381 17.5C16.7381 19.2959 18.1958 20.75 19.9916 20.75C21.7875 20.75 23.2452 19.2959 23.2452 17.5C23.2452 15.7041 21.7875 14.25 19.9916 14.25ZM25.0409 24.4802C22.3735 21.6002 17.5747 21.7487 14.9638 24.4756L14.7763 24.6631C14.631 24.8084 14.5517 25.0069 14.5569 25.2123C14.562 25.4177 14.6512 25.612 14.8036 25.7498C16.1777 26.9923 18.0013 27.75 20.0001 27.75C21.9989 27.75 23.8225 26.9923 25.1966 25.7498C25.349 25.612 25.4382 25.4177 25.4433 25.2123C25.4485 25.0069 25.3692 24.8084 25.2239 24.6631L25.0409 24.4802Z" fill="#8F9AA3"/> | ||||
| </svg> | ||||
| After Width: | Height: | Size: 947 B | 
| @ -0,0 +1,9 @@ | ||||
| <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||||
|     <rect width="40" height="40" rx="10" fill="#EFEFF0" /> | ||||
|     <path fill-rule="evenodd" clip-rule="evenodd" | ||||
|         d="M14 9.125C14.5523 9.125 15 9.57272 15 10.125V10.4003C15.7146 10.375 16.5263 10.375 17.4442 10.375H18V10.125C18 9.57272 18.4477 9.125 19 9.125C19.5523 9.125 20 9.57272 20 10.125V10.375H20.5558C21.4737 10.375 22.2854 10.375 23 10.4003V10.125C23 9.57272 23.4477 9.125 24 9.125C24.5523 9.125 25 9.57272 25 10.125V10.6053C25.7881 10.7723 26.4557 11.0703 27.0052 11.6198C27.6803 12.2949 27.9758 13.1484 28.1152 14.1846C28.25 15.1877 28.25 16.4667 28.25 18.0693V19.4718C28.25 19.6649 28.25 19.7614 28.1497 19.8509C28.0495 19.9404 27.9297 19.9267 27.6902 19.8994C26.9002 19.8092 26.0881 19.9694 25.3767 20.3802C24.9379 20.6335 24.5768 20.9968 24.341 21.2339L20.9295 24.6457C20.1944 25.3808 19.8859 26.2375 19.7251 26.8673C19.6482 27.1685 19.5952 27.4601 19.5554 27.6895C19.5176 27.869 19.4542 28.1907 19.3973 28.5014C19.3452 28.7858 19.272 29.1997 19.257 29.435C19.2433 29.6508 19.2408 29.9906 19.3355 30.3731C19.3797 30.552 19.4018 30.6414 19.3138 30.7559C19.2257 30.8705 19.1667 30.8716 19.0486 30.8737C18.9727 30.875 18.8861 30.875 18.7878 30.875H17.4443C15.8417 30.875 14.5627 30.875 13.5596 30.7402C12.5234 30.6008 11.6699 30.3053 10.9948 29.6302C10.3197 28.9551 10.0242 28.1017 9.88483 27.0654C9.74997 26.0623 9.74998 24.7834 9.75 23.1808V18.0692C9.74998 16.4667 9.74997 15.1877 9.88483 14.1846C10.0242 13.1484 10.3197 12.2949 10.9948 11.6198C11.5443 11.0703 12.2119 10.7723 13 10.6053V10.125C13 9.57272 13.4477 9.125 14 9.125ZM15 17.375C14.5858 17.375 14.25 17.7108 14.25 18.125C14.25 18.5392 14.5858 18.875 15 18.875H23C23.4142 18.875 23.75 18.5392 23.75 18.125C23.75 17.7108 23.4142 17.375 23 17.375H15ZM15 22.375C14.5858 22.375 14.25 22.7108 14.25 23.125C14.25 23.5392 14.5858 23.875 15 23.875H19C19.4142 23.875 19.75 23.5392 19.75 23.125C19.75 22.7108 19.4142 22.375 19 22.375H15Z" | ||||
|         fill="#8F9AA3" /> | ||||
|     <path | ||||
|         d="M28.3976 21.6792C27.695 21.2736 26.8294 21.2736 26.1269 21.6792C25.8653 21.8303 25.631 22.065 25.3579 22.3387L21.9903 25.7064C21.525 26.1717 21.3075 26.7336 21.1786 27.2384C21.1143 27.4904 21.0684 27.7436 21.0288 27.9733C20.9632 28.2793 20.7702 29.277 20.7541 29.5302C20.7364 29.8092 20.7637 30.2137 21.0875 30.5374C21.4113 30.8612 21.8157 30.8886 22.0947 30.8708C22.348 30.8547 23.3456 30.6617 23.6516 30.5962C23.8813 30.5565 24.1345 30.5106 24.3865 30.4463C24.8913 30.3174 25.513 30.0402 25.9784 29.5749L29.2862 26.2671C29.5599 25.994 29.7947 25.7597 29.9457 25.4981C30.3513 24.7955 30.3513 23.9299 29.9457 23.2273C29.7947 22.9657 29.5001 22.6717 29.2264 22.3985C28.9533 22.1249 28.6592 21.8303 28.3976 21.6792Z" | ||||
|         fill="#8F9AA3" /> | ||||
| </svg> | ||||
| After Width: | Height: | Size: 2.7 KiB | 
| @ -0,0 +1,5 @@ | ||||
| <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||||
|     <rect width="40" height="40" rx="10" fill="#EFEFF0"/> | ||||
|     <path d="M20.75 12.5C20.75 12.0858 20.4142 11.75 20 11.75C19.5858 11.75 19.25 12.0858 19.25 12.5V13.25H18.5C18.0858 13.25 17.75 13.5858 17.75 14C17.75 14.4142 18.0858 14.75 18.5 14.75H19.25V15.5C19.25 15.9142 19.5858 16.25 20 16.25C20.4142 16.25 20.75 15.9142 20.75 15.5V14.75H21.5C21.9142 14.75 22.25 14.4142 22.25 14C22.25 13.5858 21.9142 13.25 21.5 13.25H20.75V12.5Z" fill="#8F9AA3"/> | ||||
|     <path fill-rule="evenodd" clip-rule="evenodd" d="M19.948 9.25H20.052C20.9505 9.24997 21.6997 9.24995 22.2945 9.32991C22.9223 9.41432 23.4891 9.59999 23.9445 10.0555C24.4 10.5109 24.5857 11.0777 24.6701 11.7055C24.695 11.8911 24.7122 12.0917 24.724 12.3072C25.8622 12.4348 26.7867 12.726 27.506 13.4474C28.1807 14.1241 28.476 14.9793 28.6152 16.018C28.75 17.0237 28.75 18.3062 28.75 19.9137V28.75H29C29.5523 28.75 30 29.1977 30 29.75C30 30.3023 29.5523 30.75 29 30.75H11C10.4477 30.75 10 30.3023 10 29.75C10 29.1977 10.4477 28.75 11 28.75H11.25V19.9137C11.25 18.3062 11.25 17.0237 11.3848 16.018C11.524 14.9793 11.8193 14.1241 12.494 13.4474C13.2133 12.726 14.1378 12.4348 15.276 12.3072C15.2878 12.0917 15.305 11.8911 15.3299 11.7055C15.4143 11.0777 15.6 10.5109 16.0555 10.0555C16.5109 9.59999 17.0777 9.41432 17.7055 9.32991C18.3003 9.24995 19.0495 9.24997 19.948 9.25ZM17.9054 10.8165C17.4439 10.8786 17.2464 10.9858 17.1161 11.1161C16.9858 11.2464 16.8786 11.4439 16.8165 11.9054C16.7516 12.3884 16.75 13.036 16.75 14C16.75 14.964 16.7516 15.6116 16.8165 16.0946C16.8786 16.5561 16.9858 16.7536 17.1161 16.8839C17.2464 17.0142 17.4439 17.1214 17.9054 17.1835C18.3884 17.2484 19.036 17.25 20 17.25C20.964 17.25 21.6116 17.2484 22.0946 17.1835C22.5561 17.1214 22.7536 17.0142 22.8839 16.8839C23.0142 16.7536 23.1214 16.5561 23.1835 16.0946C23.2484 15.6116 23.25 14.964 23.25 14C23.25 13.036 23.2484 12.3884 23.1835 11.9054C23.1214 11.4439 23.0142 11.2464 22.8839 11.1161C22.7536 10.9858 22.5561 10.8786 22.0946 10.8165C21.6116 10.7516 20.964 10.75 20 10.75C19.036 10.75 18.3884 10.7516 17.9054 10.8165ZM23.25 28.75V27.4678C23.25 27.028 23.25 26.6486 23.2218 26.3374C23.192 26.0082 23.1259 25.6822 22.9486 25.375C22.7511 25.033 22.467 24.7489 22.125 24.5514C21.8178 24.3741 21.4918 24.308 21.1627 24.2782C20.8514 24.25 20.472 24.25 20.0323 24.25C19.5925 24.25 19.1486 24.25 18.8374 24.2782C18.5082 24.308 18.1822 24.3741 17.875 24.5514C17.533 24.7489 17.2489 25.033 17.0514 25.375C16.8741 25.6822 16.808 26.0082 16.7782 26.3374C16.75 26.6486 16.75 27.028 16.75 27.4677V28.75H18.25V27.5C18.25 27.0189 18.2507 26.7082 18.2721 26.4727C18.3015 26.2392 18.4223 25.7721 18.9727 25.7721C19.2082 25.7507 19.5189 25.75 20 25.75C20.4811 25.75 20.7918 25.7507 21.0273 25.7721C21.2608 25.7843 21.7279 25.9415 21.7279 26.4727C21.7493 26.7082 21.75 27.0189 21.75 27.5V28.75H23.25ZM15 21C15 20.4477 15.4477 20 16 20H16.009C16.5612 20 17.009 20.4477 17.009 21C17.009 21.5523 16.5612 22 16.009 22H16C15.4477 22 15 21.5523 15 21ZM18.991 21C18.991 20.4477 19.4388 20 19.991 20H20C20.5523 20 21 20.4477 21 21C21 21.5523 20.5523 22 20 22H19.991C19.4388 22 18.991 21.5523 18.991 21ZM22.9922 21C22.9922 20.4477 23.4399 20 23.9922 20H24.0011C24.5534 20 25.0011 20.4477 25.0011 21C25.0011 21.5523 24.5534 22 24.0011 22H23.9922C23.4399 22 22.9922 21.5523 22.9922 21Z" fill="#8F9AA3"/> | ||||
| </svg> | ||||
| After Width: | Height: | Size: 3.3 KiB | 
| @ -0,0 +1,58 @@ | ||||
| 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/services/logger_service.dart'; | ||||
| 
 | ||||
| abstract class HabibWalletRepo { | ||||
|   Future<Either<Failure, GenericApiModel<dynamic>>> getPatientBalanceAmount(); | ||||
| } | ||||
| 
 | ||||
| class HabibWalletRepoImp implements HabibWalletRepo { | ||||
|   final ApiClient apiClient; | ||||
|   final LoggerService loggerService; | ||||
| 
 | ||||
|   HabibWalletRepoImp({required this.loggerService, required this.apiClient}); | ||||
| 
 | ||||
|   @override | ||||
|   Future<Either<Failure, GenericApiModel<dynamic>>> getPatientBalanceAmount() async { | ||||
|     Map<String, dynamic> mapDevice = {}; | ||||
| 
 | ||||
|     try { | ||||
|       GenericApiModel<dynamic>? apiResponse; | ||||
|       Failure? failure; | ||||
|       await apiClient.post( | ||||
|         GET_PATIENT_AdVANCE_BALANCE_AMOUNT, | ||||
|         body: mapDevice, | ||||
|         onFailure: (error, statusCode, {messageStatus, failureType}) { | ||||
|           failure = failureType; | ||||
|         }, | ||||
|         onSuccess: (response, statusCode, {messageStatus, errorMessage}) { | ||||
|           try { | ||||
|             // final list = response['ListPLO']; | ||||
|             // if (list == null || list.isEmpty) { | ||||
|             //   throw Exception("lab list is empty"); | ||||
|             // } | ||||
| 
 | ||||
|             // final labOrders = list.map((item) => PatientLabOrdersResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<PatientLabOrdersResponseModel>(); | ||||
| 
 | ||||
|             apiResponse = GenericApiModel<dynamic>( | ||||
|               messageStatus: messageStatus, | ||||
|               statusCode: statusCode, | ||||
|               errorMessage: null, | ||||
|               data: response["TotalAdvanceBalanceAmount"], | ||||
|             ); | ||||
|           } 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,39 @@ | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:hmg_patient_app_new/features/habib_wallet/models/habib_wallet_repo.dart'; | ||||
| import 'package:hmg_patient_app_new/services/error_handler_service.dart'; | ||||
| 
 | ||||
| class HabibWalletViewModel extends ChangeNotifier { | ||||
|   bool isWalletAmountLoading = false; | ||||
|   num habibWalletAmount = 0; | ||||
| 
 | ||||
|   HabibWalletRepo habibWalletRepo; | ||||
|   ErrorHandlerService errorHandlerService; | ||||
| 
 | ||||
|   HabibWalletViewModel({required this.habibWalletRepo, required this.errorHandlerService}); | ||||
| 
 | ||||
|   initHabibWalletProvider() { | ||||
|     isWalletAmountLoading = true; | ||||
|     habibWalletAmount = 0; | ||||
|     notifyListeners(); | ||||
|   } | ||||
| 
 | ||||
|   Future<void> getPatientBalanceAmount({Function(dynamic)? onSuccess, Function(String)? onError}) async { | ||||
|     final result = await habibWalletRepo.getPatientBalanceAmount(); | ||||
| 
 | ||||
|     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) { | ||||
|           habibWalletAmount = apiResponse.data!; | ||||
|           isWalletAmountLoading = false; | ||||
|           notifyListeners(); | ||||
|           if (onSuccess != null) { | ||||
|             onSuccess(apiResponse); | ||||
|           } | ||||
|         } | ||||
|       }, | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,109 @@ | ||||
| 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/habib_wallet/models/habib_wallet_view_model.dart'; | ||||
| import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; | ||||
| import 'package:hmg_patient_app_new/presentation/habib_wallet/recharge_wallet_page.dart'; | ||||
| import 'package:hmg_patient_app_new/presentation/lab/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/transitions/fade_page.dart'; | ||||
| import 'package:provider/provider.dart'; | ||||
| 
 | ||||
| class HabibWalletPage extends StatefulWidget { | ||||
|   const HabibWalletPage({super.key}); | ||||
| 
 | ||||
|   @override | ||||
|   State<HabibWalletPage> createState() => _HabibWalletState(); | ||||
| } | ||||
| 
 | ||||
| class _HabibWalletState extends State<HabibWalletPage> { | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     AppState _appState = getIt.get<AppState>(); | ||||
|     return Scaffold( | ||||
|       backgroundColor: AppColors.bgScaffoldColor, | ||||
|       body: CollapsingListView( | ||||
|         title: LocaleKeys.myWallet.tr(), | ||||
|         child: Padding( | ||||
|           padding: EdgeInsets.all(24.h), | ||||
|           child: SingleChildScrollView( | ||||
|             child: Column( | ||||
|               crossAxisAlignment: CrossAxisAlignment.start, | ||||
|               children: [ | ||||
|                 Container( | ||||
|                   width: double.infinity, | ||||
|                   height: 180.h, | ||||
|                   decoration: RoundedRectangleBorder().toSmoothCornerDecoration( | ||||
|                     color: AppColors.blackBgColor, | ||||
|                     borderRadius: 24, | ||||
|                   ), | ||||
|                   child: Padding( | ||||
|                     padding: EdgeInsets.all(16.h), | ||||
|                     child: Column( | ||||
|                       crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                       children: [ | ||||
|                         Row( | ||||
|                           mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
|                           children: [ | ||||
|                             Column( | ||||
|                               crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                               children: [ | ||||
|                                 "${_appState.getAuthenticatedUser()!.firstName!} ${_appState.getAuthenticatedUser()!.lastName!}".toText19(isBold: true, color: AppColors.whiteColor), | ||||
|                                 "MRN: ${_appState.getAuthenticatedUser()!.patientId!}".toText14(weight: FontWeight.w500, color: AppColors.greyTextColor), | ||||
|                               ], | ||||
|                             ), | ||||
|                             Utils.buildSvgWithAssets(icon: AppAssets.habiblogo, width: 24.h, height: 24.h), | ||||
|                           ], | ||||
|                         ), | ||||
|                         Spacer(), | ||||
|                         LocaleKeys.balanceAmount.tr(context: context).toText14(weight: FontWeight.w500, color: AppColors.whiteColor), | ||||
|                         Consumer<HabibWalletViewModel>(builder: (context, habibWalletVM, child) { | ||||
|                           return Utils.getPaymentAmountWithSymbol(habibWalletVM.habibWalletAmount.toString().toText32(isBold: true, color: AppColors.whiteColor), AppColors.whiteColor, 13.h, | ||||
|                                   isExpanded: false) | ||||
|                               .toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.h, width: 80.h, height: 40.h); | ||||
|                         }), | ||||
|                       ], | ||||
|                     ), | ||||
|                   ), | ||||
|                 ), | ||||
|                 SizedBox(height: 16.h), | ||||
|                 Row( | ||||
|                   mainAxisAlignment: MainAxisAlignment.center, | ||||
|                   children: [ | ||||
|                     CustomButton( | ||||
|                       icon: AppAssets.recharge_icon, | ||||
|                       iconSize: 21.h, | ||||
|                       text: "Recharge".needTranslation, | ||||
|                       onPressed: () { | ||||
|                         Navigator.of(context).push( | ||||
|                           FadePage( | ||||
|                             page: RechargeWalletPage(), | ||||
|                           ), | ||||
|                         ); | ||||
|                       }, | ||||
|                       backgroundColor: AppColors.infoColor, | ||||
|                       borderColor: AppColors.infoColor, | ||||
|                       textColor: AppColors.whiteColor, | ||||
|                       fontSize: 14, | ||||
|                       fontWeight: FontWeight.bold, | ||||
|                       borderRadius: 12, | ||||
|                       padding: EdgeInsets.fromLTRB(10, 0, 10, 0), | ||||
|                       height: 40.h, | ||||
|                     ), | ||||
|                   ], | ||||
|                 ), | ||||
|               ], | ||||
|             ), | ||||
|           ), | ||||
|         ), | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,229 @@ | ||||
| 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/generated/locale_keys.g.dart'; | ||||
| import 'package:hmg_patient_app_new/presentation/lab/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'; | ||||
| import 'package:hmg_patient_app_new/widgets/input_widget.dart'; | ||||
| 
 | ||||
| import 'widgets/select-medical_file.dart'; | ||||
| 
 | ||||
| class RechargeWalletPage extends StatefulWidget { | ||||
|   const RechargeWalletPage({super.key}); | ||||
| 
 | ||||
|   @override | ||||
|   State<RechargeWalletPage> createState() => _RechargeWalletPageState(); | ||||
| } | ||||
| 
 | ||||
| class _RechargeWalletPageState extends State<RechargeWalletPage> { | ||||
|   FocusNode textFocusNode = FocusNode(); | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     AppState appState = getIt.get<AppState>(); | ||||
|     return Scaffold( | ||||
|       backgroundColor: AppColors.bgScaffoldColor, | ||||
|       body: Column( | ||||
|         crossAxisAlignment: CrossAxisAlignment.start, | ||||
|         children: [ | ||||
|           Expanded( | ||||
|               child: CollapsingListView( | ||||
|             title: LocaleKeys.createAdvancedPayment.tr(context: context), | ||||
|             child: SingleChildScrollView( | ||||
|               child: Padding( | ||||
|                 padding: EdgeInsets.all(24.h), | ||||
|                 child: Column( | ||||
|                   crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                   children: [ | ||||
|                     Container( | ||||
|                       height: 135.h, | ||||
|                       decoration: RoundedRectangleBorder().toSmoothCornerDecoration( | ||||
|                         color: AppColors.whiteColor, | ||||
|                         borderRadius: 24.h, | ||||
|                         hasShadow: false, | ||||
|                         side: BorderSide(color: AppColors.textColor, width: 2.h), | ||||
|                       ), | ||||
|                       child: Padding( | ||||
|                         padding: EdgeInsets.all(16.h), | ||||
|                         child: Column( | ||||
|                           crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                           children: [ | ||||
|                             "Enter an amount".needTranslation.toText14(color: AppColors.greyTextColor, weight: FontWeight.w500), | ||||
|                             Spacer(), | ||||
|                             Row( | ||||
|                               crossAxisAlignment: CrossAxisAlignment.end, | ||||
|                               children: [ | ||||
|                                 Utils.getPaymentAmountWithSymbol( | ||||
|                                     SizedBox( | ||||
|                                       width: 150.h, | ||||
|                                       child: TextInputWidget( | ||||
|                                         labelText: "", | ||||
|                                         hintText: "", | ||||
|                                         isEnable: true, | ||||
|                                         prefix: null, | ||||
|                                         isAllowRadius: true, | ||||
|                                         isBorderAllowed: false, | ||||
|                                         isAllowLeadingIcon: true, | ||||
|                                         autoFocus: true, | ||||
|                                         fontSize: 40, | ||||
|                                         padding: EdgeInsets.symmetric(horizontal: 8.h, vertical: 0.h), | ||||
|                                         focusNode: textFocusNode, | ||||
|                                         isWalletAmountInput: true, | ||||
|                                         // leadingIcon: AppAssets.student_card, | ||||
|                                       ), | ||||
|                                     ), | ||||
|                                     AppColors.textColor, | ||||
|                                     13.h, | ||||
|                                     isExpanded: false), | ||||
|                                 const Spacer(), | ||||
|                                 "SAR".needTranslation.toText20(color: AppColors.greyTextColor, weight: FontWeight.w500), | ||||
|                               ], | ||||
|                             ), | ||||
|                           ], | ||||
|                         ), | ||||
|                       ), | ||||
|                     ), | ||||
|                     SizedBox(height: 24.h), | ||||
|                     Container( | ||||
|                       decoration: RoundedRectangleBorder().toSmoothCornerDecoration( | ||||
|                         color: AppColors.whiteColor, | ||||
|                         borderRadius: 24.h, | ||||
|                         hasShadow: false, | ||||
|                       ), | ||||
|                       child: Padding( | ||||
|                         padding: EdgeInsets.all(16.h), | ||||
|                         child: Column( | ||||
|                           crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                           children: [ | ||||
|                             Row( | ||||
|                               mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
|                               children: [ | ||||
|                                 Row( | ||||
|                                   children: [ | ||||
|                                     Utils.buildSvgWithAssets(icon: AppAssets.my_account_icon, width: 40.h, height: 40.h), | ||||
|                                     SizedBox(width: 8.h), | ||||
|                                     Column( | ||||
|                                       crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                                       children: [ | ||||
|                                         LocaleKeys.myAccount.tr(context: context).toText16(color: AppColors.textColor, weight: FontWeight.w500), | ||||
|                                         "${LocaleKeys.medicalFile.tr(context: context)}: ${appState.getAuthenticatedUser()!.patientId}" | ||||
|                                             .toText14(color: AppColors.greyTextColor, weight: FontWeight.w500), | ||||
|                                       ], | ||||
|                                     ), | ||||
|                                   ], | ||||
|                                 ), | ||||
|                                 Utils.buildSvgWithAssets(icon: AppAssets.arrow_down, width: 25.h, height: 25.h), | ||||
|                               ], | ||||
|                             ).onPress(() { | ||||
|                               // showCommonBottomSheetWithoutHeight(context, title: "Select Medical File".needTranslation, child: SelectMedicalFile(), callBackFunc: () {}, isFullScreen: false); | ||||
|                               showCommonBottomSheetWithoutHeight(context, title: "Select Medical File".needTranslation, child: const MultiPageBottomSheet(), callBackFunc: () {}, isFullScreen: false); | ||||
|                             }), | ||||
|                             SizedBox(height: 16.h), | ||||
|                             Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.1), height: 1.h), | ||||
|                             SizedBox(height: 16.h), | ||||
|                             Row( | ||||
|                               mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
|                               children: [ | ||||
|                                 Row( | ||||
|                                   children: [ | ||||
|                                     Utils.buildSvgWithAssets(icon: AppAssets.select_hospital_icon, width: 40.h, height: 40.h), | ||||
|                                     SizedBox(width: 8.h), | ||||
|                                     Column( | ||||
|                                       crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                                       children: [ | ||||
|                                         LocaleKeys.hospital.tr(context: context).toText16(color: AppColors.textColor, weight: FontWeight.w500), | ||||
|                                         "Olaya".toText14(color: AppColors.greyTextColor, weight: FontWeight.w500), | ||||
|                                       ], | ||||
|                                     ), | ||||
|                                   ], | ||||
|                                 ), | ||||
|                                 Utils.buildSvgWithAssets(icon: AppAssets.arrow_down, width: 25.h, height: 25.h), | ||||
|                               ], | ||||
|                             ), | ||||
|                             SizedBox(height: 16.h), | ||||
|                             Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.1), height: 1.h), | ||||
|                             SizedBox(height: 16.h), | ||||
|                             Row( | ||||
|                               mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
|                               children: [ | ||||
|                                 Row( | ||||
|                                   children: [ | ||||
|                                     Utils.buildSvgWithAssets(icon: AppAssets.email_icon, width: 40.h, height: 40.h), | ||||
|                                     SizedBox(width: 8.h), | ||||
|                                     Column( | ||||
|                                       crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                                       children: [ | ||||
|                                         LocaleKeys.email.tr(context: context).toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500), | ||||
|                                         "${appState.getAuthenticatedUser()!.emailAddress}".toText16(color: AppColors.textColor, weight: FontWeight.w500), | ||||
|                                       ], | ||||
|                                     ), | ||||
|                                   ], | ||||
|                                 ), | ||||
|                               ], | ||||
|                             ), | ||||
|                             SizedBox(height: 16.h), | ||||
|                             Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.1), height: 1.h), | ||||
|                             SizedBox(height: 16.h), | ||||
|                             Row( | ||||
|                               mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
|                               children: [ | ||||
|                                 Row( | ||||
|                                   children: [ | ||||
|                                     Utils.buildSvgWithAssets(icon: AppAssets.notes_icon, width: 40.h, height: 40.h), | ||||
|                                     SizedBox(width: 8.h), | ||||
|                                     Column( | ||||
|                                       crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                                       children: [ | ||||
|                                         LocaleKeys.notes.tr(context: context).toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500), | ||||
|                                         "Lorem Ipsum".toText16(color: AppColors.textColor, weight: FontWeight.w500), | ||||
|                                       ], | ||||
|                                     ), | ||||
|                                   ], | ||||
|                                 ), | ||||
|                               ], | ||||
|                             ), | ||||
|                             SizedBox(height: 8.h), | ||||
|                           ], | ||||
|                         ), | ||||
|                       ), | ||||
|                     ), | ||||
|                   ], | ||||
|                 ), | ||||
|               ), | ||||
|             ), | ||||
|           )), | ||||
|           Container( | ||||
|             decoration: RoundedRectangleBorder().toSmoothCornerDecoration( | ||||
|               color: AppColors.whiteColor, | ||||
|               borderRadius: 24.h, | ||||
|               hasShadow: false, | ||||
|             ), | ||||
|             child: CustomButton( | ||||
|               text: LocaleKeys.next.tr(context: context), | ||||
|               onPressed: () {}, | ||||
|               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.appointment_pay_icon, | ||||
|               iconColor: AppColors.whiteColor, | ||||
|               iconSize: 18.h, | ||||
|             ).paddingSymmetrical(24.h, 24.h), | ||||
|           ), | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,238 @@ | ||||
| // import 'package:flutter/cupertino.dart'; | ||||
| // import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; | ||||
| // | ||||
| // class SelectMedicalFile extends StatelessWidget { | ||||
| //   const SelectMedicalFile({super.key}); | ||||
| // | ||||
| //   @override | ||||
| //   Widget build(BuildContext context) { | ||||
| //     return Padding( | ||||
| //       padding: EdgeInsets.all(24.h), | ||||
| //       child: Column( | ||||
| //         crossAxisAlignment: CrossAxisAlignment.start, | ||||
| //         children: [ | ||||
| //           Container() | ||||
| //         ], | ||||
| //       ), | ||||
| //     ); | ||||
| //   } | ||||
| // } | ||||
| 
 | ||||
| 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/generated/locale_keys.g.dart'; | ||||
| import 'package:hmg_patient_app_new/theme/colors.dart'; | ||||
| 
 | ||||
| class MultiPageBottomSheet extends StatefulWidget { | ||||
|   const MultiPageBottomSheet({Key? key}) : super(key: key); | ||||
| 
 | ||||
|   @override | ||||
|   State<MultiPageBottomSheet> createState() => _MultiPageBottomSheetState(); | ||||
| } | ||||
| 
 | ||||
| class _MultiPageBottomSheetState extends State<MultiPageBottomSheet> { | ||||
|   final PageController _pageController = PageController(); | ||||
|   int _currentPage = 0; | ||||
|   final int _totalPages = 3; | ||||
| 
 | ||||
|   late AppState appState; | ||||
| 
 | ||||
|   @override | ||||
|   void dispose() { | ||||
|     _pageController.dispose(); | ||||
|     super.dispose(); | ||||
|   } | ||||
| 
 | ||||
|   void _nextPage() { | ||||
|     if (_currentPage < _totalPages - 1) { | ||||
|       _pageController.animateToPage( | ||||
|         _currentPage + 2, | ||||
|         duration: const Duration(milliseconds: 300), | ||||
|         curve: Curves.easeInOut, | ||||
|       ); | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   void _previousPage() { | ||||
|     if (_currentPage > 0) { | ||||
|       _pageController.previousPage( | ||||
|         duration: const Duration(milliseconds: 300), | ||||
|         curve: Curves.easeInOut, | ||||
|       ); | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     appState = getIt.get<AppState>(); | ||||
|     return Container( | ||||
|       height: MediaQuery.of(context).size.height * 0.38, | ||||
|       child: Column( | ||||
|         children: [ | ||||
|           SizedBox(height: 12.h), | ||||
|           Expanded( | ||||
|             child: PageView( | ||||
|               controller: _pageController, | ||||
|               onPageChanged: (index) { | ||||
|                 setState(() { | ||||
|                   _currentPage = index; | ||||
|                 }); | ||||
|               }, | ||||
|               children: [ | ||||
|                 _buildPage1(), | ||||
|                 _buildPage2(), | ||||
|                 _buildPage3(), | ||||
|               ], | ||||
|             ), | ||||
|           ), | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   Widget _buildPage1() { | ||||
|     return Column( | ||||
|       crossAxisAlignment: CrossAxisAlignment.start, | ||||
|       children: [ | ||||
|         Container( | ||||
|           decoration: RoundedRectangleBorder().toSmoothCornerDecoration( | ||||
|             color: AppColors.whiteColor, | ||||
|             borderRadius: 16.h, | ||||
|             hasShadow: false, | ||||
|           ), | ||||
|           child: Row( | ||||
|             mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
|             children: [ | ||||
|               Column( | ||||
|                 crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                 children: [ | ||||
|                   LocaleKeys.myMedicalFile.tr(context: context).toText16(color: AppColors.textColor, weight: FontWeight.w500), | ||||
|                   "${LocaleKeys.fileno.tr(context: context)}: ${appState.getAuthenticatedUser()!.patientId}".toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500), | ||||
|                 ], | ||||
|               ), | ||||
|               Utils.buildSvgWithAssets(icon: AppAssets.forward_chevron_icon, iconColor: AppColors.textColor, width: 15.h, height: 15.h), | ||||
|             ], | ||||
|           ).paddingAll(16.h), | ||||
|         ).onPress(() { | ||||
|           Navigator.of(context).pop(); | ||||
|         }), | ||||
|         SizedBox(height: 16.h), | ||||
|         Container( | ||||
|           decoration: RoundedRectangleBorder().toSmoothCornerDecoration( | ||||
|             color: AppColors.whiteColor, | ||||
|             borderRadius: 16.h, | ||||
|             hasShadow: false, | ||||
|           ), | ||||
|           child: Row( | ||||
|             mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
|             children: [ | ||||
|               Column( | ||||
|                 crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                 children: [ | ||||
|                   LocaleKeys.familyTitle.tr(context: context).toText16(color: AppColors.textColor, weight: FontWeight.w500), | ||||
|                   "Select a medical file from your family".needTranslation.toText14(color: AppColors.greyTextColor, weight: FontWeight.w500), | ||||
|                 ], | ||||
|               ), | ||||
|               Utils.buildSvgWithAssets(icon: AppAssets.forward_chevron_icon, iconColor: AppColors.textColor, width: 15.h, height: 15.h), | ||||
|             ], | ||||
|           ).paddingAll(16.h), | ||||
|         ), | ||||
|         SizedBox(height: 16.h), | ||||
|         Container( | ||||
|           decoration: RoundedRectangleBorder().toSmoothCornerDecoration( | ||||
|             color: AppColors.whiteColor, | ||||
|             borderRadius: 16.h, | ||||
|             hasShadow: false, | ||||
|           ), | ||||
|           child: Row( | ||||
|             mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
|             children: [ | ||||
|               Column( | ||||
|                 crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                 children: [ | ||||
|                   LocaleKeys.otherAccount.tr(context: context).toText16(color: AppColors.textColor, weight: FontWeight.w500), | ||||
|                   "Any active medical file from HMG".toText14(color: AppColors.greyTextColor, weight: FontWeight.w500), | ||||
|                 ], | ||||
|               ), | ||||
|               Utils.buildSvgWithAssets(icon: AppAssets.forward_chevron_icon, iconColor: AppColors.textColor, width: 15.h, height: 15.h), | ||||
|             ], | ||||
|           ).paddingAll(16.h), | ||||
|         ).onPress(() { | ||||
|           _pageController.animateToPage( | ||||
|             2, | ||||
|             duration: const Duration(milliseconds: 300), | ||||
|             curve: Curves.easeInOut, | ||||
|           ); | ||||
|         }), | ||||
|       ], | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   Widget _buildPage2() { | ||||
|     return Padding( | ||||
|       padding: const EdgeInsets.all(16.0), | ||||
|       child: Column( | ||||
|         crossAxisAlignment: CrossAxisAlignment.start, | ||||
|         children: [ | ||||
|           Text( | ||||
|             'Page 2: Settings', | ||||
|             style: Theme.of(context).textTheme.headlineSmall, | ||||
|           ), | ||||
|           const SizedBox(height: 16), | ||||
|           SwitchListTile( | ||||
|             title: const Text('Enable notifications'), | ||||
|             value: true, | ||||
|             onChanged: (value) {}, | ||||
|           ), | ||||
|           SwitchListTile( | ||||
|             title: const Text('Dark mode'), | ||||
|             value: false, | ||||
|             onChanged: (value) {}, | ||||
|           ), | ||||
|           const ListTile( | ||||
|             leading: Icon(Icons.language), | ||||
|             title: Text('Language'), | ||||
|             subtitle: Text('English'), | ||||
|             trailing: Icon(Icons.arrow_forward_ios), | ||||
|           ), | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   Widget _buildPage3() { | ||||
|     return Padding( | ||||
|       padding: const EdgeInsets.all(16.0), | ||||
|       child: Column( | ||||
|         crossAxisAlignment: CrossAxisAlignment.start, | ||||
|         children: [ | ||||
|           Text( | ||||
|             'Page 3: Summary', | ||||
|             style: Theme.of(context).textTheme.headlineSmall, | ||||
|           ), | ||||
|           const SizedBox(height: 16), | ||||
|           const Card( | ||||
|             child: Padding( | ||||
|               padding: EdgeInsets.all(16.0), | ||||
|               child: Column( | ||||
|                 crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                 children: [ | ||||
|                   Text('Configuration Complete!'), | ||||
|                   SizedBox(height: 8), | ||||
|                   Text('Your settings have been saved successfully.'), | ||||
|                 ], | ||||
|               ), | ||||
|             ), | ||||
|           ), | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,65 @@ | ||||
| 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'; | ||||
| 
 | ||||
| class LabRadCard extends StatelessWidget { | ||||
|   LabRadCard({super.key, required this.icon, required this.labelText, required this.labOrderTests}); | ||||
| 
 | ||||
|   String icon; | ||||
|   String labelText; | ||||
|   List<String> labOrderTests = []; | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return Container( | ||||
|       decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: false), | ||||
|       child: Column( | ||||
|         crossAxisAlignment: CrossAxisAlignment.start, | ||||
|         children: [ | ||||
|           Row( | ||||
|             children: [ | ||||
|               Utils.buildSvgWithAssets( | ||||
|                 icon: icon, | ||||
|                 width: 40.h, | ||||
|                 height: 40.h, | ||||
|                 fit: BoxFit.contain, | ||||
|               ).toShimmer2(isShow: false, radius: 12.h), | ||||
|               SizedBox(width: 8.h), | ||||
|               labelText.toText14(isBold: true).toShimmer2(isShow: false, radius: 6.h, height: 32.h), | ||||
|             ], | ||||
|           ), | ||||
|           SizedBox(height: 16.h), | ||||
|           ListView.separated( | ||||
|             scrollDirection: Axis.vertical, | ||||
|             padding: EdgeInsets.zero, | ||||
|             physics: NeverScrollableScrollPhysics(), | ||||
|             shrinkWrap: true, | ||||
|             itemBuilder: (cxt, index) { | ||||
|               return labOrderTests[index].toText12(isBold: true, maxLine: 1).toShimmer2(isShow: false, radius: 6.h, height: 24.h, width: 120.h); | ||||
|             }, | ||||
|             separatorBuilder: (cxt, index) => SizedBox(height: 8.h), | ||||
|             itemCount: labOrderTests.length, | ||||
|           ), | ||||
|           SizedBox(height: 16.h), | ||||
|           Row( | ||||
|             mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
|             children: [ | ||||
|               SizedBox.shrink(), | ||||
|               Utils.buildSvgWithAssets( | ||||
|                 icon: AppAssets.forward_arrow_icon, | ||||
|                 width: 15.h, | ||||
|                 height: 15.h, | ||||
|                 fit: BoxFit.contain, | ||||
|                 iconColor: AppColors.textColor | ||||
|               ).toShimmer2(isShow: false, radius: 12.h), | ||||
|             ], | ||||
|           ) | ||||
|         ], | ||||
|       ).paddingAll(16.h), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,181 @@ | ||||
| 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/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/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/theme/colors.dart'; | ||||
| import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; | ||||
| import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart'; | ||||
| 
 | ||||
| class MedicalFileAppointmentCard extends StatelessWidget { | ||||
|   MedicalFileAppointmentCard({super.key, required this.patientAppointmentHistoryResponseModel, required this.myAppointmentsViewModel}); | ||||
| 
 | ||||
|   PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel; | ||||
|   MyAppointmentsViewModel myAppointmentsViewModel; | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return Column( | ||||
|       crossAxisAlignment: CrossAxisAlignment.start, | ||||
|       children: [ | ||||
|         CustomButton( | ||||
|           text: DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false), | ||||
|           onPressed: () {}, | ||||
|           backgroundColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.greyColor : AppColors.secondaryLightRedColor, | ||||
|           borderColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.greyLightColor : AppColors.secondaryLightRedColor, | ||||
|           textColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor, | ||||
|           fontSize: 12, | ||||
|           fontWeight: FontWeight.w500, | ||||
|           borderRadius: 12.h, | ||||
|           padding: EdgeInsets.fromLTRB(10, 0, 10, 0), | ||||
|           height: 40.h, | ||||
|           icon: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppAssets.appointment_calendar_icon : AppAssets.alarm_clock_icon, | ||||
|           iconColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor, | ||||
|           iconSize: 16.h, | ||||
|         ).toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading), | ||||
|         SizedBox(height: 16.h), | ||||
|         Container( | ||||
|           decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true), | ||||
|           width: 200.h, | ||||
|           child: Column( | ||||
|             crossAxisAlignment: CrossAxisAlignment.start, | ||||
|             children: [ | ||||
|               Row( | ||||
|                 children: [ | ||||
|                   Image.network( | ||||
|                     patientAppointmentHistoryResponseModel.doctorImageURL ?? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png", | ||||
|                     width: 25.h, | ||||
|                     height: 27.h, | ||||
|                     fit: BoxFit.fill, | ||||
|                   ).circle(100).toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading), | ||||
|                   SizedBox(width: 8.h), | ||||
|                   Expanded( | ||||
|                     child: Column( | ||||
|                       crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                       children: [ | ||||
|                         (patientAppointmentHistoryResponseModel.doctorNameObj ?? "").toText14(isBold: true, maxlines: 1).toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading), | ||||
|                         (patientAppointmentHistoryResponseModel.clinicName ?? "") | ||||
|                             .toText12(maxLine: 1, fontWeight: FontWeight.w500, color: AppColors.greyTextColor) | ||||
|                             .toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading), | ||||
|                       ], | ||||
|                     ), | ||||
|                   ), | ||||
|                 ], | ||||
|               ), | ||||
|               SizedBox(height: 12.h), | ||||
|               Row( | ||||
|                 children: [ | ||||
|                   myAppointmentsViewModel.isMyAppointmentsLoading | ||||
|                       ? Container().toShimmer2(isShow: true, height: 40.h, width: 100.h, radius: 12.h) | ||||
|                       : Expanded( | ||||
|                           flex: 6, | ||||
|                           child: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) | ||||
|                               ? getArrivedAppointmentButton(context).toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading) | ||||
|                               : CustomButton( | ||||
|                                   text: AppointmentType.getNextActionText(patientAppointmentHistoryResponseModel.nextAction), | ||||
|                                   onPressed: () { | ||||
|                                     Navigator.of(context) | ||||
|                                         .push(FadePage( | ||||
|                                       page: AppointmentDetailsPage(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel), | ||||
|                                     )) | ||||
|                                         .then((val) { | ||||
|                                       // widget.myAppointmentsViewModel.initAppointmentsViewModel(); | ||||
|                                       // widget.myAppointmentsViewModel.getPatientAppointments(true, false); | ||||
|                                     }); | ||||
|                                   }, | ||||
|                                   backgroundColor: AppointmentType.getNextActionButtonColor(patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.15), | ||||
|                                   borderColor: AppointmentType.getNextActionButtonColor(patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.01), | ||||
|                                   textColor: AppointmentType.getNextActionTextColor(patientAppointmentHistoryResponseModel.nextAction), | ||||
|                                   fontSize: 14, | ||||
|                                   fontWeight: FontWeight.w500, | ||||
|                                   borderRadius: 12, | ||||
|                                   padding: EdgeInsets.fromLTRB(10, 0, 10, 0), | ||||
|                                   height: 40.h, | ||||
|                                   icon: AppointmentType.getNextActionIcon(patientAppointmentHistoryResponseModel.nextAction), | ||||
|                                   iconColor: AppointmentType.getNextActionTextColor(patientAppointmentHistoryResponseModel.nextAction), | ||||
|                                   iconSize: 14.h, | ||||
|                                 ).toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading), | ||||
|                         ), | ||||
|                   SizedBox(width: 8.h), | ||||
|                   Expanded( | ||||
|                     flex: 2, | ||||
|                     child: Container( | ||||
|                       height: 40.h, | ||||
|                       width: 40.h, | ||||
|                       decoration: RoundedRectangleBorder().toSmoothCornerDecoration( | ||||
|                         color: AppColors.textColor, | ||||
|                         borderRadius: 10.h, | ||||
|                       ), | ||||
|                       child: Padding( | ||||
|                         padding: EdgeInsets.all(10.h), | ||||
|                         child: Utils.buildSvgWithAssets( | ||||
|                           icon: AppAssets.forward_arrow_icon, | ||||
|                           width: 10.h, | ||||
|                           height: 10.h, | ||||
|                           fit: BoxFit.contain, | ||||
|                         ), | ||||
|                       ), | ||||
|                     ).toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading).onPress(() { | ||||
|                       Navigator.of(context) | ||||
|                           .push( | ||||
|                         FadePage( | ||||
|                           page: AppointmentDetailsPage(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel), | ||||
|                         ), | ||||
|                       ) | ||||
|                           .then((val) { | ||||
|                         // widget.myAppointmentsViewModel.initAppointmentsViewModel(); | ||||
|                         // widget.myAppointmentsViewModel.getPatientAppointments(true, false); | ||||
|                       }); | ||||
|                     }), | ||||
|                   ), | ||||
|                 ], | ||||
|               ), | ||||
|             ], | ||||
|           ).paddingAll(16.h), | ||||
|         ), | ||||
|       ], | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   Widget getArrivedAppointmentButton(BuildContext context) { | ||||
|     return DateTime.now().difference(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate)).inDays <= 15 | ||||
|         ? CustomButton( | ||||
|             text: LocaleKeys.askDoctor.tr(context: context), | ||||
|             onPressed: () {}, | ||||
|             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, | ||||
|             icon: AppAssets.ask_doctor_icon, | ||||
|             iconColor: AppColors.primaryRedColor, | ||||
|             iconSize: 16.h, | ||||
|           ) | ||||
|         : CustomButton( | ||||
|             text: "Rebook".needTranslation, | ||||
|             onPressed: () {}, | ||||
|             backgroundColor: AppColors.greyColor, | ||||
|             borderColor: AppColors.greyColor, | ||||
|             textColor: AppColors.blackColor, | ||||
|             fontSize: 14, | ||||
|             fontWeight: FontWeight.w500, | ||||
|             borderRadius: 12, | ||||
|             padding: EdgeInsets.fromLTRB(10, 0, 10, 0), | ||||
|             height: 40.h, | ||||
|             icon: AppAssets.rebook_appointment_icon, | ||||
|             iconColor: AppColors.blackColor, | ||||
|             iconSize: 16.h, | ||||
|           ); | ||||
|   } | ||||
| } | ||||
					Loading…
					
					
				
		Reference in New Issue