Compare commits

..

47 Commits

Author SHA1 Message Date
b3ec0fbf73 Merged with dev 2024-11-06 10:44:10 +03:00
27b0816ffd Merge pull request #48 from SyncrowIOT/new_devices
SOS Device
2024-11-04 23:51:52 +03:00
dc55232a42 remove commented code 2024-11-04 12:09:44 +03:00
7b179c90c3 push SOS device 2024-11-04 12:06:44 +03:00
0fc709a5b1 push sos basic device implementation 2024-10-31 11:32:34 +03:00
3e9b93c2fc Merge branch 'dev' of https://github.com/SyncrowIOT/web into feat/refactoring 2024-10-31 09:26:23 +04:00
13622c1dcf Merge pull request #45 from SyncrowIOT/web_issue
forget_password&power_clamp_issue
2024-10-30 14:24:22 +03:00
8b1099c683 dateTime issue 2024-10-30 13:17:46 +03:00
b802a6130d Merged with dev 2024-10-30 10:55:45 +03:00
73ab6f3d05 forget_password&power_clamp_issue 2024-10-30 09:47:18 +03:00
bc53605114 Merge pull request #44 from SyncrowIOT/30_oct_fixes
enhancement and bug fixes
2024-10-30 09:31:01 +03:00
29a2e9285b enhancement and bug fixes 2024-10-30 00:46:48 +03:00
5d10b2a35b Merge pull request #41 from SyncrowIOT/power_clamp
Power clamp
2024-10-29 11:06:16 +03:00
4eb214e010 remove_file 2024-10-29 10:50:44 +03:00
81913dca9f power_clamp_issue 2024-10-29 09:43:09 +03:00
62e8c372f7 Merge branch 'power_clamp' of https://github.com/SyncrowIOT/web into power_clamp 2024-10-28 13:18:42 +03:00
0425b19478 power_clamp_issue 2024-10-28 13:17:48 +03:00
8775258160 Updated the pubspec.lock 2024-10-27 23:41:26 +03:00
9dda21075e Updated the pubspec.lock 2024-10-27 23:39:00 +03:00
361891546c Merged with dev 2024-10-27 23:31:04 +03:00
79f96f3255 Merge pull request #43 from SyncrowIOT/enhancement
shadow and text color
2024-10-27 23:15:26 +03:00
c4421a9ef3 Edited pubspec.lock file 2024-10-27 23:12:38 +03:00
5fff4445ac Added pubspec.lock file 2024-10-27 23:09:33 +03:00
19e0c6e7bd Delete pubspec.lock 2024-10-27 15:23:32 +03:00
b7dddcb8dd shadow and text color 2024-10-27 12:36:32 +03:00
23e54c7e78 batch_control 2024-10-25 20:17:34 +03:00
a594d5b93c power_clamp_batch_control 2024-10-25 20:06:07 +03:00
b8ad20b3ff power_clamp_functionality 2024-10-24 17:40:32 +03:00
9b4e687e9a power_clamp_functionality 2024-10-24 15:03:19 +03:00
2941565b3d Merge pull request #42 from SyncrowIOT/web_scroll_logout_fixes
table scroll, logout, and  fixes
2024-10-23 13:12:07 +03:00
76fbfd2d95 Removed vs_scrollbar package 2024-10-23 13:08:34 +03:00
0b15391868 push logout dialog design 2024-10-23 11:56:48 +03:00
1c9943cfdb finilizing the alert dialog for logut 2024-10-23 02:40:44 +03:00
bd7651fa8c push scroll bar and design enhancment 2024-10-23 01:15:17 +03:00
e01ed33b17 Merge branch 'power_clamp' of https://github.com/SyncrowIOT/web into power_clamp 2024-10-22 13:28:28 +03:00
f0c2560af2 power_clamp 2024-10-22 13:26:36 +03:00
64b84fed82 filter by space 2024-10-22 11:31:49 +04:00
bb5571a02d power_clamp 2024-10-22 10:18:49 +03:00
0b0fee2e26 added community filtering 2024-10-22 10:47:14 +04:00
76f48aad6f added community 2024-10-22 10:22:39 +04:00
c297e02a84 added community to all device 2024-10-22 10:12:08 +04:00
03b5c49df0 added device spaces model 2024-10-21 21:54:22 +04:00
b9ecae7068 power_clamp 2024-10-21 16:50:05 +03:00
97c3b90b76 power_clamp 2024-10-21 16:47:31 +03:00
3684ac4d27 power_clamp 2024-10-21 16:39:10 +03:00
9b0e6ff898 power_clamp 2024-10-20 16:36:45 +03:00
a3a92e5d3f Merge pull request #38 from SyncrowIOT/access_bug_fixes
access_bug_fixes
2024-10-09 21:30:58 +03:00
67 changed files with 3866 additions and 562 deletions

View File

@ -0,0 +1,6 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.892857 12.1429H2.44054C2.60714 12.733 2.84125 13.2989 3.13875 13.8311L2.04518 14.9246C1.87643 15.0932 1.78357 15.3175 1.78357 15.5561C1.78357 15.7946 1.87661 16.0188 2.04518 16.1873L3.43196 17.5741C3.57125 17.7136 3.7975 17.7136 3.93696 17.5741C4.07643 17.4346 4.07643 17.2086 3.93696 17.0691L2.55018 15.6821C2.50464 15.6368 2.49786 15.5836 2.49786 15.5559C2.49786 15.5282 2.50464 15.4752 2.55018 15.4295L3.83821 14.1414C3.95464 14.025 3.97643 13.8441 3.89089 13.7034C3.51482 13.0843 3.23607 12.4105 3.0625 11.7009C3.02357 11.5411 2.88018 11.4286 2.71571 11.4286H0.892857C0.794464 11.4286 0.714286 11.3484 0.714286 11.25V8.75C0.714286 8.65161 0.794464 8.57143 0.892857 8.57143H2.71571C2.88036 8.57143 3.02357 8.45893 3.06268 8.29911C3.23607 7.58964 3.51482 6.91571 3.89107 6.29661C3.97661 6.15589 3.95464 5.975 3.83839 5.85857L2.55036 4.57054C2.50482 4.525 2.49804 4.47179 2.49804 4.44411C2.49804 4.41661 2.50482 4.36339 2.55036 4.31786L4.31804 2.55C4.38786 2.48018 4.50089 2.48036 4.57071 2.55L5.85875 3.83821C5.97518 3.95464 6.15607 3.97643 6.29679 3.89089C6.91607 3.51464 7.58982 3.23589 8.29929 3.0625C8.45893 3.02357 8.57143 2.88018 8.57143 2.71571V0.892857C8.57143 0.794464 8.65161 0.714286 8.75 0.714286H11.25C11.3484 0.714286 11.4286 0.794464 11.4286 0.892857V2.71571C11.4286 2.88036 11.5411 3.02357 11.7009 3.06268C12.4104 3.23607 13.0843 3.51482 13.7034 3.89107C13.8441 3.97661 14.0252 3.95482 14.1414 3.83839L15.4295 2.55036C15.4991 2.48071 15.6125 2.48054 15.6821 2.55036L17.4498 4.31821C17.4954 4.36357 17.5021 4.41679 17.5021 4.44446C17.5021 4.47214 17.4954 4.52518 17.4498 4.57089L16.1618 5.85893C16.0454 5.97536 16.0236 6.15625 16.1091 6.29696C16.4854 6.91625 16.7641 7.59 16.9375 8.29946C16.9766 8.45929 17.1198 8.57179 17.2845 8.57179H19.1071C19.2055 8.57179 19.2857 8.65196 19.2857 8.75036V11.2504C19.2857 11.3488 19.2055 11.4289 19.1071 11.4289H17.2843C17.1196 11.4289 16.9764 11.5414 16.9373 11.7013C16.7639 12.4111 16.4852 13.0848 16.1089 13.7037C16.0234 13.8445 16.0452 14.0254 16.1616 14.1418L17.4496 15.4298C17.4952 15.4754 17.502 15.5286 17.502 15.5562C17.502 15.5837 17.4952 15.637 17.4496 15.6825L16.0629 17.0693C15.9234 17.2087 15.9234 17.4348 16.0629 17.5743C16.1327 17.6441 16.2239 17.6789 16.3154 17.6789C16.4068 17.6789 16.4982 17.6441 16.5679 17.5743L17.9546 16.1875C18.1232 16.0189 18.2163 15.7946 18.2163 15.5561C18.2163 15.3175 18.1234 15.0934 17.9546 14.9246L16.8611 13.8311C17.1586 13.2989 17.3927 12.7332 17.5593 12.1429H19.1071C19.5995 12.1429 20 11.7423 20 11.25V8.75C20 8.25768 19.5995 7.85714 19.1071 7.85714H17.5595C17.3929 7.26714 17.1588 6.70125 16.8612 6.16911L17.9548 5.07554C18.1236 4.90696 18.2164 4.68268 18.2164 4.44411C18.2164 4.20554 18.1234 3.98143 17.9548 3.81286L16.1871 2.045C15.8391 1.69696 15.2727 1.69679 14.9245 2.045L13.8309 3.13857C13.2988 2.84107 12.7329 2.60696 12.1429 2.44036V0.892857C12.1429 0.400536 11.7423 0 11.25 0H8.75C8.25768 0 7.85714 0.400536 7.85714 0.892857V2.44054C7.26714 2.60714 6.70125 2.84125 6.16911 3.13875L5.07554 2.045C4.72732 1.69696 4.16089 1.69696 3.81286 2.045L2.04518 3.81268C1.87661 3.98125 1.78357 4.20554 1.78357 4.44411C1.78357 4.68268 1.87643 4.90679 2.04518 5.07554L3.13875 6.16911C2.84125 6.70125 2.60714 7.26714 2.44054 7.85714H0.892857C0.400536 7.85714 0 8.25768 0 8.75V11.25C0 11.7423 0.400536 12.1429 0.892857 12.1429Z" fill="black"/>
<path d="M13.3929 9.28568C13.3929 7.41479 11.8709 5.89282 10 5.89282C8.12914 5.89282 6.60718 7.41479 6.60718 9.28568C6.60718 11.1566 8.12914 12.6785 10 12.6785C11.8709 12.6785 13.3929 11.1566 13.3929 9.28568ZM7.32146 9.28568C7.32146 7.80871 8.52307 6.60711 10 6.60711C11.477 6.60711 12.6786 7.80871 12.6786 9.28568C12.6786 10.7626 11.477 11.9643 10 11.9643C8.52307 11.9643 7.32146 10.7626 7.32146 9.28568Z" fill="black"/>
<path d="M4.64282 17.3214V18.75C4.64282 19.4393 5.20354 20 5.89282 20H14.1071C14.7964 20 15.3571 19.4393 15.3571 18.75V17.3214C15.3571 15.1551 13.5948 13.3928 11.4285 13.3928H8.57139C6.40514 13.3928 4.64282 15.1551 4.64282 17.3214ZM8.57139 14.1071H11.4285C13.2009 14.1071 14.6428 15.5491 14.6428 17.3214V18.75C14.6428 19.0453 14.4025 19.2857 14.1071 19.2857H5.89282C5.59747 19.2857 5.35711 19.0453 5.35711 18.75V17.3214C5.35711 15.5491 6.79907 14.1071 8.57139 14.1071Z" fill="black"/>
<path d="M10.3571 15.7143H11.3048C12.1607 15.7143 12.8571 16.4107 12.8571 17.2666C12.8571 17.4638 13.0171 17.6238 13.2143 17.6238C13.4114 17.6238 13.5714 17.4638 13.5714 17.2666C13.5714 16.0168 12.5546 15 11.3048 15H10.3571C10.16 15 10 15.16 10 15.3571C10 15.5543 10.16 15.7143 10.3571 15.7143Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -0,0 +1,25 @@
<svg width="23" height="18" viewBox="0 0 23 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M22.3032 0.832703H1.4526C1.10932 0.832703 0.830078 1.11285 0.830078 1.45725V16.6318C0.830078 16.9762 1.10932 17.2563 1.4526 17.2563H22.3032C22.6463 17.2563 22.9257 16.9762 22.9257 16.6318V1.45725C22.9257 1.11265 22.6465 0.832703 22.3032 0.832703Z" fill="#E6E7E8"/>
<path d="M21.8881 0.624556V15.7989C21.8881 16.029 21.7023 16.2153 21.4731 16.2153H0.622537C0.393143 16.2153 0.20752 16.029 0.20752 15.7989V0.624556C0.20752 0.394417 0.393143 0.208191 0.622537 0.208191H21.4731C21.7023 0.208191 21.8881 0.394417 21.8881 0.624556Z" fill="white"/>
<path d="M0.20752 15.7989C0.20752 16.0288 0.393143 16.2152 0.622537 16.2152H21.4731C21.7023 16.2152 21.8881 16.0288 21.8881 15.7989V0.832703H0.20752V15.7989Z" fill="#D4FBFF"/>
<path d="M4.44421 8.45071C4.36336 8.45071 4.29 8.3952 4.27055 8.31266C3.4626 4.87562 2.7657 4.37773 2.4283 4.37427C1.65825 4.38423 0.871172 6.79256 0.555856 8.30819C0.535592 8.40517 0.440754 8.46758 0.3447 8.44705C0.248038 8.42672 0.186231 8.33177 0.206293 8.235C0.29566 7.80501 1.11779 4.03293 2.42364 4.01605H2.43336C3.2484 4.01605 3.94267 5.35582 4.61829 8.23053C4.64098 8.32669 4.58161 8.42326 4.48555 8.44603C4.47157 8.44928 4.45799 8.45071 4.44421 8.45071Z" fill="#FFD7E5"/>
<path d="M12.6696 8.59971C12.5887 8.59971 12.5156 8.54421 12.4959 8.46167C11.6916 5.03987 11.001 4.52328 10.6583 4.52328C10.6569 4.52328 10.6553 4.52348 10.6539 4.52348C9.88383 4.53344 9.09696 6.94157 8.78164 8.45719C8.76118 8.55417 8.66634 8.61679 8.57029 8.59605C8.47362 8.57572 8.41182 8.48078 8.43188 8.38401C8.52145 7.95402 9.34358 4.18193 10.6494 4.16526C11.4762 4.15693 12.1656 5.49364 12.8437 8.37953C12.8664 8.4757 12.807 8.57226 12.7109 8.59524C12.6972 8.59829 12.6834 8.59971 12.6696 8.59971Z" fill="#FFD7E5"/>
<path d="M20.7961 8.29596C20.7152 8.29596 20.6418 8.24046 20.6224 8.15792C19.8181 4.73612 19.1275 4.21953 18.7848 4.21953C18.7832 4.21953 18.7818 4.21973 18.7803 4.21973C18.0103 4.2297 17.2234 6.63782 16.9081 8.15345C16.8878 8.25042 16.7928 8.31284 16.6968 8.2923C16.6001 8.27197 16.5383 8.17703 16.5583 8.08026C16.6477 7.65027 17.47 3.87818 18.7759 3.86151C19.5903 3.84647 20.2921 5.1899 20.9701 8.07579C20.9928 8.17195 20.9335 8.26852 20.8374 8.29149C20.8234 8.29454 20.8098 8.29596 20.7961 8.29596Z" fill="#FFD7E5"/>
<path d="M6.52174 12.5619C6.5185 12.5619 6.51546 12.5617 6.51181 12.5617C5.17537 12.5448 4.33378 8.7729 4.24219 8.34291C4.22152 8.24594 4.28495 8.15099 4.38384 8.13087C4.48252 8.11074 4.57959 8.17275 4.60006 8.26972C4.92287 9.78535 5.729 12.1935 6.51668 12.2034C6.5181 12.2034 6.51972 12.2036 6.52114 12.2036C6.87212 12.2036 7.57915 11.6875 8.40229 8.26525C8.42519 8.16909 8.52388 8.10993 8.62216 8.13188C8.72065 8.15465 8.78144 8.25122 8.75814 8.34759C8.06671 11.2215 7.35583 12.5619 6.52174 12.5619Z" fill="#FFD7E5"/>
<path d="M14.7221 12.5619C14.7187 12.5619 14.7157 12.5617 14.7124 12.5617C13.4066 12.5448 12.5842 8.7729 12.4949 8.34291C12.4748 8.24594 12.5366 8.15099 12.6333 8.13087C12.7299 8.11074 12.8244 8.17275 12.8446 8.26972C13.1599 9.78535 13.9472 12.1935 14.7169 12.2034C14.7183 12.2034 14.7197 12.2036 14.7213 12.2036C15.064 12.2036 15.7546 11.6875 16.5589 8.26525C16.5816 8.16909 16.6777 8.10972 16.7737 8.13188C16.8698 8.15465 16.9292 8.25122 16.9065 8.34759C16.2314 11.2215 15.5368 12.5619 14.7221 12.5619Z" fill="#FFD7E5"/>
<path d="M21.7088 11.1408C21.6411 11.1408 21.5763 11.102 21.5463 11.0361C20.9983 9.83621 20.6678 8.26468 20.6542 8.1982C20.634 8.10142 20.696 8.00648 20.7926 7.98615C20.8887 7.96602 20.9837 8.02803 21.0038 8.12501C21.0072 8.14087 21.34 9.72419 21.8711 10.8871C21.912 10.9769 21.8727 11.0831 21.783 11.1245C21.7591 11.1357 21.7339 11.1408 21.7088 11.1408Z" fill="#FFD7E5"/>
<path d="M3.03701 8.32623C2.97175 8.32623 2.91238 8.2811 2.89677 8.21462C2.36037 5.93295 1.90949 5.68532 1.73582 5.69386C1.28088 5.69976 0.771229 7.16923 0.554601 8.21096C0.538389 8.28923 0.46179 8.33945 0.383771 8.32298C0.305753 8.30671 0.255902 8.23007 0.271911 8.152C0.366952 7.69498 0.884102 5.41534 1.73177 5.40436H1.73845C2.28033 5.40436 2.7379 6.27653 3.17764 8.14814C3.19588 8.2258 3.14785 8.30387 3.07024 8.32237C3.0593 8.32461 3.04815 8.32623 3.03701 8.32623Z" fill="#FA759E"/>
<path d="M8.34895 8.42239C8.2835 8.42239 8.22412 8.37746 8.20852 8.31078C7.67475 6.03927 7.22204 5.79002 7.04979 5.79002C7.04898 5.79002 7.04838 5.79002 7.04757 5.79002C6.59283 5.79592 6.08318 7.26539 5.86655 8.30712C5.85014 8.38539 5.77333 8.43561 5.69572 8.41914C5.6177 8.40288 5.56765 8.32623 5.58386 8.24816C5.6789 7.79114 6.19605 5.5115 7.04372 5.50052H7.0502C7.59207 5.50052 8.04965 6.37269 8.48939 8.2443C8.50762 8.32196 8.4596 8.40003 8.38198 8.41853C8.37084 8.42117 8.3599 8.42239 8.34895 8.42239Z" fill="#FA759E"/>
<path d="M13.5964 8.22601C13.5309 8.22601 13.4716 8.18108 13.456 8.1144C12.9198 5.83293 12.4648 5.59039 12.295 5.59385C11.8401 5.59974 11.3304 7.06922 11.1138 8.11094C11.0976 8.18921 11.021 8.23984 10.9432 8.22296C10.8651 8.2067 10.8151 8.12985 10.8313 8.05178C10.9263 7.59476 11.4435 5.31532 12.2912 5.30414H12.2976C12.8395 5.30414 13.2971 6.17651 13.7368 8.04812C13.7551 8.12578 13.707 8.20385 13.6294 8.22235C13.6185 8.22479 13.6073 8.22601 13.5964 8.22601Z" fill="#FA759E"/>
<path d="M18.895 8.42239C18.8298 8.42239 18.7704 8.37746 18.7548 8.31078C18.2186 6.02931 17.7635 5.78677 17.5938 5.79002C17.1389 5.79612 16.6292 7.26539 16.4126 8.30712C16.3962 8.38539 16.3198 8.43601 16.242 8.41914C16.1638 8.40288 16.1139 8.32623 16.1301 8.24816C16.2252 7.79114 16.7421 5.5115 17.5898 5.50052H17.5965C18.1383 5.50052 18.5959 6.37269 19.0357 8.2443C19.0539 8.32196 19.0059 8.40003 18.9283 8.41853C18.9171 8.42117 18.9062 8.42239 18.895 8.42239Z" fill="#FA759E"/>
<path d="M4.4265 11.1188C4.42427 11.1188 4.42204 11.1188 4.41981 11.1188C3.57195 11.1076 3.055 8.8282 2.95996 8.37118C2.94375 8.2929 2.9938 8.21626 3.07162 8.19999C3.14984 8.18332 3.22623 8.23374 3.24245 8.31201C3.45928 9.35354 3.96913 10.8234 4.42367 10.8291H4.42589C4.59814 10.8291 5.05065 10.5799 5.58462 8.30856C5.60286 8.2309 5.68067 8.18312 5.75808 8.20081C5.8357 8.2191 5.88352 8.29717 5.86528 8.37504C5.42575 10.2464 4.96838 11.1188 4.4265 11.1188Z" fill="#FA759E"/>
<path d="M9.67406 10.9584C9.67183 10.9584 9.6696 10.9584 9.66737 10.9584C8.81951 10.9474 8.30256 8.66778 8.20752 8.21076C8.19131 8.13248 8.24136 8.05584 8.31917 8.03978C8.3976 8.02311 8.47359 8.07353 8.49 8.1518C8.70683 9.19332 9.21669 10.663 9.67122 10.6689H9.67345C9.8457 10.6689 10.2982 10.4196 10.8322 8.14814C10.8504 8.07027 10.928 8.0229 11.0056 8.04059C11.0833 8.05889 11.1311 8.13696 11.1128 8.21482C10.6733 10.086 10.2159 10.9584 9.67406 10.9584Z" fill="#FA759E"/>
<path d="M14.9774 10.9842C14.9752 10.9842 14.9732 10.9842 14.971 10.9842C14.1229 10.9732 13.6061 8.69361 13.5111 8.23658C13.4949 8.15831 13.5449 8.08166 13.6228 8.0656C13.701 8.04893 13.7772 8.09915 13.7934 8.17762C14.0102 9.21915 14.5201 10.6888 14.9746 10.6947H14.9768C15.1491 10.6947 15.6016 10.4455 16.1356 8.17396C16.1538 8.0963 16.2316 8.04873 16.309 8.06642C16.3866 8.08471 16.4347 8.16278 16.4164 8.24065C15.9767 10.1121 15.5193 10.9842 14.9774 10.9842Z" fill="#FA759E"/>
<path d="M20.234 11.1188C20.2318 11.1188 20.2298 11.1188 20.2274 11.1188C19.3795 11.1076 18.8627 8.8282 18.7677 8.37118C18.7515 8.2929 18.8015 8.21626 18.8794 8.19999C18.9576 8.18332 19.0338 8.23374 19.05 8.31201C19.2668 9.35354 19.7767 10.8234 20.2312 10.8291H20.2334C20.4057 10.8291 20.8582 10.5799 21.3922 8.30856C21.4104 8.2309 21.4882 8.18312 21.5656 8.20081C21.6432 8.2191 21.6913 8.29717 21.673 8.37504C21.2335 10.2464 20.7759 11.1188 20.234 11.1188Z" fill="#FA759E"/>
<path d="M5.67451 8.26302C5.58717 8.26302 5.50794 8.20284 5.48707 8.11399C4.43696 3.6462 3.52019 2.97225 3.06363 2.97225C3.06161 2.97225 3.05958 2.97225 3.05776 2.97225C2.03541 2.98567 1.00151 6.12996 0.589942 8.10912C0.568258 8.21382 0.46572 8.28091 0.361763 8.25895C0.257401 8.2372 0.190528 8.13473 0.212211 8.02983C0.327719 7.47501 1.38816 2.60651 3.05269 2.58496H3.06404C4.08719 2.58496 5.00254 4.36447 5.86257 8.02495C5.88709 8.12884 5.82265 8.23333 5.7191 8.25793C5.7043 8.26139 5.68931 8.26302 5.67451 8.26302Z" fill="#0089EF"/>
<path d="M16.3507 8.26302C16.2633 8.26302 16.1841 8.20284 16.163 8.11399C15.1131 3.6462 14.1964 2.97225 13.7398 2.97225C13.7378 2.97225 13.7357 2.97225 13.7337 2.97225C12.7116 2.98567 11.6779 6.12996 11.2661 8.10912C11.2442 8.21382 11.1419 8.28091 11.0379 8.25895C10.9336 8.2372 10.8667 8.13473 10.8882 8.02983C11.0039 7.47501 12.0641 2.60651 13.7286 2.58496H13.74C14.7627 2.58496 15.6781 4.36447 16.5385 8.02495C16.563 8.12884 16.4986 8.23333 16.3951 8.25793C16.3805 8.26139 16.3655 8.26302 16.3507 8.26302Z" fill="#0089EF"/>
<path d="M8.46634 13.838C8.46269 13.838 8.45884 13.838 8.45499 13.838C6.79046 13.8164 5.73002 8.94794 5.61431 8.39292C5.59263 8.28843 5.6595 8.18576 5.76406 8.164C5.86802 8.14205 5.97056 8.20934 5.99224 8.31384C6.40422 10.2928 7.43832 13.4375 8.45985 13.4505H8.46593C8.9227 13.4505 9.83926 12.777 10.8892 8.30896C10.9137 8.20507 11.0178 8.14123 11.1212 8.16482C11.2249 8.18942 11.2892 8.29371 11.2647 8.3978C10.4046 12.0583 9.48909 13.838 8.46634 13.838Z" fill="#0089EF"/>
<path d="M19.014 13.6947C19.0103 13.6947 19.0065 13.6947 19.0026 13.6947C17.3381 13.6729 16.2776 8.80464 16.1619 8.24963C16.1402 8.14513 16.2069 8.04246 16.3117 8.0205C16.416 7.99875 16.518 8.06604 16.5399 8.17054C16.9518 10.1495 17.9859 13.294 19.0075 13.3072H19.0135C19.4703 13.3072 20.3869 12.6335 21.4368 8.16546C21.4613 8.06157 21.5655 7.99794 21.6688 8.02152C21.7726 8.04592 21.837 8.15021 21.8123 8.2543C20.9523 11.9148 20.0367 13.6947 19.014 13.6947Z" fill="#0089EF"/>
<path d="M21.4731 0H0.622526C0.279245 0 0 0.280152 0 0.624547V15.7991C0 16.1435 0.279245 16.4236 0.622526 16.4236H21.4731C21.8162 16.4236 22.0956 16.1435 22.0956 15.7991V6.08324C22.0956 5.96817 22.0026 5.87506 21.8881 5.87506C21.7734 5.87506 21.6806 5.96817 21.6806 6.08324V8.00323H18.0263C17.7882 6.70921 16.7602 1.48066 15.5275 0.416365H21.4731C21.5874 0.416365 21.6806 0.509681 21.6806 0.624547V2.90866C21.6806 3.02373 21.7734 3.11684 21.8881 3.11684C22.0026 3.11684 22.0956 3.02373 22.0956 2.90866V0.624547C22.0956 0.279949 21.8164 0 21.4731 0ZM17.6453 8.4196C17.94 9.69594 19.2156 14.9412 20.4964 16.0071H9.63335C10.8664 14.9428 11.8945 9.71342 12.1324 8.4196H17.6453ZM9.20192 15.7828C8.47685 15.7828 7.18702 12.0658 6.33874 8.4196H11.7101C11.0348 12.0642 9.92273 15.7828 9.20192 15.7828ZM5.80943 8.00323H0.438119C1.11576 4.35902 2.23011 0.640405 2.95072 0.640405C3.67558 0.640405 4.96319 4.3574 5.80943 8.00323ZM0.622526 0.416365H2.51908C1.64751 1.16899 0.876441 4.00121 0.415017 6.0564V0.624547C0.415017 0.509681 0.508032 0.416365 0.622526 0.416365ZM0.415017 15.7989V8.4196H5.91258C6.20723 9.69594 7.48288 14.9412 8.7636 16.0071H0.622526C0.508032 16.0071 0.415017 15.9138 0.415017 15.7989ZM21.4731 16.0071H21.3939C21.4934 15.9217 21.5902 15.8062 21.6806 15.6543V15.7989C21.6806 15.9138 21.5874 16.0071 21.4731 16.0071ZM21.6806 14.2969C21.5136 15.3866 21.1434 15.7828 20.9347 15.7828C20.2096 15.7828 18.9198 12.0658 18.0715 8.4196H21.6802V14.2969H21.6806ZM17.604 8.00323H12.2329C13.081 4.3574 14.3708 0.640405 15.0959 0.640405C15.8167 0.640405 16.9288 4.35902 17.604 8.00323ZM11.8065 8.00323H6.2356C5.94156 6.72629 4.66915 1.48249 3.38944 0.416365H14.6569C13.3768 1.48269 12.1014 6.72669 11.8065 8.00323Z" fill="#3A2C60"/>
<path d="M21.8882 3.50696C21.7735 3.50696 21.6807 3.60007 21.6807 3.71514V5.22446C21.6807 5.33953 21.7735 5.43265 21.8882 5.43265C22.0027 5.43265 22.0957 5.33953 22.0957 5.22446V3.71514C22.0957 3.60027 22.0027 3.50696 21.8882 3.50696Z" fill="#3A2C60"/>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,4 @@
<svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="19.5" cy="19.5" r="18.5" fill="#D9D9D9" stroke="white" stroke-width="2"/>
<path opacity="0.994" fill-rule="evenodd" clip-rule="evenodd" d="M13.7258 10.75C14.6614 10.75 15.597 10.75 16.5326 10.75C16.5718 11.8783 17.0678 12.7378 18.0205 13.3285C19.1166 13.9015 20.1818 13.8508 21.2162 13.1763C22.0192 12.5708 22.4363 11.762 22.4674 10.75C23.403 10.75 24.3386 10.75 25.2742 10.75C25.2418 12.4975 24.5795 13.9516 23.2874 15.1123C23.2762 15.1236 23.2762 15.1349 23.2874 15.1461C23.4903 15.3265 23.682 15.5181 23.8623 15.721C25.0293 14.4194 26.4919 13.7543 28.25 13.7258C28.25 14.6614 28.25 15.597 28.25 16.5326C27.215 16.5583 26.3949 16.9866 25.7899 17.8176C25.2517 18.6453 25.1333 19.5301 25.4348 20.4722C25.948 21.7316 26.8864 22.3967 28.25 22.4674C28.25 23.403 28.25 24.3386 28.25 25.2742C26.4961 25.2406 25.0363 24.5755 23.8708 23.279C23.6793 23.4845 23.4793 23.6818 23.2705 23.8708C23.2593 23.882 23.2593 23.8933 23.2705 23.9046C24.5686 25.0695 25.2364 26.5293 25.2742 28.2838C24.3386 28.2838 23.403 28.2838 22.4674 28.2838C22.408 27.0503 21.8331 26.1514 20.7428 25.587C19.6978 25.1484 18.7059 25.2442 17.7669 25.8744C16.9735 26.4776 16.5621 27.2807 16.5326 28.2838C15.597 28.2838 14.6614 28.2838 13.7258 28.2838C13.7577 26.5268 14.4255 25.067 15.7295 23.9046C15.7407 23.8933 15.7407 23.882 15.7295 23.8708C15.5207 23.6818 15.3207 23.4845 15.1292 23.279C13.9613 24.57 12.5016 25.2351 10.75 25.2742C10.75 24.3386 10.75 23.403 10.75 22.4674C11.9627 22.4124 12.856 21.8544 13.43 20.7935C13.9025 19.7273 13.8123 18.7128 13.1594 17.75C12.5542 16.9612 11.751 16.5555 10.75 16.5326C10.75 15.597 10.75 14.6614 10.75 13.7258C12.5067 13.7576 13.9693 14.4227 15.1377 15.721C15.2222 15.6252 15.3068 15.5294 15.3913 15.4336C15.5042 15.3348 15.6141 15.2333 15.721 15.1292C14.4204 13.9649 13.7554 12.5051 13.7258 10.75ZM19.2717 16.5326C20.3739 16.4946 21.2559 16.9117 21.9179 17.7838C22.6033 18.8416 22.6427 19.9238 22.0362 21.0302C21.4416 21.9421 20.5962 22.4211 19.5 22.4674C18.4038 22.4211 17.5584 21.9421 16.9638 21.0302C16.3957 20.0193 16.3901 19.0048 16.9469 17.9867C17.4892 17.1319 18.2641 16.6472 19.2717 16.5326Z" fill="#FEFFFE"/>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1,3 @@
<svg width="13" height="23" viewBox="0 0 13 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3.95088 0L0.141105 11.2883H4.3742L0 23L11.5706 9.17177H7.47851L12.8404 0H3.95088Z" fill="#F7CF52"/>
</svg>

After

Width:  |  Height:  |  Size: 213 B

View File

@ -0,0 +1,4 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.9333 20H9.06667C8.43583 20 7.90333 19.5275 7.82833 18.9L7.62917 17.3367C7.23167 17.2075 6.84833 17.0483 6.48417 16.8625L5.23917 17.83C4.73417 18.2208 4.02333 18.1758 3.585 17.725L2.2725 16.4125C1.825 15.9783 1.78 15.2675 2.17083 14.7633L3.13833 13.5175C2.95167 13.1533 2.7925 12.77 2.66417 12.3725L1.0975 12.1733C0.4725 12.0967 0 11.5642 0 10.9333V9.06667C0 8.43583 0.4725 7.90333 1.1 7.82833L2.66333 7.62917C2.7925 7.23167 2.95167 6.84833 3.1375 6.48417L2.17083 5.23917C1.77917 4.73417 1.825 4.0225 2.27667 3.58417L3.58917 2.27167C4.02333 1.82417 4.735 1.78 5.23833 2.17L6.48333 3.13833C6.8475 2.9525 7.23083 2.79333 7.62917 2.66417L7.82833 1.0975C7.90333 0.4725 8.43583 0 9.06667 0H10.9333C11.5642 0 12.0967 0.4725 12.1717 1.1L12.3708 2.66333C12.7692 2.7925 13.1525 2.95167 13.5167 3.1375L14.7617 2.17C15.2675 1.77917 15.9775 1.82417 16.4158 2.27583L17.7283 3.58833C18.1758 4.0225 18.2208 4.73333 17.83 5.2375L16.8625 6.48333C17.0492 6.8475 17.2083 7.23083 17.3367 7.62833L18.9033 7.8275C19.5275 7.90333 20 8.43583 20 9.06667V10.9333C20 11.5642 19.5275 12.0967 18.9 12.1717L17.3367 12.3708C17.2075 12.7683 17.0483 13.1517 16.8625 13.5158L17.83 14.7608C18.2217 15.2658 18.1758 15.9767 17.7242 16.415L16.4117 17.7275C15.9775 18.175 15.2658 18.2208 14.7625 17.8292L13.5167 16.8617C13.1525 17.0483 12.7692 17.2075 12.3717 17.3358L12.1725 18.9025C12.0967 19.5275 11.5642 20 10.9333 20ZM6.44167 15.95C6.51083 15.95 6.58167 15.9675 6.645 16.0025C7.10417 16.2592 7.60167 16.4658 8.12333 16.6158C8.28333 16.6617 8.40083 16.7983 8.42167 16.9633L8.655 18.7967C8.68 19.0058 8.86083 19.1667 9.06667 19.1667H10.9333C11.1392 19.1667 11.32 19.0058 11.3442 18.8008L11.5783 16.9642C11.5992 16.7992 11.7167 16.6625 11.8767 16.6167C12.3983 16.4667 12.8958 16.26 13.355 16.0033C13.5008 15.9217 13.6825 15.9358 13.8133 16.0383L15.2717 17.1717C15.4392 17.3017 15.6742 17.2908 15.8175 17.1433L17.1383 15.8225C17.2892 15.6758 17.3008 15.4408 17.1708 15.2725L16.0375 13.8142C15.935 13.6825 15.9208 13.5017 16.0025 13.3558C16.2592 12.8967 16.4658 12.3992 16.6158 11.8775C16.6617 11.7175 16.7983 11.6 16.9633 11.5792L18.7967 11.3458C19.0058 11.32 19.1667 11.1392 19.1667 10.9333V9.06667C19.1667 8.86083 19.0058 8.68 18.8008 8.65583L16.9642 8.42167C16.7992 8.40083 16.6625 8.28333 16.6167 8.12333C16.4667 7.60167 16.26 7.10417 16.0033 6.645C15.9217 6.49917 15.935 6.31833 16.0383 6.18667L17.1717 4.72833C17.3025 4.56 17.2908 4.325 17.1442 4.18333L15.8233 2.8625C15.6775 2.71083 15.4417 2.69917 15.2733 2.83L13.815 3.96333C13.6825 4.06583 13.5017 4.08 13.3558 3.99833C12.8983 3.74167 12.4008 3.53583 11.8775 3.385C11.7175 3.33917 11.6 3.2025 11.5792 3.0375L11.3458 1.20417C11.32 0.994167 11.1392 0.833333 10.9333 0.833333H9.06667C8.86083 0.833333 8.68 0.994167 8.65583 1.19917L8.42167 3.03583C8.40083 3.20083 8.28333 3.3375 8.12333 3.38417C7.6 3.53417 7.1025 3.74083 6.645 3.99667C6.49917 4.07917 6.31833 4.06417 6.18583 3.9625L4.7275 2.82917C4.55917 2.69833 4.325 2.71 4.1825 2.85667L2.86167 4.17833C2.71083 4.325 2.69917 4.56 2.82917 4.72833L3.9625 6.18667C4.065 6.31833 4.07917 6.49917 3.9975 6.645C3.74 7.10417 3.53417 7.60167 3.38417 8.12333C3.33833 8.28333 3.20167 8.40083 3.03667 8.42167L1.20333 8.655C0.994167 8.68 0.833333 8.86083 0.833333 9.06667V10.9333C0.833333 11.1392 0.994167 11.32 1.19917 11.3442L3.03583 11.5783C3.20083 11.5992 3.3375 11.7167 3.38333 11.8767C3.53333 12.3983 3.74 12.8958 3.99667 13.355C4.07833 13.5008 4.065 13.6817 3.96167 13.8133L2.82833 15.2717C2.6975 15.44 2.70917 15.675 2.85583 15.8167L4.17667 17.1375C4.3225 17.2883 4.55667 17.3 4.72667 17.17L6.185 16.0367C6.26083 15.98 6.35083 15.95 6.44167 15.95Z" fill="black"/>
<path d="M10.0002 14.1666C7.70266 14.1666 5.8335 12.2974 5.8335 9.99992C5.8335 7.70242 7.70266 5.83325 10.0002 5.83325C12.2977 5.83325 14.1668 7.70242 14.1668 9.99992C14.1668 12.2974 12.2977 14.1666 10.0002 14.1666ZM10.0002 6.66659C8.16183 6.66659 6.66683 8.16159 6.66683 9.99992C6.66683 11.8383 8.16183 13.3333 10.0002 13.3333C11.8385 13.3333 13.3335 11.8383 13.3335 9.99992C13.3335 8.16159 11.8385 6.66659 10.0002 6.66659Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M20 10C20 10 20 10.0017 20 10.0025C19.9983 10.5633 19.7783 11.0892 19.3783 11.4825L15.9267 14.88C15.8458 14.96 15.74 15 15.6342 15C15.5267 15 15.4192 14.9583 15.3375 14.8758C15.1767 14.7125 15.1783 14.4483 15.3425 14.2867L18.7942 10.8892C18.9308 10.7542 19.0283 10.5925 19.0908 10.4175H5.41667C5.18667 10.4175 5 10.2308 5 10.0008C5 9.77083 5.18667 9.58417 5.41667 9.58417H19.0917C19.0292 9.40667 18.9317 9.24333 18.7933 9.1075L15.3425 5.71417C15.1783 5.55333 15.1758 5.28917 15.3375 5.125C15.4983 4.96 15.7625 4.95833 15.9267 5.12L19.3775 8.51333C19.7783 8.90833 20 9.435 20 9.99833C20 9.99833 20 9.99917 20 10ZM9.58333 12.5C9.35333 12.5 9.16667 12.6867 9.16667 12.9167V16.25C9.16667 17.8583 7.85833 19.1667 6.25 19.1667H3.75C2.14167 19.1667 0.833333 17.8583 0.833333 16.25V3.75C0.833333 2.14167 2.14167 0.833333 3.75 0.833333H6.25C7.85833 0.833333 9.16667 2.14167 9.16667 3.75V7.08333C9.16667 7.31333 9.35333 7.5 9.58333 7.5C9.81333 7.5 10 7.31333 10 7.08333V3.75C10 1.6825 8.3175 0 6.25 0H3.75C1.6825 0 0 1.6825 0 3.75V16.25C0 18.3175 1.6825 20 3.75 20H6.25C8.3175 20 10 18.3175 10 16.25V12.9167C10 12.6867 9.81333 12.5 9.58333 12.5Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

23
assets/icons/sos.svg Normal file
View File

@ -0,0 +1,23 @@
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17.9985 35.3366C13.3686 35.3366 9.01577 33.5305 5.74189 30.2509C2.46802 26.9714 0.665039 22.611 0.665039 17.973C0.665039 13.3351 2.46802 8.97466 5.74197 5.69509C9.01577 2.41552 13.3686 0.609375 17.9985 0.609375C22.6284 0.609375 26.9813 2.41552 30.2552 5.69509C33.5291 8.97459 35.3321 13.3351 35.3321 17.973C35.3321 22.611 33.5291 26.9714 30.2552 30.251C26.9814 33.5305 22.6285 35.3366 17.9985 35.3366Z" fill="#CBC4CC"/>
<path d="M17.9971 32.1589C25.8176 32.1589 32.1574 25.8081 32.1574 17.974C32.1574 10.1399 25.8176 3.78906 17.9971 3.78906C10.1767 3.78906 3.83691 10.1399 3.83691 17.974C3.83691 25.8081 10.1767 32.1589 17.9971 32.1589Z" fill="#F3F0F3"/>
<path d="M17.9987 29.9667C24.6119 29.9667 29.9729 24.5963 29.9729 17.9716C29.9729 11.3469 24.6119 5.97656 17.9987 5.97656C11.3855 5.97656 6.02441 11.3469 6.02441 17.9716C6.02441 24.5963 11.3855 29.9667 17.9987 29.9667Z" fill="#FD4755"/>
<path d="M17.998 5.97656C17.5223 5.97656 17.0532 6.00539 16.5918 6.05967C22.5342 6.75926 27.1598 11.8341 27.1598 17.9716C27.1598 24.1091 22.5342 29.184 16.5918 29.8835C17.0532 29.9379 17.5223 29.9666 17.998 29.9666C24.6007 29.9666 29.9723 24.5857 29.9723 17.9716C29.9723 11.3574 24.6007 5.97656 17.998 5.97656Z" fill="#FB2B3A"/>
<path d="M11.9123 11.6183C11.7669 11.6183 11.6221 11.5585 11.5179 11.4412C11.3245 11.2235 11.3441 10.8903 11.5618 10.6968C13.3402 9.1164 15.6268 8.24609 18.0005 8.24609C18.2918 8.24609 18.5278 8.4822 18.5278 8.77342C18.5278 9.06465 18.2918 9.30075 18.0005 9.30075C15.8853 9.30075 13.8475 10.0766 12.2624 11.4852C12.162 11.5744 12.0369 11.6183 11.9123 11.6183Z" fill="#FD8087"/>
<path d="M18 27.6995C17.7087 27.6995 17.4727 27.4634 17.4727 27.1722C17.4727 26.881 17.7087 26.6449 18 26.6449C20.0643 26.6449 22.0648 25.9017 23.6329 24.5524C23.8537 24.3625 24.1866 24.3874 24.3765 24.6082C24.5665 24.8289 24.5416 25.1619 24.3208 25.3518C22.5614 26.8658 20.3167 27.6995 18 27.6995Z" fill="#FD8087"/>
<path d="M12.6912 17.52C12.5691 17.4748 12.4351 17.4321 12.2934 17.3867C11.8625 17.2491 11.2115 17.041 11.0522 16.7438C10.9746 16.5988 10.9675 16.4474 11.0312 16.2938C11.1145 16.0925 11.3047 15.9258 11.5275 15.8585C12.368 15.605 13.1315 16.2164 13.1479 16.2296C13.3707 16.4153 13.7018 16.3863 13.8889 16.1642C14.0765 15.9414 14.0479 15.6087 13.8252 15.4211C13.7768 15.3804 12.6225 14.4266 11.2228 14.8488C10.6971 15.0074 10.2613 15.3967 10.0569 15.89C9.87159 16.3369 9.89493 16.8171 10.1227 17.242C10.4838 17.9157 11.3442 18.1906 11.9724 18.3913C12.1027 18.433 12.2257 18.4723 12.3257 18.5093C12.8999 18.7215 13.1921 19.0502 13.1275 19.4114C13.0627 19.7734 12.6382 20.148 12.0399 20.148C11.4628 20.148 10.9059 19.9133 10.5502 19.5201C10.3549 19.3041 10.0214 19.2875 9.80543 19.4828C9.58943 19.6782 9.5727 20.0116 9.76816 20.2276C10.3204 20.8382 11.1697 21.2027 12.0399 21.2027C13.088 21.2027 14.0019 20.5124 14.1656 19.5971C14.2899 18.9022 13.9679 17.9917 12.6912 17.52Z" fill="white"/>
<path d="M24.8679 17.52C24.7458 17.4749 24.6119 17.4321 24.4701 17.3868C24.0393 17.2491 23.3882 17.0411 23.2289 16.7438C23.1512 16.5989 23.1441 16.4475 23.2078 16.2938C23.2912 16.0926 23.4814 15.9258 23.7042 15.8586C24.5432 15.6052 25.3058 16.2145 25.3245 16.2296C25.5472 16.4154 25.8785 16.3864 26.0655 16.1642C26.2531 15.9415 26.2246 15.6088 26.0019 15.4212C25.9535 15.3804 24.7992 14.4266 23.3995 14.8488C22.8739 15.0075 22.438 15.3967 22.2335 15.89C22.0483 16.337 22.0716 16.8171 22.2994 17.242C22.6605 17.9157 23.5209 18.1906 24.1492 18.3914C24.2795 18.4331 24.4025 18.4724 24.5025 18.5094C25.0766 18.7216 25.3688 19.0503 25.3042 19.4114C25.2395 19.7735 24.8149 20.1481 24.2166 20.1481C23.6396 20.1481 23.0827 19.9134 22.727 19.5202C22.5317 19.3042 22.1982 19.2876 21.9822 19.4829C21.7662 19.6783 21.7495 20.0117 21.9449 20.2277C22.4971 20.8383 23.3464 21.2027 24.2166 21.2027C25.2648 21.2027 26.1787 20.5125 26.3424 19.5972C26.4666 18.9022 26.1446 17.9917 24.8679 17.52Z" fill="white"/>
<path d="M18.0001 14.7412C16.2214 14.7412 14.7744 16.1905 14.7744 17.9718C14.7744 19.7532 16.2214 21.2025 18.0001 21.2025C19.7787 21.2025 21.2257 19.7532 21.2257 17.9718C21.2257 16.1905 19.7787 14.7412 18.0001 14.7412ZM18.0001 20.1478C16.803 20.1478 15.8291 19.1717 15.8291 17.9718C15.8291 16.772 16.803 15.7959 18.0001 15.7959C19.1971 15.7959 20.171 16.772 20.171 17.9718C20.171 19.1717 19.1972 20.1478 18.0001 20.1478Z" fill="white"/>
<path d="M3.46424 31.8394L1.62871 33.6782C1.42298 33.8844 1.42327 34.2182 1.62942 34.4239C1.73242 34.5267 1.86721 34.578 2.00199 34.578C2.13713 34.578 2.27227 34.5264 2.3752 34.4232L4.21073 32.5844C4.41646 32.3782 4.41618 32.0444 4.21003 31.8387C4.00374 31.6329 3.66983 31.6332 3.46424 31.8394Z" fill="#F3F0F3"/>
<path d="M2.02488 29.2304C1.85768 28.992 1.5287 28.9343 1.29041 29.1015L0.224575 29.8492C-0.0139194 30.0165 -0.0715742 30.3453 0.095695 30.5837C0.198278 30.73 0.361751 30.8082 0.527825 30.8082C0.632377 30.8082 0.738054 30.7772 0.830161 30.7126L1.896 29.9649C2.1345 29.7977 2.19215 29.4688 2.02488 29.2304Z" fill="#F3F0F3"/>
<path d="M6.81289 34.0297C6.57418 33.8629 6.24555 33.9212 6.07856 34.1598L5.37152 35.1714C5.20467 35.4101 5.26296 35.7389 5.50166 35.9057C5.5937 35.97 5.69902 36.0008 5.80329 36.0008C5.96965 36.0008 6.1334 35.9223 6.23599 35.7756L6.94303 34.764C7.10988 34.5253 7.05159 34.1965 6.81289 34.0297Z" fill="#F3F0F3"/>
<path d="M32.5324 31.8394C32.3266 31.6333 31.9927 31.6329 31.7866 31.8387C31.5805 32.0444 31.5802 32.3783 31.7859 32.5844L33.6215 34.4233C33.7245 34.5265 33.8595 34.5781 33.9947 34.5781C34.1295 34.5781 34.2643 34.5267 34.3673 34.424C34.5734 34.2182 34.5737 33.8843 34.368 33.6782L32.5324 31.8394Z" fill="#F3F0F3"/>
<path d="M35.77 29.8492L34.7042 29.1015C34.4656 28.9343 34.1369 28.992 33.9697 29.2304C33.8024 29.4688 33.8601 29.7977 34.0986 29.9649L35.1644 30.7126C35.2566 30.7772 35.3622 30.8082 35.4668 30.8082C35.6328 30.8082 35.7964 30.73 35.8989 30.5837C36.0661 30.3453 36.0084 30.0165 35.77 29.8492Z" fill="#F3F0F3"/>
<path d="M29.9157 34.1579C29.7488 33.9193 29.4202 33.8609 29.1813 34.0277C28.9426 34.1946 28.8844 34.5234 29.0512 34.7621L29.7582 35.7736C29.8608 35.9203 30.0245 35.9989 30.1909 35.9989C30.2952 35.9989 30.4005 35.968 30.4926 35.9038C30.7313 35.7369 30.7896 35.4082 30.6227 35.1695L29.9157 34.1579Z" fill="#F3F0F3"/>
<path d="M32.1591 4.31343C32.2943 4.31343 32.4294 4.26182 32.5324 4.1586L34.3679 2.31977C34.5736 2.11362 34.5733 1.77978 34.3672 1.57405C34.1609 1.36825 33.827 1.3686 33.6215 1.57476L31.7859 3.41359C31.5802 3.61974 31.5805 3.95358 31.7866 4.15931C31.8896 4.2621 32.0244 4.31343 32.1591 4.31343Z" fill="#F3F0F3"/>
<path d="M33.9697 6.76829C34.0723 6.91461 34.2358 6.9928 34.4018 6.9928C34.5064 6.9928 34.6121 6.96179 34.7042 6.89717L35.77 6.14949C36.0085 5.98222 36.0662 5.65338 35.8989 5.41495C35.7317 5.17653 35.4027 5.11888 35.1644 5.28607L34.0986 6.03376C33.8601 6.20103 33.8024 6.52987 33.9697 6.76829Z" fill="#F3F0F3"/>
<path d="M30.4926 0.0950873C30.2538 -0.0716194 29.9252 -0.0134724 29.7582 0.225232L29.0512 1.23672C28.8844 1.47543 28.9426 1.8042 29.1813 1.97105C29.2734 2.03531 29.3787 2.06618 29.483 2.06618C29.6493 2.06618 29.8131 1.98764 29.9157 1.8409L30.6227 0.829342C30.7895 0.590707 30.7312 0.261935 30.4926 0.0950873Z" fill="#F3F0F3"/>
<path d="M2.37513 1.57476C2.16933 1.3686 1.83543 1.36825 1.62942 1.57405C1.42327 1.77978 1.42298 2.11369 1.62871 2.31977L3.46424 4.1586C3.56725 4.26182 3.70232 4.31343 3.83745 4.31343C3.97224 4.31343 4.1071 4.2621 4.21003 4.15931C4.41618 3.95358 4.41646 3.61967 4.21073 3.41359L2.37513 1.57476Z" fill="#F3F0F3"/>
<path d="M0.224575 6.14949L1.29041 6.89717C1.38259 6.96179 1.48813 6.9928 1.59275 6.9928C1.75882 6.9928 1.92237 6.91454 2.02488 6.76829C2.19215 6.52987 2.1345 6.20103 1.896 6.03376L0.830161 5.28607C0.591737 5.11888 0.262894 5.17653 0.095695 5.41495C-0.0715742 5.65338 -0.0139194 5.98222 0.224575 6.14949Z" fill="#F3F0F3"/>
<path d="M6.23599 0.225178C6.06914 -0.0133866 5.74051 -0.0716742 5.50166 0.0951028C5.26296 0.26195 5.20467 0.590723 5.37152 0.829428L6.07856 1.84099C6.18114 1.98766 6.34483 2.06626 6.51125 2.06626C6.61552 2.06626 6.72085 2.0354 6.81289 1.97113C7.05159 1.80429 7.10988 1.47551 6.94303 1.23681L6.23599 0.225178Z" fill="#F3F0F3"/>
</svg>

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

@ -0,0 +1,23 @@
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17.9974 35.3421C13.3675 35.3421 9.0147 33.536 5.74086 30.2564C2.46702 26.977 0.664062 22.6166 0.664062 17.9787C0.664062 13.3408 2.46702 8.98043 5.74093 5.70089C9.0147 2.42136 13.3675 0.615234 17.9974 0.615234C22.6272 0.615234 26.98 2.42136 30.2539 5.70089C33.5278 8.98036 35.3307 13.3408 35.3307 17.9787C35.3307 22.6166 33.5278 26.977 30.2539 30.2565C26.9801 33.536 22.6273 35.3421 17.9974 35.3421Z" fill="#CBC4CC"/>
<path d="M17.998 32.1683C25.8184 32.1683 32.158 25.8176 32.158 17.9836C32.158 10.1496 25.8184 3.79883 17.998 3.79883C10.1776 3.79883 3.83789 10.1496 3.83789 17.9836C3.83789 25.8176 10.1776 32.1683 17.998 32.1683Z" fill="#F3F0F3"/>
<path d="M17.9995 29.9762C24.6127 29.9762 29.9737 24.6059 29.9737 17.9813C29.9737 11.3566 24.6127 5.98633 17.9995 5.98633C11.3864 5.98633 6.02539 11.3566 6.02539 17.9813C6.02539 24.6059 11.3864 29.9762 17.9995 29.9762Z" fill="#97D729"/>
<path d="M17.998 5.98633C17.5223 5.98633 17.0532 6.01516 16.5918 6.06943C22.5341 6.76902 27.1597 11.8438 27.1597 17.9812C27.1597 24.1186 22.5341 29.1935 16.5918 29.893C17.0532 29.9474 17.5223 29.9761 17.998 29.9761C24.6006 29.9761 29.9721 24.5953 29.9721 17.9812C29.9721 11.3671 24.6006 5.98633 17.998 5.98633Z" fill="#8BC727"/>
<path d="M11.9045 11.6241C11.7591 11.6241 11.6143 11.5643 11.5101 11.447C11.3167 11.2294 11.3363 10.8961 11.554 10.7026C13.3324 9.12225 15.6189 8.25195 17.9926 8.25195C18.2839 8.25195 18.5199 8.48805 18.5199 8.77928C18.5199 9.0705 18.2839 9.3066 17.9926 9.3066C15.8775 9.3066 13.8397 10.0824 12.2546 11.491C12.1541 11.5802 12.0291 11.6241 11.9045 11.6241Z" fill="#8BC727"/>
<path d="M17.9883 27.7083C17.697 27.7083 17.4609 27.4722 17.4609 27.1809C17.4609 26.8897 17.697 26.6536 17.9883 26.6536C20.0526 26.6536 22.053 25.9105 23.6211 24.5612C23.8419 24.3713 24.1748 24.3962 24.3647 24.617C24.5547 24.8377 24.5298 25.1706 24.309 25.3606C22.5496 26.8745 20.3049 27.7083 17.9883 27.7083Z" fill="#8BC727"/>
<path d="M12.6882 17.5248C12.5661 17.4797 12.4322 17.437 12.2904 17.3916C11.8596 17.2539 11.2086 17.0459 11.0492 16.7486C10.9716 16.6037 10.9645 16.4523 11.0282 16.2986C11.1116 16.0974 11.3018 15.9306 11.5245 15.8634C12.365 15.6099 13.1285 16.2213 13.145 16.2345C13.3677 16.4202 13.6989 16.3912 13.8859 16.1691C14.0735 15.9463 14.0449 15.6136 13.8222 15.426C13.7738 15.3852 12.6195 14.4315 11.2198 14.8537C10.6942 15.0123 10.2583 15.4015 10.0539 15.8948C9.86866 16.3418 9.892 16.822 10.1197 17.2468C10.4808 17.9205 11.3412 18.1955 11.9694 18.3962C12.0997 18.4378 12.2227 18.4771 12.3228 18.5141C12.8969 18.7263 13.1891 19.0551 13.1245 19.4162C13.0597 19.7783 12.6353 20.1528 12.0369 20.1528C11.4598 20.1528 10.903 19.9181 10.5473 19.5249C10.352 19.309 10.0185 19.2924 9.8025 19.4876C9.58651 19.683 9.56977 20.0164 9.76523 20.2324C10.3174 20.843 11.1668 21.2075 12.0369 21.2075C13.0851 21.2075 13.9989 20.5172 14.1626 19.6019C14.2869 18.9071 13.9649 17.9965 12.6882 17.5248Z" fill="white"/>
<path d="M24.866 17.5249C24.7438 17.4797 24.6099 17.437 24.4681 17.3916C24.0373 17.254 23.3862 17.0459 23.2269 16.7486C23.1493 16.6037 23.1422 16.4524 23.2059 16.2987C23.2893 16.0974 23.4795 15.9307 23.7023 15.8634C24.5412 15.6101 25.3038 16.2193 25.3225 16.2345C25.5452 16.4202 25.8765 16.3913 26.0635 16.1691C26.2511 15.9463 26.2226 15.6137 25.9999 15.426C25.9515 15.3853 24.7972 14.4314 23.3975 14.8537C22.8719 15.0123 22.4361 15.4016 22.2316 15.8949C22.0463 16.3418 22.0697 16.822 22.2974 17.2469C22.6585 17.9206 23.519 18.1955 24.1473 18.3963C24.2775 18.4379 24.4005 18.4772 24.5005 18.5142C25.0746 18.7264 25.3669 19.0552 25.3022 19.4163C25.2375 19.7784 24.8129 20.1529 24.2146 20.1529C23.6376 20.1529 23.0807 19.9182 22.725 19.525C22.5297 19.309 22.1962 19.2925 21.9802 19.4877C21.7642 19.6831 21.7475 20.0165 21.943 20.2325C22.4952 20.8431 23.3445 21.2076 24.2146 21.2076C25.2628 21.2076 26.1767 20.5173 26.3404 19.602C26.4646 18.9071 26.1426 17.9966 24.866 17.5249Z" fill="white"/>
<path d="M18.001 14.7461C16.2224 14.7461 14.7754 16.1953 14.7754 17.9767C14.7754 19.7581 16.2224 21.2073 18.001 21.2073C19.7796 21.2073 21.2266 19.7581 21.2266 17.9767C21.2266 16.1953 19.7796 14.7461 18.001 14.7461ZM18.001 20.1526C16.804 20.1526 15.83 19.1765 15.83 17.9767C15.83 16.7769 16.804 15.8007 18.001 15.8007C19.198 15.8007 20.172 16.7769 20.172 17.9767C20.172 19.1765 19.1981 20.1526 18.001 20.1526Z" fill="white"/>
<path d="M3.46422 31.8345L1.62871 33.6733C1.42298 33.8795 1.42327 34.2133 1.62941 34.419C1.73242 34.5217 1.8672 34.5731 2.00199 34.5731C2.13712 34.5731 2.27226 34.5215 2.37519 34.4183L4.2107 32.5795C4.41643 32.3733 4.41615 32.0395 4.21 31.8338C4.00371 31.6281 3.66981 31.6283 3.46422 31.8345Z" fill="#F3F0F3"/>
<path d="M2.02486 29.2284C1.85766 28.99 1.52868 28.9324 1.2904 29.0996L0.224572 29.8472C-0.0139193 30.0145 -0.0715734 30.3433 0.0956939 30.5818C0.198276 30.7281 0.361747 30.8063 0.527819 30.8063C0.63237 30.8063 0.738045 30.7752 0.830151 30.7106L1.89598 29.963C2.13447 29.7957 2.19213 29.4668 2.02486 29.2284Z" fill="#F3F0F3"/>
<path d="M6.80994 34.0306C6.57124 33.8639 6.24261 33.9222 6.07562 34.1608L5.36859 35.1723C5.20174 35.411 5.26003 35.7398 5.49873 35.9067C5.59076 35.9709 5.69609 36.0018 5.80036 36.0018C5.96671 36.0018 6.13046 35.9232 6.23305 35.7765L6.94008 34.765C7.10693 34.5263 7.04864 34.1975 6.80994 34.0306Z" fill="#F3F0F3"/>
<path d="M32.5314 31.8345C32.3256 31.6284 31.9917 31.628 31.7857 31.8338C31.5795 32.0395 31.5792 32.3734 31.785 32.5795L33.6205 34.4183C33.7235 34.5216 33.8585 34.5732 33.9937 34.5732C34.1285 34.5732 34.2633 34.5218 34.3662 34.419C34.5724 34.2133 34.5727 33.8794 34.367 33.6733L32.5314 31.8345Z" fill="#F3F0F3"/>
<path d="M35.7729 29.8472L34.7071 29.0996C34.4685 28.9324 34.1398 28.99 33.9726 29.2284C33.8054 29.4668 33.863 29.7957 34.1015 29.963L35.1674 30.7106C35.2595 30.7752 35.3651 30.8063 35.4697 30.8063C35.6358 30.8063 35.7993 30.728 35.9018 30.5818C36.069 30.3433 36.0114 30.0145 35.7729 29.8472Z" fill="#F3F0F3"/>
<path d="M29.9147 34.1608C29.7478 33.9222 29.4192 33.8638 29.1804 34.0307C28.9417 34.1975 28.8834 34.5263 29.0502 34.765L29.7573 35.7765C29.8598 35.9232 30.0235 36.0018 30.1899 36.0018C30.2942 36.0018 30.3995 35.9709 30.4916 35.9067C30.7303 35.7398 30.7886 35.4111 30.6217 35.1724L29.9147 34.1608Z" fill="#F3F0F3"/>
<path d="M32.1582 4.30949C32.2933 4.30949 32.4284 4.25788 32.5314 4.15467L34.3669 2.31585C34.5726 2.1097 34.5723 1.77587 34.3662 1.57014C34.1599 1.36435 33.826 1.3647 33.6205 1.57085L31.785 3.40966C31.5792 3.61581 31.5795 3.94964 31.7857 4.15537C31.8886 4.25816 32.0234 4.30949 32.1582 4.30949Z" fill="#F3F0F3"/>
<path d="M33.9726 6.76339C34.0752 6.90971 34.2387 6.98789 34.4048 6.98789C34.5093 6.98789 34.615 6.95689 34.7071 6.89227L35.7729 6.1446C36.0114 5.97733 36.0691 5.64849 35.9018 5.41007C35.7346 5.17165 35.4056 5.11399 35.1674 5.28119L34.1015 6.02887C33.863 6.19613 33.8054 6.52497 33.9726 6.76339Z" fill="#F3F0F3"/>
<path d="M30.4916 0.0950863C30.2528 -0.0716186 29.9242 -0.0134723 29.7573 0.22523L29.0502 1.23671C28.8834 1.47541 28.9417 1.80418 29.1804 1.97103C29.2724 2.03529 29.3777 2.06615 29.482 2.06615C29.6484 2.06615 29.8121 1.98762 29.9147 1.84088L30.6217 0.829333C30.7885 0.590701 30.7302 0.261932 30.4916 0.0950863Z" fill="#F3F0F3"/>
<path d="M2.37512 1.57085C2.16932 1.3647 1.83542 1.36435 1.62941 1.57014C1.42327 1.77587 1.42298 2.10977 1.62871 2.31585L3.46422 4.15467C3.56723 4.25788 3.70229 4.30949 3.83743 4.30949C3.97221 4.30949 4.10707 4.25816 4.21 4.15537C4.41615 3.94964 4.41643 3.61574 4.2107 3.40966L2.37512 1.57085Z" fill="#F3F0F3"/>
<path d="M0.224572 6.1446L1.2904 6.89227C1.38258 6.95689 1.48811 6.98789 1.59273 6.98789C1.75881 6.98789 1.92235 6.90964 2.02486 6.76339C2.19213 6.52497 2.13447 6.19613 1.89598 6.02887L0.830151 5.28119C0.59173 5.11399 0.262891 5.17165 0.0956939 5.41007C-0.0715734 5.64849 -0.0139193 5.97733 0.224572 6.1446Z" fill="#F3F0F3"/>
<path d="M6.23305 0.225175C6.0662 -0.0133865 5.73757 -0.0716734 5.49873 0.0951017C5.26003 0.261947 5.20174 0.590716 5.36859 0.829419L6.07562 1.84097C6.1782 1.98763 6.34189 2.06624 6.50831 2.06624C6.61258 2.06624 6.7179 2.03537 6.80994 1.97111C7.04864 1.80427 7.10693 1.4755 6.94008 1.23679L6.23305 0.225175Z" fill="#F3F0F3"/>
</svg>

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

@ -0,0 +1,16 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 24C8.8072 24 5.79717 22.7483 3.52439 20.4756C1.25166 18.2028 0 15.1928 0 12C0 8.8072 1.25166 5.79717 3.52444 3.52444C5.79717 1.25166 8.8072 0 12 0C15.1928 0 18.2028 1.25166 20.4756 3.52444C22.7483 5.79717 24 8.8072 24 12C24 15.1928 22.7483 18.2028 20.4756 20.4756C18.2028 22.7483 15.1928 24 12 24Z" fill="#EDF3F9"/>
<path d="M20.4756 20.4756C22.7483 18.2028 24 15.1928 24 12C24 8.8072 22.7483 5.79717 20.4756 3.52444C18.2028 1.25166 15.1928 0 12 0V24C15.1928 24 18.2028 22.7483 20.4756 20.4756Z" fill="#C2DBF2"/>
<path d="M12 22.5938C17.8508 22.5938 22.5938 17.8508 22.5938 12C22.5938 6.14923 17.8508 1.40625 12 1.40625C6.14923 1.40625 1.40625 6.14923 1.40625 12C1.40625 17.8508 6.14923 22.5938 12 22.5938Z" fill="#465A61"/>
<path d="M22.5938 12C22.5938 6.15858 17.8414 1.40625 12 1.40625V22.5938C17.8414 22.5938 22.5938 17.8414 22.5938 12Z" fill="#3B4A51"/>
<path d="M7.88953 9.29576C7.37672 10.072 7.07812 11.002 7.07812 12V12.7031H2.85938V12C2.85938 9.83717 3.61453 7.84779 4.87453 6.28076L7.88953 9.29576Z" fill="#F36A3D"/>
<path d="M21.1408 12V12.7031H16.922V12C16.922 11.002 16.6234 10.072 16.1106 9.29576L19.1256 6.28076C20.3856 7.84779 21.1408 9.83717 21.1408 12Z" fill="#66A6FF"/>
<path d="M19.1255 6.28078L16.1105 9.29578C15.2292 7.96078 13.7161 7.07812 12 7.07812V2.85938C14.8772 2.85938 17.4488 4.19578 19.1255 6.28078Z" fill="#FFDF40"/>
<path d="M12 2.85938V7.07812C10.2839 7.07812 8.77076 7.96078 7.88951 9.29578L4.87451 6.28078C6.55123 4.19578 9.12279 2.85938 12 2.85938Z" fill="#FF9F40"/>
<path d="M11.2969 8.48438H12.7031V14.8594H11.2969V8.48438Z" fill="#F36A3D"/>
<path d="M12 8.48438H12.7031V14.8594H12V8.48438Z" fill="#EC4C36"/>
<path d="M12 24C15.1066 24 17.625 21.4816 17.625 18.375C17.625 15.2684 15.1066 12.75 12 12.75C8.8934 12.75 6.375 15.2684 6.375 18.375C6.375 21.4816 8.8934 24 12 24Z" fill="#FFDF40"/>
<path d="M17.625 18.375C17.625 15.2734 15.1016 12.75 12 12.75V24C15.1016 24 17.625 21.4766 17.625 18.375Z" fill="#FFBE40"/>
<path d="M11.8818 21.5776L10.7118 20.7976L11.7983 19.1678L10.3921 17.7615L12.1182 15.1724L13.2882 15.9524L12.2017 17.5823L13.6079 18.9886L11.8818 21.5776Z" fill="#465A61"/>
<path d="M12.1182 15.1724L12 15.3496V21.4004L13.6079 18.9886L12.2017 17.5823L13.2882 15.9524L12.1182 15.1724Z" fill="#3B4A51"/>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,26 @@
<svg width="22" height="23" viewBox="0 0 22 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18.1346 0H3.09615C1.3862 0 0 1.3862 0 3.09615V19.9038C0 21.6138 1.3862 23 3.09615 23H18.1346C19.8446 23 21.2308 21.6138 21.2308 19.9038V3.09615C21.2308 1.3862 19.8446 0 18.1346 0Z" fill="#EF5350"/>
<path d="M20.6445 1.29056C17.6514 17.7494 4.15071 20.9781 0.482071 21.5556C0.760501 21.9974 1.14622 22.3615 1.6033 22.6141C2.06038 22.8666 2.57394 22.9994 3.09615 23H18.1346C18.9555 22.999 19.7424 22.6725 20.3228 22.0921C20.9033 21.5116 21.2298 20.7247 21.2308 19.9038V3.09615C21.2306 2.44752 21.0254 1.81554 20.6445 1.29056Z" fill="#E53935"/>
<path d="M18.1346 1.76923H3.09615C2.36331 1.76923 1.76923 2.36331 1.76923 3.09615V12.8269C1.76923 13.5598 2.36331 14.1538 3.09615 14.1538H18.1346C18.8675 14.1538 19.4615 13.5598 19.4615 12.8269V3.09615C19.4615 2.36331 18.8675 1.76923 18.1346 1.76923Z" fill="#BBDEFB"/>
<path d="M16.5513 12.3846C16.8258 11.4606 16.8808 10.4852 16.7119 9.53621C16.543 8.58718 16.1549 7.69068 15.5785 6.91809C15.0021 6.14549 14.2532 5.51814 13.3916 5.08598C12.53 4.65381 11.5793 4.42877 10.6154 4.42877C9.65145 4.42877 8.70082 4.65381 7.83918 5.08598C6.97755 5.51814 6.2287 6.14549 5.65227 6.91809C5.07583 7.69068 4.68773 8.58718 4.51885 9.53621C4.34997 10.4852 4.40498 11.4606 4.67951 12.3846L2.875 12.1635V2.875H18.3558V12.1635L16.5513 12.3846Z" fill="#90CAF9"/>
<path d="M10.6154 5.30769C10.5573 5.30772 10.4998 5.2963 10.4461 5.27408C10.3924 5.25187 10.3436 5.21929 10.3026 5.17821C10.2615 5.13713 10.2289 5.08836 10.2067 5.03468C10.1845 4.981 10.173 4.92347 10.1731 4.86538V3.09615C10.1731 2.97884 10.2197 2.86634 10.3026 2.78339C10.3856 2.70044 10.4981 2.65384 10.6154 2.65384C10.7327 2.65384 10.8452 2.70044 10.9281 2.78339C11.0111 2.86634 11.0577 2.97884 11.0577 3.09615V4.86538C11.0577 4.92347 11.0463 4.981 11.0241 5.03468C11.0019 5.08836 10.9693 5.13713 10.9282 5.17821C10.8871 5.21929 10.8384 5.25187 10.7847 5.27408C10.731 5.2963 10.6735 5.30772 10.6154 5.30769Z" fill="#37474F"/>
<path d="M6.54953 6.99182C6.49143 6.99189 6.4339 6.98047 6.38024 6.95823C6.32657 6.93599 6.27783 6.90336 6.23681 6.86223L4.99498 5.62039C4.91328 5.5372 4.86774 5.42511 4.86827 5.30851C4.8688 5.19191 4.91535 5.08024 4.9978 4.99779C5.08025 4.91534 5.19192 4.86879 5.30852 4.86826C5.42512 4.86773 5.53721 4.91327 5.62041 4.99497L6.86224 6.2368C6.92408 6.29866 6.96619 6.37746 6.98325 6.46325C7.0003 6.54904 6.99155 6.63796 6.95808 6.71877C6.92461 6.79958 6.86793 6.86865 6.79521 6.91725C6.72249 6.96585 6.63699 6.9918 6.54953 6.99182Z" fill="#37474F"/>
<path d="M14.6812 6.99184C14.5938 6.99182 14.5083 6.96587 14.4356 6.91727C14.3628 6.86867 14.3062 6.79959 14.2727 6.71878C14.2392 6.63797 14.2305 6.54906 14.2475 6.46327C14.2646 6.37748 14.3067 6.29868 14.3685 6.23682L15.6104 4.99499C15.6513 4.95331 15.7001 4.92015 15.7539 4.89743C15.8077 4.87471 15.8655 4.86288 15.9239 4.86261C15.9823 4.86235 16.0402 4.87366 16.0942 4.89589C16.1482 4.91812 16.1973 4.95084 16.2386 4.99214C16.2799 5.03345 16.3127 5.08253 16.3349 5.13655C16.3571 5.19057 16.3684 5.24846 16.3682 5.30687C16.3679 5.36529 16.3561 5.42307 16.3333 5.47689C16.3106 5.5307 16.2775 5.57948 16.2358 5.62041L14.994 6.86224C14.9529 6.90338 14.9042 6.93601 14.8505 6.95825C14.7969 6.98049 14.7393 6.99191 14.6812 6.99184Z" fill="#37474F"/>
<path d="M10.6154 11.0577C10.5573 11.0578 10.4998 11.0463 10.4461 11.0241C10.3924 11.0019 10.3437 10.9692 10.3027 10.9281L7.48771 8.11314C7.40477 8.0302 7.35818 7.91771 7.35818 7.80041C7.35818 7.68312 7.40477 7.57063 7.48771 7.48769C7.57065 7.40475 7.68314 7.35815 7.80044 7.35815C7.91773 7.35815 8.03022 7.40475 8.11316 7.48769L10.9281 10.3027C10.9899 10.3645 11.032 10.4433 11.0491 10.5291C11.0662 10.6149 11.0574 10.7038 11.0239 10.7846C10.9905 10.8654 10.9338 10.9345 10.8611 10.9831C10.7883 11.0317 10.7029 11.0577 10.6154 11.0577Z" fill="#37474F"/>
<path d="M3.98077 19.9039C5.20217 19.9039 6.19231 18.9137 6.19231 17.6923C6.19231 16.4709 5.20217 15.4808 3.98077 15.4808C2.75937 15.4808 1.76923 16.4709 1.76923 17.6923C1.76923 18.9137 2.75937 19.9039 3.98077 19.9039Z" fill="#CFD8DC"/>
<path d="M5.70351 16.3228C5.784 16.7463 5.75973 17.1831 5.63281 17.5952C5.5059 18.0072 5.28018 18.382 4.97531 18.6868C4.67045 18.9917 4.29568 19.2174 3.88364 19.3443C3.4716 19.4713 3.03478 19.4955 2.61122 19.415C2.99872 19.7293 3.4819 19.9017 3.98077 19.9038C4.56709 19.9032 5.12921 19.6699 5.5438 19.2553C5.9584 18.8407 6.19162 18.2786 6.19231 17.6923C6.19017 17.1934 6.01772 16.7103 5.70351 16.3228Z" fill="#B0BEC5"/>
<path d="M17.25 19.9039C18.4714 19.9039 19.4615 18.9137 19.4615 17.6923C19.4615 16.4709 18.4714 15.4808 17.25 15.4808C16.0286 15.4808 15.0385 16.4709 15.0385 17.6923C15.0385 18.9137 16.0286 19.9039 17.25 19.9039Z" fill="#CFD8DC"/>
<path d="M18.9727 16.3228C19.0532 16.7463 19.029 17.1831 18.902 17.5952C18.7751 18.0072 18.5494 18.382 18.2445 18.6868C17.9397 18.9917 17.5649 19.2174 17.1529 19.3443C16.7408 19.4713 16.304 19.4955 15.8805 19.415C16.2679 19.7293 16.7511 19.9017 17.25 19.9038C17.8363 19.9032 18.3984 19.6699 18.813 19.2553C19.2276 18.8407 19.4609 18.2786 19.4615 17.6923C19.4594 17.1934 19.2869 16.7103 18.9727 16.3228Z" fill="#B0BEC5"/>
<path d="M4.42308 17.6923C4.42273 17.8095 4.37602 17.9218 4.29314 18.0047C4.21027 18.0876 4.09797 18.1343 3.98077 18.1346H1.81346C1.7545 17.8427 1.7545 17.5419 1.81346 17.25H3.98077C4.09797 17.2504 4.21027 17.2971 4.29314 17.3799C4.37602 17.4628 4.42273 17.5751 4.42308 17.6923Z" fill="#546E7A"/>
<path d="M19.0988 16.4716L17.564 18.0064C17.4802 18.0886 17.3674 18.1346 17.25 18.1346C17.1326 18.1346 17.0198 18.0886 16.936 18.0064C16.8531 17.9228 16.8066 17.81 16.8066 17.6923C16.8066 17.5747 16.8531 17.4618 16.936 17.3783L18.4708 15.8435C18.718 16.0111 18.9312 16.2243 19.0988 16.4716Z" fill="#546E7A"/>
<path d="M15.4808 21.6731H5.75C5.63269 21.6731 5.52019 21.6265 5.43724 21.5435C5.35429 21.4606 5.30769 21.3481 5.30769 21.2308C5.30769 21.1135 5.35429 21.001 5.43724 20.918C5.52019 20.8351 5.63269 20.7885 5.75 20.7885H15.4808C15.5981 20.7885 15.7106 20.8351 15.7935 20.918C15.8765 21.001 15.9231 21.1135 15.9231 21.2308C15.9231 21.3481 15.8765 21.4606 15.7935 21.5435C15.7106 21.6265 15.5981 21.6731 15.4808 21.6731Z" fill="#37474F"/>
<path d="M14.1538 19.9038H7.07692C6.95962 19.9038 6.84711 19.8572 6.76417 19.7743C6.68122 19.6913 6.63462 19.5788 6.63462 19.4615C6.63462 19.3442 6.68122 19.2317 6.76417 19.1488C6.84711 19.0658 6.95962 19.0192 7.07692 19.0192H14.1538C14.2712 19.0192 14.3837 19.0658 14.4666 19.1488C14.5496 19.2317 14.5962 19.3442 14.5962 19.4615C14.5962 19.5788 14.5496 19.6913 14.4666 19.7743C14.3837 19.8572 14.2712 19.9038 14.1538 19.9038Z" fill="#37474F"/>
<path d="M14.1538 16.3654H7.07692C6.95962 16.3654 6.84711 16.3188 6.76417 16.2358C6.68122 16.1529 6.63462 16.0404 6.63462 15.9231C6.63462 15.8058 6.68122 15.6933 6.76417 15.6103C6.84711 15.5274 6.95962 15.4808 7.07692 15.4808H14.1538C14.2712 15.4808 14.3837 15.5274 14.4666 15.6103C14.5496 15.6933 14.5962 15.8058 14.5962 15.9231C14.5962 16.0404 14.5496 16.1529 14.4666 16.2358C14.3837 16.3188 14.2712 16.3654 14.1538 16.3654Z" fill="#37474F"/>
<path d="M18.1346 1.76923H3.09615C2.74435 1.76961 2.40706 1.90953 2.1583 2.1583C1.90954 2.40706 1.76961 2.74435 1.76923 3.09615V12.8269C1.76961 13.1787 1.90954 13.516 2.1583 13.7648C2.40706 14.0135 2.74435 14.1535 3.09615 14.1538H18.1346C18.4864 14.1535 18.8237 14.0135 19.0725 13.7648C19.3212 13.516 19.4612 13.1787 19.4615 12.8269V3.09615C19.4612 2.74435 19.3212 2.40706 19.0725 2.1583C18.8237 1.90953 18.4864 1.76961 18.1346 1.76923ZM17.25 11.0577H13.7115C13.6534 11.0577 13.5959 11.0463 13.5422 11.0241C13.4886 11.0019 13.4398 10.9693 13.3987 10.9282C13.3576 10.8871 13.325 10.8384 13.3028 10.7847C13.2806 10.731 13.2692 10.6735 13.2692 10.6154C13.2692 9.91154 12.9896 9.23652 12.4919 8.73883C11.9942 8.24113 11.3192 7.96153 10.6154 7.96153C9.91154 7.96153 9.23652 8.24113 8.73883 8.73883C8.24114 9.23652 7.96154 9.91154 7.96154 10.6154C7.96157 10.6735 7.95015 10.731 7.92794 10.7847C7.90572 10.8384 7.87314 10.8871 7.83206 10.9282C7.79098 10.9693 7.74221 11.0019 7.68853 11.0241C7.63486 11.0463 7.57732 11.0577 7.51923 11.0577H3.98077C3.92267 11.0577 3.86514 11.0463 3.81147 11.0241C3.75779 11.0019 3.70901 10.9693 3.66794 10.9282C3.62686 10.8871 3.59428 10.8384 3.57206 10.7847C3.54985 10.731 3.53843 10.6735 3.53846 10.6154C3.53846 8.73846 4.28406 6.93842 5.61124 5.61124C6.93842 4.28406 8.73847 3.53846 10.6154 3.53846C12.4923 3.53846 14.2923 4.28406 15.6195 5.61124C16.9467 6.93842 17.6923 8.73846 17.6923 10.6154C17.6923 10.6735 17.6809 10.731 17.6587 10.7847C17.6365 10.8384 17.6039 10.8871 17.5628 10.9282C17.5218 10.9693 17.473 11.0019 17.4193 11.0241C17.3656 11.0463 17.3081 11.0577 17.25 11.0577Z" fill="#FFEE58"/>
<path d="M18.1346 1.76923H18.1031C17.434 11.9799 5.19336 12.4807 1.76923 12.4194V12.8269C1.76961 13.1787 1.90954 13.516 2.1583 13.7648C2.40706 14.0135 2.74435 14.1535 3.09615 14.1538H18.1346C18.4864 14.1535 18.8237 14.0135 19.0725 13.7648C19.3212 13.516 19.4612 13.1787 19.4615 12.8269V3.09615C19.4612 2.74435 19.3212 2.40706 19.0725 2.1583C18.8237 1.90953 18.4864 1.76961 18.1346 1.76923Z" fill="#90CAF9"/>
<path d="M18.1346 1.76923H18.1031C18.0217 3.53365 17.4778 5.24565 16.5259 6.7335C17.2873 7.88491 17.693 9.23498 17.6923 10.6154C17.6923 10.6735 17.6809 10.731 17.6587 10.7847C17.6365 10.8384 17.6039 10.8871 17.5628 10.9282C17.5218 10.9693 17.473 11.0019 17.4193 11.0241C17.3656 11.0463 17.3081 11.0577 17.25 11.0577H13.7115C13.6534 11.0577 13.5959 11.0463 13.5422 11.0241C13.4886 11.0019 13.4398 10.9693 13.3987 10.9282C13.3576 10.8871 13.325 10.8384 13.3028 10.7847C13.2806 10.731 13.2692 10.6735 13.2692 10.6154C13.2687 10.3667 13.2331 10.1193 13.1635 9.88054C9.14978 12.2871 3.84298 12.4565 1.76923 12.4194V12.8269C1.76961 13.1787 1.90954 13.516 2.1583 13.7648C2.40706 14.0135 2.74435 14.1535 3.09615 14.1538H18.1346C18.4864 14.1535 18.8237 14.0135 19.0725 13.7648C19.3212 13.516 19.4612 13.1787 19.4615 12.8269V3.09615C19.4612 2.74435 19.3212 2.40706 19.0725 2.1583C18.8237 1.90953 18.4864 1.76961 18.1346 1.76923Z" fill="#FDD835"/>
<path d="M10.6154 12.3846C11.5925 12.3846 12.3846 11.5925 12.3846 10.6154C12.3846 9.63827 11.5925 8.84616 10.6154 8.84616C9.63826 8.84616 8.84615 9.63827 8.84615 10.6154C8.84615 11.5925 9.63826 12.3846 10.6154 12.3846Z" fill="#CFD8DC"/>
<path d="M11.9108 9.41928C11.9288 9.52222 11.9393 9.62632 11.9423 9.73076C11.9417 10.3171 11.7085 10.8793 11.2939 11.2939C10.8793 11.7085 10.3171 11.9417 9.73077 11.9423C9.62632 11.9393 9.52223 11.9288 9.41929 11.9108C9.75344 12.2224 10.1955 12.392 10.6523 12.3841C11.1091 12.3761 11.5449 12.191 11.868 11.868C12.191 11.5449 12.376 11.1091 12.384 10.6523C12.392 10.1955 12.2224 9.75343 11.9108 9.41928Z" fill="#B0BEC5"/>
<path d="M3.53846 4.86538C4.02702 4.86538 4.42308 4.37031 4.42308 3.75961C4.42308 3.14891 4.02702 2.65384 3.53846 2.65384C3.0499 2.65384 2.65385 3.14891 2.65385 3.75961C2.65385 4.37031 3.0499 4.86538 3.53846 4.86538Z" fill="white"/>
<path d="M3.09615 6.63462C3.34043 6.63462 3.53846 6.43659 3.53846 6.19231C3.53846 5.94803 3.34043 5.75 3.09615 5.75C2.85187 5.75 2.65385 5.94803 2.65385 6.19231C2.65385 6.43659 2.85187 6.63462 3.09615 6.63462Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,26 @@
<svg width="22" height="23" viewBox="0 0 22 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18.1346 0H3.09615C1.3862 0 0 1.3862 0 3.09615V19.9038C0 21.6138 1.3862 23 3.09615 23H18.1346C19.8446 23 21.2308 21.6138 21.2308 19.9038V3.09615C21.2308 1.3862 19.8446 0 18.1346 0Z" fill="#EF5350"/>
<path d="M20.6445 1.29056C17.6514 17.7494 4.1507 20.9781 0.482056 21.5556C0.760485 21.9974 1.1462 22.3615 1.60328 22.6141C2.06036 22.8666 2.57393 22.9994 3.09614 23H18.1346C18.9554 22.999 19.7424 22.6725 20.3228 22.0921C20.9032 21.5116 21.2298 20.7247 21.2308 19.9038V3.09615C21.2306 2.44752 21.0254 1.81554 20.6445 1.29056Z" fill="#E53935"/>
<path d="M18.1347 1.76923H3.09621C2.36337 1.76923 1.76929 2.36331 1.76929 3.09615V12.8269C1.76929 13.5598 2.36337 14.1538 3.09621 14.1538H18.1347C18.8675 14.1538 19.4616 13.5598 19.4616 12.8269V3.09615C19.4616 2.36331 18.8675 1.76923 18.1347 1.76923Z" fill="#BBDEFB"/>
<path d="M16.5513 12.3846C16.8258 11.4606 16.8808 10.4852 16.7119 9.53621C16.543 8.58718 16.1549 7.69068 15.5785 6.91809C15.0021 6.14549 14.2532 5.51814 13.3916 5.08598C12.53 4.65381 11.5793 4.42877 10.6154 4.42877C9.65145 4.42877 8.70082 4.65381 7.83918 5.08598C6.97755 5.51814 6.2287 6.14549 5.65227 6.91809C5.07583 7.69068 4.68773 8.58718 4.51885 9.53621C4.34997 10.4852 4.40498 11.4606 4.67951 12.3846L2.875 12.1635V2.875H18.3558V12.1635L16.5513 12.3846Z" fill="#90CAF9"/>
<path d="M10.6154 5.30769C10.5573 5.30772 10.4998 5.2963 10.4461 5.27408C10.3924 5.25187 10.3436 5.21929 10.3026 5.17821C10.2615 5.13713 10.2289 5.08836 10.2067 5.03468C10.1845 4.981 10.1731 4.92347 10.1731 4.86538V3.09615C10.1731 2.97884 10.2197 2.86634 10.3026 2.78339C10.3856 2.70044 10.4981 2.65384 10.6154 2.65384C10.7327 2.65384 10.8452 2.70044 10.9282 2.78339C11.0111 2.86634 11.0577 2.97884 11.0577 3.09615V4.86538C11.0577 4.92347 11.0463 4.981 11.0241 5.03468C11.0019 5.08836 10.9693 5.13713 10.9282 5.17821C10.8872 5.21929 10.8384 5.25187 10.7847 5.27408C10.731 5.2963 10.6735 5.30772 10.6154 5.30769Z" fill="#37474F"/>
<path d="M6.54954 6.99182C6.49145 6.99189 6.43392 6.98047 6.38026 6.95823C6.32659 6.93599 6.27785 6.90336 6.23683 6.86223L4.995 5.62039C4.9133 5.5372 4.86776 5.42511 4.86829 5.30851C4.86882 5.19191 4.91537 5.08024 4.99782 4.99779C5.08027 4.91534 5.19194 4.86879 5.30854 4.86826C5.42514 4.86773 5.53723 4.91327 5.62043 4.99497L6.86226 6.2368C6.9241 6.29866 6.96621 6.37746 6.98327 6.46325C7.00032 6.54904 6.99156 6.63796 6.9581 6.71877C6.92463 6.79958 6.86795 6.86865 6.79523 6.91725C6.72251 6.96585 6.63701 6.9918 6.54954 6.99182Z" fill="#37474F"/>
<path d="M14.6812 6.99184C14.5938 6.99182 14.5083 6.96587 14.4355 6.91727C14.3628 6.86867 14.3061 6.79959 14.2727 6.71878C14.2392 6.63797 14.2304 6.54906 14.2475 6.46327C14.2646 6.37748 14.3067 6.29868 14.3685 6.23682L15.6103 4.99499C15.6513 4.95331 15.7001 4.92015 15.7539 4.89743C15.8077 4.87471 15.8655 4.86288 15.9239 4.86261C15.9823 4.86235 16.0402 4.87366 16.0942 4.89589C16.1482 4.91812 16.1973 4.95084 16.2386 4.99214C16.2799 5.03345 16.3126 5.08253 16.3349 5.13655C16.3571 5.19057 16.3684 5.24846 16.3681 5.30687C16.3679 5.36529 16.356 5.42307 16.3333 5.47689C16.3106 5.5307 16.2774 5.57948 16.2358 5.62041L14.9939 6.86224C14.9529 6.90338 14.9042 6.93601 14.8505 6.95825C14.7969 6.98049 14.7393 6.99191 14.6812 6.99184Z" fill="#37474F"/>
<path d="M10.6154 11.0577C10.5573 11.0578 10.4997 11.0463 10.4461 11.0241C10.3924 11.0019 10.3437 10.9692 10.3026 10.9281L7.48769 8.11314C7.40475 8.0302 7.35815 7.91771 7.35815 7.80041C7.35815 7.68312 7.40475 7.57063 7.48769 7.48769C7.57063 7.40475 7.68312 7.35815 7.80041 7.35815C7.91771 7.35815 8.0302 7.40475 8.11314 7.48769L10.9281 10.3027C10.9899 10.3645 11.032 10.4433 11.0491 10.5291C11.0661 10.6149 11.0574 10.7038 11.0239 10.7846C10.9904 10.8654 10.9338 10.9345 10.861 10.9831C10.7883 11.0317 10.7028 11.0577 10.6154 11.0577Z" fill="#37474F"/>
<path d="M3.98083 19.9039C5.20222 19.9039 6.19236 18.9137 6.19236 17.6923C6.19236 16.4709 5.20222 15.4808 3.98083 15.4808C2.75943 15.4808 1.76929 16.4709 1.76929 17.6923C1.76929 18.9137 2.75943 19.9039 3.98083 19.9039Z" fill="#CFD8DC"/>
<path d="M5.7035 16.3228C5.78399 16.7463 5.75972 17.1831 5.6328 17.5952C5.50588 18.0072 5.28016 18.382 4.9753 18.6868C4.67043 18.9917 4.29567 19.2174 3.88363 19.3443C3.47159 19.4713 3.03477 19.4955 2.61121 19.415C2.9987 19.7293 3.48188 19.9017 3.98075 19.9038C4.56708 19.9032 5.12919 19.6699 5.54379 19.2553C5.95838 18.8407 6.1916 18.2786 6.19229 17.6923C6.19015 17.1934 6.0177 16.7103 5.7035 16.3228Z" fill="#B0BEC5"/>
<path d="M17.25 19.9039C18.4714 19.9039 19.4615 18.9137 19.4615 17.6923C19.4615 16.4709 18.4714 15.4808 17.25 15.4808C16.0286 15.4808 15.0385 16.4709 15.0385 17.6923C15.0385 18.9137 16.0286 19.9039 17.25 19.9039Z" fill="#CFD8DC"/>
<path d="M18.9728 16.3228C19.0533 16.7463 19.029 17.1831 18.9021 17.5952C18.7752 18.0072 18.5495 18.382 18.2446 18.6868C17.9397 18.9917 17.565 19.2174 17.1529 19.3443C16.7409 19.4713 16.3041 19.4955 15.8805 19.415C16.268 19.7293 16.7512 19.9017 17.25 19.9038C17.8364 19.9032 18.3985 19.6699 18.8131 19.2553C19.2277 18.8407 19.4609 18.2786 19.4616 17.6923C19.4594 17.1934 19.287 16.7103 18.9728 16.3228Z" fill="#B0BEC5"/>
<path d="M4.42312 17.6923C4.42277 17.8095 4.37606 17.9218 4.29319 18.0047C4.21032 18.0876 4.09802 18.1343 3.98082 18.1346H1.81351C1.75455 17.8427 1.75455 17.5419 1.81351 17.25H3.98082C4.09802 17.2504 4.21032 17.2971 4.29319 17.3799C4.37606 17.4628 4.42277 17.5751 4.42312 17.6923Z" fill="#546E7A"/>
<path d="M19.0989 16.4716L17.5641 18.0064C17.4802 18.0886 17.3675 18.1346 17.25 18.1346C17.1326 18.1346 17.0199 18.0886 16.936 18.0064C16.8531 17.9228 16.8066 17.81 16.8066 17.6923C16.8066 17.5747 16.8531 17.4618 16.936 17.3783L18.4708 15.8435C18.7181 16.0111 18.9312 16.2243 19.0989 16.4716Z" fill="#546E7A"/>
<path d="M15.4808 21.6731H5.75005C5.63274 21.6731 5.52024 21.6265 5.43729 21.5435C5.35434 21.4606 5.30774 21.3481 5.30774 21.2308C5.30774 21.1135 5.35434 21.0009 5.43729 20.918C5.52024 20.8351 5.63274 20.7885 5.75005 20.7885H15.4808C15.5981 20.7885 15.7106 20.8351 15.7936 20.918C15.8765 21.0009 15.9231 21.1135 15.9231 21.2308C15.9231 21.3481 15.8765 21.4606 15.7936 21.5435C15.7106 21.6265 15.5981 21.6731 15.4808 21.6731Z" fill="#37474F"/>
<path d="M14.1539 19.9038H7.07695C6.95964 19.9038 6.84714 19.8572 6.76419 19.7743C6.68124 19.6913 6.63464 19.5788 6.63464 19.4615C6.63464 19.3442 6.68124 19.2317 6.76419 19.1488C6.84714 19.0658 6.95964 19.0192 7.07695 19.0192H14.1539C14.2712 19.0192 14.3837 19.0658 14.4666 19.1488C14.5496 19.2317 14.5962 19.3442 14.5962 19.4615C14.5962 19.5788 14.5496 19.6913 14.4666 19.7743C14.3837 19.8572 14.2712 19.9038 14.1539 19.9038Z" fill="#37474F"/>
<path d="M14.1539 16.3654H7.07695C6.95964 16.3654 6.84714 16.3188 6.76419 16.2358C6.68124 16.1529 6.63464 16.0404 6.63464 15.9231C6.63464 15.8058 6.68124 15.6933 6.76419 15.6103C6.84714 15.5274 6.95964 15.4808 7.07695 15.4808H14.1539C14.2712 15.4808 14.3837 15.5274 14.4666 15.6103C14.5496 15.6933 14.5962 15.8058 14.5962 15.9231C14.5962 16.0404 14.5496 16.1529 14.4666 16.2358C14.3837 16.3188 14.2712 16.3654 14.1539 16.3654Z" fill="#37474F"/>
<path d="M18.1347 1.76923H3.09621C2.74441 1.76961 2.40712 1.90953 2.15836 2.1583C1.90959 2.40706 1.76967 2.74435 1.76929 3.09615V12.8269C1.76967 13.1787 1.90959 13.516 2.15836 13.7648C2.40712 14.0135 2.74441 14.1535 3.09621 14.1538H18.1347C18.4865 14.1535 18.8238 14.0135 19.0725 13.7648C19.3213 13.516 19.4612 13.1787 19.4616 12.8269V3.09615C19.4612 2.74435 19.3213 2.40706 19.0725 2.1583C18.8238 1.90953 18.4865 1.76961 18.1347 1.76923ZM17.2501 11.0577H13.7116C13.6535 11.0577 13.596 11.0463 13.5423 11.0241C13.4886 11.0019 13.4398 10.9693 13.3988 10.9282C13.3577 10.8871 13.3251 10.8384 13.3029 10.7847C13.2807 10.731 13.2693 10.6735 13.2693 10.6154C13.2693 9.91154 12.9897 9.23652 12.492 8.73883C11.9943 8.24113 11.3193 7.96153 10.6154 7.96153C9.9116 7.96153 9.23658 8.24113 8.73889 8.73883C8.2412 9.23652 7.9616 9.91154 7.9616 10.6154C7.96163 10.6735 7.95021 10.731 7.92799 10.7847C7.90578 10.8384 7.8732 10.8871 7.83212 10.9282C7.79104 10.9693 7.74227 11.0019 7.68859 11.0241C7.63491 11.0463 7.57738 11.0577 7.51929 11.0577H3.98083C3.92273 11.0577 3.8652 11.0463 3.81152 11.0241C3.75784 11.0019 3.70907 10.9693 3.66799 10.9282C3.62691 10.8871 3.59434 10.8384 3.57212 10.7847C3.5499 10.731 3.53848 10.6735 3.53852 10.6154C3.53852 8.73846 4.28412 6.93842 5.6113 5.61124C6.93848 4.28406 8.73852 3.53846 10.6154 3.53846C12.4924 3.53846 14.2924 4.28406 15.6196 5.61124C16.9468 6.93842 17.6924 8.73846 17.6924 10.6154C17.6924 10.6735 17.681 10.731 17.6588 10.7847C17.6365 10.8384 17.604 10.8871 17.5629 10.9282C17.5218 10.9693 17.473 11.0019 17.4194 11.0241C17.3657 11.0463 17.3082 11.0577 17.2501 11.0577Z" fill="#FFEE58"/>
<path d="M18.1347 1.76923H18.1031C17.4341 11.9799 5.19342 12.4807 1.76929 12.4194V12.8269C1.76967 13.1787 1.90959 13.516 2.15836 13.7648C2.40712 14.0135 2.74441 14.1535 3.09621 14.1538H18.1347C18.4865 14.1535 18.8238 14.0135 19.0725 13.7648C19.3213 13.516 19.4612 13.1787 19.4616 12.8269V3.09615C19.4612 2.74435 19.3213 2.40706 19.0725 2.1583C18.8238 1.90953 18.4865 1.76961 18.1347 1.76923Z" fill="#90CAF9"/>
<path d="M18.1347 1.76923H18.1031C18.0218 3.53365 17.4778 5.24565 16.5259 6.7335C17.2874 7.88491 17.693 9.23498 17.6924 10.6154C17.6924 10.6735 17.681 10.731 17.6588 10.7847C17.6365 10.8384 17.604 10.8871 17.5629 10.9282C17.5218 10.9693 17.473 11.0019 17.4194 11.0241C17.3657 11.0463 17.3082 11.0577 17.2501 11.0577H13.7116C13.6535 11.0577 13.596 11.0463 13.5423 11.0241C13.4886 11.0019 13.4398 10.9693 13.3988 10.9282C13.3577 10.8871 13.3251 10.8384 13.3029 10.7847C13.2807 10.731 13.2693 10.6735 13.2693 10.6154C13.2688 10.3667 13.2332 10.1193 13.1635 9.88054C9.14984 12.2871 3.84304 12.4565 1.76929 12.4194V12.8269C1.76967 13.1787 1.90959 13.516 2.15836 13.7648C2.40712 14.0135 2.74441 14.1535 3.09621 14.1538H18.1347C18.4865 14.1535 18.8238 14.0135 19.0725 13.7648C19.3213 13.516 19.4612 13.1787 19.4616 12.8269V3.09615C19.4612 2.74435 19.3213 2.40706 19.0725 2.1583C18.8238 1.90953 18.4865 1.76961 18.1347 1.76923Z" fill="#FDD835"/>
<path d="M10.6154 12.3846C11.5925 12.3846 12.3847 11.5925 12.3847 10.6154C12.3847 9.63827 11.5925 8.84616 10.6154 8.84616C9.6383 8.84616 8.84619 9.63827 8.84619 10.6154C8.84619 11.5925 9.6383 12.3846 10.6154 12.3846Z" fill="#CFD8DC"/>
<path d="M11.9109 9.41928C11.9288 9.52222 11.9393 9.62632 11.9423 9.73076C11.9418 10.3171 11.7086 10.8793 11.2939 11.2939C10.8793 11.7085 10.3172 11.9417 9.73079 11.9423C9.62635 11.9393 9.52225 11.9288 9.41931 11.9108C9.75346 12.2224 10.1955 12.392 10.6523 12.3841C11.1091 12.3761 11.545 12.191 11.868 11.868C12.1911 11.5449 12.3761 11.1091 12.3841 10.6523C12.3921 10.1955 12.2224 9.75343 11.9109 9.41928Z" fill="#B0BEC5"/>
<path d="M3.53842 4.86538C4.02698 4.86538 4.42304 4.37031 4.42304 3.75961C4.42304 3.14891 4.02698 2.65384 3.53842 2.65384C3.04986 2.65384 2.65381 3.14891 2.65381 3.75961C2.65381 4.37031 3.04986 4.86538 3.53842 4.86538Z" fill="white"/>
<path d="M3.09612 6.63462C3.3404 6.63462 3.53842 6.43659 3.53842 6.19231C3.53842 5.94803 3.3404 5.75 3.09612 5.75C2.85184 5.75 2.65381 5.94803 2.65381 6.19231C2.65381 6.43659 2.85184 6.63462 3.09612 6.63462Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,41 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.998 2.5882C11.8004 2.5882 11.6403 2.42817 11.6403 2.23069V0.357516C11.6403 0.160078 11.8004 0 11.998 0C12.1956 0 12.3558 0.160031 12.3558 0.357516V2.23073C12.3558 2.42817 12.1956 2.5882 11.998 2.5882Z" fill="#E6E2E6"/>
<path d="M5.22457 2.5882C5.02699 2.5882 4.86682 2.42817 4.86682 2.23069V0.357516C4.86682 0.160078 5.02699 0 5.22457 0C5.42215 0 5.58232 0.160031 5.58232 0.357516V2.23073C5.58232 2.42817 5.42215 2.5882 5.22457 2.5882Z" fill="#E6E2E6"/>
<path d="M18.7714 2.5882C18.5738 2.5882 18.4137 2.42817 18.4137 2.23069V0.357516C18.4137 0.160078 18.5739 0 18.7714 0C18.969 0 19.1292 0.160031 19.1292 0.357516V2.23073C19.1292 2.42817 18.969 2.5882 18.7714 2.5882Z" fill="#E6E2E6"/>
<path d="M17.6937 1.7467H19.8492C20.0782 1.7467 20.2814 1.8937 20.3528 2.1112L20.7326 3.26672C20.7832 3.42084 20.6683 3.57942 20.506 3.57942H17.0369C16.8746 3.57942 16.7596 3.42084 16.8103 3.26672L17.19 2.1112C17.2615 1.8937 17.4647 1.7467 17.6937 1.7467Z" fill="#545454"/>
<path d="M17.6935 3.57938H19.8492C20.0782 3.57938 20.2814 3.72638 20.3528 3.94383L20.7326 5.0993C20.7832 5.25342 20.6683 5.412 20.506 5.412H17.0369C16.8746 5.412 16.7596 5.25342 16.8103 5.0993L17.1901 3.94359C17.2615 3.72628 17.4646 3.57938 17.6935 3.57938Z" fill="#545454"/>
<path d="M17.6935 5.41205H19.8492C20.0782 5.41205 20.2814 5.55905 20.3528 5.77655L20.7326 6.93206C20.7832 7.08619 20.6683 7.24477 20.506 7.24477H17.0369C16.8746 7.24477 16.7596 7.08619 16.8103 6.93206L17.1901 5.77636C17.2615 5.55895 17.4646 5.41205 17.6935 5.41205Z" fill="#545454"/>
<path d="M13.0759 1.7467H10.9203C10.6912 1.7467 10.488 1.8937 10.4166 2.1112L10.0369 3.26672C9.9862 3.42084 10.1011 3.57942 10.2635 3.57942H13.7325C13.8949 3.57942 14.0098 3.42084 13.9591 3.26672L13.5793 2.11102C13.5079 1.89361 13.3049 1.7467 13.0759 1.7467Z" fill="#545454"/>
<path d="M13.0757 3.57938H10.9203C10.6912 3.57938 10.4881 3.72638 10.4166 3.94383L10.0369 5.0993C9.9862 5.25342 10.1011 5.412 10.2635 5.412H13.7325C13.8949 5.412 14.0098 5.25342 13.9591 5.0993L13.5794 3.94378C13.508 3.72638 13.3048 3.57938 13.0757 3.57938Z" fill="#545454"/>
<path d="M13.0759 5.41205H10.9203C10.6912 5.41205 10.4881 5.55905 10.4166 5.77655L10.0369 6.93206C9.9862 7.08619 10.1011 7.24477 10.2635 7.24477H13.7325C13.8949 7.24477 14.0098 7.08619 13.9591 6.93206L13.5793 5.77636C13.5079 5.55895 13.3049 5.41205 13.0759 5.41205Z" fill="#545454"/>
<path d="M6.30253 1.7467H4.14689C3.91781 1.7467 3.71465 1.8937 3.64321 2.1112L3.26343 3.26667C3.21276 3.4208 3.3277 3.57938 3.49003 3.57938H6.9591C7.12143 3.57938 7.23637 3.4208 7.1857 3.26667L6.80592 2.11097C6.73448 1.89361 6.53146 1.7467 6.30253 1.7467Z" fill="#545454"/>
<path d="M3.44264 2.72137L3.26343 3.26667C3.21276 3.4208 3.3277 3.57937 3.49003 3.57937H6.9591C7.12143 3.57937 7.23637 3.4208 7.1857 3.26667L7.0065 2.72137H3.44264Z" fill="#494949"/>
<path d="M6.30248 3.57938H4.14684C3.91776 3.57938 3.71461 3.72638 3.64317 3.94383L3.26343 5.0993C3.21276 5.25342 3.3277 5.412 3.49003 5.412H6.95911C7.12143 5.412 7.23637 5.25342 7.1857 5.0993L6.80592 3.94359C6.73443 3.72628 6.53142 3.57938 6.30248 3.57938Z" fill="#545454"/>
<path d="M3.44264 4.55405L3.26343 5.09934C3.21276 5.25347 3.3277 5.41205 3.49003 5.41205H6.9591C7.12143 5.41205 7.23637 5.25347 7.1857 5.09934L7.0065 4.55405H3.44264Z" fill="#494949"/>
<path d="M6.30225 5.41205H4.14684C3.91776 5.41205 3.71461 5.55905 3.64317 5.77655L3.26343 6.93206C3.21276 7.08619 3.3277 7.24477 3.49003 7.24477H6.95911C7.12143 7.24477 7.23637 7.08619 7.1857 6.93206L6.80596 5.77655C6.73448 5.55905 6.53132 5.41205 6.30225 5.41205Z" fill="#545454"/>
<path d="M3.44264 6.38666L3.26343 6.93196C3.21276 7.08608 3.3277 7.24466 3.49003 7.24466H6.9591C7.12143 7.24466 7.23637 7.08608 7.1857 6.93196L7.0065 6.38666H3.44264Z" fill="#494949"/>
<path d="M10.2161 2.72137L10.0369 3.26667C9.9862 3.4208 10.1011 3.57937 10.2635 3.57937H13.7325C13.8949 3.57937 14.0098 3.4208 13.9591 3.26667L13.7799 2.72137H10.2161Z" fill="#494949"/>
<path d="M10.2161 4.55405L10.0369 5.09934C9.9862 5.25347 10.1011 5.41205 10.2635 5.41205H13.7325C13.8949 5.41205 14.0098 5.25347 13.9591 5.09934L13.7799 4.55405H10.2161Z" fill="#494949"/>
<path d="M10.2161 6.38666L10.0369 6.93196C9.9862 7.08608 10.1011 7.24466 10.2635 7.24466H13.7325C13.8949 7.24466 14.0098 7.08608 13.9591 6.93196L13.7799 6.38666H10.2161Z" fill="#494949"/>
<path d="M16.9895 2.72137L16.8103 3.26667C16.7596 3.4208 16.8746 3.57937 17.0369 3.57937H20.506C20.6683 3.57937 20.7832 3.4208 20.7326 3.26667L20.5534 2.72137H16.9895Z" fill="#494949"/>
<path d="M16.9895 4.55405L16.8103 5.09934C16.7596 5.25347 16.8746 5.41205 17.0369 5.41205H20.506C20.6683 5.41205 20.7832 5.25347 20.7326 5.09934L20.5534 4.55405H16.9895Z" fill="#494949"/>
<path d="M16.9895 6.38666L16.8103 6.93196C16.7596 7.08608 16.8746 7.24466 17.0369 7.24466H20.506C20.6683 7.24466 20.7832 7.08608 20.7326 6.93196L20.5534 6.38666H16.9895Z" fill="#494949"/>
<path d="M11.0522 7.24466H12.9437V8.88885H11.0522V7.24466Z" fill="#545454"/>
<path d="M4.27881 7.24466H6.17031V8.88885H4.27881V7.24466Z" fill="#545454"/>
<path d="M19.7172 8.88892H17.8257V7.24473H19.7172V8.88892Z" fill="#545454"/>
<path d="M1.21143 10.9806H22.7886V21.9083H1.21143V10.9806Z" fill="#545454"/>
<path d="M1.21143 10.9806H22.7886V11.8386H1.21143V10.9806Z" fill="#494949"/>
<path d="M11.998 12.3605C11.8004 12.3605 11.6403 12.2004 11.6403 12.003V10.7935C11.6403 10.596 11.8004 10.436 11.998 10.436C12.1956 10.436 12.3558 10.596 12.3558 10.7935V12.003C12.3558 12.2004 12.1956 12.3605 11.998 12.3605Z" fill="#E6E2E6"/>
<path d="M5.22457 12.3605C5.02699 12.3605 4.86682 12.2004 4.86682 12.003V10.7935C4.86682 10.596 5.02699 10.436 5.22457 10.436C5.42215 10.436 5.58232 10.596 5.58232 10.7935V12.003C5.58232 12.2004 5.42215 12.3605 5.22457 12.3605Z" fill="#E6E2E6"/>
<path d="M18.7714 12.3605C18.5738 12.3605 18.4137 12.2004 18.4137 12.003V10.7935C18.4137 10.596 18.5739 10.436 18.7714 10.436C18.969 10.436 19.1292 10.596 19.1292 10.7935V12.003C19.1292 12.2004 18.969 12.3605 18.7714 12.3605Z" fill="#E6E2E6"/>
<path d="M23.5233 10.9806H0.476672C0.213422 10.9806 0 10.7672 0 10.5039V9.36559C0 9.10234 0.213422 8.88892 0.476672 8.88892H23.5233C23.7865 8.88892 24 9.10234 24 9.36559V10.5039C24 10.7672 23.7866 10.9806 23.5233 10.9806Z" fill="#A8A7A8"/>
<path d="M23.5231 10.1226H0.476859C0.213516 10.1226 0 9.90929 0 9.64609V10.5041C0 10.7673 0.213516 10.9806 0.476859 10.9806H23.5231C23.7865 10.9806 24 10.7673 24 10.5041V9.64609C24 9.90929 23.7865 10.1226 23.5231 10.1226Z" fill="#818181"/>
<path d="M23.5233 24H0.476672C0.213422 24 0 23.7866 0 23.5234V22.385C0 22.1217 0.213422 21.9083 0.476672 21.9083H23.5233C23.7865 21.9083 24 22.1217 24 22.385V23.5234C24 23.7866 23.7866 24 23.5233 24Z" fill="#A8A7A8"/>
<path d="M23.5231 23.142H0.476859C0.213516 23.142 0 22.9287 0 22.6655V23.5235C0 23.7867 0.213516 24 0.476859 24H23.5231C23.7865 24 24 23.7867 24 23.5235V22.6655C24 22.9287 23.7865 23.142 23.5231 23.142Z" fill="#818181"/>
<path d="M15.6454 19.172L12.6056 14.0633C12.3317 13.6029 11.6644 13.6029 11.3904 14.0633L8.35062 19.172C8.07068 19.6425 8.4102 20.2384 8.95816 20.2384H15.0378C15.5858 20.2384 15.9253 19.6425 15.6454 19.172Z" fill="#F6E266"/>
<path d="M15.6023 19.0995C15.4767 19.2667 15.2772 19.3804 15.0379 19.3804H8.95829C8.71894 19.3804 8.51944 19.2667 8.39387 19.0995L8.35074 19.172C8.0708 19.6425 8.41032 20.2384 8.95829 20.2384H15.0379C15.5859 20.2384 15.9254 19.6425 15.6454 19.172L15.6023 19.0995Z" fill="#FFC239"/>
<path d="M11.0522 8.06677H12.9437V8.88887H11.0522V8.06677Z" fill="#494949"/>
<path d="M4.27881 8.06677H6.17031V8.88887H4.27881V8.06677Z" fill="#494949"/>
<path d="M17.8257 8.06677H19.7172V8.88887H17.8257V8.06677Z" fill="#494949"/>
<path d="M11.9225 15.9461L10.9958 17.4033C10.9256 17.5136 10.9211 17.6534 10.9841 17.7679C11.0471 17.8825 11.1675 17.9536 11.2983 17.9536H11.7902L11.2135 18.8605C11.1073 19.0275 11.1567 19.2488 11.3237 19.355C11.4658 19.449 11.7038 19.4221 11.8185 19.2448L12.7453 17.7876C12.8154 17.6773 12.8198 17.5376 12.7569 17.423C12.6939 17.3085 12.5735 17.2373 12.4427 17.2373H11.9508L12.5276 16.3304C12.6338 16.1634 12.5844 15.942 12.4173 15.8359C12.2503 15.7298 12.0287 15.7792 11.9225 15.9461Z" fill="#DD636E"/>
</svg>

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

@ -5,6 +5,7 @@ import 'package:syncrow_web/pages/access_management/bloc/access_state.dart';
import 'package:syncrow_web/pages/access_management/model/password_model.dart';
import 'package:syncrow_web/pages/common/hour_picker_dialog.dart';
import 'package:syncrow_web/services/access_mang_api.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/constants/app_enum.dart';
import 'package:syncrow_web/utils/snack_bar.dart';
@ -26,7 +27,8 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
List<PasswordModel> filteredData = [];
List<PasswordModel> data = [];
Future<void> _onFetchTableData(FetchTableData event, Emitter<AccessState> emit) async {
Future<void> _onFetchTableData(
FetchTableData event, Emitter<AccessState> emit) async {
try {
emit(AccessLoaded());
data = await AccessMangApi().fetchVisitorPassword();
@ -39,19 +41,28 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
}
void updateTabsCount() {
int toBeEffectiveCount =
data.where((item) => item.passwordStatus.value == 'To be effective').length;
int effectiveCount = data.where((item) => item.passwordStatus.value == 'Effective').length;
int expiredCount = data.where((item) => item.passwordStatus.value == 'Expired').length;
int toBeEffectiveCount = data
.where((item) => item.passwordStatus.value == 'To be effective')
.length;
int effectiveCount =
data.where((item) => item.passwordStatus.value == 'Effective').length;
int expiredCount =
data.where((item) => item.passwordStatus.value == 'Expired').length;
tabs[1] = 'To Be Effective ($toBeEffectiveCount)';
tabs[2] = 'Effective ($effectiveCount)';
tabs[3] = 'Expired ($expiredCount)';
}
int selectedIndex = 0;
final List<String> tabs = ['All', 'To Be Effective (0)', 'Effective (0)', 'Expired'];
final List<String> tabs = [
'All',
'To Be Effective (0)',
'Effective (0)',
'Expired'
];
Future selectFilterTap(TabChangedEvent event, Emitter<AccessState> emit) async {
Future selectFilterTap(
TabChangedEvent event, Emitter<AccessState> emit) async {
try {
emit(AccessLoaded());
selectedIndex = event.selectedIndex;
@ -73,6 +84,23 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
initialDate: DateTime.now(),
firstDate: DateTime.now().add(const Duration(days: -5095)),
lastDate: DateTime.now().add(const Duration(days: 2095)),
builder: (BuildContext context, Widget? child) {
return Theme(
data: ThemeData.light().copyWith(
colorScheme: ColorScheme.light(
primary: ColorsManager.blackColor,
onPrimary: Colors.white,
onSurface: ColorsManager.grayColor,
),
textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(
foregroundColor: Colors.blue,
),
),
),
child: child!,
);
},
);
if (picked != null) {
final TimeOfDay? timePicked = await showHourPicker(
@ -88,16 +116,20 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
timePicked.hour,
timePicked.minute,
);
final int selectedTimestamp = selectedDateTime.millisecondsSinceEpoch ~/ 1000;
final int selectedTimestamp =
selectedDateTime.millisecondsSinceEpoch ~/ 1000;
if (event.isStart) {
if (expirationTimeTimeStamp != null && selectedTimestamp > expirationTimeTimeStamp!) {
CustomSnackBar.displaySnackBar('Effective Time cannot be later than Expiration Time.');
if (expirationTimeTimeStamp != null &&
selectedTimestamp > expirationTimeTimeStamp!) {
CustomSnackBar.displaySnackBar(
'Effective Time cannot be later than Expiration Time.');
} else {
startTime = selectedDateTime.toString().split('.').first;
effectiveTimeTimeStamp = selectedTimestamp;
}
} else {
if (effectiveTimeTimeStamp != null && selectedTimestamp < effectiveTimeTimeStamp!) {
if (effectiveTimeTimeStamp != null &&
selectedTimestamp < effectiveTimeTimeStamp!) {
CustomSnackBar.displaySnackBar(
'Expiration Time cannot be earlier than Effective Time.');
} else {
@ -110,7 +142,8 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
emit(ChangeTimeState());
}
Future<void> _filterData(FilterDataEvent event, Emitter<AccessState> emit) async {
Future<void> _filterData(
FilterDataEvent event, Emitter<AccessState> emit) async {
emit(AccessLoaded());
try {
// Convert search text to lower case for case-insensitive search
@ -119,29 +152,40 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
filteredData = data.where((item) {
bool matchesCriteria = true;
// Convert timestamp to DateTime and extract date component
DateTime effectiveDate =
DateTime.fromMillisecondsSinceEpoch(int.parse(item.effectiveTime.toString()) * 1000)
.toUtc()
.toLocal();
DateTime invalidDate =
DateTime.fromMillisecondsSinceEpoch(int.parse(item.invalidTime.toString()) * 1000)
.toUtc()
.toLocal();
DateTime effectiveDateAndTime = DateTime(effectiveDate.year, effectiveDate.month,
effectiveDate.day, effectiveDate.hour, effectiveDate.minute);
DateTime invalidDateAndTime = DateTime(invalidDate.year, invalidDate.month, invalidDate.day,
invalidDate.hour, invalidDate.minute);
DateTime effectiveDate = DateTime.fromMillisecondsSinceEpoch(
int.parse(item.effectiveTime.toString()) * 1000)
.toUtc()
.toLocal();
DateTime invalidDate = DateTime.fromMillisecondsSinceEpoch(
int.parse(item.invalidTime.toString()) * 1000)
.toUtc()
.toLocal();
DateTime effectiveDateAndTime = DateTime(
effectiveDate.year,
effectiveDate.month,
effectiveDate.day,
effectiveDate.hour,
effectiveDate.minute);
DateTime invalidDateAndTime = DateTime(
invalidDate.year,
invalidDate.month,
invalidDate.day,
invalidDate.hour,
invalidDate.minute);
// Filter by password name, making the search case-insensitive
if (searchText.isNotEmpty) {
final bool matchesName = item.passwordName.toString().toLowerCase().contains(searchText);
final bool matchesName =
item.passwordName.toString().toLowerCase().contains(searchText);
if (!matchesName) {
matchesCriteria = false;
}
}
if (searchEmailText.isNotEmpty) {
final bool matchesName =
item.authorizerEmail.toString().toLowerCase().contains(searchEmailText);
final bool matchesName = item.authorizerEmail
.toString()
.toLowerCase()
.contains(searchEmailText);
if (!matchesName) {
matchesCriteria = false;
}
@ -149,9 +193,11 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
// Filter by start date only
if (event.startTime != null && event.endTime == null) {
DateTime startDateTime =
DateTime.fromMillisecondsSinceEpoch(event.startTime! * 1000).toUtc().toLocal();
startDateTime = DateTime(startDateTime.year, startDateTime.month, startDateTime.day,
startDateTime.hour, startDateTime.minute);
DateTime.fromMillisecondsSinceEpoch(event.startTime! * 1000)
.toUtc()
.toLocal();
startDateTime = DateTime(startDateTime.year, startDateTime.month,
startDateTime.day, startDateTime.hour, startDateTime.minute);
if (effectiveDateAndTime.isBefore(startDateTime)) {
matchesCriteria = false;
}
@ -159,9 +205,11 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
// Filter by end date only
if (event.endTime != null && event.startTime == null) {
DateTime startDateTime =
DateTime.fromMillisecondsSinceEpoch(event.endTime! * 1000).toUtc().toLocal();
startDateTime = DateTime(startDateTime.year, startDateTime.month, startDateTime.day,
startDateTime.hour, startDateTime.minute);
DateTime.fromMillisecondsSinceEpoch(event.endTime! * 1000)
.toUtc()
.toLocal();
startDateTime = DateTime(startDateTime.year, startDateTime.month,
startDateTime.day, startDateTime.hour, startDateTime.minute);
if (invalidDateAndTime.isAfter(startDateTime)) {
matchesCriteria = false;
}
@ -170,13 +218,17 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
// Filter by both start date and end date
if (event.startTime != null && event.endTime != null) {
DateTime startDateTime =
DateTime.fromMillisecondsSinceEpoch(event.startTime! * 1000).toUtc().toLocal();
DateTime.fromMillisecondsSinceEpoch(event.startTime! * 1000)
.toUtc()
.toLocal();
DateTime endDateTime =
DateTime.fromMillisecondsSinceEpoch(event.endTime! * 1000).toUtc().toLocal();
startDateTime = DateTime(startDateTime.year, startDateTime.month, startDateTime.day,
startDateTime.hour, startDateTime.minute);
endDateTime = DateTime(endDateTime.year, endDateTime.month, endDateTime.day,
endDateTime.hour, endDateTime.minute);
DateTime.fromMillisecondsSinceEpoch(event.endTime! * 1000)
.toUtc()
.toLocal();
startDateTime = DateTime(startDateTime.year, startDateTime.month,
startDateTime.day, startDateTime.hour, startDateTime.minute);
endDateTime = DateTime(endDateTime.year, endDateTime.month,
endDateTime.day, endDateTime.hour, endDateTime.minute);
if (effectiveDateAndTime.isBefore(startDateTime) ||
invalidDateAndTime.isAfter(endDateTime)) {
matchesCriteria = false;
@ -184,11 +236,14 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
}
// Filter by selected tab index
if (event.selectedTabIndex == 1 && item.passwordStatus.value != 'To be effective') {
if (event.selectedTabIndex == 1 &&
item.passwordStatus.value != 'To be effective') {
matchesCriteria = false;
} else if (event.selectedTabIndex == 2 && item.passwordStatus.value != 'Effective') {
} else if (event.selectedTabIndex == 2 &&
item.passwordStatus.value != 'Effective') {
matchesCriteria = false;
} else if (event.selectedTabIndex == 3 && item.passwordStatus.value != 'Expired') {
} else if (event.selectedTabIndex == 3 &&
item.passwordStatus.value != 'Expired') {
matchesCriteria = false;
}
@ -214,12 +269,14 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
}
String timestampToDate(dynamic timestamp) {
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(int.parse(timestamp) * 1000);
DateTime dateTime =
DateTime.fromMillisecondsSinceEpoch(int.parse(timestamp) * 1000);
return "${dateTime.year}/${dateTime.month.toString().padLeft(2, '0')}/${dateTime.day.toString().padLeft(2, '0')} "
" ${dateTime.hour.toString().padLeft(2, '0')}:${dateTime.minute.toString().padLeft(2, '0')}";
}
Future<void> onTabChanged(TabChangedEvent event, Emitter<AccessState> emit) async {
Future<void> onTabChanged(
TabChangedEvent event, Emitter<AccessState> emit) async {
try {
emit(AccessLoaded());
selectedIndex = event.selectedIndex;
@ -228,14 +285,19 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
filteredData = data;
break;
case 1: // To Be Effective
filteredData =
data.where((item) => item.passwordStatus.value == "To Be Effective").toList();
filteredData = data
.where((item) => item.passwordStatus.value == "To Be Effective")
.toList();
break;
case 2: // Effective
filteredData = data.where((item) => item.passwordStatus.value == "Effective").toList();
filteredData = data
.where((item) => item.passwordStatus.value == "Effective")
.toList();
break;
case 3: // Expired
filteredData = data.where((item) => item.passwordStatus.value == "Expired").toList();
filteredData = data
.where((item) => item.passwordStatus.value == "Expired")
.toList();
break;
default:
filteredData = data;

View File

@ -15,8 +15,8 @@ import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/constants/app_enum.dart';
import 'package:syncrow_web/utils/constants/assets.dart';
import 'package:syncrow_web/utils/extension/build_context_x.dart';
import 'package:syncrow_web/utils/style.dart';
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
import 'package:syncrow_web/utils/style.dart';
import 'package:syncrow_web/web_layout/web_scaffold.dart';
class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
@ -27,7 +27,8 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
final isLargeScreen = isLargeScreenSize(context);
final isSmallScreen = isSmallScreenSize(context);
final isHalfMediumScreen = isHafMediumScreenSize(context);
final padding = isLargeScreen ? const EdgeInsets.all(30) : const EdgeInsets.all(15);
final padding =
isLargeScreen ? const EdgeInsets.all(30) : const EdgeInsets.all(15);
return WebScaffold(
enableMenuSidebar: false,
@ -37,23 +38,10 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
style: Theme.of(context).textTheme.headlineLarge,
),
),
centerBody: Wrap(
children: [
Padding(
padding: EdgeInsets.only(left: MediaQuery.of(context).size.width * 0.09),
child: Align(
alignment: Alignment.bottomLeft,
child: Text(
'Physical Access',
style: Theme.of(context).textTheme.headlineMedium!.copyWith(color: Colors.white),
),
),
),
],
),
rightBody: const NavigateHomeGridView(),
scaffoldBody: BlocProvider(
create: (BuildContext context) => AccessBloc()..add(FetchTableData()),
create: (BuildContext context) =>
AccessBloc()..add(FetchTableData()),
child: BlocConsumer<AccessBloc, AccessState>(
listener: (context, state) {},
builder: (context, state) {
@ -107,11 +95,14 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
return [
item.passwordName,
item.passwordType.value,
accessBloc.timestampToDate(item.effectiveTime),
accessBloc.timestampToDate(item.invalidTime),
accessBloc
.timestampToDate(item.effectiveTime),
accessBloc
.timestampToDate(item.invalidTime),
item.deviceName.toString(),
item.authorizerEmail.toString(),
accessBloc.timestampToDate(item.invalidTime),
accessBloc
.timestampToDate(item.invalidTime),
item.passwordStatus.value,
];
}).toList(),
@ -122,7 +113,8 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
})));
}
Wrap _buildVisitorAdminPasswords(BuildContext context, AccessBloc accessBloc) {
Wrap _buildVisitorAdminPasswords(
BuildContext context, AccessBloc accessBloc) {
return Wrap(
spacing: 10,
runSpacing: 10,
@ -147,8 +139,9 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
},
borderRadius: 8,
child: Text(
'+ Create Visitor Password ',
style: context.textTheme.titleSmall!.copyWith(color: Colors.white, fontSize: 12),
'Create Visitor Password ',
style: context.textTheme.titleSmall!
.copyWith(color: Colors.white, fontSize: 12),
)),
),
Container(
@ -160,7 +153,8 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
backgroundColor: ColorsManager.whiteColors,
child: Text(
'Admin Password',
style: context.textTheme.titleSmall!.copyWith(color: Colors.black, fontSize: 12),
style: context.textTheme.titleSmall!
.copyWith(color: Colors.black, fontSize: 12),
)),
),
],
@ -183,6 +177,16 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
isRequired: false,
textFieldName: 'Name',
description: '',
onSubmitted: (value) {
accessBloc.add(FilterDataEvent(
emailAuthorizer:
accessBloc.emailAuthorizer.text.toLowerCase(),
selectedTabIndex:
BlocProvider.of<AccessBloc>(context).selectedIndex,
passwordName: accessBloc.passwordName.text.toLowerCase(),
startTime: accessBloc.effectiveTimeTimeStamp,
endTime: accessBloc.expirationTimeTimeStamp));
},
),
),
const SizedBox(width: 15),
@ -194,6 +198,16 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
isRequired: false,
textFieldName: 'Authorizer',
description: '',
onSubmitted: (value) {
accessBloc.add(FilterDataEvent(
emailAuthorizer:
accessBloc.emailAuthorizer.text.toLowerCase(),
selectedTabIndex:
BlocProvider.of<AccessBloc>(context).selectedIndex,
passwordName: accessBloc.passwordName.text.toLowerCase(),
startTime: accessBloc.effectiveTimeTimeStamp,
endTime: accessBloc.expirationTimeTimeStamp));
},
),
),
const SizedBox(width: 15),
@ -218,7 +232,8 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
onSearch: () {
accessBloc.add(FilterDataEvent(
emailAuthorizer: accessBloc.emailAuthorizer.text.toLowerCase(),
selectedTabIndex: BlocProvider.of<AccessBloc>(context).selectedIndex,
selectedTabIndex:
BlocProvider.of<AccessBloc>(context).selectedIndex,
passwordName: accessBloc.passwordName.text.toLowerCase(),
startTime: accessBloc.effectiveTimeTimeStamp,
endTime: accessBloc.expirationTimeTimeStamp));
@ -239,12 +254,21 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
SizedBox(
width: 300,
child: CustomWebTextField(
controller: accessBloc.passwordName,
isRequired: true,
height: 40,
textFieldName: 'Name',
description: '',
),
controller: accessBloc.passwordName,
isRequired: true,
height: 40,
textFieldName: 'Name',
description: '',
onSubmitted: (value) {
accessBloc.add(FilterDataEvent(
emailAuthorizer:
accessBloc.emailAuthorizer.text.toLowerCase(),
selectedTabIndex:
BlocProvider.of<AccessBloc>(context).selectedIndex,
passwordName: accessBloc.passwordName.text.toLowerCase(),
startTime: accessBloc.effectiveTimeTimeStamp,
endTime: accessBloc.expirationTimeTimeStamp));
}),
),
DateTimeWebWidget(
icon: Assets.calendarIcon,
@ -264,7 +288,8 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
onSearch: () {
accessBloc.add(FilterDataEvent(
emailAuthorizer: accessBloc.emailAuthorizer.text.toLowerCase(),
selectedTabIndex: BlocProvider.of<AccessBloc>(context).selectedIndex,
selectedTabIndex:
BlocProvider.of<AccessBloc>(context).selectedIndex,
passwordName: accessBloc.passwordName.text.toLowerCase(),
startTime: accessBloc.effectiveTimeTimeStamp,
endTime: accessBloc.expirationTimeTimeStamp));

View File

@ -31,7 +31,8 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
////////////////////////////// forget password //////////////////////////////////
final TextEditingController forgetEmailController = TextEditingController();
final TextEditingController forgetPasswordController = TextEditingController();
final TextEditingController forgetPasswordController =
TextEditingController();
final TextEditingController forgetOtp = TextEditingController();
final forgetFormKey = GlobalKey<FormState>();
final forgetEmailKey = GlobalKey<FormState>();
@ -48,7 +49,8 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
return;
}
_remainingTime = 1;
add(UpdateTimerEvent(remainingTime: _remainingTime, isButtonEnabled: false));
add(UpdateTimerEvent(
remainingTime: _remainingTime, isButtonEnabled: false));
try {
forgetEmailValidate = '';
_remainingTime = (await AuthenticationAPI.sendOtp(
@ -84,7 +86,8 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
_timer?.cancel();
add(const UpdateTimerEvent(remainingTime: 0, isButtonEnabled: true));
} else {
add(UpdateTimerEvent(remainingTime: _remainingTime, isButtonEnabled: false));
add(UpdateTimerEvent(
remainingTime: _remainingTime, isButtonEnabled: false));
}
});
}
@ -94,21 +97,25 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
emit(const TimerState(isButtonEnabled: true, remainingTime: 0));
}
Future<void> changePassword(ChangePasswordEvent event, Emitter<AuthState> emit) async {
Future<void> changePassword(
ChangePasswordEvent event, Emitter<AuthState> emit) async {
emit(LoadingForgetState());
try {
var response = await AuthenticationAPI.verifyOtp(
email: forgetEmailController.text, otpCode: forgetOtp.text);
if (response == true) {
await AuthenticationAPI.forgetPassword(
password: forgetPasswordController.text, email: forgetEmailController.text);
otpCode: forgetOtp.text,
password: forgetPasswordController.text,
email: forgetEmailController.text);
_timer?.cancel();
emit(const TimerState(isButtonEnabled: true, remainingTime: 0));
emit(SuccessForgetState());
}
} on DioException catch (e) {
final errorData = e.response!.data;
String errorMessage = errorData['error']['message'] ?? 'something went wrong';
String errorMessage =
errorData['error']['message'] ?? 'something went wrong';
validate = errorMessage;
emit(AuthInitialState());
}
@ -122,7 +129,9 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
}
void _onUpdateTimer(UpdateTimerEvent event, Emitter<AuthState> emit) {
emit(TimerState(isButtonEnabled: event.isButtonEnabled, remainingTime: event.remainingTime));
emit(TimerState(
isButtonEnabled: event.isButtonEnabled,
remainingTime: event.remainingTime));
}
///////////////////////////////////// login /////////////////////////////////////
@ -154,7 +163,9 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
token = await AuthenticationAPI.loginWithEmail(
model: LoginWithEmailModel(
email: event.username, password: event.password, regionUuid: event.regionUuid),
email: event.username,
password: event.password,
regionUuid: event.regionUuid),
);
} catch (failure) {
validate = 'Invalid Credentials!';
@ -164,7 +175,8 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
if (token.accessTokenIsNotEmpty) {
FlutterSecureStorage storage = const FlutterSecureStorage();
await storage.write(key: Token.loginAccessTokenKey, value: token.accessToken);
await storage.write(
key: Token.loginAccessTokenKey, value: token.accessToken);
const FlutterSecureStorage().write(
key: UserModel.userUuidKey,
value: Token.decodeToken(token.accessToken)['uuid'].toString());
@ -322,12 +334,14 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
static Future<String> getTokenAndValidate() async {
try {
const storage = FlutterSecureStorage();
final firstLaunch =
await SharedPreferencesHelper.readBoolFromSP(StringsManager.firstLaunch) ?? true;
final firstLaunch = await SharedPreferencesHelper.readBoolFromSP(
StringsManager.firstLaunch) ??
true;
if (firstLaunch) {
storage.deleteAll();
}
await SharedPreferencesHelper.saveBoolToSP(StringsManager.firstLaunch, false);
await SharedPreferencesHelper.saveBoolToSP(
StringsManager.firstLaunch, false);
final value = await storage.read(key: Token.loginAccessTokenKey) ?? '';
if (value.isEmpty) {
return 'Token not found';
@ -380,7 +394,9 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
final String formattedTime = [
if (days > 0) '${days}d', // Append 'd' for days
if (days > 0 || hours > 0)
hours.toString().padLeft(2, '0'), // Show hours if there are days or hours
hours
.toString()
.padLeft(2, '0'), // Show hours if there are days or hours
minutes.toString().padLeft(2, '0'),
seconds.toString().padLeft(2, '0'),
].join(':');

View File

@ -26,9 +26,12 @@ class CurtainToggle extends StatelessWidget {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ClipOval(
child: Container(
@ -41,6 +44,9 @@ class CurtainToggle extends StatelessWidget {
),
),
),
const SizedBox(
width: 20,
),
SizedBox(
height: 20,
width: 35,

View File

@ -4,6 +4,7 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/bloc/device_managment_bloc.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/constants/assets.dart';
import 'package:syncrow_web/utils/extension/build_context_x.dart';
class DynamicTable extends StatefulWidget {
final List<String> headers;
@ -45,6 +46,8 @@ class DynamicTable extends StatefulWidget {
class _DynamicTableState extends State<DynamicTable> {
late List<bool> _selectedRows;
bool _selectAll = false;
final ScrollController _verticalScrollController = ScrollController();
final ScrollController _horizontalScrollController = ScrollController();
@override
void initState() {
@ -102,68 +105,81 @@ class _DynamicTableState extends State<DynamicTable> {
Widget build(BuildContext context) {
return Container(
decoration: widget.cellDecoration,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: SizedBox(
width: widget.size.width,
child: Column(
children: [
Container(
decoration: widget.headerDecoration ?? BoxDecoration(color: Colors.grey[200]),
child: Row(
child: Scrollbar(
controller: _verticalScrollController,
thumbVisibility: true,
trackVisibility: true,
child: Scrollbar(
controller: _horizontalScrollController,
thumbVisibility: false,
trackVisibility: false,
notificationPredicate: (notif) => notif.depth == 1,
child: SingleChildScrollView(
controller: _verticalScrollController,
child: SingleChildScrollView(
controller: _horizontalScrollController,
scrollDirection: Axis.horizontal,
child: SizedBox(
width: widget.size.width,
child: Column(
children: [
if (widget.withCheckBox) _buildSelectAllCheckbox(),
...widget.headers.map((header) => _buildTableHeaderCell(header)),
],
),
),
widget.isEmpty
? Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
Container(
decoration: widget.headerDecoration ??
const BoxDecoration(
color: ColorsManager.boxColor,
),
child: Row(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
if (widget.withCheckBox) _buildSelectAllCheckbox(),
...List.generate(widget.headers.length, (index) {
return _buildTableHeaderCell(widget.headers[index], index);
})
//...widget.headers.map((header) => _buildTableHeaderCell(header)),
],
),
),
widget.isEmpty
? Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Column(
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset(Assets.emptyTable),
const SizedBox(
height: 15,
Column(
children: [
SvgPicture.asset(Assets.emptyTable),
const SizedBox(
height: 15,
),
Text(
widget.tableName == 'AccessManagement' ? 'No Password ' : 'No Devices',
style: Theme.of(context)
.textTheme
.bodySmall!
.copyWith(color: ColorsManager.grayColor),
)
],
),
Text(
// no password
widget.tableName == 'AccessManagement' ? 'No Password ' : 'No Devices',
style:
Theme.of(context).textTheme.bodySmall!.copyWith(color: ColorsManager.grayColor),
)
],
),
],
)
: Column(
children: List.generate(widget.data.length, (index) {
final row = widget.data[index];
return Row(
children: [
if (widget.withCheckBox) _buildRowCheckbox(index, widget.size.height * 0.08),
...row.map((cell) => _buildTableCell(cell.toString(), widget.size.height * 0.08)),
],
);
}),
),
],
),
)
: Expanded(
child: Container(
color: Colors.white,
child: ListView.builder(
shrinkWrap: true,
itemCount: widget.data.length,
itemBuilder: (context, index) {
final row = widget.data[index];
return Row(
children: [
if (widget.withCheckBox) _buildRowCheckbox(index, widget.size.height * 0.10),
...row.map((cell) => _buildTableCell(cell.toString(), widget.size.height * 0.10)),
],
);
},
),
),
),
],
],
),
),
),
),
),
),
@ -173,7 +189,6 @@ class _DynamicTableState extends State<DynamicTable> {
Widget _buildSelectAllCheckbox() {
return Container(
width: 50,
padding: const EdgeInsets.all(8.0),
decoration: const BoxDecoration(
border: Border.symmetric(
vertical: BorderSide(color: ColorsManager.boxDivider),
@ -198,6 +213,7 @@ class _DynamicTableState extends State<DynamicTable> {
width: 1.0,
),
),
color: ColorsManager.whiteColors,
),
alignment: Alignment.centerLeft,
child: Center(
@ -211,7 +227,7 @@ class _DynamicTableState extends State<DynamicTable> {
);
}
Widget _buildTableHeaderCell(String title) {
Widget _buildTableHeaderCell(String title, int index) {
return Expanded(
child: Container(
decoration: const BoxDecoration(
@ -219,15 +235,16 @@ class _DynamicTableState extends State<DynamicTable> {
vertical: BorderSide(color: ColorsManager.boxDivider),
),
),
constraints: const BoxConstraints.expand(height: 40),
alignment: Alignment.centerLeft,
child: Padding(
padding: const EdgeInsets.all(8.0),
padding: EdgeInsets.symmetric(horizontal: index == widget.headers.length - 1 ? 12 : 8.0, vertical: 4),
child: Text(
title,
style: const TextStyle(
style: context.textTheme.titleSmall!.copyWith(
color: ColorsManager.grayColor,
fontSize: 12,
fontWeight: FontWeight.w400,
fontSize: 13,
color: Color(0xFF999999),
),
maxLines: 2,
),
@ -276,6 +293,7 @@ class _DynamicTableState extends State<DynamicTable> {
width: 1.0,
),
),
color: Colors.white,
),
alignment: Alignment.centerLeft,
child: Text(
@ -286,7 +304,7 @@ class _DynamicTableState extends State<DynamicTable> {
: (batteryLevel != null && batteryLevel > 20)
? ColorsManager.green
: statusColor,
fontSize: 10,
fontSize: 13,
fontWeight: FontWeight.w400),
maxLines: 2,
),

View File

@ -81,7 +81,10 @@ class DateTimeWebWidget extends StatelessWidget {
const SizedBox(
width: 30,
),
const Icon(Icons.arrow_right_alt),
const Icon(
Icons.arrow_right_alt,
color: ColorsManager.grayColor,
),
const SizedBox(
width: 30,
),

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:syncrow_web/utils/extension/build_context_x.dart';
import 'package:syncrow_web/utils/style.dart';
class StatefulTextField extends StatefulWidget {
const StatefulTextField(
@ -25,13 +26,15 @@ class StatefulTextField extends StatefulWidget {
class _StatefulTextFieldState extends State<StatefulTextField> {
@override
Widget build(BuildContext context) {
return CustomTextField(
title: widget.title,
controller: widget.controller,
hintText: widget.hintText,
width: widget.width,
elevation: widget.elevation,
onSubmittedFun: widget.onSubmitted);
return Container(
child: CustomTextField(
title: widget.title,
controller: widget.controller,
hintText: widget.hintText,
width: widget.width,
elevation: widget.elevation,
onSubmittedFun: widget.onSubmitted),
);
}
}
@ -73,17 +76,20 @@ class CustomTextField extends StatelessWidget {
child: Container(
width: width,
height: 45,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
decoration: containerDecoration,
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(8),
// ),
child: TextFormField(
controller: controller,
style: const TextStyle(color: Colors.black),
decoration: InputDecoration(
hintText: hintText,
hintStyle: const TextStyle(fontSize: 12),
contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
contentPadding:
const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
border: InputBorder.none,
),
onFieldSubmitted: (_) {

View File

@ -13,6 +13,7 @@ class CustomWebTextField extends StatelessWidget {
this.validator,
this.hintText,
this.height,
this.onSubmitted,
});
final bool isRequired;
@ -22,6 +23,7 @@ class CustomWebTextField extends StatelessWidget {
final String? Function(String?)? validator;
final String? hintText;
final double? height;
final ValueChanged<String>? onSubmitted;
@override
Widget build(BuildContext context) {
@ -32,23 +34,25 @@ class CustomWebTextField extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
if (isRequired)
Text('* ',
Row(
children: [
if (isRequired)
Text(
'* ',
style: Theme.of(context)
.textTheme.bodyMedium!
.textTheme
.bodyMedium!
.copyWith(color: Colors.red),
),
Text(
textFieldName,
style: Theme.of(context)
.textTheme.bodySmall!
.copyWith(color: Colors.black, fontSize: 13),
),
],
),
Text(
textFieldName,
style: Theme.of(context)
.textTheme
.bodySmall!
.copyWith(color: Colors.black, fontSize: 13),
),
],
),
const SizedBox(
width: 10,
),
@ -68,17 +72,7 @@ class CustomWebTextField extends StatelessWidget {
),
Container(
height: height ?? 35,
decoration: containerDecoration.copyWith(
color: const Color(0xFFF5F6F7),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.3),
spreadRadius: 2,
blurRadius: 3,
offset: const Offset(1, 1), // changes position of shadow
),
]
),
decoration: containerDecoration,
child: TextFormField(
validator: validator,
controller: controller,
@ -88,6 +82,7 @@ class CustomWebTextField extends StatelessWidget {
hintStyle: context.textTheme.titleSmall!
.copyWith(color: Colors.grey, fontSize: 12),
hintText: hintText ?? 'Please enter'),
onFieldSubmitted: onSubmitted,
),
),
],

View File

@ -40,7 +40,7 @@ class AcDeviceControlsView extends StatelessWidget with HelperResponsiveLayout {
: 1,
mainAxisExtent: 140,
crossAxisSpacing: 12,
mainAxisSpacing: 12,
mainAxisSpacing: 16,
),
children: [
ToggleWidget(
@ -81,6 +81,7 @@ class AcDeviceControlsView extends StatelessWidget with HelperResponsiveLayout {
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
IconButton(
padding: const EdgeInsets.all(0),
onPressed: () {},
icon: const Icon(
Icons.remove,
@ -108,6 +109,7 @@ class AcDeviceControlsView extends StatelessWidget with HelperResponsiveLayout {
),
Text('m', style: context.textTheme.bodySmall!.copyWith(color: ColorsManager.blackColor)),
IconButton(
padding: const EdgeInsets.all(0),
onPressed: () {},
icon: const Icon(
Icons.add,
@ -127,7 +129,7 @@ class AcDeviceControlsView extends StatelessWidget with HelperResponsiveLayout {
deviceId: device.uuid!,
code: 'child_lock',
value: state.status.childLock,
label: 'Child Lock',
label: 'Lock',
icon: state.status.childLock ? Assets.acLock : Assets.unlock,
onChange: (value) {
context.read<AcBloc>().add(

View File

@ -6,7 +6,8 @@ import 'package:syncrow_web/services/devices_mang_api.dart';
part 'device_managment_event.dart';
part 'device_managment_state.dart';
class DeviceManagementBloc extends Bloc<DeviceManagementEvent, DeviceManagementState> {
class DeviceManagementBloc
extends Bloc<DeviceManagementEvent, DeviceManagementState> {
int _selectedIndex = 0;
List<AllDevicesModel> _devices = [];
int _onlineCount = 0;
@ -29,7 +30,8 @@ class DeviceManagementBloc extends Bloc<DeviceManagementEvent, DeviceManagementS
on<UpdateSelection>(_onUpdateSelection);
}
Future<void> _onFetchDevices(FetchDevices event, Emitter<DeviceManagementState> emit) async {
Future<void> _onFetchDevices(
FetchDevices event, Emitter<DeviceManagementState> emit) async {
emit(DeviceManagementLoading());
try {
final devices = await DevicesManagementApi().fetchDevices();
@ -51,7 +53,8 @@ class DeviceManagementBloc extends Bloc<DeviceManagementEvent, DeviceManagementS
}
}
void _onFilterDevices(FilterDevices event, Emitter<DeviceManagementState> emit) async {
void _onFilterDevices(
FilterDevices event, Emitter<DeviceManagementState> emit) async {
if (_devices.isNotEmpty) {
_filteredDevices = List.from(_devices.where((device) {
switch (event.filter) {
@ -82,7 +85,8 @@ class DeviceManagementBloc extends Bloc<DeviceManagementEvent, DeviceManagementS
}
}
Future<void> _onResetFilters(ResetFilters event, Emitter<DeviceManagementState> emit) async {
Future<void> _onResetFilters(
ResetFilters event, Emitter<DeviceManagementState> emit) async {
currentProductName = '';
_selectedDevices.clear();
_filteredDevices = List.from(_devices);
@ -98,7 +102,8 @@ class DeviceManagementBloc extends Bloc<DeviceManagementEvent, DeviceManagementS
));
}
void _onResetSelectedDevices(ResetSelectedDevices event, Emitter<DeviceManagementState> emit) {
void _onResetSelectedDevices(
ResetSelectedDevices event, Emitter<DeviceManagementState> emit) {
_selectedDevices.clear();
if (state is DeviceManagementLoaded) {
@ -124,12 +129,14 @@ class DeviceManagementBloc extends Bloc<DeviceManagementEvent, DeviceManagementS
}
}
void _onSelectedFilterChanged(SelectedFilterChanged event, Emitter<DeviceManagementState> emit) {
void _onSelectedFilterChanged(
SelectedFilterChanged event, Emitter<DeviceManagementState> emit) {
_selectedIndex = event.selectedIndex;
add(FilterDevices(_getFilterFromIndex(_selectedIndex)));
}
void _onSelectDevice(SelectDevice event, Emitter<DeviceManagementState> emit) {
void _onSelectDevice(
SelectDevice event, Emitter<DeviceManagementState> emit) {
final selectedUuid = event.selectedDevice.uuid;
if (_selectedDevices.any((device) => device.uuid == selectedUuid)) {
@ -140,7 +147,8 @@ class DeviceManagementBloc extends Bloc<DeviceManagementEvent, DeviceManagementS
List<AllDevicesModel> clonedSelectedDevices = List.from(_selectedDevices);
bool isControlButtonEnabled = _checkIfControlButtonEnabled(clonedSelectedDevices);
bool isControlButtonEnabled =
_checkIfControlButtonEnabled(clonedSelectedDevices);
if (state is DeviceManagementLoaded) {
emit(DeviceManagementLoaded(
@ -149,7 +157,8 @@ class DeviceManagementBloc extends Bloc<DeviceManagementEvent, DeviceManagementS
onlineCount: _onlineCount,
offlineCount: _offlineCount,
lowBatteryCount: _lowBatteryCount,
selectedDevice: clonedSelectedDevices.isNotEmpty ? clonedSelectedDevices : null,
selectedDevice:
clonedSelectedDevices.isNotEmpty ? clonedSelectedDevices : null,
isControlButtonEnabled: isControlButtonEnabled,
));
} else if (state is DeviceManagementFiltered) {
@ -159,13 +168,15 @@ class DeviceManagementBloc extends Bloc<DeviceManagementEvent, DeviceManagementS
onlineCount: _onlineCount,
offlineCount: _offlineCount,
lowBatteryCount: _lowBatteryCount,
selectedDevice: clonedSelectedDevices.isNotEmpty ? clonedSelectedDevices : null,
selectedDevice:
clonedSelectedDevices.isNotEmpty ? clonedSelectedDevices : null,
isControlButtonEnabled: isControlButtonEnabled,
));
}
}
void _onUpdateSelection(UpdateSelection event, Emitter<DeviceManagementState> emit) {
void _onUpdateSelection(
UpdateSelection event, Emitter<DeviceManagementState> emit) {
List<AllDevicesModel> selectedDevices = [];
List<AllDevicesModel> devicesToSelectFrom = [];
@ -208,7 +219,8 @@ class DeviceManagementBloc extends Bloc<DeviceManagementEvent, DeviceManagementS
bool _checkIfControlButtonEnabled(List<AllDevicesModel> selectedDevices) {
if (selectedDevices.length > 1) {
final productTypes = selectedDevices.map((device) => device.productType).toSet();
final productTypes =
selectedDevices.map((device) => device.productType).toSet();
return productTypes.length == 1;
} else if (selectedDevices.length == 1) {
return true;
@ -219,8 +231,10 @@ class DeviceManagementBloc extends Bloc<DeviceManagementEvent, DeviceManagementS
void _calculateDeviceCounts() {
_onlineCount = _devices.where((device) => device.online == true).length;
_offlineCount = _devices.where((device) => device.online == false).length;
_lowBatteryCount =
_devices.where((device) => device.batteryLevel != null && device.batteryLevel! < 20).length;
_lowBatteryCount = _devices
.where((device) =>
device.batteryLevel != null && device.batteryLevel! < 20)
.length;
}
String _getFilterFromIndex(int index) {
@ -236,7 +250,8 @@ class DeviceManagementBloc extends Bloc<DeviceManagementEvent, DeviceManagementS
}
}
void _onSearchDevices(SearchDevices event, Emitter<DeviceManagementState> emit) {
void _onSearchDevices(
SearchDevices event, Emitter<DeviceManagementState> emit) {
if ((event.community == null || event.community!.isEmpty) &&
(event.unitName == null || event.unitName!.isEmpty) &&
(event.productName == null || event.productName!.isEmpty)) {
@ -265,19 +280,33 @@ class DeviceManagementBloc extends Bloc<DeviceManagementEvent, DeviceManagementS
final filteredDevices = devicesToSearch.where((device) {
final matchesCommunity = event.community == null ||
event.community!.isEmpty ||
(device.room?.name?.toLowerCase().contains(event.community!.toLowerCase()) ?? false);
(device.community?.name
?.toLowerCase()
.contains(event.community!.toLowerCase()) ??
false);
final matchesUnit = event.unitName == null ||
event.unitName!.isEmpty ||
(device.unit?.name?.toLowerCase().contains(event.unitName!.toLowerCase()) ?? false);
(device.spaces != null &&
device.spaces!.isNotEmpty &&
device.spaces![0].spaceName
!.toLowerCase()
.contains(event.unitName!.toLowerCase()));
final matchesProductName = event.productName == null ||
event.productName!.isEmpty ||
(device.name?.toLowerCase().contains(event.productName!.toLowerCase()) ?? false);
(device.name
?.toLowerCase()
.contains(event.productName!.toLowerCase()) ??
false);
final matchesDeviceName = event.productName == null ||
event.productName!.isEmpty ||
(device.categoryName?.toLowerCase().contains(event.productName!.toLowerCase()) ??
(device.categoryName
?.toLowerCase()
.contains(event.productName!.toLowerCase()) ??
false);
return matchesCommunity && matchesUnit && (matchesProductName || matchesDeviceName);
return matchesCommunity &&
matchesUnit &&
(matchesProductName || matchesDeviceName);
}).toList();
emit(DeviceManagementFiltered(

View File

@ -18,6 +18,10 @@ import 'package:syncrow_web/pages/device_managment/main_door_sensor/view/main_do
import 'package:syncrow_web/pages/device_managment/one_g_glass_switch/view/one_gang_glass_batch_control_view.dart';
import 'package:syncrow_web/pages/device_managment/one_gang_switch/view/wall_light_batch_control.dart';
import 'package:syncrow_web/pages/device_managment/one_gang_switch/view/wall_light_device_control.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/view/power_clamp_batch_control_view.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/view/smart_power_device_control.dart';
import 'package:syncrow_web/pages/device_managment/sos/view/sos_batch_control_view.dart';
import 'package:syncrow_web/pages/device_managment/sos/view/sos_device_control_view.dart';
import 'package:syncrow_web/pages/device_managment/three_g_glass_switch/view/three_gang_glass_switch_batch_control_view.dart';
import 'package:syncrow_web/pages/device_managment/three_g_glass_switch/view/three_gang_glass_switch_control_view.dart';
import 'package:syncrow_web/pages/device_managment/three_gang_switch/view/living_room_batch_controls.dart';
@ -94,6 +98,12 @@ mixin RouteControlsBasedCode {
return WaterLeakView(
deviceId: device.uuid!,
);
case 'PC':
return SmartPowerDeviceControl(
deviceId: device.uuid!,
);
case 'SOS':
return SosDeviceControlsView(device: device);
default:
return const SizedBox();
}
@ -117,112 +127,72 @@ mixin RouteControlsBasedCode {
switch (devices.first.productType) {
case '1G':
return WallLightBatchControlView(
deviceIds: devices
.where((e) => (e.productType == '1G'))
.map((e) => e.uuid!)
.toList(),
deviceIds: devices.where((e) => (e.productType == '1G')).map((e) => e.uuid!).toList(),
);
case '2G':
return TwoGangBatchControlView(
deviceIds: devices
.where((e) => (e.productType == '2G'))
.map((e) => e.uuid!)
.toList(),
deviceIds: devices.where((e) => (e.productType == '2G')).map((e) => e.uuid!).toList(),
);
case '3G':
return LivingRoomBatchControlsView(
deviceIds: devices
.where((e) => (e.productType == '3G'))
.map((e) => e.uuid!)
.toList(),
deviceIds: devices.where((e) => (e.productType == '3G')).map((e) => e.uuid!).toList(),
);
case '1GT':
return OneGangGlassSwitchBatchControlView(
deviceIds: devices
.where((e) => (e.productType == '1GT'))
.map((e) => e.uuid!)
.toList(),
deviceIds: devices.where((e) => (e.productType == '1GT')).map((e) => e.uuid!).toList(),
);
case '2GT':
return TwoGangGlassSwitchBatchControlView(
deviceIds: devices
.where((e) => (e.productType == '2GT'))
.map((e) => e.uuid!)
.toList(),
deviceIds: devices.where((e) => (e.productType == '2GT')).map((e) => e.uuid!).toList(),
);
case '3GT':
return ThreeGangGlassSwitchBatchControlView(
deviceIds: devices
.where((e) => (e.productType == '3GT'))
.map((e) => e.uuid!)
.toList(),
deviceIds: devices.where((e) => (e.productType == '3GT')).map((e) => e.uuid!).toList(),
);
case 'GW':
return GatewayBatchControlView(
gatewayIds: devices
.where((e) => (e.productType == 'GW'))
.map((e) => e.uuid!)
.toList(),
gatewayIds: devices.where((e) => (e.productType == 'GW')).map((e) => e.uuid!).toList(),
);
case 'DL':
return DoorLockBatchControlView(
devicesIds: devices
.where((e) => (e.productType == 'DL'))
.map((e) => e.uuid!)
.toList());
devicesIds: devices.where((e) => (e.productType == 'DL')).map((e) => e.uuid!).toList());
case 'WPS':
return WallSensorBatchControlView(
devicesIds: devices
.where((e) => (e.productType == 'WPS'))
.map((e) => e.uuid!)
.toList());
devicesIds: devices.where((e) => (e.productType == 'WPS')).map((e) => e.uuid!).toList());
case 'CPS':
return CeilingSensorBatchControlView(
devicesIds: devices
.where((e) => (e.productType == 'CPS'))
.map((e) => e.uuid!)
.toList(),
devicesIds: devices.where((e) => (e.productType == 'CPS')).map((e) => e.uuid!).toList(),
);
case 'CUR':
return CurtainBatchStatusView(
devicesIds: devices
.where((e) => (e.productType == 'CUR'))
.map((e) => e.uuid!)
.toList(),
devicesIds: devices.where((e) => (e.productType == 'CUR')).map((e) => e.uuid!).toList(),
);
case 'AC':
return AcDeviceBatchControlView(
devicesIds: devices
.where((e) => (e.productType == 'AC'))
.map((e) => e.uuid!)
.toList());
devicesIds: devices.where((e) => (e.productType == 'AC')).map((e) => e.uuid!).toList());
case 'WH':
return WaterHEaterBatchControlView(
deviceIds: devices
.where((e) => (e.productType == 'WH'))
.map((e) => e.uuid!)
.toList(),
deviceIds: devices.where((e) => (e.productType == 'WH')).map((e) => e.uuid!).toList(),
);
case 'DS':
return MainDoorSensorBatchView(
devicesIds: devices
.where((e) => (e.productType == 'DS'))
.map((e) => e.uuid!)
.toList(),
devicesIds: devices.where((e) => (e.productType == 'DS')).map((e) => e.uuid!).toList(),
);
case 'GD':
return GarageDoorBatchControlView(
deviceIds: devices
.where((e) => (e.productType == 'GD'))
.map((e) => e.uuid!)
.toList(),
deviceIds: devices.where((e) => (e.productType == 'GD')).map((e) => e.uuid!).toList(),
);
case 'WL':
return WaterLeakBatchControlView(
deviceIds: devices
.where((e) => (e.productType == 'WL'))
.map((e) => e.uuid!)
.toList(),
deviceIds: devices.where((e) => (e.productType == 'WL')).map((e) => e.uuid!).toList(),
);
case 'PC':
return PowerClampBatchControlView(
deviceIds: devices.where((e) => (e.productType == 'PC')).map((e) => e.uuid!).toList(),
);
case 'SOS':
return SOSBatchControlView(
deviceIds: devices.where((e) => (e.productType == 'SOS')).map((e) => e.uuid!).toList(),
);
default:
return const SizedBox();

View File

@ -0,0 +1,18 @@
class DeviceCommunityModel {
String? uuid;
String? name;
DeviceCommunityModel({this.uuid, this.name});
DeviceCommunityModel.fromJson(Map<String, dynamic> json) {
uuid = json['uuid']?.toString();
name = json['name']?.toString();
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['uuid'] = uuid;
data['name'] = name;
return data;
}
}

View File

@ -0,0 +1,18 @@
class DeviceSpaceModel {
String? uuid;
String? spaceName;
DeviceSpaceModel({this.uuid, this.spaceName});
DeviceSpaceModel.fromJson(Map<String, dynamic> json) {
uuid = json['uuid']?.toString();
spaceName = json['spaceName']?.toString();
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['uuid'] = uuid;
data['spaceName'] = spaceName;
return data;
}
}

View File

@ -1,3 +1,5 @@
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_community.model.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_space_model.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/room.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/unit.dart';
import 'package:syncrow_web/utils/constants/assets.dart';
@ -40,6 +42,7 @@ class AllDevicesModel {
DevicesModelRoom? room;
DevicesModelUnit? unit;
DeviceCommunityModel? community;
String? productUuid;
String? productType;
String? permissionType;
@ -64,10 +67,12 @@ class AllDevicesModel {
String? uuid;
int? batteryLevel;
String? productName;
List<DeviceSpaceModel>? spaces;
AllDevicesModel({
this.room,
this.unit,
this.community,
this.productUuid,
this.productType,
this.permissionType,
@ -92,6 +97,7 @@ class AllDevicesModel {
this.uuid,
this.batteryLevel,
this.productName,
this.spaces,
});
AllDevicesModel.fromJson(Map<String, dynamic> json) {
room = (json['room'] != null && (json['room'] is Map))
@ -100,6 +106,9 @@ class AllDevicesModel {
unit = (json['unit'] != null && (json['unit'] is Map))
? DevicesModelUnit.fromJson(json['unit'])
: null;
community = (json['community'] != null && (json['community'] is Map))
? DeviceCommunityModel.fromJson(json['community'])
: null;
productUuid = json['productUuid']?.toString();
productType = json['productType']?.toString();
permissionType = json['permissionType']?.toString();
@ -124,6 +133,11 @@ class AllDevicesModel {
uuid = json['uuid']?.toString();
batteryLevel = int.tryParse(json['battery']?.toString() ?? '');
productName = json['productName']?.toString();
if (json['spaces'] != null && json['spaces'] is List) {
spaces = (json['spaces'] as List)
.map((space) => DeviceSpaceModel.fromJson(space))
.toList();
}
}
String _getDefaultIcon(String? productType) {
@ -162,6 +176,9 @@ class AllDevicesModel {
if (unit != null) {
data['unit'] = unit!.toJson();
}
if (community != null) {
data['community'] = community!.toJson();
}
data['productUuid'] = productUuid;
data['productType'] = productType;
data['permissionType'] = permissionType;
@ -186,6 +203,9 @@ class AllDevicesModel {
data['uuid'] = uuid;
data['battery'] = batteryLevel;
data['productName'] = productName;
if (spaces != null) {
data['spaces'] = spaces!.map((space) => space.toJson()).toList();
}
return data;
}

View File

@ -8,7 +8,6 @@ import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_mo
import 'package:syncrow_web/pages/device_managment/all_devices/widgets/device_search_filters.dart';
import 'package:syncrow_web/pages/device_managment/shared/device_batch_control_dialog.dart';
import 'package:syncrow_web/pages/device_managment/shared/device_control_dialog.dart';
import 'package:syncrow_web/utils/extension/build_context_x.dart';
import 'package:syncrow_web/utils/format_date_time.dart';
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
import 'package:syncrow_web/utils/style.dart';
@ -58,12 +57,15 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
'Low Battery ($lowBatteryCount)',
];
final buttonLabel = (selectedDevices.length > 1) ? 'Batch Control' : 'Control';
final buttonLabel =
(selectedDevices.length > 1) ? 'Batch Control' : 'Control';
return Column(
children: [
Container(
padding: isLargeScreenSize(context) ? const EdgeInsets.all(30) : const EdgeInsets.all(15),
padding: isLargeScreenSize(context)
? const EdgeInsets.all(30)
: const EdgeInsets.all(15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -72,7 +74,9 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
tabs: tabs,
selectedIndex: selectedIndex,
onTabChanged: (index) {
context.read<DeviceManagementBloc>().add(SelectedFilterChanged(index));
context
.read<DeviceManagementBloc>()
.add(SelectedFilterChanged(index));
},
),
const SizedBox(height: 20),
@ -94,11 +98,14 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
),
);
} else if (selectedDevices.length > 1) {
final productTypes = selectedDevices.map((device) => device.productType).toSet();
final productTypes = selectedDevices
.map((device) => device.productType)
.toSet();
if (productTypes.length == 1) {
showDialog(
context: context,
builder: (context) => DeviceBatchControlDialog(
builder: (context) =>
DeviceBatchControlDialog(
devices: selectedDevices,
),
);
@ -112,7 +119,9 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12,
color: isControlButtonEnabled ? Colors.white : Colors.grey,
color: isControlButtonEnabled
? Colors.white
: Colors.grey,
),
),
),
@ -123,46 +132,72 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
),
Expanded(
child: Padding(
padding: isLargeScreenSize(context) ? const EdgeInsets.all(30) : const EdgeInsets.all(15),
padding: isLargeScreenSize(context)
? const EdgeInsets.all(30)
: const EdgeInsets.all(15),
child: DynamicTable(
withSelectAll: true,
cellDecoration: containerDecoration,
onRowSelected: (index, isSelected, row) {
final selectedDevice = devicesToShow[index];
context.read<DeviceManagementBloc>().add(SelectDevice(selectedDevice));
context
.read<DeviceManagementBloc>()
.add(SelectDevice(selectedDevice));
},
withCheckBox: true,
size: context.screenSize,
size: MediaQuery.of(context).size,
uuidIndex: 2,
headers: const [
'Device Name',
'Product Name',
'Device ID',
'Unit Name',
'Room',
'Space Name',
'location',
'Battery Level',
'Installation Date and Time',
'Status',
'Last Offline Date and Time',
],
data: devicesToShow.map((device) {
final combinedSpaceNames = device.spaces != null
? device.spaces!
.map((space) => space.spaceName)
.join(' > ') +
(device.community != null
? ' > ${device.community!.name}'
: '')
: (device.community != null
? device.community!.name
: '');
return [
device.name ?? '',
device.productName ?? '',
device.uuid ?? '',
device.unit?.name ?? '',
device.room?.name ?? '',
device.batteryLevel != null ? '${device.batteryLevel}%' : '-',
formatDateTime(DateTime.fromMillisecondsSinceEpoch((device.createTime ?? 0) * 1000)),
(device.spaces != null && device.spaces!.isNotEmpty)
? device.spaces![0].spaceName
: '',
combinedSpaceNames,
device.batteryLevel != null
? '${device.batteryLevel}%'
: '-',
formatDateTime(DateTime.fromMillisecondsSinceEpoch(
(device.createTime ?? 0) * 1000)),
device.online == true ? 'Online' : 'Offline',
formatDateTime(DateTime.fromMillisecondsSinceEpoch((device.updateTime ?? 0) * 1000)),
formatDateTime(DateTime.fromMillisecondsSinceEpoch(
(device.updateTime ?? 0) * 1000)),
];
}).toList(),
onSelectionChanged: (selectedRows) {
context.read<DeviceManagementBloc>().add(UpdateSelection(selectedRows));
context
.read<DeviceManagementBloc>()
.add(UpdateSelection(selectedRows));
},
initialSelectedIds:
context.read<DeviceManagementBloc>().selectedDevices.map((device) => device.uuid!).toList(),
initialSelectedIds: context
.read<DeviceManagementBloc>()
.selectedDevices
.map((device) => device.uuid!)
.toList(),
isEmpty: devicesToShow.isEmpty,
),
),

View File

@ -4,6 +4,7 @@ import 'package:syncrow_web/pages/common/text_field/custom_text_field.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/bloc/device_managment_bloc.dart';
import 'package:syncrow_web/pages/common/buttons/search_reset_buttons.dart';
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
import 'package:syncrow_web/utils/style.dart';
class DeviceSearchFilters extends StatefulWidget {
const DeviceSearchFilters({super.key});
@ -12,7 +13,8 @@ class DeviceSearchFilters extends StatefulWidget {
State<DeviceSearchFilters> createState() => _DeviceSearchFiltersState();
}
class _DeviceSearchFiltersState extends State<DeviceSearchFilters> with HelperResponsiveLayout {
class _DeviceSearchFiltersState extends State<DeviceSearchFilters>
with HelperResponsiveLayout {
final TextEditingController communityController = TextEditingController();
final TextEditingController unitNameController = TextEditingController();
final TextEditingController productNameController = TextEditingController();
@ -32,9 +34,10 @@ class _DeviceSearchFiltersState extends State<DeviceSearchFilters> with HelperRe
children: [
_buildSearchField("Community", communityController, 200),
const SizedBox(width: 20),
_buildSearchField("Unit Name", unitNameController, 200),
_buildSearchField("Space Name", unitNameController, 200),
const SizedBox(width: 20),
_buildSearchField("Device Name / Product Name", productNameController, 300),
_buildSearchField(
"Device Name / Product Name", productNameController, 300),
const SizedBox(width: 20),
_buildSearchResetButtons(),
],
@ -48,7 +51,7 @@ class _DeviceSearchFiltersState extends State<DeviceSearchFilters> with HelperRe
communityController,
200,
),
_buildSearchField("Unit Name", unitNameController, 200),
_buildSearchField("Space Name", unitNameController, 200),
_buildSearchField(
"Device Name / Product Name",
productNameController,
@ -59,19 +62,22 @@ class _DeviceSearchFiltersState extends State<DeviceSearchFilters> with HelperRe
);
}
Widget _buildSearchField(String title, TextEditingController controller, double width) {
return StatefulTextField(
title: title,
width: width,
elevation: 2,
controller: controller,
onSubmitted: () {
context.read<DeviceManagementBloc>().add(SearchDevices(
productName: productNameController.text,
unitName: unitNameController.text,
community: communityController.text,
searchField: true));
},
Widget _buildSearchField(
String title, TextEditingController controller, double width) {
return Container(
child: StatefulTextField(
title: title,
width: width,
elevation: 2,
controller: controller,
onSubmitted: () {
context.read<DeviceManagementBloc>().add(SearchDevices(
productName: productNameController.text,
unitName: unitNameController.text,
community: communityController.text,
searchField: true));
},
),
);
}

View File

@ -6,6 +6,7 @@ import 'package:syncrow_web/pages/device_managment/garage_door/bloc/garage_door_
import 'package:syncrow_web/pages/device_managment/garage_door/helper/garage_door_helper.dart';
import 'package:syncrow_web/pages/device_managment/garage_door/models/garage_door_model.dart';
import 'package:syncrow_web/pages/device_managment/garage_door/widgets/schedule_garage_view.dart';
import 'package:syncrow_web/pages/device_managment/shared/icon_name_status_container.dart';
import 'package:syncrow_web/pages/device_managment/shared/table/report_table.dart';
import 'package:syncrow_web/pages/device_managment/shared/toggle_widget.dart';
import 'package:syncrow_web/utils/color_manager.dart';
@ -13,10 +14,7 @@ import 'package:syncrow_web/utils/constants/assets.dart';
import 'package:syncrow_web/utils/extension/build_context_x.dart';
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
import '../../main_door_sensor/view/main_door_control_view.dart';
class GarageDoorControlView extends StatelessWidget
with HelperResponsiveLayout {
class GarageDoorControlView extends StatelessWidget with HelperResponsiveLayout {
final String deviceId;
const GarageDoorControlView({required this.deviceId, super.key});
@ -24,8 +22,7 @@ class GarageDoorControlView extends StatelessWidget
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => GarageDoorBloc(deviceId: deviceId)
..add(GarageDoorInitialEvent(deviceId)),
create: (context) => GarageDoorBloc(deviceId: deviceId)..add(GarageDoorInitialEvent(deviceId)),
child: BlocBuilder<GarageDoorBloc, GarageDoorState>(
builder: (context, state) {
if (state is GarageDoorLoadingState) {
@ -37,9 +34,7 @@ class GarageDoorControlView extends StatelessWidget
garageDoorSensor: true,
onRowTap: (index) {},
onClose: () {
context
.read<GarageDoorBloc>()
.add(BackToGarageDoorGridViewEvent());
context.read<GarageDoorBloc>().add(BackToGarageDoorGridViewEvent());
},
);
} else if (state is GarageDoorLoadedState) {
@ -80,10 +75,7 @@ class GarageDoorControlView extends StatelessWidget
icon: status.switch1 ? Assets.openedDoor : Assets.closedDoor,
onTap: () {
context.read<GarageDoorBloc>().add(
GarageDoorControlEvent(
deviceId: status.uuid,
value: !status.switch1,
code: 'switch_1'),
GarageDoorControlEvent(deviceId: status.uuid, value: !status.switch1, code: 'switch_1'),
);
},
status: status.switch1,
@ -92,8 +84,7 @@ class GarageDoorControlView extends StatelessWidget
IconNameStatusContainer(
onTap: () {
context.read<GarageDoorBloc>().add(
FetchGarageDoorSchedulesEvent(
deviceId: deviceId, category: 'switch_1'),
FetchGarageDoorSchedulesEvent(deviceId: deviceId, category: 'switch_1'),
);
showDialog(
context: context,
@ -116,9 +107,7 @@ class GarageDoorControlView extends StatelessWidget
children: [
IconButton(
onPressed: () {
context
.read<GarageDoorBloc>()
.add(DecreaseGarageDoorDelayEvent(deviceId: status.uuid));
context.read<GarageDoorBloc>().add(DecreaseGarageDoorDelayEvent(deviceId: status.uuid));
},
icon: const Icon(
Icons.remove,
@ -136,8 +125,7 @@ class GarageDoorControlView extends StatelessWidget
),
Text(
'h',
style: context.textTheme.bodySmall!
.copyWith(color: ColorsManager.blackColor),
style: context.textTheme.bodySmall!.copyWith(color: ColorsManager.blackColor),
),
Text(
(status.delay.inMinutes % 60).toString().padLeft(2, '0'),
@ -148,14 +136,11 @@ class GarageDoorControlView extends StatelessWidget
),
Text(
'm',
style: context.textTheme.bodySmall!
.copyWith(color: ColorsManager.blackColor),
style: context.textTheme.bodySmall!.copyWith(color: ColorsManager.blackColor),
),
IconButton(
onPressed: () {
context
.read<GarageDoorBloc>()
.add(IncreaseGarageDoorDelayEvent(deviceId: status.uuid));
context.read<GarageDoorBloc>().add(IncreaseGarageDoorDelayEvent(deviceId: status.uuid));
},
icon: const Icon(
Icons.add,
@ -173,9 +158,7 @@ class GarageDoorControlView extends StatelessWidget
onChange: (value) {
context.read<GarageDoorBloc>().add(
GarageDoorControlEvent(
deviceId: status.uuid,
value: value ? status.delay.inSeconds : 0,
code: 'countdown_1'),
deviceId: status.uuid, value: value ? status.delay.inSeconds : 0, code: 'countdown_1'),
);
},
),
@ -184,8 +167,7 @@ class GarageDoorControlView extends StatelessWidget
name: 'Records',
icon: Assets.records,
onTap: () {
context.read<GarageDoorBloc>().add(FetchGarageDoorRecordsEvent(
code: 'switch_1', deviceId: status.uuid));
context.read<GarageDoorBloc>().add(FetchGarageDoorRecordsEvent(code: 'switch_1', deviceId: status.uuid));
},
status: false,
textColor: ColorsManager.blackColor,

View File

@ -5,6 +5,7 @@ import 'package:syncrow_web/pages/device_managment/gateway/bloc/gate_way_bloc.da
import 'package:syncrow_web/pages/device_managment/shared/device_controls_container.dart';
import 'package:syncrow_web/pages/visitor_password/model/device_model.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/extension/build_context_x.dart';
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
class GateWayControlsView extends StatelessWidget with HelperResponsiveLayout {
@ -25,25 +26,61 @@ class GateWayControlsView extends StatelessWidget with HelperResponsiveLayout {
if (state is GatewayLoadingState) {
return const Center(child: CircularProgressIndicator());
} else if (state is UpdateGatewayState) {
return GridView.builder(
padding: const EdgeInsets.symmetric(horizontal: 50),
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: isLarge || isExtraLarge
? 3
: isMedium
? 2
: 1,
mainAxisExtent: 140,
crossAxisSpacing: 12,
mainAxisSpacing: 12,
),
itemCount: state.list.length,
itemBuilder: (context, index) {
final device = state.list[index];
return _DeviceItem(device: device);
},
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: const EdgeInsets.symmetric(horizontal: 50),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
"Bluetooth Devices:",
style: context.textTheme.bodyMedium!.copyWith(
color: ColorsManager.grayColor,
),
),
const SizedBox(height: 12),
Text(
"No devices found",
style: context.textTheme.bodySmall!.copyWith(
color: ColorsManager.blackColor,
),
),
const SizedBox(height: 30),
Text(
"ZigBee Devices:",
style: context.textTheme.bodyMedium!.copyWith(
color: ColorsManager.grayColor,
),
),
],
),
),
const SizedBox(height: 12),
GridView.builder(
padding: const EdgeInsets.symmetric(horizontal: 50),
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: isLarge || isExtraLarge
? 3
: isMedium
? 2
: 1,
mainAxisExtent: 140,
crossAxisSpacing: 12,
mainAxisSpacing: 12,
),
itemCount: state.list.length,
itemBuilder: (context, index) {
final device = state.list[index];
return _DeviceItem(device: device);
},
),
],
);
} else {
return const Center(child: Text('Error fetching status'));

View File

@ -1,17 +1,15 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_model.dart';
import 'package:syncrow_web/pages/device_managment/main_door_sensor/bloc/main_door_sensor_bloc.dart';
import 'package:syncrow_web/pages/device_managment/main_door_sensor/bloc/main_door_sensor_event.dart';
import 'package:syncrow_web/pages/device_managment/main_door_sensor/bloc/main_door_sensor_state.dart';
import 'package:syncrow_web/pages/device_managment/main_door_sensor/models/main_door_status_model.dart';
import 'package:syncrow_web/pages/device_managment/main_door_sensor/widgets/notification_dialog.dart';
import 'package:syncrow_web/pages/device_managment/shared/device_controls_container.dart';
import 'package:syncrow_web/pages/device_managment/shared/icon_name_status_container.dart';
import 'package:syncrow_web/pages/device_managment/shared/table/report_table.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/constants/assets.dart';
import 'package:syncrow_web/utils/extension/build_context_x.dart';
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
class MainDoorSensorControlView extends StatelessWidget with HelperResponsiveLayout {
@ -113,71 +111,3 @@ class MainDoorSensorControlView extends StatelessWidget with HelperResponsiveLay
);
}
}
class IconNameStatusContainer extends StatelessWidget {
const IconNameStatusContainer({
super.key,
required this.name,
required this.icon,
required this.onTap,
required this.status,
required this.textColor,
this.paddingAmount = 12,
required this.isFullIcon,
});
final String name;
final String icon;
final GestureTapCallback onTap;
final bool status;
final Color textColor;
final double? paddingAmount;
final bool isFullIcon;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
child: DeviceControlsContainer(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (isFullIcon)
ClipOval(
child: SvgPicture.asset(
icon,
fit: BoxFit.contain,
),
)
else
ClipOval(
child: Container(
height: 60,
width: 60,
padding: EdgeInsets.all(paddingAmount ?? 8),
color: ColorsManager.whiteColors,
child: SvgPicture.asset(
icon,
width: 35,
height: 35,
fit: BoxFit.contain,
),
)),
const Spacer(),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 6),
child: Text(
name,
textAlign: TextAlign.start,
style: context.textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.w400,
color: textColor,
),
),
),
],
),
),
);
}
}

View File

@ -0,0 +1,792 @@
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:intl/intl.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/bloc/smart_power_event.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/bloc/smart_power_state.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/models/device_event.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/models/power_clamp_batch_model.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/models/power_clamp_model.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/view/power_chart.dart';
import 'package:syncrow_web/services/devices_mang_api.dart';
class SmartPowerBloc extends Bloc<SmartPowerEvent, SmartPowerState> {
SmartPowerBloc({required this.deviceId}) : super(SmartPowerInitial()) {
on<SmartPowerFetchDeviceEvent>(_onFetchDeviceStatus);
on<SmartPowerArrowPressedEvent>(_onArrowPressed);
on<SmartPowerFetchBatchEvent>(_onFetchBatchStatus);
on<SmartPowerPageChangedEvent>(_onPageChanged);
on<PowerBatchControlEvent>(_onBatchControl);
on<FilterRecordsByDateEvent>(_filterRecordsByDate);
on<SelectDateEvent>(checkDayMonthYearSelected);
on<SmartPowerFactoryReset>(_onFactoryReset);
}
late PowerClampModel deviceStatus;
late PowerClampBatchModel deviceBatchStatus;
final String deviceId;
Timer? _timer;
List<Map<String, dynamic>> phaseData = [];
int currentPage = 0;
List<EventDevice> record = [
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2024-10-23 11:15:43'),
value: '2286'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2024-10-23 11:15:35'),
value: '2285'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2024-10-23 11:15:29'),
value: '2284'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2024-10-23 11:15:25'),
value: '2285'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2024-10-23 11:15:21'),
value: '2284'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2024-10-23 11:15:17'),
value: '2285'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2024-10-23 11:15:07'),
value: '2286'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2024-10-23 11:14:47'),
value: '2285'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2024-10-23 11:14:40'),
value: '2284'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2024-10-23 11:14:23'),
value: '2285'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2024-10-23 11:14:13'),
value: '2284'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-10-23 11:15:43'),
value: '2286'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-10-23 11:15:35'),
value: '2285'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-10-23 11:15:29'),
value: '2284'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-10-23 11:15:25'),
value: '2285'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-10-23 11:15:21'),
value: '2284'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-10-23 11:15:17'),
value: '2285'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-10-23 11:15:07'),
value: '2286'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-10-23 11:14:47'),
value: '2285'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-10-23 11:14:40'),
value: '2284'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-10-23 11:14:23'),
value: '2285'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-10-23 11:14:13'),
value: '2284'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-23 11:15:43'),
value: '2286'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-23 11:15:35'),
value: '2285'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-23 11:15:29'),
value: '2284'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-23 11:15:25'),
value: '2285'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-23 11:15:21'),
value: '2284'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-23 11:15:17'),
value: '2285'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-23 11:15:07'),
value: '2286'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-23 11:14:47'),
value: '2285'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-23 11:14:40'),
value: '2284'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-23 11:14:23'),
value: '2285'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-23 11:14:13'),
value: '2284'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-11 11:15:43'),
value: '2286'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-11 11:15:35'),
value: '2285'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-12 11:15:29'),
value: '2284'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-13 11:15:25'),
value: '2285'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-14 11:15:21'),
value: '2284'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-15 11:15:17'),
value: '2285'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-16 11:15:07'),
value: '2286'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-17 11:14:47'),
value: '2285'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-18 11:14:40'),
value: '2284'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-19 11:14:23'),
value: '2285'),
EventDevice(
code: 'VoltageA',
eventTime: DateTime.parse('2023-02-20 11:14:13'),
value: '2284'),
];
FutureOr<void> _onFetchDeviceStatus(
SmartPowerFetchDeviceEvent event, Emitter<SmartPowerState> emit) async {
emit(SmartPowerLoading());
try {
var status =
await DevicesManagementApi().getPowerClampInfo(event.deviceId);
deviceStatus = PowerClampModel.fromJson(status);
phaseData = [
{
'name': 'Phase A',
'voltage': '${deviceStatus.status.phaseA.dataPoints[0].value / 10} V',
'current': '${deviceStatus.status.phaseA.dataPoints[1].value / 10} A',
'activePower': '${deviceStatus.status.phaseA.dataPoints[2].value} W',
'powerFactor': '${deviceStatus.status.phaseA.dataPoints[3].value}',
},
{
'name': 'Phase B',
'voltage': '${deviceStatus.status.phaseB.dataPoints[0].value / 10} V',
'current': '${deviceStatus.status.phaseB.dataPoints[1].value / 10} A',
'activePower': '${deviceStatus.status.phaseB.dataPoints[2].value} W',
'powerFactor': '${deviceStatus.status.phaseB.dataPoints[3].value}',
},
{
'name': 'Phase C',
'voltage': '${deviceStatus.status.phaseC.dataPoints[0].value / 10} V',
'current': '${deviceStatus.status.phaseC.dataPoints[1].value / 10} A',
'activePower': '${deviceStatus.status.phaseC.dataPoints[2].value} W',
'powerFactor': '${deviceStatus.status.phaseC.dataPoints[3].value}',
},
];
emit(GetDeviceStatus());
} catch (e) {
emit(SmartPowerError(e.toString()));
}
}
FutureOr<void> _onArrowPressed(
SmartPowerArrowPressedEvent event, Emitter<SmartPowerState> emit) {
currentPage = (currentPage + event.direction + 4) % 4;
emit(SmartPowerStatusLoaded(deviceStatus, currentPage));
emit(GetDeviceStatus());
}
FutureOr<void> _onPageChanged(
SmartPowerPageChangedEvent event, Emitter<SmartPowerState> emit) {
currentPage = event.page;
emit(SmartPowerStatusLoaded(deviceStatus, currentPage));
emit(GetDeviceStatus());
}
Future<void> _onFactoryReset(
SmartPowerFactoryReset event, Emitter<SmartPowerState> emit) async {
emit(SmartPowerLoading());
try {
final response = await DevicesManagementApi().factoryReset(
event.factoryReset,
event.deviceId,
);
if (response) {
emit(SmartPowerInitial());
} else {
emit(SmartPowerError('Factory reset failed'));
}
} catch (e) {
emit(SmartPowerError(e.toString()));
}
}
Future<void> _onBatchControl(
PowerBatchControlEvent event, Emitter<SmartPowerState> emit) async {
final oldValue = deviceStatus.status;
_updateLocalValue(event.code, event.value);
// emit(WaterLeakBatchStatusLoadedState(deviceStatus!));
await _runDebounce(
deviceId: event.deviceIds,
code: event.code,
value: event.value,
oldValue: oldValue,
emit: emit,
isBatch: true,
);
}
Future<void> _onFetchBatchStatus(
SmartPowerFetchBatchEvent event, Emitter<SmartPowerState> emit) async {
emit(SmartPowerLoading());
try {
final response =
await DevicesManagementApi().getPowerStatus(event.devicesIds);
PowerClampBatchModel deviceStatus =
PowerClampBatchModel.fromJson(response);
emit(SmartPowerLoadBatchControll(deviceStatus));
} catch (e) {
debugPrint('=========error====$e');
emit(SmartPowerError(e.toString()));
}
}
Future<void> _runDebounce({
required dynamic deviceId,
required String code,
required dynamic value,
required dynamic oldValue,
required Emitter<SmartPowerState> emit,
required bool isBatch,
}) async {
late String id;
if (deviceId is List) {
id = deviceId.first;
} else {
id = deviceId;
}
if (_timer != null) {
_timer!.cancel();
}
_timer = Timer(const Duration(milliseconds: 500), () async {
try {
late bool response;
if (isBatch) {
response = await DevicesManagementApi()
.deviceBatchControl(deviceId, code, value);
} else {
response = await DevicesManagementApi()
.deviceControl(deviceId, Status(code: code, value: value));
}
if (!response) {
_revertValueAndEmit(id, code, oldValue, emit);
}
} catch (e) {
_revertValueAndEmit(id, code, oldValue, emit);
}
});
}
void _updateLocalValue(String code, dynamic value) {
if (code == 'watersensor_state') {
deviceStatus = deviceStatus.copyWith(statusPower: value);
} else if (code == 'battery_percentage') {
deviceStatus = deviceStatus.copyWith(statusPower: value);
}
}
void _revertValueAndEmit(String deviceId, String code, dynamic oldValue,
Emitter<SmartPowerState> emit) {
_updateLocalValue(code, oldValue);
emit(SmartPowerLoadBatchControll(deviceBatchStatus));
}
@override
Future<void> close() {
_timer?.cancel();
return super.close();
}
List<EventDevice> filteredRecords = [];
int currentIndex = 0;
final List<String> views = ['Day', 'Month', 'Year'];
Widget dateSwitcher() {
void switchView(int direction) {
currentIndex = (currentIndex + direction + views.length) % views.length;
}
return StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
return Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
icon: const Icon(Icons.arrow_left),
onPressed: () {
setState(() {
switchView(-1);
});
},
),
Text(
views[currentIndex],
style: const TextStyle(fontSize: 15, fontWeight: FontWeight.w500),
),
IconButton(
icon: const Icon(Icons.arrow_right),
onPressed: () {
setState(() {
switchView(1);
});
},
),
],
);
},
);
}
Future<DateTime?> selectMonthAndYear(BuildContext context) async {
int selectedYear = DateTime.now().year;
int selectedMonth = DateTime.now().month;
FixedExtentScrollController yearController =
FixedExtentScrollController(initialItem: selectedYear - 1905);
FixedExtentScrollController monthController =
FixedExtentScrollController(initialItem: selectedMonth - 1);
return await showDialog<DateTime>(
context: context,
builder: (BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
),
height: 350,
width: 350,
child: Column(
children: [
const Padding(
padding: EdgeInsets.all(16.0),
child: Text(
'Select Month and Year',
style:
TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
),
const Divider(),
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Spacer(),
Expanded(
child: ListWheelScrollView.useDelegate(
controller: yearController,
overAndUnderCenterOpacity: 0.2,
itemExtent: 50,
onSelectedItemChanged: (index) {
selectedYear = 1905 + index;
},
childDelegate: ListWheelChildBuilderDelegate(
builder: (context, index) {
return Center(
child: Text(
(1905 + index).toString(),
style: const TextStyle(fontSize: 18),
),
);
},
childCount: 200,
),
),
),
Expanded(
flex: 2,
child: ListWheelScrollView.useDelegate(
controller: monthController,
overAndUnderCenterOpacity: 0.2,
itemExtent: 50,
onSelectedItemChanged: (index) {
selectedMonth = index + 1;
},
childDelegate: ListWheelChildBuilderDelegate(
builder: (context, index) {
return Center(
child: Text(
DateFormat.MMMM()
.format(DateTime(0, index + 1)),
style: const TextStyle(fontSize: 18),
),
);
},
childCount: 12,
),
),
),
const Spacer(),
],
),
),
const Divider(),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0, vertical: 8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
TextButton(
child: const Text('Cancel'),
onPressed: () {
Navigator.of(context).pop();
},
),
TextButton(
child: const Text('OK'),
onPressed: () {
final selectedDateTime =
DateTime(selectedYear, selectedMonth);
Navigator.of(context).pop(selectedDateTime);
},
),
],
),
),
],
),
),
],
);
},
);
}
Future<DateTime?> selectYear(BuildContext context) async {
int selectedYear = DateTime.now().year;
FixedExtentScrollController yearController =
FixedExtentScrollController(initialItem: selectedYear - 1905);
return await showDialog<DateTime>(
context: context,
builder: (BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
),
height: 350,
width: 350,
child: Column(
children: [
const Padding(
padding: EdgeInsets.all(16.0),
child: Text(
'Select Year',
style:
TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
),
const Divider(),
Expanded(
child: ListWheelScrollView.useDelegate(
controller: yearController,
overAndUnderCenterOpacity: 0.2,
itemExtent: 50,
onSelectedItemChanged: (index) {
selectedYear = 1905 + index;
},
childDelegate: ListWheelChildBuilderDelegate(
builder: (context, index) {
return Center(
child: Text(
(1905 + index).toString(),
style: const TextStyle(fontSize: 18),
),
);
},
childCount: 200,
),
),
),
const Divider(),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0, vertical: 8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
TextButton(
child: const Text('Cancel'),
onPressed: () {
Navigator.of(context).pop();
},
),
TextButton(
child: const Text('OK'),
onPressed: () {
final selectedDateTime = DateTime(selectedYear);
Navigator.of(context).pop(selectedDateTime);
},
),
],
),
),
],
),
),
],
);
},
);
}
Future<DateTime?> dayMonthYearPicker({
required BuildContext context,
}) async {
DateTime selectedDate = DateTime.now();
return await showDialog<DateTime>(
context: context,
builder: (BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
height: 350,
width: 350,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
),
child: Column(
children: [
Expanded(
child: CupertinoDatePicker(
mode: CupertinoDatePickerMode.date,
initialDateTime: DateTime.now(),
minimumYear: 1900,
maximumYear: DateTime.now().year,
onDateTimeChanged: (DateTime newDateTime) {
selectedDate = newDateTime;
},
),
),
const Divider(),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0, vertical: 8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
TextButton(
child: const Text('Cancel'),
onPressed: () {
Navigator.of(context).pop();
},
),
TextButton(
child: const Text('OK'),
onPressed: () {
Navigator.of(context).pop(selectedDate);
},
),
],
),
),
],
),
),
],
);
},
);
}
DateTime? dateTime = DateTime.now();
String formattedDate = DateFormat('yyyy/MM/dd').format(DateTime.now());
void checkDayMonthYearSelected(
SelectDateEvent event, Emitter<SmartPowerState> emit) async {
Future<DateTime?> Function(BuildContext context)? dateSelector;
String dateFormat;
switch (currentIndex) {
case 0:
dateSelector = (context) {
return dayMonthYearPicker(context: context);
};
dateFormat = 'yyyy/MM/dd';
break;
case 1:
dateSelector = (context) {
return selectMonthAndYear(context);
};
dateFormat = 'yyyy-MM';
break;
case 2:
dateSelector = (context) {
return selectYear(context);
};
dateFormat = 'yyyy';
break;
default:
return;
}
Future.delayed(const Duration(milliseconds: 500), () {
emit(FakeState());
});
// Use the selected picker
await dateSelector(event.context).then((newDate) {
if (newDate.toString() == 'null') {
emit(GetDeviceStatus());
} else {
dateTime = newDate;
add(FilterRecordsByDateEvent(
selectedDate: newDate!,
viewType: views[currentIndex],
));
}
// formattedDate = newDate.toString();
});
emit(FilterRecordsState(filteredRecords: energyDataList));
}
List<EnergyData> energyDataList = [];
void _filterRecordsByDate(
FilterRecordsByDateEvent event, Emitter<SmartPowerState> emit) {
// emit(SmartPowerLoading());
if (event.viewType == 'Year') {
formattedDate = event.selectedDate.year.toString();
filteredRecords = record
.where((record) => record.eventTime!.year == event.selectedDate.year)
.toList();
} else if (event.viewType == 'Month') {
formattedDate =
"${event.selectedDate.year.toString()}-${getMonthShortName(event.selectedDate.month)}";
filteredRecords = record
.where((record) =>
record.eventTime!.year == event.selectedDate.year &&
record.eventTime!.month == event.selectedDate.month)
.toList();
} else if (event.viewType == 'Day') {
formattedDate =
"${event.selectedDate.year.toString()}-${getMonthShortName(event.selectedDate.month)}-${event.selectedDate.day}";
filteredRecords = record
.where((record) =>
record.eventTime!.year == event.selectedDate.year &&
record.eventTime!.month == event.selectedDate.month &&
record.eventTime!.day == event.selectedDate.day)
.toList();
}
selectDateRange();
energyDataList = filteredRecords.map((eventDevice) {
return EnergyData(
event.viewType == 'Year'
? getMonthShortName(
int.tryParse(DateFormat('MM').format(eventDevice.eventTime!))!)
: event.viewType == 'Month'
? DateFormat('yyyy/MM/dd').format(eventDevice.eventTime!)
: DateFormat('HH:mm:ss').format(eventDevice.eventTime!),
double.parse(eventDevice.value!),
);
}).toList();
emit(FilterRecordsState(filteredRecords: energyDataList));
}
String getMonthShortName(int month) {
final date = DateTime(0, month);
return DateFormat.MMM().format(date);
}
String endChartDate = '';
void selectDateRange() async {
DateTime startDate = dateTime!;
DateTime endDate = DateTime(startDate.year, startDate.month + 1, 1)
.subtract(Duration(days: 1));
String formattedEndDate = DateFormat('dd/MM/yyyy').format(endDate);
endChartDate = ' - $formattedEndDate';
}
}

View File

@ -0,0 +1,115 @@
import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/factory_reset_model.dart';
class SmartPowerEvent extends Equatable {
@override
List<Object?> get props => [];
}
class SmartPowerFetchDeviceEvent extends SmartPowerEvent {
final String deviceId;
SmartPowerFetchDeviceEvent(this.deviceId);
@override
List<Object> get props => [deviceId];
}
class SmartPowerControl extends SmartPowerEvent {
final String deviceId;
final String code;
final bool value;
SmartPowerControl(
{required this.deviceId, required this.code, required this.value});
@override
List<Object> get props => [deviceId, code, value];
}
class SmartPowerFetchBatchEvent extends SmartPowerEvent {
final List<String> devicesIds;
SmartPowerFetchBatchEvent(this.devicesIds);
@override
List<Object> get props => [devicesIds];
}
class SmartPowerBatchControl extends SmartPowerEvent {
final List<String> devicesIds;
final String code;
final bool value;
SmartPowerBatchControl(
{required this.devicesIds, required this.code, required this.value});
@override
List<Object> get props => [devicesIds, code, value];
}
class SmartPowerFactoryReset extends SmartPowerEvent {
final String deviceId;
final FactoryResetModel factoryReset;
SmartPowerFactoryReset({required this.deviceId, required this.factoryReset});
@override
List<Object> get props => [deviceId, factoryReset];
}
class PageChangedEvent extends SmartPowerEvent {
final int newPage;
PageChangedEvent(this.newPage);
}
class PageArrowPressedEvent extends SmartPowerEvent {
final int direction;
PageArrowPressedEvent(this.direction);
}
class SmartPowerArrowPressedEvent extends SmartPowerEvent {
final int direction;
SmartPowerArrowPressedEvent(this.direction);
}
class SmartPowerPageChangedEvent extends SmartPowerEvent {
final int page;
SmartPowerPageChangedEvent(this.page);
}
class SelectDateEvent extends SmartPowerEvent {
BuildContext context;
SelectDateEvent({required this.context});
}
class FilterRecordsByDateEvent extends SmartPowerEvent {
final DateTime selectedDate;
final String viewType; // 'Day', 'Month', 'Year'
FilterRecordsByDateEvent(
{required this.selectedDate, required this.viewType});
}
class FetchPowerClampBatchStatusEvent extends SmartPowerEvent {
final List<String> deviceIds;
FetchPowerClampBatchStatusEvent(this.deviceIds);
@override
List<Object> get props => [deviceIds];
}class PowerBatchControlEvent extends SmartPowerEvent {
final List<String> deviceIds;
final String code;
final dynamic value;
PowerBatchControlEvent({
required this.deviceIds,
required this.code,
required this.value,
});
@override
List<Object> get props => [deviceIds, code, value];
}

View File

@ -0,0 +1,77 @@
import 'package:equatable/equatable.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/models/power_clamp_batch_model.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/models/power_clamp_model.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/view/power_chart.dart';
class SmartPowerState extends Equatable {
@override
List<Object?> get props => [];
}
class SmartPowerInitial extends SmartPowerState {}
class SmartPowerLoading extends SmartPowerState {}
class GetDeviceStatus extends SmartPowerState {}
//GetDeviceStatus
class SmartPowerLoadBatchControll extends SmartPowerState {
final PowerClampBatchModel status;
SmartPowerLoadBatchControll(this.status);
@override
List<Object> get props => [status];
}
class DateSelectedState extends SmartPowerState {}
class FakeState extends SmartPowerState {}
class SmartPowerStatusLoaded extends SmartPowerState {
final PowerClampModel deviceStatus;
final int currentPage;
SmartPowerStatusLoaded(this.deviceStatus, this.currentPage);
}
class SmartPowerError extends SmartPowerState {
final String message;
SmartPowerError(this.message);
@override
List<Object> get props => [message];
}
class SmartPowerControlError extends SmartPowerState {
final String message;
SmartPowerControlError(this.message);
@override
List<Object> get props => [message];
}
class SmartPowerBatchControlError extends SmartPowerState {
final String message;
SmartPowerBatchControlError(this.message);
@override
List<Object> get props => [message];
}
class SmartPowerBatchStatusLoaded extends SmartPowerState {
final List<String> status;
SmartPowerBatchStatusLoaded(this.status);
@override
List<Object> get props => [status];
}
class FilterRecordsState extends SmartPowerState {
final List<EnergyData> filteredRecords;
FilterRecordsState({required this.filteredRecords});
}

View File

@ -0,0 +1,23 @@
class EventDevice {
final String? code;
final DateTime? eventTime;
final String? value;
EventDevice({
this.code,
this.eventTime,
this.value,
});
EventDevice.fromJson(Map<String, dynamic> json)
: code = json['code'] as String?,
eventTime = json['eventTime'] ,
value = json['value'] as String?;
Map<String, dynamic> toJson() => {
'code': code,
'eventTime': eventTime,
'value': value,
};
}

View File

@ -0,0 +1,49 @@
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
abstract class PowerClampModel1 {
String get productUuid;
String get productType;
}
class PowerClampBatchModel extends PowerClampModel1 {
@override
final String productUuid;
@override
final String productType;
final List<Status> status;
PowerClampBatchModel({
required this.productUuid,
required this.productType,
required this.status,
});
factory PowerClampBatchModel.fromJson(Map<String, dynamic> json) {
String productUuid = json['productUuid'] ?? '';
String productType = json['productType'] ?? '';
List<Status> statusList = [];
if (json['status'] != null && json['status'] is List) {
statusList =
(json['status'] as List).map((e) => Status.fromJson(e)).toList();
}
return PowerClampBatchModel(
productUuid: productUuid,
productType: productType,
status: statusList,
);
}
PowerClampBatchModel copyWith({
String? productUuid,
String? productType,
List<Status>? status,
}) {
return PowerClampBatchModel(
productUuid: productUuid ?? this.productUuid,
productType: productType ?? this.productType,
status: status ?? this.status,
);
}
}

View File

@ -0,0 +1,98 @@
// PowerClampModel class to represent the response
class PowerClampModel {
String productUuid;
String productType;
PowerStatus status;
PowerClampModel({
required this.productUuid,
required this.productType,
required this.status,
});
factory PowerClampModel.fromJson(Map<String, dynamic> json) {
return PowerClampModel(
productUuid: json['productUuid'],
productType: json['productType'],
status: PowerStatus.fromJson(json['status']),
);
}
PowerClampModel copyWith({
String? productUuid,
String? productType,
PowerStatus? statusPower,
}) {
return PowerClampModel(
productUuid: productUuid ?? this.productUuid,
productType: productType ?? this.productType,
status: statusPower ?? this.status,
);
}
}
class PowerStatus {
Phase phaseA;
Phase phaseB;
Phase phaseC;
Phase general;
PowerStatus({
required this.phaseA,
required this.phaseB,
required this.phaseC,
required this.general,
});
factory PowerStatus.fromJson(Map<String, dynamic> json) {
return PowerStatus(
phaseA: Phase.fromJson(json['phaseA']),
phaseB: Phase.fromJson(json['phaseB']),
phaseC: Phase.fromJson(json['phaseC']),
general: Phase.fromJson(json['general']
// List<DataPoint>.from(
// json['general'].map((x) => DataPoint.fromJson(x))),
));
}
}
class Phase {
List<DataPoint> dataPoints;
Phase({required this.dataPoints});
factory Phase.fromJson(List<dynamic> json) {
return Phase(
dataPoints: json.map((x) => DataPoint.fromJson(x)).toList(),
);
}
}
class DataPoint {
dynamic code;
dynamic customName;
dynamic dpId;
dynamic time;
dynamic type;
dynamic value;
DataPoint({
required this.code,
required this.customName,
required this.dpId,
required this.time,
required this.type,
required this.value,
});
factory DataPoint.fromJson(Map<String, dynamic> json) {
return DataPoint(
code: json['code'],
customName: json['customName'],
dpId: json['dpId'],
time: json['time'],
type: json['type'],
value: json['value'],
);
}
}

View File

@ -0,0 +1,124 @@
import 'package:flutter/material.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/view/power_info_card.dart';
import 'package:syncrow_web/utils/constants/assets.dart';
class PhaseWidget extends StatefulWidget {
final List<Map<String, dynamic>> phaseData;
PhaseWidget({
required this.phaseData,
});
@override
_PhaseWidgetState createState() => _PhaseWidgetState();
}
class _PhaseWidgetState extends State<PhaseWidget> {
int _selectedPhaseIndex = 0;
@override
Widget build(BuildContext context) {
return Column(
children: [
SizedBox(height: 10),
Row(
children: List.generate(widget.phaseData.length, (index) {
return InkWell(
onTap: () {
setState(() {
_selectedPhaseIndex = index;
});
},
child: Padding(
padding: const EdgeInsets.only(left: 10, right: 10),
child: Text(
widget.phaseData[index]['name'],
style: TextStyle(
fontWeight: FontWeight.bold,
color: _selectedPhaseIndex == index
? Colors.black
: Colors.grey,
),
),
),
);
}),
),
SizedBox(height: 10),
_selectedPhaseIndex == 0
? phase(
totalActive: widget.phaseData[0]['activePower'] ?? '0',
totalCurrent: widget.phaseData[0]['current'] ?? '0',
totalFactor: widget.phaseData[0]['powerFactor'] ?? '0',
totalVoltage: widget.phaseData[0]['voltage'] ?? '0',
)
: _selectedPhaseIndex == 1
? phase(
totalActive: widget.phaseData[1]['activePower'] ?? '0',
totalCurrent: widget.phaseData[1]['current'] ?? '0',
totalFactor: widget.phaseData[1]['powerFactor'] ?? '0',
totalVoltage: widget.phaseData[1]['voltage'] ?? '0',
)
: phase(
totalActive: widget.phaseData[2]['activePower'] ?? '0',
totalCurrent: widget.phaseData[2]['current'] ?? '0',
totalFactor: widget.phaseData[2]['powerFactor'] ?? '0',
totalVoltage: widget.phaseData[2]['voltage'] ?? '0',
),
],
);
}
}
class phase extends StatelessWidget {
const phase({
super.key,
required this.totalVoltage,
required this.totalCurrent,
required this.totalActive,
required this.totalFactor,
});
final String totalVoltage;
final String totalCurrent;
final String totalActive;
final String totalFactor;
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
PowerClampInfoCard(
iconPath: Assets.voltageIcon,
title: 'Voltage',
value: totalVoltage,
unit: '',
),
PowerClampInfoCard(
iconPath: Assets.voltMeterIcon,
title: 'Current',
value: totalCurrent,
unit: '',
),
PowerClampInfoCard(
iconPath: Assets.powerActiveIcon,
title: 'Active Power',
value: totalActive,
unit: '',
),
PowerClampInfoCard(
iconPath: Assets.speedoMeter,
title: 'Power Factor',
value: totalFactor,
unit: '',
),
],
),
],
),
);
}
}

View File

@ -0,0 +1,281 @@
import 'package:flutter/material.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:syncrow_web/utils/color_manager.dart';
class EnergyConsumptionPage extends StatefulWidget {
final List<dynamic> chartData;
final double totalConsumption;
final String date;
final String formattedDate;
final Widget widget;
final Function()? onTap;
EnergyConsumptionPage({
required this.chartData,
required this.totalConsumption,
required this.date,
required this.widget,
required this.onTap,
required this.formattedDate,
});
@override
_EnergyConsumptionPageState createState() => _EnergyConsumptionPageState();
}
class _EnergyConsumptionPageState extends State<EnergyConsumptionPage> {
late List<dynamic> _chartData;
@override
void initState() {
_chartData = widget.chartData;
super.initState();
}
@override
Widget build(BuildContext context) {
return Container(
color: ColorsManager.whiteColors,
child: Column(
children: [
const Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'Total Consumption',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 20,
),
),
Text(
'8623.20 kWh',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 20,
),
),
],
),
const Row(
children: [
Text(
'Energy consumption',
style: TextStyle(
color: ColorsManager.grayColor,
fontWeight: FontWeight.w700,
fontSize: 12,
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
widget.formattedDate,
style: const TextStyle(
color: ColorsManager.grayColor,
fontWeight: FontWeight.w400,
fontSize: 8,
),
),
const Text(
'1000.00 kWh',
style: TextStyle(
color: ColorsManager.grayColor,
fontWeight: FontWeight.w400,
fontSize: 8,
),
),
],
),
Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 10),
child: SizedBox(
height: MediaQuery.of(context).size.height * 0.11,
child: LineChart(
LineChartData(
lineTouchData: LineTouchData(
handleBuiltInTouches: true,
touchSpotThreshold: 2,
getTouchLineEnd: (barData, spotIndex) {
return 10.0;
},
touchTooltipData: LineTouchTooltipData(
getTooltipColor: (touchTooltipItem) => Colors.white,
tooltipRoundedRadius: 10.0,
tooltipPadding: const EdgeInsets.all(8.0),
tooltipBorder: const BorderSide(
color: ColorsManager.grayColor, width: 1),
getTooltipItems: (List<LineBarSpot> touchedSpots) {
return touchedSpots.map((spot) {
return LineTooltipItem(
'${spot.x},\n ${spot.y.toStringAsFixed(2)} kWh',
const TextStyle(
color: Colors.blue,
fontWeight: FontWeight.bold,
fontSize: 12,
),
);
}).toList();
},
)),
titlesData: FlTitlesData(
bottomTitles: const AxisTitles(
sideTitles: SideTitles(
showTitles: false,
),
),
leftTitles: const AxisTitles(
sideTitles: SideTitles(
showTitles: false,
),
),
rightTitles: const AxisTitles(
sideTitles: SideTitles(
showTitles: false,
),
),
topTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: false,
reservedSize: 70,
getTitlesWidget: (value, meta) {
int index = value.toInt();
if (index >= 0 && index < _chartData.length) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: RotatedBox(
quarterTurns: -1,
child: Text(_chartData[index].time,
style: TextStyle(fontSize: 10)),
),
);
}
return const SizedBox.shrink();
},
),
),
),
gridData: FlGridData(
show: true,
drawVerticalLine: true,
horizontalInterval: 1,
verticalInterval: 1,
getDrawingVerticalLine: (value) {
return FlLine(
color: Colors.grey.withOpacity(0.2),
dashArray: [8, 8],
strokeWidth: 1,
);
},
getDrawingHorizontalLine: (value) {
return FlLine(
color: Colors.grey.withOpacity(0.2),
dashArray: [5, 5],
strokeWidth: 1,
);
},
drawHorizontalLine: false,
),
lineBarsData: [
LineChartBarData(
preventCurveOvershootingThreshold: 0.1,
curveSmoothness: 0.5,
preventCurveOverShooting: true,
aboveBarData: BarAreaData(),
spots: _chartData
.asMap()
.entries
.map((entry) => FlSpot(entry.key.toDouble(),
entry.value.consumption))
.toList(),
isCurved: true,
color: ColorsManager.primaryColor.withOpacity(0.6),
show: true,
shadow: const Shadow(color: Colors.black12),
belowBarData: BarAreaData(
show: true,
gradient: LinearGradient(
colors: [
ColorsManager.primaryColor.withOpacity(0.5),
Colors.blue.withOpacity(0.1),
],
begin: Alignment.center,
end: Alignment.bottomCenter,
),
),
dotData: const FlDotData(
show: false,
),
isStrokeCapRound: true,
barWidth: 2,
),
],
borderData: FlBorderData(
show: false,
border: Border.all(
color: Color(0xff023DFE).withOpacity(0.7),
width: 10,
),
),
),
),
),
),
Padding(
padding: const EdgeInsets.all(5.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Container(
decoration: BoxDecoration(
color: ColorsManager.graysColor,
borderRadius: BorderRadius.circular(10),
),
child: Container(child: widget.widget),
),
),
const SizedBox(
width: 20,
),
Expanded(
child: Container(
padding: const EdgeInsets.all(5.0),
decoration: BoxDecoration(
color: ColorsManager.graysColor,
borderRadius: BorderRadius.circular(10),
),
child: InkWell(
onTap: widget.onTap,
child: Center(
child: SizedBox(
child: Padding(
padding: const EdgeInsets.all(5),
child: Text(widget.date),
),
),
),
),
),
),
],
),
)
],
),
],
),
);
}
}
class EnergyData {
EnergyData(this.time, this.consumption);
final String time;
final double consumption;
}

View File

@ -0,0 +1,66 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/factory_reset_model.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/bloc/smart_power_bloc.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/bloc/smart_power_event.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/bloc/smart_power_state.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/models/power_clamp_batch_model.dart';
import 'package:syncrow_web/pages/device_managment/shared/batch_control/factory_reset.dart';
import 'package:syncrow_web/pages/device_managment/shared/batch_control/firmware_update.dart';
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
class PowerClampBatchControlView extends StatelessWidget
with HelperResponsiveLayout {
final List<String> deviceIds;
const PowerClampBatchControlView({Key? key, required this.deviceIds})
: super(key: key);
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => SmartPowerBloc(deviceId: deviceIds.first)
..add(SmartPowerFetchBatchEvent(deviceIds)),
child: BlocBuilder<SmartPowerBloc, SmartPowerState>(
builder: (context, state) {
if (state is SmartPowerLoading) {
return const Center(child: CircularProgressIndicator());
} else if (state is SmartPowerLoadBatchControll) {
return _buildStatusControls(context, state.status);
} else if (state is SmartPowerError) {
return Center(child: Text('Error: ${state.message}'));
} else {
return const Center(child: CircularProgressIndicator());
}
},
),
);
}
Widget _buildStatusControls(
BuildContext context, PowerClampBatchModel status) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: 170,
// height: 140,
child: FirmwareUpdateWidget(deviceId: deviceIds.first, version: 2)),
const SizedBox(
width: 12,
),
SizedBox(
width: 170,
height: 140,
child: FactoryResetWidget(
callFactoryReset: () {
context.read<SmartPowerBloc>().add(SmartPowerFactoryReset(
deviceId: deviceIds.first,
factoryReset: FactoryResetModel(devicesUuid: deviceIds)));
},
),
),
],
);
}
}

View File

@ -0,0 +1,81 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_web/utils/color_manager.dart';
class PowerClampInfoCard extends StatelessWidget {
final String iconPath;
final String title;
final String value;
final String unit;
const PowerClampInfoCard({
Key? key,
required this.iconPath,
required this.title,
required this.value,
required this.unit,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Expanded(
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 6),
decoration: BoxDecoration(
color: ColorsManager.whiteColors,
borderRadius: BorderRadius.circular(20),
),
height: 55,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
const SizedBox(
width: 16,
),
SvgPicture.asset(
iconPath,
fit: BoxFit.fill,
),
const SizedBox(
width: 18,
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
title,
style: const TextStyle(
fontSize: 8,
fontWeight: FontWeight.w400,
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
value,
style: const TextStyle(
fontSize: 15,
fontWeight: FontWeight.w700,
),
),
Text(
unit,
style: const TextStyle(
fontSize: 15,
fontWeight: FontWeight.w700,
),
),
],
),
],
)
],
),
),
);
}
}

