Semi-implemented getting spaces feature

This commit is contained in:
Mohammad Salameh
2024-03-12 11:14:31 +03:00
parent 661d535960
commit 0f3cc453ce
25 changed files with 311 additions and 294 deletions

View File

@ -0,0 +1,13 @@
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M26.6793 26.6699L30.4747 20.9188L26.6793 19.9409C26.1821 18.4493 25.3367 17.0404 24.1434 15.8471C22.9666 14.6703 21.5745 13.8085 20.0497 13.3113L19.9999 13.3611L15.3759 13.1787L13.3207 13.3113C11.7959 13.8085 10.4037 14.6703 9.22692 15.8471L3.08272 21.9913C-1.02757 26.1016 -1.02757 32.7819 3.08272 36.8922C7.30904 41.1185 13.9884 40.9031 17.9992 36.8922L24.1434 30.7636C25.3369 29.5702 26.1822 28.1615 26.6793 26.6699ZM13.8558 32.7486C11.9995 34.605 9.03286 34.5553 7.22622 32.7486C5.40311 30.9255 5.40311 27.9422 7.22622 26.1191L13.3207 20.0402L16.652 23.3384L20 26.6201L13.8558 32.7486Z" fill="#4A696F"/>
<path d="M24.1435 30.7632L17.9993 36.8918C13.9883 40.9027 7.30908 41.1181 3.08276 36.8918L7.22619 32.7483C9.03282 34.5549 11.9994 34.6046 13.8558 32.7483L20 26.6198L16.6521 23.3381L24.1435 15.8467C25.3367 17.04 26.1821 18.4488 26.6793 19.9404L30.4747 20.9183L26.6793 26.6695C26.1821 28.1612 25.3368 29.5698 24.1435 30.7632Z" fill="#384949"/>
<path d="M32.4304 34.0783L30.773 32.4208C30.3149 31.9628 30.3149 31.2215 30.773 30.7634C31.231 30.3055 31.9723 30.3054 32.4304 30.7634L34.0878 32.4208C34.5459 32.8789 34.5459 33.6202 34.0878 34.0783C33.6297 34.5363 32.8884 34.5363 32.4304 34.0783Z" fill="#D2C5C2"/>
<path d="M7.56975 9.21783L5.91226 7.56041C5.45421 7.10237 5.45421 6.36104 5.91226 5.90307C6.3703 5.44511 7.11163 5.44503 7.5696 5.90307L9.22693 7.56041C9.68498 8.01846 9.68498 8.75978 9.22693 9.21775C8.76889 9.67572 8.02772 9.67579 7.56975 9.21783Z" fill="#DFD7D5"/>
<path d="M34.7158 23.9334C34.8833 23.3078 35.5259 22.9372 36.1514 23.1047L38.4158 23.7116C39.0414 23.8759 39.4104 24.5217 39.2445 25.1473C39.077 25.7729 38.4345 26.1435 37.8089 25.976L35.5445 25.3691C34.9231 25.2027 34.5481 24.5627 34.7158 23.9334Z" fill="#D2C5C2"/>
<path d="M0.755502 14.8338C0.923001 14.2082 1.56558 13.8376 2.19112 14.0051L4.45549 14.6121C5.07869 14.7756 5.45088 15.4214 5.28424 16.0477C5.11674 16.6734 4.47416 17.044 3.84862 16.8765L1.58425 16.2695C0.962767 16.1031 0.587768 15.4631 0.755502 14.8338Z" fill="#DFD7D5"/>
<path d="M23.7211 38.4064L23.1141 36.142C22.9466 35.5164 23.3172 34.8739 23.9428 34.7064C24.5685 34.5389 25.2102 34.9071 25.3785 35.5352L25.9854 37.7995C26.1529 38.4252 25.7823 39.0677 25.1567 39.2352C24.5275 39.4028 23.8874 39.0279 23.7211 38.4064Z" fill="#D2C5C2"/>
<path d="M14.6215 4.44588L14.0145 2.18152C13.847 1.55589 14.2176 0.913395 14.8432 0.745896C15.4689 0.580037 16.1121 0.946598 16.2789 1.57464L16.8859 3.83901C17.0534 4.46463 16.6828 5.10713 16.0571 5.27463C15.4279 5.44213 14.7879 5.06721 14.6215 4.44588Z" fill="#DFD7D5"/>
<path d="M36.9172 3.08897C32.8069 -1.02133 26.1275 -1.03797 22.0007 3.08897L15.8565 9.21754C14.6632 10.4108 13.8179 11.8196 13.3206 13.3113C12.5913 15.4991 12.5914 17.8525 13.3207 20.0403C13.8179 21.5319 14.6632 22.9408 15.8565 24.1341C17.0167 25.2944 18.4089 26.1561 19.9503 26.6699L20 26.6202C21.8232 24.797 21.8231 21.8137 20 19.9906C18.1768 18.1675 18.1768 15.1842 20 13.361L26.1442 7.23247C27.0392 6.33739 28.1994 5.87341 29.4591 5.87341C29.4921 5.84036 29.7738 5.85685 29.8402 5.88997C30.7352 5.88989 31.9119 6.37052 32.7737 7.23247C34.5969 9.05558 34.5969 12.0389 32.7737 13.8621L26.6794 19.9408C27.4087 22.1286 27.4087 24.4821 26.6794 26.6699C28.1875 26.1561 29.613 25.2943 30.7731 24.134L36.9173 18.0055C41.0276 13.8951 41.0275 7.19926 36.9172 3.08897Z" fill="#2F66D3"/>
<path d="M19.9999 26.6198L19.9503 26.6695C18.4089 26.1558 17.0166 25.294 15.8564 24.1337L19.9999 19.9902C21.8231 21.8134 21.8231 24.7967 19.9999 26.6198Z" fill="#0C3C9B"/>
<path d="M36.917 18.0054L30.7728 24.1339C29.6127 25.2942 28.1873 26.156 26.6791 26.6698C27.4084 24.482 27.4084 22.1285 26.6791 19.9407L32.7734 13.862C34.5966 12.0388 34.5965 9.05549 32.7734 7.23237L36.9169 3.08887C41.0273 7.19909 41.0275 13.8949 36.917 18.0054Z" fill="#0C3C9B"/>
</svg>

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -0,0 +1,61 @@
<svg width="286" height="286" viewBox="0 0 286 286" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_di_594_1304)">
<path d="M250.999 132.999C250.999 67.8299 198.169 14.9998 132.999 14.9998C67.8301 14.9998 15 67.8299 15 132.999C15 198.168 67.8301 250.999 132.999 250.999C198.169 250.999 250.999 198.168 250.999 132.999Z" fill="#EBECED"/>
</g>
<g filter="url(#filter1_ddi_594_1304)">
<path d="M196.919 196.919C232.066 161.772 232.066 104.787 196.919 69.6397C161.772 34.4925 104.787 34.4925 69.6396 69.6397C34.4924 104.787 34.4924 161.772 69.6396 196.919C104.787 232.066 161.772 232.066 196.919 196.919Z" fill="#F9F9F9"/>
</g>
<g filter="url(#filter2_i_594_1304)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M145.704 128.193H120.613V119.993C120.613 116.542 122.021 113.402 124.297 111.131C126.573 108.854 129.705 107.44 133.156 107.44C136.606 107.44 139.744 108.854 142.014 111.131C144.29 113.402 145.704 116.542 145.704 119.993V128.193ZM156.398 129.919C155.736 129.263 154.926 128.757 154.018 128.472V119.993C154.018 114.252 151.67 109.029 147.89 105.247C144.109 101.465 138.895 99.123 133.156 99.123C127.416 99.123 122.202 101.465 118.421 105.247C114.641 109.029 112.293 114.252 112.293 119.993V128.446C111.359 128.731 110.523 129.244 109.848 129.919C108.785 130.989 108.123 132.455 108.123 134.077V160.48C108.123 162.102 108.785 163.568 109.848 164.639C110.918 165.703 112.384 166.364 114.005 166.364H152.241C153.862 166.364 155.328 165.703 156.398 164.639C157.462 163.568 158.123 162.102 158.123 160.48V134.077C158.123 132.455 157.462 130.989 156.398 129.919ZM129.05 140.889C130.094 139.851 131.534 139.202 133.123 139.202C134.712 139.202 136.152 139.851 137.196 140.889C138.24 141.933 138.882 143.373 138.882 144.963C138.882 146.202 138.493 147.344 137.831 148.284C137.28 149.063 136.541 149.699 135.678 150.127V152.8C135.678 153.5 135.393 154.143 134.926 154.603C134.465 155.064 133.83 155.356 133.123 155.356C132.422 155.356 131.781 155.064 131.32 154.603C130.86 154.143 130.568 153.5 130.568 152.8V150.127C129.712 149.699 128.972 149.063 128.421 148.284C127.753 147.344 127.364 146.202 127.364 144.963C127.364 143.373 128.013 141.933 129.05 140.889Z" fill="#C1C1C1"/>
</g>
<defs>
<filter id="filter0_di_594_1304" x="0" y="0" width="285.999" height="285.999" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="10" dy="10"/>
<feGaussianBlur stdDeviation="12.5"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_594_1304"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_594_1304" result="shape"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="5" dy="5"/>
<feGaussianBlur stdDeviation="15"/>
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0"/>
<feBlend mode="normal" in2="shape" result="effect2_innerShadow_594_1304"/>
</filter>
<filter id="filter1_ddi_594_1304" x="8.27924" y="8.2793" width="245" height="245" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="5" dy="5"/>
<feGaussianBlur stdDeviation="12.5"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_594_1304"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="-5" dy="-5"/>
<feGaussianBlur stdDeviation="15"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0"/>
<feBlend mode="normal" in2="effect1_dropShadow_594_1304" result="effect2_dropShadow_594_1304"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_594_1304" result="shape"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="5" dy="5"/>
<feGaussianBlur stdDeviation="15"/>
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0"/>
<feBlend mode="normal" in2="shape" result="effect3_innerShadow_594_1304"/>
</filter>
<filter id="filter2_i_594_1304" x="108.123" y="99.123" width="55" height="72.2412" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="5" dy="5"/>
<feGaussianBlur stdDeviation="2.5"/>
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"/>
<feBlend mode="normal" in2="shape" result="effect1_innerShadow_594_1304"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -0,0 +1,14 @@
<svg width="50" height="36" viewBox="0 0 50 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M49.192 20.1479C47.9682 18.0322 46.2249 16.2593 44.1513 15.0214C42.0124 13.7452 39.5672 13.0703 37.0796 13.0703C34.592 13.0703 32.1468 13.7452 30.0079 15.0214C27.9343 16.2593 26.1914 18.0322 24.9672 20.1479C23.9056 21.9841 23.8896 24.1917 24.9249 26.054C25.9705 27.9359 27.8538 29.0589 29.9622 29.0589H44.197C46.3058 29.0589 48.1887 27.9355 49.2347 26.054C50.2696 24.1917 50.2536 21.9841 49.192 20.1479Z" fill="#19CFFC"/>
<path d="M44.1515 15.0189C42.013 13.7423 39.5674 13.0674 37.0798 13.0674C37.0798 13.0674 37.0798 13.0674 37.0795 13.0674V29.0564H44.1973C46.306 29.0564 48.189 27.933 49.2346 26.0515C50.2699 24.1891 50.2539 21.9811 49.1922 20.1454C47.9685 18.0292 46.2252 16.2564 44.1515 15.0189Z" fill="#4AB8F7"/>
<path d="M42.6676 2.37262C41.1749 0.842616 39.1905 0 37.0795 0C34.9685 0 32.9841 0.842616 31.4918 2.37262C29.9991 3.90262 29.177 5.93663 29.177 8.10006C29.177 10.2639 29.9991 12.2979 31.4918 13.8279C32.9841 15.3579 34.9685 16.2005 37.0795 16.2005C39.1905 16.2005 41.1749 15.3579 42.6676 13.8279C44.1603 12.2979 44.9824 10.2639 44.9824 8.10006C44.9824 5.93663 44.1603 3.90262 42.6676 2.37262Z" fill="#FFD2BF"/>
<path d="M42.668 2.37017C41.1272 0.790904 39.1035 0.00146484 37.0795 0.00146484V16.1942H37.0798C39.1035 16.1942 41.1272 15.4047 42.668 13.8254C45.7491 10.6673 45.7491 5.52832 42.668 2.37017Z" fill="#FFB89C"/>
<path d="M25.0324 20.1479C23.8087 18.0322 22.0654 16.2593 19.9917 15.0214C17.8532 13.7452 15.4076 13.0703 12.9201 13.0703C10.4325 13.0703 7.98729 13.7452 5.8484 15.0214C3.77473 16.2593 2.03181 18.0322 0.807673 20.1479C-0.253953 21.9837 -0.269975 24.1917 0.76533 26.054C1.81093 27.9355 3.69424 29.0589 5.80262 29.0589H20.0379C22.1462 29.0589 24.0292 27.9359 25.0752 26.054C26.1101 24.1921 26.0941 21.9841 25.0324 20.1479Z" fill="#27488F"/>
<path d="M19.9922 15.0189C17.8537 13.7423 15.4081 13.0674 12.9205 13.0674C12.9205 13.0674 12.9205 13.0674 12.9202 13.0674V29.0564H20.038C22.1467 29.0564 24.0297 27.933 25.0753 26.0515C26.1106 24.1891 26.0946 21.9811 25.0329 20.1454C23.8092 18.0292 22.0659 16.2564 19.9922 15.0189Z" fill="#12254C"/>
<path d="M18.5081 2.37262C17.0154 0.842616 15.031 0 12.92 0C10.8093 0 8.82451 0.842616 7.33221 2.37262C5.83952 3.90262 5.01746 5.93663 5.01746 8.10006C5.01746 10.2639 5.83952 12.2979 7.33221 13.8279C8.82451 15.3579 10.8093 16.2005 12.92 16.2005C15.031 16.2005 17.0154 15.3579 18.5081 13.8279C20.0008 12.2979 20.8228 10.2639 20.8228 8.10006C20.8228 5.93663 20.0008 3.90262 18.5081 2.37262Z" fill="#FFD2BF"/>
<path d="M18.5087 2.37017C16.9679 0.790904 14.9442 0.00146484 12.9202 0.00146484V16.1942H12.9205C14.9442 16.1942 16.9679 15.4047 18.5087 13.8254C21.5898 10.6673 21.5898 5.52832 18.5087 2.37017Z" fill="#FFB89C"/>
<path d="M37.1119 26.5761C35.8881 24.46 34.1452 22.6872 32.0716 21.4497C29.9327 20.173 27.4874 19.4985 24.9999 19.4985C22.5123 19.4985 20.0667 20.173 17.9282 21.4497C15.8546 22.6872 14.1113 24.46 12.8875 26.5761C11.8259 28.4119 11.8099 30.6199 12.8452 32.4822C13.8908 34.3638 15.7737 35.4871 17.8825 35.4871H32.1173C34.2257 35.4871 36.109 34.3638 37.1546 32.4822C38.1895 30.6199 38.1739 28.4119 37.1119 26.5761Z" fill="#2F66D3"/>
<path d="M32.0717 21.45C29.9328 20.1734 27.4876 19.4985 25 19.4985H24.9996V35.4875H32.1175C34.2258 35.4875 36.1091 34.3642 37.1547 32.4826C38.1897 30.6203 38.174 28.4123 37.112 26.5765C35.8883 24.4604 34.1453 22.6876 32.0717 21.45Z" fill="#0843B9"/>
<path d="M30.5882 8.80172C27.5067 5.64357 22.4934 5.64357 19.4119 8.80172C16.3308 11.9599 16.3308 17.0988 19.4119 20.257C20.9527 21.8363 22.9764 22.6257 25 22.6257C27.0237 22.6257 29.0474 21.8363 30.5882 20.257C33.6693 17.0988 33.6693 11.9599 30.5882 8.80172Z" fill="#FFD2BF"/>
<path d="M30.5881 8.80181C29.0474 7.22254 27.0233 6.43311 24.9996 6.43311V22.6258H25C27.0237 22.6258 29.0474 21.8364 30.5881 20.2571C33.6693 17.0989 33.6693 11.96 30.5881 8.80181Z" fill="#FFB89C"/>
</svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -0,0 +1,16 @@
<svg width="50" height="47" viewBox="0 0 50 47" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M23.1996 28.0109C23.1484 29.4902 21.9896 30.6892 20.5018 30.7988C19.1163 30.9 17.7174 30.9524 16.3453 30.9524C14.9732 30.9524 13.5756 30.9 12.19 30.7988C10.7021 30.6892 9.54208 29.4902 9.49218 28.0109C9.2704 21.5355 9.2704 14.976 9.49101 8.51524C9.54218 7.03467 10.7011 5.83692 12.1889 5.72725C13.5743 5.62608 14.9732 5.57373 16.3453 5.57373C17.7174 5.57373 19.1163 5.62608 20.503 5.72725C21.9896 5.83692 23.1497 7.03477 23.2009 8.51524C23.2338 9.47061 23.2605 10.4272 23.2837 11.3861H28.8586C28.8355 10.3626 28.8062 9.34268 28.7709 8.32393C28.6234 3.99317 25.2444 0.486231 20.9112 0.168164C19.3893 0.0560547 17.8539 0 16.3453 0C14.838 0 13.3014 0.0560547 11.7807 0.168164C7.44755 0.486231 4.06845 3.99317 3.91981 8.32393C3.69442 14.9114 3.69442 21.5987 3.92098 28.2009C4.06845 32.5328 7.44745 36.0386 11.7807 36.3578C13.3014 36.4699 14.838 36.526 16.3453 36.526C17.8539 36.526 19.3893 36.4699 20.9112 36.3578C25.2432 36.0386 28.6222 32.5328 28.7709 28.2009C28.7892 27.6562 28.8063 27.1103 28.8221 26.5632H23.2447C23.2313 27.047 23.2167 27.5295 23.1996 28.0109Z" fill="#665E66"/>
<path d="M20.5031 5.72725C19.5879 5.66025 18.6667 5.61758 17.7516 5.59443C18.2219 5.58223 18.6923 5.57373 19.1578 5.57373C20.5299 5.57373 21.9288 5.62607 23.3143 5.72725C24.8022 5.83691 25.961 7.03477 26.0121 8.51524C26.0451 9.47061 26.0718 10.4272 26.095 11.3861H23.2837C23.2606 10.4272 23.2337 9.47061 23.2009 8.51524C23.1497 7.03477 21.9908 5.83691 20.5031 5.72725Z" fill="#544F57"/>
<path d="M14.5923 36.3578C10.2598 36.039 6.88078 32.5325 6.73263 28.2015C6.50675 21.5995 6.50646 14.9119 6.73185 8.32452C6.88019 3.99317 10.2593 0.486817 14.5921 0.168457C15.6432 0.091211 16.7009 0.0421875 17.7519 0.0180664C17.2817 0.00732417 16.8123 0 16.3462 0C14.8383 0 13.3023 0.0566407 11.7808 0.168457C7.44806 0.486914 4.06886 3.99317 3.92052 8.32452C3.69513 14.912 3.69532 21.5996 3.9213 28.2015C4.06954 32.5325 7.44845 36.039 11.781 36.3578C13.3022 36.4698 14.8381 36.5265 16.3461 36.5265C16.8123 36.5265 17.2816 36.5192 17.7518 36.5083C16.7008 36.4842 15.6433 36.4351 14.5923 36.3578Z" fill="#544F57"/>
<path d="M16.3457 43.2305C12.6565 43.2305 8.93619 43.1235 5.22202 42.9112C2.55269 42.7586 0.418311 40.6348 0.249463 37.9664C-0.0826656 32.7191 -0.0832516 27.4538 0.248292 22.2154C0.417139 19.5472 2.55161 17.4235 5.22076 17.2711C8.9316 17.0592 12.6567 16.9521 16.3457 16.9521C20.0346 16.9521 23.7598 17.0592 27.4706 17.2711C30.1398 17.4235 32.2742 19.5473 32.443 22.2154C32.7746 27.4538 32.774 32.7191 32.4419 37.9664C32.2729 40.6348 30.1386 42.7586 27.4693 42.9112C23.7551 43.1235 20.0348 43.2305 16.3457 43.2305Z" fill="#2F66D3"/>
<path d="M6.48729 42.9778C6.06502 42.9583 5.64275 42.9347 5.22195 42.911C2.5533 42.7591 0.418336 40.6353 0.249684 37.9665C-0.0820546 32.7184 -0.0834218 27.4534 0.248219 22.2149C0.416872 19.5477 2.55183 17.4238 5.22049 17.2705C5.64275 17.2468 6.06355 17.2231 6.48582 17.2036C4.91805 18.1233 3.8366 19.7804 3.71541 21.7049C3.3614 27.2834 3.36287 32.8898 3.71678 38.4766C3.83807 40.4012 4.91951 42.0581 6.48729 42.9778Z" fill="#113F99"/>
<path d="M45.6567 45.7926C35.8327 46.16 26.0085 46.16 16.1845 45.7926C14.55 45.7315 13.1948 44.5199 12.9286 42.9061C12.4678 40.1125 12.4678 37.3189 12.9286 34.5253C13.1948 32.9116 14.55 31.7 16.1845 31.6388C26.0085 31.2714 35.8327 31.2714 45.6567 31.6388C47.2912 31.7 48.6464 32.9116 48.9125 34.5253C49.3734 37.3189 49.3734 40.1126 48.9125 42.9061C48.6464 44.5199 47.2912 45.7315 45.6567 45.7926Z" fill="#F9F6F9"/>
<path d="M30.9206 46.8101C25.9878 46.8101 21.055 46.7185 16.1568 46.5354C14.1845 46.4617 12.5184 44.9862 12.1952 43.027C11.7233 40.1661 11.7233 37.2651 12.1952 34.4042C12.5184 32.445 14.1845 30.9696 16.1568 30.8958C25.9534 30.5295 35.888 30.5295 45.6845 30.8958C47.6568 30.9696 49.3229 32.445 49.646 34.4042C50.118 37.2651 50.118 40.1661 49.646 43.027C49.3229 44.9862 47.6569 46.4617 45.6845 46.5354C40.7862 46.7186 35.8534 46.8101 30.9206 46.8101ZM30.9206 32.1078C26.0064 32.1078 21.0922 32.1991 16.2123 32.3815C14.9433 32.4289 13.8708 33.3814 13.6621 34.6462C13.2166 37.3465 13.2166 40.0848 13.6621 42.7851C13.8708 44.0499 14.9433 45.0024 16.2124 45.0498C25.9723 45.4148 35.8694 45.4148 45.629 45.0498C46.8981 45.0024 47.9706 44.0499 48.1792 42.7851C48.6247 40.0848 48.6247 37.3465 48.1792 34.6462C47.9706 33.3814 46.8981 32.4289 45.629 32.3815C40.7491 32.1991 35.8348 32.1078 30.9206 32.1078Z" fill="#E2DFE2"/>
<path d="M22.0325 36.6504C21.8273 36.2948 21.3727 36.173 21.0171 36.3783L19.1994 37.4277V35.3288C19.1994 34.9183 18.8666 34.5854 18.4561 34.5854C18.0455 34.5854 17.7127 34.9183 17.7127 35.3288V37.4277L15.8949 36.3782C15.5394 36.1729 15.0847 36.2948 14.8795 36.6503C14.6742 37.0059 14.796 37.4605 15.1516 37.6657L16.9694 38.7152L15.1516 39.7648C14.796 39.97 14.6742 40.4246 14.8795 40.7802C15.0172 41.0187 15.267 41.152 15.5239 41.152C15.65 41.152 15.7779 41.1198 15.8949 41.0523L17.7127 40.0027V42.1017C17.7127 42.5122 18.0455 42.845 18.4561 42.845C18.8666 42.845 19.1994 42.5122 19.1994 42.1017V40.0027L21.0171 41.0522C21.1342 41.1197 21.262 41.1519 21.3881 41.1519C21.6449 41.1519 21.8948 41.0185 22.0325 40.7801C22.2378 40.4245 22.116 39.9699 21.7605 39.7647L19.9427 38.7151L21.7605 37.6656C22.116 37.4606 22.2378 37.006 22.0325 36.6504Z" fill="#665E66"/>
<path d="M30.2124 36.6503C30.0071 36.2947 29.5524 36.173 29.197 36.3782L27.3792 37.4277V35.3288C27.3792 34.9183 27.0464 34.5854 26.6358 34.5854C26.2253 34.5854 25.8925 34.9183 25.8925 35.3288V37.4277L24.0747 36.3782C23.7191 36.1729 23.2645 36.2948 23.0593 36.6503C22.854 37.0059 22.9758 37.4605 23.3313 37.6657L25.1491 38.7152L23.3313 39.7648C22.9758 39.97 22.854 40.4246 23.0593 40.7802C23.197 41.0187 23.4468 41.152 23.7037 41.152C23.8298 41.152 23.9576 41.1198 24.0747 41.0523L25.8925 40.0027V42.1017C25.8925 42.5122 26.2253 42.845 26.6358 42.845C27.0464 42.845 27.3792 42.5122 27.3792 42.1017V40.0027L29.197 41.0523C29.314 41.1198 29.4419 41.152 29.568 41.152C29.8248 41.152 30.0747 41.0186 30.2124 40.7802C30.4177 40.4246 30.2959 39.97 29.9403 39.7648L28.1225 38.7152L29.9403 37.6657C30.2958 37.4605 30.4177 37.0059 30.2124 36.6503Z" fill="#665E66"/>
<path d="M38.392 36.6503C38.1867 36.2947 37.7321 36.173 37.3766 36.3782L35.5588 37.4277V35.3288C35.5588 34.9183 35.226 34.5854 34.8154 34.5854C34.4049 34.5854 34.0721 34.9183 34.0721 35.3288V37.4277L32.2543 36.3782C31.8987 36.1729 31.4442 36.2948 31.2389 36.6503C31.0336 37.0059 31.1554 37.4605 31.511 37.6657L33.3287 38.7152L31.511 39.7648C31.1554 39.97 31.0336 40.4246 31.2389 40.7802C31.3766 41.0187 31.6264 41.152 31.8833 41.152C32.0094 41.152 32.1372 41.1198 32.2543 41.0523L34.0721 40.0027V42.1017C34.0721 42.5122 34.4049 42.845 34.8154 42.845C35.226 42.845 35.5588 42.5122 35.5588 42.1017V40.0027L37.3766 41.0523C37.4937 41.1198 37.6215 41.152 37.7476 41.152C38.0044 41.152 38.2543 41.0186 38.392 40.7802C38.5973 40.4246 38.4755 39.97 38.1199 39.7648L36.3022 38.7152L38.1199 37.6657C38.4755 37.4605 38.5974 37.0059 38.392 36.6503Z" fill="#665E66"/>
<path d="M46.2998 39.7648L44.482 38.7153L46.2998 37.6658C46.6553 37.4605 46.7771 37.006 46.5718 36.6504C46.3666 36.2948 45.912 36.173 45.5564 36.3783L43.7387 37.4277V35.3288C43.7387 34.9183 43.4059 34.5854 42.9954 34.5854C42.5848 34.5854 42.252 34.9183 42.252 35.3288V37.4277L40.4342 36.3782C40.0788 36.1728 39.6241 36.2948 39.4188 36.6503C39.2135 37.0059 39.3353 37.4605 39.6909 37.6657L41.5087 38.7152L39.6909 39.7647C39.3353 39.97 39.2135 40.4246 39.4188 40.7802C39.5565 41.0187 39.8063 41.152 40.0633 41.152C40.1893 41.152 40.3172 41.1198 40.4342 41.0523L42.252 40.0027V42.1017C42.252 42.5122 42.5848 42.845 42.9954 42.845C43.4059 42.845 43.7387 42.5122 43.7387 42.1017V40.0027L45.5564 41.0522C45.6735 41.1197 45.8013 41.1519 45.9274 41.1519C46.1843 41.1519 46.4342 41.0185 46.5718 40.7801C46.7771 40.4247 46.6553 39.9701 46.2998 39.7648Z" fill="#665E66"/>
<path d="M31.497 12.9282C31.3905 12.9282 31.2824 12.9052 31.1797 12.8566C30.8086 12.6811 30.6501 12.2379 30.8256 11.8667L32.2594 8.83539C32.4348 8.46429 32.8778 8.3056 33.2492 8.48128C33.6203 8.65677 33.7788 9.09994 33.6033 9.47113L32.1695 12.5025C32.0426 12.7709 31.7756 12.9282 31.497 12.9282Z" fill="#DD636E"/>
<path d="M35.9749 18.4053C35.8684 18.4053 35.7603 18.3823 35.6577 18.3337L32.6263 16.8999C32.2552 16.7244 32.0966 16.2812 32.2722 15.9102C32.4477 15.539 32.8909 15.3803 33.2619 15.5561L36.2933 16.9898C36.6644 17.1653 36.823 17.6085 36.6474 17.9796C36.5204 18.2479 36.2535 18.4053 35.9749 18.4053Z" fill="#DD636E"/>
<path d="M33.0582 14.6501C32.7531 14.6501 32.467 14.4607 32.3583 14.1569C32.2201 13.7704 32.4212 13.345 32.8079 13.2066L35.9652 12.077C36.3516 11.9384 36.7772 12.1399 36.9155 12.5265C37.0538 12.913 36.8526 13.3384 36.466 13.4768L33.3086 14.6065C33.2258 14.636 33.1414 14.6501 33.0582 14.6501Z" fill="#DD636E"/>
</svg>

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@ -0,0 +1,16 @@
<svg width="50" height="47" viewBox="0 0 50 47" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.050207 16.6458L13.9217 0.0702664C13.9567 0.0293291 14.006 0.00427301 14.0588 0.000497841C14.1116 -0.00327733 14.1637 0.0145307 14.2039 0.0500842L34.7517 18.4102C34.7913 18.4471 34.8155 18.4985 34.8192 18.5534C34.8228 18.6084 34.8056 18.6627 34.7713 18.7049L20.9002 35.28C20.8646 35.3212 20.8149 35.3463 20.7617 35.3502C20.7084 35.354 20.6558 35.3363 20.615 35.3007L0.0701289 16.9403C0.0498928 16.9225 0.0333082 16.9006 0.0213466 16.876C0.00938493 16.8515 0.00228675 16.8247 0.000467822 16.7973C-0.00135111 16.7698 0.00214579 16.7423 0.0107537 16.7163C0.0193615 16.6903 0.0329073 16.6663 0.0505976 16.6458H0.050207Z" fill="#006694"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.25498 8.84241L18.9388 4.27979L34.7517 18.4101C34.7913 18.447 34.8155 18.4983 34.8191 18.5533C34.8228 18.6083 34.8056 18.6626 34.7712 18.7047L20.9002 35.2799C20.8646 35.321 20.8149 35.3462 20.7616 35.3501C20.7084 35.3539 20.6558 35.3362 20.615 35.3006L19.6316 34.4198L8.84453 9.97656C8.75381 9.7699 8.74603 9.53452 8.82291 9.32194C8.89978 9.10937 9.05504 8.93694 9.25469 8.84241H9.25498Z" fill="#005C85"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.51445 9.43176L28.8107 0.341312C28.8592 0.318978 28.9142 0.317281 28.9638 0.336589C29.0134 0.355897 29.0537 0.394651 29.0759 0.444444L40.3447 25.9838C40.3561 26.0086 40.3626 26.0354 40.3639 26.0627C40.3652 26.0901 40.3612 26.1174 40.3522 26.1432C40.3432 26.169 40.3293 26.1926 40.3114 26.2128C40.2935 26.233 40.2719 26.2493 40.2478 26.2607L20.9514 35.3508C20.9025 35.3729 20.8472 35.3745 20.7972 35.3552C20.7472 35.336 20.7064 35.2974 20.6834 35.2476L9.41465 9.70906C9.39278 9.65861 9.391 9.6013 9.40967 9.54949C9.42834 9.49769 9.46598 9.45554 9.51445 9.43216V9.43176Z" fill="#60B7FF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.9686 6.30322H31.662L40.3447 25.9836C40.3561 26.0083 40.3627 26.0351 40.364 26.0625C40.3653 26.0898 40.3613 26.1172 40.3523 26.1429C40.3433 26.1687 40.3294 26.1924 40.3115 26.2125C40.2936 26.2327 40.2719 26.249 40.2479 26.2605L20.9515 35.3505C20.9026 35.3726 20.8473 35.3742 20.7973 35.3549C20.7473 35.3357 20.7065 35.2971 20.6835 35.2474L20.1419 34.0163V7.16037C20.1417 7.04799 20.1629 6.93666 20.2043 6.83275C20.2457 6.72884 20.3066 6.63438 20.3833 6.55478C20.4601 6.47517 20.5513 6.41199 20.6517 6.36882C20.7522 6.32566 20.8598 6.30337 20.9686 6.30322Z" fill="#56A5E6"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.9686 6.95166H36.7615L42.3773 12.7547V35.2278C42.3771 35.2832 42.3557 35.3362 42.3178 35.3754C42.2799 35.4146 42.2286 35.4367 42.175 35.437H20.9686C20.9422 35.4368 20.9161 35.4312 20.8918 35.4206C20.8675 35.41 20.8454 35.3946 20.8269 35.3751C20.8083 35.3557 20.7937 35.3327 20.7838 35.3074C20.7739 35.2821 20.7689 35.2551 20.7691 35.2278V7.16075C20.7689 7.13347 20.7739 7.10642 20.7838 7.08114C20.7937 7.05586 20.8084 7.03285 20.8269 7.01343C20.8454 6.99401 20.8675 6.97856 20.8918 6.96796C20.9161 6.95736 20.9422 6.95182 20.9686 6.95166Z" fill="#EAF6FF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M36.7614 6.95166V11.4523C36.7621 11.7974 36.895 12.1281 37.1311 12.3721C37.3672 12.6161 37.6873 12.7534 38.0212 12.7541H42.3767L36.7614 6.95166Z" fill="#BEC7CF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M25.826 26.741H42.3972C43.2371 26.7436 44.0419 27.0896 44.6358 27.7033C45.2298 28.317 45.5646 29.1486 45.5671 30.0166V43.4697C45.565 44.3377 45.2304 45.1697 44.6364 45.7835C44.0423 46.3974 43.2373 46.7432 42.3972 46.7454H13.0179C12.178 46.7427 11.3731 46.3968 10.7792 45.783C10.1853 45.1693 9.85045 44.3376 9.8479 43.4697V23.4653C9.84976 22.7521 10.125 22.0687 10.6133 21.5646C11.1016 21.0606 11.7633 20.777 12.4535 20.7759H17.9866C18.9046 20.7759 19.5289 21.3591 20.1845 22.019L23.6281 25.4978C24.2838 26.1606 24.9081 26.741 25.826 26.741Z" fill="#999999"/>
<path d="M24.2211 12.6755C24.0358 12.6732 23.8588 12.5956 23.7286 12.4593C23.5983 12.3231 23.5252 12.1393 23.5252 11.9478C23.5252 11.7563 23.5983 11.5725 23.7286 11.4363C23.8588 11.3001 24.0358 11.2225 24.2211 11.2202H33.5315C33.7168 11.2225 33.8938 11.3001 34.0241 11.4363C34.1544 11.5725 34.2274 11.7563 34.2274 11.9478C34.2274 12.1393 34.1544 12.3231 34.0241 12.4593C33.8938 12.5956 33.7168 12.6732 33.5315 12.6755H24.2211ZM24.2211 23.2914C24.0344 23.2914 23.8553 23.2147 23.7233 23.0783C23.5912 22.9418 23.517 22.7568 23.517 22.5638C23.517 22.3709 23.5912 22.1858 23.7233 22.0493C23.8553 21.9129 24.0344 21.8362 24.2211 21.8362H38.925C39.1117 21.8362 39.2908 21.9129 39.4229 22.0493C39.5549 22.1858 39.6291 22.3709 39.6291 22.5638C39.6291 22.7568 39.5549 22.9418 39.4229 23.0783C39.2908 23.2147 39.1117 23.2914 38.925 23.2914H24.2211ZM24.2211 19.7536C24.0358 19.7514 23.8588 19.6737 23.7286 19.5375C23.5983 19.4013 23.5252 19.2175 23.5252 19.026C23.5252 18.8345 23.5983 18.6507 23.7286 18.5145C23.8588 18.3783 24.0358 18.3006 24.2211 18.2984H38.925C39.0182 18.2972 39.1106 18.3152 39.197 18.3513C39.2834 18.3873 39.362 18.4408 39.4283 18.5084C39.4946 18.5761 39.5472 18.6567 39.5831 18.7456C39.619 18.8344 39.6375 18.9297 39.6375 19.026C39.6375 19.1223 39.619 19.2176 39.5831 19.3064C39.5472 19.3953 39.4946 19.4759 39.4283 19.5436C39.362 19.6112 39.2834 19.6647 39.197 19.7007C39.1106 19.7368 39.0182 19.7548 38.925 19.7536H24.2211ZM24.2211 16.2158C24.1287 16.2158 24.0371 16.1969 23.9517 16.1604C23.8663 16.1238 23.7886 16.0702 23.7233 16.0027C23.6579 15.9351 23.606 15.8549 23.5706 15.7666C23.5352 15.6783 23.517 15.5837 23.517 15.4882C23.517 15.3926 23.5352 15.298 23.5706 15.2098C23.606 15.1215 23.6579 15.0413 23.7233 14.9737C23.7886 14.9061 23.8663 14.8526 23.9517 14.816C24.0371 14.7794 24.1287 14.7606 24.2211 14.7606H38.925C39.0175 14.7606 39.109 14.7794 39.1945 14.816C39.2799 14.8526 39.3575 14.9061 39.4229 14.9737C39.4883 15.0413 39.5401 15.1215 39.5755 15.2098C39.6109 15.298 39.6291 15.3926 39.6291 15.4882C39.6291 15.5837 39.6109 15.6783 39.5755 15.7666C39.5401 15.8549 39.4883 15.9351 39.4229 16.0027C39.3575 16.0702 39.2799 16.1238 39.1945 16.1604C39.109 16.1969 39.0175 16.2158 38.925 16.2158H24.2211Z" fill="#BEC7CF"/>
<path d="M14.3209 37.961C14.1341 37.961 13.955 37.8844 13.823 37.7479C13.6909 37.6115 13.6168 37.4264 13.6168 37.2334C13.6168 37.0405 13.6909 36.8554 13.823 36.719C13.955 36.5825 14.1341 36.5059 14.3209 36.5059H21.1882C21.3749 36.5059 21.554 36.5825 21.6861 36.719C21.8181 36.8554 21.8923 37.0405 21.8923 37.2334C21.8923 37.4264 21.8181 37.6115 21.6861 37.7479C21.554 37.8844 21.3749 37.961 21.1882 37.961H14.3209ZM14.3209 42.9304C14.1341 42.9304 13.955 42.8538 13.823 42.7173C13.6909 42.5809 13.6168 42.3958 13.6168 42.2028C13.6168 42.0099 13.6909 41.8248 13.823 41.6884C13.955 41.5519 14.1341 41.4753 14.3209 41.4753H41.0945C41.2813 41.4753 41.4603 41.5519 41.5924 41.6884C41.7244 41.8248 41.7986 42.0099 41.7986 42.2028C41.7986 42.3958 41.7244 42.5809 41.5924 42.7173C41.4603 42.8538 41.2813 42.9304 41.0945 42.9304H14.3209Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M42.3772 27.2918C42.8122 27.5904 43.169 27.9953 43.4162 28.4706C43.6633 28.9458 43.7932 29.4768 43.7941 30.0164V43.4697C43.7921 44.3378 43.4574 45.1697 42.8634 45.7835C42.2693 46.3974 41.4642 46.7432 40.6241 46.7454H42.3973C43.2374 46.7432 44.0424 46.3974 44.6365 45.7835C45.2305 45.1697 45.5651 44.3377 45.5672 43.4697V30.0166C45.5678 29.5868 45.4855 29.1612 45.3249 28.7647C45.0838 28.1671 44.6774 27.6563 44.1566 27.2963C43.6358 26.9364 43.0238 26.7432 42.3973 26.741H40.6241C41.2484 26.7409 41.8586 26.9326 42.3772 27.2918ZM23.6282 25.4978L20.769 22.6111L20.1846 22.019C19.529 21.3591 18.9047 20.7759 17.9867 20.7759H16.2165C17.1315 20.7759 17.7559 21.3591 18.4115 22.019L20.769 24.3991L21.858 25.4978C22.5108 26.1606 23.1351 26.741 24.053 26.741H25.8261C24.9081 26.741 24.2839 26.1606 23.6282 25.4978Z" fill="#C4C4C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M43.9992 36.4122C45.1861 36.4122 46.3463 36.0485 47.3331 35.3672C48.3199 34.6859 49.089 33.7174 49.5432 32.5844C49.9974 31.4514 50.1162 30.2046 49.8847 29.0018C49.6531 27.799 49.0816 26.6941 48.2424 25.8269C47.4032 24.9597 46.334 24.3691 45.1699 24.1299C44.0059 23.8906 42.7994 24.0134 41.7029 24.4827C40.6064 24.9521 39.6692 25.7468 39.0098 26.7665C38.3505 27.7862 37.9985 28.9851 37.9985 30.2115C38.0015 31.8551 38.6347 33.4305 39.7594 34.5927C40.8841 35.7549 42.4087 36.4091 43.9992 36.4122Z" fill="#25C73B"/>
<path d="M40.4132 31.0537C40.3461 30.9865 40.2926 30.9063 40.2558 30.8176C40.2189 30.7289 40.1996 30.6335 40.1988 30.537C40.1979 30.4405 40.2157 30.3448 40.251 30.2554C40.2863 30.1661 40.3385 30.0849 40.4044 30.0166C40.4704 29.9482 40.5488 29.8941 40.6352 29.8574C40.7216 29.8207 40.8142 29.8021 40.9076 29.8027C41.001 29.8033 41.0933 29.8231 41.1792 29.8609C41.2652 29.8987 41.343 29.9538 41.4081 30.023L42.7593 31.4192L46.5874 27.4634C46.7193 27.3271 46.8983 27.2505 47.0849 27.2505C47.2714 27.2505 47.4504 27.3271 47.5823 27.4634C47.7142 27.5997 47.7884 27.7846 47.7884 27.9774C47.7884 28.1702 47.7143 28.3551 47.5824 28.4914L43.2553 32.9625C43.1231 33.0984 42.9443 33.1746 42.7579 33.1746C42.5715 33.1746 42.3926 33.0984 42.2605 32.9625L40.4132 31.0537Z" fill="#EAF6FF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M43.4891 24.0313C44.9614 24.1603 46.3359 24.846 47.3494 25.957C48.363 27.068 48.9443 28.5263 48.9821 30.0526C49.0198 31.5789 48.5114 33.066 47.5542 34.2291C46.597 35.3922 45.2582 36.1496 43.7942 36.3562C43.6944 36.3709 43.5917 36.3827 43.4891 36.3915C43.5917 36.4004 43.6916 36.4063 43.7942 36.4093C43.8626 36.4122 43.9309 36.4122 43.9993 36.4122C44.5288 36.4132 45.0562 36.3409 45.5671 36.1972C46.9711 35.8044 48.1893 34.8981 48.995 33.6468C49.8008 32.3955 50.1393 30.8844 49.9476 29.3945C49.7559 27.9046 49.0471 26.5373 47.9529 25.547C46.8588 24.5567 45.4538 24.0108 43.9993 24.0107C43.8282 24.0107 43.6575 24.0166 43.489 24.0309L43.4891 24.0313Z" fill="#21B335"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M41.0944 12.7544V24.7818C41.5001 24.5501 41.9306 24.3682 42.3772 24.2398V12.7544H41.0944Z" fill="#D3DDE6"/>
</svg>

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

@ -1,210 +1,23 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/app_layout/model/space_model.dart';
import 'package:syncrow_app/features/devices/model/ac_model.dart';
import 'package:syncrow_app/features/devices/model/curtain_model.dart';
import 'package:syncrow_app/features/devices/model/device_category_model.dart';
import 'package:syncrow_app/features/devices/model/light_model.dart';
import 'package:syncrow_app/features/devices/model/room_model.dart';
import 'package:syncrow_app/features/devices/view/widgets/ACs/acs_view.dart';
import 'package:syncrow_app/features/devices/view/widgets/curtains/curtain_view.dart';
import 'package:syncrow_app/features/devices/view/widgets/gateway/gateway_view.dart';
import 'package:syncrow_app/features/devices/view/widgets/lights/lights_view.dart';
import 'package:syncrow_app/features/devices/view/widgets/smart_door/door_view.dart';
import 'package:syncrow_app/generated/assets.dart';
import 'package:syncrow_app/utils/resource_manager/constants.dart';
import 'package:syncrow_app/services/api/network_exception.dart';
import 'package:syncrow_app/services/api/spaces_api.dart';
part 'spaces_state.dart';
class SpacesCubit extends Cubit<SpacesState> {
SpacesCubit() : super(SpacesInitial());
SpacesCubit() : super(SpacesInitial()) {
fetchSpaces();
}
static SpacesCubit get(context) => BlocProvider.of(context);
static List<SpaceModel> spaces = [
SpaceModel(
id: '0',
name: 'Home',
rooms: [
RoomModel(id: '0', name: 'Living Room', categories: [
DevicesCategoryModel(
devices: [
ACModel(
name: "Living Room AC",
id: '0',
status: false,
temperature: 20,
fanSpeed: 0,
tempMode: 0,
coolTo: 20,
type: DeviceType.AC,
image: '',
timer: null,
bounds: Bounds(
min: 20,
max: 30,
),
),
],
icon: Assets.iconsAC,
name: 'ACs',
type: DeviceType.AC,
page: const ACsView(),
),
DevicesCategoryModel(
devices: [
LightModel(
name: "Living Room Light",
id: '0',
status: false,
color: 0,
brightness: 20,
lightingMode: 1,
timer: null,
type: DeviceType.Lights,
image: '',
recentColors: [
0xFF83D9FF,
0xFFFC3E81,
0xFFC0FF66,
0xFFFDC242,
],
),
],
icon: Assets.iconsLight,
name: 'Lights',
type: DeviceType.Lights,
page: const LightsView(),
),
DevicesCategoryModel(
devices: [],
icon: Assets.iconsDoorLock,
name: 'Doors',
type: DeviceType.Door,
page: const DoorView(),
),
DevicesCategoryModel(
devices: [
CurtainModel(
openPercentage: 10,
id: "1",
name: "Living Room Curtain",
status: false,
type: DeviceType.Curtain,
image: '',
timer: null,
),
],
icon: Assets.iconsCurtain,
name: 'Curtains',
type: DeviceType.Curtain,
page: const CurtainView(),
),
DevicesCategoryModel(
devices: [],
icon: Assets.iconsGateway,
name: 'Gateway',
type: DeviceType.Gateway,
page: const GateWayView(),
),
]),
RoomModel(id: '1', name: 'Bedroom', categories: [
DevicesCategoryModel(
devices: [
ACModel(
name: "Living Room AC",
id: '0',
status: false,
temperature: 20,
fanSpeed: 0,
tempMode: 0,
coolTo: 20,
type: DeviceType.AC,
image: '',
timer: null,
bounds: Bounds(
min: 20,
max: 30,
),
),
],
icon: Assets.iconsAC,
name: 'ACs',
type: DeviceType.AC,
page: const ACsView(),
),
DevicesCategoryModel(
devices: [
LightModel(
name: "Living Room Light",
id: '0',
status: false,
color: 0,
brightness: 20,
lightingMode: 1,
timer: null,
type: DeviceType.Lights,
image: '',
recentColors: [
0xFF83D9FF,
0xFFFC3E81,
0xFFC0FF66,
0xFFFDC242,
],
),
],
icon: Assets.iconsLight,
name: 'Lights',
type: DeviceType.Lights,
page: const LightsView(),
),
DevicesCategoryModel(
devices: [],
icon: Assets.iconsDoorLock,
name: 'Doors',
type: DeviceType.Door,
page: const DoorView(),
),
DevicesCategoryModel(
devices: [
CurtainModel(
openPercentage: 10,
id: "1",
name: "Living Room Curtain",
status: false,
type: DeviceType.Curtain,
image: '',
timer: null,
),
],
icon: Assets.iconsCurtain,
name: 'Curtains',
type: DeviceType.Curtain,
page: const CurtainView(),
),
DevicesCategoryModel(
devices: [],
icon: Assets.iconsGateway,
name: 'Gateway',
type: DeviceType.Gateway,
page: const GateWayView(),
),
]),
],
),
SpaceModel(
id: '1',
name: 'Office',
rooms: [],
),
SpaceModel(
id: '2',
name: 'Parent\'s House',
rooms: [],
),
];
static List<SpaceModel> spaces = [];
SpaceModel selectedSpace = spaces.first;
SpaceModel? selectedSpace = spaces.isNotEmpty ? spaces.first : null;
RoomModel? selectedRoom;
@ -229,7 +42,7 @@ class SpacesCubit extends Cubit<SpacesState> {
if (index == 0) {
unselectRoom();
} else {
selectedRoom = selectedSpace.rooms[index - 1];
selectedRoom = selectedSpace!.rooms![index - 1];
}
emit(RoomSelected(selectedRoom!));
}
@ -244,7 +57,7 @@ class SpacesCubit extends Cubit<SpacesState> {
if (index == 0) {
unselectRoom();
} else {
selectedRoom = selectedSpace.rooms[index - 1];
selectedRoom = selectedSpace!.rooms![index - 1];
}
emit(RoomSelected(selectedRoom!));
}
@ -266,5 +79,16 @@ class SpacesCubit extends Cubit<SpacesState> {
emit(RoomUnSelected());
}
//TODO implement the methods to fetch the spaces from the API
fetchSpaces() async {
emit(SpacesLoading());
try {
spaces = await SpacesAPI.getSpaces();
emit(SpacesLoaded(spaces));
} on DioException catch (e) {
emit(SpacesError(e.message ?? "Something went wrong"));
throw ServerFailure.fromDioError(e);
} catch (e) {
emit(SpacesError(e.toString()));
}
}
}

View File

@ -12,6 +12,12 @@ class SpacesLoaded extends SpacesState {
SpacesLoaded(this.spaces);
}
class SpacesError extends SpacesState {
final String errMessage;
SpacesError(this.errMessage);
}
class SpacesSelected extends SpacesState {
final SpaceModel space;

View File

@ -1,9 +1,9 @@
import 'package:syncrow_app/features/devices/model/room_model.dart';
class SpaceModel {
final String id;
final String name;
final List<RoomModel> rooms;
final int? id;
final String? name;
final List<RoomModel>? rooms;
SpaceModel({
required this.id,
@ -21,9 +21,9 @@ class SpaceModel {
factory SpaceModel.fromJson(Map<String, dynamic> json) {
return SpaceModel(
id: json['id'],
name: json['name'],
rooms: json['rooms'],
id: int.parse(json['homeId']),
name: json['homeName'],
rooms: [],
);
}
}

View File

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.dart';
import 'package:syncrow_app/features/app_layout/bloc/spaces_cubit.dart';
import 'package:syncrow_app/features/app_layout/view/widgets/app_body.dart';
import 'package:syncrow_app/features/app_layout/view/widgets/default_app_bar.dart';
import 'package:syncrow_app/features/app_layout/view/widgets/default_nav_bar.dart';
@ -20,13 +21,18 @@ class AppLayout extends StatelessWidget {
statusBarIconBrightness: Brightness.light,
),
child: SafeArea(
child: Scaffold(
child: BlocBuilder<SpacesCubit, SpacesState>(
builder: (context, state) {
return Scaffold(
backgroundColor: ColorsManager.backgroundColor,
extendBodyBehindAppBar: true,
extendBody: true,
appBar: DefaultAppBar(context),
appBar: state is SpacesLoaded ? DefaultAppBar(context) : null,
body: const AppBody(),
bottomNavigationBar: const DefaultNavBar(),
bottomNavigationBar:
state is SpacesLoaded ? const DefaultNavBar() : null,
);
},
),
),
);

View File

@ -50,7 +50,7 @@ class AppBarHomeDropdown extends StatelessWidget {
const SizedBox(width: 5),
Expanded(
child: BodyMedium(
text: space.name,
text: space.name ?? "",
style: context.bodyMedium.copyWith(
fontSize: 15,
color: ColorsManager.textPrimaryColor,

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.dart';
import 'package:syncrow_app/features/app_layout/bloc/spaces_cubit.dart';
import '../../../../generated/assets.dart';
@ -25,11 +26,26 @@ class AppBody extends StatelessWidget {
opacity: 0.4,
),
),
child: PageView(
child: BlocConsumer<SpacesCubit, SpacesState>(
listener: (context, state) {
if (state is SpacesError) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(state.errMessage),
),
);
}
},
builder: (context, state) {
return state is! SpacesLoading
? PageView(
physics: const NeverScrollableScrollPhysics(),
controller: NavCubit.of(context).pageController,
children: NavCubit.of(context).pages,
)
: const Center(child: CircularProgressIndicator());
},
)
// NavCubit.of(context).currentPage,
);
},

View File

@ -8,7 +8,6 @@ import 'package:syncrow_app/features/auth/model/token.dart';
import 'package:syncrow_app/features/auth/model/user_model.dart';
import 'package:syncrow_app/services/api/authentication_api.dart';
import 'package:syncrow_app/services/api/network_exception.dart';
import 'package:syncrow_app/utils/resource_manager/constants.dart';
part 'auth_state.dart';
@ -35,9 +34,9 @@ class AuthCubit extends Cubit<AuthState> {
emit(AuthAgreeToTermsChanged());
}
UserModel? user;
static UserModel? user;
Token token = Token.emptyConstructor();
static Token token = Token.emptyConstructor();
// (FlutterSecureStorage().read(key :'token'));
@ -54,7 +53,7 @@ class AuthCubit extends Cubit<AuthState> {
if (token.accessTokenIsNotEmpty) {
FlutterSecureStorage storage = const FlutterSecureStorage();
await storage.write(
key: Constants.tokenAccessKey, value: token.accessToken);
key: Token.loginAccessTokenKey, value: token.accessToken);
user = UserModel.fromToken(token);
emit(AuthSuccess());
@ -62,6 +61,7 @@ class AuthCubit extends Cubit<AuthState> {
emit(AuthError('Something went wrong'));
}
} on DioException catch (e) {
emit(AuthError(e.message ?? "Something went wrong"));
throw ServerFailure.fromDioError(e);
}
}
@ -70,7 +70,7 @@ class AuthCubit extends Cubit<AuthState> {
emit(AuthLoading());
try {
FlutterSecureStorage storage = const FlutterSecureStorage();
await storage.delete(key: Constants.tokenAccessKey);
await storage.delete(key: Token.loginAccessTokenKey);
emit(AuthLoggedOut());
} on DioException catch (e) {
throw ServerFailure.fromDioError(e);

View File

@ -4,8 +4,8 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:syncrow_app/utils/helpers/decode_base64.dart';
class Token {
static const String loginAccessToken = 'access_token';
static const String loginRefreshToken = 'refreshToken';
static const String loginAccessTokenKey = 'access_token';
static const String loginRefreshTokenKey = 'refreshToken';
final String accessToken;
final String refreshToken;
@ -16,6 +16,10 @@ class Token {
bool get accessTokenIsNotEmpty => accessToken.isNotEmpty;
bool get refreshTokenIsNotEmpty => refreshToken.isNotEmpty;
bool get isNotEmpty => accessToken.isNotEmpty && refreshToken.isNotEmpty;
Token(
this.accessToken,
this.refreshToken,
@ -26,13 +30,17 @@ class Token {
factory Token.fromJson(Map<String, dynamic> json) {
//save token to secure storage
var storage = const FlutterSecureStorage();
storage.write(key: loginAccessToken, value: json[loginAccessToken] ?? '');
storage.write(
key: loginAccessTokenKey, value: json[loginAccessTokenKey] ?? '');
//create token object ?
return Token(json[loginAccessToken] ?? '', json[loginRefreshToken] ?? '');
return Token(
json[loginAccessTokenKey] ?? '', json[loginRefreshTokenKey] ?? '');
}
Map<String, String> toJson() => {loginRefreshToken: refreshToken};
Map<String, String> toJson() => {loginRefreshTokenKey: refreshToken};
Map<String, String> accessTokenToJson() => {loginAccessTokenKey: accessToken};
Map<String, dynamic> decodeToken() {
final parts = accessToken.split('.');

View File

@ -1,7 +1,7 @@
import 'package:syncrow_app/features/auth/model/token.dart';
class UserModel {
final String? id;
final String? uuid;
final String? email;
final String? name;
final String? photoUrl;
@ -12,18 +12,8 @@ class UserModel {
final bool? isAgreementAccepted;
//token decoded with jwt
//{
// "email": "Test@Test.com",
// "userId": 2,
// "uuid": "e145438c-4c62-4535-a0f4-f77958f9f9f4",
// "sessionId": "0409a7a1-6ef5-42c5-b3a1-1f15c639b301",
// "iat": 1709711675,
// "exp": 1709711975
// }
UserModel({
required this.id,
required this.uuid,
required this.email,
required this.name,
required this.photoUrl,
@ -34,7 +24,7 @@ class UserModel {
factory UserModel.fromJson(Map<String, dynamic> json) {
return UserModel(
id: json['id'],
uuid: json['id'],
email: json['email'],
name: json['name'],
photoUrl: json['photoUrl'],
@ -44,12 +34,18 @@ class UserModel {
);
}
//uuid to json
Map<String, dynamic> uuIdAsJson() => {
'userUuid': uuid,
};
//from token
factory UserModel.fromToken(Token token) {
Map<String, dynamic> tempJson = token.decodeToken();
return UserModel(
id: tempJson['uuid'].toString(),
uuid: tempJson['uuid'].toString(),
email: tempJson['email'],
name: null,
photoUrl: null,
@ -61,7 +57,7 @@ class UserModel {
Map<String, dynamic> toJson() {
return {
'id': id,
'id': uuid,
'email': email,
'name': name,
'photoUrl': photoUrl,

View File

@ -46,7 +46,10 @@ class DevicesViewBody extends StatelessWidget {
},
children: [
const WizardPage(),
...SpacesCubit.get(context).selectedSpace.rooms.map(
...SpacesCubit.get(context)
.selectedSpace!
.rooms!
.map(
(room) {
return RoomPage(
room: room,

View File

@ -40,15 +40,15 @@ class RoomsSlider extends StatelessWidget {
),
),
),
...SpacesCubit.get(context).selectedSpace.rooms.map(
...SpacesCubit.get(context).selectedSpace!.rooms!.map(
(room) => Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: InkWell(
onTap: () {
SpacesCubit.get(context).roomSliderPageChanged(
SpacesCubit.get(context)
.selectedSpace
.rooms
.selectedSpace!
.rooms!
.indexOf(room));
},
child: TitleMedium(

View File

@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_app/features/auth/model/token.dart';
import 'package:syncrow_app/generated/assets.dart';
import 'package:syncrow_app/navigation/routing_constants.dart';
import 'package:syncrow_app/utils/resource_manager/constants.dart';
class SplashView extends StatelessWidget {
const SplashView({super.key});
@ -13,7 +13,7 @@ class SplashView extends StatelessWidget {
//TODO remove this delay
Future.value().then((value) async {
var isLoggedIn = await const FlutterSecureStorage()
.read(key: Constants.tokenAccessKey) !=
.read(key: Token.loginAccessTokenKey) !=
null;
if (isLoggedIn) {
Navigator.pushReplacementNamed(context, Routes.homeRoute);

View File

@ -2,11 +2,9 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:syncrow_app/services/locator.dart';
import 'package:syncrow_app/utils/bloc_observer.dart';
import 'package:syncrow_app/utils/helpers/localization_helpers.dart';
import 'package:syncrow_app/utils/resource_manager/constants.dart';
import 'my_app.dart';
@ -35,11 +33,6 @@ void main() {
initialSetup();
//final SharedPreferences prefs = await SharedPreferences.getInstance();
// var isLoggedIn = (prefs.getBool('isLoggedIn') == null) ? false : prefs.getBool('isLoggedIn');
//
var storage = const FlutterSecureStorage();
bool isLoggedIn =
await (storage.read(key: Constants.tokenAccessKey)) != null;
//to save the locale in the shared preferences
await LocalizationService.saveLocale(const Locale("en", "AE"));

View File

@ -1,6 +1,7 @@
abstract class ApiEndpoints {
static const String baseUrl = 'http://100.107.182.63:4001';
static const String baseUrl = 'https://syncrow.azurewebsites.net';
// Authentication
static const String signUp = '$baseUrl/authentication/user/signup';
static const String login = '$baseUrl/authentication/user/login';
static const String deleteUser = '$baseUrl/authentication/user/delete/{id}';
@ -8,4 +9,7 @@ abstract class ApiEndpoints {
static const String verifyOtp = '$baseUrl/authentication/user/verify-otp';
static const String forgetPassword =
'$baseUrl/authentication/user/forget-password';
// Spaces
static const String spaces = '$baseUrl/home';
}

View File

@ -24,10 +24,7 @@ class AuthenticationAPI {
path: ApiEndpoints.login,
body: model.toJson(),
showServerMessage: false,
expectedResponseModel: (json) {
Token token = Token.fromJson(json['data']);
return token;
});
expectedResponseModel: (json) => Token.fromJson(json['data']));
debugPrint("response: $response");
return response;
}

View File

@ -1,4 +1,5 @@
import 'package:dio/dio.dart';
import 'package:syncrow_app/features/auth/bloc/auth_cubit.dart';
class HTTPInterceptor extends InterceptorsWrapper {
// @override
@ -7,36 +8,38 @@ class HTTPInterceptor extends InterceptorsWrapper {
// return handler.next(response);
// }
//
// @override
// void onRequest(RequestOptions options,
// RequestInterceptorHandler handler) async {
// // TODO: Implement logic for adding headers to requests.
// // This method is called before a request is sent.
// super.onRequest(options, handler);
// }
//
// @override
// void onError(DioException err, ErrorInterceptorHandler handler) async {
// // TODO: Implement error handling logic.
// // This method is called when an error occurs during a request.
// super.onError(err, handler);
// }
//
// /// Validates the response and returns true if it is successful (status code 2xx).
// Future<bool> validateResponse(Response response) async {
// if (response.statusCode != null) {
// if (response.statusCode! >= 200 && response.statusCode! < 300) {
// // If the response status code is within the successful range (2xx),
// // return true indicating a successful response.
// return true;
// } else {
// // If the response status code is not within the successful range (2xx),
// // return false indicating an unsuccessful response.
// return false;
// }
// } else {
// // If the response status code is null, return false indicating an unsuccessful response.
// return false;
// }
// }
@override
void onRequest(
RequestOptions options, RequestInterceptorHandler handler) async {
//pass the token from the flutter secure storage to the request header
options.headers['Authorization'] = 'Bearer ${AuthCubit.token.accessToken}';
super.onRequest(options, handler);
}
//
// @override
// void onError(DioException err, ErrorInterceptorHandler handler) async {
// // TODO: Implement error handling logic.
// // This method is called when an error occurs during a request.
// super.onError(err, handler);
// }
//
// /// Validates the response and returns true if it is successful (status code 2xx).
// Future<bool> validateResponse(Response response) async {
// if (response.statusCode != null) {
// if (response.statusCode! >= 200 && response.statusCode! < 300) {
// // If the response status code is within the successful range (2xx),
// // return true indicating a successful response.
// return true;
// } else {
// // If the response status code is not within the successful range (2xx),
// // return false indicating an unsuccessful response.
// return false;
// }
// } else {
// // If the response status code is null, return false indicating an unsuccessful response.
// return false;
// }
// }
}

View File

@ -17,8 +17,8 @@ class HTTPService {
baseUrl: ApiEndpoints.baseUrl,
receiveDataWhenStatusError: true,
followRedirects: false,
connectTimeout: const Duration(seconds: 60),
receiveTimeout: const Duration(seconds: 60),
connectTimeout: const Duration(seconds: 5),
receiveTimeout: const Duration(seconds: 5),
),
);
@ -37,6 +37,9 @@ class HTTPService {
path,
queryParameters: queryParameters,
);
debugPrint("status code is ${response.statusCode}");
debugPrint("response data is ${response.data}");
return expectedResponseModel(response.data);
} catch (error) {
debugPrint("******* Error");

View File

@ -38,6 +38,9 @@ class ServerFailure extends Failure {
case DioExceptionType.unknown:
return ServerFailure("Unexpected Error, Please try again!");
default:
return ServerFailure("Unexpected Error, Please try again!");
}
}

View File

@ -0,0 +1,35 @@
import 'package:syncrow_app/features/app_layout/model/space_model.dart';
import 'package:syncrow_app/features/auth/bloc/auth_cubit.dart';
import 'package:syncrow_app/services/api/api_links_endpoints.dart';
import 'package:syncrow_app/services/api/http_service.dart';
class SpacesAPI {
// static Future<Token> loginWithEmail(
// {required LoginWithEmailModel model}) async {
// final response = await HTTPService().post(
// path: ApiEndpoints.login,
// body: model.toJson(),
// showServerMessage: false,
// expectedResponseModel: (json) {
// Token token = Token.fromJson(json['data']);
// return token;
// });
// debugPrint("response: $response");
// return response;
// }
static Future<List<SpaceModel>> getSpaces() async {
final response = await HTTPService().get(
path: "${ApiEndpoints.spaces}/${AuthCubit.user!.uuid}",
showServerMessage: false,
expectedResponseModel: (json) {
List<SpaceModel> spaces = [];
for (var space in json) {
spaces.add(SpaceModel.fromJson(space));
}
return spaces;
},
);
return response;
}
}

View File

@ -11,7 +11,7 @@ abstract class Constants {
static const double defaultPadding = 16;
static const String tokenAccessKey = 'access_token';
static const String token = '';
}
enum DeviceType {