Merge pull request #22 from SyncrowIOT/finishing_smart_door_pages

built the remaining door lock pages
This commit is contained in:
Mohammad Salameh
2024-04-30 12:13:48 +03:00
committed by GitHub
34 changed files with 1607 additions and 537 deletions

View File

@ -0,0 +1,11 @@
<svg width="45" height="39" viewBox="0 0 45 39" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M35.5233 38.287H9.4765C8.76168 38.287 8.18213 37.7074 8.18213 36.9926C8.18213 36.2778 8.76177 35.6982 9.4765 35.6982H35.5234C36.2382 35.6982 36.8177 36.2778 36.8177 36.9926C36.8177 37.7074 36.2381 38.287 35.5233 38.287Z" fill="#585A60"/>
<path d="M35.5234 36.9924H9.47658C8.99784 36.9924 8.5808 36.7318 8.35685 36.3452C7.8579 37.2064 8.48122 38.2868 9.47658 38.2868H35.5235C36.5168 38.2868 37.143 37.2082 36.6432 36.3452C36.4192 36.7318 36.0021 36.9924 35.5234 36.9924Z" fill="#414356"/>
<path d="M22.5001 13.021C16.3816 13.021 11.4219 17.9808 11.4219 24.0992V35.9694H33.5781V24.0992C33.5781 17.9808 28.6183 13.021 22.5001 13.021Z" fill="#F74C48"/>
<path d="M26.3394 13.7048C25.1432 13.2628 23.8499 13.021 22.5001 13.021C16.3816 13.021 11.4219 17.9808 11.4219 24.0992V35.9695H19.1008V24.0993C19.1008 19.3308 22.1135 15.2663 26.3394 13.7048Z" fill="#D63322"/>
<path d="M7.37685 23.7943H1.29437C0.57964 23.7943 0 23.2148 0 22.4999C0 21.785 0.57964 21.2056 1.29437 21.2056H7.37676C8.09158 21.2056 8.67113 21.7851 8.67113 22.4999C8.67122 23.2148 8.09158 23.7943 7.37685 23.7943Z" fill="#C6271A"/>
<path d="M43.7058 23.7947H37.6235C36.9085 23.7947 36.3291 23.2152 36.3291 22.5004C36.3291 21.7855 36.9086 21.2061 37.6235 21.2061H43.7057C44.4207 21.2061 45.0001 21.7856 45.0001 22.5004C45.0001 23.2152 44.4207 23.7947 43.7058 23.7947Z" fill="#C6271A"/>
<path d="M38.4101 8.42057L34.1091 12.7215C33.6035 13.2271 32.784 13.2271 32.2787 12.7215C31.773 12.216 31.773 11.3965 32.2787 10.891L36.5796 6.59007C37.085 6.08452 37.9045 6.08461 38.4101 6.59007C38.9155 7.09561 38.9155 7.91511 38.4101 8.42057Z" fill="#C6271A"/>
<path d="M23.7945 1.29437V7.37685C23.7945 8.09175 23.2148 8.67122 22.5002 8.67122C21.7853 8.67113 21.2058 8.09175 21.2058 7.37685V1.29437C21.2058 0.579552 21.7854 0.000175782 22.5002 0C23.2149 0.000175782 23.7945 0.579552 23.7945 1.29437Z" fill="#C6271A"/>
<path d="M8.4206 6.58997L12.7214 10.8909C13.2269 11.3965 13.2269 12.216 12.7214 12.7214C12.2158 13.2269 11.3964 13.227 10.891 12.7214L6.5901 8.42047C6.08446 7.9151 6.08464 7.09551 6.5901 6.58997C7.09547 6.08459 7.91505 6.08459 8.4206 6.58997Z" fill="#C6271A"/>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1,6 @@
<svg width="45" height="43" viewBox="0 0 45 43" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M23.5062 4.0995C22.9572 3.52803 22.0431 3.52803 21.4942 4.0995L5.99316 20.2354V40.4401C5.99316 41.57 6.90916 42.486 8.03908 42.486H36.9612C38.0911 42.486 39.0071 41.57 39.0071 40.4401C39.0071 40.0232 39.0071 21.2067 39.0071 20.2353L23.5062 4.0995Z" fill="#D8ECFE"/>
<path d="M16.9824 42.4858V34.1179C16.9824 31.0704 19.4529 28.6001 22.5002 28.6001C25.5476 28.6001 28.018 31.0705 28.018 34.1179V42.4858C27.4389 42.4858 17.6149 42.4858 16.9824 42.4858Z" fill="#3C87D0"/>
<path d="M23.5059 4.0995C22.9569 3.52803 22.0429 3.52803 21.4939 4.0995L18.698 7.00991C19.1308 6.94355 19.5886 7.07934 19.9164 7.42062L35.4174 23.5566V42.4861H36.9609C38.0908 42.4861 39.0068 41.5701 39.0068 40.4402C39.0068 40.0233 39.0068 21.2068 39.0068 20.2354L23.5059 4.0995Z" fill="#C4E2FF"/>
<path d="M21.494 6.66578L3.44219 25.4571C3.08131 25.8327 2.48224 25.8388 2.11398 25.4704L0.272409 23.6289C-0.0856571 23.2708 -0.0914579 22.6921 0.259314 22.327L21.1587 0.571443C21.8906 -0.190481 23.1094 -0.190481 23.8413 0.571443L44.7407 22.327C45.0915 22.6922 45.0857 23.2708 44.7276 23.6289L42.8861 25.4704C42.5178 25.8388 41.9188 25.8327 41.5579 25.4571L23.506 6.66578C22.9571 6.09432 22.043 6.09432 21.494 6.66578Z" fill="#60B7FF"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,3 @@
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.75781 4.57037C1.75781 5.05576 1.3643 5.44928 0.878906 5.44928C0.393516 5.44928 0 5.05576 0 4.57037V0.878906C0 0.393516 0.393516 0 0.878906 0H4.57008C5.05547 0 5.44898 0.393516 5.44898 0.878906C5.44898 1.3643 5.05547 1.75781 4.57008 1.75781H1.75781V4.57037ZM16.5963 7.47193C17.8894 8.29383 19.4308 8.67762 20.9595 8.55791C20.3178 7.09875 19.155 5.9168 17.7081 5.25035C17.4392 6.05467 17.0619 6.79969 16.5963 7.47193ZM21.4443 10.2705C19.3314 10.5221 17.2136 10.0071 15.4521 8.81391C13.6266 10.5659 11.1043 11.4889 8.49767 11.2409C8.49475 11.7451 8.57449 12.2533 8.06168 12.554C7.5958 12.8272 7.37602 13.5452 7.34514 14.121H22.655C22.6272 13.602 22.4375 12.8909 21.9867 12.5845C21.7011 12.4393 21.5055 12.1428 21.5055 11.8005C21.5055 11.2542 21.5202 10.8197 21.4443 10.2705ZM22.443 25.3418C21.0887 25.3418 19.9821 24.2352 19.9821 22.8809V20.8424C20.8122 20.091 21.5387 19.2625 22.1026 18.2933C23.1304 17.8921 23.8321 16.8998 24.163 15.8789H28.2129C28.6983 15.8789 29.0918 15.4854 29.0918 15C29.0918 14.5146 28.6983 14.1211 28.2129 14.1211H24.409C24.3728 13.0866 24.0079 12.0429 23.2633 11.3675C23.2633 6.69926 19.7276 2.90039 15.0015 2.90039C10.2782 2.90039 6.7398 6.69785 6.7398 11.3644C5.99355 12.0393 5.62717 13.0852 5.59096 14.1211H1.78711C1.30172 14.1211 0.908203 14.5146 0.908203 15C0.908203 15.4854 1.30172 15.8789 1.78711 15.8789H5.8367C6.14045 16.8179 6.74625 17.7158 7.6415 18.1747C8.2149 19.3386 9.02971 20.3239 10.0211 21.1574V22.8809C10.0211 24.2351 8.91439 25.3418 7.56012 25.3418C7.07473 25.3418 6.68121 25.7353 6.68121 26.2207C6.68121 26.7061 7.07473 27.0996 7.56012 27.0996C10.2925 27.0996 11.7789 24.9641 11.7789 22.4111C12.7789 23.0067 13.9638 23.5078 14.8934 23.5078C15.7948 23.5078 17.0646 22.9576 18.2242 22.2008C18.2242 24.8273 19.526 27.0996 22.4429 27.0996C22.9283 27.0996 23.3218 26.7061 23.3218 26.2207C23.3219 25.7353 22.9284 25.3418 22.443 25.3418ZM8.71342 9.50121C9.55811 6.31576 12.7002 4.20738 16.0283 4.73953C14.9798 7.81359 11.9558 9.78586 8.71342 9.50121ZM16.9918 20.9056C16.1183 21.4393 15.3486 21.75 14.8934 21.75C14.5005 21.75 13.9127 21.5568 13.2394 21.2155C12.5291 20.8556 11.7587 20.343 11.0388 19.7224C10.1973 18.9969 9.54217 18.1526 9.10031 17.1504C8.98928 16.8981 8.77389 16.7243 8.52715 16.6571C8.2398 16.5618 7.92369 16.2036 7.73965 15.8789H22.2615C22.0441 16.2633 21.7105 16.6196 21.3345 16.6946C21.0548 16.7503 20.8329 16.9331 20.7166 17.1708C19.9505 18.685 18.3338 20.0856 16.9918 20.9056ZM28.2422 25.4297C28.2422 24.9443 28.6357 24.5508 29.1211 24.5508C29.6065 24.5508 30 24.9443 30 25.4297V29.1211C30 29.6065 29.6065 30 29.1211 30H25.4299C24.9445 30 24.551 29.6065 24.551 29.1211C24.551 28.6357 24.9445 28.2422 25.4299 28.2422H28.2422V25.4297ZM0 25.4297C0 24.9443 0.393516 24.5508 0.878906 24.5508C1.3643 24.5508 1.75781 24.9443 1.75781 25.4297V28.2422H4.57008C5.05547 28.2422 5.44898 28.6357 5.44898 29.1211C5.44898 29.6065 5.05547 30 4.57008 30H0.878906C0.393516 30 0 29.6065 0 29.1211V25.4297ZM30 4.57037C30 5.05576 29.6065 5.44928 29.1211 5.44928C28.6357 5.44928 28.2422 5.05576 28.2422 4.57037V1.75781H25.4299C24.9445 1.75781 24.551 1.3643 24.551 0.878906C24.551 0.393516 24.9445 0 25.4299 0H29.1211C29.6065 0 30 0.393516 30 0.878906V4.57037Z" fill="#D5D5D5"/>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,9 @@
<svg width="23" height="30" viewBox="0 0 23 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.8772 19.0952C15.4988 19.8801 15.0608 20.6376 14.5656 21.3623C14.9946 22.6134 15.706 23.7597 16.668 24.7217C17.504 25.5577 18.4791 26.2046 19.5413 26.6414C19.9848 26.1978 20.3918 25.7177 20.7581 25.2067C18.0993 24.3578 16.1216 21.9698 15.8772 19.0952Z" fill="#D5D5D5"/>
<path d="M19.3737 18.493V11.4481C19.3737 7.07787 15.8182 3.52246 11.4481 3.52246C7.07794 3.52246 3.52248 7.07793 3.52248 11.4481C3.52248 13.3904 1.94226 14.9706 0 14.9706V16.7318C2.91345 16.7318 5.28374 14.3615 5.28374 11.4481C5.28374 8.04906 8.04907 5.28373 11.4482 5.28373C14.8472 5.28373 17.6126 8.04906 17.6126 11.4481V18.4931C17.6126 20.9956 19.3613 23.0973 21.7011 23.6405C21.9665 23.1078 22.1921 22.5521 22.3729 21.9765C20.6779 21.7228 19.3737 20.2575 19.3737 18.493Z" fill="#D5D5D5"/>
<path d="M15.4227 25.9668C14.8328 25.3769 14.3141 24.7201 13.8812 24.0149L13.2949 23.0601L12.4566 23.9045C10.4339 25.9272 8.00397 27.3959 5.35132 28.237C6.03335 28.6678 6.76343 29.0291 7.53218 29.3098C9.51393 28.4747 11.3555 27.3063 12.9856 25.8314C13.3475 26.319 13.7462 26.781 14.1773 27.2121C14.8298 27.8646 15.5428 28.4348 16.3034 28.9177C16.92 28.6277 17.507 28.285 18.0577 27.8942C17.0971 27.3988 16.2086 26.7527 15.4227 25.9668Z" fill="#D5D5D5"/>
<path d="M11.4482 0C5.13568 0 0 5.13562 0 11.4482V13.2094C0.971132 13.2094 1.76127 12.4193 1.76127 11.4482C1.76127 6.10681 6.10681 1.76127 11.4482 1.76127C16.7895 1.76127 21.135 6.10681 21.135 11.4482V18.4932C21.135 19.4219 21.8577 20.1845 22.7703 20.2495C22.853 19.6955 22.8963 19.1287 22.8963 18.5519V11.4482C22.8963 5.13562 17.7606 0 11.4482 0Z" fill="#D5D5D5"/>
<path d="M11.4482 7.04492C9.02026 7.04492 7.04501 9.02017 7.04501 11.4481C7.04501 15.3326 3.88464 18.4931 0 18.4931V18.5518C0 19.1297 0.0434179 19.6976 0.126504 20.2528C2.4331 20.2206 4.59568 19.309 6.22828 17.6764C7.89064 16.014 8.80622 13.8021 8.80622 11.4481C8.80622 9.99131 9.9914 8.80619 11.4481 8.80619C12.9048 8.80619 14.09 9.99136 14.09 11.4481C14.09 18.452 8.95282 24.2779 2.24865 25.3579C2.6567 25.9079 3.11285 26.42 3.61072 26.8884C6.46734 26.2271 9.08823 24.7819 11.211 22.6591C14.2032 19.6668 15.8512 15.6854 15.8512 11.4481C15.8513 9.02017 13.876 7.04492 11.4482 7.04492Z" fill="#D5D5D5"/>
<path d="M12.9318 28.4579C12.8782 28.4044 12.8251 28.3503 12.7724 28.2959C11.9728 28.9042 11.1334 29.4525 10.2587 29.9386C10.6497 29.9792 11.0465 30.0002 11.4481 30.0002C12.4255 30.0002 13.3746 29.8768 14.2808 29.6453C13.8082 29.2788 13.3566 28.8825 12.9318 28.4579Z" fill="#D5D5D5"/>
<path d="M11.4483 10.5674C10.962 10.5674 10.5677 10.9617 10.5677 11.448C10.5677 17.0966 6.1128 21.7242 0.531982 22.0022C0.72001 22.5958 0.955205 23.1687 1.23323 23.7163C4.06266 23.4377 6.68532 22.2023 8.71992 20.1677C11.0473 17.8403 12.3289 14.7436 12.3289 11.448C12.3289 10.9617 11.9347 10.5674 11.4483 10.5674Z" fill="#D5D5D5"/>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -0,0 +1,9 @@
<svg width="21" height="30" viewBox="0 0 21 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.9966 0C15.673 0 15.4106 0.262383 15.4106 0.585938C15.4106 0.909493 15.673 1.17188 15.9966 1.17188C17.8522 1.17188 19.3618 2.6857 19.3618 4.54647C19.3618 4.87002 19.6242 5.1324 19.9477 5.1324C20.2713 5.1324 20.5337 4.87002 20.5337 4.54647C20.5337 2.03953 18.4983 0 15.9966 0Z" fill="#D5D5D5"/>
<path d="M15.9962 2.36475C15.6727 2.36475 15.4103 2.62713 15.4103 2.95068C15.4103 3.27424 15.6727 3.53662 15.9962 3.53662C16.5509 3.53662 17.0022 3.98955 17.0022 4.54637C17.0022 4.86992 17.2646 5.13231 17.5881 5.13231C17.9117 5.13231 18.1741 4.86992 18.1741 4.54637C18.1741 3.34344 17.1971 2.36475 15.9962 2.36475Z" fill="#D5D5D5"/>
<path d="M6.4183 15.0895H9.6116C10.3963 15.0895 11.0348 14.4511 11.0348 13.6663V10.3708C11.0348 9.8619 10.7661 9.41477 10.3633 9.16311V8.56615C10.3633 7.27123 9.30985 6.21777 8.01498 6.21777C6.72012 6.21777 5.6666 7.27123 5.6666 8.56615V9.16311C5.26383 9.41471 4.99512 9.8619 4.99512 10.3708V13.6663C4.99512 14.4511 5.63361 15.0895 6.4183 15.0895ZM9.86291 13.6663C9.86291 13.8049 9.75018 13.9176 9.6116 13.9176H6.4183C6.27973 13.9176 6.16699 13.8049 6.16699 13.6663V10.3708C6.16699 10.2322 6.27973 10.1195 6.4183 10.1195H9.6116C9.75018 10.1195 9.86291 10.2322 9.86291 10.3708V13.6663ZM6.83848 8.56615C6.83848 7.91746 7.36629 7.38965 8.01498 7.38965C8.66367 7.38965 9.19143 7.91746 9.19143 8.56615V8.9476H6.83848V8.56615Z" fill="#D5D5D5"/>
<path d="M8.01506 11.4243C7.76118 11.4243 7.5302 11.5943 7.4552 11.8369C7.38524 12.0632 7.44946 12.3226 7.62858 12.4799C7.82141 12.6493 8.11133 12.6723 8.32825 12.5348C8.53274 12.4053 8.62807 12.1657 8.59549 11.9295C8.556 11.6434 8.30364 11.4243 8.01506 11.4243Z" fill="#D5D5D5"/>
<path d="M13.3501 3.81445H2.67984C1.20217 3.81445 0 5.01885 0 6.49922V27.3153C0 28.7957 1.20223 30.0001 2.67984 30.0001H13.3501C14.8278 30.0001 16.03 28.7957 16.03 27.3153V6.49922C16.03 5.01879 14.8278 3.81445 13.3501 3.81445ZM2.67984 4.98633H13.3501C14.1816 4.98633 14.8581 5.66502 14.8581 6.49922V16.3213H1.17182V6.49922C1.17182 5.66502 1.84828 4.98633 2.67984 4.98633ZM13.3501 28.8282H2.67984C1.84834 28.8282 1.17188 28.1495 1.17188 27.3153V17.4932H14.8581V27.3153C14.8581 28.1495 14.1816 28.8282 13.3501 28.8282Z" fill="#D5D5D5"/>
<path d="M9.6116 21.4549H6.83848V21.0776C6.83848 20.4267 7.36629 19.897 8.01498 19.897C8.27789 19.897 8.52645 19.9821 8.73381 20.1429C8.98951 20.3413 9.3576 20.2949 9.55588 20.0391C9.75428 19.7835 9.70787 19.4154 9.45211 19.2171C9.03738 18.8953 8.54039 18.7251 8.01498 18.7251C6.72006 18.7251 5.6666 19.7804 5.6666 21.0776V21.6704C5.26383 21.922 4.99512 22.3692 4.99512 22.8781V26.1737C4.99512 26.9584 5.63355 27.5968 6.4183 27.5968H9.6116C10.3963 27.5968 11.0348 26.9583 11.0348 26.1737V22.8781C11.0348 22.0934 10.3963 21.4549 9.6116 21.4549ZM9.86291 26.1737C9.86291 26.3122 9.75018 26.4249 9.6116 26.4249H6.4183C6.27973 26.4249 6.16699 26.3122 6.16699 26.1737V22.8781C6.16699 22.7395 6.27973 22.6268 6.4183 22.6268H9.6116C9.75018 22.6268 9.86291 22.7395 9.86291 22.8781V26.1737Z" fill="#D5D5D5"/>
<path d="M8.01506 23.9312C7.76118 23.9312 7.5302 24.1011 7.4552 24.3438C7.38524 24.57 7.44946 24.8295 7.62858 24.9867C7.82141 25.1561 8.11133 25.1791 8.32825 25.0416C8.53274 24.9121 8.62807 24.6725 8.59549 24.4362C8.556 24.1502 8.30364 23.9312 8.01506 23.9312Z" fill="#D5D5D5"/>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -1,12 +1,11 @@
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/home_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';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
class AppLayout extends StatelessWidget {
const AppLayout({super.key});
@ -17,23 +16,12 @@ class AppLayout extends StatelessWidget {
create: (context) => HomeCubit.getInstance(),
child: BlocBuilder<HomeCubit, HomeState>(
builder: (context, state) {
return AnnotatedRegion(
value: SystemUiOverlayStyle(
statusBarColor: ColorsManager.primaryColor.withOpacity(0.5),
statusBarIconBrightness: Brightness.light,
),
child: SafeArea(
child: Scaffold(
backgroundColor: ColorsManager.backgroundColor,
extendBodyBehindAppBar: true,
extendBody: true,
appBar: HomeCubit.getInstance().spaces != null
? const DefaultAppBar()
: null,
body: const AppBody(),
bottomNavigationBar: const DefaultNavBar(),
),
),
return DefaultScaffold(
appBar: HomeCubit.getInstance().spaces != null
? const DefaultAppBar()
: null,
bottomNavBar: const DefaultNavBar(),
child: const AppBody(),
);
},
),

View File

@ -3,7 +3,6 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
import 'package:syncrow_app/generated/assets.dart';
class AppBody extends StatelessWidget {
const AppBody({
@ -15,32 +14,20 @@ class AppBody extends StatelessWidget {
return BlocConsumer<HomeCubit, HomeState>(
listener: (context, state) {
if (state is GetSpacesError) {
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(
// content: Text(state.errMessage),
// ),
// );
ScaffoldMessenger.of(context).removeCurrentSnackBar();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(state.errMessage),
),
);
}
},
builder: (context, state) {
return Container(
width: MediaQuery.sizeOf(context).width,
height: MediaQuery.sizeOf(context).height,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
Assets.imagesBackground,
),
fit: BoxFit.cover,
opacity: 0.4,
),
),
child: state is! GetSpacesLoading
? state is! GetSpaceRoomsLoading
? HomeCubit.getInstance().pages[HomeCubit.pageIndex]
: const Center(child: CircularProgressIndicator())
: const Center(child: CircularProgressIndicator()),
);
return state is! GetSpacesLoading
? state is! GetSpaceRoomsLoading
? HomeCubit.getInstance().pages[HomeCubit.pageIndex]
: const Center(child: CircularProgressIndicator())
: const Center(child: CircularProgressIndicator());
},
);
}

View File

@ -3,7 +3,6 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
import 'package:syncrow_app/utils/resource_manager/constants.dart';
class DefaultNavBar extends StatelessWidget {
const DefaultNavBar({
@ -15,34 +14,23 @@ class DefaultNavBar extends StatelessWidget {
return BlocBuilder<HomeCubit, HomeState>(
builder: (context, state) {
var cubit = HomeCubit.getInstance();
return SizedBox(
height: Constants.bottomNavBarHeight,
child: BottomNavigationBar(
backgroundColor: Colors.transparent,
onTap: (int index) {
cubit.updatePageIndex(index);
// if (DevicesCubit.getInstance().chosenCategoryView != null) {
// DevicesCubit.getInstance()
// .clearCategoriesSelection(context);
// }
// if (HomeCubit.getInstance().selectedRoom != null) {
// HomeCubit.getInstance().unselectRoom();
// }
HomeCubit.getInstance().updatePageIndex(index);
},
currentIndex: HomeCubit.pageIndex,
selectedItemColor: ColorsManager.primaryColor,
selectedLabelStyle: const TextStyle(
color: ColorsManager.primaryColor,
fontSize: 10,
),
showUnselectedLabels: true,
unselectedItemColor: Colors.grey,
type: BottomNavigationBarType.fixed,
elevation: 0,
items: HomeCubit.bottomNavItems,
return BottomNavigationBar(
backgroundColor: Colors.transparent,
onTap: (int index) {
cubit.updatePageIndex(index);
HomeCubit.getInstance().updatePageIndex(index);
},
currentIndex: HomeCubit.pageIndex,
selectedItemColor: ColorsManager.primaryColor,
selectedLabelStyle: const TextStyle(
color: ColorsManager.primaryColor,
fontSize: 10,
),
showUnselectedLabels: true,
unselectedItemColor: Colors.grey,
type: BottomNavigationBarType.fixed,
elevation: 0,
items: HomeCubit.bottomNavItems,
);
},
);

View File

@ -140,7 +140,7 @@ class AuthCubit extends Cubit<AuthState> {
final value =
await const FlutterSecureStorage().read(key: Token.loginAccessTokenKey);
if (value == null) {
if (value == null || value.isEmpty) {
emit(AuthTokenError(message: "Token not found"));
return;
}

View File

@ -5,7 +5,6 @@ import 'package:syncrow_app/features/dashboard/view/widgets/carbon_emission.dart
import 'package:syncrow_app/features/dashboard/view/widgets/consumption.dart';
import 'package:syncrow_app/features/dashboard/view/widgets/live_monitor_tab.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart';
import 'package:syncrow_app/utils/resource_manager/constants.dart';
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
import 'widgets/energy_usage.dart';
@ -15,45 +14,36 @@ class DashboardView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.only(
top: Constants.appBarHeight,
left: Constants.defaultPadding,
right: Constants.defaultPadding,
bottom: Constants.bottomNavBarHeight,
),
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const TitleMedium(
text: StringsManager.dashboard,
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.bold,
),
return SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const TitleMedium(
text: StringsManager.dashboard,
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.bold,
),
const LiveMonitorTab(),
const SizedBox(height: 10),
const EnergyUsage(),
Container(
padding: const EdgeInsets.only(top: 20),
constraints: const BoxConstraints(
minHeight: 220,
maxHeight: 240,
),
child: const Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Consumption(),
SizedBox(height: 20),
CarbonEmission(),
],
),
),
const LiveMonitorTab(),
const SizedBox(height: 10),
const EnergyUsage(),
Container(
padding: const EdgeInsets.only(top: 20),
constraints: const BoxConstraints(
minHeight: 220,
maxHeight: 240,
),
],
),
child: const Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Consumption(),
SizedBox(height: 20),
CarbonEmission(),
],
),
),
],
),
);
}