View File

@ -0,0 +1,279 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/bloc/smart_power_bloc.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/bloc/smart_power_event.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/bloc/smart_power_state.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/view/phase_widget.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/view/power_chart.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/view/power_info_card.dart';
import 'package:syncrow_web/pages/device_managment/shared/device_controls_container.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/constants/assets.dart';
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
//Smart Power Clamp
class SmartPowerDeviceControl extends StatelessWidget
with HelperResponsiveLayout {
final String deviceId;
const SmartPowerDeviceControl({super.key, required this.deviceId});
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => SmartPowerBloc(deviceId: deviceId)
..add(SmartPowerFetchDeviceEvent(deviceId)),
child: BlocBuilder<SmartPowerBloc, SmartPowerState>(
builder: (context, state) {
final _blocProvider = BlocProvider.of<SmartPowerBloc>(context);
if (state is SmartPowerLoading) {
return const Center(child: CircularProgressIndicator());
} else if (state is FakeState) {
return _buildStatusControls(
currentPage: _blocProvider.currentPage,
context: context,
blocProvider: _blocProvider,
);
} else if (state is GetDeviceStatus) {
return _buildStatusControls(
currentPage: _blocProvider.currentPage,
context: context,
blocProvider: _blocProvider,
);
} else if (state is FilterRecordsState) {
return _buildStatusControls(
currentPage: _blocProvider.currentPage,
context: context,
blocProvider: _blocProvider,
);
}
return const Center(child: CircularProgressIndicator());
// }
},
),
);
}
Widget _buildStatusControls({
required BuildContext context,
required SmartPowerBloc blocProvider,
required int currentPage,
}) {
PageController _pageController = PageController(initialPage: currentPage);
return Container(
padding: const EdgeInsets.symmetric(horizontal: 50),
child: DeviceControlsContainer(
child: Column(
children: [
const Row(
children: [
Text(
'Live',
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.w700,
color: ColorsManager.textPrimaryColor),
),
],
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
PowerClampInfoCard(
iconPath: Assets.powerActiveIcon,
title: 'Active',
value: blocProvider
.deviceStatus.status.general.dataPoints[2].value
.toString(),
unit: '',
),
PowerClampInfoCard(
iconPath: Assets.voltMeterIcon,
title: 'Current',
value: blocProvider
.deviceStatus.status.general.dataPoints[1].value
.toString(),
unit: ' A',
),
PowerClampInfoCard(
iconPath: Assets.frequencyIcon,
title: 'Frequency',
value: blocProvider
.deviceStatus.status.general.dataPoints[4].value
.toString(),
unit: ' Hz',
),
],
),
),
PhaseWidget(
phaseData: blocProvider.phaseData,
),
const SizedBox(
height: 10,
),
Container(
padding: const EdgeInsets.only(
top: 10,
left: 20,
right: 20,
bottom: 10,
),
decoration: BoxDecoration(
color: ColorsManager.whiteColors,
borderRadius: BorderRadius.circular(20),
),
height: 300,
child: Column(
children: [
Container(
decoration: BoxDecoration(
color: ColorsManager.graysColor,
borderRadius: BorderRadius.circular(20),
),
height: 50,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
icon: const Icon(Icons.arrow_left),
onPressed: () {
blocProvider.add(SmartPowerArrowPressedEvent(-1));
_pageController.previousPage(
duration: const Duration(milliseconds: 300),
curve: Curves.easeInOut,
);
},
),
Text(
currentPage == 0
? 'Total'
: currentPage == 1
? 'Phase A'
: currentPage == 2
? 'Phase B'
: 'Phase C',
style: const TextStyle(fontSize: 18),
),
IconButton(
icon: const Icon(Icons.arrow_right),
onPressed: () {
blocProvider.add(SmartPowerArrowPressedEvent(1));
_pageController.nextPage(
duration: const Duration(milliseconds: 300),
curve: Curves.easeInOut,
);
},
),
],
),
),
const SizedBox(
height: 5,
),
Expanded(
flex: 2,
child: PageView(
controller: _pageController,
onPageChanged: (int page) {
blocProvider.add(SmartPowerPageChangedEvent(page));
},
physics: const NeverScrollableScrollPhysics(),
children: [
EnergyConsumptionPage(
formattedDate:
'${blocProvider.dateTime!.day}/${blocProvider.dateTime!.month}/${blocProvider.dateTime!.year} ${blocProvider.endChartDate}',
onTap: () {
blocProvider.add(SelectDateEvent(context: context));
blocProvider.add(FilterRecordsByDateEvent(
selectedDate: blocProvider.dateTime!,
viewType: blocProvider
.views[blocProvider.currentIndex]));
},
widget: blocProvider.dateSwitcher(),
chartData: blocProvider.energyDataList.isNotEmpty
? blocProvider.energyDataList
: [
EnergyData('12:00 AM', 4.0),
EnergyData('01:00 AM', 3.5),
EnergyData('02:00 AM', 3.8),
EnergyData('03:00 AM', 3.2),
EnergyData('04:00 AM', 4.0),
EnergyData('05:00 AM', 3.4),
EnergyData('06:00 AM', 3.2),
EnergyData('07:00 AM', 3.5),
EnergyData('08:00 AM', 3.8),
EnergyData('09:00 AM', 3.6),
EnergyData('10:00 AM', 3.9),
EnergyData('11:00 AM', 4.0),
],
totalConsumption: 10000,
date: blocProvider.formattedDate,
),
EnergyConsumptionPage(
formattedDate:
'${blocProvider.dateTime!.day}/${blocProvider.dateTime!.month}/${blocProvider.dateTime!.year} ${blocProvider.endChartDate}',
onTap: () {
blocProvider.add(SelectDateEvent(context: context));
},
widget: blocProvider.dateSwitcher(),
chartData: blocProvider.energyDataList.isNotEmpty
? blocProvider.energyDataList
: [
EnergyData('12:00 AM', 4.0),
EnergyData('01:00 AM', 3.5),
EnergyData('02:00 AM', 3.8),
EnergyData('03:00 AM', 3.2),
EnergyData('04:00 AM', 4.0),
EnergyData('05:00 AM', 3.4),
EnergyData('06:00 AM', 3.2),
EnergyData('07:00 AM', 3.5),
EnergyData('08:00 AM', 3.8),
EnergyData('09:00 AM', 3.6),
EnergyData('10:00 AM', 3.9),
EnergyData('11:00 AM', 4.0),
],
totalConsumption: 10000,
date: blocProvider.formattedDate,
),
EnergyConsumptionPage(
formattedDate:
'${blocProvider.dateTime!.day}/${blocProvider.dateTime!.month}/${blocProvider.dateTime!.year} ${blocProvider.endChartDate}',
onTap: () {
blocProvider.add(SelectDateEvent(context: context));
},
widget: blocProvider.dateSwitcher(),
chartData: blocProvider.energyDataList.isNotEmpty
? blocProvider.energyDataList
: [
EnergyData('12:00 AM', 4.0),
EnergyData('01:00 AM', 6.5),
EnergyData('02:00 AM', 3.8),
EnergyData('03:00 AM', 3.2),
EnergyData('04:00 AM', 6.0),
EnergyData('05:00 AM', 3.4),
EnergyData('06:00 AM', 5.2),
EnergyData('07:00 AM', 3.5),
EnergyData('08:00 AM', 3.8),
EnergyData('09:00 AM', 5.6),
EnergyData('10:00 AM', 6.9),
EnergyData('11:00 AM', 6.0),
],
totalConsumption: 10000,
date: blocProvider.formattedDate,
),
],
),
),
],
),
),
],
),
),
);
}
}

View File

@ -52,6 +52,7 @@ class _FactoryResetWidgetState extends State<FactoryResetWidget> {
child: DefaultButton(
height: 20,
elevation: 0,
padding: 0,
onPressed: _toggleConfirmation,
backgroundColor: ColorsManager.greyColor,
child: Text(
@ -69,14 +70,16 @@ class _FactoryResetWidgetState extends State<FactoryResetWidget> {
child: DefaultButton(
height: 20,
elevation: 0,
padding: 0,
onPressed: widget.callFactoryReset,
backgroundColor: ColorsManager.red,
child: Text(
'Reset',
style: context.textTheme.bodyMedium!.copyWith(
color: ColorsManager.whiteColors,
fontWeight: FontWeight.w400,
fontSize: 12),
color: ColorsManager.whiteColors,
fontWeight: FontWeight.w400,
fontSize: 12,
),
),
),
),

View File

@ -1,11 +1,8 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:syncrow_web/utils/extension/build_context_x.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/helper/route_controls_based_code.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_model.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/extension/build_context_x.dart';
class DeviceBatchControlDialog extends StatelessWidget with RouteControlsBasedCode {
final List<AllDevicesModel> devices;
@ -138,6 +135,8 @@ String getBatchDialogName(AllDevicesModel device) {
return "Garage Door Opener";
case 'WL':
return "Water Leak Sensor";
case 'SOS':
return "SOS";
default:
return device.categoryName ?? 'Device Control';
}

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/helper/route_controls_based_code.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_model.dart';
import 'package:syncrow_web/pages/device_managment/shared/device_batch_control_dialog.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/format_date_time.dart';
@ -31,7 +32,7 @@ class DeviceControlDialog extends StatelessWidget with RouteControlsBasedCode {
children: [
const SizedBox(),
Text(
device.productName ?? 'Device Control',
getBatchDialogName(device),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 22,
@ -64,7 +65,7 @@ class DeviceControlDialog extends StatelessWidget with RouteControlsBasedCode {
),
const SizedBox(height: 20),
_buildDeviceInfoSection(),
const SizedBox(height: 20),
//const SizedBox(height: 20),
//// BUILD DEVICE CONTROLS
///
//// ROUTE TO SPECIFIC CONTROL VIEW BASED ON DEVICE CATEGORY
@ -94,7 +95,7 @@ class DeviceControlDialog extends StatelessWidget with RouteControlsBasedCode {
]),
TableRow(
children: [
_buildInfoRow('Unit Name:', device.unit?.name ?? 'N/A'),
_buildInfoRow('Space Name:', device.unit?.name ?? 'N/A'),
_buildInfoRow('Room:', device.room?.name ?? 'N/A'),
],
),

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:syncrow_web/utils/color_manager.dart';
class DeviceControlsContainer extends StatelessWidget {
const DeviceControlsContainer({required this.child, this.padding, super.key});
@ -8,21 +7,21 @@ class DeviceControlsContainer extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
return Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
color: ColorsManager.greyColor.withOpacity(0.2),
// boxShadow: <BoxShadow>[
// BoxShadow(
// color: ColorsManager.blackColor.withOpacity(0.05),
// blurRadius: 6.0,
// offset: const Offset(0, 5),
// spreadRadius: 0)
// ],
),
padding: EdgeInsets.all(padding ?? 12),
child: child,
elevation: 3,
surfaceTintColor: Colors.transparent,
child: Container(
decoration: BoxDecoration(
color: Colors.grey.shade100,
borderRadius: BorderRadius.circular(20),
),
padding:
EdgeInsets.symmetric(vertical: padding ?? 10, horizontal: padding ?? 16), //EdgeInsets.all(padding ?? 12),
child: child,
),
);
}
}

View File

@ -0,0 +1,73 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_web/pages/device_managment/shared/device_controls_container.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/extension/build_context_x.dart';
class IconNameStatusContainer extends StatelessWidget {
const IconNameStatusContainer({
super.key,
required this.name,
required this.icon,
required this.onTap,
required this.status,
required this.textColor,
this.paddingAmount = 12,
required this.isFullIcon,
});
final String name;
final String icon;
final GestureTapCallback onTap;
final bool status;
final Color textColor;
final double? paddingAmount;
final bool isFullIcon;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
child: DeviceControlsContainer(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (isFullIcon)
ClipOval(
child: SvgPicture.asset(
icon,
fit: BoxFit.contain,
),
)
else
ClipOval(
child: Container(
height: 60,
width: 60,
padding: EdgeInsets.all(paddingAmount ?? 8),
color: ColorsManager.whiteColors,
child: SvgPicture.asset(
icon,
width: 35,
height: 35,
fit: BoxFit.contain,
),
)),
const Spacer(),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 6),
child: Text(
name,
textAlign: TextAlign.start,
style: context.textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.w400,
color: textColor,
),
),
),
],
),
),
);
}
}

View File

@ -0,0 +1,90 @@
import 'dart:async';
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_reports.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/factory_reset_model.dart';
import 'package:syncrow_web/pages/device_managment/sos/models/sos_status_model.dart';
import 'package:syncrow_web/services/devices_mang_api.dart';
part 'sos_device_event.dart';
part 'sos_device_state.dart';
class SosDeviceBloc extends Bloc<SosDeviceEvent, SosDeviceState> {
SosDeviceBloc() : super(SosDeviceInitial()) {
on<GetDeviceStatus>(_getDeviceStatus);
on<GetBatchStatus>(_getBatchStatus);
on<GetDeviceRecords>(_getDeviceRecords);
on<GetDeviceAutomationRecords>(_getDeviceAutomationRecords);
on<BackToSosStatusView>(_backToSosStatusView);
on<SosFactoryReset>(_sosFactoryReset);
}
late SosStatusModel deviceStatus;
FutureOr<void> _getDeviceStatus(GetDeviceStatus event, Emitter<SosDeviceState> emit) async {
emit(SosDeviceLoadingState());
try {
final status = await DevicesManagementApi().getDeviceStatus(event.uuid);
deviceStatus = SosStatusModel.fromJson(event.uuid, status.status);
emit(SosDeviceLoadedState(deviceStatus));
} catch (e) {
emit(SosDeviceErrorState(e.toString()));
}
}
FutureOr<void> _getBatchStatus(GetBatchStatus event, Emitter<SosDeviceState> emit) async {
emit(SosDeviceLoadingState());
try {
final status = await DevicesManagementApi().getBatchStatus(event.uuids);
deviceStatus = SosStatusModel.fromJson(event.uuids.first, status.status);
emit(SosDeviceLoadedState(deviceStatus));
} catch (e) {
emit(SosDeviceErrorState(e.toString()));
}
}
FutureOr<void> _getDeviceRecords(GetDeviceRecords event, Emitter<SosDeviceState> emit) async {
emit(SosReportLoadingState());
try {
final from = DateTime.now().subtract(const Duration(days: 30)).millisecondsSinceEpoch;
final to = DateTime.now().millisecondsSinceEpoch;
final DeviceReport records =
await DevicesManagementApi.getDeviceReportsByDate(event.uuid, 'sos', from.toString(), to.toString());
emit(SosReportLoadedState(records));
} catch (e) {
emit(SosReportErrorState(e.toString()));
}
}
FutureOr<void> _getDeviceAutomationRecords(GetDeviceAutomationRecords event, Emitter<SosDeviceState> emit) async {
emit(SosAutomationReportLoadingState());
try {
final from = DateTime.now().subtract(const Duration(days: 30)).millisecondsSinceEpoch;
final to = DateTime.now().millisecondsSinceEpoch;
final DeviceReport records = await DevicesManagementApi.getDeviceReportsByDate(
event.uuid, 'sos_automation', from.toString(), to.toString());
emit(SosAutomationReportLoadedState(records));
} catch (e) {
emit(SosAutomationReportErrorState(e.toString()));
}
}
FutureOr<void> _backToSosStatusView(BackToSosStatusView event, Emitter<SosDeviceState> emit) {
emit(SosDeviceLoadedState(deviceStatus));
}
FutureOr<void> _sosFactoryReset(SosFactoryReset event, Emitter<SosDeviceState> emit) async {
emit(SosDeviceLoadingState());
try {
final response = await DevicesManagementApi().factoryReset(event.factoryReset, event.deviceId);
if (response) {
emit(SosDeviceLoadedState(deviceStatus));
} else {
emit(const SosDeviceErrorState('Factory reset failed'));
}
} catch (e) {
emit(SosDeviceErrorState(e.toString()));
}
}
}

