Compare commits

...

55 Commits

Author SHA1 Message Date
76da7debfd Merge pull request #113 from SyncrowIOT/SP-519-delete-account
Delete account
2025-07-20 13:55:46 +03:00
42c8b776ec use same text as used
and make text align to center
2025-07-15 10:05:11 +03:00
04352c980d fix over flow 2025-07-15 09:54:02 +03:00
228aee97e6 add loading indicator and state for deleting acount 2025-07-15 09:02:42 +03:00
24c7bcef55 PR requests 2025-07-10 16:52:34 +03:00
2ff34a07a7 add delete account UI and logic 2025-07-08 16:21:37 +03:00
fe472f0ca0 Merge pull request #112 from SyncrowIOT/SP-368-clarification-on-default-value-for-start-date-in-door-lock-online-tile-limited-password-repeat-section
Clarification on Default Value for Start Date in Door Lock Online Tile Limited Password repeat section
2025-07-02 09:12:48 +03:00
d9b68a11e5 fix the initial value on start date and fix logic that prevent user from select old date (befor now) 2025-07-01 14:09:14 +03:00
6c91af6f90 Merge pull request #111 from SyncrowIOT/SP-1781-fe-fix-bugs-related-to-wi-fi-door-lock-on-mobile-app
[FE] Fix bugs related to Wi-Fi door lock on Mobile App
2025-06-24 12:55:50 +03:00
65b8ecf672 PR improvments 2025-06-24 08:39:30 +03:00
ea0bd32eb7 Merge pull request #110 from SyncrowIOT/SP-1439-FE-On-Manage-your-home-screen-the-container-height-that-has-the-spaces-is-longer-than-needed-it-should-extend-based-on-the-data-in-the-list
[FE] On Manage your home screen the container height that has the spaces is longer than needed it should extend based on the data in the list
2025-06-23 14:06:56 +03:00
069a8e16db fix the issue in mobile to have indicator depend on time of unlock and unlock on pressing with lock animation 2025-06-23 13:55:52 +03:00
5989cdcfa0 using Align to keep the container stick with elemnts number (tested for many items) 2025-06-23 10:00:13 +03:00
4c81d22605 Merge pull request #109 from SyncrowIOT/build_booking_system
Build booking system
2025-06-17 16:25:55 +03:00
dc123e6231 PR fixes 2025-06-17 14:14:16 +03:00
a705384717 the Book Page is Ready now but not linked with any logic 2025-06-16 14:11:41 +03:00
d644c9c949 make the UI and link it with its blocs 2025-06-16 13:48:34 +03:00
9d7113cee8 make the domain and data layers 2025-06-16 13:48:15 +03:00
3893740080 start with upcoming widget 2025-06-16 09:40:49 +03:00
c7a9cd7ea7 add current balance widget 2025-06-16 09:40:28 +03:00
24a12af0f6 add booking appbar widget 2025-06-16 09:40:08 +03:00
5d327e29c7 add phone Height and Width into helpers 2025-06-16 09:39:47 +03:00
2b58af4560 add points to user model 2025-06-16 09:39:27 +03:00
19f1bb8ec3 add booking to setting list 2025-06-16 08:51:56 +03:00
a4f56effbb Merge pull request #108 from SyncrowIOT/bump-version-to-1.0.30+18
bump-v to `1.0.30+18`.
2025-06-03 16:46:22 +03:00
b35447384c bump-v to 1.0.30+18. 2025-06-03 12:39:07 +03:00
dbf031287b Merge pull request #107 from SyncrowIOT/SP-1562-FE-On-verify-OTP-screen-when-the-user-verifies-the-OTP-both-buttons-Verify-Resend-get-intoo-loading-state
fix loading issue seperate loading states between verify and resend O…
2025-05-22 04:55:52 -05:00
293d6a1d98 fix loading issue seperate loading states between verify and resend Otp&&perevent user to send api if otp length !=6 2025-05-22 02:45:24 -05:00
eaecd4996e Update flush sensor logic to trigger initial events when value is null or true, 2025-05-20 15:59:17 +03:00
bfb0cb1dc1 Merge pull request #106 from SyncrowIOT/Fix-Flush-Sensor-Bugs
Refactor device info model to handle optional fields more efficiently
2025-05-20 15:00:39 +03:00
c2bf32af1c Refactor device info model to handle optional fields more efficiently 2025-05-20 14:53:28 +03:00
b7a42af223 Merge pull request #105 from SyncrowIOT/fix-issue-SceneDetails
Refactor Action class constructor to handle optional fields more effi…
2025-05-19 13:26:02 +03:00
e8e5ddd102 Refactor Action class constructor to handle optional fields more efficiently 2025-05-19 13:24:49 +03:00
fca69cef73 Merge pull request #104 from SyncrowIOT/fix-back-button-status
Refactor screen titles to use bloc device info
2025-05-19 11:06:57 +03:00
7a19291088 Refactor screen titles to use bloc device info 2025-05-19 11:04:59 +03:00
c76995fbb8 Merge pull request #103 from SyncrowIOT/SP-1586-FE-On-Device-settings-screen-after-editing
add PopScope to setting page
2025-05-15 14:23:50 +03:00
5d1b8e39b0 add PopScope to setting page 2025-05-15 12:35:47 +03:00
a04beb32f2 Merge pull request #102 from SyncrowIOT/Fix-Flush-Presence-Records
Refactor flush presence records widget to display the correct status
2025-05-14 11:16:45 +03:00
23c307338a Refactor flush presence records widget to display the correct status 2025-05-14 11:14:27 +03:00
4db16fd567 Merge pull request #101 from SyncrowIOT/change-New-PS-Functions-UI
Refactor operation dialog types and add counter steps
2025-05-13 15:58:28 +03:00
2c5ca67b10 Refactor operation dialog types and add counter steps 2025-05-13 14:46:27 +03:00
79c1205932 Merge pull request #100 from SyncrowIOT/fix-flush-bugs
fix flush bugs
2025-05-13 10:51:06 +03:00
3589e349b3 fix comments 2025-05-13 10:50:09 +03:00
86bd3fdd5b fix flush bugs 2025-05-13 10:23:35 +03:00
2e2db90c19 Merge pull request #99 from SyncrowIOT/SP-1459-FE-Display-Build-Number-and-Environment-Label-DEV-in-App-UI
Refactor menu view and add build number and environment label
2025-05-12 11:11:43 +03:00
21cad0d9e8 Refactor menu view and add build number and environment label 2025-05-12 10:58:16 +03:00
9c6ab888a7 Merge pull request #98 from SyncrowIOT/SP-1523-FE-Implement-Task-Dialogs-for-Editable-Sensor-Parameters-Sensitivity-Distances-Timings-Levels
Implement Flush Mounted Presence Sensor Routine Control and change th…
2025-05-12 10:51:11 +03:00
0a4ec1c6de Refactor API endpoint for getting device reports and fix the record title 2025-05-12 10:18:02 +03:00
adb42f95e8 Implement Flush Mounted Presence Sensor Routine Control and change the device type logic 2025-05-11 16:33:11 +03:00
2651de71e4 Merge pull request #97 from SyncrowIOT/SP-1522-FE-Implement-Device-Settings-Screen-Edit-Name-Location-Device-Info
Sp 1522 fe implement device settings screen edit name location device info
2025-05-07 11:07:43 +03:00
5411d84759 Refactor device avatar and add icon to setting 2025-05-07 11:01:51 +03:00
a1954b3ad3 add settings to flush sensor 2025-05-07 10:37:59 +03:00
56007d6a8c Merge pull request #96 from SyncrowIOT/SP-1520-FE-Build-Motion-Status-Illuminance-Row-and-Presence-Record-Navigation
add new flush sensor device to app
2025-05-07 10:16:12 +03:00
7fd825516f Merge pull request #95 from SyncrowIOT/staging-release-30+16
Added Client id, and client secret to `.env.prod`.
2025-05-06 09:40:23 +03:00
9919840391 Added Client id, and client secret to .env.prod. 2025-05-06 09:35:02 +03:00
86 changed files with 3590 additions and 1302 deletions

View File

@ -1,3 +1,5 @@
ENV_NAME=production
BASE_URL=https://syncrow-staging.azurewebsites.net
PROJECT_ID=bcda711e-9fc2-4168-a05e-171b4026d1ff
CLIENT_ID=ac05b6c26bdb0543ec6200781d8177f1
CLIENT_SECRET=fdbaafdd5a94bbd542a4a6739cf0178c8bb2e87bff39232a3aaa993fbd5d71e7

12
assets/icons/Booking.svg Normal file
View File

@ -0,0 +1,12 @@
<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_9795_16810)">
<path d="M3.68007 14.1344H4.98041C5.73422 14.1344 5.73533 12.96 4.98041 12.96H3.68007C2.92629 12.96 2.92518 14.1344 3.68007 14.1344ZM3.68007 13.3994H4.98041C5.17143 13.3994 5.17143 13.695 4.98041 13.695H3.68007C3.48908 13.695 3.48908 13.3994 3.68007 13.3994Z" fill="white"/>
<path d="M5.29431 7.55226L3.86289 8.9837L3.36716 8.48794C3.16621 8.28714 2.85552 8.59777 3.05641 8.79869L3.70753 9.44981C3.81112 9.53559 3.91472 9.53559 4.01828 9.44981L5.60509 7.86301C5.80595 7.66209 5.49525 7.35145 5.29431 7.55226Z" fill="white"/>
<path d="M14.8368 9.72059C14.7481 9.55125 14.6838 9.36574 14.6401 9.17956C14.4259 8.28325 14.1003 7.41489 13.6727 6.59856L12.9576 5.23374C12.5529 4.46106 11.3583 4.58953 11.1328 5.437C10.5978 5.24455 9.99396 5.56087 9.84768 6.11024C9.40544 5.9511 8.89477 6.13855 8.6603 6.54527V1.7204V0.858486C8.66028 0.385137 8.27517 0 7.80176 0H2.68301C2.39892 0 2.39892 0.439453 2.68301 0.439453H7.80176C8.03282 0.439453 8.22082 0.627422 8.22082 0.858486V1.50067H0.439659V0.858486C0.439659 0.627422 0.627628 0.439453 0.858692 0.439453H1.45257C1.73666 0.439453 1.73666 0 1.45257 0H0.858692C0.385343 0 0.000205994 0.385137 0.000205994 0.858486V1.7204V12.3108V14.1415C0.000205994 14.6149 0.385343 15 0.858692 15H7.80176C8.27514 15 8.66027 14.6149 8.66027 14.1415V12.3108V11.4307L9.44546 11.819C9.63949 11.915 9.79896 12.0748 9.89452 12.269C10.2433 12.9779 11.1374 13.2717 11.8396 12.9038L13.1487 12.218C13.4004 12.0861 13.1965 11.6969 12.9448 11.8287L11.6357 12.5145C11.1494 12.7694 10.5312 12.5676 10.2888 12.075C10.1508 11.7945 9.92051 11.5637 9.64028 11.4251L6.30826 9.77698C5.68245 9.47303 6.13503 8.49126 6.7706 8.78769L7.98044 9.42457C8.16709 9.52283 8.3753 9.31506 8.27742 9.1282L6.17569 5.11652C5.83058 4.46771 6.75481 3.86883 7.10733 4.54184L8.59292 7.37742L8.98096 8.1181C9.10904 8.36271 9.50171 8.16518 9.37023 7.91417L8.99244 7.19309C8.83945 6.68329 9.46884 6.27226 9.87393 6.62766L10.2943 7.43004C10.4224 7.67464 10.8151 7.47712 10.6836 7.2261L10.2561 6.41024C10.2161 5.94152 10.7901 5.63988 11.153 5.94905L11.5761 6.75671C11.7042 7.00131 12.0968 6.80379 11.9653 6.55277L11.5421 5.745C11.4846 5.16976 12.2942 4.91437 12.5683 5.43765L13.2834 6.80247C13.6942 7.5866 14.0068 8.42074 14.2127 9.28163C14.2627 9.50496 14.3413 9.7217 14.4475 9.92446C14.7007 10.4077 14.5135 11.0068 14.0303 11.26C13.7786 11.3919 13.9826 11.7811 14.2342 11.6492C14.9321 11.2836 15.2024 10.4184 14.8368 9.72059ZM8.22082 14.1415C8.22082 14.3726 8.03282 14.5605 7.80176 14.5605H0.858692C0.627628 14.5605 0.439659 14.3726 0.439659 14.1415V12.5305H8.22082V14.1415ZM5.64987 8.85926C5.50072 9.17279 5.5297 9.54832 5.72405 9.83587C5.36068 10.2161 4.86217 10.4316 4.33022 10.4316C3.26581 10.4316 2.39985 9.56563 2.39985 8.50122C2.39985 7.43681 3.26581 6.57085 4.33022 6.57085C5.34018 6.57085 6.17092 7.35062 6.2533 8.33965C5.99306 8.41904 5.76686 8.61328 5.64987 8.85926ZM7.24526 4.0302C7.14946 3.95241 7.03893 3.89259 6.91758 3.85468C6.21375 3.63475 5.50491 4.28016 5.65983 5.00092H1.48843C1.44803 5.00092 1.41519 4.96808 1.41519 4.92768V3.35742C1.41519 3.31702 1.44803 3.28418 1.48843 3.28418H7.17202C7.21242 3.28418 7.24526 3.31702 7.24526 3.35742V4.0302ZM8.22082 5.72027L7.68472 4.69702V3.35742C7.68472 3.07474 7.45471 2.84473 7.17202 2.84473H1.48843C1.20574 2.84473 0.975733 3.07474 0.975733 3.35742V4.92771C0.975733 5.21039 1.20574 5.4404 1.48843 5.4404H5.84921L7.56065 8.70703L6.97102 8.39663C6.96841 8.39525 6.96574 8.39391 6.96308 8.39265C6.87577 8.3511 6.78445 8.3231 6.69155 8.30851C6.59306 7.09166 5.572 6.1314 4.33025 6.1314C3.02353 6.1314 1.96043 7.19449 1.96043 8.50122C1.96043 9.80795 3.02353 10.871 4.33025 10.871C4.98563 10.871 5.60016 10.6053 6.04658 10.1354C6.74367 10.5371 7.49956 10.8565 8.22082 11.2133V12.091H0.439659V1.94013H8.22082V5.72027Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0_9795_16810">
<rect width="15" height="15" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -0,0 +1,18 @@
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.8326 16.8575C7.55614 16.8575 4.89062 14.192 4.89062 10.9156C4.89062 7.63915 7.55614 4.97363 10.8326 4.97363C14.1091 4.97363 16.7746 7.63915 16.7746 10.9156C16.7746 14.192 14.1091 16.8575 10.8326 16.8575Z" fill="#FFE645"/>
<path d="M10.8333 4.97363C10.8332 4.97363 10.833 4.97363 10.833 4.97363V16.8575H10.8333C14.1098 16.8575 16.7753 14.192 16.7753 10.9156C16.7753 7.63915 14.1098 4.97363 10.8333 4.97363Z" fill="#FFF1B9"/>
<path d="M10.833 21.8334C10.4824 21.8334 10.1982 21.5493 10.1982 21.1986V18.8289C10.1982 18.4784 10.4824 18.1941 10.833 18.1941C11.1836 18.1941 11.4678 18.4784 11.4678 18.8289V21.1986C11.4678 21.5493 11.1836 21.8334 10.833 21.8334Z" fill="#FFE645"/>
<path d="M21.0317 11.6348H18.7461C18.3955 11.6348 18.1113 11.3506 18.1113 11C18.1113 10.6496 18.3955 10.3652 18.7461 10.3652H21.0317C21.3824 10.3652 21.6665 10.6496 21.6665 11C21.6665 11.3506 21.3824 11.6348 21.0317 11.6348Z" fill="#FFCF2C"/>
<path d="M2.92042 11.6348H0.634766C0.284157 11.6348 0 11.3506 0 11C0 10.6496 0.284157 10.3652 0.634766 10.3652H2.92042C3.27103 10.3652 3.55518 10.6496 3.55518 11C3.55518 11.3506 3.27103 11.6348 2.92042 11.6348Z" fill="#FFE645"/>
<path d="M17.7243 7.65695C17.5049 7.65695 17.2915 7.54306 17.174 7.33941C16.9988 7.03591 17.1027 6.64761 17.4064 6.47239L19.3481 5.3513C19.6517 5.17591 20.04 5.28005 20.2152 5.58372C20.3905 5.88721 20.2865 6.27551 19.9828 6.45073L18.0412 7.57182C17.9412 7.62951 17.8321 7.65695 17.7243 7.65695Z" fill="#FFCF2C"/>
<path d="M2.03686 16.7139C1.8175 16.7139 1.60409 16.6 1.48656 16.3963C1.31117 16.0928 1.41531 15.7045 1.71881 15.5293L3.69865 14.3862C4.00231 14.2108 4.39045 14.315 4.56567 14.6186C4.74106 14.9221 4.63708 15.3104 4.33342 15.4856L2.35358 16.6287C2.25373 16.6864 2.14447 16.7139 2.03686 16.7139Z" fill="#FFE645"/>
<path d="M5.76902 20.4051C5.6614 20.4051 5.5523 20.3778 5.4523 20.32C5.14863 20.1448 5.04466 19.7565 5.21988 19.453L6.36279 17.4735C6.53801 17.17 6.92631 17.0658 7.22981 17.2412C7.53347 17.4164 7.63744 17.8047 7.46222 18.1082L6.31931 20.0877C6.20178 20.2914 5.98838 20.4051 5.76902 20.4051Z" fill="#FFE645"/>
<path d="M3.94197 7.65681C3.83419 7.65681 3.72509 7.62937 3.62524 7.57168L1.64557 6.42877C1.34207 6.25355 1.23793 5.86525 1.41332 5.56158C1.58854 5.25809 1.97667 5.15395 2.28033 5.32933L4.26001 6.47224C4.56351 6.64746 4.66748 7.03576 4.49226 7.33926C4.37473 7.54291 4.16132 7.65681 3.94197 7.65681Z" fill="#FFE645"/>
<path d="M19.6649 16.7342C19.5572 16.7342 19.4481 16.7067 19.348 16.6491L17.333 15.4857C17.0295 15.3103 16.9255 14.9221 17.1007 14.6185C17.276 14.315 17.6643 14.2108 17.9678 14.3862L19.9828 15.5496C20.2865 15.7248 20.3905 16.1131 20.2152 16.4166C20.0977 16.6203 19.8843 16.7342 19.6649 16.7342Z" fill="#FFCF2C"/>
<path d="M15.8973 20.4051C15.6778 20.4051 15.4645 20.2913 15.347 20.0877L14.2043 18.1085C14.029 17.8048 14.133 17.4167 14.4367 17.2415C14.7402 17.0661 15.1285 17.1701 15.3037 17.4737L16.4464 19.4529C16.6217 19.7566 16.5177 20.1447 16.214 20.3199C16.114 20.3778 16.0049 20.4051 15.8973 20.4051Z" fill="#FFCF2C"/>
<path d="M10.833 3.72144C10.4824 3.72144 10.1982 3.43728 10.1982 3.08667V0.801514C10.1982 0.450905 10.4824 0.166748 10.833 0.166748C11.1836 0.166748 11.4678 0.450905 11.4678 0.801514V3.08667C11.4678 3.43728 11.1836 3.72144 10.833 3.72144Z" fill="#FFE645"/>
<path d="M14.7534 4.75952C14.6458 4.75952 14.5365 4.73208 14.4367 4.67422C14.133 4.499 14.029 4.11086 14.2043 3.8072L15.3472 1.82786C15.5224 1.5242 15.9105 1.42005 16.2142 1.59544C16.5178 1.77066 16.6218 2.15896 16.4466 2.46262L15.3037 4.44197C15.1862 4.64562 14.9728 4.75952 14.7534 4.75952Z" fill="#FFCF2C"/>
<path d="M6.91292 4.75919C6.69356 4.75919 6.48015 4.64529 6.36262 4.44164L5.21988 2.46262C5.04466 2.15896 5.14863 1.77066 5.4523 1.59544C5.75579 1.42005 6.14409 1.5242 6.31931 1.82786L7.46206 3.80687C7.63728 4.11053 7.5333 4.49867 7.22964 4.67405C7.1298 4.73175 7.02053 4.75919 6.91292 4.75919Z" fill="#FFE645"/>
<path d="M10.8333 18.1941C10.8332 18.1941 10.833 18.1941 10.833 18.1941V21.8334H10.8333C11.1839 21.8334 11.4681 21.5493 11.4681 21.1986V18.8289C11.4681 18.4784 11.1839 18.1941 10.8333 18.1941Z" fill="#FFCF2C"/>
<path d="M10.8333 0.166748C10.8332 0.166748 10.833 0.166748 10.833 0.166748V3.72144H10.8333C11.1839 3.72144 11.4681 3.43728 11.4681 3.08667V0.801514C11.4681 0.450905 11.1839 0.166748 10.8333 0.166748Z" fill="#FFCF2C"/>
</svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -0,0 +1,17 @@
<svg width="22" height="14" viewBox="0 0 22 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21.6663 11.1257L7.02441 8.58667L10.833 13.6648H21.6663V11.1257Z" fill="#FFB54C"/>
<path d="M0 11.1257V13.6648H10.8333V8.58667L0 11.1257Z" fill="#FFCC4A"/>
<path d="M21.6663 11.1257V5.41284H20.0688L19.4341 6.04761L18.7993 5.41284H17.2018L16.5671 6.04761L15.9323 5.41284H14.3348L13.7 6.04761L13.0653 5.41284H11.4678L8.29395 8.26929L10.833 11.1257H21.6663Z" fill="#FFCC4A"/>
<path d="M10.8333 5.41284H10.1986H8.60107L7.96631 6.04761L7.33154 5.41284H5.73405L5.09928 6.04761L4.46452 5.41284H2.86702L2.23226 6.04761L1.59749 5.41284H0V11.1257H10.8333V5.41284Z" fill="#FFE278"/>
<path d="M21.0316 1.60449H10.833L10.1982 2.23926L10.833 2.87402H21.0316V1.60449Z" fill="#ABD5ED"/>
<path d="M10.8333 1.60449H1.26953V0.334961H0V4.14355H1.26953V2.87402H10.8333V1.60449Z" fill="#BFEBFF"/>
<path d="M20.3965 0.334961H21.666V4.14355H20.3965V0.334961Z" fill="#ABD5ED"/>
<path d="M1.59766 5.41284H2.86719V8.58667H1.59766V5.41284Z" fill="#587AA1"/>
<path d="M4.46484 5.41284H5.73438V7.31714H4.46484V5.41284Z" fill="#587AA1"/>
<path d="M7.33203 5.41284H8.60156V8.58667H7.33203V5.41284Z" fill="#587AA1"/>
<path d="M11.4678 7.31714H10.833L10.5156 6.99976V5.73022L10.833 5.41284H11.4678V7.31714Z" fill="#455F80"/>
<path d="M10.1982 5.41284H10.833V7.31714H10.1982V5.41284Z" fill="#587AA1"/>
<path d="M13.0654 5.41284H14.335V8.58667H13.0654V5.41284Z" fill="#455F80"/>
<path d="M15.9326 5.41284H17.2021V7.31714H15.9326V5.41284Z" fill="#455F80"/>
<path d="M18.7998 5.41284H20.0693V8.58667H18.7998V5.41284Z" fill="#455F80"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,17 @@
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_8194_10048)">
<path d="M11.4732 16.7316C8.31096 16.7316 5.73828 14.1589 5.73828 10.9967C5.73828 7.8344 8.31096 5.26172 11.4732 5.26172C14.6355 5.26172 17.2081 7.8344 17.2081 10.9967C17.2081 14.1589 14.6355 16.7316 11.4732 16.7316Z" fill="#EBF6FF"/>
<path d="M17.2076 10.9967C17.2076 7.8344 14.6349 5.26172 11.4727 5.26172V16.7316C14.6349 16.7316 17.2076 14.1589 17.2076 10.9967Z" fill="#D7E7F8"/>
<path d="M11.4721 17.3699C7.95827 17.3699 5.09961 14.5112 5.09961 10.9974C5.09961 7.48362 7.95827 4.625 11.472 4.625C14.9858 4.625 17.8445 7.48366 17.8445 10.9974C17.8445 14.5112 14.9858 17.3699 11.4721 17.3699ZM11.4721 5.89473C8.6584 5.89473 6.36934 8.18379 6.36934 10.9974C6.36934 13.811 8.6584 16.1001 11.472 16.1001C14.2857 16.1001 16.5748 13.8111 16.5748 10.9974C16.5748 8.18375 14.2857 5.89473 11.4721 5.89473Z" fill="#9FE066"/>
<path d="M11.4728 11.6318H8.28525C7.93464 11.6318 7.65039 11.3475 7.65039 10.9969C7.65039 10.6463 7.93464 10.3621 8.28525 10.3621H10.8379V8.95127C10.8379 8.60066 11.1222 8.31641 11.4728 8.31641C11.8234 8.31641 12.1076 8.60066 12.1076 8.95127V10.9969C12.1077 11.3475 11.8234 11.6318 11.4728 11.6318Z" fill="#394949"/>
<path d="M12.1075 10.9969V8.95127C12.1075 8.60066 11.8233 8.31641 11.4727 8.31641V11.6318C11.8233 11.6318 12.1075 11.3475 12.1075 10.9969Z" fill="#151F1F"/>
<path d="M16.5753 10.9974C16.5753 13.8111 14.2863 16.1001 11.4727 16.1001V17.3698C14.9865 17.3698 17.8451 14.5112 17.8451 10.9974C17.8451 7.48366 14.9864 4.625 11.4727 4.625V5.89473C14.2863 5.89473 16.5753 8.18379 16.5753 10.9974Z" fill="#4ACA7B"/>
<path d="M18.6832 3.78752C16.7572 1.86147 14.1963 0.800781 11.4725 0.800781C8.74869 0.800781 6.18782 1.86147 4.26177 3.78752C2.67775 5.37158 1.67966 7.38516 1.37492 9.56545L1.08378 9.2743C0.835882 9.02641 0.433887 9.02641 0.185951 9.2743C-0.0619838 9.52219 -0.0619838 9.92419 0.185951 10.1721L1.46097 11.4471C1.58494 11.5711 1.74742 11.6331 1.90986 11.6331C2.0723 11.6331 2.23482 11.5711 2.35875 11.4471L3.63377 10.1721C3.8817 9.92423 3.8817 9.52224 3.63377 9.2743C3.38587 9.02641 2.98388 9.02641 2.73594 9.2743L2.70678 9.30346C3.50083 5.18845 7.12907 2.07051 11.4725 2.07051C16.3953 2.07051 20.4003 6.07548 20.4003 10.9983C20.4003 15.921 16.3953 19.926 11.4725 19.926C7.46868 19.926 3.9294 17.234 2.86558 13.3794C2.77234 13.0413 2.42266 12.8429 2.08474 12.9363C1.74674 13.0295 1.54837 13.3792 1.64165 13.7171C2.22378 15.8264 3.50315 17.7286 5.24408 19.0732C7.04184 20.4618 9.19555 21.1957 11.4725 21.1957C14.1963 21.1957 16.7571 20.135 18.6832 18.209C20.6093 16.2829 21.67 13.7221 21.67 10.9983C21.67 8.27439 20.6093 5.71361 18.6832 3.78752Z" fill="#FF4D5B"/>
<path d="M20.4004 10.9983C20.4004 15.9211 16.3955 19.926 11.4727 19.926V21.1958C14.1965 21.1958 16.7573 20.135 18.6834 18.209C20.6095 16.2829 21.6702 13.7221 21.6702 10.9983C21.6702 8.27439 20.6094 5.71361 18.6834 3.78752C16.7573 1.86147 14.1965 0.800781 11.4727 0.800781V2.07051C16.3955 2.07051 20.4004 6.07548 20.4004 10.9983Z" fill="#DE0062"/>
</g>
<defs>
<clipPath id="clip0_8194_10048">
<rect width="21.67" height="21.67" fill="white" transform="translate(0 0.164062)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1,17 @@
<svg width="22" height="14" viewBox="0 0 22 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21.6663 11.1257L7.02441 8.58667L10.833 13.6648H21.6663V11.1257Z" fill="#FFB54C"/>
<path d="M0 11.1257V13.6648H10.8333V8.58667L0 11.1257Z" fill="#FFCC4A"/>
<path d="M21.6663 11.1257V5.41284H20.0688L19.4341 6.04761L18.7993 5.41284H17.2018L16.5671 6.04761L15.9323 5.41284H14.3348L13.7 6.04761L13.0653 5.41284H11.4678L8.29395 8.26929L10.833 11.1257H21.6663Z" fill="#FFCC4A"/>
<path d="M10.8333 5.41284H10.1986H8.60107L7.96631 6.04761L7.33154 5.41284H5.73405L5.09928 6.04761L4.46452 5.41284H2.86702L2.23226 6.04761L1.59749 5.41284H0V11.1257H10.8333V5.41284Z" fill="#FFE278"/>
<path d="M21.0316 1.60449H10.833L10.1982 2.23926L10.833 2.87402H21.0316V1.60449Z" fill="#ABD5ED"/>
<path d="M10.8333 1.60449H1.26953V0.334961H0V4.14355H1.26953V2.87402H10.8333V1.60449Z" fill="#BFEBFF"/>
<path d="M20.3965 0.334961H21.666V4.14355H20.3965V0.334961Z" fill="#ABD5ED"/>
<path d="M1.59766 5.41284H2.86719V8.58667H1.59766V5.41284Z" fill="#587AA1"/>
<path d="M4.46484 5.41284H5.73438V7.31714H4.46484V5.41284Z" fill="#587AA1"/>
<path d="M7.33203 5.41284H8.60156V8.58667H7.33203V5.41284Z" fill="#587AA1"/>
<path d="M11.4678 7.31714H10.833L10.5156 6.99976V5.73022L10.833 5.41284H11.4678V7.31714Z" fill="#455F80"/>
<path d="M10.1982 5.41284H10.833V7.31714H10.1982V5.41284Z" fill="#587AA1"/>
<path d="M13.0654 5.41284H14.335V8.58667H13.0654V5.41284Z" fill="#455F80"/>
<path d="M15.9326 5.41284H17.2021V7.31714H15.9326V5.41284Z" fill="#455F80"/>
<path d="M18.7998 5.41284H20.0693V8.58667H18.7998V5.41284Z" fill="#455F80"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,23 @@
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_8194_10077)">
<path d="M17.6 18.673C17.3521 18.4251 17.3521 18.0231 17.6 17.7752C19.4054 15.9698 20.3996 13.5678 20.3996 11.0115C20.3996 8.45525 19.4054 6.05318 17.6 4.24784C17.3521 3.99994 17.3521 3.59795 17.6 3.35001C17.8479 3.10208 18.2499 3.10208 18.4978 3.35001C20.543 5.39516 21.6694 8.11606 21.6694 11.0115C21.6694 13.9069 20.543 16.6278 18.4978 18.673C18.2503 18.9205 17.8484 18.9213 17.6 18.673Z" fill="#7AFFE4"/>
<path d="M15.6781 16.7502C15.4302 16.5023 15.4302 16.1003 15.6781 15.8524C16.9704 14.5602 17.6821 12.8408 17.6821 11.011C17.6821 9.18128 16.9705 7.46194 15.6781 6.1697C15.4302 5.92176 15.4302 5.51981 15.6781 5.27187C15.926 5.02398 16.328 5.02394 16.576 5.27187C18.1081 6.80393 18.9519 8.84213 18.9519 11.0111C18.9519 13.18 18.1081 15.2182 16.576 16.7503C16.3279 16.9982 15.926 16.9981 15.6781 16.7502Z" fill="#00DDC1"/>
<path d="M13.7543 14.8285C13.5064 14.5805 13.5064 14.1785 13.7543 13.9306C14.5331 13.152 14.9619 12.1158 14.9619 11.0131C14.9619 9.91034 14.5331 8.87416 13.7543 8.09548C13.5064 7.84758 13.5064 7.44559 13.7543 7.19765C14.0022 6.94976 14.4042 6.94972 14.6521 7.19765C15.6707 8.21619 16.2317 9.5712 16.2317 11.0131C16.2317 12.455 15.6707 13.81 14.6521 14.8285C14.4042 15.0764 14.0022 15.0763 13.7543 14.8285Z" fill="#7AFFE4"/>
<path d="M17.6 18.6732C17.8484 18.9216 18.2503 18.9207 18.4978 18.6732C20.543 16.6281 21.6694 13.9072 21.6694 11.0117H20.3996C20.3996 13.568 19.4054 15.97 17.6 17.7754C17.3521 18.0233 17.3521 18.4253 17.6 18.6732Z" fill="#00DDC1"/>
<path d="M15.6781 16.7509C15.926 16.9988 16.3279 16.9989 16.5759 16.7509C18.1081 15.2189 18.9518 13.1807 18.9518 11.0117H17.6821C17.6821 12.8415 16.9704 14.5608 15.6781 15.8531C15.4302 16.101 15.4302 16.503 15.6781 16.7509Z" fill="#00B4BC"/>
<path d="M13.7543 14.8272C14.0022 15.0751 14.4041 15.0751 14.6521 14.8272C15.6707 13.8086 16.2316 12.4536 16.2316 11.0117H14.9619C14.9619 12.1144 14.533 13.1506 13.7543 13.9293C13.5064 14.1772 13.5064 14.5792 13.7543 14.8272Z" fill="#00DDC1"/>
<path d="M3.17152 18.673C1.12633 16.6278 0 13.9069 0 11.0115C0 8.11604 1.12633 5.39515 3.17152 3.35C3.41946 3.10206 3.82141 3.10211 4.06935 3.35C4.31728 3.59793 4.31728 3.99989 4.06935 4.24782C2.26396 6.05316 1.26973 8.45523 1.26973 11.0115C1.26973 13.5677 2.26396 15.9698 4.06935 17.7751C4.31728 18.023 4.31728 18.425 4.06935 18.673C3.82141 18.921 3.41937 18.9209 3.17152 18.673Z" fill="#7AFFE4"/>
<path d="M5.09462 16.7503C3.56253 15.2182 2.71875 13.18 2.71875 11.0111C2.71875 8.84212 3.56253 6.80391 5.09466 5.27186C5.3426 5.02396 5.74459 5.02396 5.99249 5.27186C6.24038 5.51979 6.24038 5.92175 5.99249 6.16968C4.70016 7.46197 3.98848 9.1813 3.98848 11.0111C3.98848 12.8408 4.70016 14.5602 5.99249 15.8524C6.24042 16.1003 6.24042 16.5023 5.99249 16.7502C5.74489 16.9978 5.34294 16.9985 5.09462 16.7503Z" fill="#00DDC1"/>
<path d="M7.01704 14.8285C5.99847 13.81 5.4375 12.455 5.4375 11.0131C5.4375 9.5712 5.99847 8.21619 7.01704 7.19765C7.26498 6.94972 7.66697 6.94976 7.91486 7.19765C8.1628 7.44559 8.16276 7.84758 7.91486 8.09548C7.1361 8.87416 6.70723 9.91034 6.70723 11.0131C6.70723 12.1158 7.1361 13.152 7.91486 13.9306C8.1628 14.1785 8.1628 14.5805 7.91486 14.8285C7.66727 15.0761 7.26531 15.0768 7.01704 14.8285Z" fill="#7AFFE4"/>
<path d="M4.06935 18.6732C4.31728 18.4253 4.31728 18.0233 4.06935 17.7754C2.26396 15.97 1.26973 13.568 1.26973 11.0117H0C0 13.9072 1.12633 16.6281 3.17152 18.6732C3.41937 18.9211 3.82141 18.9212 4.06935 18.6732Z" fill="#00DDC1"/>
<path d="M5.99249 16.7509C6.24038 16.5029 6.24038 16.101 5.99249 15.8531C4.70016 14.5609 3.98848 12.8415 3.98848 11.0117H2.71875C2.71875 13.1807 3.56253 15.2189 5.09466 16.7509C5.34294 16.9992 5.74489 16.9985 5.99249 16.7509Z" fill="#00B4BC"/>
<path d="M7.91486 14.8271C8.1628 14.5792 8.16276 14.1772 7.91486 13.9293C7.1361 13.1506 6.70723 12.1144 6.70723 11.0117H5.4375C5.4375 12.4536 5.99846 13.8086 7.01704 14.8272C7.26527 15.0754 7.66722 15.0747 7.91486 14.8271Z" fill="#00DDC1"/>
<path d="M10.835 13.6857C12.3123 13.6857 13.5099 12.4881 13.5099 11.0108C13.5099 9.53353 12.3123 8.33594 10.835 8.33594C9.35775 8.33594 8.16016 9.53353 8.16016 11.0108C8.16016 12.4881 9.35775 13.6857 10.835 13.6857Z" fill="#00DDC1"/>
<path d="M10.835 13.6866C12.31 13.6866 13.5099 12.4866 13.5099 11.0117H8.16016C8.16016 12.4867 9.36009 13.6866 10.835 13.6866Z" fill="#00B4BC"/>
</g>
<defs>
<clipPath id="clip0_8194_10077">
<rect width="21.67" height="21.67" fill="white" transform="translate(0 0.164062)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -0,0 +1,4 @@
<svg width="23" height="22" viewBox="0 0 23 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M20.0539 4.23654C21.4826 6.07144 22.3331 8.37817 22.3331 10.8834C22.3331 16.8663 17.4827 21.7167 11.4998 21.7167L10.2744 20.2302L11.4998 18.829C15.8882 18.829 19.4454 15.2717 19.4454 10.8834C19.4454 9.17629 18.9075 7.59487 17.9909 6.29953L11.4998 12.7906L10.5337 11.1112L11.4998 8.97612L16.0837 4.39227C14.7883 3.47567 13.2069 2.93781 11.4998 2.93781L10.2744 1.33418L11.4998 0.0500488C14.005 0.0500488 16.3118 0.900635 18.1467 2.32928L20.4115 0.0500488L22.3331 1.94165L20.0539 4.23654Z" fill="#66B3FF"/>
<path d="M3.55475 10.8834C3.55475 12.5905 4.09261 14.1719 5.00921 15.4672L11.5003 8.97612V12.7906L6.91647 17.3745C8.21182 18.2911 9.79323 18.829 11.5003 18.829V21.7167C8.99512 21.7167 6.68838 20.8661 4.85348 19.4375L2.57214 21.7167L0.666992 19.8116L2.94622 17.5302C1.51758 15.6953 0.666992 13.3886 0.666992 10.8834C0.666992 4.9005 5.51745 0.0500488 11.5003 0.0500488V2.93781C7.11198 2.93781 3.55475 6.49504 3.55475 10.8834Z" fill="#80D4FF"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,18 @@
<svg width="23" height="20" viewBox="0 0 23 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.5833 1.84497L1.22267 16.046C0.0476544 17.6566 1.198 19.9198 3.19166 19.9198H19.975C21.9687 19.9198 23.119 17.6566 21.944 16.046L11.5833 1.84497Z" fill="#F1FAFF"/>
<path d="M21.9431 16.0448L11.5833 1.84497L9.81055 4.27486L18.3975 16.0448C19.5729 17.6558 18.4222 19.9198 16.4279 19.9198H19.9735C21.9678 19.9198 23.1185 17.6559 21.9431 16.0448Z" fill="#C7EEFB"/>
<path d="M13.6602 6.1864H9.51926C8.38838 6.1864 7.47168 5.26966 7.47168 4.13882V2.24846C7.47168 2.13162 7.56643 2.03687 7.68327 2.03687H15.4963C15.6131 2.03687 15.7079 2.13162 15.7079 2.24846V4.13882C15.7079 5.26966 14.7911 6.1864 13.6602 6.1864Z" fill="#E0DDE2"/>
<path d="M15.498 2.03687H14.3393V2.76335C14.3393 3.89681 13.4204 4.81567 12.287 4.81567H8.15546C7.94886 4.81567 7.74959 4.78482 7.56152 4.72807C7.81628 5.57186 8.59934 6.18645 9.52624 6.18645H13.6578C14.7912 6.18645 15.7101 5.26759 15.7101 4.13413V2.24892C15.7101 2.13183 15.6151 2.03687 15.498 2.03687Z" fill="#C8C1C9"/>
<path d="M17.0524 2.78679H6.12858C6.01174 2.78679 5.91699 2.69204 5.91699 2.5752V0.544844C5.91699 0.428003 6.01174 0.333252 6.12858 0.333252H17.0524C17.1692 0.333252 17.264 0.428003 17.264 0.544844V2.5752C17.264 2.69208 17.1693 2.78679 17.0524 2.78679Z" fill="#E0DDE2"/>
<path d="M17.0519 0.333252H15.8129V1.12359C15.8129 1.24073 15.7179 1.33569 15.6008 1.33569H5.91699V2.57473C5.91699 2.69187 6.01195 2.78684 6.12909 2.78684H17.0519C17.1691 2.78684 17.264 2.69187 17.264 2.57473V0.545352C17.264 0.428215 17.1691 0.333252 17.0519 0.333252Z" fill="#C8C1C9"/>
<path d="M11.591 4.95259C11.891 4.95259 12.1342 4.7094 12.1342 4.4094C12.1342 4.10941 11.891 3.86621 11.591 3.86621C11.291 3.86621 11.0479 4.10941 11.0479 4.4094C11.0479 4.7094 11.291 4.95259 11.591 4.95259Z" fill="#FA2A3B"/>
<path d="M11.4636 10.3904C12.0045 10.3904 12.4429 9.95199 12.4429 9.41116C12.4429 8.87032 12.0045 8.43188 11.4636 8.43188C10.9228 8.43188 10.4844 8.87032 10.4844 9.41116C10.4844 9.95199 10.9228 10.3904 11.4636 10.3904Z" fill="#62D8F9"/>
<path d="M11.4638 8.43213C11.3942 8.43213 11.3262 8.43953 11.2607 8.45333C11.7041 8.54685 12.0369 8.94019 12.0369 9.4114C12.0369 9.88261 11.7041 10.276 11.2607 10.3695C11.3263 10.3833 11.3942 10.3907 11.4638 10.3907C12.0046 10.3907 12.4431 9.95222 12.4431 9.4114C12.4431 8.87058 12.0047 8.43213 11.4638 8.43213Z" fill="#00BEF7"/>
<path d="M14.8717 13.5145L13.1586 13.236L12.2278 11.4381C12.1444 11.2501 12.0134 10.9926 11.7241 10.9064L10.637 10.5802C10.5178 10.5512 10.4031 10.5405 10.1997 10.5725L7.88145 11.1109C7.74264 11.1432 7.61865 11.2211 7.5294 11.3322L6.29163 12.8728C6.07157 13.1467 6.1152 13.5471 6.38913 13.7672C6.50661 13.8617 6.64736 13.9075 6.78718 13.9075C6.97338 13.9075 7.15789 13.8262 7.28357 13.6697L8.3836 12.3006L9.47165 12.0479L8.83273 14.1772C8.82045 14.213 8.81652 14.2593 8.79896 14.3605L8.43849 16.9193L6.75734 18.3779C6.49192 18.6082 6.46344 19.0101 6.69374 19.2755C6.81959 19.4205 6.99657 19.4948 7.1746 19.4948C7.32238 19.4948 7.47087 19.4435 7.59127 19.3391L9.45227 17.7244C9.56826 17.6238 9.64393 17.4847 9.66534 17.3326L9.96009 15.2404L9.99932 15.2522L11.5919 17.1109L12.5347 19.1578C12.642 19.3907 12.8723 19.528 13.113 19.528C13.202 19.528 13.2925 19.5092 13.3787 19.4695C13.6979 19.3225 13.8374 18.9446 13.6905 18.6254L12.7106 16.4981C12.686 16.4446 12.6542 16.3949 12.6159 16.3503L11.2825 14.7941L11.7411 13.2658L12.1757 14.1053C12.2683 14.2841 12.44 14.4085 12.6386 14.4408L14.6674 14.7706C14.702 14.7762 14.7364 14.7789 14.7703 14.7789C15.0767 14.7789 15.3468 14.5569 15.3975 14.2447C15.4539 13.8978 15.2185 13.5709 14.8717 13.5145Z" fill="#62D8F9"/>
<path d="M9.74707 10.6776C9.95045 10.6457 10.0645 10.6586 10.1838 10.6876L11.2709 11.0138C11.5602 11.1 11.6911 11.3574 11.7745 11.5454L12.8085 13.5537C12.835 13.6052 12.8845 13.6409 12.9417 13.6497L15.395 14.0282C15.3479 13.7709 15.1447 13.5589 14.8718 13.5145L13.1588 13.236L12.2279 11.4381C12.1445 11.2501 12.0135 10.9926 11.7242 10.9064L10.6372 10.5802C10.5179 10.5512 10.4032 10.5405 10.1998 10.5725L9.74707 10.6776Z" fill="#00BEF7"/>
<path d="M12.7115 16.498C12.6869 16.4446 12.655 16.3948 12.6167 16.3502L11.2833 14.794L11.7419 13.266L11.6837 13.1536C11.6079 13.0072 11.3924 13.0273 11.345 13.1852L10.8916 14.6961C10.8532 14.824 10.8825 14.9627 10.9694 15.0642L12.1634 16.4576C12.2016 16.5023 12.2335 16.552 12.2581 16.6054L13.2379 18.7328C13.3691 19.0176 13.2716 19.3488 13.0223 19.5213C13.0525 19.5257 13.0831 19.528 13.1138 19.528C13.2028 19.528 13.2933 19.5092 13.3795 19.4695C13.6987 19.3224 13.8382 18.9445 13.6913 18.6254L12.7115 16.498Z" fill="#00BEF7"/>
<path d="M4.22827 18.567C4.06064 18.567 3.92032 18.436 3.91092 18.2666C3.83839 16.9594 4.84282 15.8369 6.14991 15.7644C6.32574 15.7553 6.47551 15.8889 6.4852 16.0643C6.49493 16.2398 6.36065 16.3899 6.1852 16.3996C5.22834 16.4528 4.49305 17.2745 4.54616 18.2313C4.5559 18.4067 4.42162 18.5568 4.24617 18.5666C4.2402 18.5669 4.23419 18.567 4.22827 18.567Z" fill="#00BEF7"/>
<path d="M5.51838 18.5804C5.35076 18.5804 5.21044 18.4493 5.20104 18.2799C5.16524 17.635 5.66082 17.0812 6.3057 17.0454C6.48081 17.0358 6.63121 17.17 6.64094 17.3454C6.65068 17.5209 6.51636 17.671 6.34091 17.6807C6.04634 17.6971 5.81994 17.95 5.83627 18.2447C5.84601 18.4201 5.71169 18.5702 5.53624 18.5799C5.53032 18.5802 5.52431 18.5804 5.51838 18.5804Z" fill="#00BEF7"/>
<path d="M17.7606 13.7491C17.7576 13.7491 17.7546 13.749 17.7516 13.749C17.576 13.744 17.4376 13.5977 17.4425 13.4221C17.4691 12.4641 16.7115 11.663 15.7536 11.6364C15.578 11.6315 15.4396 11.4851 15.4445 11.3095C15.4494 11.1339 15.5966 10.9955 15.7713 11.0004C17.0799 11.0368 18.115 12.1311 18.0785 13.4398C18.0737 13.6124 17.9322 13.7491 17.7606 13.7491Z" fill="#00BEF7"/>
<path d="M16.4716 13.7978C16.4686 13.7978 16.4656 13.7978 16.4626 13.7977C16.287 13.7928 16.1486 13.6465 16.1535 13.4708C16.1575 13.328 16.1055 13.1921 16.0074 13.0882C15.9091 12.9844 15.7763 12.925 15.6335 12.921C15.4579 12.9161 15.3195 12.7698 15.3243 12.5942C15.3293 12.4186 15.474 12.2798 15.6512 12.2851C15.964 12.2938 16.2546 12.4238 16.4696 12.6511C16.6846 12.8784 16.7982 13.1758 16.7895 13.4886C16.7846 13.6611 16.6432 13.7978 16.4716 13.7978Z" fill="#00BEF7"/>
</svg>

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -26,6 +26,7 @@
buildConfiguration = "Debug-prod"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
@ -54,6 +55,7 @@
buildConfiguration = "Debug-prod"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

View File

@ -270,7 +270,7 @@ class AuthCubit extends Cubit<AuthState> {
Future<bool> reSendOtp({bool? forget}) async {
try {
emit(AuthLoading());
emit(ResendOtpLoading());
await AuthenticationAPI.sendOtp(body: {
'email': email,
'type': forget == true ? 'PASSWORD' : 'VERIFICATION'
@ -286,7 +286,10 @@ class AuthCubit extends Cubit<AuthState> {
}
verifyOtp(bool isForgotPass) async {
emit(AuthLoginLoading());
if (otpCode.length != 6) {
return;
}
emit(AuthOtpLoading());
try {
final response = await AuthenticationAPI.verifyPassCode(body: {
'email': email,

View File

@ -20,9 +20,13 @@ class AuthLoginLoading extends AuthLoading {}
class AuthLoginSuccess extends AuthSuccess {}
class AuthSignUpSuccess extends AuthSuccess {}
class AuthOtpSuccess extends AuthSuccess {}
class AuthSignUpSuccess extends AuthSuccess {}
class AuthOtpLoading extends AuthLoading {}
class ResendOtpLoading extends AuthLoading {}
class ResendOtpSuccess extends AuthSuccess {}

View File

@ -22,7 +22,7 @@ class UserModel {
final DateTime? appAgreementAcceptedAt;
final Role? role;
final Project? project;
final int? points;
UserModel({
required this.uuid,
required this.email,
@ -41,6 +41,7 @@ class UserModel {
required this.appAgreementAcceptedAt,
required this.role,
required this.project,
this.points,
});
factory UserModel.fromJson(Map<String, dynamic> json) {
@ -67,33 +68,36 @@ class UserModel {
role: json['role'] != null ? Role.fromJson(json['role']) : null,
project:
json['project'] != null ? Project.fromJson(json['project']) : null,
points: json['points'],
);
}
factory UserModel.fromToken(Token token) {
Map<String, dynamic> tempJson = Token.decodeToken(token.accessToken);
return UserModel(
uuid: tempJson['uuid'].toString(),
email: tempJson['email'],
lastName: tempJson['lastName'],
firstName: tempJson['firstName'],
profilePicture: UserModel.decodeBase64Image(tempJson['profilePicture']),
phoneNumber: null,
isEmailVerified: null,
isAgreementAccepted: null,
regionUuid: null,
regionName: tempJson['region']?['regionName'],
timeZone: tempJson['timezone']?['timeZoneOffset'],
hasAcceptedWebAgreement: tempJson['hasAcceptedWebAgreement'],
webAgreementAcceptedAt: tempJson['webAgreementAcceptedAt'] != null
? DateTime.parse(tempJson['webAgreementAcceptedAt'])
: null,
hasAcceptedAppAgreement: tempJson['hasAcceptedAppAgreement'],
appAgreementAcceptedAt: tempJson['appAgreementAcceptedAt'] != null
? DateTime.parse(tempJson['appAgreementAcceptedAt'])
: null,
role: tempJson['role'] != null ? Role.fromJson(tempJson['role']) : null,
project: null);
uuid: tempJson['uuid'].toString(),
email: tempJson['email'],
lastName: tempJson['lastName'],
firstName: tempJson['firstName'],
profilePicture: UserModel.decodeBase64Image(tempJson['profilePicture']),
phoneNumber: null,
isEmailVerified: null,
isAgreementAccepted: null,
regionUuid: null,
regionName: tempJson['region']?['regionName'],
timeZone: tempJson['timezone']?['timeZoneOffset'],
hasAcceptedWebAgreement: tempJson['hasAcceptedWebAgreement'],
webAgreementAcceptedAt: tempJson['webAgreementAcceptedAt'] != null
? DateTime.parse(tempJson['webAgreementAcceptedAt'])
: null,
hasAcceptedAppAgreement: tempJson['hasAcceptedAppAgreement'],
appAgreementAcceptedAt: tempJson['appAgreementAcceptedAt'] != null
? DateTime.parse(tempJson['appAgreementAcceptedAt'])
: null,
role: tempJson['role'] != null ? Role.fromJson(tempJson['role']) : null,
project: null,
points: tempJson['points'],
);
}
static Uint8List? decodeBase64Image(String? base64String) {

View File

@ -321,7 +321,7 @@ class _OtpViewState extends State<OtpView> {
Expanded(
child: DefaultButton(
isDone: state is AuthLoginSuccess,
isLoading: state is AuthLoading,
isLoading: state is AuthOtpLoading,
customButtonStyle: ButtonStyle(
backgroundColor:
MaterialStateProperty.all(
@ -349,8 +349,8 @@ class _OtpViewState extends State<OtpView> {
),
Expanded(
child: DefaultButton(
isDone: state is AuthLoginSuccess,
isLoading: state is AuthLoading,
isDone: state is ResendOtpSuccess,
isLoading: state is ResendOtpLoading,
customButtonStyle: ButtonStyle(
backgroundColor:
MaterialStateProperty.all(
@ -383,7 +383,8 @@ class _OtpViewState extends State<OtpView> {
if (success) {
showDialog(
context: context,
builder: (_) =>const SuccessDialog(
builder: (_) =>
const SuccessDialog(
key: ValueKey(
'SuccessDialog'),
message: 'New OTP sent!',

View File

@ -0,0 +1,32 @@
import 'package:syncrow_app/features/booking_system/domain/booking_model.dart';
import 'package:syncrow_app/features/booking_system/domain/booking_service.dart';
class BookingDummySource implements BookingService {
@override
Future<List<BookingModel>> get() async {
await Future.delayed(Duration(seconds: 2));
return [
BookingModel(
uuid: 'uuid1',
roomName: 'roomName1',
date: 'wed 28th May 2025',
timeSlot: '10:30 AM - 11:30 AM',
cost: 4,
),
BookingModel(
uuid: 'uuid2',
roomName: 'roomName2',
date: 'wed 28th May 2025',
timeSlot: '10:30 AM - 11:30 AM',
cost: 6,
),
BookingModel(
uuid: 'uuid3',
roomName: 'roomName3',
date: 'thur 2th june 2025',
timeSlot: '10:30 AM - 1:30 PM',
cost: 10,
)
];
}
}

View File

@ -0,0 +1,35 @@
import 'package:dio/dio.dart';
import 'package:syncrow_app/features/booking_system/domain/booking_model.dart';
import 'package:syncrow_app/features/booking_system/domain/booking_service.dart';
import 'package:syncrow_app/services/api/api_links_endpoints.dart';
import 'package:syncrow_app/services/api/http_service.dart';
class BookingRemoteSource implements BookingService {
final HTTPService _httpService;
BookingRemoteSource(this._httpService);
@override
Future<List<BookingModel>> get() async {
try {
return _httpService.get(
path: ApiEndpoints.upcomingBookings,
expectedResponseModel: (json) {
return BookingModel.fromJsonList(json['data']);
},
);
} on DioException catch (e) {
return [];
// final message = e.response?.data as Map<String, dynamic>?;
// final error = message?['error'] as Map<String, dynamic>?;
// final errorMessage = error?['error'] as String? ?? '';
// final formattedErrorMessage =
// [_defaultErrorMessage, errorMessage].join(': ');
// throw APIException(formattedErrorMessage);
// } catch (e) {
// final formattedErrorMessage = [_defaultErrorMessage, '$e'].join(': ');
// throw APIException(formattedErrorMessage);
// }
//
}
}
}

View File

@ -0,0 +1,39 @@
class BookingModel {
final String uuid, roomName, date, timeSlot;
final int cost;
BookingModel({
required this.uuid,
required this.roomName,
required this.date,
required this.timeSlot,
required this.cost,
});
factory BookingModel.zero() => BookingModel(
uuid: '',
roomName: '',
date: '',
timeSlot: '',
cost: -1,
);
factory BookingModel.fromJson(Map<String, dynamic> json) => BookingModel(
uuid: json['uuid'] as String,
roomName: json['roomName'] as String,
date: json['date'] as String,
timeSlot: json['timeSlot'] as String,
cost: json['cost'] as int,
);
static List<BookingModel> fromJsonList(List<dynamic> jsonList) => jsonList
.map(
(bookModel) => BookingModel.fromJson(bookModel),
)
.toList();
Map<String, dynamic> toJson() => {
'uuid': uuid,
'roomName': roomName,
'date': date,
'timeSlot': timeSlot,
'cost': cost,
};
}

View File

@ -0,0 +1,5 @@
import 'package:syncrow_app/features/booking_system/domain/booking_model.dart';
abstract interface class BookingService {
Future<List<BookingModel>> get();
}

View File

@ -0,0 +1,32 @@
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import '../../../domain/booking_model.dart';
import '../../../domain/booking_service.dart';
part 'past_bookings_event.dart';
part 'past_bookings_state.dart';
class PastBookingsBloc extends Bloc<PastBookingsEvent, PastBookingsState> {
final BookingService _bookingService;
PastBookingsBloc(this._bookingService) : super(PastBookingsInitial()) {
on<GetPastBookingsEvent>(_onGetPastBookingsEvent);
}
Future<void> _onGetPastBookingsEvent(
GetPastBookingsEvent event,
Emitter<PastBookingsState> emit,
) async {
emit(PastBookingLoadingState());
try {
final pastBookings = await _bookingService.get();
emit(
PastBookingLoadedState(pastBookings: pastBookings),
);
} catch (e) {
emit(
PastBookingErrorState(e.toString()),
);
}
}
}

View File

@ -0,0 +1,10 @@
part of 'past_bookings_bloc.dart';
sealed class PastBookingsEvent extends Equatable {
const PastBookingsEvent();
@override
List<Object> get props => [];
}
class GetPastBookingsEvent extends PastBookingsEvent {}

View File

@ -0,0 +1,24 @@
part of 'past_bookings_bloc.dart';
sealed class PastBookingsState extends Equatable {
const PastBookingsState();
@override
List<Object> get props => [];
}
final class PastBookingsInitial extends PastBookingsState {}
final class PastBookingLoadingState extends PastBookingsState {}
final class PastBookingLoadedState extends PastBookingsState {
final List<BookingModel> pastBookings;
const PastBookingLoadedState({
required this.pastBookings,
});
}
final class PastBookingErrorState extends PastBookingsState {
final String errorMsg;
const PastBookingErrorState(this.errorMsg);
}

View File

@ -0,0 +1,32 @@
import 'package:equatable/equatable.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/booking_system/domain/booking_model.dart';
import 'package:syncrow_app/features/booking_system/domain/booking_service.dart';
part 'upcoming_bookings_event.dart';
part 'upcoming_bookings_state.dart';
class UpcomingBookingsBloc
extends Bloc<UpcomingBookingsEvent, UpcomingBookingsState> {
final BookingService _bookingService;
UpcomingBookingsBloc(this._bookingService)
: super(UpcomingBookingsInitial()) {
on<GetUpcomingBookingsEvent>(_onGetUpcomingBookingsEvent);
}
Future<void> _onGetUpcomingBookingsEvent(
GetUpcomingBookingsEvent event,
Emitter<UpcomingBookingsState> emit,
) async {
emit(UpcomingBookingLoadingState());
try {
final upcomingBookings = await _bookingService.get();
emit(
UpcomingBookingLoadedState(upcomingBookings: upcomingBookings),
);
} catch (e) {
emit(
UpcomingBookingErrorState(e.toString()),
);
}
}
}

View File

@ -0,0 +1,10 @@
part of 'upcoming_bookings_bloc.dart';
sealed class UpcomingBookingsEvent extends Equatable {
const UpcomingBookingsEvent();
@override
List<Object> get props => [];
}
class GetUpcomingBookingsEvent extends UpcomingBookingsEvent {}

View File

@ -0,0 +1,24 @@
part of 'upcoming_bookings_bloc.dart';
sealed class UpcomingBookingsState extends Equatable {
const UpcomingBookingsState();
@override
List<Object> get props => [];
}
final class UpcomingBookingsInitial extends UpcomingBookingsState {}
final class UpcomingBookingLoadingState extends UpcomingBookingsState {}
final class UpcomingBookingLoadedState extends UpcomingBookingsState {
final List<BookingModel> upcomingBookings;
const UpcomingBookingLoadedState({
required this.upcomingBookings,
});
}
final class UpcomingBookingErrorState extends UpcomingBookingsState {
final String errorMsg;
const UpcomingBookingErrorState(this.errorMsg);
}

View File

@ -0,0 +1,89 @@
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/booking_system/presentation/widgets/booking_appbar_widget.dart';
import 'package:syncrow_app/features/shared_widgets/default_button.dart';
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
import 'package:syncrow_app/utils/helpers/app_size.dart';
import '../../../../utils/resource_manager/color_manager.dart';
import '../widgets/row_of_title_arrow_widget.dart';
class BookPage extends StatelessWidget {
const BookPage({super.key});
@override
Widget build(BuildContext context) {
return DefaultScaffold(
padding: EdgeInsets.zero,
appBar: BookingAppBar(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 20,
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 10),
child: Text(
'Booking Details',
style: TextStyle(
fontSize: 15,
color: ColorsManager.grayColor,
fontWeight: FontWeight.bold,
),
),
),
SizedBox(
height: 5,
),
Container(
padding: EdgeInsets.all(10),
height: deviceHeight(context) * 0.25,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20)),
color: ColorsManager.onPrimaryColor,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RowOfTitleAndArrowWidget(
title: 'Space',
onTap: () {},
),
Divider(
color: ColorsManager.grayButtonColors,
),
RowOfTitleAndArrowWidget(
title: 'Booking Date',
onTap: () {},
),
Divider(
color: ColorsManager.grayButtonColors,
),
RowOfTitleAndArrowWidget(
title: 'Time Slot',
onTap: () {},
)
],
),
),
SizedBox(
height: 30,
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 10),
child: DefaultButton(
backgroundColor: ColorsManager.blueColor1,
child: Text(
'Book Now',
style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.bold,
),
),
),
),
],
),
);
}
}

View File

@ -0,0 +1,67 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
import 'package:syncrow_app/features/booking_system/data/booking_dummy_source.dart';
import 'package:syncrow_app/features/booking_system/presentation/blocs/upcoming_bookings_bloc/upcoming_bookings_bloc.dart';
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
import '../blocs/past_bookings_bloc/past_bookings_bloc.dart';
import '../widgets/booking_appbar_widget.dart';
import '../widgets/current_balance_widget.dart';
import '../widgets/past_booking_widget.dart';
import '../widgets/upcoming_bookings_widget.dart';
class BookingSystemPage extends StatelessWidget {
const BookingSystemPage({super.key});
@override
Widget build(BuildContext context) {
return MultiBlocProvider(
providers: [
BlocProvider<UpcomingBookingsBloc>(
create: (_) => UpcomingBookingsBloc(BookingDummySource())
..add(GetUpcomingBookingsEvent()),
),
BlocProvider<PastBookingsBloc>(
create: (_) => PastBookingsBloc(BookingDummySource())
..add(GetPastBookingsEvent()),
)
],
child: DefaultScaffold(
appBar: BookingAppBar(),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 20,
),
Expanded(
flex: 2,
child: CurrentBalanceWidget(
userBalance: HomeCubit.user!.points == null
? '0'
: HomeCubit.user!.points.toString(),
),
),
SizedBox(
height: 20,
),
Expanded(
flex: 8,
child: Column(
children: [
UpcomingBookingsWidget(),
SizedBox(
height: 10,
),
PastBookingsWidget(),
],
),
)
],
),
),
));
}
}

View File

@ -0,0 +1,29 @@
import 'package:flutter/material.dart';
import '../../../../utils/resource_manager/color_manager.dart';
class BookingAppBar extends StatelessWidget implements PreferredSizeWidget {
const BookingAppBar({super.key});
@override
Widget build(BuildContext context) {
return AppBar(
backgroundColor: Colors.transparent,
centerTitle: true,
leading: IconButton(
onPressed: () => Navigator.pop(context),
icon: Icon(Icons.arrow_back_ios_new)),
title: Text(
'Booking',
style: TextStyle(
color: ColorsManager.blueColor1,
fontSize: 15,
fontWeight: FontWeight.bold,
),
),
);
}
@override
Size get preferredSize => const Size.fromHeight(kToolbarHeight);
}

View File

@ -0,0 +1,105 @@
import 'package:flutter/material.dart';
import '../../../../utils/resource_manager/color_manager.dart';
import '../../domain/booking_model.dart';
class BookingCardWidget extends StatelessWidget {
const BookingCardWidget({
super.key,
required this.bookingModel,
});
final BookingModel bookingModel;
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(15),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20)),
color: ColorsManager.onPrimaryColor,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
bookingModel.roomName,
style: TextStyle(
color: ColorsManager.blackColor,
fontSize: 17,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 15,
),
Text(
'Booking Date',
style: TextStyle(
color: ColorsManager.grayColor,
fontSize: 15,
),
),
Text(
bookingModel.date,
style: TextStyle(
color: ColorsManager.blackColor,
fontSize: 15,
fontWeight: FontWeight.w500,
),
),
SizedBox(
height: 15,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Time slot',
style: TextStyle(
color: ColorsManager.grayColor,
fontSize: 15,
),
),
Text(
bookingModel.timeSlot,
style: TextStyle(
color: ColorsManager.blackColor,
fontSize: 15,
fontWeight: FontWeight.w500,
),
),
],
),
SizedBox(
width: 80,
),
Column(
children: [
Text(
'cost',
style: TextStyle(
color: ColorsManager.grayColor,
fontSize: 15,
),
),
Text(
bookingModel.cost.toString(),
style: TextStyle(
color: ColorsManager.blackColor,
fontSize: 15,
fontWeight: FontWeight.w500,
),
),
],
),
],
)
],
),
);
}
}

View File

@ -0,0 +1,97 @@
import 'package:flutter/material.dart';
import '../../../../utils/resource_manager/color_manager.dart';
import '../screens/book_page.dart';
class CurrentBalanceWidget extends StatelessWidget {
final String userBalance;
const CurrentBalanceWidget({
super.key,
required this.userBalance,
});
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: ColorsManager.onPrimaryColor,
borderRadius: BorderRadius.circular(20)),
child: Row(
children: [
Expanded(
flex: 75,
child: Padding(
padding: EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
'Current Balance',
style: TextStyle(
color: ColorsManager.blackColor,
fontWeight: FontWeight.bold,
fontSize: 17,
),
)),
SizedBox(
height: 10,
),
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
userBalance,
style: TextStyle(
color: ColorsManager.blueColor1,
fontWeight: FontWeight.bold,
fontSize: 50),
),
SizedBox(
width: 5,
),
Text(
'Points',
style: TextStyle(
color: ColorsManager.blueColor1,
fontWeight: FontWeight.bold,
fontSize: 17),
),
],
)),
],
),
)),
Expanded(
flex: 25,
child: InkWell(
//TODO:should use custom Navigator
onTap: () => Navigator.of(context).push(MaterialPageRoute(
builder: (context) => BookPage(),
)),
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.only(left: 15),
height: double.infinity,
decoration: BoxDecoration(
color: ColorsManager.blueColor,
borderRadius:
BorderRadius.horizontal(right: Radius.circular(20)),
),
child: Text(
'Book Now',
style: TextStyle(
color: ColorsManager.onPrimaryColor,
fontWeight: FontWeight.bold,
fontSize: 20),
),
),
),
)
],
),
);
}
}

View File

@ -0,0 +1,64 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../../../../utils/helpers/app_size.dart';
import '../../../../utils/resource_manager/color_manager.dart';
import '../../../shared_widgets/default_button.dart';
import '../blocs/past_bookings_bloc/past_bookings_bloc.dart';
import 'booking_card_widget.dart';
class PastBookingsWidget extends StatelessWidget {
const PastBookingsWidget({super.key});
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Past Bookings',
style: TextStyle(
fontSize: 15,
color: ColorsManager.grayColor,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 10,
),
BlocBuilder<PastBookingsBloc, PastBookingsState>(
builder: (context, state) {
if (state is PastBookingLoadingState) {
return CircularProgressIndicator();
} else if (state is PastBookingErrorState) {
return DefaultButton(
onPressed: () => context
.read<PastBookingsBloc>()
.add(GetPastBookingsEvent()),
child: Text('Try again'),
);
} else if (state is PastBookingLoadedState) {
return SizedBox(
height: deviceHeight(context) * 0.3,
child: state.pastBookings.isEmpty
? Text('You Dont Have past Bookings')
: ListView.separated(
separatorBuilder: (context, index) => SizedBox(
height: 10,
),
itemCount: state.pastBookings.length,
itemBuilder: (context, index) {
final pastBooking = state.pastBookings[index];
return BookingCardWidget(bookingModel: pastBooking);
},
),
);
} else {
return SizedBox();
}
},
)
],
);
}
}

View File

@ -0,0 +1,40 @@
import 'package:flutter/material.dart';
import '../../../../utils/resource_manager/color_manager.dart';
class RowOfTitleAndArrowWidget extends StatelessWidget {
final String title;
final void Function() onTap;
const RowOfTitleAndArrowWidget({
super.key,
required this.title,
required this.onTap,
});
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: EdgeInsets.all(10),
child: Text(
title,
style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.bold,
),
),
),
IconButton(
onPressed: onTap,
icon: Icon(
Icons.arrow_forward_ios,
color: ColorsManager.grayColor,
size: 15,
),
)
],
);
}
}

View File

@ -0,0 +1,66 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../../../../utils/helpers/app_size.dart';
import '../../../../utils/resource_manager/color_manager.dart';
import '../../../shared_widgets/default_button.dart';
import '../blocs/upcoming_bookings_bloc/upcoming_bookings_bloc.dart';
import 'booking_card_widget.dart';
class UpcomingBookingsWidget extends StatelessWidget {
const UpcomingBookingsWidget({super.key});
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Upcoming Bookings',
style: TextStyle(
fontSize: 15,
color: ColorsManager.grayColor,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 10,
),
BlocBuilder<UpcomingBookingsBloc, UpcomingBookingsState>(
builder: (context, state) {
if (state is UpcomingBookingLoadingState) {
//TODO:should use CustomLoadingWidget
return CircularProgressIndicator();
} else if (state is UpcomingBookingErrorState) {
//TODO:shold use CustomErrorWidget
return DefaultButton(
onPressed: () => context
.read<UpcomingBookingsBloc>()
.add(GetUpcomingBookingsEvent()),
child: Text('Try again'),
);
} else if (state is UpcomingBookingLoadedState) {
return SizedBox(
height: deviceHeight(context) * 0.3,
child: state.upcomingBookings.isEmpty
? Text('You Dont Have Upcoming Bookings')
: ListView.separated(
separatorBuilder: (context, index) => SizedBox(
height: 10,
),
itemCount: state.upcomingBookings.length,
itemBuilder: (context, index) {
final upcomingBooking = state.upcomingBookings[index];
return BookingCardWidget(
bookingModel: upcomingBooking);
},
),
);
} else {
return SizedBox();
}
},
)
],
);
}
}

View File

@ -179,7 +179,8 @@ class DeviceManagerBloc extends Bloc<DeviceManagerEvent, DeviceManagerState> {
DeviceType.ThreeGang,
DeviceType.OneGang,
DeviceType.TwoGang,
DeviceType.WH
DeviceType.WH,
DeviceType.FlushMountedSensor,
};
return devices

View File

@ -22,6 +22,7 @@ class FlushSensorBloc extends Bloc<FlushSensorEvent, FlushSensorState> {
on<FlushSensorChangeValueEvent>(_changeValue);
on<FlushSensorUpdatedEvent>(_flushSensorUpdated);
on<FlushSensorGetDeviceReportsEvent>(_getDeviceReports);
on<FlushSensorInitialDeviceInfo>(fetchDeviceInfo);
}
void _fetchFlushSensorStatus(
@ -118,7 +119,7 @@ class FlushSensorBloc extends Bloc<FlushSensorEvent, FlushSensorState> {
Emitter<FlushSensorState> emit) async {
emit(FlushSensorLoadingInitialState());
try {
await DevicesAPI.getDeviceReports(deviceId, event.code).then((value) {
await DevicesAPI.getReports(deviceId, event.code).then((value) {
emit(FlushSensorDeviceReportsState(
deviceReport: value, code: event.code));
});
@ -128,5 +129,51 @@ class FlushSensorBloc extends Bloc<FlushSensorEvent, FlushSensorState> {
}
}
DeviceInfoModel deviceInfo = DeviceInfoModel(
activeTime: 0,
category: "",
categoryName: "",
createTime: 0,
gatewayId: "",
icon: "",
ip: "",
lat: "",
localKey: "",
lon: "",
model: "",
name: "",
nodeId: "",
online: false,
ownerId: "",
productName: "",
sub: false,
timeZone: "",
updateTime: 0,
uuid: "",
productUuid: "",
productType: "",
permissionType: "",
macAddress: "",
subspace: Subspace(
uuid: "",
createdAt: "",
updatedAt: "",
subspaceName: "",
),
);
static String deviceName = '';
void fetchDeviceInfo(FlushSensorInitialDeviceInfo event,
Emitter<FlushSensorState> emit) async {
try {
emit(FlushSensorLoadingInitialState());
var response = await DevicesAPI.getDeviceInfo(deviceId);
deviceInfo = DeviceInfoModel.fromJson(response);
deviceName = deviceInfo.name;
emit(FlushSensorLoadingDeviceInfo(deviceInfo: deviceInfo));
emit(FlushSensorUpdateState(flushSensorModel: deviceStatus));
} catch (e) {
emit(FlushSensorFailedState(error: e.toString()));
}
}
}

View File

@ -11,7 +11,7 @@ class FlushSensorLoadingEvent extends FlushSensorEvent {}
class FlushSensorInitialEvent extends FlushSensorEvent {}
class FlushSensorInitialDeviseInfo extends FlushSensorEvent {}
class FlushSensorInitialDeviceInfo extends FlushSensorEvent {}
class FlushSensorUpdatedEvent extends FlushSensorEvent {}

View File

@ -149,7 +149,6 @@ class SmartDoorBloc extends Bloc<SmartDoorEvent, SmartDoorState> {
_streamSubscription = null;
return super.close();
}
_doorLockUpdated(DoorLockUpdated event, Emitter<SmartDoorState> emit) {
unlockRequest = deviceStatus.unlockRequest;
@ -254,18 +253,42 @@ class SmartDoorBloc extends Bloc<SmartDoorEvent, SmartDoorState> {
}
void _updateLock(UpdateLockEvent event, Emitter<SmartDoorState> emit) async {
emit(LoadingNewSate(smartDoorModel: deviceStatus));
final oldValue = deviceStatus.normalOpenSwitch;
deviceStatus = deviceStatus.copyWith(normalOpenSwitch: !oldValue);
emit(UpdateState(smartDoorModel: deviceStatus));
try {
// final response = await DevicesAPI.controlDevice(
// DeviceControlModel(deviceId: deviceId, code: 'normal_open_switch', value: !event.value),
// deviceId);
final response = await DevicesAPI.openDoorLock(deviceId);
if (response) {
deviceStatus.normalOpenSwitch = !event.value;
if (!response) {
_revertValueAndEmit(deviceId, 'normal_open_switch', oldValue, emit);
}
} catch (_) {}
} catch (_) {
_revertValueAndEmit(deviceId, 'normal_open_switch', oldValue, emit);
}
}
void _revertValueAndEmit(String deviceId, String code, dynamic oldValue,
Emitter<SmartDoorState> emit) {
_updateLocalValue(code, oldValue);
emit(UpdateState(smartDoorModel: deviceStatus));
emit(const FailedState(errorMessage: 'Failed to control the device.'));
}
void _updateLocalValue(String code, dynamic value) {
switch (code) {
case 'normal_open_switch':
if (value is bool) {
deviceStatus = deviceStatus.copyWith(normalOpenSwitch: value);
}
break;
case 'reverse_lock':
if (value is bool) {
deviceStatus = deviceStatus.copyWith(reverseLock: value);
}
break;
default:
break;
}
emit(UpdateState(smartDoorModel: deviceStatus));
}
@ -331,6 +354,7 @@ class SmartDoorBloc extends Bloc<SmartDoorEvent, SmartDoorState> {
Future<void> selectTimeOnlinePassword(
SelectTimeOnlinePasswordEvent event, Emitter<SmartDoorState> emit) async {
effectiveTimeTimeStamp ??= DateTime.now().millisecondsSinceEpoch ~/ 1000;
emit(ChangeTimeState());
final DateTime? picked = await showDatePicker(
context: event.context,
@ -375,7 +399,13 @@ class SmartDoorBloc extends Bloc<SmartDoorEvent, SmartDoorState> {
selectedDateTime.minute,
).millisecondsSinceEpoch ~/
1000; // Divide by 1000 to remove milliseconds
final currentTimestamp = DateTime.now().millisecondsSinceEpoch ~/ 1000;
if (event.isEffective) {
if (selectedTimestamp < currentTimestamp) {
CustomSnackBar.displaySnackBar(
'Effective Time cannot be later than Expiration Time.');
return;
}
if (expirationTimeTimeStamp != null &&
selectedTimestamp > expirationTimeTimeStamp!) {
CustomSnackBar.displaySnackBar(

View File

@ -55,31 +55,33 @@ class DeviceInfoModel {
factory DeviceInfoModel.fromJson(Map<String, dynamic> json) {
return DeviceInfoModel(
activeTime: json['activeTime'],
category: json['category'],
categoryName: json['categoryName'],
createTime: json['createTime'],
gatewayId: json['gatewayId'],
icon: json['icon'],
activeTime: json['activeTime'] ?? '',
category: json['category'] ?? '',
categoryName: json['categoryName'] ?? '',
createTime: json['createTime'] ?? '',
gatewayId: json['gatewayId'] ?? '',
icon: json['icon'] ?? '',
ip: json['ip'] ?? "",
lat: json['lat'],
localKey: json['localKey'],
lon: json['lon'],
model: json['model'],
name: json['name'],
nodeId: json['nodeId'],
online: json['online'],
ownerId: json['ownerId'],
productName: json['productName'],
sub: json['sub'],
timeZone: json['timeZone'],
updateTime: json['updateTime'],
uuid: json['uuid'],
productUuid: json['productUuid'],
productType: json['productType'],
lat: json['lat'] ?? '',
localKey: json['localKey'] ?? '',
lon: json['lon'] ?? '',
model: json['model'] ?? '',
name: json['name'] ?? '',
nodeId: json['nodeId'] ?? '',
online: json['online'] ?? '',
ownerId: json['ownerId'] ?? '',
productName: json['productName'] ?? '',
sub: json['sub'] ?? '',
timeZone: json['timeZone'] ?? '',
updateTime: json['updateTime'] ?? '',
uuid: json['uuid'] ?? '',
productUuid: json['productUuid'] ?? '',
productType: json['productType'] ?? '',
permissionType: json['permissionType'] ?? '',
macAddress: json['macAddress'],
subspace: Subspace.fromJson(json['subspace']),
macAddress: json['macAddress'] ?? '',
subspace: json['subspace'] != null
? Subspace.fromJson(json['subspace'])
: throw ArgumentError('subspace cannot be null'),
);
}
@ -129,10 +131,10 @@ class Subspace {
factory Subspace.fromJson(Map<String, dynamic> json) {
return Subspace(
uuid: json['uuid'],
createdAt: json['createdAt'],
updatedAt: json['updatedAt'],
subspaceName: json['subspaceName'],
uuid: json['uuid'] ?? '',
createdAt: json['createdAt'] ?? '',
updatedAt: json['updatedAt'] ?? '',
subspaceName: json['subspaceName'] ?? '',
);
}

View File

@ -113,4 +113,44 @@ class SmartDoorModel {
remoteNoDpKey: _remoteNoDpKey,
normalOpenSwitch: _normalOpenSwitch);
}
SmartDoorModel copyWith({
String? uuid,
int? unlockFingerprint,
int? unlockPassword,
int? unlockTemporary,
int? unlockCard,
String? alarmLock,
int? unlockRequest,
int? residualElectricity,
bool? reverseLock,
int? unlockApp,
bool? hijack,
bool? doorbell,
String? unlockOfflinePd,
String? unlockOfflineClear,
String? unlockDoubleKit,
String? remoteNoPdSetkey,
String? remoteNoDpKey,
bool? normalOpenSwitch,
}) {
return SmartDoorModel(
unlockAlarm: alarmLock ?? unlockAlarm,
unlockFingerprint: unlockFingerprint ?? this.unlockFingerprint,
unlockPassword: unlockPassword ?? this.unlockPassword,
unlockTemporary: unlockTemporary ?? this.unlockTemporary,
unlockCard: unlockCard ?? this.unlockCard,
unlockRequest: unlockRequest ?? this.unlockRequest,
residualElectricity: residualElectricity ?? this.residualElectricity,
reverseLock: reverseLock ?? this.reverseLock,
unlockApp: unlockApp ?? this.unlockApp,
hijack: hijack ?? this.hijack,
doorbell: doorbell ?? this.doorbell,
unlockOfflinePd: unlockOfflinePd ?? this.unlockOfflinePd,
unlockOfflineClear: unlockOfflineClear ?? this.unlockOfflineClear,
unlockDoubleKit: unlockDoubleKit ?? this.unlockDoubleKit,
remoteNoPdSetkey: remoteNoPdSetkey ?? this.remoteNoPdSetkey,
remoteNoDpKey: remoteNoDpKey ?? this.remoteNoDpKey,
normalOpenSwitch: normalOpenSwitch ?? this.normalOpenSwitch,
);
}
}

View File

@ -22,180 +22,198 @@ class SettingProfilePage extends StatelessWidget {
Widget build(BuildContext context) {
var spaces = HomeCubit.getInstance().spaces;
return DefaultScaffold(
title: 'Device Settings',
leading: IconButton(
onPressed: () {
Navigator.of(context).pop(true);
},
icon: const Icon(Icons.arrow_back_ios)),
child: BlocProvider(
create: (context) => DeviceSettingBloc(deviceId: device?.uuid ?? '')
..add(const DeviceSettingInitial())
..add(const DeviceSettingInitialInfo()),
child: BlocBuilder<DeviceSettingBloc, DeviceSettingState>(
builder: (context, state) {
final _bloc = BlocProvider.of<DeviceSettingBloc>(context);
return state is DeviceSettingLoadingState
? const Center(
child: DefaultContainer(
width: 50,
height: 50,
child: CircularProgressIndicator()),
)
: RefreshIndicator(
onRefresh: () async {
_bloc.add(const DeviceSettingInitial());
},
child: ListView(
children: [
CircleAvatar(
radius: device!.type != "SOS" ? 60 : 52,
backgroundColor: Colors.white,
child: device!.type == "SOS"
? ClipOval(
child: SvgPicture.asset(
Assets.sosHomeIcon,
fit: BoxFit.fitHeight,
height:
MediaQuery.of(context).size.height * 0.13,
))
: CircleAvatar(
radius: 55,
backgroundColor: ColorsManager.graysColor,
child: ClipOval(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Center(
child: SvgPicture.asset(
device!.type == "4S"
? Assets.fourSceneIcon
: Assets.sixSceneIcon,
fit: BoxFit.contain,
height: MediaQuery.of(context)
.size
.height *
0.08,
),
),
],
),
),
),
),
const SizedBox(
height: 10,
),
SizedBox(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
IntrinsicWidth(
child: ConstrainedBox(
constraints:
const BoxConstraints(maxWidth: 200),
child: TextFormField(
maxLength: 30,
style: const TextStyle(
color: Colors.black,
),
textAlign: TextAlign.center,
focusNode: _bloc.focusNode,
controller: _bloc.nameController,
enabled: _bloc.editName,
onEditingComplete: () {
_bloc.add(const SaveNameEvent());
},
decoration: const InputDecoration(
hintText: "Your Name",
border: InputBorder.none,
fillColor: Colors.white10,
counterText: '',
),
),
),
),
const SizedBox(width: 5),
InkWell(
onTap: () {
_bloc.add(const ChangeNameEvent(value: true));
},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10),
child: SvgPicture.asset(
Assets.sosEditProfile,
color: Colors.grey,
fit: BoxFit.contain,
height: MediaQuery.of(context).size.height *
0.02,
),
),
),
],
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) {
return;
}
Navigator.of(context).pop(true);
},
child: DefaultScaffold(
title: 'Device Settings',
leading: IconButton(
onPressed: () {
Navigator.of(context).pop(true);
},
icon: const Icon(Icons.arrow_back_ios)),
child: BlocProvider(
create: (context) => DeviceSettingBloc(deviceId: device?.uuid ?? '')
..add(const DeviceSettingInitial())
..add(const DeviceSettingInitialInfo()),
child: BlocBuilder<DeviceSettingBloc, DeviceSettingState>(
builder: (context, state) {
final _bloc = BlocProvider.of<DeviceSettingBloc>(context);
return state is DeviceSettingLoadingState
? const Center(
child: DefaultContainer(
width: 50,
height: 50,
child: CircularProgressIndicator()),
)
: RefreshIndicator(
onRefresh: () async {
_bloc.add(const DeviceSettingInitial());
},
child: ListView(
children: [
buildDeviceAvatar(context, device!),
const SizedBox(
height: 10,
),
),
const SizedBox(height: 20),
const BodyMedium(
text: 'Smart Device Information',
fontWeight: FontWeight.w700,
fontSize: 12,
fontColor: ColorsManager.grayColor,
),
const SizedBox(height: 7),
DefaultContainer(
padding: const EdgeInsets.all(20),
child: InkWell(
onTap: () async {
if (HomeCubit.visitorPasswordManagement) {
bool? val = await Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => LocationSettingPage(
space: spaces!.first,
deviceId: device?.uuid ?? '',
)),
);
if (val != null && val == true) {
_bloc.add(const DeviceSettingInitialInfo());
}
}
},
SizedBox(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(
child: Text('Location'),
),
Row(
children: [
SizedBox(
child: BodyMedium(
text: _bloc
.deviceInfo.subspace.subspaceName,
fontColor: ColorsManager.textGray,
IntrinsicWidth(
child: ConstrainedBox(
constraints:
const BoxConstraints(maxWidth: 200),
child: TextFormField(
maxLength: 30,
style: const TextStyle(
color: Colors.black,
),
textAlign: TextAlign.center,
focusNode: _bloc.focusNode,
controller: _bloc.nameController,
enabled: _bloc.editName,
onEditingComplete: () {
_bloc.add(const SaveNameEvent());
},
decoration: const InputDecoration(
hintText: "Your Name",
border: InputBorder.none,
fillColor: Colors.white10,
counterText: '',
),
),
const Icon(
Icons.arrow_forward_ios,
size: 15,
color: ColorsManager.textGray,
),
),
const SizedBox(width: 5),
InkWell(
onTap: () {
_bloc.add(
const ChangeNameEvent(value: true));
},
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: 10),
child: SvgPicture.asset(
Assets.sosEditProfile,
color: Colors.grey,
fit: BoxFit.contain,
height:
MediaQuery.of(context).size.height *
0.02,
),
],
)
),
),
],
),
),
)
],
),
);
},
const SizedBox(height: 20),
const BodyMedium(
text: 'Smart Device Information',
fontWeight: FontWeight.w700,
fontSize: 12,
fontColor: ColorsManager.grayColor,
),
const SizedBox(height: 7),
DefaultContainer(
padding: const EdgeInsets.all(20),
child: InkWell(
onTap: () async {
if (HomeCubit.visitorPasswordManagement) {
bool? val = await Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
LocationSettingPage(
space: spaces!.first,
deviceId: device?.uuid ?? '',
)),
);
if (val != null && val == true) {
_bloc.add(const DeviceSettingInitialInfo());
}
}
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
const SizedBox(
child: Text('Location'),
),
Row(
children: [
SizedBox(
child: BodyMedium(
text: _bloc
.deviceInfo.subspace.subspaceName,
fontColor: ColorsManager.textGray,
),
),
const Icon(
Icons.arrow_forward_ios,
size: 15,
color: ColorsManager.textGray,
),
],
)
],
),
),
)
],
),
);
},
),
),
),
);
}
Widget buildDeviceAvatar(BuildContext context, DeviceModel device) {
final isSOSDevice = device.type == "SOS";
final assetIcon = isSOSDevice
? Assets.sosHomeIcon
: device.type == 'NCPS'
? Assets.flushIcon
: device.type == '4S'
? Assets.fourSceneIcon
: Assets.sixSceneIcon;
final avatarRadius = isSOSDevice ? 52.0 : 60.0;
final innerAvatarRadius = 55.0;
final assetHeightFactor = isSOSDevice ? 0.13 : 0.08;
return CircleAvatar(
radius: avatarRadius,
backgroundColor: Colors.white,
child: ClipOval(
child: isSOSDevice
? SvgPicture.asset(
assetIcon,
fit: BoxFit.fitHeight,
height: MediaQuery.of(context).size.height * assetHeightFactor,
)
: CircleAvatar(
radius: innerAvatarRadius,
backgroundColor: ColorsManager.graysColor,
child: Center(
child: SvgPicture.asset(
assetIcon,
fit: BoxFit.contain,
height:
MediaQuery.of(context).size.height * assetHeightFactor,
),
),
),
),
);
}
}

View File

@ -28,397 +28,449 @@ class SettingsPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DefaultScaffold(
title: 'Device Settings',
child: BlocProvider(
create: (context) => DeviceSettingBloc(deviceId: device?.uuid ?? '')
..add(const DeviceSettingInitial())
..add(const DeviceSettingInitialInfo()),
child: BlocBuilder<DeviceSettingBloc, DeviceSettingState>(
builder: (context, state) {
final _bloc = BlocProvider.of<DeviceSettingBloc>(context);
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) {
return;
}
Navigator.of(context).pop(true);
},
child: DefaultScaffold(
title: 'Device Settings',
child: BlocProvider(
create: (context) => DeviceSettingBloc(deviceId: device?.uuid ?? '')
..add(const DeviceSettingInitial())
..add(const DeviceSettingInitialInfo()),
child: BlocBuilder<DeviceSettingBloc, DeviceSettingState>(
builder: (context, state) {
final _bloc = BlocProvider.of<DeviceSettingBloc>(context);
return state is DeviceSettingLoadingState
? const Center(
child:
DefaultContainer(width: 50, height: 50, child: CircularProgressIndicator()),
)
: ListView(
children: [
Padding(
padding: const EdgeInsets.symmetric(
vertical: 10,
),
child: InkWell(
onTap: () async {
bool val = await Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => SettingProfilePage(
device: device,
),
),
);
if (val == true) {
_bloc.add(const DeviceSettingInitialInfo());
}
},
child: Stack(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const SizedBox(height: 20),
DefaultContainer(
borderRadius: const BorderRadius.all(Radius.circular(30)),
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Padding(
padding: const EdgeInsets.only(left: 90),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
child: Text(
_bloc.deviceInfo.name,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w700,
color: ColorsManager.grayColor,
),
overflow: TextOverflow
.ellipsis, // Adds ellipsis (...) when the text overflows.
maxLines:
1, // Restricts the text to a single line.
)),
const SizedBox(
height: 5,
),
BodySmall(
text: _bloc.deviceInfo.subspace.subspaceName),
],
),
),
SvgPicture.asset(
Assets.editNameSetting,
fit: BoxFit.contain,
height: 30,
),
],
),
),
),
),
],
),
Positioned(
top: 0,
left: 20,
child: CircleAvatar(
radius: 43,
backgroundColor: Colors.white,
child: CircleAvatar(
radius: 40,
backgroundColor: Colors.white,
child: CircleAvatar(
radius: 40,
backgroundColor: ColorsManager.backgroundColor,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
device!.type == "SOS"
? ClipOval(
child: SvgPicture.asset(
Assets.sosHomeIcon,
fit: BoxFit.contain,
height: 70,
),
)
: Padding(
padding: device!.type == "4S"
? const EdgeInsets.only(top: 5)
: const EdgeInsets.only(top: 0),
child: SizedBox(
height: 70,
child: SvgPicture.asset(
device!.type == "4S"
? Assets.fourSceneIcon
: Assets.sixSceneIcon,
fit: BoxFit.contain,
),
),
),
],
),
),
)),
),
],
return state is DeviceSettingLoadingState
? const Center(
child: DefaultContainer(
width: 50,
height: 50,
child: CircularProgressIndicator()),
)
: ListView(
children: [
Padding(
padding: const EdgeInsets.symmetric(
vertical: 10,
),
),
),
const SizedBox(height: 20),
const BodyMedium(
text: 'Device Management',
fontWeight: FontWeight.w700,
fontSize: 12,
fontColor: ColorsManager.grayColor,
),
DefaultContainer(
child: Column(
children: [
SettingWidget(
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => SettingInfoPage(
device: device!,
)),
);
},
text: 'Device Information',
icon: Assets.infoIcon,
),
// const Divider(
// color: ColorsManager.dividerColor,
// ),
// SettingWidget(
// onTap: () {
// Navigator.of(context).push(
// MaterialPageRoute(
// builder: (context) =>
// ShareFourScenePage(
// device: device!)),
// );
// },
// text: 'Tap-to Run and Automation',
// icon: Assets.tapRunIcon,
// ),
],
),
),
const SizedBox(height: 20),
// const BodyMedium(
// text: 'Device Offline Notification',
// fontWeight: FontWeight.w700,
// fontSize: 12,
// fontColor: ColorsManager.grayColor,
// ),
// DefaultContainer(
// child: Column(
// children: [
// SettingWidget(
// value: _bloc.enableAlarm,
// onChanged: (p0) {
// context
// .read<DeviceSettingBloc>()
// .add(ToggleEnableAlarmEvent(p0));
// },
// isNotification: true,
// onTap: () {},
// text: 'Offline Notification',
// icon: Assets.notificationIcon,
// ),
// ],
// ),
// ),
// const SizedBox(height: 20),
// const BodyMedium(
// text: 'Others',
// fontWeight: FontWeight.w700,
// fontSize: 12,
// fontColor: ColorsManager.grayColor,
// ),
// const SizedBox(height: 5),
// DefaultContainer(
// child: Column(
// children: [
// SettingWidget(
// onTap: () {
// Navigator.of(context).push(
// MaterialPageRoute(
// builder: (context) =>
// ShareDevicePage(device: device!)),
// );
// },
// text: 'Share Device',
// icon: Assets.shareIcon,
// ),
// // const Divider(
// // color: ColorsManager.dividerColor,
// // ),
// // SettingWidget(
// // onTap: () {
// // Navigator.of(context).push(
// // MaterialPageRoute(
// // builder: (context) =>
// // FourSceneCreateGroup(
// // device: device!)),
// // );
// // },
// // text: 'Create Group',
// // icon: Assets.createGroupIcon,
// // ),
// const Divider(
// color: ColorsManager.dividerColor,
// ),
// SettingWidget(
// onTap: () {
// Navigator.of(context).push(
// MaterialPageRoute(
// builder: (context) =>
// FaqSettingPage(device: device!)),
// );
// },
// text: 'Device FAQ',
// icon: Assets.faqIcon,
// ),
// const Divider(
// color: ColorsManager.dividerColor,
// ),
// SettingWidget(
// onTapUpdate: () {
// showDialog(
// context: context,
// builder: (context) {
// return UpdateInfoDialog(
// cancelTab: () {
// Navigator.of(context).pop();
// },
// confirmTab: () {
// Navigator.of(context).pop();
// },
// );
// },
// );
// },
// isUpdate: true,
// onTap: () {
// Navigator.of(context).push(
// MaterialPageRoute(
// builder: (context) =>
// const UpdatePageSetting()),
// );
// },
// text: 'Device Update',
// icon: Assets.updateIcon,
// ),
// ],
// ),
// ),
const SizedBox(height: 20),
InkWell(
onTap: () {
showModalBottomSheet(
context: context,
builder: (BuildContext context) {
return Container(
height: 200,
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisSize: MainAxisSize.min,
child: InkWell(
onTap: () async {
bool val = await Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => SettingProfilePage(
device: device,
),
),
);
if (val == true) {
_bloc.add(const DeviceSettingInitialInfo());
}
},
child: Stack(
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.stretch,
children: [
const BodyMedium(
text: 'Remove Device',
fontWeight: FontWeight.w700,
fontSize: 16,
fontColor: ColorsManager.red,
),
const SizedBox(height: 10),
const SizedBox(
width: 250,
child: Divider(
color: ColorsManager.dividerColor,
),
),
const SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
showDialog(
context: context,
builder: (context) {
return DisconnectDeviceDialog(
cancelTab: () {
Navigator.of(context).pop();
},
confirmTab: () {
Navigator.of(context).pop();
},
);
},
);
},
child: const BodyMedium(
text: 'Disconnect Device',
fontWeight: FontWeight.w400,
fontSize: 15,
fontColor: ColorsManager.textPrimaryColor,
),
),
const Icon(
Icons.keyboard_arrow_right,
color: ColorsManager.textGray,
)
],
),
const SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
showDialog(
context: context,
builder: (context) {
return DisconnectWipeData(
cancelTab: () {
Navigator.of(context).pop();
},
confirmTab: () {
_bloc.add(DeleteDeviceEvent());
},
);
},
);
},
child: const BodyMedium(
text: 'Disconnect Device and Wipe Data',
fontWeight: FontWeight.w400,
fontSize: 15,
fontColor: ColorsManager.textPrimaryColor,
DefaultContainer(
borderRadius: const BorderRadius.all(
Radius.circular(30)),
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Padding(
padding:
const EdgeInsets.only(left: 90),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SizedBox(
child: Text(
_bloc.deviceInfo.name,
style: const TextStyle(
fontSize: 16,
fontWeight:
FontWeight.w700,
color: ColorsManager
.grayColor,
),
overflow: TextOverflow
.ellipsis, // Adds ellipsis (...) when the text overflows.
maxLines:
1, // Restricts the text to a single line.
)),
const SizedBox(
height: 5,
),
BodySmall(
text: _bloc
.deviceInfo
.subspace
.subspaceName),
],
),
),
SvgPicture.asset(
Assets.editNameSetting,
fit: BoxFit.contain,
height: 30,
),
],
),
),
const Icon(
Icons.keyboard_arrow_right,
color: ColorsManager.textGray,
)
],
),
),
],
),
);
},
);
},
child: const Center(
child: BodyMedium(
text: 'Remove Device',
fontWeight: FontWeight.w400,
fontSize: 15,
fontColor: ColorsManager.red,
Positioned(
top: 0,
left: 20,
child: CircleAvatar(
radius: 43,
backgroundColor: Colors.white,
child: CircleAvatar(
radius: 40,
backgroundColor: Colors.white,
child: CircleAvatar(
radius: 40,
backgroundColor:
ColorsManager.backgroundColor,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: [
device!.type == 'NCPS'
? SizedBox(
height: 80,
width: 50,
child: SvgPicture.asset(
Assets.flushIcon,
fit: BoxFit.contain,
),
)
: device!.type == "SOS"
? ClipOval(
child:
SvgPicture.asset(
Assets.sosHomeIcon,
fit: BoxFit.contain,
height: 70,
),
)
: Padding(
padding: device!
.type ==
"4S"
? const EdgeInsets
.only(top: 5)
: const EdgeInsets
.only(top: 0),
child: SizedBox(
height: 70,
child: SvgPicture
.asset(
device!.type ==
"4S"
? Assets
.fourSceneIcon
: Assets
.sixSceneIcon,
fit: BoxFit
.contain,
),
),
),
],
),
),
)),
),
],
),
),
),
),
],
);
},
const SizedBox(height: 20),
const BodyMedium(
text: 'Device Management',
fontWeight: FontWeight.w700,
fontSize: 12,
fontColor: ColorsManager.grayColor,
),
DefaultContainer(
child: Column(
children: [
SettingWidget(
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => SettingInfoPage(
device: device!,
)),
);
},
text: 'Device Information',
icon: Assets.infoIcon,
),
// const Divider(
// color: ColorsManager.dividerColor,
// ),
// SettingWidget(
// onTap: () {
// Navigator.of(context).push(
// MaterialPageRoute(
// builder: (context) =>
// ShareFourScenePage(
// device: device!)),
// );
// },
// text: 'Tap-to Run and Automation',
// icon: Assets.tapRunIcon,
// ),
],
),
),
const SizedBox(height: 20),
// const BodyMedium(
// text: 'Device Offline Notification',
// fontWeight: FontWeight.w700,
// fontSize: 12,
// fontColor: ColorsManager.grayColor,
// ),
// DefaultContainer(
// child: Column(
// children: [
// SettingWidget(
// value: _bloc.enableAlarm,
// onChanged: (p0) {
// context
// .read<DeviceSettingBloc>()
// .add(ToggleEnableAlarmEvent(p0));
// },
// isNotification: true,
// onTap: () {},
// text: 'Offline Notification',
// icon: Assets.notificationIcon,
// ),
// ],
// ),
// ),
// const SizedBox(height: 20),
// const BodyMedium(
// text: 'Others',
// fontWeight: FontWeight.w700,
// fontSize: 12,
// fontColor: ColorsManager.grayColor,
// ),
// const SizedBox(height: 5),
// DefaultContainer(
// child: Column(
// children: [
// SettingWidget(
// onTap: () {
// Navigator.of(context).push(
// MaterialPageRoute(
// builder: (context) =>
// ShareDevicePage(device: device!)),
// );
// },
// text: 'Share Device',
// icon: Assets.shareIcon,
// ),
// // const Divider(
// // color: ColorsManager.dividerColor,
// // ),
// // SettingWidget(
// // onTap: () {
// // Navigator.of(context).push(
// // MaterialPageRoute(
// // builder: (context) =>
// // FourSceneCreateGroup(
// // device: device!)),
// // );
// // },
// // text: 'Create Group',
// // icon: Assets.createGroupIcon,
// // ),
// const Divider(
// color: ColorsManager.dividerColor,
// ),
// SettingWidget(
// onTap: () {
// Navigator.of(context).push(
// MaterialPageRoute(
// builder: (context) =>
// FaqSettingPage(device: device!)),
// );
// },
// text: 'Device FAQ',
// icon: Assets.faqIcon,
// ),
// const Divider(
// color: ColorsManager.dividerColor,
// ),
// SettingWidget(
// onTapUpdate: () {
// showDialog(
// context: context,
// builder: (context) {
// return UpdateInfoDialog(
// cancelTab: () {
// Navigator.of(context).pop();
// },
// confirmTab: () {
// Navigator.of(context).pop();
// },
// );
// },
// );
// },
// isUpdate: true,
// onTap: () {
// Navigator.of(context).push(
// MaterialPageRoute(
// builder: (context) =>
// const UpdatePageSetting()),
// );
// },
// text: 'Device Update',
// icon: Assets.updateIcon,
// ),
// ],
// ),
// ),
const SizedBox(height: 20),
InkWell(
onTap: () {
showModalBottomSheet(
context: context,
builder: (BuildContext context) {
return Container(
height: 200,
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const BodyMedium(
text: 'Remove Device',
fontWeight: FontWeight.w700,
fontSize: 16,
fontColor: ColorsManager.red,
),
const SizedBox(height: 10),
const SizedBox(
width: 250,
child: Divider(
color: ColorsManager.dividerColor,
),
),
const SizedBox(height: 10),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
showDialog(
context: context,
builder: (context) {
return DisconnectDeviceDialog(
cancelTab: () {
Navigator.of(context)
.pop();
},
confirmTab: () {
Navigator.of(context)
.pop();
},
);
},
);
},
child: const BodyMedium(
text: 'Disconnect Device',
fontWeight: FontWeight.w400,
fontSize: 15,
fontColor: ColorsManager
.textPrimaryColor,
),
),
const Icon(
Icons.keyboard_arrow_right,
color: ColorsManager.textGray,
)
],
),
const SizedBox(height: 20),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
showDialog(
context: context,
builder: (context) {
return DisconnectWipeData(
cancelTab: () {
Navigator.of(context)
.pop();
},
confirmTab: () {
_bloc.add(
DeleteDeviceEvent());
},
);
},
);
},
child: const BodyMedium(
text:
'Disconnect Device and Wipe Data',
fontWeight: FontWeight.w400,
fontSize: 15,
fontColor: ColorsManager
.textPrimaryColor,
),
),
const Icon(
Icons.keyboard_arrow_right,
color: ColorsManager.textGray,
)
],
),
],
),
);
},
);
},
child: const Center(
child: BodyMedium(
text: 'Remove Device',
fontWeight: FontWeight.w400,
fontSize: 15,
fontColor: ColorsManager.red,
),
),
),
],
);
},
),
),
),
);

View File

@ -46,7 +46,7 @@ class SixSceneScreen extends StatelessWidget {
model = state.device;
}
return DefaultScaffold(
title: device?.name ?? '6 Scene Switch',
title: bloc.deviceInfo.name ,
actions: [
InkWell(
onTap: () async {
@ -55,7 +55,7 @@ class SixSceneScreen extends StatelessWidget {
builder: (context) => SettingsPage(device: device!),
),
);
if (val == null) {
if (val == null || val == true) {
bloc.add(const SixSceneInitialInfo());
bloc.add(const SixSceneInitial());
bloc.add(const SexSceneSwitchInitial());
@ -195,8 +195,8 @@ class SixSceneScreen extends StatelessWidget {
);
if (value == true) {
Future.delayed(
const Duration(milliseconds: 200),
() {
const Duration(
milliseconds: 200), () {
bloc.add(
const SexSceneSwitchInitial());
});

View File

@ -23,7 +23,7 @@ class FlushPresenceRecords extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DefaultScaffold(
title: title,
title: 'Presence Record',
child: BlocProvider(
create: (context) => FlushSensorBloc(deviceId: deviceId)
..add(FlushSensorGetDeviceReportsEvent(
@ -95,17 +95,15 @@ class FlushPresenceRecords extends StatelessWidget {
SizedBox(
child: ListTile(
leading: Icon(
record.value == 'true'
record.value == "presence"
? Icons.radio_button_checked
: Icons.radio_button_unchecked,
color: record.value == 'true'
color: record.value == "presence"
? Colors.blue
: Colors.grey,
),
title: Text(
record.value == 'true'
? "Opened"
: "Closed",
record.value.toString(),
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,

View File

@ -9,7 +9,6 @@ import 'package:syncrow_app/features/devices/bloc/flush_sensor_bloc/flush_sensor
import 'package:syncrow_app/features/devices/model/device_model.dart';
import 'package:syncrow_app/features/devices/model/flush_sensor_model.dart';
import 'package:syncrow_app/features/devices/view/device_settings/settings_page.dart';
import 'package:syncrow_app/features/devices/view/widgets/device_appbar.dart';
import 'package:syncrow_app/features/devices/view/widgets/flush_sensor/flush_persence_records.dart';
import 'package:syncrow_app/features/devices/view/widgets/flush_sensor/flush_sensor_option.dart';
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
@ -20,7 +19,6 @@ import 'package:syncrow_app/utils/context_extension.dart';
import 'package:syncrow_app/utils/helpers/misc_string_helpers.dart';
import 'package:syncrow_app/utils/helpers/snack_bar.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
import 'package:syncrow_app/utils/resource_manager/constants.dart';
import 'package:syncrow_app/utils/resource_manager/font_manager.dart';
part "presence_indicator.dart";
part "flush_sensor_options_list.dart";
@ -33,7 +31,8 @@ class FlushMountedInterface extends StatelessWidget {
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => FlushSensorBloc(deviceId: deviceModel.uuid ?? '')
..add(FlushSensorInitialEvent()),
..add(FlushSensorInitialEvent())
..add(FlushSensorInitialDeviceInfo()),
child: BlocBuilder<FlushSensorBloc, FlushSensorState>(
builder: (context, state) {
final bloc = BlocProvider.of<FlushSensorBloc>(context);
@ -61,8 +60,25 @@ class FlushMountedInterface extends StatelessWidget {
statusBarIconBrightness: Brightness.light,
),
child: DefaultScaffold(
title: deviceModel.name!,
title: FlushSensorBloc.deviceName,
actions: [
InkWell(
onTap: () async {
var val = await Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
SettingsPage(device: deviceModel),
),
);
if (val == null || val == true) {
bloc.add(FlushSensorInitialDeviceInfo());
bloc.add(FlushSensorInitialEvent());
}
},
child: SvgPicture.asset(Assets.assetsIconsSettings),
),
const SizedBox(width: 10),
],
child: Container(
width: MediaQuery.sizeOf(context).width,
height: MediaQuery.sizeOf(context).height,

View File

@ -47,7 +47,7 @@ class FourSceneScreen extends StatelessWidget {
}
return DefaultScaffold(
title: device?.name ?? '4 Scene',
title: _bloc.deviceInfo.name,
actions: [
InkWell(
onTap: () async {
@ -56,7 +56,7 @@ class FourSceneScreen extends StatelessWidget {
builder: (context) => SettingsPage(device: device!),
),
);
if (val == null) {
if (val == null || val == true) {
_bloc.add(const FourSceneInitial());
_bloc.add(const FourSceneInitialInfo());
_bloc.add(const FourSceneSwitchInitial());
@ -164,8 +164,7 @@ class FourSceneScreen extends StatelessWidget {
cancelTab: () {
Navigator.of(context).pop();
},
confirmTab:
(switchSelected) {
confirmTab: (switchSelected) {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>

View File

@ -11,6 +11,9 @@ class NameTimeWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
DateTime now = DateTime.now();
DateTime cleaned =
DateTime(now.year, now.month, now.day, now.hour, now.minute);
return DefaultContainer(
padding: const EdgeInsets.all(20),
child: Column(
@ -59,19 +62,22 @@ class NameTimeWidget extends StatelessWidget {
width: MediaQuery.of(context).size.width / 3.5,
child: InkWell(
onTap: () {
BlocProvider.of<SmartDoorBloc>(context).add(SelectTimeOnlinePasswordEvent(context: context, isEffective: true));
BlocProvider.of<SmartDoorBloc>(context).add(
SelectTimeOnlinePasswordEvent(
context: context, isEffective: true));
},
child: Text(
BlocProvider.of<SmartDoorBloc>(context).effectiveTime,
style: TextStyle(fontSize: 14,
color: BlocProvider.of<SmartDoorBloc>(context).effectiveTime ==
BlocProvider.of<SmartDoorBloc>(context)
.effectiveTime ==
'Select Time'
? ColorsManager.textGray
: null),
? cleaned.toString()
: BlocProvider.of<SmartDoorBloc>(context)
.effectiveTime,
style: TextStyle(fontSize: 14),
),
)),
],),
],
),
),
const Divider(
color: ColorsManager.graysColor,
@ -96,10 +102,13 @@ class NameTimeWidget extends StatelessWidget {
context: context, isEffective: false));
},
child: Text(
BlocProvider.of<SmartDoorBloc>(context).expirationTime,
BlocProvider.of<SmartDoorBloc>(context)
.expirationTime,
style: TextStyle(
fontSize: 14,
color: BlocProvider.of<SmartDoorBloc>(context).expirationTime == 'Select Time'
color: BlocProvider.of<SmartDoorBloc>(context)
.expirationTime ==
'Select Time'
? ColorsManager.textGray
: null),
),

View File

@ -6,10 +6,9 @@ import 'package:syncrow_app/features/devices/bloc/smart_door_bloc/smart_door_eve
import 'package:syncrow_app/features/devices/model/device_model.dart';
import 'package:syncrow_app/features/devices/model/smart_door_model.dart';
import 'package:syncrow_app/generated/assets.dart';
import 'package:syncrow_app/utils/context_extension.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class DoorLockButton extends StatefulWidget {
class DoorLockButton extends StatelessWidget {
const DoorLockButton({
super.key,
required this.doorLock,
@ -18,157 +17,79 @@ class DoorLockButton extends StatefulWidget {
final DeviceModel doorLock;
final SmartDoorModel smartDoorModel;
@override
State<DoorLockButton> createState() => _DoorLockButtonState(smartDoorModel: smartDoorModel);
}
class _DoorLockButtonState extends State<DoorLockButton> with SingleTickerProviderStateMixin {
late AnimationController _animationController;
late Animation<double> _animation;
SmartDoorModel smartDoorModel;
_DoorLockButtonState({required this.smartDoorModel});
@override
void initState() {
super.initState();
_animationController = AnimationController(
vsync: this,
value: context.read<SmartDoorBloc>().unlockRequest > 0 ? 1 : 0,
duration: Duration(seconds: context.read<SmartDoorBloc>().unlockRequest),
);
if (context.read<SmartDoorBloc>().unlockRequest > 0) {
_animationController.reverse();
}
_animation = Tween<double>(begin: 0, end: 1).animate(_animationController)
..addListener(() {
setState(() {});
});
}
@override
void didUpdateWidget(DoorLockButton oldWidget) {
super.didUpdateWidget(oldWidget);
if (_animationController.status == AnimationStatus.dismissed) {
if (context.read<SmartDoorBloc>().unlockRequest > 0) {
_animationController.value = 1;
_animationController.duration =
Duration(seconds: context.read<SmartDoorBloc>().unlockRequest);
_animationController.reverse();
}
}
}
@override
void dispose() {
_animationController.dispose();
super.dispose();
double _calculateProgress() {
final value = smartDoorModel.unlockRequest;
if (value <= 0 || value > 30) return 0;
return value / 30.0;
}
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.only(
right: context.width * 0.25 / 2,
left: context.width * 0.25 / 2,
bottom: context.width * 0.2 / 2,
),
final progress = _calculateProgress();
final isEnabled = smartDoorModel.unlockRequest > 0;
return SizedBox(
width: 255,
height: 255,
child: InkWell(
overlayColor:
WidgetStateProperty.all(ColorsManager.primaryColorWithOpacity.withOpacity(0.1)),
borderRadius: BorderRadius.circular(999),
onTapDown: (details) {
// if (_animationController.status == AnimationStatus.dismissed) {
// _animationController.forward();
// } else if (_animationController.status == AnimationStatus.completed) {
// _animationController.reverse();
// } else if (_animationController.status == AnimationStatus.forward) {
// _animationController.reverse();
// } else if (_animationController.status == AnimationStatus.reverse) {
// _animationController.forward();
// }
if (context.read<SmartDoorBloc>().unlockRequest > 0) {
BlocProvider.of<SmartDoorBloc>(context)
.add(UpdateLockEvent(value: smartDoorModel.normalOpenSwitch));
}
},
onTapUp: (details) {
// if (_animationController.status == AnimationStatus.forward) {
// _animationController.reverse();
// } else if (_animationController.status == AnimationStatus.reverse) {
// _animationController.forward();
// }
},
onTap: isEnabled
? () {
BlocProvider.of<SmartDoorBloc>(context).add(
UpdateLockEvent(value: !smartDoorModel.normalOpenSwitch),
);
}
: null,
child: Container(
width: context.width * 06,
height: context.width * 0.6,
margin: const EdgeInsets.all(10),
decoration: const BoxDecoration(
width: 255,
height: 255,
decoration: BoxDecoration(
color: const Color(0xFFEBECED),
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: Colors.grey,
color: Colors.grey.withOpacity(0.5),
blurRadius: 18,
// offset: Offset(6, 7),
blurStyle: BlurStyle.outer,
),
],
color: Color(0xFFEBECED),
borderRadius: BorderRadius.all(Radius.circular(999)),
),
child: Padding(
padding: const EdgeInsets.all(25),
child: Stack(
alignment: Alignment.center,
children: [
Container(
margin: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(999),
boxShadow: [
BoxShadow(
color: Colors.white.withOpacity(0.5),
blurRadius: 30,
offset: const Offset(-5, -5),
blurStyle: BlurStyle.outer,
),
BoxShadow(
color: Colors.black.withOpacity(0.14),
blurRadius: 25,
offset: const Offset(5, 5),
blurStyle: BlurStyle.outer,
),
BoxShadow(
color: Colors.black.withOpacity(0.14),
blurRadius: 30,
offset: const Offset(5, 5),
blurStyle: BlurStyle.inner,
),
],
),
child: Center(
child: SvgPicture.asset(
smartDoorModel.normalOpenSwitch
? Assets.doorUnlockIcon
: Assets.assetsIconsDoorlockAssetsLockIcon,
),
child: Stack(
alignment: Alignment.center,
children: [
Container(
margin: const EdgeInsets.all(30),
decoration: const BoxDecoration(
color: Color(0xFFF9F9F9),
shape: BoxShape.circle,
),
child: Center(
child: SvgPicture.asset(
smartDoorModel.normalOpenSwitch
? Assets.doorUnlockIcon
: Assets.assetsIconsDoorlockAssetsLockIcon,
width: 60,
height: 60,
),
),
SizedBox.expand(
),
if (progress > 0)
Container(
decoration: BoxDecoration(shape: BoxShape.circle),
height: 250,
width: 250,
child: CircularProgressIndicator(
value: _animation.value,
strokeWidth: 15,
value: progress,
strokeWidth: 8,
backgroundColor: Colors.transparent,
valueColor: const AlwaysStoppedAnimation<Color>(ColorsManager.primaryColor),
valueColor: const AlwaysStoppedAnimation<Color>(
ColorsManager.primaryColor),
),
)
],
),
),
],
),
),
),
);
}
}
}

View File

@ -18,7 +18,8 @@ import 'package:syncrow_app/utils/resource_manager/font_manager.dart';
class CreateOfflineTimeLimitPasswordPage extends StatelessWidget {
final String? deviceId;
final String? type;
const CreateOfflineTimeLimitPasswordPage({super.key, this.deviceId, this.type});
const CreateOfflineTimeLimitPasswordPage(
{super.key, this.deviceId, this.type});
@override
Widget build(BuildContext context) {
bool isRepeat = false;
@ -28,9 +29,7 @@ class CreateOfflineTimeLimitPasswordPage extends StatelessWidget {
child: BlocConsumer<SmartDoorBloc, SmartDoorState>(
listener: (context, state) {
if (state is FailedState) {
CustomSnackBar.displaySnackBar(
state.errorMessage
);
CustomSnackBar.displaySnackBar(state.errorMessage);
}
if (state is IsRepeatState) {
isRepeat = state.repeat;
@ -39,6 +38,10 @@ class CreateOfflineTimeLimitPasswordPage extends StatelessWidget {
generated = state.generated;
}
}, builder: (context, state) {
DateTime now = DateTime.now();
DateTime cleaned =
DateTime(now.year, now.month, now.day, now.hour, now.minute);
final smartDoorBloc = BlocProvider.of<SmartDoorBloc>(context);
return DefaultScaffold(
appBar: AppBar(
@ -85,46 +88,56 @@ class CreateOfflineTimeLimitPasswordPage extends StatelessWidget {
Flexible(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: smartDoorBloc.passwordController.text.isEmpty ?
List.generate(10, (index) {
return const Padding(
padding: EdgeInsets.symmetric(
horizontal: 4.0,
vertical: 15),
child: Icon(
Icons.circle,
size: 20.0,
color: Colors.black,
),
);
}) : [
Expanded(
child: Row(
children: [
children: smartDoorBloc
.passwordController.text.isEmpty
? List.generate(10, (index) {
return const Padding(
padding: EdgeInsets.symmetric(
horizontal: 4.0,
vertical: 15),
child: Icon(
Icons.circle,
size: 20.0,
color: Colors.black,
),
);
})
: [
Expanded(
child: BodyLarge(
style: const TextStyle(
color: ColorsManager.primaryColor,
fontWeight: FontWeight.bold,
letterSpacing: 8.0,
fontSize: 25,
wordSpacing: 2),
textAlign: TextAlign.center,
text: smartDoorBloc.passwordController.text,
fontSize: 25,
child: Row(
children: [
Expanded(
child: BodyLarge(
style: const TextStyle(
color: ColorsManager
.primaryColor,
fontWeight:
FontWeight.bold,
letterSpacing: 8.0,
fontSize: 25,
wordSpacing: 2),
textAlign:
TextAlign.center,
text: smartDoorBloc
.passwordController
.text,
fontSize: 25,
),
),
IconButton(
onPressed: () async {
await Clipboard.setData(
ClipboardData(
text: smartDoorBloc
.passwordController
.text));
},
icon: const Icon(
Icons.copy)),
],
),
),
IconButton(
onPressed: () async {
await Clipboard.setData(
ClipboardData(text: smartDoorBloc.passwordController.text)
);
},
icon: const Icon(Icons.copy)),
],
),
),
],
)),
const SizedBox(
width: 10,
@ -135,91 +148,142 @@ class CreateOfflineTimeLimitPasswordPage extends StatelessWidget {
padding: const EdgeInsets.all(20),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Container(
padding: const EdgeInsets.all(10.0),
child: const BodyMedium(
text: 'Password Name',
fontWeight: FontWeight.normal,
),
),
),
SizedBox(
width: MediaQuery.of(context).size.width / 2.6,
child: TextFormField(
controller: BlocProvider.of<SmartDoorBloc>(context).passwordNameController,
decoration:
const InputDecoration(
hintText: 'Enter The Name',
hintStyle: TextStyle(
fontSize: 14,
color: ColorsManager.textGray)
),
)),
],
),
Column(
children: [
const Divider(color: ColorsManager.graysColor,),
Padding(
padding: const EdgeInsets.all(10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Expanded(
child: BodyMedium(
text: 'Effective Time',
fontWeight: FontWeight.normal,
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Container(
padding:
const EdgeInsets.all(10.0),
child: const BodyMedium(
text: 'Password Name',
fontWeight: FontWeight.normal,
),
),
),
),
SizedBox(
width: MediaQuery.of(context).size.width / 3.5,
child: InkWell(
onTap: () {
BlocProvider.of<SmartDoorBloc>(context).add(SelectTimeEvent(context: context, isEffective: true));
},
child: Text(
BlocProvider.of<SmartDoorBloc>(context).effectiveTime,
style: TextStyle(
fontSize: 14,
color: BlocProvider.of<SmartDoorBloc>(context).effectiveTime ==
'Select Time' ? ColorsManager.textGray : null),
),
)),],
),
),
const Divider(
color: ColorsManager.graysColor,
),
Padding(
padding: const EdgeInsets.all(10.0),
child: Row(mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
const Expanded(
child: BodyMedium(
text: 'Expiration Time',
fontWeight: FontWeight.normal,
),
),
SizedBox(
width: MediaQuery.of(context).size.width / 3.5,
child: InkWell(
onTap: () {
BlocProvider.of<SmartDoorBloc>(context).add(SelectTimeEvent(
context: context,
isEffective: false));
},
child: Text(
BlocProvider.of<SmartDoorBloc>(context).expirationTime,
style: TextStyle(
fontSize: 14,
color: BlocProvider.of<SmartDoorBloc>(context)
.expirationTime == 'Select Time' ? ColorsManager
.textGray : null),
SizedBox(
width: MediaQuery.of(context)
.size
.width /
2.6,
child: TextFormField(
controller: BlocProvider.of<
SmartDoorBloc>(context)
.passwordNameController,
decoration:
const InputDecoration(
hintText:
'Enter The Name',
hintStyle: TextStyle(
fontSize: 14,
color: ColorsManager
.textGray)),
)),
],
),
Column(
children: [
const Divider(
color: ColorsManager.graysColor,
),
Padding(
padding: const EdgeInsets.all(10.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
const Expanded(
child: BodyMedium(
text: 'Effective Time',
fontWeight:
FontWeight.normal,
),
),
SizedBox(
width:
MediaQuery.of(context)
.size
.width /
3.5,
child: InkWell(
onTap: () {
BlocProvider.of<
SmartDoorBloc>(
context)
.add(
SelectTimeEvent(
context:
context,
isEffective:
true));
},
child: Text(
BlocProvider.of<SmartDoorBloc>(
context)
.effectiveTime ==
'Select Time'
? cleaned.toString()
: BlocProvider.of<
SmartDoorBloc>(
context)
.effectiveTime,
style: TextStyle(
fontSize: 14,
),
),
)),
],
),
),
const Divider(
color: ColorsManager.graysColor,
),
Padding(
padding: const EdgeInsets.all(10.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
const Expanded(
child: BodyMedium(
text: 'Expiration Time',
fontWeight:
FontWeight.normal,
),
),
SizedBox(
width: MediaQuery.of(context)
.size
.width /
3.5,
child: InkWell(
onTap: () {
BlocProvider.of<
SmartDoorBloc>(
context)
.add(SelectTimeEvent(
context: context,
isEffective:
false));
},
child: Text(
BlocProvider.of<
SmartDoorBloc>(
context)
.expirationTime,
style: TextStyle(
fontSize: 14,
color: BlocProvider.of<
SmartDoorBloc>(
context)
.expirationTime ==
'Select Time'
? ColorsManager
.textGray
: null),
),
),
),
@ -238,7 +302,8 @@ class CreateOfflineTimeLimitPasswordPage extends StatelessWidget {
),
const BodyMedium(
textAlign: TextAlign.center,
text: 'Use the time-limited password at least once within 24 hours after the password takes effect. Otherwise, the password becomes invalid.',
text:
'Use the time-limited password at least once within 24 hours after the password takes effect. Otherwise, the password becomes invalid.',
fontWeight: FontWeight.normal,
fontColor: ColorsManager.grayColor,
),
@ -256,10 +321,13 @@ class CreateOfflineTimeLimitPasswordPage extends StatelessWidget {
backgroundColor: ColorsManager.primaryColor,
onPressed: () async {
if (generated == false) {
smartDoorBloc.add(GenerateAndSavePasswordTimeLimitEvent(context: context));
smartDoorBloc.add(
GenerateAndSavePasswordTimeLimitEvent(
context: context));
} else {
if(smartDoorBloc.passwordNameController.text.isNotEmpty){
smartDoorBloc.add(RenamePasswordEvent());
if (smartDoorBloc
.passwordNameController.text.isNotEmpty) {
smartDoorBloc.add(RenamePasswordEvent());
}
Navigator.of(context).pop(true);
}

View File

@ -29,7 +29,7 @@ class SosScreen extends StatelessWidget {
builder: (context, state) {
final sensor = BlocProvider.of<SosBloc>(context);
return DefaultScaffold(
title: device?.name,
title: sensor.deviceInfo.name,
actions: [
InkWell(
onTap: () async {
@ -38,7 +38,7 @@ class SosScreen extends StatelessWidget {
builder: (context) => SettingsPage(device: device!),
),
);
if (val == null) {
if (val == null || val == true) {
sensor.add(SosInitialDeviseInfo());
sensor.add(const SosInitial());
}
@ -72,33 +72,38 @@ class SosScreen extends StatelessWidget {
Expanded(
flex: 4,
child: InkWell(
overlayColor:
WidgetStateProperty.all(Colors.transparent),
overlayColor: WidgetStateProperty.all(
Colors.transparent),
onTap: () {
// Add functionality for the main SOS button here
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(890),
borderRadius:
BorderRadius.circular(890),
boxShadow: [
BoxShadow(
color: Colors.white.withOpacity(0.1),
color:
Colors.white.withOpacity(0.1),
blurRadius: 24,
offset: const Offset(-5, -5),
blurStyle: BlurStyle.outer,
),
BoxShadow(
color: Colors.black.withOpacity(0.11),
color: Colors.black
.withOpacity(0.11),
blurRadius: 25,
offset: const Offset(5, 5),
blurStyle: BlurStyle.outer,
),
BoxShadow(
color: Colors.black.withOpacity(0.13),
color: Colors.black
.withOpacity(0.13),
blurRadius: 30,
offset: const Offset(5, 5),
blurStyle: BlurStyle.inner,
@ -125,8 +130,9 @@ class SosScreen extends StatelessWidget {
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => SosRecordsScreen(
sosId: device!.uuid!),
builder: (context) =>
SosRecordsScreen(
sosId: device!.uuid!),
),
);
},
@ -181,8 +187,8 @@ class SosScreen extends StatelessWidget {
maxHeight: 46,
maxWidth: 50,
),
child: SvgPicture.asset(
Assets.doorNotificationSetting),
child: SvgPicture.asset(Assets
.doorNotificationSetting),
),
const SizedBox(height: 15),
const Flexible(

View File

@ -2,6 +2,7 @@ import 'dart:ui';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
import 'package:syncrow_app/features/booking_system/presentation/screens/booking_system_page.dart';
import 'package:syncrow_app/features/menu/bloc/privacy_policy.dart';
import 'package:syncrow_app/features/menu/bloc/user_agreement.dart';
import 'package:syncrow_app/features/menu/view/widgets/join_home/join_home_view.dart';
@ -44,6 +45,18 @@ class MenuCubit extends Cubit<MenuState> {
}
List<Map<String, Object>> menuSections = [
//Booking System
{
'title': 'Booking System',
'color': const Color(0xFF8AB9FF),
'buttons': [
{
'title': 'Booking',
'Icon': Assets.assetsIconsMenuBookingSystem,
'page': BookingSystemPage()
},
],
},
//Home Management
{
'title': 'Home Management',

View File

@ -4,6 +4,7 @@ import 'package:syncrow_app/features/auth/bloc/auth_cubit.dart';
import 'package:syncrow_app/features/menu/bloc/menu_cubit.dart';
import 'package:syncrow_app/features/menu/view/widgets/menu_list.dart';
import 'package:syncrow_app/features/menu/view/widgets/profile/profile_tab.dart';
import 'package:syncrow_app/features/shared_widgets/build_number_environment.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
import 'package:syncrow_app/utils/context_extension.dart';
@ -51,6 +52,7 @@ class MenuView extends StatelessWidget {
],
),
),
buildNumberAndEnvironmentLabel()
],
),
);

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
import 'package:syncrow_app/features/app_layout/model/community_model.dart';
import 'package:syncrow_app/features/menu/view/widgets/manage_home/home_settings.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
@ -15,29 +16,37 @@ class ManageHomeView extends StatelessWidget {
Widget build(BuildContext context) {
var spaces = HomeCubit.getInstance().spaces;
return DefaultScaffold(
title: 'Manage Your Home',
height: MediaQuery.sizeOf(context).height,
title: 'Manage Your Home',
child: Align(
alignment: Alignment.topCenter,
child: spaces.isEmpty
? const Center(
child: BodyMedium(text: 'No spaces found'),
)
? const Center(child: BodyMedium(text: 'No spaces found'))
: DefaultContainer(
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 25),
padding:
const EdgeInsets.symmetric(horizontal: 20, vertical: 25),
child: ListView.builder(
itemCount: spaces.length,
itemBuilder: (context, index) {
if (index == spaces.length - 1) {
return InkWell(
onTap: () {
Navigator.of(context).push(CustomPageRoute(
builder: (context) => HomeSettingsView(
space: spaces[index],
)));
},
child: Row(
shrinkWrap: true,
itemCount: spaces.length,
itemBuilder: (context, index) {
final space = spaces[index];
return InkWell(
onTap: () {
Navigator.of(context).push(
CustomPageRoute(
builder: (context) =>
HomeSettingsView(space: space),
),
);
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
BodyMedium(text: StringHelpers.toTitleCase(spaces[index].name)),
BodyMedium(
text: StringHelpers.toTitleCase(space.name)),
const Icon(
Icons.arrow_forward_ios,
color: ColorsManager.greyColor,
@ -45,45 +54,19 @@ class ManageHomeView extends StatelessWidget {
)
],
),
);
}
return InkWell(
onTap: () {
//TODO refactor the routing to use named routes
// Navigator.of(context).pushNamed(
// '/home_settings',
// arguments: spaces[index],
// );
Navigator.of(context).push(CustomPageRoute(
builder: (context) => HomeSettingsView(
space: spaces[index],
)));
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
BodyMedium(text: HomeCubit.getInstance().spaces[index].name),
const Icon(
Icons.arrow_forward_ios,
color: ColorsManager.greyColor,
size: 15,
)
],
),
if (index != spaces.length - 1)
Container(
margin: const EdgeInsets.symmetric(vertical: 15),
height: 1,
color: ColorsManager.greyColor,
),
],
),
);
}),
));
],
),
);
},
),
),
),
);
}
}

View File

@ -20,6 +20,7 @@ class SecurityBloc extends Bloc<SecurityEvent, SecurityState> {
on<UpdateTimerEvent>(_onUpdateTimer);
on<VerifyPassCodeEvent>(verifyCode);
on<ChangePasswordEvent>(changePassword);
on<DeleteAccountEvent>(onDeleteAccountEvent);
}
void _onSetPassword(SetPassword event, Emitter<SecurityState> emit) {
@ -180,7 +181,6 @@ class SecurityBloc extends Bloc<SecurityEvent, SecurityState> {
ChangePasswordEvent event, Emitter<SecurityState> emit) async {
emit(LoadingForgetState());
try {
final response = await AuthenticationAPI.forgetPassword(
email: HomeCubit.user!.email!,
otpCode: event.otpCode,
@ -195,5 +195,16 @@ class SecurityBloc extends Bloc<SecurityEvent, SecurityState> {
emit(AuthInitialState());
}
}
Future<void> onDeleteAccountEvent(
DeleteAccountEvent event, Emitter<SecurityState> emit) async {
emit(LoadingForgetState());
try {
await AuthenticationAPI.deleteAccount();
emit(ChangedPassState());
} catch (e) {
validate = e.toString();
emit(AuthInitialState());
}
}
}

View File

@ -29,3 +29,5 @@ class ChangePasswordEvent extends SecurityEvent {
}
class VerifyPassCodeEvent extends SecurityEvent {}
class DeleteAccountEvent extends SecurityEvent {}

View File

@ -0,0 +1,107 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/svg.dart';
import 'package:syncrow_app/features/auth/bloc/auth_cubit.dart';
import 'package:syncrow_app/features/menu/view/widgets/securty/bloc/security_bloc.dart';
import 'package:syncrow_app/features/menu/view/widgets/securty/bloc/security_event.dart';
import 'package:syncrow_app/features/menu/view/widgets/securty/bloc/security_state.dart';
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
import 'package:syncrow_app/generated/assets.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class DeleteAccountPage extends StatelessWidget {
const DeleteAccountPage({super.key});
@override
Widget build(BuildContext context) {
return BlocListener<SecurityBloc, SecurityState>(
listener: (context, state) {
if (state is ChangedPassState) {
AuthCubit.get(context).logout();
}
},
child: DefaultScaffold(
title: 'Delete Account',
bottomNavBar: SizedBox(
height: 150,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Column(
children: [
BodyMedium(
text: 'Thank you for using Syncrow',
fontWeight: FontWeight.w400,
fontSize: 14,
textAlign: TextAlign.center,
),
SizedBox(
height: 10,
),
BlocBuilder<SecurityBloc, SecurityState>(
builder: (context, state) {
if (state is LoadingForgetState) {
return Center(
child: CircularProgressIndicator(),
);
}
return ElevatedButton(
onPressed: () {
context
.read<SecurityBloc>()
.add(DeleteAccountEvent());
},
style: ElevatedButton.styleFrom(
backgroundColor: ColorsManager.blueColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
fixedSize: Size(
MediaQuery.sizeOf(context).width * 0.8,
40,
),
),
child: Text(
'Delete Account',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w700,
color: ColorsManager.onPrimaryColor),
),
);
},
)
],
),
],
),
),
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 80, bottom: 30),
child: SvgPicture.asset(Assets.deleteAccountIcon),
),
const Padding(
padding: EdgeInsets.all(8.0),
child: BodyMedium(
text: 'Account Verification',
fontWeight: FontWeight.w700,
fontSize: 18,
),
),
const BodyMedium(
text:
'if you confirm to "delete account",the account will be deleted',
fontWeight: FontWeight.w400,
fontSize: 16,
textAlign: TextAlign.center,
),
],
),
),
);
}
}

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_app/features/menu/view/widgets/securty/bloc/security_bloc.dart';
@ -24,13 +23,15 @@ class ChangePasswordPage extends StatelessWidget {
children: [
InkWell(
onTap: () {
// In your parent widget or navigator
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => BlocProvider(
create: (_) => SecurityBloc(), // Provide the Bloc
child: const VerificationCodePage(),
create: (_) => SecurityBloc(),
child: const VerificationCodePage(
title: 'Change Password',
isDeleteAccountMode: false,
),
),
),
);

View File

@ -1,5 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/menu/view/widgets/securty/bloc/security_bloc.dart';
import 'package:syncrow_app/features/menu/view/widgets/securty/bloc/security_event.dart';
import 'package:syncrow_app/features/menu/view/widgets/securty/view/change_password_page.dart';
import 'package:syncrow_app/features/menu/view/widgets/securty/view/verification_code_page.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
@ -23,134 +27,34 @@ class SecurtyView extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
children: [
InkWell(
SecurityListTileWidget(
title: 'Change Password',
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const ChangePasswordPage(),
));
},
child: const Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
BodyMedium(
text: 'Change Password',
),
Icon(
Icons.arrow_forward_ios,
color: ColorsManager.greyColor,
size: 15,
)
],
),
// Container(
// margin: const EdgeInsets.symmetric(vertical: 15),
// height: 1,
// color: ColorsManager.greyColor,
// ),
],
),
),
// InkWell(
// onTap: () {},
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: [
// const Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// BodyMedium(
// text: 'App Lock',
// ),
// Icon(
// Icons.arrow_forward_ios,
// color: ColorsManager.greyColor,
// size: 15,
// )
// ],
// ),
// Container(
// margin: const EdgeInsets.symmetric(vertical: 15),
// height: 1,
// color: ColorsManager.greyColor,
// ),
// ],
// ),
// ),
// InkWell(
// onTap: () {},
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: [
// const Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// BodyMedium(
// text: 'User Code',
// ),
// Icon(
// Icons.arrow_forward_ios,
// color: ColorsManager.greyColor,
// size: 15,
// )
// ],
// ),
// Container(
// margin: const EdgeInsets.symmetric(vertical: 15),
// height: 1,
// color: ColorsManager.greyColor,
// ),
// ],
// ),
// ),
// InkWell(
// onTap: () {},
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: [
// const Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// BodyMedium(
// text: 'Delete Account',
// ),
// Icon(
// Icons.arrow_forward_ios,
// color: ColorsManager.greyColor,
// size: 15,
// )
// ],
// ),
// Container(
// margin: const EdgeInsets.symmetric(vertical: 15),
// height: 1,
// color: ColorsManager.greyColor,
// ),
// ],
// ),
// ),
// InkWell(
// onTap: () {},
// child: const Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// BodyMedium(
// text: 'Device Update',
// ),
// Icon(
// Icons.arrow_forward_ios,
// color: ColorsManager.greyColor,
// size: 15,
// )
// ],
// ),
// ),
Container(
margin: const EdgeInsets.symmetric(vertical: 15),
height: 1,
color: ColorsManager.greyColor,
),
SecurityListTileWidget(
title: 'Delete Account',
fontColor: ColorsManager.red,
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => BlocProvider(
create: (_) => SecurityBloc()..add(StartTimerEvent()),
child: VerificationCodePage(
title: '',
isDeleteAccountMode: true,
),
),
));
},
),
],
),
),
@ -159,3 +63,42 @@ class SecurtyView extends StatelessWidget {
);
}
}
class SecurityListTileWidget extends StatelessWidget {
final String title;
final void Function() onTap;
final Color? fontColor;
const SecurityListTileWidget({
super.key,
required this.title,
required this.onTap,
this.fontColor,
});
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
BodyMedium(
text: title,
fontColor: fontColor,
),
Icon(
Icons.arrow_forward_ios,
color: ColorsManager.greyColor,
size: 15,
)
],
),
],
),
);
}
}

View File

@ -4,6 +4,7 @@ import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
import 'package:syncrow_app/features/menu/view/widgets/securty/bloc/security_bloc.dart';
import 'package:syncrow_app/features/menu/view/widgets/securty/bloc/security_event.dart';
import 'package:syncrow_app/features/menu/view/widgets/securty/bloc/security_state.dart';
import 'package:syncrow_app/features/menu/view/widgets/securty/delete_account/delete_account_page.dart';
import 'package:syncrow_app/features/menu/view/widgets/securty/view/set_password_page.dart';
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
@ -11,7 +12,13 @@ import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
import 'package:pin_code_fields/pin_code_fields.dart';
class VerificationCodePage extends StatelessWidget {
const VerificationCodePage({super.key});
final String title;
final bool isDeleteAccountMode;
const VerificationCodePage({
super.key,
required this.title,
required this.isDeleteAccountMode,
});
@override
Widget build(BuildContext context) {
@ -20,19 +27,29 @@ class VerificationCodePage extends StatelessWidget {
create: (context) => SecurityBloc()..add(StartTimerEvent()),
child: BlocConsumer<SecurityBloc, SecurityState>(
listener: (context, state) {
final securityBloc = context.read<SecurityBloc>();
if (state is SuccessForgetState) {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => SetPasswordPage(
otpCode: otp,
),
));
if (isDeleteAccountMode) {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => BlocProvider.value(
value: securityBloc,
child: DeleteAccountPage(),
),
));
} else {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => SetPasswordPage(
otpCode: otp,
),
));
}
}
},
builder: (context, state) {
final _bloc = BlocProvider.of<SecurityBloc>(context);
return DefaultScaffold(
title: 'Change Password',
title: title,
child: Column(
children: [
const SizedBox(height: 55),
@ -86,8 +103,8 @@ class VerificationCodePage extends StatelessWidget {
selectedFillColor: Colors.white70,
activeFillColor: Colors.white,
errorBorderColor: Colors.white,
fieldHeight: 55.0,
fieldWidth: 55.0,
fieldHeight: 45.0,
fieldWidth: 45.0,
fieldOuterPadding: const EdgeInsets.only(right: 8),
borderRadius: BorderRadius.circular(17),
borderWidth: 1,
@ -109,27 +126,35 @@ class VerificationCodePage extends StatelessWidget {
children: [
Expanded(
child: InkWell(
onTap:
state is TimerState && !state.isButtonEnabled && state.remainingTime != 1
? null
: () {
_bloc.add(StartTimerEvent());
},
onTap: state is TimerState &&
!state.isButtonEnabled &&
state.remainingTime != 1
? null
: () {
_bloc.add(StartTimerEvent());
},
child: Container(
padding: const EdgeInsets.only(right: 20, left: 20, top: 15, bottom: 15),
padding: const EdgeInsets.only(
right: 20, left: 20, top: 15, bottom: 15),
decoration: BoxDecoration(
color: state is TimerState && !state.isButtonEnabled
? ColorsManager.blueButton
: ColorsManager.blueColor,
borderRadius: BorderRadius.all(Radius.circular(20))),
borderRadius:
BorderRadius.all(Radius.circular(20))),
child: Center(
child: Center(
child: Text(
'${state is TimerState && !state.isButtonEnabled && state.remainingTime != 1 ? "${_bloc.formattedTime(state.remainingTime)} " : "Resend"}',
state is TimerState &&
!state.isButtonEnabled &&
state.remainingTime != 1
? "${_bloc.formattedTime(state.remainingTime)} "
: "Resend",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w700,
color: state is TimerState && !state.isButtonEnabled
color: state is TimerState &&
!state.isButtonEnabled
? Colors.white
: ColorsManager.onPrimaryColor,
),
@ -142,18 +167,24 @@ class VerificationCodePage extends StatelessWidget {
Expanded(
child: InkWell(
onTap: () {
context.read<SecurityBloc>().add(VerifyPassCodeEvent());
context
.read<SecurityBloc>()
.add(VerifyPassCodeEvent());
},
child: Container(
padding: const EdgeInsets.only(right: 20, left: 20, top: 15, bottom: 15),
padding: const EdgeInsets.only(
right: 20, left: 20, top: 15, bottom: 15),
decoration: const BoxDecoration(
color: ColorsManager.blueColor,
borderRadius: BorderRadius.all(Radius.circular(20))),
borderRadius:
BorderRadius.all(Radius.circular(20))),
child: const Center(
child: Text(
"Verify",
style: TextStyle(
fontSize: 16, color: Colors.white, fontWeight: FontWeight.w700),
fontSize: 16,
color: Colors.white,
fontWeight: FontWeight.w700),
),
),
),

View File

@ -107,6 +107,7 @@ class CreateSceneBloc extends Bloc<CreateSceneEvent, CreateSceneState>
for (var element in tempTasksList) {
if (element.code == event.deviceControlModel.code) {
var updatedElement = element.copyWith(
deviceType: event.deviceType,
operationName: event.operation,
deviceName: event.deviceName,
icon: event.icon,
@ -134,6 +135,7 @@ class CreateSceneBloc extends Bloc<CreateSceneEvent, CreateSceneState>
if (element.deviceId == event.deviceControlModel.deviceId &&
element.code == event.deviceControlModel.code) {
var updatedElement = element.copyWith(
deviceType: event.deviceType,
operationName: event.operation,
deviceName: event.deviceName,
icon: event.icon,

View File

@ -41,7 +41,7 @@ class SmartSceneSelectBloc
.read<CreateSceneBloc>();
createSceneBloc.add(TempHoldSceneTasksEvent(
deviceType: '',
deviceType:smartSceneEnable!.type ,
deviceControlModel: DeviceControlModel(
deviceId: smartSceneEnable?.entityId ?? '',
code: CreateSceneEnum.smartSceneSelect.name,

View File

@ -4,6 +4,7 @@ enum OperationDialogType {
temperature,
onOff,
integerSteps,
counterSteps,
listOfOptions,
none,
}

View File

@ -9,6 +9,7 @@ class ACFunctionsHelper {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
@ -30,6 +31,7 @@ class ACFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsFreezing,
@ -56,6 +58,7 @@ class ACFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsTempreture,
@ -72,6 +75,7 @@ class ACFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsFanSpeed,
@ -103,6 +107,7 @@ class ACFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsChildLock,
@ -130,6 +135,7 @@ class ACFunctionsHelper {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
@ -151,6 +157,7 @@ class ACFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsFreezing,
@ -177,6 +184,7 @@ class ACFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsTempreture,
@ -196,6 +204,7 @@ class ACFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsCurrentTemp,
@ -215,6 +224,7 @@ class ACFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsFanSpeed,
@ -246,6 +256,7 @@ class ACFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsChildLock,

View File

@ -8,6 +8,7 @@ class DoorLockHelperFunctions {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsIconsDoorLock,
@ -16,8 +17,10 @@ class DoorLockHelperFunctions {
code: 'normal_open_switch',
operationDialogType: OperationDialogType.onOff,
operationalValues: [
SceneOperationalValue(icon: Assets.assetsAcPower, description: "ON", value: true),
SceneOperationalValue(icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
SceneOperationalValue(
icon: Assets.assetsAcPower, description: "ON", value: true),
SceneOperationalValue(
icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
],
),
];
@ -28,6 +31,7 @@ class DoorLockHelperFunctions {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsFingerprintUnlock,
@ -47,6 +51,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsPasswordUnlock,
@ -66,6 +71,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsCardUnlock,
@ -85,6 +91,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLockAlarm,
@ -101,6 +108,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsRemoteUnlockReq,
@ -120,6 +128,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsResidualElectricity,
@ -139,6 +148,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsDoubleLock,
@ -160,6 +170,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsRemoteUnlockViaApp,
@ -179,6 +190,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsHijackAlarm,
@ -200,6 +212,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsDoorlockNormalOpen,
@ -221,6 +234,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsDoorlockNormalOpen,
@ -242,6 +256,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsTempPasswordUnlock,

View File

@ -0,0 +1,235 @@
import 'package:syncrow_app/features/scene/enum/operation_dialog_type.dart';
import 'package:syncrow_app/features/scene/model/scene_static_function.dart';
import 'package:syncrow_app/generated/assets.dart';
class FlushFunctionsHelper {
static List<SceneStaticFunction> flushSceneHelperFunctions(
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'NCPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsPresenceState,
operationName: 'Presence State',
code: 'presence_state',
functionValue: functionValue,
operationDialogType: OperationDialogType.listOfOptions,
operationalValues: [
SceneOperationalValue(
icon: Assets.nobodyTime, description: "None", value: 'none'),
SceneOperationalValue(
icon: Assets.nobodyTime,
description: "Presence",
value: 'presence',
),
],
),
SceneStaticFunction(
deviceType: 'NCPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.IlluminanceIcon,
operationName: 'Illuminance Value',
code: 'illum_value',
functionValue: functionValue,
operationDialogType: OperationDialogType.integerSteps,
operationalValues: [
SceneOperationalValue(
icon: '',
value: 0.0,
description: "",
minValue: 0.0,
maxValue: 2000.0,
stepValue: 1.0,
),
],
),
];
}
static List<SceneStaticFunction> flushAutomationFunctions(
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'NCPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsSensitivityFunction,
operationName: 'Sensitivity',
code: 'sensitivity',
functionValue: functionValue,
operationDialogType: OperationDialogType.listOfOptions,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 1,
description: 1.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 2,
description: 2.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 3,
description: 3.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 4,
description: 4.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 5,
description: 5.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 6,
description: 6.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 7,
description: 7.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 8,
description: 8.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 9,
description: 9.toString(),
),
],
),
SceneStaticFunction(
deviceType: 'NCPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.currentDistanceIcon,
operationName: 'Min Detection Distance',
code: 'near_detection',
functionValue: functionValue,
operationDialogType: OperationDialogType.counterSteps,
operationalValues: [
SceneOperationalValue(
icon: '',
value: 0.0,
description: "m",
minValue: 0.0,
maxValue: 9.5,
stepValue: 0.10,
),
],
),
SceneStaticFunction(
deviceType: 'NCPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.currentDistanceIcon,
operationName: 'Max Detection Distance',
code: 'far_detection',
functionValue: functionValue,
operationDialogType: OperationDialogType.counterSteps,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsCelsiusDegrees,
value: 0.0,
description: "m",
minValue: 0.0,
maxValue: 9.5,
stepValue: 0.10,
),
],
),
SceneStaticFunction(
deviceType: 'NCPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.levelIcon,
operationName: 'Trigger Level',
code: 'sensi_reduce',
functionValue: functionValue,
operationDialogType: OperationDialogType.counterSteps,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsCelsiusDegrees,
value: 1,
description: "",
minValue: 1,
maxValue: 3,
stepValue: 1,
),
],
),
SceneStaticFunction(
deviceType: 'NCPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.indentLevelIcon,
operationName: 'Indent Level',
code: 'occur_dist_reduce',
functionValue: functionValue,
operationDialogType: OperationDialogType.counterSteps,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsCelsiusDegrees,
value: 1,
description: "",
minValue: 1,
maxValue: 3,
stepValue: 1,
),
],
),
SceneStaticFunction(
deviceType: 'NCPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.targetConfirmTimeIcon,
operationName: 'Target Confirm Time',
code: 'presence_delay',
functionValue: functionValue,
operationDialogType: OperationDialogType.counterSteps,
operationalValues: [
SceneOperationalValue(
icon: '',
value: 0.0,
description: "",
minValue: 0.0,
maxValue: 0.5,
stepValue: 0.1,
),
],
),
SceneStaticFunction(
deviceType: 'NCPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.delayIcon,
operationName: 'Disappear Delay',
code: 'none_delay',
functionValue: functionValue,
operationDialogType: OperationDialogType.integerSteps,
operationalValues: [
SceneOperationalValue(
icon: '',
value: 20.0,
description: "sec",
minValue: 20.0,
maxValue: 300.0,
stepValue: 1.0,
),
],
),
];
}
}

View File

@ -7,6 +7,7 @@ class GatewayHelperFunctions {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'GW',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsSwitchAlarmSound,
@ -22,6 +23,7 @@ class GatewayHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'GW',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsMasterState,
@ -43,6 +45,7 @@ class GatewayHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'GW',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsFactoryReset,

View File

@ -7,6 +7,7 @@ class HumanPresenceHelperFunctions {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'WPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsFarDetection,
@ -66,6 +67,7 @@ class HumanPresenceHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'WPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsMotionDetection,
@ -102,6 +104,7 @@ class HumanPresenceHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'WPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsMotionlessDetection,
@ -143,6 +146,7 @@ class HumanPresenceHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'WPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsIndicator,
@ -164,6 +168,7 @@ class HumanPresenceHelperFunctions {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'WPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsPresenceState,
@ -185,6 +190,7 @@ class HumanPresenceHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'WPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsIconsPresenceSensorAssetsDistance,
@ -204,6 +210,7 @@ class HumanPresenceHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'WPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsIconsPresenceSensorAssetsIlluminanceValue,
@ -223,6 +230,7 @@ class HumanPresenceHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'WPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsIndicator,
@ -238,6 +246,7 @@ class HumanPresenceHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'WPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsIconsPresenceSensorAssetsTime,

View File

@ -7,6 +7,7 @@ class PresenceSensorHelperFunctions {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'CPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsSensitivityFunction,
@ -74,6 +75,7 @@ class PresenceSensorHelperFunctions {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'CPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsIconsSensors,
@ -100,6 +102,7 @@ class PresenceSensorHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'CPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsSensitivityFunction,
@ -119,6 +122,7 @@ class PresenceSensorHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'CPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsSelfTestResult,

View File

@ -7,6 +7,7 @@ class TowGangHelperFunctions {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
@ -22,6 +23,7 @@ class TowGangHelperFunctions {
],
),
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
@ -34,6 +36,7 @@ class TowGangHelperFunctions {
],
),
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
@ -49,6 +52,7 @@ class TowGangHelperFunctions {
],
),
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
@ -67,6 +71,7 @@ class TowGangHelperFunctions {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
@ -82,6 +87,7 @@ class TowGangHelperFunctions {
],
),
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
@ -101,6 +107,7 @@ class TowGangHelperFunctions {
],
),
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
@ -116,6 +123,7 @@ class TowGangHelperFunctions {
],
),
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,

View File

@ -7,10 +7,11 @@ class WaterHeaterFunctionsHelper {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'WH',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
operationName: 'Reverse Switch',
operationName: 'Switch',
code: 'switch_1',
functionValue: functionValue,
operationDialogType: OperationDialogType.onOff,
@ -27,10 +28,11 @@ class WaterHeaterFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'WH',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
operationName: 'CountDown',
operationName: 'Timer',
code: 'countdown_1',
functionValue: functionValue,
operationDialogType: OperationDialogType.countdown,
@ -45,6 +47,7 @@ class WaterHeaterFunctionsHelper {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'WH',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.refreshStatusIcon,
@ -71,6 +74,7 @@ class WaterHeaterFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'WH',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
@ -86,6 +90,7 @@ class WaterHeaterFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'WH',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
@ -105,6 +110,7 @@ class WaterHeaterFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'WH',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsIndicator,

View File

@ -8,6 +8,7 @@ import 'package:syncrow_app/features/scene/model/create_automation_model.dart';
import 'package:syncrow_app/features/scene/model/create_scene_model.dart';
import 'package:syncrow_app/features/scene/model/scene_static_function.dart';
import 'package:syncrow_app/features/scene/widgets/alert_dialogs/alert_dialog_countdown.dart';
import 'package:syncrow_app/features/scene/widgets/alert_dialogs/alert_dialog_counter.dart';
import 'package:syncrow_app/features/scene/widgets/alert_dialogs/alert_dialog_functions_body.dart';
import 'package:syncrow_app/features/scene/widgets/alert_dialogs/alert_dialog_slider_steps.dart';
import 'package:syncrow_app/features/scene/widgets/alert_dialogs/alert_dialog_temperature_body.dart';
@ -88,6 +89,7 @@ mixin SceneLogicHelper {
final task = actions[index];
if (task.deviceId == 'delay') {
return CreateSceneAction(
productType: task.deviceType,
entityId: actions[index].deviceId,
actionExecutor: 'delay',
executorProperty: CreateSceneExecutorProperty(
@ -99,6 +101,7 @@ mixin SceneLogicHelper {
}
if (task.code == CreateSceneEnum.smartSceneSelect.name) {
return CreateSceneAction(
productType: task.deviceType,
actionType: task.operationName.toLowerCase() == 'automation'
? 'automation'
: 'scene',
@ -107,6 +110,7 @@ mixin SceneLogicHelper {
executorProperty: null);
}
return CreateSceneAction(
productType: task.deviceType,
entityId: task.deviceId,
actionExecutor: 'device_issue',
executorProperty: CreateSceneExecutorProperty(
@ -119,6 +123,20 @@ mixin SceneLogicHelper {
),
],
);
for (var action in createAutomationModel.actions) {
if (action.productType == 'NCPS') {
if (action.executorProperty!.functionCode == 'near_detection' ||
action.executorProperty!.functionCode == 'far_detection') {
action.executorProperty!.functionValue =
(action.executorProperty!.functionValue * 100).round();
} else if (action.executorProperty!.functionCode ==
'presence_delay' ||
action.executorProperty!.functionCode == 'none_delay') {
action.executorProperty!.functionValue =
(action.executorProperty!.functionValue * 10).round();
}
}
}
sceneBloc.add(CreateSceneWithTasksEvent(
createSceneModel: null,
updateScene: updateScene,
@ -139,6 +157,7 @@ mixin SceneLogicHelper {
final task = actions[index];
if (task.deviceId == 'delay') {
return CreateSceneAction(
productType: task.deviceType,
entityId: actions[index].deviceId,
actionExecutor: 'delay',
executorProperty: CreateSceneExecutorProperty(
@ -150,11 +169,14 @@ mixin SceneLogicHelper {
}
if (task.code == CreateSceneEnum.smartSceneSelect.name) {
return CreateSceneAction(
productType: task.deviceType,
entityId: actions[index].deviceId,
actionExecutor: actions[index].functionValue,
executorProperty: null);
}
return CreateSceneAction(
productType: task.deviceType,
entityId: task.deviceId,
actionExecutor: 'device_issue',
executorProperty: CreateSceneExecutorProperty(
@ -167,6 +189,20 @@ mixin SceneLogicHelper {
),
],
);
for (var action in createSceneModel.actions) {
if (action.productType == 'NCPS') {
if (action.executorProperty!.functionCode == 'near_detection' ||
action.executorProperty!.functionCode == 'far_detection') {
action.executorProperty!.functionValue =
(action.executorProperty!.functionValue * 100).round();
} else if (action.executorProperty!.functionCode ==
'presence_delay' ||
action.executorProperty!.functionCode == 'none_delay') {
action.executorProperty!.functionValue =
(action.executorProperty!.functionValue * 10).round();
}
}
}
sceneBloc.add(CreateSceneWithTasksEvent(
createSceneModel: createSceneModel,
createAutomationModel: null,
@ -199,6 +235,13 @@ mixin SceneLogicHelper {
functionValue: functionValue ?? taskItem.functionValue,
isAutomation: isAutomation,
);
} else if (taskItem.operationDialogType ==
OperationDialogType.counterSteps) {
return AlertDialogCounterSteps(
taskItem: taskItem,
functionValue: functionValue ?? taskItem.functionValue,
isAutomation: isAutomation,
);
}
return AlertDialogFunctionsOperationsBody(

View File

@ -4,6 +4,7 @@ import 'package:syncrow_app/features/scene/enum/create_scene_enum.dart';
import 'package:syncrow_app/features/scene/enum/operation_dialog_type.dart';
import 'package:syncrow_app/features/scene/helper/functions_per_device/ac_functions.dart';
import 'package:syncrow_app/features/scene/helper/functions_per_device/door_lock_functions.dart';
import 'package:syncrow_app/features/scene/helper/functions_per_device/flush_functions_helper.dart';
import 'package:syncrow_app/features/scene/helper/functions_per_device/gateway_functions.dart';
import 'package:syncrow_app/features/scene/helper/functions_per_device/human_presence_functions.dart';
import 'package:syncrow_app/features/scene/helper/functions_per_device/one_gang_functions.dart';
@ -18,7 +19,7 @@ import 'package:syncrow_app/utils/resource_manager/constants.dart';
mixin SceneOperationsDataHelper {
final Map<DeviceType,
Function(List<FunctionModel>, String, String, dynamic, bool)>
Function(List<FunctionModel>, String, String, dynamic, bool, String)>
_functionMap = {
DeviceType.LightBulb: lightBulbFunctions,
DeviceType.CeilingSensor: ceilingSensorFunctions,
@ -31,6 +32,7 @@ mixin SceneOperationsDataHelper {
DeviceType.OneGang: oneGangFunctions,
DeviceType.TwoGang: towGangFunctions,
DeviceType.WH: waterHeaterFunctions,
DeviceType.FlushMountedSensor: flushFunctions
};
final Map<DeviceType, String> _titleMap = {
@ -45,14 +47,33 @@ mixin SceneOperationsDataHelper {
DeviceType.OneGang: '1G Light Switch Conditions',
DeviceType.TwoGang: '2G Light Switch Conditions',
DeviceType.WH: 'Water Heater Conditions',
DeviceType.FlushMountedSensor: 'Flush Presence Sensor Functions'
};
static List<SceneStaticFunction> flushFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
if (isAutomation) {
return FlushFunctionsHelper.flushSceneHelperFunctions(
deviceId, deviceName, functionValue);
}
return FlushFunctionsHelper.flushAutomationFunctions(
deviceId, deviceName, functionValue);
}
static List<SceneStaticFunction> waterHeaterFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
if (isAutomation) {
return WaterHeaterFunctionsHelper.waterHeaterAutomationFunctions(
deviceId, deviceName, functionValue);
@ -63,11 +84,13 @@ mixin SceneOperationsDataHelper {
//one gang functions
static List<SceneStaticFunction> oneGangFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
if (isAutomation) {
return OneGangHelperFunctions.oneGangAutomationFunctions(
deviceId, deviceName, functionValue);
@ -77,11 +100,13 @@ mixin SceneOperationsDataHelper {
}
static List<SceneStaticFunction> towGangFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
if (isAutomation) {
return TowGangHelperFunctions.towGangAutomationFunctions(
deviceId, deviceName, functionValue);
@ -95,13 +120,14 @@ mixin SceneOperationsDataHelper {
required List<FunctionModel> functions,
required String deviceId,
required String deviceName,
required String productType,
required bool isAutomation,
}) {
final functionValue = null;
return _functionMap[type]?.call(
functions, deviceId, deviceName, functionValue, isAutomation) ??
lightBulbFunctions(
functions, deviceId, deviceName, functionValue, isAutomation);
return _functionMap[type]?.call(functions, deviceId, deviceName,
functionValue, isAutomation, productType) ??
lightBulbFunctions(functions, deviceId, deviceName, functionValue,
isAutomation, productType);
}
String getTitle({DeviceType? type}) {
@ -109,11 +135,13 @@ mixin SceneOperationsDataHelper {
}
static List<SceneStaticFunction> ceilingSensorFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
if (isAutomation) {
return PresenceSensorHelperFunctions.automationPresenceSensorFunctions(
deviceId, deviceName, functionValue);
@ -123,20 +151,24 @@ mixin SceneOperationsDataHelper {
}
static List<SceneStaticFunction> curtainFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
return [];
}
static List<SceneStaticFunction> doorLockFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
if (isAutomation) {
return DoorLockHelperFunctions.doorLockAutomationFunctions(
deviceId, deviceName, functionValue);
@ -146,11 +178,13 @@ mixin SceneOperationsDataHelper {
}
static List<SceneStaticFunction> wallSensorFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
if (isAutomation) {
return HumanPresenceHelperFunctions.automationHumanPresenceFunctions(
deviceId, deviceName, functionValue);
@ -164,26 +198,31 @@ mixin SceneOperationsDataHelper {
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
bool isAutomation,
String productType) {
return [];
}
static List<SceneStaticFunction> gatewayFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
return GatewayHelperFunctions.tabToRunGatewayFunctions(
deviceId, deviceName, functionValue);
}
static List<SceneStaticFunction> threeGangFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
if (isAutomation) {
return ThreeGangHelperFunctions.threeGangAutomationFunctions(
deviceId, deviceName, functionValue);
@ -193,11 +232,13 @@ mixin SceneOperationsDataHelper {
}
static List<SceneStaticFunction> acFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
if (isAutomation) {
return ACFunctionsHelper.automationAcFunctions(
deviceId, deviceName, functionValue);
@ -212,7 +253,19 @@ mixin SceneOperationsDataHelper {
List<Condition>? conditions,
}) {
List<SceneStaticFunction> functions = [];
for (var action in actions) {
if (action.productType == "NCPS") {
if (action.executorProperty!.functionCode == 'near_detection' ||
action.executorProperty!.functionCode == 'far_detection') {
action.executorProperty!.functionValue =
action.executorProperty!.functionValue / 100;
} else if (action.executorProperty!.functionCode == 'presence_delay' ||
action.executorProperty!.functionCode == 'none_delay') {
action.executorProperty!.functionValue =
(action.executorProperty!.functionValue / 10);
}
}
}
// Handle actions
for (var action in actions) {
if (action.entityId == 'delay') {
@ -306,11 +359,9 @@ mixin SceneOperationsDataHelper {
String? uniqueCustomId,
}) {
final executorProperty = action.executorProperty;
final Map<String,
SceneStaticFunction Function(Action, bool, String?, String?)>
functionMap = {
'sensitivity': _createSensitivityFunction,
'normal_open_switch': _createNormalOpenSwitchFunction,
'unlock_fingerprint': _createUnlockFingerprintFunction,
'unlock_password': _createUnlockPasswordFunction,
@ -323,12 +374,21 @@ mixin SceneOperationsDataHelper {
'hijack': _createHijackFunction,
'doorbell': _createDoorbellFunction,
'unlock_temporary': _createUnlockTemporaryFunction,
'far_detection': _createFarDetectionFunction,
'near_detection': _createNearDetectionOptions,
if (action.productType == 'NCPS') ...{
'far_detection': _createFarDetectionOptionsFlush,
'presence_state': _createPresenceStateFunctionFlush,
'illum_value': _createIlluminanceValueFunctionFlush,
'sensitivity': _createSensitivityFunctionFlush,
} else ...{
'far_detection': _createFarDetectionFunction,
'presence_state': _createPresenceStateFunction,
'sensitivity': _createSensitivityFunction,
},
'motion_sensitivity_value': _createMotionSensitivityFunction,
'motionless_sensitivity': _createMotionlessSensitivityFunction,
'indicator': _createIndicatorFunction,
'presence_time': _createPresenceTimeFunction,
'presence_state': _createPresenceStateFunction,
'dis_current': _createDisCurrentFunction,
'illuminance_value': _createIlluminanceValueFunction,
'checking_result': _createCheckingResultFunction,
@ -349,6 +409,10 @@ mixin SceneOperationsDataHelper {
'factory_reset': _createFactoryResetFunction,
'switch_backlight': _createSwitchFunction,
'relay_status': _relayStatusSwitchFunction,
'sensi_reduce': _createTriggerLevelOptions,
'occur_dist_reduce': _createIndentLevelOptions,
'presence_delay': _createTargetConfirmTime,
'none_delay': _createDisappeDelay
};
final functionCode = executorProperty?.functionCode ?? '';
@ -372,7 +436,6 @@ mixin SceneOperationsDataHelper {
String? uniqueCustomId,
]) {
final productType = action.productType;
final functionValue = action.executorProperty?.functionValue;
return SceneStaticFunction(
deviceType: productType,
@ -765,17 +828,36 @@ mixin SceneOperationsDataHelper {
SceneStaticFunction _createSwitchFunction(Action action, bool isAutomation,
String? comparator, String? uniqueCustomId) {
return _createSceneFunction(
action,
action.deviceName,
Assets.waterHeaterIcon,
'Power',
OperationDialogType.onOff,
_createOnOffOptions(),
isAutomation,
comparator,
uniqueCustomId,
);
switch (action.productType) {
case "AC":
return _createSceneFunction(
action,
action.deviceName,
Assets.assetsIconsAC,
'Switch',
OperationDialogType.onOff,
_createOnOffOptions(),
isAutomation,
comparator,
uniqueCustomId,
);
case "WH":
return _createSceneFunction(
action,
action.deviceName,
Assets.waterHeaterIcon,
'Power',
OperationDialogType.onOff,
_createOnOffOptions(),
isAutomation,
comparator,
uniqueCustomId,
);
default:
throw ArgumentError('Unsupported product type: ${action.productType}');
}
}
SceneStaticFunction _relayStatusSwitchFunction(Action action,
@ -875,6 +957,19 @@ mixin SceneOperationsDataHelper {
static SceneStaticFunction _createSwitch1Function(Action action,
bool isAutomation, String? comparator, String? uniqueCustomId) {
switch (action.productType) {
case "AC":
return _createSceneFunction(
action,
action.deviceName,
Assets.acSwitchIcon,
'Switch',
OperationDialogType.onOff,
_createOnOffOptions(),
isAutomation,
comparator,
uniqueCustomId,
);
case "WH":
return _createSceneFunction(
action,
@ -1349,6 +1444,21 @@ mixin SceneOperationsDataHelper {
];
}
List<SceneOperationalValue> _createPresenceStateOptionsFlush() {
return [
SceneOperationalValue(
icon: Assets.assetsIconsPresenceSensorAssetsEmpty,
value: 'none',
description: 'None',
),
SceneOperationalValue(
icon: Assets.assetsPresence,
value: 'presence',
description: 'Presence',
),
];
}
List<SceneOperationalValue> _createPresenceStateOptions() {
return [
SceneOperationalValue(
@ -1582,7 +1692,7 @@ mixin SceneOperationsDataHelper {
return [
_mapExecutorPropertyToSceneFunction(
Action(
deviceName: taskItem.deviceName,
deviceName: taskItem.deviceName!,
productType: taskItem.deviceType!,
entityId: deviceId,
executorProperty: ExecutorProperty(
@ -1630,4 +1740,282 @@ mixin SceneOperationsDataHelper {
),
];
}
SceneStaticFunction _createNearDetectionOptions(Action action,
bool isAutomation, String? comparator, String? uniqueCustomId) {
return _createSceneFunction(
action,
action.deviceName,
Assets.flushIcon,
'Min Detection distance',
OperationDialogType.counterSteps,
_createMinDetection(),
isAutomation,
comparator,
uniqueCustomId,
);
}
SceneStaticFunction _createFarDetectionOptionsFlush(Action action,
bool isAutomation, String? comparator, String? uniqueCustomId) {
return _createSceneFunction(
action,
action.deviceName,
Assets.flushIcon,
'Max Detection distance',
OperationDialogType.counterSteps,
_createFarDetection(),
isAutomation,
comparator,
uniqueCustomId,
);
}
SceneStaticFunction _createTriggerLevelOptions(Action action,
bool isAutomation, String? comparator, String? uniqueCustomId) {
return _createSceneFunction(
action,
action.deviceName,
Assets.flushIcon,
"Trigger Level",
OperationDialogType.counterSteps,
_createTriggerLevelFunction(),
isAutomation,
comparator,
uniqueCustomId,
);
}
List<SceneOperationalValue> _createTriggerLevelFunction() {
return [
SceneOperationalValue(
icon: Assets.assetsCelsiusDegrees,
value: 0,
description: '',
minValue: 0,
maxValue: 3,
stepValue: 1,
),
];
}
SceneStaticFunction _createIndentLevelOptions(Action action,
bool isAutomation, String? comparator, String? uniqueCustomId) {
return _createSceneFunction(
action,
action.deviceName,
Assets.flushIcon,
'Indent Level',
OperationDialogType.counterSteps,
_createIndentLevelFunction(),
isAutomation,
comparator,
uniqueCustomId,
);
}
List<SceneOperationalValue> _createIndentLevelFunction() {
return [
SceneOperationalValue(
icon: Assets.assetsCelsiusDegrees,
value: 0,
description: '',
minValue: 0,
maxValue: 3,
stepValue: 1,
),
];
}
SceneStaticFunction _createTargetConfirmTime(Action action, bool isAutomation,
String? comparator, String? uniqueCustomId) {
return _createSceneFunction(
action,
action.deviceName,
Assets.flushIcon,
'Target Confirm Time',
OperationDialogType.counterSteps,
_targetConfirmTimeFun(),
isAutomation,
comparator,
uniqueCustomId,
);
}
SceneStaticFunction _createDisappeDelay(Action action, bool isAutomation,
String? comparator, String? uniqueCustomId) {
return _createSceneFunction(
action,
action.deviceName,
Assets.flushIcon,
'Disappe Delay',
OperationDialogType.integerSteps,
_targetDisappeDelayFun(),
isAutomation,
comparator,
uniqueCustomId,
);
}
List<SceneOperationalValue> _targetDisappeDelayFun() {
return [
SceneOperationalValue(
icon: Assets.flushIcon,
value: 0.0,
description: 'sec',
minValue: 20,
maxValue: 300,
stepValue: 1,
),
];
}
List<SceneOperationalValue> _createFarDetection() {
return [
SceneOperationalValue(
icon: '',
description: "m",
value: 0.0,
minValue: 0.0,
maxValue: 9.5,
stepValue: 0.10,
),
];
}
List<SceneOperationalValue> _createMinDetection() {
return [
SceneOperationalValue(
icon: '',
description: "m",
value: 0.0,
minValue: 0.0,
maxValue: 9.5,
stepValue: 0.10,
),
];
}
List<SceneOperationalValue> _targetConfirmTimeFun() {
return [
SceneOperationalValue(
icon: Assets.assetsCelsiusDegrees,
value: 0.0,
description: 'sec',
minValue: 0.0,
maxValue: 0.5,
stepValue: 0.1,
),
];
}
SceneStaticFunction _createPresenceStateFunctionFlush(Action action,
bool isAutomation, String? comparator, String? uniqueCustomId) {
return _createSceneFunction(
action,
action.deviceName,
Assets.flushIcon,
'Presence State',
OperationDialogType.listOfOptions,
_createPresenceStateOptionsFlush(),
isAutomation,
comparator,
uniqueCustomId,
);
}
SceneStaticFunction _createIlluminanceValueFunctionFlush(Action action,
bool isAutomation, String? comparator, String? uniqueCustomId) {
return _createSceneFunction(
action,
action.deviceName,
Assets.flushIcon,
'Illuminance Value',
OperationDialogType.integerSteps,
_createIlluminanceValueOptionsFlush(),
isAutomation,
comparator,
uniqueCustomId,
);
}
List<SceneOperationalValue> _createIlluminanceValueOptionsFlush() {
return [
SceneOperationalValue(
icon: '',
value: 0.0,
description: "Lux",
minValue: 0,
maxValue: 10000,
stepValue: 1,
),
];
}
SceneStaticFunction _createSensitivityFunctionFlush(Action action,
bool isAutomation, String? comparator, String? uniqueCustomId) {
return _createSceneFunction(
action,
action.deviceName,
Assets.flushIcon,
'Sensitivity',
isAutomation
? OperationDialogType.integerSteps
: OperationDialogType.listOfOptions,
_createIntegerStepsOptionsFlush(),
isAutomation,
comparator,
uniqueCustomId,
);
}
List<SceneOperationalValue> _createIntegerStepsOptionsFlush() {
return [
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 1,
description: 1.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 2,
description: 2.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 3,
description: 3.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 4,
description: 4.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 5,
description: 5.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 6,
description: 6.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 7,
description: 7.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 8,
description: 8.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 9,
description: 9.toString(),
),
];
}
}

View File

@ -94,6 +94,8 @@ class CreateSceneModel {
}
class CreateSceneAction {
final String? productType;
String entityId;
String? actionType;
String actionExecutor;
@ -104,15 +106,18 @@ class CreateSceneAction {
required this.entityId,
required this.actionExecutor,
required this.executorProperty,
required this.productType,
});
CreateSceneAction copyWith({
String? productType,
String? actionType,
String? entityId,
String? actionExecutor,
CreateSceneExecutorProperty? executorProperty,
}) {
return CreateSceneAction(
productType: productType,
actionType: actionType,
entityId: entityId ?? this.entityId,
actionExecutor: actionExecutor ?? this.actionExecutor,
@ -126,18 +131,21 @@ class CreateSceneAction {
'entityId': entityId,
'actionExecutor': actionExecutor,
'executorProperty': executorProperty?.toMap(actionExecutor),
// 'productType': productType,
};
} else {
return {
"actionType": actionType,
'entityId': entityId,
'actionExecutor': actionExecutor,
// 'productType': productType,
};
}
}
factory CreateSceneAction.fromMap(Map<String, dynamic> map) {
return CreateSceneAction(
productType: map['productType'] ?? '',
entityId: map['entityId'] ?? '',
actionExecutor: map['actionExecutor'] ?? '',
executorProperty:

View File

@ -75,7 +75,6 @@ class Action {
String? name;
String? type;
final String productType;
final String deviceName;
Action({
@ -91,26 +90,24 @@ class Action {
String toRawJson() => json.encode(toJson());
static Action? fromJson(Map<String, dynamic> json) {
if (json['name'] != null && json['type'] != null) {
return Action(
actionExecutor: json["actionExecutor"] as String,
entityId: json["entityId"] as String,
name: json['name'] as String?,
type: json['type'] as String?,
productType: json['productType'] as String,
deviceName: json['deviceName'] as String,
);
}
if (json["executorProperty"] == null) {
final String? actionExecutor = json["actionExecutor"] as String?;
final String? entityId = json["entityId"] as String?;
if (actionExecutor == null || entityId == null) {
return null;
}
return Action(
actionExecutor: json["actionExecutor"] as String,
entityId: json["entityId"] as String,
executorProperty: ExecutorProperty.fromJson(json["executorProperty"]),
productType: json['productType'] as String,
deviceName: json['deviceName'] as String,
actionExecutor: actionExecutor,
entityId: entityId,
executorProperty: json["executorProperty"] != null
? ExecutorProperty.fromJson(json["executorProperty"])
: null,
name: json['name'] as String?,
type: json['type'] as String?,
productType: json['productType'] as String? ?? 'unknown',
deviceName: json['deviceName'] as String? ?? 'Delay Action',
);
}
@ -118,12 +115,13 @@ class Action {
"actionExecutor": actionExecutor,
"entityId": entityId,
"executorProperty": executorProperty?.toJson(),
// "productType": productType
};
}
class ExecutorProperty {
final String? functionCode;
final dynamic functionValue;
dynamic functionValue;
final dynamic delaySeconds;
ExecutorProperty({

View File

@ -12,7 +12,7 @@ class SceneStaticFunction {
final String deviceId;
final String operationName;
final String? uniqueCustomId;
final dynamic functionValue;
dynamic functionValue;
final String? deviceIcon;
final OperationDialogType operationDialogType;
final String? comparator;
@ -29,7 +29,7 @@ class SceneStaticFunction {
this.deviceIcon,
required this.operationDialogType,
this.comparator,
this.deviceType,
this.deviceType,
String? uniqueCustomId,
}) : uniqueCustomId = uniqueCustomId ?? const Uuid().v4();
@ -127,7 +127,8 @@ class SceneStaticFunction {
other.uniqueCustomId == uniqueCustomId &&
other.operationDialogType == operationDialogType &&
listEquals(other.operationalValues, operationalValues) &&
other.deviceId == deviceId && other.deviceType == deviceType;
other.deviceId == deviceId &&
other.deviceType == deviceType;
}
@override
@ -142,7 +143,8 @@ class SceneStaticFunction {
comparator.hashCode ^
uniqueCustomId.hashCode ^
operationDialogType.hashCode ^
operationalValues.hashCode ^ deviceType.hashCode;
operationalValues.hashCode ^
deviceType.hashCode;
}
}

View File

@ -26,20 +26,20 @@ class DeviceFunctionsView extends StatelessWidget
Widget build(BuildContext context) {
final device = (ModalRoute.of(context)?.settings.arguments as Map)['device']
as DeviceModel;
final isAutomation = (ModalRoute.of(context)?.settings.arguments
as Map)['isAutomationDeviceStatus'] as bool;
List<SceneStaticFunction> functions = [];
if (device.functions.isNotEmpty) {
functions = getFunctionsWithIcons(
type: device.productType,
functions: device.functions,
deviceId: device.uuid ?? '',
deviceName: device.name ?? '',
isAutomation: isAutomation,
);
}
// if (device.functions.isNotEmpty) {
functions = getFunctionsWithIcons(
productType: device.type ?? '',
type: device.productType,
functions: device.functions,
deviceId: device.uuid ?? '',
deviceName: device.name ?? '',
isAutomation: isAutomation,
);
// }
return DefaultScaffold(
title: getTitle(type: device.productType),
@ -257,7 +257,7 @@ class DeviceFunctionsView extends StatelessWidget
deviceName: device.name ?? '',
uniqueId: function.uniqueCustomId!,
operationType: function.operationDialogType,
deviceType: '',
deviceType: function.deviceType!,
));
Navigator.pop(context);
},
@ -298,7 +298,7 @@ class DeviceFunctionsView extends StatelessWidget
return;
}
context.read<CreateSceneBloc>().add(TempHoldSceneTasksEvent(
deviceType: device.productType!.name,
deviceType: function.deviceType!,
deviceControlModel: DeviceControlModel(
deviceId: device.uuid,
code: function.code,

View File

@ -0,0 +1,243 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/scene/bloc/create_scene/create_scene_bloc.dart';
import 'package:syncrow_app/features/scene/model/scene_static_function.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart';
import 'package:syncrow_app/utils/context_extension.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class AlertDialogCounterSteps extends StatefulWidget {
const AlertDialogCounterSteps({
super.key,
this.functionValue,
required this.taskItem,
required this.isAutomation,
});
final dynamic functionValue;
final SceneStaticFunction taskItem;
final bool isAutomation;
@override
State<AlertDialogCounterSteps> createState() =>
_AlertDialogCounterStepsState();
}
class _AlertDialogCounterStepsState extends State<AlertDialogCounterSteps> {
double? groupValue;
int selectedToggleIndex = 1;
@override
void didChangeDependencies() {
super.didChangeDependencies();
final createSceneBloc = context.read<CreateSceneBloc>();
if (widget.taskItem.comparator != null) {
selectedToggleIndex = _comparatorToIndex(widget.taskItem.comparator);
}
if (widget.isAutomation) {
final automationTempTaskList = createSceneBloc.automationTempTasksList;
final automationComparatorValues =
createSceneBloc.automationComparatorValues;
for (var element in automationTempTaskList) {
if (element.code == widget.taskItem.code) {
groupValue = element.functionValue;
selectedToggleIndex =
_comparatorToIndex(automationComparatorValues[element.code]);
}
}
}
if (widget.taskItem.code == 'temp_current') {
groupValue = widget.functionValue != null
? _normalizeValue(
double.tryParse(widget.functionValue.toString()) ??
widget.taskItem.operationalValues[0].minValue,
)
: widget.taskItem.operationalValues[0].minValue;
} else {
groupValue = widget.functionValue != null
? _normalizeValue(widget.functionValue)
: _normalizeValue(widget.taskItem.operationalValues[0].minValue);
}
setState(() {});
context.read<CreateSceneBloc>().add(
SelectedValueEvent(
value: _deNormalizeValue(groupValue),
code: widget.taskItem.code,
isAutomation: widget.isAutomation,
comparator: _indexToComparator(selectedToggleIndex),
),
);
}
int _comparatorToIndex(String? comparator) {
switch (comparator) {
case "<":
return 0;
case "==":
return 1;
case ">":
return 2;
default:
return 1;
}
}
String _indexToComparator(int index) {
switch (index) {
case 0:
return "<";
case 1:
return "==";
case 2:
return ">";
default:
return "==";
}
}
@override
Widget build(BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
if (widget.isAutomation)
ToggleButtons(
isSelected: [
selectedToggleIndex == 0,
selectedToggleIndex == 1,
selectedToggleIndex == 2,
],
onPressed: (index) {
setState(() {
selectedToggleIndex = index;
});
context.read<CreateSceneBloc>().add(
SelectedValueEvent(
value: _deNormalizeValue(groupValue),
code: widget.taskItem.code,
isAutomation: widget.isAutomation,
comparator: _indexToComparator(selectedToggleIndex),
),
);
},
borderRadius: BorderRadius.circular(30),
selectedColor: Colors.white,
color: ColorsManager.blackColor,
fillColor: ColorsManager.primaryColorWithOpacity,
borderColor: ColorsManager.greyColor,
constraints: BoxConstraints.tight(Size(70, 30)),
children: const [
SizedBox(width: 70, height: 30, child: Center(child: Text("<"))),
SizedBox(width: 70, height: 30, child: Center(child: Text("="))),
SizedBox(width: 70, height: 30, child: Center(child: Text(">"))),
],
),
const SizedBox(height: 12),
...widget.taskItem.operationalValues.map(
(operation) => BlocBuilder<CreateSceneBloc, CreateSceneState>(
builder: (context, state) {
final step = operation.stepValue?.toDouble() ?? 1.0;
final min = operation.minValue?.toDouble() ?? 0.0;
final max = operation.maxValue?.toDouble() ?? 100.0;
return Column(
children: [
const SizedBox(height: 12),
const SizedBox(height: 8),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
IconButton(
icon: const Icon(Icons.remove),
onPressed: () {
setState(() {
groupValue =
((groupValue ?? min) - step).clamp(min, max);
});
context.read<CreateSceneBloc>().add(
SelectedValueEvent(
value: _deNormalizeValue(groupValue),
code: widget.taskItem.code,
isAutomation: widget.isAutomation,
comparator:
_indexToComparator(selectedToggleIndex),
),
);
},
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TitleMedium(
text: groupValue != null
? (groupValue! % 1 == 0
? groupValue!.toStringAsFixed(0)
: groupValue!.toStringAsFixed(1))
: "0",
style: context.titleMedium.copyWith(
color: ColorsManager.primaryColorWithOpacity,
fontSize: 30,
),
),
const SizedBox(width: 8),
TitleMedium(
text: operation.description.toString(),
style: context.titleMedium.copyWith(
color: ColorsManager.primaryColorWithOpacity,
fontSize: 30,
),
),
],
),
IconButton(
icon: const Icon(Icons.add),
onPressed: () {
setState(() {
groupValue =
((groupValue ?? 0) + step).clamp(min, max);
});
context.read<CreateSceneBloc>().add(
SelectedValueEvent(
value: _deNormalizeValue(groupValue),
code: widget.taskItem.code,
isAutomation: widget.isAutomation,
comparator:
_indexToComparator(selectedToggleIndex),
),
);
},
),
],
),
const SizedBox(height: 12),
],
);
},
),
),
],
);
}
double _normalizeValue(dynamic value) {
if ((widget.taskItem.code == "temp_set" && value > 199) ||
(widget.taskItem.code == "temp_current" && value >= -99.0)) {
return (value) / 10;
}
return value.toDouble();
}
double _deNormalizeValue(double? value) {
if (widget.taskItem.code == "temp_set" ||
widget.taskItem.code == "temp_current") {
return (value ?? 0) * 10;
}
return value ?? 0;
}
}

View File

@ -7,12 +7,12 @@ import 'package:syncrow_app/utils/context_extension.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class AlertDialogSliderSteps extends StatefulWidget {
const AlertDialogSliderSteps({
super.key,
this.functionValue,
required this.taskItem,
required this.isAutomation,
});
const AlertDialogSliderSteps(
{super.key,
this.functionValue,
required this.taskItem,
required this.isAutomation,
});
final dynamic functionValue;
final SceneStaticFunction taskItem;
@ -108,67 +108,69 @@ class _AlertDialogSliderStepsState extends State<AlertDialogSliderSteps> {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
ToggleButtons(
isSelected: [
selectedToggleIndex == 0,
selectedToggleIndex == 1,
selectedToggleIndex == 2
],
onPressed: (index) {
setState(() {
selectedToggleIndex = index;
});
context.read<CreateSceneBloc>().add(
SelectedValueEvent(
value: _deNormalizeValue(groupValue),
code: widget.taskItem.code,
isAutomation: widget.isAutomation,
comparator: _indexToComparator(selectedToggleIndex),
widget.isAutomation
? ToggleButtons(
isSelected: [
selectedToggleIndex == 0,
selectedToggleIndex == 1,
selectedToggleIndex == 2
],
onPressed: (index) {
setState(() {
selectedToggleIndex = index;
});
context.read<CreateSceneBloc>().add(
SelectedValueEvent(
value: _deNormalizeValue(groupValue),
code: widget.taskItem.code,
isAutomation: widget.isAutomation,
comparator: _indexToComparator(selectedToggleIndex),
),
);
},
borderRadius: BorderRadius.circular(30),
selectedColor: Colors.white,
color: ColorsManager.blackColor,
fillColor: ColorsManager.primaryColorWithOpacity,
borderColor: ColorsManager.greyColor,
constraints: BoxConstraints.tight(const Size(70, 30)),
children: [
SizedBox(
width: 70,
height: 30,
child: Container(
color: selectedToggleIndex == 0
? ColorsManager.primaryColorWithOpacity
: ColorsManager.greyColor,
alignment: Alignment.center,
child: const Text("<"),
),
),
);
},
borderRadius: BorderRadius.circular(30),
selectedColor: Colors.white,
color: ColorsManager.blackColor,
fillColor: ColorsManager.primaryColorWithOpacity,
borderColor: ColorsManager.greyColor,
constraints: BoxConstraints.tight(const Size(70, 30)),
children: [
SizedBox(
width: 70,
height: 30,
child: Container(
color: selectedToggleIndex == 0
? ColorsManager.primaryColorWithOpacity
: ColorsManager.greyColor,
alignment: Alignment.center,
child: const Text("<"),
),
),
SizedBox(
width: 70,
height: 30,
child: Container(
color: selectedToggleIndex == 1
? ColorsManager.primaryColorWithOpacity
: ColorsManager.greyColor,
alignment: Alignment.center,
child: const Text("="),
),
),
SizedBox(
width: 70,
height: 30,
child: Container(
color: selectedToggleIndex == 2
? ColorsManager.primaryColorWithOpacity
: ColorsManager.greyColor,
alignment: Alignment.center,
child: const Text(">"),
),
),
],
),
SizedBox(
width: 70,
height: 30,
child: Container(
color: selectedToggleIndex == 1
? ColorsManager.primaryColorWithOpacity
: ColorsManager.greyColor,
alignment: Alignment.center,
child: const Text("="),
),
),
SizedBox(
width: 70,
height: 30,
child: Container(
color: selectedToggleIndex == 2
? ColorsManager.primaryColorWithOpacity
: ColorsManager.greyColor,
alignment: Alignment.center,
child: const Text(">"),
),
),
],
)
: SizedBox(),
const SizedBox(height: 12),
...widget.taskItem.operationalValues.map(
(operation) => BlocBuilder<CreateSceneBloc, CreateSceneState>(

View File

@ -0,0 +1,16 @@
import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:syncrow_app/main.dart';
Widget buildNumberAndEnvironmentLabel() {
String envNAME = dotenv.env['ENV_NAME'] ?? '';
return SizedBox(
child: Center(
child: Text(
'\n$envNAME \nBuild Number $buildNumber',
textAlign: TextAlign.center,
),
),
);
}

View File

@ -495,6 +495,7 @@ class Assets {
/// assets/icons/MenuIcons/HomeManagementIcons/CreateHome.svg
static const String assetsIconsMenuIconsHomeManagementIconsCreateHome =
"assets/icons/MenuIcons/HomeManagementIcons/CreateHome.svg";
static const String assetsIconsMenuBookingSystem = 'assets/icons/Booking.svg';
/// Assets for assetsIconsMenuIconsHomeManagementIconsJoinAHome
/// assets/icons/MenuIcons/HomeManagementIcons/joinAHome.svg
@ -1127,7 +1128,7 @@ class Assets {
static const String editNameSetting = "assets/icons/edit_name_setting.svg";
static const String verificationIcon = "assets/icons/verification_icon.svg";
static const String deleteAccountIcon='assets/icons/delete_account_icon.svg';
static const String passwordUnvisibility =
"assets/icons/password_unvisibility.svg";
static const String passwordVisibility =
@ -1156,4 +1157,9 @@ class Assets {
'assets/icons/target_confirm_time_icon.svg';
static const String disappeDelayIcon = 'assets/icons/disappe_delay_icon.svg';
static const String flushIcon = 'assets/icons/flush_icon.svg';
static const String IlluminanceIcon = 'assets/icons/Illuminance_icon.svg';
static const String nobodyTime = "assets/icons/nobody_time.svg";
static const String currentDistanceIcon = 'assets/icons/distance_icon.svg';
static const String delayIcon = 'assets/icons/delay_icon.svg';
static const String levelIcon = 'assets/icons/level_icon.svg';
}

View File

@ -9,6 +9,9 @@ import 'package:syncrow_app/utils/bloc_observer.dart';
import 'package:syncrow_app/utils/helpers/localization_helpers.dart';
import 'my_app.dart';
const String buildNumber = '1.0.30+18';
void main() {
//to observe the state of the blocs in the output console
Bloc.observer = MyBlocObserver();

View File

@ -126,8 +126,7 @@ abstract class ApiEndpoints {
static const String gatewayApi = '/devices/gateway/{gatewayUuid}/devices';
static const String deviceFunctionsStatus =
'/devices/{deviceUuid}/functions/status';
static const String powerClamp =
'/devices/{deviceUuid}/functions/status';
static const String powerClamp = '/devices/{deviceUuid}/functions/status';
///Device Permission Module
//POST
@ -196,6 +195,7 @@ abstract class ApiEndpoints {
static const String sendPicture = '/user/profile-picture/{userUuid}';
static const String getRegion = '/region';
static const String getTimezone = '/timezone';
static const String deleteProfile = '/user';
//multiple-time offline
static const String addMultipleTimeTemporaryPassword =
@ -233,4 +233,9 @@ abstract class ApiEndpoints {
static const String getPermission = '/permission/{roleUuid}';
static const String getAllDevices =
'/projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/devices';
static const String getReportLogs = '/devices/{uuid}/report-logs?code={code}';
//booking System APIs
static const String upcomingBookings = '/bookings/{uuid}/';
}

View File

@ -1,3 +1,4 @@
import 'package:dio/dio.dart';
import 'package:syncrow_app/features/auth/model/login_with_email_model.dart';
import 'package:syncrow_app/features/auth/model/signup_model.dart';
import 'package:syncrow_app/features/auth/model/token.dart';
@ -83,4 +84,18 @@ class AuthenticationAPI {
);
return response;
}
static Future<void> deleteAccount() async {
try {
await HTTPService().delete(
path: ApiEndpoints.deleteProfile,
expectedResponseModel: (p0) {},
);
} on DioException catch (e) {
final errorData = e.response!.data;
String errorMessage =
errorData['error']['message'] ?? 'something went wrong';
throw Exception(errorMessage);
}
}
}

View File

@ -569,6 +569,22 @@ class DevicesAPI {
return response;
}
static Future<DeviceReport> getReports(
String uuid,
String code,
) async {
final response = await HTTPService().get(
path: ApiEndpoints.getReportLogs
.replaceAll('{uuid}', uuid)
.replaceAll('{code}', code),
showServerMessage: false,
expectedResponseModel: (json) {
return DeviceReport.fromJson(json['data'] as Map<String, dynamic>);
},
);
return response;
}
static Future<List<DeviceModel>> getAllDevices({
required String communityUuid,
required String spaceUuid,

View File

@ -0,0 +1,4 @@
import 'package:flutter/material.dart';
double deviceHeight(BuildContext context) => MediaQuery.sizeOf(context).height;
double deviceWidth(BuildContext context) => MediaQuery.sizeOf(context).width;

View File

@ -207,7 +207,7 @@ abstract class ThemeManager {
),
///card theme
cardTheme: const CardTheme(
cardTheme: const CardThemeData(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(20)),
@ -372,7 +372,7 @@ abstract class ThemeManager {
///card theme
//TODO edit card theme
cardTheme: const CardTheme(
cardTheme: const CardThemeData(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(20)),

View File

@ -5,7 +5,7 @@ description: This is the mobile application project, developed with Flutter for
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 1.0.30+1
version: 1.0.30+18
environment:
sdk: ">=3.0.6 <4.0.0"