View File

@ -1,17 +0,0 @@
// import 'package:flutter/material.dart';
// import 'package:syncrow_app/features/devices/view/widgets/devices_view_body.dart';
// class DevicesView extends StatelessWidget {
// const DevicesView({super.key});
// @override
// Widget build(BuildContext context) {
// print('built DevicesView');
// return Container(
// padding: const EdgeInsets.all(8),
// width: MediaQuery.of(context).size.width,
// height: MediaQuery.of(context).size.height,
// child: const DevicesViewBody(),
// );
// }
// }

View File

@ -144,7 +144,6 @@ class ParameterControlDialogState extends State<ParameterControlDialog> {
return;
}
if (!widget.sensor.isOnline!) {
debugPrint('Device is offline');
return;
}

View File

@ -0,0 +1,231 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
import 'package:syncrow_app/utils/context_extension.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
import 'package:syncrow_app/utils/resource_manager/constants.dart';
class AddMemberInterface extends StatelessWidget {
const AddMemberInterface({super.key, required this.memberRole});
final MemberRole memberRole;
@override
Widget build(BuildContext context) {
return DefaultScaffold(
title: 'Add Member',
actions: [
Padding(
padding: const EdgeInsets.only(right: 10),
child: TextButton(
onPressed: () {},
child: const BodyMedium(
text: 'SAVE',
fontWeight: FontWeight.bold,
),
),
),
],
child: Column(
children: [
SizedBox.square(
dimension: 120,
child: CircleAvatar(
backgroundColor: Colors.white,
child: SizedBox.square(
dimension: 117,
child: CircleAvatar(
backgroundColor: Colors.grey,
child: Icon(
memberRole == MemberRole.FamilyMember
? Icons.family_restroom
: Icons.person,
size: 25,
color: Colors.white,
),
),
),
),
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 20),
child: Row(
children: [
const Expanded(
child: SizedBox.shrink(),
),
BodyLarge(
text: memberRole == MemberRole.FamilyMember
? 'Family Member'
: 'Guest',
fontWeight: FontWeight.bold,
),
Expanded(
child: Row(
children: [
IconButton(
onPressed: () {},
icon: const Icon(
Icons.edit_outlined,
size: 20,
),
),
],
),
),
],
),
),
memberRole == MemberRole.FamilyMember
? DefaultContainer(
padding: const EdgeInsets.symmetric(
horizontal: 25,
vertical: 5,
),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const BodyMedium(text: 'Region '),
Flexible(
child: TextField(
textAlign: TextAlign.end,
decoration: InputDecoration(
hintText: 'United Arab Emirates',
hintStyle: context.bodyMedium
.copyWith(color: Colors.grey),
border: InputBorder.none,
),
),
),
],
),
Container(
height: 1,
color: ColorsManager.greyColor,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const BodyMedium(text: 'Account '),
Flexible(
child: TextField(
textAlign: TextAlign.end,
decoration: InputDecoration(
hintText: 'Account Name',
hintStyle: context.bodyMedium
.copyWith(color: Colors.grey),
border: InputBorder.none,
),
),
),
],
),
Container(
height: 1,
color: ColorsManager.greyColor,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const BodyMedium(text: 'Family Role'),
Flexible(
child: TextField(
textAlign: TextAlign.end,
decoration: InputDecoration(
hintText: 'Common Member',
hintStyle: context.bodyMedium
.copyWith(color: Colors.grey),
border: InputBorder.none,
),
),
),
],
),
],
),
)
: DefaultContainer(
padding: const EdgeInsets.symmetric(
horizontal: 25,
vertical: 5,
),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const BodyMedium(text: 'Unlock with Mobile phone '),
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Transform.scale(
scale: .8,
child: CupertinoSwitch(
value: false,
onChanged: (value) {},
applyTheme: true,
),
),
],
),
),
],
),
Container(
height: 1,
color: ColorsManager.greyColor,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const BodyMedium(text: 'Set Validity Period '),
Flexible(
child: TextField(
textAlign: TextAlign.end,
decoration: InputDecoration(
hintText: 'Start and End Date',
hintStyle: context.bodyMedium
.copyWith(color: Colors.grey),
border: InputBorder.none,
),
),
),
],
),
Container(
height: 1,
color: ColorsManager.greyColor,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const BodyMedium(text: 'Effictive Period '),
Flexible(
child: TextField(
textAlign: TextAlign.end,
decoration: InputDecoration(
hintText: 'Start and End Time',
hintStyle: context.bodyMedium
.copyWith(color: Colors.grey),
border: InputBorder.none,
),
),
),
],
),
],
),
),
],
),
);
}
}