View File

@ -0,0 +1,49 @@
part of 'sos_device_bloc.dart';
sealed class SosDeviceEvent extends Equatable {
const SosDeviceEvent();
}
class GetDeviceStatus extends SosDeviceEvent {
final String uuid;
const GetDeviceStatus(this.uuid);
@override
List<Object?> get props => [uuid];
}
class GetBatchStatus extends SosDeviceEvent {
final List<String> uuids;
const GetBatchStatus(this.uuids);
@override
List<Object?> get props => [uuids];
}
class GetDeviceRecords extends SosDeviceEvent {
final String uuid;
const GetDeviceRecords(this.uuid);
@override
List<Object?> get props => [uuid];
}
class GetDeviceAutomationRecords extends SosDeviceEvent {
final String uuid;
const GetDeviceAutomationRecords(this.uuid);
@override
List<Object?> get props => [uuid];
}
class BackToSosStatusView extends SosDeviceEvent {
@override
List<Object?> get props => [];
}
class SosFactoryReset extends SosDeviceEvent {
final String deviceId;
final FactoryResetModel factoryReset;
const SosFactoryReset({required this.deviceId, required this.factoryReset});
@override
List<Object> get props => [deviceId, factoryReset];
}

View File

@ -0,0 +1,82 @@
part of 'sos_device_bloc.dart';
sealed class SosDeviceState extends Equatable {
const SosDeviceState();
}
final class SosDeviceInitial extends SosDeviceState {
@override
List<Object> get props => [];
}
final class SosDeviceLoadingState extends SosDeviceState {
@override
List<Object> get props => [];
}
final class SosDeviceLoadedState extends SosDeviceState {
final SosStatusModel sosStatusModel;
const SosDeviceLoadedState(this.sosStatusModel);
@override
List<Object> get props => [sosStatusModel];
}
final class SosDeviceErrorState extends SosDeviceState {
final String message;
const SosDeviceErrorState(this.message);
@override
List<Object> get props => [message];
}
/// report state
final class SosReportLoadingState extends SosDeviceState {
@override
List<Object> get props => [];
}
final class SosReportLoadedState extends SosDeviceState {
final DeviceReport sosReport;
const SosReportLoadedState(this.sosReport);
@override
List<Object> get props => [sosReport];
}
final class SosReportErrorState extends SosDeviceState {
final String message;
const SosReportErrorState(this.message);
@override
List<Object> get props => [message];
}
/// automation reports
final class SosAutomationReportLoadingState extends SosDeviceState {
@override
List<Object> get props => [];
}
final class SosAutomationReportLoadedState extends SosDeviceState {
final DeviceReport automationReport;
const SosAutomationReportLoadedState(this.automationReport);
@override
List<Object> get props => [automationReport];
}
final class SosAutomationReportErrorState extends SosDeviceState {
final String message;
const SosAutomationReportErrorState(this.message);
@override
List<Object> get props => [message];
}

View File

@ -0,0 +1,34 @@
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
class SosStatusModel {
final int batteryLevel;
final String sosStatus;
final String deviceId;
SosStatusModel({
required this.batteryLevel,
required this.sosStatus,
required this.deviceId,
});
factory SosStatusModel.fromJson(String deviceId, List<Status> statuses) {
late int batteryLevel;
late String sosStatus;
for (var status in statuses) {
switch (status.code) {
case 'battery_percentage':
batteryLevel = status.value;
break;
case 'sos':
sosStatus = status.value;
break;
}
}
return SosStatusModel(
deviceId: deviceId,
batteryLevel: batteryLevel,
sosStatus: sosStatus,
);
}
}

View File

@ -0,0 +1,41 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/factory_reset_model.dart';
import 'package:syncrow_web/pages/device_managment/shared/batch_control/factory_reset.dart';
import 'package:syncrow_web/pages/device_managment/shared/batch_control/firmware_update.dart';
import 'package:syncrow_web/pages/device_managment/sos/bloc/sos_device_bloc.dart';
class SOSBatchControlView extends StatelessWidget {
const SOSBatchControlView({
super.key,
required this.deviceIds,
});
final List<String> deviceIds;
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: 170,
// height: 140,
child: FirmwareUpdateWidget(deviceId: deviceIds.first, version: 2)),
const SizedBox(
width: 12,
),
SizedBox(
width: 170,
height: 140,
child: FactoryResetWidget(
callFactoryReset: () {
context.read<SosDeviceBloc>().add(
SosFactoryReset(deviceId: deviceIds.first, factoryReset: FactoryResetModel(devicesUuid: deviceIds)));
},
),
),
],
);
}
}

View File

@ -0,0 +1,138 @@
// sos device control view
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_model.dart';
import 'package:syncrow_web/pages/device_managment/shared/icon_name_status_container.dart';
import 'package:syncrow_web/pages/device_managment/shared/table/report_table.dart';
import 'package:syncrow_web/pages/device_managment/sos/bloc/sos_device_bloc.dart';
import 'package:syncrow_web/pages/device_managment/sos/widgets/sos_notification_dialog.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/constants/assets.dart';
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
import '../models/sos_status_model.dart';
class SosDeviceControlsView extends StatelessWidget with HelperResponsiveLayout {
const SosDeviceControlsView({
super.key,
required this.device,
});
final AllDevicesModel device;
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => SosDeviceBloc()..add(GetDeviceStatus(device.uuid!)),
child: BlocBuilder<SosDeviceBloc, SosDeviceState>(
builder: (context, state) {
if (state is SosDeviceLoadingState) {
return const Center(child: CircularProgressIndicator());
} else if (state is SosDeviceLoadedState) {
return _buildStatusControls(context, state.sosStatusModel);
} else if (state is SosReportLoadedState) {
return ReportsTable(
report: state.sosReport,
hideValueShowDescription: true,
garageDoorSensor: true,
onRowTap: (index) {},
onClose: () {
context.read<SosDeviceBloc>().add(BackToSosStatusView());
},
);
} else if (state is SosAutomationReportLoadedState) {
return ReportsTable(
report: state.automationReport,
hideValueShowDescription: true,
garageDoorSensor: true,
onRowTap: (index) {},
onClose: () {
context.read<SosDeviceBloc>().add(BackToSosStatusView());
},
);
} else if (state is SosDeviceErrorState) {
return const Center(child: Text('Error fetching status'));
} else if (state is SosAutomationReportErrorState) {
return Center(child: Text('Error: ${state.message.toString()}'));
} else if (state is SosReportErrorState) {
return Center(child: Text('Error: ${state.message.toString()}'));
}
return const Center(child: CircularProgressIndicator());
},
));
}
Widget _buildStatusControls(BuildContext context, SosStatusModel deviceStatus) {
final isExtraLarge = isExtraLargeScreenSize(context);
final isLarge = isLargeScreenSize(context);
final isMedium = isMediumScreenSize(context);
return GridView(
padding: const EdgeInsets.symmetric(horizontal: 50),
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: isLarge || isExtraLarge
? 3
: isMedium
? 2
: 1,
mainAxisExtent: 140,
crossAxisSpacing: 12,
mainAxisSpacing: 12,
),
children: [
IconNameStatusContainer(
isFullIcon: false,
name: deviceStatus.sosStatus == 'sos' ? 'SOS' : 'Normal',
icon: deviceStatus.sosStatus == 'sos' ? Assets.sos : Assets.sosNormal,
onTap: () {},
status: false,
textColor: ColorsManager.blackColor,
),
IconNameStatusContainer(
isFullIcon: false,
name: 'SOS Records',
icon: Assets.records,
onTap: () {
context.read<SosDeviceBloc>().add(
GetDeviceRecords(
device.uuid!,
),
);
},
status: false,
textColor: ColorsManager.blackColor,
),
IconNameStatusContainer(
isFullIcon: false,
name: 'Automation Record',
icon: Assets.automationRecords,
onTap: () {
// context.read<SosDeviceBloc>().add(
// GetDeviceAutomationRecords(
// device.uuid!,
// ),
// );
},
status: false,
textColor: ColorsManager.blackColor,
),
IconNameStatusContainer(
isFullIcon: false,
name: 'Alarm Settings',
icon: Assets.mainDoorNotifi,
onTap: () {
showDialog(
context: context,
builder: (context) => const SosNotificationDialog(),
);
},
status: false,
textColor: ColorsManager.blackColor,
paddingAmount: 14,
),
],
);
}
}

View File

@ -0,0 +1,116 @@
import 'package:flutter/material.dart';
import 'package:syncrow_web/pages/device_managment/shared/toggle_widget.dart';
import 'package:syncrow_web/utils/color_manager.dart';
class SosNotificationDialog extends StatefulWidget {
const SosNotificationDialog({super.key});
@override
State<SosNotificationDialog> createState() => _NotificationDialogState();
}
class _NotificationDialogState extends State<SosNotificationDialog> {
bool isLowBatteryNotificationEnabled = true;
bool isSosAlarmEnabled = true;
@override
Widget build(BuildContext context) {
return Dialog(
backgroundColor: Colors.white,
insetPadding: const EdgeInsets.all(20),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
child: SizedBox(
width: 550,
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const SizedBox(),
Text(
'Notification Settings',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 22,
color: ColorsManager.dialogBlueTitle,
),
),
Container(
width: 25,
decoration: BoxDecoration(
color: Colors.transparent,
shape: BoxShape.circle,
border: Border.all(
color: Colors.grey,
width: 1.0,
),
),
child: IconButton(
padding: EdgeInsets.all(1),
icon: const Icon(
Icons.close,
color: Colors.grey,
size: 18,
),
onPressed: () {
Navigator.of(context).pop();
},
),
),
],
),
const SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: 170,
height: 135,
child: ToggleWidget(
value: isSosAlarmEnabled,
code: 'notification',
deviceId: '',
label: 'SOS Alarm',
onChange: (v) {
setState(() {
isSosAlarmEnabled = v;
});
},
icon: '-1',
),
),
const SizedBox(
width: 16,
),
SizedBox(
width: 170,
height: 135,
child: ToggleWidget(
value: isLowBatteryNotificationEnabled,
code: 'notification',
deviceId: '',
label: 'Low Battery',
onChange: (v) {
setState(() {
isLowBatteryNotificationEnabled = v;
});
},
icon: '-1',
),
),
],
),
],
),
),
),
),
);
}
}

View File

@ -1,13 +1,13 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_web/pages/device_managment/main_door_sensor/view/main_door_control_view.dart';
import 'package:syncrow_web/pages/device_managment/shared/icon_name_status_container.dart';
import 'package:syncrow_web/pages/device_managment/shared/table/report_table.dart';
import 'package:syncrow_web/pages/device_managment/water_leak/bloc/water_leak_bloc.dart';
import 'package:syncrow_web/pages/device_managment/water_leak/bloc/water_leak_event.dart';
import 'package:syncrow_web/pages/device_managment/water_leak/bloc/water_leak_state.dart';
import 'package:syncrow_web/pages/device_managment/water_leak/widgets/water_leak_notifi_dialog.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/constants/assets.dart';
import 'package:syncrow_web/pages/device_managment/shared/table/report_table.dart';
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
class WaterLeakView extends StatelessWidget with HelperResponsiveLayout {
@ -21,8 +21,7 @@ class WaterLeakView extends StatelessWidget with HelperResponsiveLayout {
final isLarge = isLargeScreenSize(context);
final isMedium = isMediumScreenSize(context);
return BlocProvider(
create: (context) =>
WaterLeakBloc(deviceId)..add(FetchWaterLeakStatusEvent(deviceId)),
create: (context) => WaterLeakBloc(deviceId)..add(FetchWaterLeakStatusEvent(deviceId)),
child: BlocBuilder<WaterLeakBloc, WaterLeakState>(
builder: (context, state) {
if (state is WaterLeakLoadingState) {
@ -45,31 +44,21 @@ class WaterLeakView extends StatelessWidget with HelperResponsiveLayout {
children: [
IconNameStatusContainer(
isFullIcon: false,
name: state.status.watersensorState == 'normal'
? 'Normal'
: 'Leak Detection',
icon: state.status.watersensorState == 'normal'
? Assets.waterLeakNormal
: Assets.waterLeakDetected,
name: state.status.watersensorState == 'normal' ? 'Normal' : 'Leak Detection',
icon: state.status.watersensorState == 'normal' ? Assets.waterLeakNormal : Assets.waterLeakDetected,
onTap: () {},
status: state.status.watersensorState == 'normal',
textColor: state.status.watersensorState == 'normal'
? ColorsManager.blackColor
: ColorsManager.red,
textColor: state.status.watersensorState == 'normal' ? ColorsManager.blackColor : ColorsManager.red,
),
IconNameStatusContainer(
isFullIcon: false,
name: 'Records',
icon: Assets.records,
onTap: () {
context
.read<WaterLeakBloc>()
.add(FetchWaterLeakReportsEvent(
context.read<WaterLeakBloc>().add(FetchWaterLeakReportsEvent(
deviceId: deviceId,
code: 'watersensor_state',
from: DateTime.now()
.subtract(const Duration(days: 30))
.millisecondsSinceEpoch,
from: DateTime.now().subtract(const Duration(days: 30)).millisecondsSinceEpoch,
to: DateTime.now().millisecondsSinceEpoch,
));
},
@ -109,9 +98,7 @@ class WaterLeakView extends StatelessWidget with HelperResponsiveLayout {
waterLeak: true,
onRowTap: (index) {},
onClose: () {
context
.read<WaterLeakBloc>()
.add(FetchWaterLeakStatusEvent(deviceId));
context.read<WaterLeakBloc>().add(FetchWaterLeakStatusEvent(deviceId));
},
);
} else if (state is WaterLeakReportsFailedState) {

View File

@ -111,7 +111,7 @@ class AddDeviceDialog extends StatelessWidget {
child: CustomWebTextField(
controller: visitorBloc.unitNameController,
isRequired: false,
textFieldName: 'Unit Name',
textFieldName: 'Space Name',
description: '',
),
),
@ -185,7 +185,7 @@ class AddDeviceDialog extends StatelessWidget {
'Device Name',
'Device ID',
'Access Type',
'Unit Name',
'Space Name',
'Status'
],
data: state.data.map((item) {

View File

@ -18,10 +18,11 @@ class AuthenticationAPI {
static Future forgetPassword({
required var email,
required var password,
required var otpCode,
}) async {
final response = await HTTPService().post(
path: ApiEndpoints.forgetPassword,
body: {"email": email, "password": password},
body: {"email": email, "password": password,"otpCode": otpCode},
showServerMessage: true,
expectedResponseModel: (json) {});
return response;

View File

@ -1,3 +1,4 @@
import 'dart:core';
import 'package:flutter/material.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_reports.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
@ -50,6 +51,22 @@ class DevicesManagementApi {
}
}
Future getPowerClampInfo(String deviceId) async {
try {
final response = await HTTPService().get(
path: ApiEndpoints.powerClamp.replaceAll('{powerClampUuid}', deviceId),
showServerMessage: true,
expectedResponseModel: (json) {
return json;
},
);
return response;
} catch (e) {
debugPrint('Error fetching $e');
return {};
}
}
//deviceControl
Future<bool> deviceControl(String uuid, Status status) async {
try {
@ -68,7 +85,8 @@ class DevicesManagementApi {
}
}
Future<bool> deviceBatchControl(List<String> uuids, String code, dynamic value) async {
Future<bool> deviceBatchControl(
List<String> uuids, String code, dynamic value) async {
try {
final body = {
'devicesUuid': uuids,
@ -92,7 +110,8 @@ class DevicesManagementApi {
}
}
static Future<List<DeviceModel>> getDevicesByGatewayId(String gatewayId) async {
static Future<List<DeviceModel>> getDevicesByGatewayId(
String gatewayId) async {
final response = await HTTPService().get(
path: ApiEndpoints.gatewayApi.replaceAll('{gatewayUuid}', gatewayId),
showServerMessage: false,
@ -126,7 +145,9 @@ class DevicesManagementApi {
String code,
) async {
final response = await HTTPService().get(
path: ApiEndpoints.getDeviceLogs.replaceAll('{uuid}', uuid).replaceAll('{code}', code),
path: ApiEndpoints.getDeviceLogs
.replaceAll('{uuid}', uuid)
.replaceAll('{code}', code),
showServerMessage: false,
expectedResponseModel: (json) {
return DeviceReport.fromJson(json);
@ -135,7 +156,8 @@ class DevicesManagementApi {
return response;
}
static Future<DeviceReport> getDeviceReportsByDate(String uuid, String code, [String? from, String? to]) async {
static Future<DeviceReport> getDeviceReportsByDate(String uuid, String code,
[String? from, String? to]) async {
final response = await HTTPService().get(
path: ApiEndpoints.getDeviceLogsByDate
.replaceAll('{uuid}', uuid)
@ -174,7 +196,32 @@ class DevicesManagementApi {
}
}
Future<bool> addScheduleRecord(ScheduleEntry sendSchedule, String uuid) async {
getPowerStatus(List<String> uuids) async {
try {
final queryParameters = {
'devicesUuid': uuids.join(','),
};
final response = await HTTPService().get(
path: ApiEndpoints.getBatchStatus,
queryParameters: queryParameters,
showServerMessage: true,
expectedResponseModel: (json) {
return json;
},
);
return response;
} catch (e) {
debugPrint('Error fetching $e');
return DeviceStatus(
productUuid: '',
productType: '',
status: [],
);
}
}
Future<bool> addScheduleRecord(
ScheduleEntry sendSchedule, String uuid) async {
try {
final response = await HTTPService().post(
path: ApiEndpoints.scheduleByDeviceId.replaceAll('{deviceUuid}', uuid),
@ -191,10 +238,13 @@ class DevicesManagementApi {
}
}
Future<List<ScheduleModel>> getDeviceSchedules(String uuid, String category) async {
Future<List<ScheduleModel>> getDeviceSchedules(
String uuid, String category) async {
try {
final response = await HTTPService().get(
path: ApiEndpoints.getScheduleByDeviceId.replaceAll('{deviceUuid}', uuid).replaceAll('{category}', category),
path: ApiEndpoints.getScheduleByDeviceId
.replaceAll('{deviceUuid}', uuid)
.replaceAll('{category}', category),
showServerMessage: true,
expectedResponseModel: (json) {
List<ScheduleModel> schedules = [];
@ -211,7 +261,10 @@ class DevicesManagementApi {
}
}
Future<bool> updateScheduleRecord({required bool enable, required String uuid, required String scheduleId}) async {
Future<bool> updateScheduleRecord(
{required bool enable,
required String uuid,
required String scheduleId}) async {
try {
final response = await HTTPService().put(
path: ApiEndpoints.updateScheduleByDeviceId
@ -232,7 +285,8 @@ class DevicesManagementApi {
}
}
Future<bool> editScheduleRecord(String uuid, ScheduleEntry newSchedule) async {
Future<bool> editScheduleRecord(
String uuid, ScheduleEntry newSchedule) async {
try {
final response = await HTTPService().put(
path: ApiEndpoints.scheduleByDeviceId.replaceAll('{deviceUuid}', uuid),

View File

@ -42,4 +42,5 @@ abstract class ColorsManager {
static const Color textGreen = Color(0xFF008905);
static const Color yaGreen = Color(0xFFFFBF44);
}
//0036E6
//background: #background: #5D5D5D;

View File

@ -47,5 +47,7 @@ abstract class ApiEndpoints {
static const String updateScheduleByDeviceId =
'/schedule/enable/{deviceUuid}';
static const String factoryReset = '/device/factory/reset/{deviceUuid}';
static const String factoryReset = '/device/factory/reset/{deviceUuid}';
static const String powerClamp =
'/device/{powerClampUuid}/power-clamp/status';
}

View File

@ -168,4 +168,28 @@ class Assets {
//assets/icons/2gang.svg
static const String twoGang = 'assets/icons/2gang.svg';
static const String frequencyIcon = "assets/icons/frequency_icon.svg";
static const String voltMeterIcon = "assets/icons/volt_meter_icon.svg";
static const String powerActiveIcon = "assets/icons/power_active_icon.svg";
static const String searchIcon = "assets/icons/search_icon.svg";
static const String voltageIcon = "assets/icons/voltage_icon.svg";
static const String speedoMeter = "assets/icons/speedo_meter.svg";
//assets/icons/account_setting.svg
static const String accountSetting = 'assets/icons/account_setting.svg';
//assets/icons/settings.svg
static const String settings = 'assets/icons/settings.svg';
//assets/icons/sign_out.svg
static const String signOut = 'assets/icons/sign_out.svg';
//assets/icons/logo_grey.svg
static const String logoGrey = 'assets/icons/logo-grey.svg';
//assets/icons/sos.svg
static const String sos = 'assets/icons/sos.svg';
//assets/icons/sos_normal.svg
static const String sosNormal = 'assets/icons/sos_normal.svg';
}

View File

@ -33,12 +33,11 @@ InputDecoration? textBoxDecoration({bool suffixIcon = false}) =>
BoxDecoration containerDecoration = BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 5,
blurRadius: 8,
offset: const Offset(0, 3), // changes position of shadow
color: Colors.grey.withOpacity(0.3),
spreadRadius: 2,
blurRadius: 4,
offset: const Offset(0, 5), // changes position of shadow
),
],
color: ColorsManager.boxColor,
borderRadius: const BorderRadius.all(Radius.circular(10)));

View File

@ -3,6 +3,7 @@ import 'package:syncrow_web/utils/color_manager.dart';
final myTheme = ThemeData(
fontFamily: 'Aftika',
useMaterial3: true,
textTheme: const TextTheme(
bodySmall: TextStyle(
fontSize: 13,

View File

@ -0,0 +1,239 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:go_router/go_router.dart';
import 'package:syncrow_web/pages/auth/bloc/auth_bloc.dart';
import 'package:syncrow_web/pages/auth/model/user_model.dart';
import 'package:syncrow_web/pages/common/buttons/default_button.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/constants/assets.dart';
import 'package:syncrow_web/utils/constants/routes_const.dart';
import 'package:syncrow_web/utils/extension/build_context_x.dart';
class UserDropdownMenu extends StatefulWidget {
const UserDropdownMenu({super.key, required this.user});
final UserModel? user;
@override
_UserDropdownMenuState createState() => _UserDropdownMenuState();
}
class _UserDropdownMenuState extends State<UserDropdownMenu> {
bool _isDropdownOpen = false;
void _toggleDropdown() {
setState(() {
_isDropdownOpen = !_isDropdownOpen;
});
}
@override
Widget build(BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
GestureDetector(
onTap: () async {
_toggleDropdown();
await _showPopupMenu(context);
setState(() {
_isDropdownOpen = false;
});
},
child: Transform.rotate(
angle: _isDropdownOpen ? -1.5708 : 1.5708,
child: const Icon(
Icons.arrow_forward_ios,
color: Colors.white,
size: 16,
),
),
),
],
);
}
Future<void> _showPopupMenu(BuildContext context) async {
final RenderBox overlay = Overlay.of(context).context.findRenderObject() as RenderBox;
final RelativeRect position = RelativeRect.fromRect(
Rect.fromLTRB(
overlay.size.width,
75,
0,
overlay.size.height,
),
Offset.zero & overlay.size,
);
await showMenu(
context: context,
position: position,
color: ColorsManager.whiteColors,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(10),
bottomLeft: Radius.circular(10),
),
),
items: <PopupMenuEntry>[
PopupMenuItem(
onTap: () {},
child: ListTile(
leading: SvgPicture.asset(Assets.accountSetting),
title: Text(
"Account Settings",
style: context.textTheme.bodyMedium,
),
),
),
PopupMenuItem(
onTap: () {},
child: ListTile(
leading: SvgPicture.asset(Assets.settings),
title: Text(
"Settings",
style: context.textTheme.bodyMedium,
),
),
),
PopupMenuItem(
onTap: () {
showDialog(
context: context,
builder: (BuildContext context) {
final size = MediaQuery.of(context).size;
return AlertDialog(
alignment: Alignment.center,
content: SizedBox(
height: 200,
width: 400,
child: Padding(
padding: const EdgeInsets.only(top: 24, left: 24, right: 24),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Image.asset(
Assets.blackLogo,
height: 40,
width: 200,
),
Padding(
padding: const EdgeInsets.only(top: 16),
child: Text(
'Log out of your Syncrow account',
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 14,
fontWeight: FontWeight.w400,
color: Colors.black,
),
),
),
const SizedBox(
height: 16,
),
Row(
children: [
SizedBox.square(
dimension: 80,
child: CircleAvatar(
backgroundColor: ColorsManager.whiteColors,
child: SizedBox.square(
dimension: 78,
child: SvgPicture.asset(
Assets.logoGrey,
fit: BoxFit.fitHeight,
height: 80,
),
),
),
),
const SizedBox(
width: 16,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'${widget.user?.firstName ?? ''} ${widget.user?.lastName}',
style: Theme.of(context).textTheme.titleMedium!.copyWith(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 20,
),
),
Text(
' ${widget.user?.email}',
style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: Colors.black,
),
),
],
),
),
],
),
],
),
),
),
actionsAlignment: MainAxisAlignment.center,
actions: [
SizedBox(
width: 200,
child: GestureDetector(
onTap: () {
context.pop();
},
child: DefaultButton(
backgroundColor: ColorsManager.boxColor,
elevation: 1,
child: Text(
'Cancel',
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 12,
color: Colors.black,
),
),
),
),
),
const SizedBox(
height: 10,
),
GestureDetector(
onTap: () {
AuthBloc.logout();
context.go(RoutesConst.auth);
},
child: SizedBox(
width: 200,
child: DefaultButton(
elevation: 1,
child: Text(
'Logout',
style:
Theme.of(context).textTheme.bodyMedium!.copyWith(fontSize: 12, color: Colors.white),
),
),
),
),
]);
},
);
},
child: ListTile(
leading: SvgPicture.asset(Assets.signOut),
title: Text(
"Log Out",
style: context.textTheme.bodyMedium,
),
),
),
],
).then((value) {
setState(() {
_isDropdownOpen = false;
});
});
}
}

View File

@ -1,14 +1,12 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:syncrow_web/pages/auth/bloc/auth_bloc.dart';
import 'package:syncrow_web/pages/common/buttons/default_button.dart';
import 'package:syncrow_web/pages/common/custom_dialog.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_web/pages/home/bloc/home_bloc.dart';
import 'package:syncrow_web/pages/home/bloc/home_state.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/constants/routes_const.dart';
import 'package:syncrow_web/utils/constants/assets.dart';
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
import 'package:syncrow_web/utils/user_drop_down_menu.dart';
class WebAppBar extends StatefulWidget {
final Widget? title;
@ -58,15 +56,15 @@ class _WebAppBarState extends State<WebAppBar> with HelperResponsiveLayout {
if (widget.rightBody != null) widget.rightBody!,
Row(
children: [
const SizedBox.square(
SizedBox.square(
dimension: 40,
child: CircleAvatar(
backgroundColor: Colors.white,
backgroundColor: ColorsManager.whiteColors,
child: SizedBox.square(
dimension: 35,
child: CircleAvatar(
backgroundColor: Colors.grey,
child: FlutterLogo(),
child: SvgPicture.asset(
Assets.logoGrey,
fit: BoxFit.cover,
),
),
),
@ -112,15 +110,15 @@ class _WebAppBarState extends State<WebAppBar> with HelperResponsiveLayout {
const SizedBox(
width: 10,
),
const SizedBox.square(
SizedBox.square(
dimension: 40,
child: CircleAvatar(
backgroundColor: Colors.white,
backgroundColor: ColorsManager.whiteColors,
child: SizedBox.square(
dimension: 35,
child: CircleAvatar(
backgroundColor: Colors.grey,
child: FlutterLogo(),
child: SvgPicture.asset(
Assets.logoGrey,
fit: BoxFit.cover,
),
),
),
@ -136,54 +134,55 @@ class _WebAppBarState extends State<WebAppBar> with HelperResponsiveLayout {
const SizedBox(
width: 10,
),
GestureDetector(
onTap: () {
showCustomDialog(
context: context,
barrierDismissible: true,
title: 'Logout',
message: 'Are you sure you want to logout?',
actions: [
GestureDetector(
onTap: () {
AuthBloc.logout();
context.go(RoutesConst.auth);
},
child: DefaultButton(
child: Text(
'Ok',
style: Theme.of(context)
.textTheme
.bodyMedium!
.copyWith(fontSize: 12, color: Colors.white),
),
),
),
const SizedBox(
height: 10,
),
GestureDetector(
onTap: () {
context.pop();
},
child: DefaultButton(
child: Text(
'Cancel',
style: Theme.of(context)
.textTheme
.bodyMedium!
.copyWith(fontSize: 12, color: Colors.white),
),
),
),
],
);
},
child: const Icon(
Icons.logout,
color: ColorsManager.whiteColors,
),
)
UserDropdownMenu(user: user),
// GestureDetector(
// onTap: () {
// showCustomDialog(
// context: context,
// barrierDismissible: true,
// title: 'Logout',
// message: 'Are you sure you want to logout?',
// actions: [
// GestureDetector(
// onTap: () {
// AuthBloc.logout();
// context.go(RoutesConst.auth);
// },
// child: DefaultButton(
// child: Text(
// 'Ok',
// style: Theme.of(context)
// .textTheme
// .bodyMedium!
// .copyWith(fontSize: 12, color: Colors.white),
// ),
// ),
// ),
// const SizedBox(
// height: 10,
// ),
// GestureDetector(
// onTap: () {
// context.pop();
// },
// child: DefaultButton(
// child: Text(
// 'Cancel',
// style: Theme.of(context)
// .textTheme
// .bodyMedium!
// .copyWith(fontSize: 12, color: Colors.white),
// ),
// ),
// ),
// ],
// );
// },
// child: const Icon(
// Icons.logout,
// color: ColorsManager.whiteColors,
// ),
// )
],
),
],

View File

@ -137,6 +137,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "7.0.0"
fl_chart:
dependency: "direct main"
description:
name: fl_chart
sha256: "94307bef3a324a0d329d3ab77b2f0c6e5ed739185ffc029ed28c0f9b019ea7ef"
url: "https://pub.dev"
source: hosted
version: "0.69.0"
flutter:
dependency: "direct main"
description: flutter

View File

@ -49,6 +49,7 @@ dependencies:
intl: ^0.19.0
dropdown_search: ^5.0.6
flutter_dotenv: ^5.1.0
fl_chart: ^0.69.0
dev_dependencies:
flutter_test: