consumer on welcome & language & font

merge-update-with-lab-changes
Aamir Muhammad 5 months ago committed by haroon amjad
parent e9d35d8333
commit 1282b5a415

@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.75 8.00098C7.75 7.58677 7.41421 7.25098 7 7.25098C6.58579 7.25098 6.25 7.58677 6.25 8.00098V10.001C6.25 10.4152 6.58579 10.751 7 10.751C7.41421 10.751 7.75 10.4152 7.75 10.001V8.00098Z" fill="white"/>
<path d="M17.75 8.00098C17.75 7.58677 17.4142 7.25098 17 7.25098C16.5858 7.25098 16.25 7.58677 16.25 8.00098V10.001C16.25 10.4152 16.5858 10.751 17 10.751C17.4142 10.751 17.75 10.4152 17.75 10.001V8.00098Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.0208 1.7516C13.0014 1.75081 12.9819 1.75077 12.9625 1.75149C12.6711 1.75098 12.3706 1.75098 12.0606 1.75098H11.9428C9.7521 1.75096 8.03143 1.75095 6.68802 1.93157C5.31137 2.11666 4.21911 2.50369 3.36091 3.36189C2.50272 4.22009 2.11568 5.31234 1.93059 6.689C1.74998 8.03241 1.74999 9.7531 1.75 11.9438V12.0582C1.74999 14.2489 1.74998 15.9695 1.93059 17.313C2.11568 18.6896 2.50272 19.7819 3.36091 20.6401C4.21911 21.4983 5.31137 21.8853 6.68802 22.0704C8.03144 22.251 9.75214 22.251 11.9428 22.251H12.0572C12.7173 22.251 13.3351 22.251 13.9124 22.246C13.9749 22.2535 14.0387 22.253 14.1024 22.2442C15.3575 22.2308 16.4182 22.1905 17.312 22.0704C18.6886 21.8853 19.7809 21.4983 20.6391 20.6401C21.4973 19.7819 21.8843 18.6896 22.0694 17.313C22.25 15.9695 22.25 14.2488 22.25 12.0581V11.9438C22.25 9.75308 22.25 8.03241 22.0694 6.689C21.8843 5.31234 21.4973 4.22009 20.6391 3.36189C19.7809 2.50369 18.6886 2.11666 17.312 1.93157C16.1721 1.77832 14.7606 1.75511 13.0208 1.7516ZM12 20.751C12.319 20.751 12.6252 20.7509 12.9193 20.7504C12.7052 20.0832 12.5486 19.4031 12.4352 18.7401C12.2903 18.7473 12.1453 18.751 12 18.751C10.2119 18.751 8.45912 18.1986 6.6279 17.1522C6.26826 16.9467 6.14331 16.4885 6.34882 16.1289C6.55433 15.7692 7.01247 15.6443 7.3721 15.8498C9.04088 16.8034 10.5381 17.251 12 17.251C12.0809 17.251 12.162 17.2496 12.2431 17.2469C12.1475 16.1735 12.1486 15.2213 12.1717 14.5464C12.1757 14.4287 12.1789 14.3341 12.1802 14.2524C12.103 14.2511 11.9692 14.2511 11.8587 14.2511C11.453 14.2511 11.0749 14.2512 10.7637 14.2079C10.4147 14.1594 10.0552 14.0458 9.75188 13.7498C9.70087 13.7 9.64733 13.6407 9.60301 13.5848C9.34612 13.261 9.26448 12.9074 9.25186 12.5598C9.24097 12.2595 9.28144 11.9065 9.32343 11.5403C9.5525 9.53916 10.0859 7.4907 10.6645 5.82672C11.0065 4.84325 11.3732 3.95822 11.7164 3.251C9.60322 3.25141 8.06766 3.25958 6.8879 3.41819C5.67757 3.58092 4.95462 3.88951 4.42157 4.42255C3.88853 4.9556 3.57994 5.67855 3.41722 6.88887C3.25159 8.12077 3.25 9.7406 3.25 12.001C3.25 14.2614 3.25159 15.8812 3.41722 17.1131C3.57994 18.3234 3.88853 19.0464 4.42157 19.5794C4.95462 20.1124 5.67757 20.421 6.8879 20.5838C8.11979 20.7494 9.73963 20.751 12 20.751ZM16.6279 15.8498C15.6096 16.4317 14.6552 16.8252 13.7337 17.0435C13.6511 16.0766 13.6501 15.204 13.6719 14.5645C13.6795 14.3441 13.6873 14.1186 13.6719 13.9311C13.6552 13.7269 13.604 13.4369 13.3862 13.1851C13.3525 13.1462 13.3186 13.1115 13.2805 13.077C13.0395 12.8583 12.7593 12.7966 12.5554 12.7726C12.3711 12.7509 12.15 12.751 11.9359 12.751C11.4702 12.751 11.1657 12.7494 10.9703 12.7222C10.838 12.7093 10.7689 12.5723 10.7509 12.5054C10.7446 12.3322 10.7698 12.0941 10.8188 11.6661C11.0323 9.80101 11.5291 7.90743 12.0813 6.31939C12.5463 4.98234 13.0366 3.90178 13.407 3.25296C14.9571 3.25969 16.1524 3.28916 17.1121 3.41819C18.3224 3.58092 19.0454 3.88951 19.5784 4.42255C20.1115 4.9556 20.4201 5.67855 20.5828 6.88887C20.7484 8.12077 20.75 9.7406 20.75 12.001C20.75 14.2614 20.7484 15.8812 20.5828 17.1131C20.4201 18.3234 20.1115 19.0464 19.5784 19.5794C19.0454 20.1124 18.3224 20.421 17.1121 20.5838C16.3916 20.6806 15.5384 20.7214 14.502 20.7385C14.2378 20.0264 14.0526 19.2759 13.9245 18.5385C15.0615 18.2887 16.2007 17.8215 17.3721 17.1522C17.7317 16.9467 17.8567 16.4885 17.6512 16.1289C17.4457 15.7692 16.9875 15.6443 16.6279 15.8498Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 3.8 KiB

@ -0,0 +1,6 @@
<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.80035 1.33511C9.4364 1.42574 10.0064 1.62567 10.4597 2.10615C10.9073 2.58048 11.088 3.1664 11.1708 3.81915C11.25 4.44372 11.25 5.23274 11.25 6.18939L11.25 8.54675C11.2501 8.94071 11.2501 9.31238 11.2098 9.60156C11.1691 9.89334 11.0568 10.3526 10.606 10.6083C10.1369 10.8743 9.68013 10.7103 9.41251 10.5763C9.15662 10.4482 8.8599 10.2385 8.55396 10.0222L8.40824 9.91922C7.87012 9.539 7.72655 9.44738 7.57819 9.39977C7.43214 9.3529 7.26931 9.34468 6.62223 9.34468H5.5816C5.08857 9.34469 4.67451 9.3447 4.335 9.31745C3.97977 9.28894 3.64356 9.22714 3.32247 9.06845C2.73202 8.77664 2.2676 8.27902 2.00089 7.67284C1.85789 7.3478 1.80159 7.00727 1.77533 6.6397C1.74999 6.28499 1.74999 5.85059 1.75 5.32437V5.27033C1.74999 4.74411 1.74999 4.3097 1.77533 3.95499C1.80159 3.58742 1.85789 3.24688 2.00089 2.92185C2.2676 2.31566 2.73202 1.81805 3.32247 1.52624C3.64356 1.36754 3.97977 1.30574 4.335 1.27723C4.67452 1.24998 5.08856 1.24999 5.5816 1.25L6.55449 1.25C7.45079 1.24997 8.20264 1.24994 8.80035 1.33511ZM8.58874 2.82011C8.10928 2.75179 7.46524 2.75 6.5 2.75H5.61111C5.08084 2.75 4.72737 2.75057 4.45501 2.77243C4.19161 2.79357 4.06781 2.83106 3.98706 2.87097C3.72521 3.00039 3.50461 3.2288 3.37388 3.52593C3.3295 3.6268 3.2921 3.77381 3.27152 4.06189C3.25045 4.35679 3.25 4.73737 3.25 5.29734C3.25 5.85732 3.25045 6.2379 3.27152 6.5328C3.2921 6.82088 3.3295 6.96789 3.37388 7.06876C3.50461 7.36589 3.72521 7.5943 3.98706 7.72371C4.06781 7.76362 4.19161 7.80112 4.45501 7.82226C4.72737 7.84412 5.08084 7.84468 5.61111 7.84468L6.71256 7.84463C7.22544 7.84421 7.63878 7.84387 8.03652 7.97151C8.43206 8.09843 8.77231 8.33925 9.1987 8.64103L9.37809 8.76784C9.52044 8.86842 9.64066 8.95331 9.74674 9.02558C9.74961 8.88565 9.75 8.71355 9.75 8.49851V6.23944C9.75 5.22016 9.74858 4.52694 9.68274 4.00792C9.6191 3.50621 9.50696 3.28209 9.3687 3.13556C9.23626 2.99519 9.04195 2.88469 8.58874 2.82011Z" fill="#ED1C2B"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.7637 3C12.7637 2.58579 13.0994 2.25 13.5137 2.25C17.76 2.25 21.3706 4.9642 22.7087 8.75007C23.0109 9.60517 23.1972 10.5146 23.2489 11.459C23.2715 11.8726 22.9546 12.2262 22.541 12.2489C22.1274 12.2715 21.7738 11.9546 21.7511 11.541C21.7173 10.923 21.6155 10.3237 21.4533 9.75L17.1718 9.75C17.2186 10.3123 17.2481 10.8928 17.259 11.4863C17.2665 11.9005 16.9369 12.2423 16.5228 12.2499C16.1086 12.2574 15.7668 11.9278 15.7592 11.5137C15.7481 10.905 15.7163 10.315 15.6663 9.75H13.5137C13.0994 9.75 12.7637 9.41421 12.7637 9C12.7637 8.58579 13.0994 8.25 13.5137 8.25H15.4826C15.3295 7.28681 15.1205 6.43072 14.8716 5.72162C14.6181 4.99929 14.3374 4.47039 14.0644 4.13676C13.7867 3.79728 13.5967 3.75 13.5137 3.75C13.0994 3.75 12.7637 3.41421 12.7637 3ZM15.7948 4.06943C15.9772 4.41983 16.141 4.80883 16.287 5.22488C16.59 6.08816 16.8325 7.11463 17.0001 8.25H20.8643C19.8356 6.23768 18.0051 4.70403 15.7948 4.06943Z" fill="#ED1C2B"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.5 11.25C2.91421 11.25 3.25 11.5858 3.25 12C3.25 12.7809 3.35829 13.5355 3.56035 14.25L7.84184 14.25C7.80863 13.851 7.78412 13.4429 7.76882 13.0276C7.75357 12.6137 8.07676 12.2658 8.49069 12.2505C8.90463 12.2353 9.25255 12.5585 9.2678 12.9724C9.28393 13.4102 9.31078 13.8368 9.34735 14.25H11.5C11.9142 14.25 12.25 14.5858 12.25 15C12.25 15.4142 11.9142 15.75 11.5 15.75H9.53108C9.69518 16.7828 9.92353 17.6915 10.1957 18.4273C10.4451 19.1016 10.7166 19.5905 10.9772 19.8968C11.2409 20.2067 11.4198 20.25 11.5 20.25C11.9142 20.25 12.25 20.5858 12.25 21C12.25 21.4142 11.9142 21.75 11.5 21.75C7.25362 21.75 3.6431 19.0358 2.30499 15.25C1.94535 14.2325 1.75 13.1382 1.75 12C1.75 11.5858 2.08579 11.25 2.5 11.25ZM9.21887 19.9306C9.06158 19.6284 8.91846 19.2981 8.78884 18.9477C8.45639 18.0488 8.19231 16.9607 8.0136 15.75L4.14934 15.75C5.17802 17.7623 7.0086 19.296 9.21887 19.9306Z" fill="#ED1C2B"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.4455 13.25C17.5492 13.25 16.7974 13.2499 16.1997 13.3351C15.5636 13.4257 14.9936 13.6257 14.5403 14.1062C14.0928 14.5805 13.912 15.1664 13.8292 15.8191C13.75 16.4437 13.75 17.2328 13.75 18.1894L13.75 20.5468C13.7499 20.9407 13.7499 21.3124 13.7902 21.6016C13.8309 21.8933 13.9432 22.3526 14.394 22.6083C14.8631 22.8743 15.3199 22.7103 15.5875 22.5763C15.8434 22.4482 16.1401 22.2385 16.446 22.0222L16.5918 21.9192C17.1299 21.539 17.2735 21.4474 17.4218 21.3998C17.5679 21.3529 17.7307 21.3447 18.3778 21.3447H19.4184C19.9115 21.3447 20.3255 21.3447 20.665 21.3175C21.0202 21.2889 21.3564 21.2271 21.6775 21.0685C22.268 20.7766 22.7324 20.279 22.9991 19.6728C23.1421 19.3478 23.1984 19.0073 23.2247 18.6397C23.25 18.285 23.25 17.8506 23.25 17.3244V17.2703C23.25 16.7441 23.25 16.3097 23.2247 15.955C23.1984 15.5874 23.1421 15.2469 22.9991 14.9219C22.7324 14.3157 22.268 13.818 21.6775 13.5262C21.3564 13.3675 21.0202 13.3057 20.665 13.2772C20.3255 13.25 19.9115 13.25 19.4184 13.25L18.4455 13.25ZM15.6313 15.1356C15.7638 14.9952 15.9581 14.8847 16.4113 14.8201C16.8907 14.7518 17.5348 14.75 18.5 14.75H19.3889C19.9192 14.75 20.2726 14.7506 20.545 14.7724C20.8084 14.7936 20.9322 14.8311 21.013 14.871C21.2748 15.0004 21.4954 15.2288 21.6261 15.5259C21.6705 15.6268 21.7079 15.7738 21.7285 16.0619C21.7496 16.3568 21.75 16.7374 21.75 17.2973C21.75 17.8573 21.7496 18.2379 21.7285 18.5328C21.7079 18.8209 21.6705 18.9679 21.6261 19.0688C21.4954 19.3659 21.2748 19.5943 21.013 19.7237C20.9322 19.7636 20.8084 19.8011 20.545 19.8223C20.2726 19.8441 19.9192 19.8447 19.3889 19.8447L18.2874 19.8446C17.7746 19.8442 17.3612 19.8439 16.9635 19.9715C16.568 20.0984 16.2277 20.3392 15.8013 20.641L15.6219 20.7678C15.4796 20.8684 15.3594 20.9533 15.2533 21.0256C15.2504 20.8857 15.25 20.7136 15.25 20.4985L15.25 18.2394C15.25 17.2202 15.2514 16.5269 15.3173 16.0079C15.3809 15.5062 15.4931 15.2821 15.6313 15.1356Z" fill="#ED1C2B"/>
</svg>

After

Width:  |  Height:  |  Size: 5.8 KiB

@ -0,0 +1,6 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.69531 2C6.69531 1.58579 6.35953 1.25 5.94531 1.25C5.5311 1.25 5.19531 1.58579 5.19531 2V2.39544C4.31166 2.55215 3.57204 2.85363 2.97472 3.4604C2.30965 4.13597 2.01951 4.98842 1.88263 6.02257C1.74997 7.02489 1.74998 8.30319 1.75 9.90642V15.0164C1.74998 16.6196 1.74997 17.8979 1.88263 18.9003C2.01951 19.9344 2.30967 20.7869 2.97472 21.4625C3.64139 22.1397 4.48532 22.4366 5.50892 22.5764C6.49796 22.7115 7.75835 22.7114 9.3347 22.7114H10.2892C10.7034 22.7114 11.0392 22.3756 11.0392 21.9614C11.0392 21.5472 10.7034 21.2114 10.2892 21.2114H9.39112C7.74534 21.2114 6.58763 21.2098 5.71189 21.0902C4.85894 20.9737 4.38615 20.7581 4.04365 20.4102C3.69953 20.0606 3.48508 19.5755 3.36966 18.7034C3.25155 17.811 3.25 16.6322 3.25 14.9614V9.96143C3.25 8.29063 3.25155 7.11182 3.36966 6.21938C3.48509 5.34733 3.69954 4.86226 4.04366 4.51271C4.3098 4.24236 4.65461 4.05189 5.19531 3.92574V4C5.19531 4.41421 5.5311 4.75 5.94531 4.75C6.35953 4.75 6.69531 4.41421 6.69531 4V3.74778C7.41857 3.71215 8.29699 3.71143 9.39112 3.71143H10.1953V4C10.1953 4.41421 10.5311 4.75 10.9453 4.75C11.3595 4.75 11.6953 4.41421 11.6953 4V3.71143H12.3444C13.4752 3.71143 14.4124 3.71867 15.1953 3.76707V4C15.1953 4.41421 15.5311 4.75 15.9453 4.75C16.3595 4.75 16.6953 4.41421 16.6953 4V3.95638C17.3123 4.09536 17.7006 4.29881 17.9655 4.56789C18.3115 4.91932 18.5223 5.39264 18.6349 6.24661C18.75 7.11979 18.75 8.27495 18.75 9.93126V11.1479C18.75 11.5621 19.0858 11.8979 19.5 11.8979C19.9142 11.8979 20.25 11.5621 20.25 11.1479L20.25 9.82598C20.2501 8.26264 20.2502 7.02274 20.122 6.05052C19.9869 5.02589 19.6976 4.18926 19.0345 3.51557C18.43 2.90162 17.627 2.59299 16.6953 2.42677V2C16.6953 1.58579 16.3595 1.25 15.9453 1.25C15.5311 1.25 15.1953 1.58579 15.1953 2V2.26458C14.3645 2.21689 13.4139 2.21143 12.3444 2.21143L11.6953 2.21143V2C11.6953 1.58579 11.3595 1.25 10.9453 1.25C10.5311 1.25 10.1953 1.58579 10.1953 2V2.21143L9.33469 2.21143C8.33053 2.21141 7.45458 2.2114 6.69531 2.24631V2Z" fill="white"/>
<path d="M6.25 10C6.25 9.58579 6.58579 9.25 7 9.25H15C15.4142 9.25 15.75 9.58579 15.75 10C15.75 10.4142 15.4142 10.75 15 10.75H7C6.58579 10.75 6.25 10.4142 6.25 10Z" fill="white"/>
<path d="M6.25 15C6.25 14.5858 6.58579 14.25 7 14.25H11C11.4142 14.25 11.75 14.5858 11.75 15C11.75 15.4142 11.4142 15.75 11 15.75H7C6.58579 15.75 6.25 15.4142 6.25 15Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.8191 13.3204C20.3324 13.4613 20.8043 13.8083 21.2934 14.3502C21.5748 14.6091 21.8863 14.9348 22.0742 15.3682C22.2806 15.8445 22.305 16.3685 22.1485 16.9557L22.1369 16.9991L22.1202 17.0409C21.936 17.5016 21.5651 17.9034 21.2283 18.2407C21.0781 18.3913 20.932 18.5315 20.7845 18.6731C20.5538 18.8946 20.3194 19.1196 20.0602 19.3925L20.0513 19.4019L20.0421 19.411C19.5786 19.8663 19.1875 20.265 18.8488 20.6103C18.6961 20.766 18.5539 20.9109 18.4206 21.0453C18.026 21.4429 17.6525 21.8092 17.3432 21.9948C16.9171 22.2506 16.3792 22.3894 15.7622 22.5005L15.7502 22.5027L15.7382 22.5045C15.5559 22.5312 15.3563 22.563 15.1612 22.5941C14.9219 22.6322 14.6887 22.6694 14.5029 22.6948C14.3206 22.7197 14.1385 22.7403 13.9743 22.7473C13.8288 22.7535 13.6184 22.754 13.419 22.6932C12.8754 22.5277 12.7854 21.9924 12.7664 21.8532C12.737 21.6378 12.752 21.3998 12.7736 21.1968C12.8071 20.8823 12.8761 20.4991 12.9394 20.1479C12.9581 20.0437 12.9764 19.9423 12.993 19.8464C13.0852 19.197 13.2781 18.5547 13.5357 18.1308C13.5858 18.0454 13.6467 17.9735 13.6698 17.9462L13.6736 17.9417C13.7192 17.8876 13.7757 17.8245 13.8378 17.757C13.9631 17.6209 14.1305 17.446 14.3227 17.2487C14.7084 16.8531 15.2087 16.3527 15.7058 15.8616L15.7194 15.8482L15.7336 15.8355C15.9104 15.6778 16.1612 15.4167 16.4556 15.1103C16.6258 14.9331 16.8107 14.7407 17.004 14.5446C17.2521 14.2929 17.5098 14.0404 17.7395 13.8436C17.8537 13.7457 17.9749 13.6494 18.0945 13.5713C18.1804 13.5152 18.3354 13.4203 18.5262 13.377C18.8564 13.2797 19.3011 13.1782 19.8191 13.3204ZM18.9232 14.8239C19.1934 14.7428 19.3092 14.7359 19.422 14.7669C19.5484 14.8016 19.7932 14.9218 20.2002 15.3778L20.226 15.4067L20.2546 15.4327C20.5091 15.6648 20.6356 15.821 20.6979 15.9648C20.7453 16.0741 20.7801 16.2328 20.7116 16.5198C20.6434 16.6616 20.4837 16.8635 20.1667 17.1811C20.0616 17.2864 19.934 17.4093 19.7941 17.5439C19.5428 17.7859 19.2519 18.066 18.9816 18.35C18.5123 18.8114 18.1058 19.2257 17.7655 19.5726C17.6162 19.7248 17.4794 19.8642 17.3559 19.9887C16.9145 20.4334 16.6844 20.6408 16.5712 20.7087C16.3949 20.8146 16.0907 20.9166 15.5081 21.0222C15.2776 21.0561 15.0765 21.0884 14.8913 21.1181C14.6805 21.152 14.4901 21.1826 14.2999 21.2086L14.2827 21.2109C14.3125 20.9881 14.3579 20.7354 14.4074 20.4607C14.4288 20.3415 14.451 20.2178 14.473 20.091L14.4751 20.0789L14.4768 20.0669C14.5521 19.5286 14.7006 19.1069 14.8129 18.9176L14.8206 18.9084C14.8458 18.8784 14.8857 18.8335 14.9416 18.7727C15.0524 18.6523 15.2082 18.4893 15.3968 18.2958C15.7699 17.9131 16.2575 17.4252 16.7472 16.9413C16.9653 16.7446 17.284 16.4134 17.6044 16.0802C17.764 15.9144 17.924 15.748 18.0723 15.5975C18.3146 15.3517 18.536 15.1365 18.7157 14.9825C18.8061 14.905 18.8721 14.855 18.9149 14.827L18.9169 14.8258L18.9232 14.8239Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 5.2 KiB

@ -155,7 +155,6 @@ class ProjectViewModel extends BaseViewModel {
currentLanguage = 'en';
sharedPref.setString(APP_LANGUAGE, 'en');
}
notifyListeners();
}

@ -24,12 +24,15 @@ import 'package:hmg_patient_app/pages/rateAppointment/rate_appointment_doctor.da
import 'package:hmg_patient_app/services/authentication/auth_provider.dart';
import 'package:hmg_patient_app/services/clinic_services/get_clinic_service.dart';
import 'package:hmg_patient_app/theme/colors.dart';
import 'package:hmg_patient_app/theme/theme_notifier.dart';
import 'package:hmg_patient_app/theme/theme_value.dart';
import 'package:hmg_patient_app/uitl/app_shared_preferences.dart';
import 'package:hmg_patient_app/uitl/app_toast.dart';
import 'package:hmg_patient_app/uitl/gif_loader_dialog_utils.dart';
import 'package:hmg_patient_app/uitl/translations_delegate_base.dart';
import 'package:hmg_patient_app/uitl/utils.dart';
import 'package:hmg_patient_app/widgets/buttons/defaultButton.dart';
import 'package:hmg_patient_app/widgets/drawer/langauge_picker.dart';
import 'package:hmg_patient_app/widgets/others/app_scaffold_widget.dart';
import 'package:hmg_patient_app/widgets/otp/sms-popup.dart';
import 'package:hmg_patient_app/widgets/text/app_texts_widget.dart';
@ -74,7 +77,6 @@ class _WelcomeLogin extends State<WelcomeLogin> {
late ToDoCountProviderModel toDoProvider;
late int selectedOption;
bool onlySMSBox = false;
@ -89,6 +91,8 @@ class _WelcomeLogin extends State<WelcomeLogin> {
var dob;
late int isHijri;
var healthId;
int _selectedLanguage = 0;
@override
void initState() {
@ -96,212 +100,459 @@ class _WelcomeLogin extends State<WelcomeLogin> {
super.initState();
}
Widget build(BuildContext context) {
void changeLanguage(ProjectViewModel projectViewModel, int value) {
sharedPref.setBool(IS_ROBOT_INIT, false);
sharedPref.remove(CLINICS_LIST);
if (projectViewModel.isArabic) {
_selectedLanguage = value;
projectViewModel.changeLanguage('en');
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('change language to english');
} else {
_selectedLanguage = value;
projectViewModel.changeLanguage('ar');
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('change language to arabic');
}
var themeNotifier = Provider.of<ThemeNotifier>(context, listen: false);
themeNotifier.setTheme(defaultTheme(fontName: projectViewModel.isArabic ? 'Cairo' : 'Poppins'));
}
projectViewModel = Provider.of(context);
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).welcome,
isShowDecPage: false,
isShowAppBar: true,
isshowBackButton: false,
showNewAppBar: true,
backgroundColor: Color(0xffF8F8F8),
showNewAppBarTitle: false,
body: Column(
children: <Widget>[
Expanded(
child: ListView(
padding: EdgeInsets.only(left: 21, right: 21),
physics: BouncingScrollPhysics(),
children: [
SizedBox(height: 30),
Row(
@override
Widget build(BuildContext context) {
final initialProjectViewModel = Provider.of<ProjectViewModel>(context, listen: false);
// _selectedLanguage = initialProjectViewModel.isArabic ? 0 : 1;
return Consumer2<ProjectViewModel, ToDoCountProviderModel>(
builder: (context, projectViewModel, toDoProvider, child) {
_selectedLanguage = projectViewModel.isArabic ? 0 : 1;
return AppScaffold(
appBarTitle: TranslationBase.of(context).welcome,
isShowDecPage: false,
isShowAppBar: true,
isshowBackButton: false,
showNewAppBar: true,
backgroundColor: Color(0xffF8F8F8),
showNewAppBarTitle: false,
showDropDown: true,
isShowLanguageChanger: true,
appBarIcons: [],
dropDownList: [
TranslationBase.of(context).arabicChange,
TranslationBase.of(context).english,
],
dropDownIndexChange: (value) {
changeLanguage(projectViewModel, value!);
},
dropdownIndexValue: _selectedLanguage,
// Use the state variable
body: Column(
children: <Widget>[
Expanded(
child: ListView(
padding: EdgeInsets.only(left: 21, right: 21),
physics: BouncingScrollPhysics(),
children: [
SvgPicture.asset(
"assets/images/new/hmg_icon.svg",
height: 62,
width: 62,
SizedBox(height: 30),
Row(
children: [
SvgPicture.asset(
"assets/images/new/hmg_icon.svg",
height: 62,
width: 62,
),
],
),
// Example of using toDoProvider:
// if (toDoProvider.count > 0) Text("To-Do items: ${toDoProvider.count}"),
],
),
],
),
),
Spacer(),
Expanded(
child: Container(
padding: EdgeInsets.only(top: 30, bottom: 0, right: 21, left: 21),
child: Text(
// TranslationBase.of(context).welcome,
"Welcome to Dr. Sulaiman Al Habib Medical Group",
style: TextStyle(fontSize: 36, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 47 / 36),
),
),
),
Container(
padding: EdgeInsets.only(top: 16, bottom: 10, right: 21, left: 21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Directionality(
textDirection: TextDirection.ltr,
child: inputWidget(
"National ID. or File No",
"1xxxxxxxx",
nationIdController,
isEnable: true,
prefix: null,
hasSelection: false,
isBorderAllowed: false,
isAllowLeadingIcon: true,
leadingIcon: "assets/images/svg/student-card.svg",
),
),
],
),
),
SizedBox(
height: 15,
),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Spacer(),
Expanded(
child: Container(
padding: EdgeInsets.only(top: 0, bottom: 16, right: 21, left: 21),
child: DefaultButton(
TranslationBase.of(context).login,
() {
bool isValid = validateIqama(nationIdController.text);
print("Iqama is valid: $isValid");
if (isValid) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
isDismissible: false,
backgroundColor: Colors.transparent,
builder: (context) => Padding(
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom,
),
child: SingleChildScrollView(
child: GenericBottomSheet(
countryCode: "966", // Default is +966 as in your example
initialPhoneNumber: "", //
textController: phoneController,
buttons: [
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: CustomButton(
text: "Send me OTP on SMS",
onPressed: () {
onOtpBtnPressed(OTPType.sms);
},
backgroundColor: Colors.red,
borderColor: Colors.red,
textColor: Colors.white,
icon: "assets/images/svg/message.svg",
),
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
padding: EdgeInsets.only(top: 30, bottom: 0, right: 21, left: 21),
child: Text(
"Welcome to Dr. Sulaiman Al Habib Medical Group",
style: TextStyle(fontSize: 36, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 47 / 36),
),
),
),
Container(
padding: EdgeInsets.only(top: 16, bottom: 10, right: 21, left: 21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Directionality(
textDirection: TextDirection.ltr, // Consider making this dynamic based on language
child: inputWidget(
"National ID. or File No",
"1xxxxxxxx",
nationIdController, // Assumed to be a TextEditingController in your State class
isEnable: true,
prefix: null,
hasSelection: false,
isBorderAllowed: false,
isAllowLeadingIcon: true,
leadingIcon: "assets/images/svg/student-card.svg",
),
),
],
),
),
SizedBox(
height: 15,
),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Expanded(
child: Container(
padding: EdgeInsets.only(top: 0, bottom: 16, right: 21, left: 21),
child: DefaultButton(
TranslationBase.of(context).login,
() {
bool isValid = validateIqama(nationIdController.text);
print("Iqama is valid: $isValid");
if (isValid) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
isDismissible: false,
backgroundColor: Colors.transparent,
builder: (bottomSheetContext) => Padding(
// Use a different context name
padding: EdgeInsets.only(
bottom: MediaQuery.of(bottomSheetContext).viewInsets.bottom,
),
child: SingleChildScrollView(
child: GenericBottomSheet(
countryCode: "966",
initialPhoneNumber: "",
textController: phoneController, // Assumed to be a TextEditingController
buttons: [
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: CustomButton(
text: "Send me OTP on SMS",
onPressed: () {
onOtpBtnPressed(OTPType.sms);
},
backgroundColor: Colors.red,
borderColor: Colors.red,
textColor: Colors.white,
icon: "assets/images/svg/message.svg",
),
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: AppText(
"OR",
fontSize: 16,
fontFamily: 'poppins',
color: Color(0xFF2E3039),
fontWeight: FontWeight.w500,
),
),
],
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: AppText(
"OR",
fontSize: 16,
fontFamily: 'poppins',
color: Color(0xFF2E3039),
fontWeight: FontWeight.w500,
padding: const EdgeInsets.only(bottom: 10),
child: CustomButton(
text: "Send me OTP on WhatsApp",
onPressed: () {
onOtpBtnPressed(OTPType.whatsapp);
},
backgroundColor: Colors.white,
borderColor: Color(0xFF2E3039),
textColor: Color(0xFF2E3039),
icon: "assets/images/svg/whatsapp.svg",
),
),
],
),
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: CustomButton(
text: "Send me OTP on WhatsApp",
onPressed: () {
onOtpBtnPressed(OTPType.whatsapp);
},
backgroundColor: Colors.white,
borderColor: Color(0xFF2E3039),
textColor: Color(0xFF2E3039),
icon: "assets/images/svg/whatsapp.svg",
),
),
],
),
),
));
} else {
Utils.showErrorToast("Please enter a valid Iqama number.");
}
},
// color: CustomColors.,
textColor: Colors.white,
),
));
} else {
Utils.showErrorToast("Please enter a valid Iqama number.");
}
},
textColor: Colors.white,
),
),
),
),
],
),
// SizedBox(width: 8),
// Expanded(
// child: DefaultButton(
// TranslationBase.of(context).yes,
// () => {
// Navigator.of(context).push(FadePage(page: LoginType())),
// locator<GAnalytics>().loginRegistration.visited_alhabib_group(true),
// },
// color: CustomColors.green,
// ),
// ),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(
color: Colors.black,
fontSize: 16,
height: 26 / 16,
fontFamily: 'poppins',
fontWeight: FontWeight.w500,
),
children: <TextSpan>[
TextSpan(text: 'Dont have an account? '),
TextSpan(
text: 'Register now',
style: const TextStyle(
color: Colors.red,
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(
color: Colors.black,
fontSize: 16,
height: 26 / 16,
fontFamily: 'poppins',
fontWeight: FontWeight.w500,
),
recognizer: TapGestureRecognizer()
..onTap = () {
Navigator.of(context).push(FadePage(page: RegisterNew()));
// Example: Navigator.push(context, MaterialPageRoute(builder: (context) => RegisterScreen()));
},
children: <TextSpan>[
TextSpan(text: 'Dont have an account? '),
TextSpan(
text: 'Register now',
style: const TextStyle(
color: Colors.red,
fontSize: 16,
height: 26 / 16,
fontFamily: 'poppins',
fontWeight: FontWeight.w500,
),
recognizer: TapGestureRecognizer()
..onTap = () {
Navigator.of(context).push(FadePage(page: RegisterNew()));
locator<GAnalytics>().loginRegistration.visited_alhabib_group(true);
},
),
],
),
],
),
),
),
],
)
],
)
],
),
),
);
},
);
}
// Widget build(BuildContext context) {
// projectViewModel = Provider.of(context);
// projectViewModel.isArabic ? _selectedLanguage = 0 : 1;
// toDoProvider = Provider.of<ToDoCountProviderModel>(context);
// return AppScaffold(
// appBarTitle: TranslationBase.of(context).welcome,
// isShowDecPage: false,
// isShowAppBar: true,
// isshowBackButton: false,
// showNewAppBar: true,
// backgroundColor: Color(0xffF8F8F8),
// showNewAppBarTitle: false,
// showDropDown: true,
// isShowLanguageChanger: true,
// appBarIcons: [],
// dropDownList: [
// TranslationBase.of(context).arabicChange,
// TranslationBase.of(context).english,
// ],
// dropDownIndexChange: (value) {
// _selectedLanguage = value!;
// if (projectViewModel.isArabic) {
// projectViewModel.changeLanguage('en');
// locator<GAnalytics>().hamburgerMenu.logMenuItemClick('change language to english');
// } else {
// projectViewModel.changeLanguage('ar');
// locator<GAnalytics>().hamburgerMenu.logMenuItemClick('change language to arabic');
// }
// },
// dropdownIndexValue: _selectedLanguage,
// body: Column(
// children: <Widget>[
// Expanded(
// child: ListView(
// padding: EdgeInsets.only(left: 21, right: 21),
// physics: BouncingScrollPhysics(),
// children: [
// SizedBox(height: 30),
// Row(
// children: [
// SvgPicture.asset(
// "assets/images/new/hmg_icon.svg",
// height: 62,
// width: 62,
// ),
// ],
// ),
// ],
// ),
// ),
// Spacer(),
// Expanded(
// child: Container(
// padding: EdgeInsets.only(top: 30, bottom: 0, right: 21, left: 21),
// child: Text(
// // TranslationBase.of(context).welcome,
// "Welcome to Dr. Sulaiman Al Habib Medical Group",
// style: TextStyle(fontSize: 36, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 47 / 36),
// ),
// ),
// ),
// Container(
// padding: EdgeInsets.only(top: 16, bottom: 10, right: 21, left: 21),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.stretch,
// children: [
// Directionality(
// textDirection: TextDirection.ltr,
// child: inputWidget(
// "National ID. or File No",
// "1xxxxxxxx",
// nationIdController,
// isEnable: true,
// prefix: null,
// hasSelection: false,
// isBorderAllowed: false,
// isAllowLeadingIcon: true,
// leadingIcon: "assets/images/svg/student-card.svg",
// ),
// ),
// ],
// ),
// ),
// SizedBox(
// height: 15,
// ),
// Row(
// mainAxisSize: MainAxisSize.min,
// children: <Widget>[
// Expanded(
// child: Container(
// padding: EdgeInsets.only(top: 0, bottom: 16, right: 21, left: 21),
// child: DefaultButton(
// TranslationBase.of(context).login,
// () {
// bool isValid = validateIqama(nationIdController.text);
// print("Iqama is valid: $isValid");
//
// if (isValid) {
// showModalBottomSheet(
// context: context,
// isScrollControlled: true,
// isDismissible: false,
// backgroundColor: Colors.transparent,
// builder: (context) => Padding(
// padding: EdgeInsets.only(
// bottom: MediaQuery.of(context).viewInsets.bottom,
// ),
// child: SingleChildScrollView(
// child: GenericBottomSheet(
// countryCode: "966", // Default is +966 as in your example
// initialPhoneNumber: "", //
// textController: phoneController,
// buttons: [
// Padding(
// padding: const EdgeInsets.only(bottom: 10),
// child: CustomButton(
// text: "Send me OTP on SMS",
// onPressed: () {
// onOtpBtnPressed(OTPType.sms);
// },
// backgroundColor: Colors.red,
// borderColor: Colors.red,
// textColor: Colors.white,
// icon: "assets/images/svg/message.svg",
// ),
// ),
// Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Padding(
// padding: const EdgeInsets.symmetric(horizontal: 8),
// child: AppText(
// "OR",
// fontSize: 16,
// fontFamily: 'poppins',
// color: Color(0xFF2E3039),
// fontWeight: FontWeight.w500,
// ),
// ),
// ],
// ),
// Padding(
// padding: const EdgeInsets.only(bottom: 10),
// child: CustomButton(
// text: "Send me OTP on WhatsApp",
// onPressed: () {
// onOtpBtnPressed(OTPType.whatsapp);
// },
// backgroundColor: Colors.white,
// borderColor: Color(0xFF2E3039),
// textColor: Color(0xFF2E3039),
// icon: "assets/images/svg/whatsapp.svg",
// ),
// ),
// ],
// ),
// ),
// ));
// } else {
// Utils.showErrorToast("Please enter a valid Iqama number.");
// }
// },
// // color: CustomColors.,
// textColor: Colors.white,
// ),
// ),
// ),
// // SizedBox(width: 8),
// // Expanded(
// // child: DefaultButton(
// // TranslationBase.of(context).yes,
// // () => {
// // Navigator.of(context).push(FadePage(page: LoginType())),
// // locator<GAnalytics>().loginRegistration.visited_alhabib_group(true),
// // },
// // color: CustomColors.green,
// // ),
// // ),
// ],
// ),
// Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// RichText(
// textAlign: TextAlign.center,
// text: TextSpan(
// style: TextStyle(
// color: Colors.black,
// fontSize: 16,
// height: 26 / 16,
// fontFamily: 'poppins',
// fontWeight: FontWeight.w500,
// ),
// children: <TextSpan>[
// TextSpan(text: 'Dont have an account? '),
// TextSpan(
// text: 'Register now',
// style: const TextStyle(
// color: Colors.red,
// fontSize: 16,
// height: 26 / 16,
// fontFamily: 'poppins',
// fontWeight: FontWeight.w500,
// ),
// recognizer: TapGestureRecognizer()
// ..onTap = () {
// Navigator.of(context).push(FadePage(page: RegisterNew()));
// // Example: Navigator.push(context, MaterialPageRoute(builder: (context) => RegisterScreen()));
// },
// ),
// ],
// ),
// ),
// ],
// )
// ],
// ),
// );
// }
void onOtpBtnPressed(OTPType type) {
if (phoneController.text.isEmpty) {
Utils.showErrorToast("Please enter your phone number.");
@ -488,14 +739,14 @@ class _WelcomeLogin extends State<WelcomeLogin> {
userData = result.list,
sharedPref.setString(BLOOD_TYPE, result.patientBloodType ?? ""),
//Remove o+ from here Added by Aamir
authenticatedUserObject.user = result.list,
projectViewModel.setPrivilege(privilegeList: res),
authenticatedUserObject.user = result.list,
projectViewModel.setPrivilege(privilegeList: res),
await sharedPref.setObject(MAIN_USER, result.list),
await sharedPref.setObject(USER_PROFILE, result.list),
loginTokenID = result.logInTokenID,
await sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
await sharedPref.setString(TOKEN, result.authenticationTokenID),
checkIfUserAgreedBefore(result),
checkIfUserAgreedBefore(result),
// projectViewModel.analytics.loginRegistration.login_successful(),
}
}
@ -644,7 +895,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
isArabic: projectViewModel.isArabic,
),
),
(r) => false);
(r) => false);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
@ -669,22 +920,20 @@ class _WelcomeLogin extends State<WelcomeLogin> {
getToDoCount();
checkIfIsInPatient();
appointmentRateViewModel
.getIsLastAppointmentRatedList(projectViewModel.isArabic ? 1 : 2)
.then((_) {
appointmentRateViewModel.getIsLastAppointmentRatedList(projectViewModel.isArabic ? 1 : 2).then((_) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
if (appointmentRateViewModel.isHaveAppointmentNotRate) {
Navigator.pushAndRemoveUntil(
context,
FadePage(page: RateAppointmentDoctor()),
(route) => false,
(route) => false,
);
} else {
Navigator.pushAndRemoveUntil(
context,
FadePage(page: LandingPage()),
(route) => false,
(route) => false,
);
}
insertIMEI();
@ -695,9 +944,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
void getToDoCount() {
toDoProvider.setState(0, 0, true, "0");
ClinicListService()
.getActiveAppointmentNo(context)
.then((res) {
ClinicListService().getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) {
toDoProvider.setState(
res['AppointmentActiveNumber'],
@ -741,11 +988,4 @@ class _WelcomeLogin extends State<WelcomeLogin> {
}
});
}
}
}

@ -0,0 +1,67 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class LanguageSelector extends StatefulWidget {
final String currentLanguage;
final ValueChanged<String> onLanguageChanged;
final List<Map<String, String>> languages;
const LanguageSelector({
super.key,
required this.currentLanguage,
required this.onLanguageChanged,
required this.languages,
});
@override
State<LanguageSelector> createState() => _LanguageSelectorState();
}
class _LanguageSelectorState extends State<LanguageSelector> {
@override
Widget build(BuildContext context) {
final currentLangData = widget.languages.firstWhere(
(lang) => lang['code'] == widget.currentLanguage,
orElse: () => {'code': 'en', 'name': 'English'},
);
return Stack(clipBehavior: Clip.none, children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Color(0xFFFEE9EA),
),
height: 40,
width: 93,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
InkWell(
onTap: () {
final newLanguage = widget.currentLanguage == 'ar' ? 'en' : 'ar';
widget.onLanguageChanged(newLanguage);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
SvgPicture.asset("assets/images/svg/language.svg", width: 24),
const SizedBox(width: 8),
Text(
currentLangData['name']?.toUpperCase() ?? 'EN',
style: const TextStyle(fontWeight: FontWeight.w500, fontFamily: 'GESSTwo', fontSize: 14, color: Color(0xFFED1C2B)),
),
],
),
),
),
],
),
),
]);
}
}

@ -25,6 +25,7 @@ import 'package:hmg_patient_app/uitl/translations_delegate_base.dart';
import 'package:hmg_patient_app/uitl/utils.dart';
import 'package:hmg_patient_app/uitl/utils_new.dart';
import 'package:hmg_patient_app/widgets/data_display/text.dart';
import 'package:hmg_patient_app/widgets/drawer/langauge_picker.dart';
import 'package:hmg_patient_app/widgets/pharmacy/bottom_nav_pharmacy_bar.dart';
import 'package:hmg_patient_app/widgets/progress_indicator/app_loader_widget.dart';
import 'package:hmg_patient_app/widgets/transitions/fade_page.dart';
@ -84,6 +85,7 @@ class AppScaffold extends StatefulWidget {
final bool isShowPharmacyAppbar;
final bool isshowBackButton;
final Widget? customAppBar;
final bool isShowLanguageChanger;
AppScaffold setOnAppBarCartClick(VoidCallback onClick) {
_onCartClick = onClick;
@ -132,7 +134,8 @@ class AppScaffold extends StatefulWidget {
this.backButtonTab,
this.changeCurrentTab,
this.currentTab,
this.isShowPharmacyAppbar = false});
this.isShowPharmacyAppbar = false,
this.isShowLanguageChanger = false});
@override
_AppScaffoldState createState() => _AppScaffoldState();
@ -245,6 +248,7 @@ class _AppScaffoldState extends State<AppScaffold> {
isShowBackButton: widget.isshowBackButton,
dropDownIndexChange: widget.dropDownIndexChange,
appBarIcons: widget.appBarIcons,
isShowLanguageChanger: widget.isShowLanguageChanger,
onTap: () {
widget.onTap;
},
@ -348,6 +352,7 @@ class NewAppBarWidget extends StatelessWidget implements PreferredSizeWidget {
List<String>? dropDownList;
final void Function(int?)? dropDownIndexChange;
final List<Widget>? appBarIcons;
final bool isShowLanguageChanger;
VoidCallback? onTap;
@ -361,7 +366,8 @@ class NewAppBarWidget extends StatelessWidget implements PreferredSizeWidget {
this.dropdownIndexValue,
this.dropDownIndexChange,
this.onTap,
this.isShowBackButton = true})
this.isShowBackButton = true,
this.isShowLanguageChanger = false})
: super(key: key);
@override
@ -391,7 +397,7 @@ class NewAppBarWidget extends StatelessWidget implements PreferredSizeWidget {
fontSize: 24, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
),
),
if (showDropDown!)
if (showDropDown! && !isShowLanguageChanger)
Container(
decoration: containerRadius(Color(0xFFF7F7F7), 30),
height: 30,
@ -428,6 +434,69 @@ class NewAppBarWidget extends StatelessWidget implements PreferredSizeWidget {
),
),
),
if (showDropDown! && isShowLanguageChanger)
Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: Directionality(
textDirection: TextDirection.ltr,
child: LanguageSelector(
currentLanguage: dropdownIndexValue == 0 ? 'ar' : 'en',
onLanguageChanged: (String value) {
print(value);
print(value);
dropDownIndexChange!(value == 'ar' ? 0 : 1);
// dropdownIndexValue = value == 'ar' ? 0 : 1;
},
languages: [
{'code': 'ar', 'name': '${TranslationBase.of(context).arabicChange}'},
{'code': 'en', 'name': '${TranslationBase.of(context).english}'}
],
),
),
// child: Directionality(
// // Directionality(
// textDirection: TextDirection.ltr,
// child: Container(
// decoration: containerRadius(Color(0xFFFEE9EA), 12),
// height: 40,
// width: 93,
// // padding: EdgeInsets.all(10),
// child: DropdownButtonHideUnderline(
// child: ButtonTheme(
// alignedDropdown: true,
// child: DropdownButton<int>(
// iconEnabledColor: CustomColors.darkOrange,
// style: TextStyle(color: CustomColors.black, fontSize: 12),
// dropdownColor: CustomColors.lightGreyColor,
// value: dropdownIndexValue,
// items: [
// for (int i = 0; i < dropDownList!.length; i++)
// DropdownMenuItem<int>(
// value: i,
// child: AutoSizeText(
// dropDownList![i],
// style: TextStyle(
// fontSize: 12,
// fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
// fontWeight: FontWeight.w600,
// color: Color(0xff2B2E31),
// letterSpacing: -.48,
// // height: 12 / 18
// ),
// ),
// )
// ],
// onChanged: dropDownIndexChange,
// underline: Container(
// height: 0,
// ),
// ),
// ),
// ),
// ),
// ),
),
],
),
actions: <Widget>[

Loading…
Cancel
Save