View File

@ -0,0 +1,129 @@
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/devices/view/widgets/smart_door/add_member_interface.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
import 'package:syncrow_app/utils/resource_manager/constants.dart';
class AddMemberView extends StatelessWidget {
const AddMemberView({super.key});
@override
Widget build(BuildContext context) {
return DefaultScaffold(
title: 'Add Member',
child: Column(
children: [
DefaultContainer(
padding: const EdgeInsets.symmetric(
horizontal: 15,
vertical: 20,
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const BodyMedium(
text: 'Family Members', fontWeight: FontWeight.bold),
const Padding(
padding: EdgeInsets.symmetric(vertical: 13),
child: BodySmall(
text:
'After adding:\n\n\t\t1.The user will join the family.\n\n\t\t2.The user will be able to control and use all devices in the family.',
fontColor: ColorsManager.greyColor,
fontSize: 10,
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
ColorsManager.primaryColorWithOpacity,
),
),
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => const AddMemberInterface(
memberRole: MemberRole.FamilyMember,
),
),
);
},
child: const Padding(
padding: EdgeInsets.symmetric(horizontal: 50),
child: BodyMedium(
text: 'ADD',
fontColor: Colors.white,
fontWeight: FontWeight.bold,
),
),
),
],
)
],
),
),
const SizedBox(
height: 10,
),
DefaultContainer(
padding: const EdgeInsets.symmetric(
horizontal: 15,
vertical: 20,
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const BodyMedium(
text: 'Other Member', fontWeight: FontWeight.bold),
const Padding(
padding: EdgeInsets.symmetric(vertical: 13),
child: BodySmall(
text:
'After adding:\n\n\t\t1.The user only appears in the member list of the current lock and can only view their own unlocking records.\n\n\t\t2.The user cannot obtain the permissions to operate or manage the lock.\n\n\t\t3.To grant the user operation permissions on the lock, you must use the device sharing functions.',
fontColor: ColorsManager.greyColor,
fontSize: 10,
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextButton(
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => const AddMemberInterface(
memberRole: MemberRole.OtherMember,
),
),
);
},
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
ColorsManager.primaryColorWithOpacity,
),
),
child: const Padding(
padding: EdgeInsets.symmetric(horizontal: 50),
child: BodyMedium(
text: 'ADD',
fontColor: Colors.white,
fontWeight: FontWeight.bold,
),
),
),
],
)
],
),
),
],
),
);
}
}

View File

@ -1,5 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
import 'package:syncrow_app/features/devices/model/device_control_model.dart';
import 'package:syncrow_app/features/devices/model/device_model.dart';
import 'package:syncrow_app/generated/assets.dart';
import 'package:syncrow_app/utils/context_extension.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
@ -7,8 +11,10 @@ import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class DoorLockButton extends StatefulWidget {
const DoorLockButton({
super.key,
required this.doorLock,
});
final DeviceModel doorLock;
@override
State<DoorLockButton> createState() => _DoorLockButtonState();
}
@ -28,9 +34,29 @@ class _DoorLockButtonState extends State<DoorLockButton>
_animation = Tween<double>(begin: 0, end: 1.0).animate(_animationController)
..addListener(() {
if (_animation.status == AnimationStatus.completed) {
//TODO send a request to lock the door but check if the door is already locked
if (widget.doorLock.status
.firstWhere((element) => element.code == 'normal_open_switch')
.value !=
true) {
DevicesCubit.getInstance().deviceControl(
DeviceControlModel(
deviceId: widget.doorLock.uuid,
code: 'normal_open_switch',
value: true),
widget.doorLock.uuid ?? "");
}
} else if (_animation.status == AnimationStatus.dismissed) {
//TODO send a request to unlock the door but check if the door is already unlocked
if (widget.doorLock.status
.firstWhere((element) => element.code == 'normal_open_switch')
.value !=
false) {
DevicesCubit.getInstance().deviceControl(
DeviceControlModel(
deviceId: widget.doorLock.uuid,
code: 'normal_open_switch',
value: false),
widget.doorLock.uuid ?? "");
}
}
setState(() {});
});
@ -44,101 +70,119 @@ class _DoorLockButtonState extends State<DoorLockButton>
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.only(
right: context.width * 0.25 / 2,
left: context.width * 0.25 / 2,
bottom: context.width * 0.2 / 2,
),
child: InkWell(
overlayColor: MaterialStateProperty.all(
ColorsManager.primaryColorWithOpacity.withOpacity(0.1)),
borderRadius: BorderRadius.circular(999),
onTapDown: (details) {
if (_animationController.status == AnimationStatus.dismissed) {
_animationController.forward();
} else if (_animationController.status == AnimationStatus.completed) {
_animationController.reverse();
} else if (_animationController.status == AnimationStatus.forward) {
_animationController.reverse();
} else if (_animationController.status == AnimationStatus.reverse) {
_animationController.forward();
}
},
onTapUp: (details) {
if (_animationController.status == AnimationStatus.forward) {
_animationController.reverse();
} else if (_animationController.status == AnimationStatus.reverse) {
_animationController.forward();
}
},
child: Container(
width: context.width * 06,
height: context.width * 0.6,
margin: const EdgeInsets.all(10),
decoration: const BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey,
blurRadius: 18,
offset: Offset(6, 7),
blurStyle: BlurStyle.outer,
),
],
color: Color(0xFFEBECED),
borderRadius: BorderRadius.all(Radius.circular(999)),
return BlocConsumer<DevicesCubit, DevicesState>(
listener: (context, state) {
if (state is GetDeviceStatusError) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(state.errorMsg),
backgroundColor: Colors.red,
),
);
}
},
builder: (context, state) {
return Padding(
padding: EdgeInsets.only(
right: context.width * 0.25 / 2,
left: context.width * 0.25 / 2,
bottom: context.width * 0.2 / 2,
),
child: Padding(
padding: const EdgeInsets.all(25),
child: Stack(
alignment: Alignment.center,
children: [
Container(
margin: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(999),
boxShadow: [
BoxShadow(
color: Colors.white.withOpacity(0.5),
blurRadius: 30,
offset: const Offset(-5, -5),
blurStyle: BlurStyle.outer,
),
BoxShadow(
color: Colors.black.withOpacity(0.14),
blurRadius: 25,
offset: const Offset(5, 5),
blurStyle: BlurStyle.outer,
),
BoxShadow(
color: Colors.black.withOpacity(0.14),
blurRadius: 30,
offset: const Offset(5, 5),
blurStyle: BlurStyle.inner,
),
],
child: InkWell(
overlayColor: MaterialStateProperty.all(
ColorsManager.primaryColorWithOpacity.withOpacity(0.1)),
borderRadius: BorderRadius.circular(999),
onTapDown: (details) {
if (_animationController.status == AnimationStatus.dismissed) {
_animationController.forward();
} else if (_animationController.status ==
AnimationStatus.completed) {
_animationController.reverse();
} else if (_animationController.status ==
AnimationStatus.forward) {
_animationController.reverse();
} else if (_animationController.status ==
AnimationStatus.reverse) {
_animationController.forward();
}
},
onTapUp: (details) {
if (_animationController.status == AnimationStatus.forward) {
_animationController.reverse();
} else if (_animationController.status ==
AnimationStatus.reverse) {
_animationController.forward();
}
},
child: Container(
width: context.width * 06,
height: context.width * 0.6,
margin: const EdgeInsets.all(10),
decoration: const BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey,
blurRadius: 18,
offset: Offset(6, 7),
blurStyle: BlurStyle.outer,
),
child: Center(
child: SvgPicture.asset(
Assets.doorlockAssetsLockIcon,
],
color: Color(0xFFEBECED),
borderRadius: BorderRadius.all(Radius.circular(999)),
),
child: Padding(
padding: const EdgeInsets.all(25),
child: Stack(
alignment: Alignment.center,
children: [
Container(
margin: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(999),
boxShadow: [
BoxShadow(
color: Colors.white.withOpacity(0.5),
blurRadius: 30,
offset: const Offset(-5, -5),
blurStyle: BlurStyle.outer,
),
BoxShadow(
color: Colors.black.withOpacity(0.14),
blurRadius: 25,
offset: const Offset(5, 5),
blurStyle: BlurStyle.outer,
),
BoxShadow(
color: Colors.black.withOpacity(0.14),
blurRadius: 30,
offset: const Offset(5, 5),
blurStyle: BlurStyle.inner,
),
],
),
child: Center(
child: SvgPicture.asset(
Assets.doorlockAssetsLockIcon,
),
),
),
),
SizedBox.expand(
child: CircularProgressIndicator(
value: _animation.value,
strokeWidth: 15,
backgroundColor: Colors.transparent,
valueColor: const AlwaysStoppedAnimation<Color>(
ColorsManager.primaryColor),
),
)
],
),
SizedBox.expand(
child: CircularProgressIndicator(
value: _animation.value,
strokeWidth: 15,
backgroundColor: Colors.transparent,
valueColor: const AlwaysStoppedAnimation<Color>(
ColorsManager.primaryColor),
),
)
],
),
),
),
),
),
);
},
);
}
}

View File

@ -1,5 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_app/features/devices/view/widgets/smart_door/members_management_view.dart';
import 'package:syncrow_app/features/devices/view/widgets/smart_door/smart_linkage_view.dart';
import 'package:syncrow_app/features/devices/view/widgets/smart_door/unlocking_records_view.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
import 'package:syncrow_app/generated/assets.dart';
@ -67,12 +70,12 @@ List<Map<String, dynamic>> doorLockButtons = [
{
'title': 'Unlocking Records',
'image': Assets.doorlockAssetsUnlockingRecords,
'page': null,
'page': const UnlockingRecordsView(),
},
{
'title': 'Memebers Managment',
'image': Assets.doorlockAssetsMembersManagement,
'page': null,
'page': const MembersManagementView(),
},
{
'title': 'Temporary Password',
@ -82,6 +85,6 @@ List<Map<String, dynamic>> doorLockButtons = [
{
'title': 'Smart Linkage',
'image': Assets.doorlockAssetsSmartLinkage,
'page': null,
'page': const SmartLinkgeView()
},
];

View File

@ -54,15 +54,15 @@ class DoorInterface extends StatelessWidget {
left: Constants.defaultPadding,
right: Constants.defaultPadding,
),
child: const Column(
child: Column(
children: [
DoorLockStatusBar(),
const DoorLockStatusBar(),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
DoorLockButton(),
DoorLockGrid(),
DoorLockButton(doorLock: doorlock),
const DoorLockGrid(),
],
)
],

View File

@ -0,0 +1,180 @@
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/devices/view/widgets/smart_door/add_member_view.dart';
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
import 'package:syncrow_app/utils/context_extension.dart';
import 'package:syncrow_app/utils/helpers/custom_page_route.dart';
import 'package:syncrow_app/utils/helpers/misc_string_helpers.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
import 'package:syncrow_app/utils/resource_manager/constants.dart';
class MembersManagementView extends StatefulWidget {
const MembersManagementView({super.key});
@override
State<MembersManagementView> createState() => _MembersManagementViewState();
}
class _MembersManagementViewState extends State<MembersManagementView> {
bool showFamilyMembers = true;
@override
Widget build(BuildContext context) {
return DefaultScaffold(
title: 'Manage Members',
actions: [
Padding(
padding: const EdgeInsets.only(right: 10),
child: IconButton(
onPressed: () {
Navigator.of(context).push(
CustomPageRoute(
builder: (context) => const AddMemberView(),
),
);
},
icon: const Icon(
Icons.add,
size: 30,
),
),
),
],
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
InkWell(
onTap: () {
setState(() {
showFamilyMembers = true;
});
},
child: BodyMedium(
text: 'Family Members',
fontWeight:
showFamilyMembers ? FontWeight.bold : FontWeight.normal,
),
),
const SizedBox(width: 10),
InkWell(
onTap: () {
setState(() {
showFamilyMembers = false;
});
},
child: BodyMedium(
text: 'Other Members',
fontWeight: !showFamilyMembers
? FontWeight.bold
: FontWeight.normal,
),
),
],
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 20),
child: BodySmall(
text:
'Administrators can set passwords for themselves or other users. Family members can set passwords only when they are granted the permission to set passwords.',
style: context.bodySmall.copyWith(fontSize: 8),
),
),
DefaultContainer(
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 10),
child: Column(
mainAxisSize: MainAxisSize.min,
children: List.generate(
members.length,
(index) {
if (showFamilyMembers) {
if (members[index]['role'] == MemberRole.FamilyMember) {
return Column(
children: [
Row(
children: [
const SizedBox.square(
dimension: 35,
child: CircleAvatar(
backgroundColor: Colors.grey,
),
),
const SizedBox(
width: 10,
),
BodyMedium(
text: StringHelpers.toTitleCase(
members[index]['name'] as String)),
const Spacer(),
const BodyMedium(
text: 'Family Member',
fontColor: Colors.grey,
)
],
),
index != members.length - 1
? Container(
margin: const EdgeInsets.only(
left: 45, top: 8, bottom: 8),
height: 1,
color: ColorsManager.greyColor,
)
: const SizedBox(),
],
);
} else {
return const SizedBox();
}
} else {
if (members[index]['role'] == MemberRole.OtherMember) {
return Column(
children: [
Row(
children: [
const SizedBox.square(
dimension: 35,
child: CircleAvatar(
backgroundColor: Colors.grey,
),
),
const SizedBox(
width: 10,
),
BodyMedium(
text: StringHelpers.toTitleCase(
members[index]['name'] as String)),
const Spacer(),
const BodyMedium(
text: 'Other Member',
fontColor: Colors.grey,
)
],
),
index != members.length - 1
? Container(
margin: const EdgeInsets.only(
left: 45, top: 8, bottom: 8),
height: 1,
color: ColorsManager.greyColor,
)
: const SizedBox(),
],
);
} else {
return const SizedBox();
}
}
},
),
),
),
],
),
),
);
}
}

View File

@ -0,0 +1,108 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
import 'package:syncrow_app/generated/assets.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class SmartLinkgeView extends StatelessWidget {
const SmartLinkgeView({super.key});
@override
Widget build(BuildContext context) {
return DefaultScaffold(
title: 'Scene',
child: Column(
children: [
DefaultContainer(
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 20),
child: Row(
children: [
SizedBox(
width: 45,
height: 40,
child: SvgPicture.asset(Assets.linkageIconsFamilyHome),
),
const SizedBox(width: 15),
const Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BodyLarge(
text: 'Family go home',
fontWeight: FontWeight.bold,
),
BodySmall(
text: 'Trigger linkage when family member go home.',
)
],
),
),
const SizedBox(width: 10),
Transform.scale(
scale: 1,
child: CupertinoSwitch(
value: false,
onChanged: (value) {},
applyTheme: true,
),
),
],
),
),
const SizedBox(height: 10),
DefaultContainer(
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 20),
child: Row(
children: [
SizedBox(
width: 45,
height: 40,
child: SvgPicture.asset(Assets.linkageIconsDoorLockAlarm),
),
const SizedBox(width: 15),
const Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BodyLarge(
text: 'Door Lock Alarm',
fontWeight: FontWeight.bold,
),
BodySmall(
text: 'When door lock alarms, trigger linkage.',
)
],
),
),
const SizedBox(width: 10),
Transform.scale(
scale: 1,
child: CupertinoSwitch(
value: false,
onChanged: (value) {},
applyTheme: true,
),
),
],
),
),
const Spacer(),
DefaultContainer(
onTap: () {},
padding: const EdgeInsets.symmetric(horizontal: 50, vertical: 10),
color: ColorsManager.primaryColorWithOpacity,
child: const BodyMedium(
text: 'Custom linkage Type',
fontColor: Colors.white,
),
),
],
),
);
}
}

View File

@ -0,0 +1,316 @@
// ignore_for_file: constant_identifier_names
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
import 'package:syncrow_app/generated/assets.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class UnlockingRecordsView extends StatelessWidget {
const UnlockingRecordsView({super.key});
@override
Widget build(BuildContext context) {
List<List<Map<String, dynamic>>> sortedRecords =
sortRecordsByDate(unlockingRecords);
return DefaultScaffold(
title: 'Unlocking Records',
child: SingleChildScrollView(
child: Column(
children: [
for (var records in sortedRecords)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: BodyMedium(
fontWeight: FontWeight.bold,
fontColor: Colors.grey,
text:
'${records[0]['day']} ${formatDate(DateTime.parse(records[0]['date'].toString()))}'),
),
DefaultContainer(
padding: const EdgeInsets.symmetric(
horizontal: 20, vertical: 10),
child: Column(
children: [
for (int i = 0; i < records.length; i++)
Column(
children: [
Row(
children: [
SizedBox.square(
dimension: 30,
child: records[i]['method'] ==
UnlockingMethod.Fingerprint
? SvgPicture.asset(Assets
.unlockingMethodsIconsFingerprint)
: records[i]['method'] ==
UnlockingMethod.Remote
? SvgPicture.asset(Assets
.unlockingMethodsIconsRemote)
: SvgPicture.asset(Assets
.unlockingMethodsIconsFace),
),
const SizedBox(
width: 13,
),
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
BodyMedium(
text: records[i]['title'],
),
BodySmall(
fontColor: Colors.grey,
text: formatTime(
records[i]['time'],
),
),
],
)
],
),
i != records.length - 1
? Padding(
padding: const EdgeInsets.only(
top: 10,
bottom: 10,
right: 15,
left: 40),
child: Container(
height: 1,
color: ColorsManager.greyColor,
),
)
: const SizedBox.shrink(),
],
),
],
))
],
),
],
),
),
);
}
String formatDate(DateTime date) {
return '${date.year}/${date.month.toString().padLeft(2, '0')}/${date.day.toString().padLeft(2, '0')}';
}
//time from 1200 to 12:00
String formatTime(int time) {
return '${(time / 100).floor()}:${(time % 100).toString().padLeft(2, '0')}';
}
/// Sorts the given [records] by date and returns a nested list of records grouped by date.
///
/// The [records] parameter is a list of maps, where each map represents a record with a 'date' key.
/// The records are sorted in ascending order based on the 'date' value.
/// The returned nested list contains sublists, where each sublist represents records for a specific date.
///
/// Example usage:
/// ```dart
/// List<Map<String, dynamic>> records = [
/// {'date': '2022-01-01', 'data': 'Record 1'},
/// {'date': '2022-01-02', 'data': 'Record 2'},
/// {'date': '2022-01-01', 'data': 'Record 3'},
/// ];
///
/// List<List<Map<String, dynamic>>> sortedRecords = sortRecordsByDate(records);
/// print(sortedRecords);
/// ```
/// This Dart function, sortRecordsByDate, takes a list of records as input,
/// where each record is a map with string keys and dynamic values. The
/// function's purpose is to sort these records by date and return a list of
/// lists, where each sublist contains records for a specific date.
// The function begins by initializing two empty lists: sortedRecords and dates.
// The sortedRecords list will eventually hold the sorted records, while the
//dates list will hold all unique dates present in the records.
// The first for loop iterates over each record in the input list. For each
//record, it parses the 'date' field into a DateTime object and checks if this
//date is already in the dates list. If the date is not already in the list, it
// is added. This way, the dates list ends up holding all unique dates present
//in the records.
// Next, the dates list is sorted in ascending order using the sort method with
// a comparator function that compares two DateTime objects.
// The second for loop iterates over each unique date. For each date, it
//initializes an empty list recordsForDate to hold all records for that date.
// It then iterates over each record in the input list again. If a record's
//ate matches the current date (i.e., their comparison result is 0), the record
// is added to recordsForDate. After all records have been checked, r
//ecordsForDate is added to sortedRecords.
// Finally, the function returns sortedRecords, which is a list of lists of
//records, where each sublist contains all records for a specific date, and the
//sublists are sorted in ascending order of date.
List<List<Map<String, dynamic>>> sortRecordsByDate(
List<Map<String, dynamic>> records) {
List<List<Map<String, dynamic>>> sortedRecords = [];
List<DateTime> dates = [];
for (var record in records) {
if (!dates.contains(DateTime.parse(record['date'].toString()))) {
dates.add(DateTime.parse(record['date'].toString()));
}
}
dates.sort((a, b) => a.compareTo(b));
for (var date in dates) {
List<Map<String, dynamic>> recordsForDate = [];
for (var record in records) {
if (DateTime.parse(record['date'].toString()).compareTo(date) == 0) {
recordsForDate.add(record);
}
}
sortedRecords.add(recordsForDate);
}
return sortedRecords;
}
}
enum UnlockingMethod {
Fingerprint,
Password,
Card,
Face,
Remote,
}
List<Map<String, dynamic>> unlockingRecords = [
{
'title': "XXX Fingerprint",
'time': 1200,
'date': 20240305,
'day': 'Tuesday',
'method': UnlockingMethod.Fingerprint,
},
{
'title': "XXX Face",
'time': 1200,
'date': 20240305,
'day': 'Tuesday',
'method': UnlockingMethod.Face,
},
{
'title': "XXX Remote",
'time': 1200,
'date': 20240305,
'day': 'Tuesday',
'method': UnlockingMethod.Remote,
},
{
'title': "XXX Face",
'time': 1200,
'date': 20240405,
'day': 'Wednesday',
'method': UnlockingMethod.Face,
},
{
'title': "XXX Fingerprint",
'time': 1200,
'date': 20240405,
'day': 'Wednesday',
'method': UnlockingMethod.Fingerprint,
},
{
'title': "XXX Fingerprint",
'time': 1200,
'date': 20240405,
'day': 'Wednesday',
'method': UnlockingMethod.Fingerprint,
},
{
'title': "XXX Remote",
'time': 1500,
'date': 20240505,
'day': 'Thursday',
'method': UnlockingMethod.Remote,
},
{
'title': "XXX Face",
'time': 1200,
'date': 20240505,
'day': 'Thursday',
'method': UnlockingMethod.Face,
},
{
'title': "XXX Fingerprint",
'time': 1200,
'date': 20240505,
'day': 'Thursday',
'method': UnlockingMethod.Fingerprint,
},
{
'title': "XXX Fingerprint",
'time': 1200,
'date': 20240505,
'day': 'Thursday',
'method': UnlockingMethod.Fingerprint,
},
{
'title': "XXX Remote",
'time': 1500,
'date': 20240505,
'day': 'Thursday',
'method': UnlockingMethod.Remote,
},
{
'title': "XXX Face",
'time': 1200,
'date': 20240605,
'day': 'Friday',
'method': UnlockingMethod.Face,
},
{
'title': "XXX Fingerprint",
'time': 1200,
'date': 20240605,
'day': 'Friday',
'method': UnlockingMethod.Fingerprint,
},
{
'title': "XXX Fingerprint",
'time': 1200,
'date': 20240605,
'day': 'Friday',
'method': UnlockingMethod.Fingerprint,
},
{
'title': "XXX Remote",
'time': 1500,
'date': 20240705,
'day': 'Saturday',
'method': UnlockingMethod.Remote,
},
{
'title': "XXX Face",
'time': 1200,
'date': 20240705,
'day': 'Saturday',
'method': UnlockingMethod.Face,
},
{
'title': "XXX Fingerprint",
'time': 1200,
'date': 20240705,
'day': 'Saturday',
'method': UnlockingMethod.Fingerprint,
},
{
'title': "XXX Fingerprint",
'time': 1200,
'date': 20240705,
'day': 'Saturday',
'method': UnlockingMethod.Fingerprint,
}
];

View File

@ -2,19 +2,14 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/auth/bloc/auth_cubit.dart';
import 'package:syncrow_app/features/menu/bloc/menu_cubit.dart';
import 'package:syncrow_app/features/menu/view/widgets/home%20management/create_home_view.dart';
import 'package:syncrow_app/features/menu/view/widgets/join_home/join_home_view.dart';
import 'package:syncrow_app/features/menu/view/widgets/manage_home/manage_home_view.dart';
import 'package:syncrow_app/features/menu/view/widgets/menu_list.dart';
import 'package:syncrow_app/features/menu/view/widgets/privacy/privacy_view.dart';
import 'package:syncrow_app/features/menu/view/widgets/profile/profile_tab.dart';
import 'package:syncrow_app/features/menu/view/widgets/securty/securty_view.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
import 'package:syncrow_app/generated/assets.dart';
import 'package:syncrow_app/navigation/routing_constants.dart';
import 'package:syncrow_app/utils/context_extension.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
import 'package:syncrow_app/utils/resource_manager/constants.dart';
class MenuView extends StatelessWidget {
@ -28,50 +23,42 @@ class MenuView extends StatelessWidget {
builder: (context, state) {
return BlocBuilder<AuthCubit, AuthState>(
builder: (context, state) {
return Padding(
padding: EdgeInsets.only(
top: Constants.appBarHeight,
bottom: Constants.bottomNavBarHeight,
left: Constants.defaultPadding,
right: Constants.defaultPadding,
),
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
child: Column(
children: [
const ProfileTab(),
for (var section in menuSections)
MenuList(
section: section,
),
const SizedBox(
height: 15,
return SingleChildScrollView(
physics: const BouncingScrollPhysics(),
child: Column(
children: [
const ProfileTab(),
for (var section in menuSections)
MenuList(
section: section,
),
InkWell(
onTap: () {
AuthCubit.get(context).logout();
Navigator.of(context).pushNamedAndRemoveUntil(
Routes.authLogin, (route) => false);
},
child: Row(
children: [
Expanded(
child: DefaultContainer(
child: Center(
child: BodyLarge(
text: 'Logout',
style: context.bodyLarge.copyWith(
color: Colors.red,
),
const SizedBox(
height: 15,
),
InkWell(
onTap: () {
AuthCubit.get(context).logout();
Navigator.of(context).pushNamedAndRemoveUntil(
Routes.authLogin, (route) => false);
},
child: Row(
children: [
Expanded(
child: DefaultContainer(
child: Center(
child: BodyLarge(
text: 'Logout',
style: context.bodyLarge.copyWith(
color: Colors.red,
),
),
),
),
],
),
)
],
),
),
],
),
)
],
),
);
},
@ -81,123 +68,3 @@ class MenuView extends StatelessWidget {
);
}
}
List<Map<String, Object>> menuSections = [
//Home Management
{
'title': 'Home Management',
'color': ColorsManager.primaryColor,
'buttons': [
{
'title': 'Create a Home',
'Icon': Assets.homeManagementIconsCreateHome,
'page': const CreateHomeView()
},
{
'title': 'Join a Home',
'Icon': Assets.homeManagementIconsJoinAHome,
'page': const JoinHomeView()
},
{
'title': 'Manage Your Home',
'Icon': Assets.homeManagementIconsManageYourHome,
'page': const ManageHomeView()
},
],
},
//General Settings
{
'title': 'General Settings',
'color': const Color(0xFF023DFE),
'buttons': [
{
'title': 'Voice Assistant',
'Icon': Assets.generalSettingsIconsVoiceAssistant,
'page': null
},
{
'title': 'Temperature unit',
'Icon': Assets.generalSettingsIconsTemperatureUnit,
'page': null
},
{
'title': 'Touch tone on panel',
'Icon': Assets.generalSettingsIconsTouchTone,
'page': null
},
{
'title': 'Language',
'Icon': Assets.generalSettingsIconsLanguage,
'page': null
},
{
'title': 'Network Diagnosis',
'Icon': Assets.generalSettingsIconsNetworkDiagnosis,
'page': null
},
{
'title': 'Clear Cache',
'Icon': Assets.generalSettingsIconsClearCache,
'page': null
},
],
},
//Messages Center
{
'title': 'Messages Center',
'color': const Color(0xFF0088FF),
'buttons': [
{
'title': 'Alerts',
'Icon': Assets.messagesCenterIconsAlerts,
'page': null
},
{
'title': 'Messages',
'Icon': Assets.messagesCenterIconsMessages,
'page': null
},
{'title': 'FAQs', 'Icon': Assets.messagesCenterIconsFAQs, 'page': null},
{
'title': 'Help & Feedback',
'Icon': Assets.messagesCenterIconsHelpAndFeedbacks,
'page': null
},
],
},
//Security And Privacy
{
'title': 'Security And Privacy',
'color': const Color(0xFF8AB9FF),
'buttons': [
{
'title': 'Security',
'Icon': Assets.securityAndPrivacyIconsSecurty,
'page': const SecurtyView()
},
{
'title': 'Privacy',
'Icon': Assets.securityAndPrivacyIconsPrivacy,
'page': const PrivacyView()
},
],
},
//Legal Information
{
'title': 'Legal Information',
'color': const Color(0xFF001B72),
'buttons': [
{'title': 'About', 'Icon': Assets.leagalInfoIconsAbout, 'page': null},
{
'title': 'Privacy Policy',
'Icon': Assets.leagalInfoIconsPrivacyPolicy,
'page': null
},
{
'title': 'User Agreement',
'Icon': Assets.leagalInfoIconsUserAgreement,
'page': null
},
],
},
];

View File

@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';

View File

@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/app_layout/model/space_model.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';

View File

@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
import 'package:syncrow_app/features/menu/view/widgets/manage_home/home_settings.dart';

View File

@ -19,7 +19,6 @@ class MenuListItem extends StatelessWidget {
Widget build(BuildContext context) {
return InkWell(
onTap: () {
debugPrint('clicked $title page: $page');
if (page == null) {
return;
}

View File

@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';

View File

@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';

View File

@ -6,7 +6,6 @@ import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dar
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart';
import 'package:syncrow_app/generated/assets.dart';
import 'package:syncrow_app/utils/resource_manager/constants.dart';
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
class SceneView extends StatelessWidget {
@ -18,109 +17,99 @@ class SceneView extends StatelessWidget {
create: (BuildContext context) => SceneCubit(),
child: BlocBuilder<SceneCubit, SceneState>(
builder: (context, state) {
return Padding(
padding: EdgeInsets.only(
top: Constants.appBarHeight,
bottom: Constants.bottomNavBarHeight,
left: Constants.defaultPadding,
right: Constants.defaultPadding,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const TitleMedium(
text: StringsManager.routine,
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.bold,
return Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const TitleMedium(
text: StringsManager.routine,
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 20),
const BodySmall(
text: StringsManager.tapToRunRoutine,
),
Row(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 10,
),
child: DefaultContainer(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Image.asset(
height: 50,
width: 50,
Assets.iconsHot1,
fit: BoxFit.contain,
),
const Icon(
Icons.play_circle,
size: 40,
color: Colors.grey,
)
],
),
const BodyMedium(
text: StringsManager.summerMode,
fontWeight: FontWeight.bold,
fontSize: 16,
)
],
),
),
),
),
),
const SizedBox(height: 20),
const BodySmall(
text: StringsManager.tapToRunRoutine,
),
Row(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 10,
),
child: DefaultContainer(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Image.asset(
height: 50,
width: 50,
Assets.iconsHot1,
fit: BoxFit.contain,
),
const Icon(
Icons.play_circle,
size: 40,
color: Colors.grey,
)
],
),
const BodyMedium(
text: StringsManager.summerMode,
fontWeight: FontWeight.bold,
fontSize: 16,
)
],
),
const SizedBox(width: 10),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 10,
),
child: DefaultContainer(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Image.asset(
height: 50,
width: 50,
Assets.iconsWinter1,
fit: BoxFit.contain,
),
const Icon(
Icons.play_circle,
size: 40,
color: Colors.grey,
)
],
),
const BodyMedium(
text: StringsManager.winterMode,
fontWeight: FontWeight.bold,
fontSize: 16,
)
],
),
),
),
const SizedBox(width: 10),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 10,
),
child: DefaultContainer(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Image.asset(
height: 50,
width: 50,
Assets.iconsWinter1,
fit: BoxFit.contain,
),
const Icon(
Icons.play_circle,
size: 40,
color: Colors.grey,
)
],
),
const BodyMedium(
text: StringsManager.winterMode,
fontWeight: FontWeight.bold,
fontSize: 16,
)
],
),
),
),
),
],
)
],
),
),
],
)
],
);
},
),

View File

@ -15,15 +15,18 @@ class DefaultButton extends StatelessWidget {
this.customButtonStyle,
this.backgroundColor,
this.foregroundColor,
this.borderRadius,
this.height,
this.padding,
});
final void Function()? onPressed;
final Widget child;
final double? height;
final bool isSecondary;
final double? borderRadius;
final bool enabled;
final double? padding;
final bool isDone;
final bool isLoading;
@ -65,21 +68,21 @@ class DefaultButton extends StatelessWidget {
}),
shape: MaterialStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
borderRadius: BorderRadius.circular(borderRadius ?? 20),
),
),
fixedSize: MaterialStateProperty.all(
const Size.fromHeight(50),
),
padding: MaterialStateProperty.all(
const EdgeInsets.all(10),
EdgeInsets.all(padding ?? 10),
),
minimumSize: MaterialStateProperty.all(
const Size.fromHeight(50),
),
),
child: SizedBox(
height: 50,
height: height ?? 50,
child: Center(
child: isLoading
? const SizedBox.square(

View File

@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
@ -9,11 +8,18 @@ import 'package:syncrow_app/utils/resource_manager/font_manager.dart';
class DefaultScaffold extends StatelessWidget {
const DefaultScaffold(
{super.key, required this.child, this.title, this.actions});
{super.key,
required this.child,
this.title,
this.actions,
this.appBar,
this.bottomNavBar});
final Widget child;
final String? title;
final List<Widget>? actions;
final PreferredSizeWidget? appBar;
final Widget? bottomNavBar;
@override
Widget build(BuildContext context) {
return AnnotatedRegion(
@ -26,20 +32,22 @@ class DefaultScaffold extends StatelessWidget {
backgroundColor: ColorsManager.backgroundColor,
extendBodyBehindAppBar: true,
extendBody: true,
appBar: AppBar(
backgroundColor: Colors.transparent,
centerTitle: true,
title: BodyLarge(
text: title ?? "",
fontColor: ColorsManager.primaryColor,
fontWeight: FontsManager.bold,
),
actions: actions,
),
appBar: appBar ??
AppBar(
backgroundColor: Colors.transparent,
centerTitle: true,
title: BodyLarge(
text: title ?? "",
fontColor: ColorsManager.primaryColor,
fontWeight: FontsManager.bold,
),
actions: actions,
),
body: Container(
width: MediaQuery.sizeOf(context).width,
height: MediaQuery.sizeOf(context).height,
padding: const EdgeInsets.all(Constants.defaultPadding),
padding:
const EdgeInsets.symmetric(horizontal: Constants.defaultPadding),
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
@ -51,6 +59,7 @@ class DefaultScaffold extends StatelessWidget {
),
child: SafeArea(child: child),
),
bottomNavigationBar: bottomNavBar,
),
);
}

View File

@ -30,6 +30,7 @@ class CustomText extends StatelessWidget {
Widget build(BuildContext context) {
//was SelectableText
return Text(
softWrap: true,
text,
style: style,
textAlign: textAlign,

View File

@ -176,6 +176,10 @@ class Assets {
static const String imagesTestDash2 = 'assets/images/test_dash2.png';
static const String imagesVector = 'assets/images/Vector.png';
static const String imagesWhiteLogo = 'assets/images/white-logo.png';
static const String linkageIconsDoorLockAlarm =
'assets/icons/linkageIcons/doorLockAlarm.svg';
static const String linkageIconsFamilyHome =
'assets/icons/linkageIcons/familyHome.svg';
static const String leagalInfoIconsAbout =
'assets/icons/MenuIcons/LeagalInfoIcons/About.svg';
static const String leagalInfoIconsPrivacyPolicy =
@ -214,6 +218,12 @@ class Assets {
'assets/icons/presence-sensor-assets/Record.svg';
static const String presenceSensorAssetsTime =
'assets/icons/presence-sensor-assets/Time.svg';
static const String unlockingMethodsIconsFace =
'assets/icons/unlockingMethodsIcons/face.svg';
static const String unlockingMethodsIconsFingerprint =
'assets/icons/unlockingMethodsIcons/fingerprint.svg';
static const String unlockingMethodsIconsRemote =
'assets/icons/unlockingMethodsIcons/remote.svg';
static const String securityAndPrivacyIconsPrivacy =
'assets/icons/MenuIcons/SecurityAndPrivacyIcons/Privacy.svg';
static const String securityAndPrivacyIconsSecurty =

View File

@ -1,6 +1,14 @@
//ignore_for_file: constant_identifier_names
import 'dart:ui';
import 'package:syncrow_app/features/devices/model/function_model.dart';
import 'package:syncrow_app/features/menu/view/widgets/home%20management/create_home_view.dart';
import 'package:syncrow_app/features/menu/view/widgets/join_home/join_home_view.dart';
import 'package:syncrow_app/features/menu/view/widgets/manage_home/manage_home_view.dart';
import 'package:syncrow_app/features/menu/view/widgets/privacy/privacy_view.dart';
import 'package:syncrow_app/features/menu/view/widgets/securty/securty_view.dart';
import 'package:syncrow_app/generated/assets.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
abstract class Constants {
static const String appName = "Syncrow App";
@ -9,8 +17,8 @@ abstract class Constants {
static const String countryCode = "US";
static const double appBarHeightPercentage = 0.12;
static const double bottomNavBarHeightPercentage = 0.1175;
static const double appBarHeightPercentage = 0.1;
static const double bottomNavBarHeightPercentage = 0.1;
static late double appBarHeight;
static late double bottomNavBarHeight;
@ -32,24 +40,6 @@ enum DeviceType {
Other,
}
// Map<String, DeviceType> devicesTypesMap = {
// "AC": DeviceType.AC,
// "LB": DeviceType.LightBulb,
// "DL": DeviceType.DoorLock,
// "WC": DeviceType.Curtain,
// "WB": DeviceType.Blind,
// "3G": DeviceType.ThreeGang,
// "GW": DeviceType.Gateway,
// "CPS": DeviceType.CeilingSensor,
// "WPS": DeviceType.WallSensor,
// "Other": DeviceType.Other,
// };
//AC wzdcrqh0
// GW wp8ticoo2bhumwgb
// CPS d3ci7gcn
// DL awu7anehyu5q1iu8
// WPS awarhusb
// 3G 1a6vgvyi
enum FunctionType { Boolean, Enum, Integer, Raw, String }
Map<String, FunctionType> functionTypesMap = {
@ -260,3 +250,224 @@ K? getNextItem<K, V>(Map<K, V> map, V value) {
// If the value is not found, return null
return null;
}
List<Map<String, Object>> menuSections = [
//Home Management
{
'title': 'Home Management',
'color': ColorsManager.primaryColor,
'buttons': [
{
'title': 'Create a Home',
'Icon': Assets.homeManagementIconsCreateHome,
'page': const CreateHomeView()
},
{
'title': 'Join a Home',
'Icon': Assets.homeManagementIconsJoinAHome,
'page': const JoinHomeView()
},
{
'title': 'Manage Your Home',
'Icon': Assets.homeManagementIconsManageYourHome,
'page': const ManageHomeView()
},
],
},
//General Settings
{
'title': 'General Settings',
'color': const Color(0xFF023DFE),
'buttons': [
{
'title': 'Voice Assistant',
'Icon': Assets.generalSettingsIconsVoiceAssistant,
'page': null
},
{
'title': 'Temperature unit',
'Icon': Assets.generalSettingsIconsTemperatureUnit,
'page': null
},
{
'title': 'Touch tone on panel',
'Icon': Assets.generalSettingsIconsTouchTone,
'page': null
},
{
'title': 'Language',
'Icon': Assets.generalSettingsIconsLanguage,
'page': null
},
{
'title': 'Network Diagnosis',
'Icon': Assets.generalSettingsIconsNetworkDiagnosis,
'page': null
},
{
'title': 'Clear Cache',
'Icon': Assets.generalSettingsIconsClearCache,
'page': null
},
],
},
//Messages Center
{
'title': 'Messages Center',
'color': const Color(0xFF0088FF),
'buttons': [
{
'title': 'Alerts',
'Icon': Assets.messagesCenterIconsAlerts,
'page': null
},
{
'title': 'Messages',
'Icon': Assets.messagesCenterIconsMessages,
'page': null
},
{'title': 'FAQs', 'Icon': Assets.messagesCenterIconsFAQs, 'page': null},
{
'title': 'Help & Feedback',
'Icon': Assets.messagesCenterIconsHelpAndFeedbacks,
'page': null
},
],
},
//Security And Privacy
{
'title': 'Security And Privacy',
'color': const Color(0xFF8AB9FF),
'buttons': [
{
'title': 'Security',
'Icon': Assets.securityAndPrivacyIconsSecurty,
'page': const SecurtyView()
},
{
'title': 'Privacy',
'Icon': Assets.securityAndPrivacyIconsPrivacy,
'page': const PrivacyView()
},
],
},
//Legal Information
{
'title': 'Legal Information',
'color': const Color(0xFF001B72),
'buttons': [
{'title': 'About', 'Icon': Assets.leagalInfoIconsAbout, 'page': null},
{
'title': 'Privacy Policy',
'Icon': Assets.leagalInfoIconsPrivacyPolicy,
'page': null
},
{
'title': 'User Agreement',
'Icon': Assets.leagalInfoIconsUserAgreement,
'page': null
},
],
},
];
enum MemberRole {
FamilyMember,
OtherMember,
}
//TODO sort memebers by role
List<Map<String, Object>> members = [
{
'name': 'member 1',
'role': MemberRole.FamilyMember,
},
{
'name': 'member 2',
'role': MemberRole.OtherMember,
},
{
'name': 'member 3',
'role': MemberRole.FamilyMember,
},
{
'name': 'member 4',
'role': MemberRole.OtherMember,
},
{
'name': 'member 5',
'role': MemberRole.FamilyMember,
},
{
'name': 'member 6',
'role': MemberRole.OtherMember,
},
{
'name': 'member 7',
'role': MemberRole.FamilyMember,
},
{
'name': 'member 8',
'role': MemberRole.OtherMember,
},
{
'name': 'member 9',
'role': MemberRole.FamilyMember,
},
{
'name': 'member 10',
'role': MemberRole.OtherMember,
},
{
'name': 'member 11',
'role': MemberRole.FamilyMember,
},
{
'name': 'member 12',
'role': MemberRole.OtherMember,
},
{
'name': 'member 13',
'role': MemberRole.FamilyMember,
},
{
'name': 'member 14',
'role': MemberRole.OtherMember,
},
{
'name': 'member 15',
'role': MemberRole.FamilyMember,
},
{
'name': 'member 16',
'role': MemberRole.OtherMember,
},
{
'name': 'member 17',
'role': MemberRole.FamilyMember,
},
{
'name': 'member 18',
'role': MemberRole.OtherMember,
},
{
'name': 'member 19',
'role': MemberRole.FamilyMember,
},
{
'name': 'member 20',
'role': MemberRole.OtherMember,
},
{
'name': 'member 21',
'role': MemberRole.FamilyMember,
},
{
'name': 'member 22',
'role': MemberRole.OtherMember,
},
{
'name': 'member 23',
'role': MemberRole.FamilyMember,
},
];

View File

@ -54,6 +54,8 @@ flutter:
- assets/icons/presence-sensor-assets/
- assets/icons/battery/dmOff/
- assets/icons/battery/dmOn/
- assets/icons/unlockingMethodsIcons/
- assets/icons/linkageIcons/
- assets/icons/MenuIcons/GeneralSettingsIcons/
- assets/icons/MenuIcons/HomeManagementIcons/
- assets/icons/MenuIcons/LeagalInfoIcons/