Commit 528df0d2 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

14-05-2025 By Sai Srinivas

All UI Adjustments and Font Sizes
parent fd946558
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="11" cy="10.5417" r="9.38963" fill="#2D2D2D"/>
<path d="M11 21.0833C13.1756 21.0833 15.3023 20.4651 17.1113 19.3068C18.9202 18.1484 20.3301 16.502 21.1627 14.5758C21.9952 12.6496 22.2131 10.53 21.7886 8.4851C21.3642 6.44022 20.3165 4.56187 18.7782 3.08759C17.2398 1.61331 15.2798 0.60932 13.146 0.202567C11.0122 -0.204185 8.80047 0.00457529 6.79048 0.802449C4.78049 1.60032 3.06253 2.95147 1.85383 4.68504C0.645134 6.41861 -4.61819e-06 8.45673 -4.80046e-06 10.5417C-5.04488e-06 13.3375 1.15892 16.0188 3.22182 17.9958C5.28472 19.9727 8.08261 21.0833 11 21.0833ZM8.29 6.43043C8.19627 6.34134 8.12187 6.23535 8.07111 6.11856C8.02034 6.00178 7.9942 5.87652 7.9942 5.75001C7.9942 5.6235 8.02034 5.49824 8.07111 5.38146C8.12187 5.26468 8.19627 5.15868 8.29 5.06959C8.38296 4.97977 8.49356 4.90848 8.61542 4.85982C8.73728 4.81117 8.86798 4.78612 9 4.78612C9.13201 4.78612 9.26271 4.81117 9.38457 4.85982C9.50643 4.90848 9.61703 4.97977 9.71 5.06959L14.71 9.86126C14.8037 9.95035 14.8781 10.0563 14.9289 10.1731C14.9797 10.2899 15.0058 10.4152 15.0058 10.5417C15.0058 10.6682 14.9797 10.7934 14.9289 10.9102C14.8781 11.027 14.8037 11.133 14.71 11.2221L9.71 16.0138C9.61676 16.1031 9.50607 16.174 9.38425 16.2223C9.26242 16.2707 9.13185 16.2956 9 16.2956C8.86814 16.2956 8.73757 16.2707 8.61575 16.2223C8.49392 16.174 8.38323 16.1031 8.29 16.0138C8.19676 15.9244 8.1228 15.8183 8.07234 15.7016C8.02188 15.5848 7.9959 15.4597 7.9959 15.3333C7.9959 15.207 8.02188 15.0818 8.07234 14.9651C8.1228 14.8484 8.19676 14.7423 8.29 14.6529L12.59 10.5417L8.29 6.43043Z" fill="white"/>
</svg>
<svg width="38" height="37" viewBox="0 0 38 37" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_470_3095)">
<path d="M28.3213 21.5165C26.7918 21.5171 25.2967 21.9712 24.0252 22.8214C22.7537 23.6715 21.7629 24.8797 21.178 26.2929C20.593 27.7062 20.4403 29.2612 20.739 30.7613C21.0378 32.2614 21.7746 33.6392 22.8564 34.7206C23.9381 35.8019 25.3162 36.5382 26.8164 36.8364C28.3166 37.1346 29.8715 36.9813 31.2846 36.3958C32.6977 35.8104 33.9054 34.819 34.7551 33.5472C35.6048 32.2754 36.0584 30.7802 36.0584 29.2507C36.0584 28.2348 35.8582 27.2288 35.4694 26.2903C35.0805 25.3517 34.5106 24.499 33.7921 23.7808C33.0736 23.0626 32.2206 22.4929 31.2819 22.1044C30.3433 21.7159 29.3372 21.5161 28.3213 21.5165ZM32.7356 27.97L28.0866 32.8516C27.9596 32.9852 27.8067 33.0916 27.6374 33.1643C27.468 33.2371 27.2856 33.2747 27.1013 33.2749H27.0948C26.9123 33.2748 26.7316 33.2381 26.5635 33.167C26.3954 33.0959 26.2432 32.9918 26.116 32.861L23.6499 30.3197C23.5223 30.1918 23.4215 30.0399 23.3531 29.8727C23.2848 29.7054 23.2503 29.5263 23.2518 29.3457C23.2532 29.165 23.2905 28.9865 23.3616 28.8204C23.4326 28.6543 23.5359 28.504 23.6655 28.3782C23.7951 28.2523 23.9485 28.1535 24.1166 28.0874C24.2847 28.0213 24.4643 27.9893 24.6449 27.9932C24.8255 27.9971 25.0035 28.0368 25.1686 28.1101C25.3338 28.1833 25.4827 28.2887 25.6067 28.42L27.0854 29.9434L30.7563 26.089C31.0092 25.8438 31.347 25.706 31.6991 25.7043C32.0512 25.7026 32.3904 25.8371 32.6455 26.0798C32.9007 26.3225 33.0521 26.6544 33.0681 27.0062C33.0841 27.358 32.9634 27.7023 32.7312 27.9671L32.7356 27.97ZM18.1579 29.2312C18.1579 27.4039 18.6504 25.6105 19.5837 24.0396C20.5171 22.4687 21.8566 21.1785 23.4614 20.3048C25.0662 19.431 26.8769 19.0061 28.7028 19.0747C30.5287 19.1432 32.3024 19.7028 33.8372 20.6945C33.8487 19.9411 33.8545 19.1378 33.8545 18.2703C33.8545 13.8127 33.7028 11.0295 33.403 8.14806C33.1986 6.18328 32.36 4.33407 30.9637 2.93561C30.0785 2.05256 29.0127 1.37146 27.8395 0.93905C27.7601 0.909433 27.6792 0.88054 27.5983 0.852368C26.9992 0.650921 26.3798 0.515993 25.7512 0.450021L25.6913 0.444243C23.2938 0.1972 22.9117 0 17.8553 0C12.7988 0 11.9811 0.1972 9.58367 0.447132L9.52371 0.452911C8.86393 0.522667 8.21437 0.668093 7.58783 0.886318V0.85309C6.02584 1.38408 4.64893 2.35195 3.62043 3.64189C2.59193 4.93183 1.95501 6.48971 1.78522 8.13072C1.484 11.0201 1.33159 13.8033 1.33159 18.2703C1.33159 22.7373 1.484 25.5226 1.78522 28.4106C1.99011 30.3813 2.8666 32.2216 4.26763 33.6226C5.66865 35.0236 7.50893 35.9001 9.47965 36.105L9.53961 36.1108C11.9371 36.3607 12.3221 36.5579 17.3778 36.5579C19.0522 36.5579 20.2621 36.5362 21.2178 36.498C20.2479 35.5527 19.4774 34.4226 18.9518 33.1745C18.4263 31.9263 18.1563 30.5855 18.1579 29.2312ZM14.4111 7.73416H26.4114C26.8676 7.73416 27.305 7.91536 27.6276 8.2379C27.9501 8.56045 28.1313 8.99791 28.1313 9.45406C28.1313 9.91021 27.9501 10.3477 27.6276 10.6702C27.305 10.9928 26.8676 11.174 26.4114 11.174H14.4111C13.955 11.174 13.5175 10.9928 13.1949 10.6702C12.8724 10.3477 12.6912 9.91021 12.6912 9.45406C12.6912 8.99791 12.8724 8.56045 13.1949 8.2379C13.5175 7.91536 13.955 7.73416 14.4111 7.73416ZM14.4111 18.5332C13.955 18.5332 13.5175 18.352 13.1949 18.0295C12.8724 17.7069 12.6912 17.2695 12.6912 16.8133C12.6912 16.3572 12.8724 15.9197 13.1949 15.5972C13.5175 15.2746 13.955 15.0934 14.4111 15.0934H18.7004C19.1565 15.0934 19.594 15.2746 19.9166 15.5972C20.2391 15.9197 20.4203 16.3572 20.4203 16.8133C20.4203 17.2695 20.2391 17.7069 19.9166 18.0295C19.594 18.352 19.1565 18.5332 18.7004 18.5332H14.4111ZM8.77681 11.174C8.32066 11.174 7.8832 10.9928 7.56065 10.6702C7.23811 10.3477 7.0569 9.91021 7.0569 9.45406C7.0569 8.99791 7.23811 8.56045 7.56065 8.2379C7.8832 7.91536 8.32066 7.73416 8.77681 7.73416C9.23295 7.73416 9.67042 7.91536 9.99296 8.2379C10.3155 8.56045 10.4967 8.99791 10.4967 9.45406C10.4967 9.91021 10.3155 10.3477 9.99296 10.6702C9.67042 10.9928 9.23295 11.174 8.77681 11.174ZM8.77681 18.5332C8.32066 18.5332 7.8832 18.352 7.56065 18.0295C7.23811 17.7069 7.0569 17.2695 7.0569 16.8133C7.0569 16.3572 7.23811 15.9197 7.56065 15.5972C7.8832 15.2746 8.32066 15.0934 8.77681 15.0934C9.23295 15.0934 9.67042 15.2746 9.99296 15.5972C10.3155 15.9197 10.4967 16.3572 10.4967 16.8133C10.4967 17.2695 10.3155 17.7069 9.99296 18.0295C9.67042 18.352 9.23295 18.5332 8.77681 18.5332Z" fill="url(#paint0_linear_470_3095)"/>
</g>
<defs>
<linearGradient id="paint0_linear_470_3095" x1="11.1829" y1="36.9848" x2="29.4349" y2="1.66797" gradientUnits="userSpaceOnUse">
<stop stop-color="#498D1E"/>
<stop offset="1" stop-color="#73A031"/>
</linearGradient>
<clipPath id="clip0_470_3095">
<rect width="36.9841" height="36.9841" fill="white" transform="translate(0.202927)"/>
</clipPath>
</defs>
</svg>
<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_470_3097)">
<path d="M33.8664 7.17596C33.2298 4.3017 30.4435 1.66873 27.5613 1.10948C25.8055 0.758456 20.9064 0.324805 17.6673 0.358519C14.4281 0.322822 9.52904 0.755151 7.77328 1.10749C4.89108 1.66873 2.10474 4.3017 1.47145 7.17596C1.10523 8.92115 0.749582 11.2957 0.744293 14.5368C0.749582 17.776 1.10523 20.1511 1.47145 21.897C2.10805 24.7712 4.89439 27.4042 7.77658 27.9635C8.72453 28.1525 10.5887 28.3667 12.6135 28.5174C12.8427 28.8775 13.0915 29.2609 13.3598 29.6677C14.4347 31.2952 15.2564 32.4289 15.8791 33.2188C16.9156 34.533 18.4248 34.533 19.4614 33.2188C20.0841 32.4289 20.9058 31.2952 21.9806 29.6677C22.249 29.2613 22.4978 28.8779 22.727 28.5174C24.7518 28.3667 26.6166 28.1525 27.5646 27.9635C30.4468 27.4042 33.2331 24.7712 33.8697 21.897C34.2319 20.1511 34.5883 17.7773 34.5935 14.5368C34.585 11.295 34.2286 8.92181 33.8664 7.17596ZM15.7925 6.64712C15.7927 6.15002 15.9903 5.67334 16.3419 5.3219C16.6934 4.97046 17.1702 4.77303 17.6673 4.77303C18.1645 4.77303 18.6413 4.97055 18.9929 5.32214C19.3445 5.67372 19.542 6.15057 19.542 6.64778V17.1632C19.542 17.6604 19.3445 18.1372 18.9929 18.4888C18.6413 18.8404 18.1645 19.0379 17.6673 19.0379C17.1701 19.0379 16.6932 18.8404 16.3416 18.4888C15.99 18.1372 15.7925 17.6604 15.7925 17.1632V6.64712ZM19.5367 24.1445C19.4927 24.3504 19.3901 24.5391 19.2412 24.6879C19.0924 24.8368 18.9037 24.9394 18.6978 24.9834C18.0149 25.0892 17.3197 25.0892 16.6367 24.9834C16.4308 24.9395 16.242 24.837 16.0931 24.6881C15.9443 24.5392 15.8417 24.3505 15.7978 24.1445C15.6929 23.4617 15.6929 22.7669 15.7978 22.084C15.8421 21.8786 15.9448 21.6903 16.0937 21.542C16.2425 21.3936 16.4311 21.2914 16.6367 21.2478C17.3197 21.142 18.0149 21.142 18.6978 21.2478C18.9038 21.2916 19.0926 21.3942 19.2415 21.543C19.3904 21.6919 19.4929 21.8808 19.5367 22.0867C19.6416 22.7695 19.6416 23.4644 19.5367 24.1472V24.1445Z" fill="url(#paint0_linear_470_3097)"/>
</g>
<defs>
<linearGradient id="paint0_linear_470_3097" x1="0.744293" y1="17.2815" x2="34.5902" y2="17.2815" gradientUnits="userSpaceOnUse">
<stop stop-color="#CC3232"/>
<stop offset="0.6" stop-color="#EF5A5A"/>
<stop offset="1" stop-color="#F47E67"/>
</linearGradient>
<clipPath id="clip0_470_3097">
<rect width="33.8459" height="33.8459" fill="white" transform="translate(0.744293 0.358398)"/>
</clipPath>
</defs>
</svg>
<svg width="35" height="36" viewBox="0 0 35 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_470_3100)">
<path d="M24.3719 18.1139C24.3713 18.8653 23.7539 19.4813 23.0039 19.482C22.2531 19.482 21.6364 18.8647 21.6358 18.1139C21.6364 17.3625 22.2538 16.7465 23.0039 16.7458C23.7546 16.7458 24.3713 17.3632 24.3719 18.1139ZM14.7417 23.3229C13.576 23.3242 12.6182 24.2814 12.6168 25.4477C12.6182 26.6141 13.576 27.5713 14.7417 27.5726C15.9073 27.5713 16.8652 26.6141 16.8665 25.4477C16.8652 24.2814 15.9073 23.3242 14.7417 23.3229ZM34.8977 18.1354C34.893 22.1324 34.5579 25.059 34.2006 27.2093C33.5746 30.7532 30.3558 33.9713 26.8125 34.5974C24.6615 34.9553 21.735 35.2898 17.7386 35.2945C13.7416 35.2898 10.815 34.9553 8.66471 34.5974C5.12148 33.9713 1.90201 30.7525 1.27661 27.2093C0.917329 25.059 0.582848 22.1324 0.578156 18.1354C0.580166 16.1117 0.667306 14.3629 0.799356 12.85C6.16447 12.2139 11.7917 11.9009 17.9591 11.8942C23.957 11.9009 29.4368 12.1965 34.6718 12.7977C34.8066 14.3227 34.8957 16.0883 34.8977 18.1354ZM21.1149 25.4477C21.1149 25.0817 21.0767 24.7164 21.0003 24.3551C20.9366 24.0367 20.6672 23.7854 20.336 23.7324C19.4251 23.5896 18.7843 22.7464 18.8862 21.8529C18.9003 21.7309 18.9277 21.6116 18.968 21.4976C19.0732 21.194 18.9653 20.8441 18.7045 20.6242C18.1428 20.1436 17.5174 19.7575 16.8552 19.4914C16.5461 19.3654 16.205 19.4579 16.0045 19.72C15.471 20.4325 14.4441 20.5579 13.7496 20.0015C13.6477 19.9197 13.5566 19.8252 13.4775 19.72C13.2771 19.4579 12.9366 19.3661 12.6269 19.4914C12.0156 19.7367 11.4344 20.0853 10.9062 20.515C10.6327 20.7375 10.5188 21.1008 10.63 21.4145C10.9404 22.2383 10.5214 23.2035 9.66949 23.5555C9.51733 23.6185 9.35713 23.66 9.19425 23.6775C8.85105 23.7204 8.56617 23.9737 8.49579 24.3015C8.41066 24.6796 8.36709 25.063 8.36709 25.4471C8.36709 25.7688 8.39591 26.0899 8.45423 26.4083C8.51456 26.7461 8.80346 27.0115 9.15671 27.0551C10.0683 27.1516 10.746 27.9573 10.6877 28.8535C10.6763 29.0359 10.6341 29.2128 10.5637 29.3771C10.4289 29.6887 10.5335 30.0661 10.8117 30.296C11.3694 30.7679 11.9887 31.148 12.6436 31.4114C12.7274 31.4429 12.8146 31.461 12.9024 31.4644C13.1464 31.4697 13.3723 31.3498 13.5103 31.1453C13.7999 30.7022 14.2946 30.4395 14.8241 30.4402C15.3362 30.4402 15.8169 30.6848 16.1125 31.1011C16.3122 31.3819 16.6708 31.4805 16.9919 31.3404C17.5925 31.0776 18.1602 30.7177 18.6757 30.28C18.9411 30.0561 19.0477 29.6975 18.9351 29.3898C18.6147 28.5707 19.0229 27.6014 19.8709 27.2415C20.0143 27.1798 20.1658 27.1382 20.32 27.1175C20.6591 27.0652 20.9346 26.8084 20.997 26.4827C21.07 26.1408 21.1096 25.7943 21.1149 25.4477ZM27.1081 18.1139C27.1081 17.878 27.0833 17.6427 27.0344 17.4101C26.9935 17.205 26.8199 17.0435 26.6067 17.0093C26.0202 16.9174 25.6073 16.3745 25.673 15.7987C25.6817 15.7203 25.6998 15.6432 25.726 15.5701C25.7937 15.3744 25.724 15.1492 25.5564 15.0077C25.1944 14.6981 24.7916 14.4494 24.3652 14.2778C24.1662 14.1967 23.9463 14.2563 23.8176 14.4246C23.4744 14.8837 22.8121 14.9642 22.3657 14.6056C22.3 14.5526 22.241 14.4923 22.1908 14.4246C22.0614 14.2557 21.8422 14.1967 21.6431 14.2778C21.249 14.436 20.875 14.6598 20.5345 14.9367C20.3582 15.0801 20.2851 15.3141 20.3562 15.5158C20.5559 16.046 20.2864 16.6681 19.7375 16.8946C19.6396 16.9355 19.5364 16.9617 19.4311 16.9731C19.2099 17.0006 19.0269 17.1641 18.9814 17.3746C18.9264 17.6179 18.8989 17.8652 18.8989 18.1126C18.8989 18.3197 18.917 18.5268 18.9552 18.7313C18.9941 18.9491 19.1804 19.1201 19.4077 19.1475C19.9949 19.2099 20.4312 19.7287 20.3937 20.3058C20.3863 20.4231 20.3588 20.5371 20.3139 20.643C20.2275 20.8434 20.2945 21.0867 20.4741 21.2349C20.8334 21.5385 21.2322 21.7838 21.6539 21.9534C21.7075 21.9742 21.7638 21.9856 21.8208 21.9876C21.9776 21.991 22.1231 21.9139 22.2122 21.7818C22.3986 21.4963 22.7176 21.3274 23.0582 21.328C23.3879 21.328 23.6976 21.4856 23.888 21.7537C24.0167 21.9347 24.2479 21.9983 24.4544 21.9079C24.8412 21.7389 25.2071 21.5063 25.5389 21.2248C25.7099 21.0807 25.7789 20.8494 25.7059 20.6517C25.4994 20.1242 25.7622 19.5001 26.3085 19.2682C26.401 19.2286 26.4982 19.2018 26.598 19.1884C26.8165 19.1549 26.9935 18.9893 27.0337 18.7795C27.0806 18.559 27.1061 18.3365 27.1095 18.1126L27.1081 18.1139ZM1.00179 10.9376C1.08759 10.2546 1.18076 9.63056 1.27527 9.06147C1.90134 5.51757 5.12014 2.29877 8.66404 1.6727C10.8144 1.31476 13.7409 0.980278 17.7379 0.975586C21.735 0.980278 24.6615 1.31543 26.8119 1.6727C30.3558 2.29877 33.5739 5.51757 34.1999 9.0608C34.2925 9.61581 34.3829 10.2231 34.4667 10.886C29.288 10.3089 23.8712 10.0234 17.9585 10.0167C11.8768 10.0234 6.31194 10.3257 1.00112 10.937L1.00179 10.9376ZM13.9809 6.38896C13.9943 7.09211 14.5748 7.65115 15.2779 7.64444C19.2414 7.60221 23.2063 7.69137 27.1658 7.9119C27.8676 7.95077 28.4729 7.41788 28.5184 6.71607C28.5634 6.01426 28.0218 5.40831 27.3079 5.36809C23.2921 5.14421 19.2709 5.05372 15.2504 5.09662C14.5359 5.10399 13.9675 5.68514 13.9809 6.38829V6.38896ZM9.58101 6.52571C9.61118 7.22617 10.2037 7.76912 10.9035 7.74432C11.6033 7.71952 12.1557 7.13635 12.1369 6.43589C12.1181 5.73542 11.5256 5.18309 10.8144 5.20789C10.1025 5.23336 9.55018 5.82524 9.58101 6.52571ZM5.87021 6.72076C5.91512 7.42056 6.51839 7.95144 7.21819 7.9119C7.91732 7.87235 8.45825 7.27846 8.42474 6.57799C8.39189 5.87819 7.78795 5.33793 7.07676 5.37747C6.36556 5.41702 5.8253 6.02097 5.87021 6.72009V6.72076Z" fill="url(#paint0_linear_470_3100)"/>
</g>
<defs>
<linearGradient id="paint0_linear_470_3100" x1="0.578203" y1="18.1351" x2="34.8977" y2="18.1351" gradientUnits="userSpaceOnUse">
<stop stop-color="#ED6C14"/>
<stop offset="0.6" stop-color="#FF9045"/>
<stop offset="1" stop-color="#FFB54A"/>
</linearGradient>
<clipPath id="clip0_470_3100">
<rect width="34.3196" height="34.3196" fill="white" transform="translate(0.578156 0.975586)"/>
</clipPath>
</defs>
</svg>
<svg width="38" height="38" viewBox="0 0 38 38" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_470_3102)">
<path d="M18.0575 37.696C18.4686 37.8749 18.9382 37.8749 19.3493 37.696C24.2129 35.5782 34.1907 25.4771 34.1907 15.9193C34.1907 7.37072 27.2604 0.44043 18.7118 0.44043H18.6789C10.1296 0.44043 3.19934 7.37072 3.19934 15.9193C3.19934 25.4778 13.1924 35.579 18.0567 37.696H18.0575ZM11.198 15.7367C10.2143 15.82 9.64911 14.6223 10.3823 13.9351C12.5476 11.921 14.856 9.9829 17.3024 8.13677C18.1093 7.52554 19.2807 7.52554 20.0876 8.13677C22.534 9.9829 24.8417 11.921 27.0077 13.9351C27.7409 14.6223 27.1757 15.82 26.192 15.7367C26.089 15.728 25.9853 15.7199 25.8823 15.7119C25.748 17.1447 24.8826 21.4336 24.6657 22.1522C24.3013 23.3484 23.0723 24.4284 21.8396 24.6409C21.5591 24.6848 21.2437 24.7278 20.8858 24.7644C20.9742 23.9925 21.0092 20.5193 20.8902 20.2527C20.7799 19.7941 20.3323 19.3501 19.8715 19.2493C19.5903 19.1916 19.2113 19.1347 18.695 19.134C18.1787 19.1347 17.7997 19.1916 17.5185 19.2493C17.0577 19.3508 16.6101 19.7941 16.4998 20.2527C16.3815 20.5185 16.4158 23.9925 16.5042 24.7644C16.1471 24.7278 15.8309 24.6848 15.5504 24.6409C14.3177 24.4284 13.0887 23.3484 12.7243 22.1522C12.5074 21.4336 11.642 17.1447 11.5077 15.7119C11.404 15.7199 11.301 15.728 11.1973 15.7367H11.198Z" fill="url(#paint0_linear_470_3102)"/>
<path d="M18.0575 37.696C18.4686 37.8749 18.9382 37.8749 19.3493 37.696C24.2129 35.5782 34.1907 25.4771 34.1907 15.9193C34.1907 7.37072 27.2604 0.44043 18.7118 0.44043H18.6789C10.1296 0.44043 3.19934 7.37072 3.19934 15.9193C3.19934 25.4778 13.1924 35.579 18.0567 37.696H18.0575ZM11.198 15.7367C10.2143 15.82 9.64911 14.6223 10.3823 13.9351C12.5476 11.921 14.856 9.9829 17.3024 8.13677C18.1093 7.52554 19.2807 7.52554 20.0876 8.13677C22.534 9.9829 24.8417 11.921 27.0077 13.9351C27.7409 14.6223 27.1757 15.82 26.192 15.7367C26.089 15.728 25.9853 15.7199 25.8823 15.7119C25.748 17.1447 24.8826 21.4336 24.6657 22.1522C24.3013 23.3484 23.0723 24.4284 21.8396 24.6409C21.5591 24.6848 21.2437 24.7278 20.8858 24.7644C20.9742 23.9925 21.0092 20.5193 20.8902 20.2527C20.7799 19.7941 20.3323 19.3501 19.8715 19.2493C19.5903 19.1916 19.2113 19.1347 18.695 19.134C18.1787 19.1347 17.7997 19.1916 17.5185 19.2493C17.0577 19.3508 16.6101 19.7941 16.4998 20.2527C16.3815 20.5185 16.4158 23.9925 16.5042 24.7644C16.1471 24.7278 15.8309 24.6848 15.5504 24.6409C14.3177 24.4284 13.0887 23.3484 12.7243 22.1522C12.5074 21.4336 11.642 17.1447 11.5077 15.7119C11.404 15.7199 11.301 15.728 11.1973 15.7367H11.198Z" fill="url(#paint1_linear_470_3102)"/>
</g>
<defs>
<linearGradient id="paint0_linear_470_3102" x1="3.19934" y1="19.1354" x2="34.1907" y2="19.1354" gradientUnits="userSpaceOnUse">
<stop stop-color="#0CAA0C"/>
<stop offset="0.6" stop-color="#4BD14B"/>
<stop offset="1" stop-color="#60E260"/>
</linearGradient>
<linearGradient id="paint1_linear_470_3102" x1="3.19845" y1="19.1357" x2="34.1906" y2="19.1357" gradientUnits="userSpaceOnUse">
<stop stop-color="#0080DE"/>
<stop offset="0.6" stop-color="#49BCFF"/>
<stop offset="1" stop-color="#61CAFF"/>
</linearGradient>
<clipPath id="clip0_470_3102">
<rect width="37.39" height="37.39" fill="white" transform="translate(0 0.44043)"/>
</clipPath>
</defs>
</svg>
<svg width="33" height="42" viewBox="0 0 33 42" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M27.3878 5.02107C24.2856 1.86673 20.3543 -0.00892691 16.2096 3.19488e-05H16.0964C7.68483 0.1336 0.212324 7.98808 0.00219789 16.3638C-0.0300529 18.2115 0.292886 20.0482 0.953466 21.7741L0.964054 21.8018C1.00396 22.0722 4.41322 29.7109 15.0148 41.0715C15.0515 41.1222 15.0912 41.1706 15.1337 41.2165C15.2656 41.3637 15.4263 41.4823 15.6058 41.5649C15.7854 41.6475 15.98 41.6924 16.1775 41.6967C16.3751 41.7011 16.5715 41.6648 16.7545 41.5902C16.9375 41.5156 17.1033 41.4042 17.2415 41.2629C22.3643 36.1319 26.044 31.0286 28.1249 27.7831C30.4151 24.215 31.4038 21.9273 31.4445 21.8271C31.4519 21.8092 31.4592 21.7912 31.4657 21.7741C32.1202 20.0638 32.443 18.2445 32.417 16.4135C32.3624 12.2338 30.5112 8.21368 27.3878 5.02107Z" fill="url(#paint0_linear_464_3029)"/>
<path d="M16.2096 22.8502C12.6684 22.8453 9.78362 19.9735 9.80154 16.4576C9.81945 12.9416 12.7075 10.0178 16.2096 10.0129C19.7117 10.008 22.5932 12.9449 22.6176 16.4584C22.642 19.9719 19.7516 22.8453 16.2096 22.8502Z" fill="white"/>
<defs>
<linearGradient id="paint0_linear_464_3029" x1="8.43987" y1="-7.91282" x2="26.7642" y2="41.6971" gradientUnits="userSpaceOnUse">
<stop stop-color="#E5983F"/>
<stop offset="1" stop-color="#FF0A38"/>
</linearGradient>
</defs>
</svg>
<svg width="37" height="38" viewBox="0 0 37 38" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_482_3064)">
<path d="M18.3779 7.32686C15.754 5.42909 10.6585 3.16913 4.98638 3.16913C4.53978 3.16913 4.0898 3.18348 3.63646 3.21218C2.42239 3.2953 1.20616 4.45311 1.00743 5.71483C-0.122817 13.0771 -0.30238 20.5603 0.473389 27.9708C0.597686 29.1316 1.65276 30.1974 2.83214 30.3621C8.23905 31.0865 13.7023 32.5709 16.7946 34.1733C17.0287 34.295 17.2499 34.4174 17.4558 34.5399C17.7755 34.7306 18.1386 34.8311 18.5084 34.8311C18.8781 34.8311 19.2412 34.7306 19.5609 34.5399C19.7676 34.4167 19.9882 34.2942 20.2229 34.1725C23.3108 32.5701 28.7618 31.0858 34.1701 30.3621C35.3495 30.1974 36.4046 29.1316 36.5289 27.9708C37.3039 20.5602 37.1236 13.077 35.9927 5.71483C35.7939 4.45311 34.5777 3.29901 33.3651 3.21589C32.9122 3.18669 32.4622 3.17234 32.0152 3.17284C26.3416 3.17284 21.2541 5.43354 18.6366 7.32909C18.5994 7.35826 18.5537 7.37388 18.5069 7.37347C18.4601 7.37307 18.4147 7.35667 18.3779 7.32686Z" fill="#0893B1"/>
<path d="M18.5087 7.37288C18.4614 7.37261 18.4155 7.35645 18.3779 7.32686C15.754 5.42909 10.6585 3.16913 4.98638 3.16913C4.53978 3.16913 4.0898 3.18348 3.63646 3.21218C2.42239 3.2953 1.20616 4.45311 1.00743 5.71483C-0.122817 13.0771 -0.30238 20.5603 0.473389 27.9708C0.597686 29.1316 1.65276 30.1974 2.83214 30.3621C8.23905 31.0865 13.7023 32.5709 16.7946 34.1733C17.0287 34.295 17.2499 34.4174 17.4558 34.5399C17.7754 34.7305 18.1384 34.8308 18.508 34.8308L18.5087 7.37288Z" fill="#68D0E6"/>
</g>
<defs>
<clipPath id="clip0_482_3064">
<rect width="37" height="38" fill="white"/>
</clipPath>
</defs>
</svg>
<svg width="4" height="18" viewBox="0 0 4 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1.89061 3.78122C2.93476 3.78122 3.78122 2.93476 3.78122 1.89061C3.78122 0.846455 2.93476 0 1.89061 0C0.846455 0 0 0.846455 0 1.89061C0 2.93476 0.846455 3.78122 1.89061 3.78122Z" fill="#2D2D2D"/>
<path d="M1.89061 10.5625C2.93476 10.5625 3.78122 9.71601 3.78122 8.67186C3.78122 7.6277 2.93476 6.78125 1.89061 6.78125C0.846455 6.78125 0 7.6277 0 8.67186C0 9.71601 0.846455 10.5625 1.89061 10.5625Z" fill="#2D2D2D"/>
<path d="M1.89061 17.3437C2.93476 17.3437 3.78122 16.4973 3.78122 15.4531C3.78122 14.409 2.93476 13.5625 1.89061 13.5625C0.846455 13.5625 0 14.409 0 15.4531C0 16.4973 0.846455 17.3437 1.89061 17.3437Z" fill="#2D2D2D"/>
</svg>
......@@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Gen ERP</string>
<string>GEN ERP</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
......
......@@ -35,6 +35,7 @@ class Visitlist {
String? mobileNo;
String? followupId;
String? companyName;
String? contactName;
String? productName;
String? complaintCategory;
String? visitDatetime;
......@@ -47,6 +48,7 @@ class Visitlist {
this.mobileNo,
this.followupId,
this.companyName,
this.contactName,
this.productName,
this.complaintCategory,
this.visitDatetime});
......@@ -59,6 +61,7 @@ class Visitlist {
mobileNo = json['mobile_no'];
followupId = json['followup_id'];
companyName = json['company_name'];
contactName = json['contact_name'];
productName = json['product_name'];
complaintCategory = json['complaint_category'];
visitDatetime = json['visit_datetime'];
......@@ -73,6 +76,7 @@ class Visitlist {
data['mobile_no'] = this.mobileNo;
data['followup_id'] = this.followupId;
data['company_name'] = this.companyName;
data['contact_name'] = this.contactName;
data['product_name'] = this.productName;
data['complaint_category'] = this.complaintCategory;
data['visit_datetime'] = this.visitDatetime;
......
......@@ -202,6 +202,8 @@ class AttendanceNotifier extends ChangeNotifier {
: 0;
_penalityArrayList.add({dateKey: penalty});
}
print(_dateArrayList);
print(_penalityArrayList);
_isLoading = false;
notifyListeners();
......
......@@ -11,6 +11,7 @@ import 'package:image_picker/image_picker.dart';
import 'package:location/location.dart' as Location;
import 'package:provider/provider.dart';
import '../Utils/BackgroundLocationService.dart';
import '../Utils/SharedpreferencesService.dart';
import '../Utils/background_service.dart';
import '../Utils/commonServices.dart';
......@@ -190,10 +191,10 @@ class CheckInOutProvider with ChangeNotifier {
if (data != null) {
if (data.error == 0) {
toast(context, "CheckedIn Successfully");
await BackgroundLocation.startLocationService();
await BackgroundLocationService.startLocationService(context);
Navigator.pop(context, true);
} else {
toast(context, "CheckedIn UnSuccessfull");
toast(context, "Check-In UnSuccessful");
print(data.error.toString());
}
} else {
......@@ -224,19 +225,19 @@ class CheckInOutProvider with ChangeNotifier {
);
if (data != null) {
if (data.error == 0) {
toast(context, "CheckedIn Successfully");
await BackgroundLocation.startLocationService();
toast(context, "Checked Out Successfully");
await BackgroundLocationService.stopLocationService();
Navigator.pop(context, true);
} else {
toast(context, "CheckedIn UnSuccessfull");
toast(context, "Check-Out UnSuccessful");
print(data.error.toString());
}
} else {
toast(context, "Something went wrong, Please try again.");
}
} catch (e) {
print("Error during check-in: $e");
toast(context, "Error during check-in.");
print("Error during check-out: $e");
toast(context, "Error during check-out.");
} finally {
isLoading = false;
notifyListeners();
......
......@@ -478,7 +478,8 @@ class Generatordetailsprovider extends ChangeNotifier {
);
}
} else if (data.error == 1) {
}
else if (data.error == 1) {
toast(context, "Enter Correct ID");
} else {}
......@@ -594,7 +595,6 @@ class Generatordetailsprovider extends ChangeNotifier {
_complaintList = data.list!;
notifyListeners();
_isLoading = false;
print("littu");
} else {
_isLoading = true;
print("error");
......@@ -690,7 +690,6 @@ class Generatordetailsprovider extends ChangeNotifier {
}
notifyListeners();
_isLoading = false;
print("littu");
} else if (data.error == 1) {
toast(context, "Please Check Entered ID!!");
} else {
......@@ -740,7 +739,6 @@ class Generatordetailsprovider extends ChangeNotifier {
}
notifyListeners();
_isLoading = false;
print("littu");
} else if (data.error == 1) {
toast(context, "Please Check Entered ID!!");
}else if (data.error == 2) {
......
......@@ -5,6 +5,7 @@ import 'package:generp/screens/LoginScreen.dart';
import 'package:generp/services/api_calling.dart';
import 'package:intl/intl.dart';
import '../Utils/BackgroundLocationService.dart';
import '../Utils/WebSocketManager.dart';
import '../Utils/background_service.dart';
......@@ -94,7 +95,7 @@ class HomescreenNotifier extends ChangeNotifier {
// checkOptimisation(),
if (_att_status == 0) {
webSocketManager.close();
await BackgroundLocation.stopLocationService();
await BackgroundLocationService.stopLocationService();
_onlineStatus = "Offline";
......@@ -133,12 +134,12 @@ class HomescreenNotifier extends ChangeNotifier {
} else {
// print("Status knlknn offine");
}
await BackgroundLocation.startLocationService();
await BackgroundLocationService.startLocationService(context);
// print("setstatus:$setstatus");
} else if (_att_status == 2) {
// print("att_status:$att_status");
webSocketManager.close();
await BackgroundLocation.stopLocationService();
await BackgroundLocationService.stopLocationService();
_onlineStatus = "Offline";
......
......@@ -2,17 +2,23 @@ import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
import 'package:generp/Utils/SharedpreferencesService.dart';
import 'package:generp/Utils/commonServices.dart';
import 'package:generp/screens/LoginScreen.dart';
import 'package:generp/screens/inventory/GeneratorPartDetailsScreen.dart';
import 'package:generp/services/api_calling.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:qr_code_scanner/qr_code_scanner.dart';
import '../Models/Inventory_Part_details_response.dart';
import '../Models/generatorComplaintResponse.dart';
import '../screens/genTracker/ComplaintHistory.dart';
import '../screens/splash.dart';
class InventoryProvider extends ChangeNotifier {
PermissionStatus _cameraPermissionStatus = PermissionStatus.denied;
final GlobalKey scannerKey = GlobalKey(debugLabel: 'QR');
PartData _partData = PartData();
List<C_List> _complaintList = [];
bool _isLoading = false;
bool _hasPermission = false;
QRViewController? _qrViewController;
String? _partID = "";
......@@ -34,6 +40,7 @@ class InventoryProvider extends ChangeNotifier {
String? get partID => _partID;
PartData get partData => _partData;
List<C_List>get complaintList => _complaintList;
bool get hasPermission => _hasPermission;
......@@ -88,6 +95,13 @@ class InventoryProvider extends ChangeNotifier {
context,
MaterialPageRoute(builder: (context) => GeneratorPartDetailsScreen()),
);
}else if(from == "pendingComplaints"){
_partID = scanData.code;
notifyListeners();
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Complainthistory()),
);
}
});
}
......@@ -109,7 +123,6 @@ class InventoryProvider extends ChangeNotifier {
if (data.error == 0) {
_partData = data.partData!;
_partID = partId;
notifyListeners();
if (from == "inventory") {
this._qrViewController!.pauseCamera();
Navigator.push(
......@@ -120,7 +133,6 @@ class InventoryProvider extends ChangeNotifier {
);
}
notifyListeners();
} else if (data.error == 1) {
toast(context, "Enter Correct ID");
} else {}
......@@ -131,6 +143,55 @@ class InventoryProvider extends ChangeNotifier {
print(e.toString());
}
}
Future<void> LoadgeneratorComplaintHistoryApifunction(
homeProvider,
BuildContext context,
from,
genID,
) async {
try {
final data = await ApiCalling.LoadGeneratorComplaintListAPI(
homeProvider.empId,
homeProvider.session,
genID,
"Open",
);
if (data != null) {
if (data.sessionExists == 1) {
if (data.error == 0) {
_complaintList = data.list!;
_isLoading = false;
this._qrViewController!.pauseCamera();
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Complainthistory()),
);
notifyListeners();
} else {
_isLoading = true;
print("error");
}
} else {
_isLoading = true;
SharedpreferencesService().clearPreferences();
toast(context, "Your Session expired, Please Login Again!");
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Splash()),
);
}
} else {
_isLoading = true;
toast(context, "Something Went Wrong, Please try again!");
print("error2");
}
} on Error catch (e) {
print(e.toString());
}
}
void updateQuantity(String issueQuantity) {
_quantity = issueQuantity;
_quantityError = '';
......
......@@ -5,6 +5,8 @@ import 'package:generp/Utils/SharedpreferencesService.dart';
import 'package:generp/screens/LoginScreen.dart';
import 'package:generp/services/api_calling.dart';
import '../Utils/BackgroundLocationService.dart';
class LogoutNotifier extends ChangeNotifier{
......@@ -20,6 +22,7 @@ class LogoutNotifier extends ChangeNotifier{
if (data.error == 0) {
_isLoading = false;
await BackgroundLocationService.stopLocationService();
SharedpreferencesService().clearPreferences();
Navigator.push(context,
MaterialPageRoute(builder: (context) => LoginScreen()));
......
......@@ -226,6 +226,7 @@ set markers(List<Marker> value){
infoWindow: InfoWindow(
title: "Customer Name: ${generator.accName}",
snippet: "Product Name: ${generator.productName}",
),
onTap: () {
int index = generatorslist.indexWhere(
......
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:generp/Notifiers/HomeScreenNotifier.dart';
import 'package:generp/Utils/SharedpreferencesService.dart';
import 'package:generp/screens/HomeScreen.dart';
import 'package:generp/services/api_calling.dart';
import 'package:generp/screens/LoginScreen.dart';
import 'package:provider/provider.dart';
import '../Utils/commonServices.dart';
class UpdatePasswordProvider with ChangeNotifier {
TextEditingController password = TextEditingController();
......@@ -22,10 +26,16 @@ class UpdatePasswordProvider with ChangeNotifier {
final confPass = confPassword.text.trim();
if (pass.isEmpty || pass.length < 8) {
passwordError = pass.isEmpty ? "Enter Password" : "Password must be at least 8 characters";
passwordError =
pass.isEmpty
? "Enter Password"
: "Password must be at least 8 characters";
}
if (confPass.isEmpty || confPass.length < 8) {
confirmPasswordError = confPass.isEmpty ? "Enter Confirm Password" : "Confirm Password must be at least 8 characters";
confirmPasswordError =
confPass.isEmpty
? "Enter Confirm Password"
: "Confirm Password must be at least 8 characters";
}
if (pass != confPass) {
confirmPasswordError = "Passwords do not match";
......@@ -40,7 +50,16 @@ class UpdatePasswordProvider with ChangeNotifier {
notifyListeners();
try {
final data = await ApiCalling.UpdatePasswordApi(empId, session, pass, confPass);
var homeProvider = Provider.of<HomescreenNotifier>(
context,
listen: false,
);
final data = await ApiCalling.UpdatePasswordApi(
homeProvider.empId,
homeProvider.session,
pass,
confPass,
);
if (data != null) {
if (data.sessionExists == 1) {
if (data.error == 0) {
......@@ -55,7 +74,9 @@ class UpdatePasswordProvider with ChangeNotifier {
} else {
SharedpreferencesService().clearPreferences();
Navigator.push(
context, MaterialPageRoute(builder: (context) => LoginScreen()));
context,
MaterialPageRoute(builder: (context) => LoginScreen()),
);
}
}
} catch (e) {
......
......@@ -40,10 +40,11 @@ class SplashVersionNotifier extends ChangeNotifier {
if (data != null) {
final int currentBuild =
int.tryParse(_packagedetails["Build Number"] ?? "0") ?? 0;
int.parse(_packagedetails["Build Number"] ?? "0") ?? 0;
print(currentBuild);
if (Platform.isAndroid &&
currentBuild < (data.latestVersionCode ?? 0)) {
print("Update");
AppUpdateDialouge(context, data.url!, data.releaseNotes!);
} else if (Platform.isIOS &&
......
import 'dart:async';
import 'dart:convert';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:intl/intl.dart';
import 'WebSocketManager.dart';
import 'SharedpreferencesService.dart';
class BackgroundLocationService {
static bool? _lastNetworkStatus; // Track last network status
static DateTime? _lastNotificationTime; // Track last notification time
static const Duration _notificationDebounceDuration = Duration(seconds: 30);
static const String customChannelId = 'GEN ERP flutter';
static const String customChannelName = 'GEN ERP flutter';
static const String customChannelDescription = 'GEN ERP flutter';
static const int notificationId = 0;
static Timer? _locationTimer;
static final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
FlutterLocalNotificationsPlugin();
static StreamSubscription<Position>? _positionStream;
WebSocketManager webSocketManager = WebSocketManager(
onConnectSuccess: () {},
onMessage: (message) {},
onClose: () {},
onConnectFailed: () {},
);
String? empId;
String? sessionId;
static Future<void> init() async {
try {
const InitializationSettings initializationSettings =
InitializationSettings(
android: AndroidInitializationSettings('@mipmap/ic_launcher'),
iOS: DarwinInitializationSettings(
requestAlertPermission: false,
requestBadgePermission: false,
requestSoundPermission: false,
),
);
await flutterLocalNotificationsPlugin.initialize(initializationSettings);
const AndroidNotificationChannel androidChannel = AndroidNotificationChannel(
customChannelId,
customChannelName,
description: customChannelDescription,
importance: Importance.max,
playSound: false,
);
await flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>()
?.createNotificationChannel(androidChannel);
} catch (e) {
print("Error initializing notifications: $e");
}
}
static Future<void> checkAndRequestLocationPermissions(BuildContext context) async {
try {
bool serviceEnabled = await Geolocator.isLocationServiceEnabled();
if (!serviceEnabled) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text("Please enable GPS")),
);
await Geolocator.openLocationSettings();
return;
}
LocationPermission permission = await Geolocator.checkPermission();
if (permission == LocationPermission.denied) {
permission = await Geolocator.requestPermission();
if (permission == LocationPermission.denied) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text("Location permission denied")),
);
return;
}
}
if (permission == LocationPermission.deniedForever) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text("Location permission permanently denied")),
);
await Geolocator.openAppSettings();
return;
}
} catch (e) {
print("Error requesting location permissions: $e");
}
}
static Future<void> showNotification(String title, String message) async {
const AndroidNotificationDetails androidPlatformChannelSpecifics =
AndroidNotificationDetails(
customChannelId,
customChannelName,
importance: Importance.defaultImportance,
ticker: 'ticker',
ongoing: true,
playSound: false,
);
const DarwinNotificationDetails darwinNotificationDetails =
DarwinNotificationDetails(presentSound: false);
const NotificationDetails platformChannelSpecifics = NotificationDetails(
android: androidPlatformChannelSpecifics,
iOS: darwinNotificationDetails,
);
final pendingNotifications =
await flutterLocalNotificationsPlugin.pendingNotificationRequests();
final notificationAlreadyExists =
pendingNotifications.any((notification) => notification.id == notificationId);
await flutterLocalNotificationsPlugin.show(
notificationId,
title,
message,
platformChannelSpecifics,
);
}
static Future<void> hideNotification() async {
await flutterLocalNotificationsPlugin.cancel(notificationId);
}
void initWebSocket() {
Future.delayed(Duration.zero, () {
webSocketManager.connect();
});
}
static Future<bool> checkGpsStatus() async {
return await Geolocator.isLocationServiceEnabled();
}
static Future<bool> checkNetworkStatus() async {
var connectivityResult = await Connectivity().checkConnectivity();
return connectivityResult != ConnectivityResult.none;
}
static Future<void> startLocationService(BuildContext context) async {
await init();
bool isGpsEnabled = await checkGpsStatus();
bool isNetworkAvailable = await checkNetworkStatus();
if (isGpsEnabled && isNetworkAvailable) {
await checkAndRequestLocationPermissions(context);
showNotification("GEN ERP", "You're Online!");
_positionStream?.cancel(); // Cancel any existing stream
_positionStream = Geolocator.getPositionStream(
locationSettings: LocationSettings(
accuracy: LocationAccuracy.high,
distanceFilter: 50,
),
).listen((Position position) async {
final location = Location(
latitude: position.latitude,
longitude: position.longitude,
altitude: position.altitude,
accuracy: position.accuracy,
bearing: position.heading,
speed: position.speed,
time: position.timestamp.millisecondsSinceEpoch.toDouble(),
isMock: position.isMocked,
);
await handleLocationUpdate(location, context);
}, onError: (e) {
print("Location stream error: $e");
showNotification("GEN ERP", "Location error: $e");
});
} else {
if (!isGpsEnabled) {
showNotification("GEN ERP", "You're Offline! Check your GPS connection.");
await checkAndRequestLocationPermissions(context);
}
if (!isNetworkAvailable) {
showNotification("GEN ERP", "You're Offline! Check your network connection.");
}
}
_locationTimer?.cancel();
_locationTimer = Timer.periodic(Duration(seconds: 30), (timer) async {
if (await checkGpsStatus() && await checkNetworkStatus()) {
final position = await Geolocator.getCurrentPosition(
desiredAccuracy: LocationAccuracy.high,
);
final location = Location(
latitude: position.latitude,
longitude: position.longitude,
altitude: position.altitude,
accuracy: position.accuracy,
bearing: position.heading,
speed: position.speed,
time: position.timestamp.millisecondsSinceEpoch.toDouble(),
isMock: position.isMocked,
);
await handleLocationUpdate(location, context);
}
});
}
static Future<void> stopLocationService() async {
print("Background location service stopped");
await hideNotification();
_locationTimer?.cancel();
_positionStream?.cancel();
}
static Future<bool> isServiceRunning() async {
return _positionStream != null && _positionStream!.isPaused == false;
}
Future<Location> getCurrentLocation(BuildContext context) async {
empId = await SharedpreferencesService().getString("UserId");
sessionId = await SharedpreferencesService().getString("Session_id");
saveLastLocationTime();
try {
final position = await Geolocator.getCurrentPosition(
desiredAccuracy: LocationAccuracy.high,
);
return Location(
latitude: position.latitude,
longitude: position.longitude,
altitude: position.altitude,
accuracy: position.accuracy,
bearing: position.heading,
speed: position.speed,
time: position.timestamp.millisecondsSinceEpoch.toDouble(),
isMock: position.isMocked,
);
} catch (e) {
print("Error getting current location: $e");
showNotification("GEN ERP", "Error getting location: $e");
rethrow;
}
}
static Future<void> handleLocationUpdate(Location location, BuildContext context) async {
final empId = await SharedpreferencesService().getString("UserId");
final sessionId = await SharedpreferencesService().getString("Session_id");
final webSocketManager = WebSocketManager(
onConnectSuccess: () {},
onMessage: (message) {},
onClose: () {},
onConnectFailed: () {},
);
bool isNetworkAvailable = await webSocketManager.isNetworkAvailable();
DateTime now = DateTime.now();
// Check if enough time has passed since the last notification (debouncing)
if (_lastNotificationTime != null &&
now.difference(_lastNotificationTime!).inSeconds < _notificationDebounceDuration.inSeconds) {
return; // Skip notification if within debounce duration
}
if (_lastNetworkStatus != isNetworkAvailable) {
if (isNetworkAvailable) {
webSocketManager.sendMessage(jsonEncode({
"command": "server_request",
"route": "attendenece_live_location_update",
"session_id": sessionId,
"ref_data": {
"session_id": sessionId,
"location": "${location.latitude},${location.longitude}",
"speed": location.speed,
"altitude": location.altitude,
"direction": location.bearing,
"direction_accuracy": 0.0,
// Geolocator doesn't provide this directly
"altitude_accuracy": 0.0,
// Geolocator doesn't provide this directly
"speed_accuracy": 0.0,
// Geolocator doesn't provide this directly
"location_accuracy": location.accuracy,
"location_provider": "",
}
}));
showNotification("GEN ERP", "You're Online!");
}else {
showNotification("GEN ERP", "You're Offline!");
}
_lastNetworkStatus = isNetworkAvailable;
_lastNotificationTime = now;
}
saveLastLocationTime();
}
}
class Location {
double? latitude;
double? longitude;
double? altitude;
double? bearing;
double? accuracy;
double? speed;
double? time;
bool? isMock;
Location({
required this.latitude,
required this.longitude,
required this.altitude,
required this.accuracy,
required this.bearing,
required this.speed,
required this.time,
required this.isMock,
});
Map<String, dynamic> toMap() {
return {
'latitude': latitude,
'longitude': longitude,
'altitude': altitude,
'bearing': bearing,
'accuracy': accuracy,
'speed': speed,
'time': time,
'is_mock': isMock,
};
}
}
void saveLastLocationTime() {
var currentTime = DateTime.now();
var formatter = DateFormat('HH:mm:ss').format(currentTime);
SharedpreferencesService().saveString("lastLocationTime", formatter);
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment