changing ac bloc

This commit is contained in:
ashrafzarkanisala
2024-08-26 00:48:29 +03:00
parent d7e3c1e1d0
commit d94ec25003
23 changed files with 780 additions and 185 deletions

View File

@ -0,0 +1,67 @@
<svg width="30" height="24" viewBox="0 0 30 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21.6601 1.402C19.7907 -0.467333 16.7603 -0.467333 14.891 1.402C13.3957 2.89727 13.3957 5.32225 14.891 6.81752C15.4891 7.41563 16.2729 7.71469 17.0578 7.71469C17.8144 7.71469 18.572 7.43557 19.1617 6.8784C18.2163 7.79133 16.9933 8.24727 15.7719 8.24721C14.5221 8.24721 13.2729 7.77028 12.3202 6.81752C12.2675 6.76482 12.2142 6.7127 12.1605 6.66129C9.36573 3.98714 4.92501 4.09102 2.18993 6.82611L0.720124 8.29592C-0.240041 9.25608 -0.240041 10.8128 0.720124 11.7729C1.68029 12.733 3.23698 12.733 4.19708 11.7729L4.77172 11.1983C6.49053 9.47949 9.09344 8.96279 11.3158 9.94754C11.3523 9.96372 11.3879 9.9799 11.4226 9.99619C14.5234 11.4478 18.2567 13.2673 21.6602 9.86372C23.8186 7.7051 23.9969 3.73879 21.6601 1.402Z" fill="url(#paint0_linear_1460_2572)"/>
<path d="M15.2717 2.86558C14.8076 3.32963 14.4588 3.99863 14.2948 4.69838C14.1176 5.45478 14.3351 6.25807 14.8827 6.80906C14.8856 6.81189 14.8883 6.81471 14.8912 6.81747C15.4893 7.41559 16.2731 7.71464 17.058 7.71464C17.6598 7.71464 18.2618 7.53741 18.7799 7.18482C18.9417 7.07271 19.0911 6.94983 19.2236 6.81742C20.3149 5.72613 20.3149 3.95686 19.2236 2.86558C18.1323 1.7743 16.363 1.7743 15.2717 2.86558Z" fill="url(#paint1_linear_1460_2572)"/>
<path d="M14.7018 6.61255C14.7623 6.68243 14.8247 6.75125 14.891 6.81766C15.4891 7.41577 16.2729 7.71483 17.0579 7.71483C17.8145 7.71483 18.572 7.43572 19.1618 6.87855C18.2163 7.79148 16.9934 8.24741 15.7719 8.24735C14.5222 8.24735 13.273 7.77042 12.3202 6.81766C12.2675 6.76496 12.2142 6.71284 12.1605 6.66143C12.1429 6.64461 12.1245 6.6292 12.1068 6.61261H2.4144C2.33858 6.68225 2.26334 6.75284 2.18993 6.82625L0.720124 8.29606C-0.240041 9.25622 -0.240041 10.8129 0.720124 11.773C1.68023 12.7332 3.23698 12.7332 4.19708 11.773L4.77172 11.1984C6.49053 9.47963 9.09344 8.96293 11.3158 9.94769C11.3523 9.96386 11.3879 9.98004 11.4226 9.99633C14.5234 11.448 18.2567 13.2674 21.6602 9.86386C22.5267 8.99734 23.0732 7.83936 23.2669 6.61261H14.7018V6.61255Z" fill="url(#paint2_linear_1460_2572)"/>
<path d="M28.3142 6.49672C26.4448 4.62739 23.4144 4.62739 21.5451 6.49672C20.0498 7.992 20.0498 10.417 21.5451 11.9122C22.1432 12.5104 22.927 12.8094 23.7119 12.8094C24.4685 12.8094 25.2261 12.5303 25.8158 11.9731C24.8703 12.8861 23.6474 13.3419 22.426 13.3419C21.1763 13.3419 19.927 12.865 18.9743 11.9122C18.9216 11.8595 18.8683 11.8074 18.8145 11.756C16.0198 9.08187 11.5791 9.18575 8.84399 11.9208L7.37419 13.3906C6.41402 14.3507 11.4258 16.293 11.4258 16.293C13.1446 14.5742 15.7475 14.0575 17.9699 15.0423C18.0064 15.0584 18.042 15.0746 18.0767 15.0909C21.1774 16.5425 24.9107 18.362 28.3142 14.9584C30.4727 12.7999 30.651 8.83358 28.3142 6.49672Z" fill="url(#paint3_linear_1460_2572)"/>
<path d="M21.926 7.96031C21.4619 8.42436 21.1131 9.09335 20.9491 9.79311C20.7719 10.5495 20.9894 11.3528 21.537 11.9038C21.5399 11.9066 21.5426 11.9094 21.5454 11.9122C22.1436 12.5103 22.9274 12.8094 23.7123 12.8094C24.3141 12.8094 24.9161 12.6321 25.4342 12.2795C25.596 12.1674 25.7454 12.0446 25.8779 11.9121C26.9691 10.8209 26.9691 9.05159 25.8779 7.96031C24.7866 6.86903 23.0173 6.86903 21.926 7.96031Z" fill="url(#paint4_linear_1460_2572)"/>
<path d="M21.3558 11.7073C21.4163 11.7772 21.4787 11.846 21.5451 11.9123C22.1432 12.5104 22.927 12.8095 23.7119 12.8095C24.4685 12.8095 25.2261 12.5304 25.8158 11.9732C24.8703 12.8861 23.6474 13.342 22.426 13.342C21.1763 13.342 19.927 12.8651 18.9743 11.9123C18.9216 11.8596 18.8683 11.8075 18.8145 11.7561C18.7969 11.7393 18.7785 11.7239 18.7608 11.7073H9.06846C8.99264 11.7769 8.9174 11.8475 8.84399 11.9209L7.37419 13.3907C6.41402 14.3508 11.4258 16.2931 11.4258 16.2931C13.1446 14.5743 15.7475 14.0576 17.9699 15.0424C18.0064 15.0585 18.042 15.0747 18.0767 15.091C21.1774 16.5426 24.9107 18.3621 28.3142 14.9585C29.1807 14.092 29.7273 12.934 29.921 11.7073H21.3558Z" fill="url(#paint5_linear_1460_2572)"/>
<path d="M20.416 12.9095C19.8934 12.6735 19.4036 12.3417 18.9743 11.9124C18.9216 11.8597 18.8683 11.8076 18.8145 11.7561C16.0198 9.08199 11.5791 9.18588 8.84399 11.921L7.37419 13.3908C6.41402 14.3509 11.4258 16.2931 11.4258 16.2931C13.1446 14.5743 15.7475 14.0576 17.9699 15.0424C18.0064 15.0586 18.042 15.0747 18.0767 15.091C18.8242 15.441 19.6085 15.8121 20.416 16.1264V12.9095Z" fill="url(#paint6_linear_1460_2572)"/>
<path d="M15.8835 21.4979C14.4714 23.7323 11.5153 24.3989 9.28026 22.9869C7.49275 21.8565 6.9594 19.4912 8.08898 17.7038C8.54086 16.9889 9.24014 16.5247 10.0059 16.352C10.7435 16.1857 11.5438 16.2912 12.2418 16.7051C11.1188 16.022 9.82572 15.8465 8.63362 16.1154C7.41475 16.3902 6.30076 17.1305 5.58101 18.2694C5.54118 18.3324 5.50124 18.3946 5.45966 18.4565C4.90772 19.2887 4.20785 19.9646 3.41703 20.4737C2.12281 21.307 0.393364 20.5921 0.0547794 19.0906C-0.216159 17.8892 0.544715 16.7068 1.74558 16.4335C2.51481 16.2584 3.25409 15.9263 3.91309 15.4366C3.94514 15.4134 3.97626 15.3896 4.00667 15.366C6.71205 13.2675 9.95331 10.6716 14.0221 13.243C16.6026 14.8744 17.6494 18.7038 15.8835 21.4979Z" fill="url(#paint7_linear_1460_2572)"/>
<path d="M9.32933 21.4752C8.77457 21.1246 8.28711 20.5487 7.97329 19.9022C7.634 19.2033 7.66947 18.3718 8.08252 17.7138C8.08464 17.7105 8.08676 17.7071 8.08887 17.7038C8.54075 16.9887 9.23962 16.5246 10.0053 16.352C10.5923 16.2196 11.2185 16.26 11.8015 16.4901C11.984 16.5639 12.1568 16.6509 12.3151 16.7509C13.6197 17.5754 14.0089 19.3014 13.1844 20.606C12.3599 21.9106 10.6339 22.2997 9.32933 21.4752Z" fill="url(#paint8_linear_1460_2572)"/>
<path d="M8.07759 16.2771C7.08008 16.6298 6.19067 17.3065 5.58168 18.2691C5.54186 18.3321 5.50192 18.3943 5.46033 18.4562C4.9084 19.2884 4.20852 19.9643 3.41771 20.4734C2.12349 21.3066 0.394038 20.5918 0.0554538 19.0903C-0.0635448 18.5625 0.267804 18.0382 0.795621 17.9192L8.07759 16.2771Z" fill="url(#paint9_linear_1460_2572)"/>
<path d="M7.49707 19.78C7.50836 21.038 8.13742 22.2646 9.2797 22.9865C11.5144 24.3989 14.4706 23.7323 15.883 21.4975C16.6185 20.3338 16.8645 18.9906 16.7165 17.7012L7.49707 19.78Z" fill="url(#paint10_linear_1460_2572)"/>
<path d="M23.7639 18.805C22.659 18.805 21.609 18.676 20.6614 18.4439C20.0417 18.2922 19.6718 19.1202 20.2003 19.4774C21.1523 20.1209 22.399 20.5109 23.7639 20.5109C25.1287 20.5109 26.3755 20.1209 27.3274 19.4774C27.8559 19.1202 27.486 18.2922 26.8664 18.4439C25.9187 18.676 24.8688 18.805 23.7639 18.805Z" fill="url(#paint11_linear_1460_2572)"/>
<defs>
<linearGradient id="paint0_linear_1460_2572" x1="9.34184" y1="2.71181" x2="14.5357" y2="13.0995" gradientUnits="userSpaceOnUse">
<stop stop-color="#EAF6FF"/>
<stop offset="1" stop-color="#B3DAFE"/>
</linearGradient>
<linearGradient id="paint1_linear_1460_2572" x1="16.5841" y1="4.36833" x2="19.9609" y2="7.74511" gradientUnits="userSpaceOnUse">
<stop stop-color="#8FCBFE" stop-opacity="0"/>
<stop offset="1" stop-color="#8AC9FE"/>
</linearGradient>
<linearGradient id="paint2_linear_1460_2572" x1="11.6335" y1="8.61588" x2="11.6335" y2="11.7883" gradientUnits="userSpaceOnUse">
<stop stop-color="#8FCBFE" stop-opacity="0"/>
<stop offset="1" stop-color="#8AC9FE"/>
</linearGradient>
<linearGradient id="paint3_linear_1460_2572" x1="16.624" y1="7.4926" x2="21.8178" y2="17.8803" gradientUnits="userSpaceOnUse">
<stop stop-color="#EAF6FF"/>
<stop offset="1" stop-color="#B3DAFE"/>
</linearGradient>
<linearGradient id="paint4_linear_1460_2572" x1="23.2384" y1="9.46299" x2="26.6152" y2="12.8398" gradientUnits="userSpaceOnUse">
<stop stop-color="#8FCBFE" stop-opacity="0"/>
<stop offset="1" stop-color="#8AC9FE"/>
</linearGradient>
<linearGradient id="paint5_linear_1460_2572" x1="18.5865" y1="13.4753" x2="18.5865" y2="16.275" gradientUnits="userSpaceOnUse">
<stop stop-color="#8FCBFE" stop-opacity="0"/>
<stop offset="1" stop-color="#8AC9FE"/>
</linearGradient>
<linearGradient id="paint6_linear_1460_2572" x1="16.3196" y1="12.2584" x2="12.5549" y2="16.1407" gradientUnits="userSpaceOnUse">
<stop stop-color="#8AC9FE" stop-opacity="0"/>
<stop offset="0.1534" stop-color="#85C2F3" stop-opacity="0.153"/>
<stop offset="0.4248" stop-color="#78AED5" stop-opacity="0.425"/>
<stop offset="0.7796" stop-color="#628FA5" stop-opacity="0.78"/>
<stop offset="1" stop-color="#537983"/>
</linearGradient>
<linearGradient id="paint7_linear_1460_2572" x1="7.17699" y1="15.894" x2="11.0692" y2="22.5632" gradientUnits="userSpaceOnUse">
<stop stop-color="#EAF6FF"/>
<stop offset="1" stop-color="#B3DAFE"/>
</linearGradient>
<linearGradient id="paint8_linear_1460_2572" x1="9.48225" y1="19.9782" x2="12.3023" y2="17.9728" gradientUnits="userSpaceOnUse">
<stop stop-color="#8FCBFE" stop-opacity="0"/>
<stop offset="1" stop-color="#8AC9FE"/>
</linearGradient>
<linearGradient id="paint9_linear_1460_2572" x1="4.19491" y1="18.2548" x2="4.764" y2="20.7794" gradientUnits="userSpaceOnUse">
<stop stop-color="#8FCBFE" stop-opacity="0"/>
<stop offset="1" stop-color="#8AC9FE"/>
</linearGradient>
<linearGradient id="paint10_linear_1460_2572" x1="12.2442" y1="19.5337" x2="12.9596" y2="22.7074" gradientUnits="userSpaceOnUse">
<stop stop-color="#8FCBFE" stop-opacity="0"/>
<stop offset="1" stop-color="#8AC9FE"/>
</linearGradient>
<linearGradient id="paint11_linear_1460_2572" x1="23.7639" y1="18.3344" x2="23.7639" y2="20.514" gradientUnits="userSpaceOnUse">
<stop stop-color="#EAF6FF"/>
<stop offset="1" stop-color="#B3DAFE"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@ -0,0 +1,15 @@
<svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="30" cy="30" r="30" fill="white"/>
<path d="M45.54 19H15.46C14.1036 19 13 20.1036 13 21.46V32.3997C13 33.7562 14.1036 34.8597 15.46 34.8597H45.54C46.8964 34.8597 48 33.7562 48 32.3997V21.46C47.9999 20.1036 46.8964 19 45.54 19Z" fill="#E0E0E0"/>
<path d="M45.54 32.6412H15.46C14.1036 32.6412 13 31.5376 13 30.1812V32.3998C13 33.7563 14.1036 34.8599 15.46 34.8599H45.54C46.8964 34.8599 48 33.7563 48 32.3998V30.1812C47.9999 31.5376 46.8964 32.6412 45.54 32.6412Z" fill="#C4C4C4"/>
<path d="M43.7961 29.9707H17.2042C16.9205 29.9707 16.6904 30.2007 16.6904 30.4845V34.3459C16.6904 34.6297 16.9205 34.8597 17.2042 34.8597H43.7961C44.0798 34.8597 44.3099 34.6297 44.3099 34.3459V30.4845C44.3099 30.2007 44.0798 29.9707 43.7961 29.9707Z" fill="#66BAEA"/>
<path d="M16.6904 32.4963V34.346C16.6904 34.6298 16.9205 34.8598 17.2042 34.8598H43.7961C44.0798 34.8598 44.3099 34.6298 44.3099 34.346V32.4963H16.6904Z" fill="#3AAAE4"/>
<path d="M44.3099 31.9016H16.6904V32.9292H44.3099V31.9016Z" fill="#67676B"/>
<path d="M43.795 23.1775H42.2755C41.9918 23.1775 41.7617 22.9475 41.7617 22.6637C41.7617 22.3799 41.9918 22.1499 42.2755 22.1499H43.795C44.0788 22.1499 44.3088 22.3799 44.3088 22.6637C44.3088 22.9474 44.0788 23.1775 43.795 23.1775Z" fill="#AAAAAA"/>
<path d="M39.9319 23.1775H30.2071C29.9234 23.1775 29.6934 22.9475 29.6934 22.6637C29.6934 22.3799 29.9234 22.1499 30.2071 22.1499H39.9319C40.2156 22.1499 40.4457 22.3799 40.4457 22.6637C40.4457 22.9474 40.2156 23.1775 39.9319 23.1775Z" fill="#AAAAAA"/>
<path d="M21.0074 40.2323C20.8467 40.2323 20.6884 40.1571 20.5882 40.0161C20.4238 39.7848 20.478 39.464 20.7093 39.2996C22.1347 38.2866 22.1511 36.7634 22.1511 36.7482C22.1511 36.4643 22.3812 36.2344 22.6649 36.2344C22.9487 36.2344 23.1787 36.4643 23.1787 36.7482C23.1787 36.8322 23.1574 38.8203 21.3046 40.1373C21.2143 40.2014 21.1104 40.2323 21.0074 40.2323Z" fill="#66BAEA"/>
<path d="M26.3439 40.2322C26.0601 40.2322 25.8301 40.0022 25.8301 39.7184V36.7482C25.8301 36.4643 26.0601 36.2344 26.3439 36.2344C26.6276 36.2344 26.8577 36.4643 26.8577 36.7482V39.7184C26.8577 40.0022 26.6276 40.2322 26.3439 40.2322Z" fill="#66BAEA"/>
<path d="M30.6446 40.2322C30.3609 40.2322 30.1309 40.0022 30.1309 39.7184V36.7482C30.1309 36.4643 30.3609 36.2344 30.6446 36.2344C30.9284 36.2344 31.1584 36.4643 31.1584 36.7482V39.7184C31.1584 40.0022 30.9284 40.2322 30.6446 40.2322Z" fill="#66BAEA"/>
<path d="M39.9926 40.2323C39.8897 40.2323 39.7857 40.2014 39.6954 40.1373C37.8426 38.8203 37.8213 36.8322 37.8213 36.7482C37.8213 36.4643 38.0513 36.2344 38.3351 36.2344C38.6181 36.2344 38.8476 36.4631 38.8489 36.7458C38.8497 36.8142 38.8846 38.3002 40.2907 39.2996C40.522 39.464 40.5762 39.7848 40.4118 40.0161C40.3117 40.1571 40.1533 40.2323 39.9926 40.2323Z" fill="#66BAEA"/>
<path d="M34.6564 40.2322C34.3726 40.2322 34.1426 40.0022 34.1426 39.7184V36.7482C34.1426 36.4643 34.3726 36.2344 34.6564 36.2344C34.9401 36.2344 35.1702 36.4643 35.1702 36.7482V39.7184C35.1702 40.0022 34.9401 40.2322 34.6564 40.2322Z" fill="#66BAEA"/>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,16 @@
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.9994 23.4854C19.6859 23.4854 23.4851 19.6862 23.4851 14.9996C23.4851 10.3131 19.6859 6.51392 14.9994 6.51392C10.3129 6.51392 6.51367 10.3131 6.51367 14.9996C6.51367 19.6862 10.3129 23.4854 14.9994 23.4854Z" fill="#FFD347"/>
<path d="M15.0002 3.33097C14.7498 3.33097 14.5469 3.12806 14.5469 2.87763V0.453336C14.5469 0.202909 14.7498 0 15.0002 0C15.2506 0 15.4535 0.202909 15.4535 0.453336V2.87769C15.4535 3.12806 15.2506 3.33097 15.0002 3.33097Z" fill="#FFD347"/>
<path d="M8.93935 4.95522C8.78267 4.95522 8.63032 4.87395 8.54636 4.72853L7.33424 2.62901C7.20908 2.41222 7.28332 2.13495 7.50018 2.00974C7.71703 1.8847 7.99424 1.95876 8.11945 2.17567L9.33157 4.27519C9.45672 4.49198 9.38249 4.76925 9.16563 4.89446C9.09421 4.93565 9.01628 4.95522 8.93935 4.95522Z" fill="#FFD347"/>
<path d="M4.50071 9.39212C4.42384 9.39212 4.34585 9.37255 4.27448 9.3313L2.17497 8.11918C1.95817 7.99402 1.88388 7.71676 2.00903 7.49991C2.13419 7.28305 2.41145 7.20887 2.6283 7.33397L4.72782 8.54609C4.94462 8.67124 5.01891 8.94851 4.89376 9.16536C4.80973 9.31085 4.65739 9.39212 4.50071 9.39212Z" fill="#FFD347"/>
<path d="M2.87763 15.4533H0.453336C0.202967 15.4533 0 15.2504 0 15C0 14.7495 0.202967 14.5466 0.453336 14.5466H2.87769C3.12806 14.5466 3.33103 14.7495 3.33103 15C3.33103 15.2504 3.128 15.4533 2.87763 15.4533Z" fill="#FFD347"/>
<path d="M2.40203 22.7265C2.24535 22.7265 2.09301 22.6453 2.00904 22.4998C1.88389 22.283 1.95813 22.0058 2.17498 21.8805L4.2745 20.6684C4.49129 20.5434 4.76856 20.6175 4.89377 20.8344C5.01892 21.0512 4.94469 21.3284 4.72783 21.4536L2.62832 22.6658C2.55689 22.7069 2.4789 22.7265 2.40203 22.7265Z" fill="#FFD347"/>
<path d="M7.72639 28.051C7.64952 28.051 7.57153 28.0314 7.50016 27.9902C7.28337 27.865 7.20907 27.5878 7.33423 27.3709L8.54635 25.2714C8.6715 25.0545 8.94877 24.9804 9.16562 25.1055C9.38242 25.2306 9.45671 25.5079 9.33156 25.7247L8.11944 27.8242C8.03541 27.9697 7.88307 28.051 7.72639 28.051Z" fill="#FFD347"/>
<path d="M15.0002 29.9997C14.7498 29.9997 14.5469 29.7968 14.5469 29.5464V27.122C14.5469 26.8716 14.7498 26.6687 15.0002 26.6687C15.2506 26.6687 15.4535 26.8716 15.4535 27.122V29.5464C15.4535 29.7968 15.2506 29.9997 15.0002 29.9997Z" fill="#FFD347"/>
<path d="M22.2733 28.0509C22.1167 28.0509 21.9643 27.9697 21.8803 27.8242L20.6682 25.7247C20.5431 25.5079 20.6173 25.2307 20.8342 25.1054C21.051 24.9804 21.3282 25.0545 21.4534 25.2714L22.6656 27.3709C22.7907 27.5877 22.7165 27.865 22.4996 27.9902C22.4282 28.0314 22.3503 28.0509 22.2733 28.0509Z" fill="#FFD347"/>
<path d="M27.5974 22.7263C27.5205 22.7263 27.4425 22.7068 27.3712 22.6655L25.2716 21.4534C25.0549 21.3283 24.9806 21.051 25.1057 20.8341C25.2309 20.6173 25.5081 20.5431 25.725 20.6682L27.8245 21.8803C28.0413 22.0055 28.1156 22.2827 27.9904 22.4996C27.9064 22.645 27.7541 22.7263 27.5974 22.7263Z" fill="#FFD347"/>
<path d="M29.5466 15.4533H27.1223C26.8719 15.4533 26.6689 15.2504 26.6689 15C26.6689 14.7495 26.8719 14.5466 27.1223 14.5466H29.5466C29.797 14.5466 30 14.7495 30 15C30 15.2504 29.797 15.4533 29.5466 15.4533Z" fill="#FFD347"/>
<path d="M25.4987 9.39205C25.342 9.39205 25.1897 9.31078 25.1057 9.16535C24.9806 8.94855 25.0548 8.67129 25.2717 8.54608L27.3712 7.33396C27.588 7.20892 27.8652 7.28298 27.9904 7.49989C28.1156 7.71669 28.0414 7.99395 27.8245 8.11917L25.725 9.33129C25.6536 9.37248 25.5756 9.39205 25.4987 9.39205Z" fill="#FFD347"/>
<path d="M21.0604 4.9553C20.9835 4.9553 20.9055 4.93573 20.8341 4.89448C20.6174 4.76932 20.5431 4.49206 20.6682 4.2752L21.8803 2.17569C22.0055 1.95883 22.2828 1.88465 22.4996 2.00975C22.7164 2.13491 22.7907 2.41217 22.6655 2.62902L21.4534 4.72854C21.3694 4.87403 21.217 4.9553 21.0604 4.9553Z" fill="#FFD347"/>
<path d="M15 6.5144C14.6928 6.5144 14.3895 6.53116 14.0908 6.56292C18.3497 7.01661 21.6671 10.6206 21.6671 14.9998C21.6671 19.379 18.3496 22.9831 14.0908 23.4368C14.3895 23.4687 14.6927 23.4853 15 23.4853C19.6864 23.4853 23.4854 19.6862 23.4854 14.9998C23.4854 10.3134 19.6864 6.5144 15 6.5144Z" fill="#FFBE31"/>
</svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -1,16 +1,31 @@
import 'dart:async';
import 'package:bloc/bloc.dart';
import 'package:syncrow_web/pages/device_managment/ac/bloc/ac_event.dart';
import 'package:syncrow_web/pages/device_managment/ac/bloc/ac_state.dart';
import 'package:syncrow_web/pages/device_managment/ac/model/ac_model.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
import 'package:syncrow_web/services/devices_mang_api.dart';
class AcBloc extends Bloc<AcsEvent, AcsState> {
AcStatusModel deviceStatus = AcStatusModel(
uuid: '',
acSwitch: true,
modeString: 'hot',
tempSet: 300,
currentTemp: 315,
fanSpeedsString: 'low',
childLock: false,
);
AcBloc() : super(AcsInitialState()) {
on<AcFetchDeviceStatus>(_onFetchAcStatus);
on<AcControl>(_onAcControl);
on<AcSwitch>(_changeAcSwitch);
on<IncreaseCoolToTemp>(_increaseCoolTo);
on<DecreaseCoolToTemp>(_decreaseCoolTo);
on<ChangeLock>(_changeLockValue);
on<ChangeAcMode>(_changeAcMode);
on<ChangeFanSpeed>(_changeFanSpeed);
}
FutureOr<void> _onFetchAcStatus(
@ -18,11 +33,121 @@ class AcBloc extends Bloc<AcsEvent, AcsState> {
emit(AcsLoadingState());
try {
final status =
await DevicesManagementApi().getDeviceStatus(event.deviceId);
emit(ACStatusLoaded(status));
await DevicesManagementApi().getDeviceStatus(event.deviceId);
deviceStatus = AcStatusModel.fromJson(status.productUuid, status.status);
emit(ACStatusLoaded(deviceStatus));
} catch (e) {
emit(AcsFailedState( error: e.toString()));
emit(AcsFailedState(error: e.toString()));
}
}
FutureOr<void> _onAcControl(AcControl event, Emitter<AcsState> emit) async {
final oldValue = _getValueByCode(event.code);
_updateLocalValue(event.code, event.value);
emit(ACStatusLoaded(deviceStatus));
try {
final status = Status(code: event.code, value: event.value);
final response =
await DevicesManagementApi().deviceControl(event.deviceId, status);
if (!response) {
_updateLocalValue(event.code, oldValue);
emit(ACStatusLoaded(deviceStatus));
emit(AcsFailedState(error: 'Failed to control the device.'));
}
} catch (e) {
_updateLocalValue(event.code, oldValue);
emit(ACStatusLoaded(deviceStatus));
emit(AcsFailedState(error: 'Error controlling the device: $e'));
}
}
void _updateLocalValue(String code, dynamic value) {
switch (code) {
case 'switch':
deviceStatus.acSwitch = value;
break;
case 'temp_set':
deviceStatus.tempSet = value;
break;
case 'mode':
deviceStatus.modeString = value;
deviceStatus.acMode = AcStatusModel.getACMode(value);
break;
case 'level':
deviceStatus.fanSpeedsString = value;
deviceStatus.acFanSpeed = AcStatusModel.getFanSpeed(value);
break;
case 'child_lock':
deviceStatus.childLock = value;
break;
default:
break;
}
}
dynamic _getValueByCode(String code) {
switch (code) {
case 'switch':
return deviceStatus.acSwitch;
case 'temp_set':
return deviceStatus.tempSet;
case 'mode':
return deviceStatus.modeString;
case 'level':
return deviceStatus.fanSpeedsString;
case 'child_lock':
return deviceStatus.childLock;
default:
return null;
}
}
FutureOr<void> _changeAcSwitch(AcSwitch event, Emitter<AcsState> emit) async {
final newValue = !event.acSwitch;
add(AcControl(deviceId: event.deviceId, code: 'switch', value: newValue));
}
FutureOr<void> _increaseCoolTo(
IncreaseCoolToTemp event, Emitter<AcsState> emit) async {
final newValue = (event.value * 10).toInt() + 5;
if (_isValidTemperature(newValue)) {
add(AcControl(
deviceId: event.deviceId, code: 'temp_set', value: newValue));
}
}
FutureOr<void> _decreaseCoolTo(
DecreaseCoolToTemp event, Emitter<AcsState> emit) async {
final newValue = (event.value * 10).toInt() - 5;
if (_isValidTemperature(newValue)) {
add(AcControl(
deviceId: event.deviceId, code: 'temp_set', value: newValue));
}
}
FutureOr<void> _changeLockValue(
ChangeLock event, Emitter<AcsState> emit) async {
final newValue = !event.lockBool;
add(AcControl(
deviceId: event.deviceId, code: 'child_lock', value: newValue));
}
FutureOr<void> _changeAcMode(
ChangeAcMode event, Emitter<AcsState> emit) async {
final newValue = AcStatusModel.getACMode(event.tempModes.name);
add(AcControl(deviceId: event.deviceId, code: 'mode', value: newValue));
}
FutureOr<void> _changeFanSpeed(
ChangeFanSpeed event, Emitter<AcsState> emit) async {
final newValue = AcStatusModel.getFanSpeed(event.fanSpeeds.name);
add(AcControl(deviceId: event.deviceId, code: 'level', value: newValue));
}
bool _isValidTemperature(int value) {
return value >= 200 && value <= 300;
}
}

View File

@ -1,6 +1,5 @@
import 'package:equatable/equatable.dart';
import 'package:syncrow_web/pages/device_managment/ac/model/ac_model.dart';
sealed class AcsEvent extends Equatable {
const AcsEvent();
@ -21,12 +20,74 @@ class AcFetchDeviceStatus extends AcsEvent {
class AcControl extends AcsEvent {
final String deviceId;
final String code;
final bool value;
final dynamic value;
const AcControl(
{required this.deviceId, required this.code, required this.value});
const AcControl({
required this.deviceId,
required this.code,
required this.value,
});
@override
List<Object> get props => [deviceId, code, value];
}
class AcSwitch extends AcsEvent {
final bool acSwitch;
final String deviceId;
const AcSwitch({required this.acSwitch, required this.deviceId});
@override
List<Object> get props => [acSwitch, deviceId];
}
class IncreaseCoolToTemp extends AcsEvent {
final double value;
final String deviceId;
const IncreaseCoolToTemp({required this.value, required this.deviceId});
@override
List<Object> get props => [value, deviceId];
}
class DecreaseCoolToTemp extends AcsEvent {
final double value;
final String deviceId;
const DecreaseCoolToTemp({required this.value, required this.deviceId});
@override
List<Object> get props => [value, deviceId];
}
class ChangeLock extends AcsEvent {
final bool lockBool;
final String deviceId;
const ChangeLock({required this.lockBool, required this.deviceId});
@override
List<Object> get props => [lockBool, deviceId];
}
class ChangeAcMode extends AcsEvent {
final TempModes tempModes;
final String deviceId;
const ChangeAcMode({required this.tempModes, required this.deviceId});
@override
List<Object> get props => [tempModes, deviceId];
}
class ChangeFanSpeed extends AcsEvent {
final FanSpeeds fanSpeeds;
final String deviceId;
const ChangeFanSpeed({required this.fanSpeeds, required this.deviceId});
@override
List<Object> get props => [fanSpeeds, deviceId];
}

View File

@ -1,7 +1,5 @@
import 'package:equatable/equatable.dart';
import 'package:syncrow_web/pages/device_managment/ac/model/ac_model.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
import 'package:syncrow_web/pages/visitor_password/model/device_model.dart';
abstract class AcsState extends Equatable {
const AcsState();
@ -14,9 +12,8 @@ class AcsInitialState extends AcsState {}
class AcsLoadingState extends AcsState {}
class ACStatusLoaded extends AcsState {
final DeviceStatus status;
final AcStatusModel status;
const ACStatusLoaded(this.status);
@ -24,46 +21,49 @@ class ACStatusLoaded extends AcsState {
List<Object> get props => [status];
}
class AcChangeLoading extends AcsState {
final AcStatusModel acStatusModel;
const AcChangeLoading({required this.acStatusModel});
class AcSwitchChanged extends AcsState {
final bool acSwitch;
const AcSwitchChanged(this.acSwitch);
@override
List<Object> get props => [acStatusModel];
List<Object> get props => [acSwitch];
}
class AcModifyingState extends AcsState {
final AcStatusModel acStatusModel;
const AcModifyingState({required this.acStatusModel});
class AcTempChanged extends AcsState {
final double tempSet;
const AcTempChanged(this.tempSet);
@override
List<Object> get props => [acStatusModel];
List<Object> get props => [tempSet];
}
class GetAcStatusState extends AcsState {
final AcStatusModel acStatusModel;
const GetAcStatusState({required this.acStatusModel});
class AcModeChanged extends AcsState {
final TempModes mode;
const AcModeChanged(this.mode);
@override
List<Object> get props => [acStatusModel];
List<Object> get props => [mode];
}
class GetAllAcsStatusState extends AcsState {
final List<AcStatusModel> allAcsStatues;
final List<DeviceModel> allAcs;
final bool allOn;
final bool allTempSame;
final int temp;
class AcFanSpeedChanged extends AcsState {
final FanSpeeds fanSpeed;
const GetAllAcsStatusState(
{required this.allAcsStatues,
required this.allAcs,
required this.allOn,
required this.allTempSame,
required this.temp});
const AcFanSpeedChanged(this.fanSpeed);
@override
List<Object> get props => [allAcsStatues, allAcs, allAcs, allTempSame, temp];
List<Object> get props => [fanSpeed];
}
class AcLockChanged extends AcsState {
final bool lock;
const AcLockChanged(this.lock);
@override
List<Object> get props => [lock];
}
class AcsFailedState extends AcsState {

View File

@ -0,0 +1,82 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_web/pages/device_managment/ac/model/ac_model.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/constants/assets.dart';
import 'package:syncrow_web/pages/device_managment/ac/bloc/ac_bloc.dart';
import 'package:syncrow_web/pages/device_managment/ac/bloc/ac_event.dart';
class AcMode extends StatelessWidget {
const AcMode({
super.key,
required this.value,
required this.code,
required this.deviceId,
});
final TempModes value;
final String code;
final String deviceId;
void _onModeSelected(BuildContext context, TempModes mode) {
context.read<AcBloc>().add(
ChangeAcMode(tempModes: mode, deviceId: deviceId),
);
}
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: ColorsManager.greyColor.withOpacity(0.2),
border: Border.all(color: ColorsManager.boxDivider),
),
padding: const EdgeInsets.all(16),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
_buildIconContainer(context, TempModes.cold, Assets.freezing,
value == TempModes.cold),
_buildIconContainer(
context, TempModes.hot, Assets.acSun, value == TempModes.hot),
_buildIconContainer(context, TempModes.wind, Assets.acAirConditioner,
value == TempModes.wind),
],
),
);
}
Widget _buildIconContainer(
BuildContext context, TempModes mode, String assetPath, bool isSelected) {
return Flexible(
child: GestureDetector(
onTap: () {
_onModeSelected(context, mode);
},
child: Container(
width: 50,
height: 50,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: ColorsManager.whiteColors,
border: Border.all(
color: isSelected ? Colors.blue : Colors.transparent,
width: 2.0,
),
),
margin: const EdgeInsets.symmetric(horizontal: 4),
padding: const EdgeInsets.all(4),
child: ClipOval(
child: SvgPicture.asset(
assetPath,
fit: BoxFit.contain,
),
),
),
),
);
}
}

View File

@ -1,43 +1,85 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_web/pages/device_managment/living_room_switch/bloc/living_room_bloc.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_web/pages/device_managment/ac/bloc/ac_bloc.dart';
import 'package:syncrow_web/pages/device_managment/ac/bloc/ac_event.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/constants/assets.dart';
class AcToggle extends StatelessWidget {
const AcToggle(
{super.key,
required this.value,
required this.code,
required this.deviceId});
const AcToggle({
super.key,
required this.value,
required this.code,
required this.deviceId,
this.icon,
this.description,
});
final bool value;
final String code;
final String deviceId;
final String? icon;
final String? description;
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
ClipOval(
child: Transform.scale(
scale: .8,
child: CupertinoSwitch(
value:true,
onChanged: (value) {
},
applyTheme: true,
),
),),
],
),
],
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: ColorsManager.greyColor.withOpacity(0.2),
border: Border.all(color: ColorsManager.boxDivider),
),
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ClipOval(
child: Container(
color: ColorsManager.whiteColors,
child: SvgPicture.asset(
icon ?? Assets.acDevice,
width: 60,
height: 60,
fit: BoxFit.cover,
),
)),
SizedBox(
height: 20,
width: 35,
child: CupertinoSwitch(
activeColor: ColorsManager.dialogBlueTitle,
value: value,
onChanged: (newValue) {
context.read<AcBloc>().add(
AcControl(
deviceId: deviceId,
code: code,
value: newValue,
),
);
},
),
),
],
),
const Spacer(),
Center(
child: Text(
description ?? 'ThermoState',
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
),
),
),
],
),
);
}
}

View File

@ -0,0 +1,134 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_web/pages/device_managment/ac/bloc/ac_event.dart';
import 'package:syncrow_web/pages/device_managment/shared/celciuse_symbol.dart';
import 'package:syncrow_web/pages/device_managment/shared/increament_decreament.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/pages/device_managment/ac/bloc/ac_bloc.dart';
class CurrentTemp extends StatefulWidget {
const CurrentTemp({
super.key,
required this.code,
required this.deviceId,
required this.currentTemp,
required this.tempSet,
});
final String code;
final String deviceId;
final int currentTemp;
final int tempSet;
@override
State<CurrentTemp> createState() => _CurrentTempState();
}
class _CurrentTempState extends State<CurrentTemp> {
late double _adjustedValue;
Timer? _debounce;
@override
void initState() {
super.initState();
_adjustedValue = _initialAdjustedValue(widget.tempSet);
}
double _initialAdjustedValue(dynamic value) {
if (value is int || value is double) {
double doubleValue = value.toDouble();
return doubleValue > 99 ? doubleValue / 10 : doubleValue;
} else {
throw ArgumentError('Invalid value type: Expected int or double');
}
}
void _onValueChanged(double newValue) {
if (_debounce?.isActive ?? false) {
_debounce?.cancel();
}
_debounce = Timer(const Duration(milliseconds: 500), () {
context.read<AcBloc>().add(
AcControl(
deviceId: widget.deviceId,
code: widget.code,
value: newValue * 10,
),
);
});
}
@override
void dispose() {
_debounce?.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: ColorsManager.greyColor.withOpacity(0.2),
border: Border.all(color: ColorsManager.boxDivider),
),
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Current Temperature',
style: Theme.of(context)
.textTheme
.bodySmall!
.copyWith(color: Colors.grey),
),
const SizedBox(
height: 5,
),
Row(
children: [
Text(
(widget.currentTemp > 99
? widget.currentTemp / 10
: widget.currentTemp)
.toString(),
style: Theme.of(context)
.textTheme
.bodySmall!
.copyWith(color: Colors.grey),
),
const CelsiusSymbol(
color: Colors.grey,
)
],
),
],
),
const Spacer(),
IncrementDecrementWidget(
value: _adjustedValue.toString(),
description: '°C',
descriptionColor: ColorsManager.dialogBlueTitle,
onIncrement: () {
setState(() {
_adjustedValue++;
});
_onValueChanged(_adjustedValue);
},
onDecrement: () {
setState(() {
_adjustedValue--;
});
_onValueChanged(_adjustedValue);
}),
],
),
);
}
}

View File

@ -0,0 +1,35 @@
// import 'package:flutter/cupertino.dart';
// import 'package:syncrow_web/pages/device_managment/ac/control_list/ac_mode.dart';
// import 'package:syncrow_web/pages/device_managment/ac/control_list/ac_toggle.dart';
// import 'package:syncrow_web/pages/device_managment/ac/control_list/current_temp.dart';
// import 'package:syncrow_web/utils/constants/assets.dart';
// mixin ACHelper {
// Widget acHelperControlWidgets({
// required dynamic value,
// required String code,
// required String deviceId,
// }) {
// switch (code) {
// case 'switch':
// return AcToggle(value: value, code: code, deviceId: deviceId);
// case 'temp_current':
// return CurrentTemp(value: value, code: 'temp_set', deviceId: deviceId);
// case 'temp_set':
// return SizedBox();
// case 'mode':
// return AcMode(value: value, code: code, deviceId: deviceId);
// case 'level':
// return SizedBox();
// case 'child_lock':
// return AcToggle(
// value: value,
// code: code,
// deviceId: deviceId,
// icon: Assets.childLock,
// description: 'Child Lock');
// default:
// return const SizedBox();
// }
// }
// }

View File

@ -1,28 +1,33 @@
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
import 'package:syncrow_web/utils/constants/const.dart';
enum TempModes { hot, cold, wind }
enum FanSpeeds { auto, low, middle, high }
class AcStatusModel {
String uuid;
bool acSwitch;
String modeString;
int tempSet;
int currentTemp;
String fanSpeedsString;
bool childLock;
// late TempModes acMode;
// late FanSpeeds acFanSpeed;
late TempModes acMode;
late FanSpeeds acFanSpeed;
AcStatusModel(
{required this.acSwitch,
{required this.uuid,
required this.acSwitch,
required this.modeString,
required this.tempSet,
required this.currentTemp,
required this.fanSpeedsString,
required this.childLock}) {
// acMode = getACMode(modeString);
// acFanSpeed = getFanSpeed(fanSpeedsString);
acMode = getACMode(modeString);
acFanSpeed = getFanSpeed(fanSpeedsString);
}
factory AcStatusModel.fromJson(List<Status> jsonList) {
factory AcStatusModel.fromJson(String id, List<Status> jsonList) {
late bool _acSwitch;
late String _mode;
late int _tempSet;
@ -45,6 +50,7 @@ class AcStatusModel {
}
}
return AcStatusModel(
uuid: id,
acSwitch: _acSwitch,
modeString: _mode,
tempSet: _tempSet,

View File

@ -3,68 +3,72 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_web/pages/device_managment/ac/bloc/ac_bloc.dart';
import 'package:syncrow_web/pages/device_managment/ac/bloc/ac_event.dart';
import 'package:syncrow_web/pages/device_managment/ac/bloc/ac_state.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/helper/ac_helper.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
import 'package:syncrow_web/pages/device_managment/ac/control_list/ac_mode.dart';
import 'package:syncrow_web/pages/device_managment/ac/control_list/ac_toggle.dart';
import 'package:syncrow_web/pages/device_managment/ac/control_list/current_temp.dart';
import 'package:syncrow_web/pages/device_managment/ac/model/ac_model.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_model.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
class AcDeviceControl extends StatelessWidget with ACHelper {
class AcDeviceControl extends StatelessWidget with HelperResponsiveLayout {
const AcDeviceControl({super.key, required this.device});
final AllDevicesModel device;
@override
Widget build(BuildContext context) {
final isLarge = isLargeScreenSize(context);
final isMedium = isMediumScreenSize(context);
return BlocProvider(
create: (context) =>
AcBloc()..add(AcFetchDeviceStatus(device.uuid!)),
child: BlocListener<AcBloc, AcsState>(
listener: (context, state) {
create: (context) => AcBloc()..add(AcFetchDeviceStatus(device.uuid!)),
child: BlocBuilder<AcBloc, AcsState>(
builder: (context, state) {
if (state is AcsLoadingState) {
return const Center(child: CircularProgressIndicator());
} else if (state is ACStatusLoaded) {
return _buildStatusControls(state.status, isLarge, isMedium);
} else {
return const Center(child: Text('Error fetching status'));
}
},
child: BlocBuilder<AcBloc, AcsState>(
builder: (context, state) {
if (state is AcsLoadingState) {
return const Center(child: CircularProgressIndicator());
} else if (state is ACStatusLoaded) {
return _buildStatusControls(state.status.status);
} else {
return const Center(child: Text('Error fetching status'));
}
},
),
),
);
}
Widget _buildStatusControls(List<Status> statuses) {
return GridView.builder(
padding: const EdgeInsets.symmetric(horizontal: 40),
Widget _buildStatusControls(
AcStatusModel statuses, bool isLarge, bool isMedium) {
return GridView(
padding: const EdgeInsets.symmetric(horizontal: 50),
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: isLarge
? 3
: isMedium
? 2
: 1,
mainAxisExtent: 133,
crossAxisSpacing: 12,
mainAxisSpacing: 12,
),
itemCount: statuses.length,
itemBuilder: (context, index) {
final status = statuses[index];
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: ColorsManager.greyColor.withOpacity(0.2),
border: Border.all(color: ColorsManager.boxDivider),
),
padding: const EdgeInsets.all(16),
child: ACHelperControlWidgets(
value: status.value,
code: status.code,
deviceId: device.uuid!),
);
},
children: [
AcToggle(
value: statuses.acSwitch,
code: 'switch',
deviceId: statuses.uuid,
),
AcMode(
value: statuses.acMode,
code: 'mode',
deviceId: statuses.uuid,
),
CurrentTemp(
currentTemp: statuses.currentTemp,
tempSet: statuses.tempSet,
code: 'temp_set',
deviceId: statuses.uuid,
),
],
);
}
}

View File

@ -1,19 +0,0 @@
import 'package:flutter/cupertino.dart';
import 'package:syncrow_web/pages/device_managment/ac/control_list/ac_toggle.dart';
mixin ACHelper {
Widget ACHelperControlWidgets(
{required bool value, required String code, required String deviceId}) {
switch (code) {
case 'switch_1':
return AcToggle(value: value, code: code, deviceId: deviceId);
case 'switch_2':
return SizedBox();
case 'switch_3':
return SizedBox();
default:
return const SizedBox();
}
}
}

View File

@ -35,9 +35,12 @@ class LivingRoomBloc extends Bloc<LivingRoomEvent, LivingRoomState> {
await DevicesManagementApi().deviceControl(event.deviceId, status);
if (response) {
emit(LivingRoomControlSuccess());
await Future.delayed(const Duration(milliseconds: 500));
add(LivingRoomFetchDeviceStatus(event.deviceId));
final newStatus =
await DevicesManagementApi().getDeviceStatus(event.deviceId);
emit(LivingRoomDeviceStatusLoaded(newStatus));
} else {
emit(const LivingRoomControlError('Failed to control the device.'));
}
} catch (e) {
emit(LivingRoomControlError('Error controlling the device: $e'));

View File

@ -41,6 +41,7 @@ class CeilingLight extends StatelessWidget {
width: 35,
child: CupertinoSwitch(
value: value,
activeColor: ColorsManager.dialogBlueTitle,
onChanged: (newValue) {
context.read<LivingRoomBloc>().add(
LivingRoomControl(

View File

@ -41,6 +41,7 @@ class SpotLight extends StatelessWidget {
width: 35,
child: CupertinoSwitch(
value: value,
activeColor: ColorsManager.dialogBlueTitle,
onChanged: (newValue) {
context.read<LivingRoomBloc>().add(
LivingRoomControl(

View File

@ -41,6 +41,7 @@ class WallLight extends StatelessWidget {
width: 35,
child: CupertinoSwitch(
value: value,
activeColor: ColorsManager.dialogBlueTitle,
onChanged: (newValue) {
context.read<LivingRoomBloc>().add(
LivingRoomControl(

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:syncrow_web/pages/device_managment/ac/control_list/ac_toggle.dart';
import 'package:syncrow_web/pages/device_managment/living_room_switch/control_list/cieling_light.dart';
import 'package:syncrow_web/pages/device_managment/living_room_switch/control_list/spot_light.dart';
import 'package:syncrow_web/pages/device_managment/living_room_switch/control_list/wall_light.dart';

View File

@ -16,25 +16,19 @@ class LivingRoomDeviceControl extends StatelessWidget with LivingRoomHelper {
return BlocProvider(
create: (context) =>
LivingRoomBloc()..add(LivingRoomFetchDeviceStatus(device.uuid!)),
child: BlocListener<LivingRoomBloc, LivingRoomState>(
listener: (context, state) {
if (state is LivingRoomControlSuccess) {
context
.read<LivingRoomBloc>()
.add(LivingRoomFetchDeviceStatus(device.uuid!));
child: BlocBuilder<LivingRoomBloc, LivingRoomState>(
builder: (context, state) {
if (state is LivingRoomDeviceStatusLoading) {
return const Center(child: CircularProgressIndicator());
} else if (state is LivingRoomDeviceStatusLoaded) {
return _buildStatusControls(state.status.status);
} else if ((state is LivingRoomDeviceManagementError) ||
(state is LivingRoomControlError)) {
return const Center(child: Text('Error fetching status'));
} else {
return const Center(child: CircularProgressIndicator());
}
},
child: BlocBuilder<LivingRoomBloc, LivingRoomState>(
builder: (context, state) {
if (state is LivingRoomDeviceStatusLoading) {
return const Center(child: CircularProgressIndicator());
} else if (state is LivingRoomDeviceStatusLoaded) {
return _buildStatusControls(state.status.status);
} else {
return const Center(child: Text('Error fetching status'));
}
},
),
),
);
}
@ -50,7 +44,7 @@ class LivingRoomDeviceControl extends StatelessWidget with LivingRoomHelper {
crossAxisSpacing: 12,
mainAxisSpacing: 12,
),
itemCount: statuses.length,
itemCount: 3,
itemBuilder: (context, index) {
final status = statuses[index];

View File

@ -0,0 +1,17 @@
import 'package:flutter/material.dart';
class CelsiusSymbol extends StatelessWidget {
const CelsiusSymbol({this.color, super.key});
final Color? color;
@override
Widget build(BuildContext context) {
return Text(
'°C',
style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: color,
),
);
}
}

View File

@ -44,7 +44,7 @@ class DeviceControlDialog extends StatelessWidget with RouteControlsBasedCode {
const SizedBox(height: 20),
//// BUILD DEVICE CONTROLS
///
//// ROUTE TO SPECIFIC CONTROL VIEW BASED ON DEVICE CATEGORY
//// ROUTE TO SPECIFIC CONTROL VIEW BASED ON DEVICE CATEGORY
routeControlsWidgets(device: device),
],
),
@ -56,7 +56,7 @@ class DeviceControlDialog extends StatelessWidget with RouteControlsBasedCode {
Widget _buildDeviceInfoSection() {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 40, horizontal: 50),
padding: const EdgeInsets.symmetric(vertical: 50, horizontal: 50),
child: Table(
children: [
TableRow(

View File

@ -6,6 +6,7 @@ class IncrementDecrementWidget extends StatelessWidget {
final String description;
final VoidCallback onIncrement;
final VoidCallback onDecrement;
final Color? descriptionColor;
const IncrementDecrementWidget({
super.key,
@ -13,6 +14,7 @@ class IncrementDecrementWidget extends StatelessWidget {
required this.description,
required this.onIncrement,
required this.onDecrement,
this.descriptionColor,
});
@override
@ -22,18 +24,20 @@ class IncrementDecrementWidget extends StatelessWidget {
children: [
Material(
type: MaterialType.transparency,
child: ClipRRect(
borderRadius: BorderRadius.circular(100),
child: InkWell(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: onDecrement,
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Icon(
Icons.remove,
color: ColorsManager.greyColor,
size: 32,
child: Flexible(
child: ClipRRect(
borderRadius: BorderRadius.circular(100),
child: InkWell(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: onDecrement,
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Icon(
Icons.remove,
color: ColorsManager.greyColor,
size: 28,
),
),
),
),
@ -53,9 +57,9 @@ class IncrementDecrementWidget extends StatelessWidget {
),
TextSpan(
text: description,
style: const TextStyle(
style: TextStyle(
fontSize: 12,
color: ColorsManager.blackColor,
color: descriptionColor ?? ColorsManager.blackColor,
fontWeight: FontWeight.bold,
),
),
@ -64,18 +68,20 @@ class IncrementDecrementWidget extends StatelessWidget {
),
Material(
type: MaterialType.transparency,
child: ClipRRect(
borderRadius: BorderRadius.circular(100),
child: InkWell(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: onIncrement,
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Icon(
Icons.add,
color: ColorsManager.greyColor,
size: 32,
child: Flexible(
child: ClipRRect(
borderRadius: BorderRadius.circular(100),
child: InkWell(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: onIncrement,
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Icon(
Icons.add,
color: ColorsManager.greyColor,
size: 28,
),
),
),
),

View File

@ -139,4 +139,9 @@ class Assets {
"presence_sensor_assets/presence-sensor-assets/presence-sensor-motion.svg";
static const String lightPulp = "functions_icons/light_pulb.svg";
static const String acDevice = "functions_icons/ac_device.svg";
static const String acAirConditioner = "functions_icons/ac_air.svg";
static const String acSun = "functions_icons/ac_sun.svg";
}