Compare commits

..

76 Commits

Author SHA1 Message Date
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
9cc4538dc5 Add flush sensor icon to assets and enhancement code 2025-05-07 10:11:33 +03:00
14a5d26ef9 add new flush sensor device to app 2025-05-06 16:20:05 +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
8a21828dd4 add water heater device to routine and fix device type in routine 2025-05-05 10:00:54 +03:00
5890a70243 Added CLIENT_ID and CLIENT_SECRET to .env.staging file. 2025-04-29 10:37:08 +03:00
5a70df0a61 Merge pull request #94 from SyncrowIOT/SP-1471-BE-On-mobile-app-Error-while-retrieving-scene-details-on-4-6-Scenes-devices
Refactor device_info_model.dart and devices_api.dart
2025-04-28 16:13:34 +03:00
d493000c20 Refactor return type of deviceByUuid API method in devices_api.dart 2025-04-28 16:11:07 +03:00
6a27f863c3 Refactor device_info_model.dart and devices_api.dart 2025-04-28 15:59:10 +03:00
bde418e52a Merge pull request #93 from SyncrowIOT/SP-1472-FE-On-Mobile-2-3-Gangs-Devices-conditions-Action-names-are-changing-when-we-save-a-routine-then-try-to-edit-it
Sp 1472 fe on mobile 2 3 gangs devices conditions action names are changing when we save a routine then try to edit it
2025-04-28 11:25:33 +03:00
3725d28a5e Refactor device names in scene operations data helper 2025-04-28 11:06:27 +03:00
f30b7b0831 Fixed routines bug where it threw 404 because of a developer error. 2025-04-28 10:02:41 +03:00
405cccad03 Merge pull request #92 from SyncrowIOT/SP-1477-FE-On-mobile-app-Error-fetching-device-functions-status-when-we-open-the-power-clamp-device-control
SP-1477
2025-04-28 09:02:02 +03:00
a7080248cb SP-1477 2025-04-27 12:50:20 +03:00
25893e3bbd Merge pull request #90 from SyncrowIOT/sp-1268-rework-v3
SP-1268 Rework
2025-04-24 16:26:31 +03:00
c90f0874c2 Merge pull request #91 from SyncrowIOT/changed_titles_of_devices_view
Changed titles of devices view
2025-04-24 16:26:15 +03:00
214ec78a95 added title to four scene view. 2025-04-24 12:41:45 +03:00
ed9f98e653 Temporarily disable showing the NCPS device from all the all devices api, for release and demo purposes. Feel free to revert this commit once the device is needed back into the application. 2025-04-24 12:40:02 +03:00
a37236c8d2 changed titles of devices views, and responsiness of device card. 2025-04-24 12:12:56 +03:00
1f1a8a7208 SP-1268 2025-04-23 15:43:55 +03:00
e7efd2b3a1 Merge pull request #89 from SyncrowIOT/fix-device-ui-routine
Refactor device name display in Action and Condition models
2025-04-23 10:20:10 +03:00
2b0e504f05 Refactor device name display in Action and Condition models 2025-04-23 10:07:14 +03:00
a656d5981e Merge pull request #88 from SyncrowIOT/Fix-Save-Display-Condition
Fix save display condition
2025-04-22 15:42:42 +03:00
3f49a18130 remove unused code 2025-04-21 15:19:14 +03:00
a51c4d9679 Refactor device name display in RoomPageSwitch widget 2025-04-21 15:00:31 +03:00
caeed8e73f Merge pull request #87 from SyncrowIOT/FE-Complete-the-Device-Name-as
Refactor device name display in RoomPageSwitch widget
2025-04-21 10:43:22 +03:00
dc5ac9be5b Refactor device name display in RoomPageSwitch widget 2025-04-21 10:36:43 +03:00
5c9b30895f Merge pull request #86 from SyncrowIOT/SP-1286-FE-Add-Device-to-Routine-2-Gang
add tow gang and change gang device ui
2025-04-17 16:29:24 +03:00
06b14a3964 add tow gang and change gang device ui 2025-04-17 16:14:48 +03:00
3c92ea3047 Merge pull request #85 from SyncrowIOT/SP-1285-FE-Add-Device-to-Routine
Sp 1285 fe add device to routine
2025-04-17 10:42:06 +03:00
73d28a1800 Refactor Action class to use type annotations for actionExecutor and entityId 2025-04-17 10:41:01 +03:00
5493ca6fb0 Refactor device filtering logic to improve code readability 2025-04-17 10:38:25 +03:00
7005d8ba83 Refactor device filtering logic and improve code readability
- Extracted the logic for filtering implemented devices into a separate method `_getOnlyImplementedDevices`
- Created a set `allowedDevices` to store the allowed device types
- Updated the filtering logic to use the `allowedDevices` set for checking device types
- Removed unnecessary conditions for filtering devices

Fix nullability issues in `Action` model

- Added null checks for `actionExecutor`, `entityId`, `name`, `type`, and `productType` properties in the `fromJson` method of the `Action` model
- Set default values for `actionExecutor` and `entityId` if they are null
- Updated the type casting for `name`, `type`, and `productType` properties to avoid potential nullability issues
2025-04-17 10:16:10 +03:00
cb79627038 Merge pull request #83 from SyncrowIOT/SP-1397-FE-Create-Routine-SceneRoomsTabBarDevicesView-throws-TabBarController-initialization-error
Sp 1397 fe create routine scene rooms tab bar devices view throws tab bar controller initialization error
2025-04-17 09:47:46 +03:00
1cff69d496 change icon 2025-04-17 09:39:58 +03:00
60df77efad add OneGang product type to routine 2025-04-17 09:32:20 +03:00
9e84048f81 Merge pull request #84 from SyncrowIOT:SP-1416
fixed typo
2025-04-16 20:57:45 +04:00
99adb1c286 fixed typo 2025-04-16 20:57:13 +04:00
f2412aa867 refactor: extract device fetching logic into a separate method for improved readability 2025-04-16 16:10:36 +03:00
e4768c95aa refactor: rename tab change events and states for consistency, and to match blocs naming convention. 2025-04-16 16:07:30 +03:00
f25b4dbf6d implement SceneDevicesBodyTabBar for improved tab management in SceneDevicesBody. 2025-04-16 15:57:21 +03:00
9eff9ab371 refactor: consolidate device loading and error handling in SceneDevicesBody and implement SceneDevicesList widget 2025-04-16 15:46:56 +03:00
a2e68d6194 fix: restore title in DefaultScaffold for SceneRoomsTabBarDevicesView 2025-04-16 15:25:23 +03:00
94c94b170f fix: correct order of dispose method calls in SceneRoomsTabBarDevicesView 2025-04-16 15:24:47 +03:00
253cf15559 refactor: simplify SceneDevicesBody widget structure and improve loading indicator handling 2025-04-16 15:24:37 +03:00
443eea9421 SP-1397 2025-04-16 15:11:43 +03:00
87a2c08f64 Merge pull request #82 from SyncrowIOT/SP-1416
added client token login
2025-04-16 12:35:31 +04:00
dd66e7c747 added client token login 2025-04-16 12:02:19 +04:00
7af61d2f65 added client id and secret 2025-04-16 11:34:24 +04:00
f37eacb0ee Merge pull request #81 from SyncrowIOT/feat/update-additional-device-endpoints
updated endpoint for device
2025-04-14 15:11:36 +03:00
c7dcc297aa fix conflict 2025-04-14 15:11:02 +03:00
aefe5ad081 Merge branch 'dev' into feat/update-additional-device-endpoints 2025-04-14 15:10:42 +03:00
8d9af8519d Merge pull request #78 from SyncrowIOT/SP-1246
updated device endpoint
2025-04-14 14:58:09 +03:00
b1d52937c9 Merge branch 'dev' of https://github.com/SyncrowIOT/syncrow-app into feat/update-additional-device-endpoints 2025-04-14 10:31:09 +04:00
5fedf37421 updated endpoint for device 2025-04-14 10:30:48 +04:00
ccde857c29 Merge pull request #80 from SyncrowIOT/SP-1398-FE-in-the-wizerd-the-batch-control-title-doesn-t-represent-the-the-accurate-device-name
SP-1398-FE-in-the-wizerd-the-batch-control-title-doesn-t-represent-the-the-accurate-device-name
2025-04-13 16:23:49 +03:00
b2a8086e0e Merge pull request #79 from SyncrowIOT/sp-1268-rework-v2
Sp 1268 rework v2
2025-04-13 16:20:10 +03:00
408e78962c SP-1398 2025-04-13 16:18:49 +03:00
dcdbc02ca0 Adds AppLoadingIndicator widget and replaces CircularProgressIndicator in SceneView. 2025-04-13 15:50:52 +03:00
31025e9176 Refactors SceneView constructor and improves conditional rendering for automation list 2025-04-13 15:49:13 +03:00
8219de6821 Injects SceneBloc using the new factory. 2025-04-13 15:28:44 +03:00
fbdf3817ab Created a factory helper to create a SceneBloc. 2025-04-13 15:25:48 +03:00
17422edd0d sp-1268-rework-v2. 2025-04-13 15:21:20 +03:00
4c8f2c72df Merge branch 'dev' of https://github.com/SyncrowIOT/syncrow-app into SP-1246 2025-04-03 10:47:27 +04:00
fb867e5df3 updated device endpoint 2025-04-03 10:47:09 +04:00
9472390284 Merge pull request #76 from SyncrowIOT/bugifx/empty-subspace-routine-creation
fixed issue on empty subspace
2025-03-28 11:38:14 +04:00
731ba0f3d6 Merge pull request #77 from SyncrowIOT/SP-1268-FE-Implement-UX-Behavior-for-No-Tab-to-Run-Scene-in-Device-Screen
Sp 1268 fe implement ux behavior for no tab to run scene in device screen
2025-03-26 15:24:34 +03:00
ef5e7c3154 fixed issue on empty subspace 2025-03-25 14:15:14 +04:00
98 changed files with 4443 additions and 1013 deletions

View File

@ -1,3 +1,5 @@
ENV_NAME=development
BASE_URL=https://syncrow-dev.azurewebsites.net
PROJECT_ID=0e62577c-06fa-41b9-8a92-99a21fbaf51c
CLIENT_ID=c024573d191a327ce74db7d4502fdc29
CLIENT_SECRET=fec6ccbc33664f94a3b84a45c7cceef3f3ebd1613ef4307db8946ede530cd1ed

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

View File

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

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,10 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_7302_4118)">
<path d="M11.1049 10.0001L19.7712 1.33381C20.0763 1.02869 20.0763 0.534007 19.7712 0.228929C19.4661 -0.0761485 18.9714 -0.0761876 18.6663 0.228929L9.99999 8.89524L1.33372 0.228929C1.0286 -0.0761876 0.533915 -0.0761876 0.228837 0.228929C-0.0762401 0.534046 -0.0762792 1.02873 0.228837 1.33381L8.89511 10.0001L0.228837 18.6664C-0.0762792 18.9715 -0.0762792 19.4662 0.228837 19.7713C0.381376 19.9238 0.581337 20.0001 0.781297 20.0001C0.981258 20.0001 1.18118 19.9238 1.33376 19.7713L9.99999 11.105L18.6663 19.7713C18.8188 19.9238 19.0188 20.0001 19.2187 20.0001C19.4187 20.0001 19.6186 19.9238 19.7712 19.7713C20.0763 19.4662 20.0763 18.9715 19.7712 18.6664L11.1049 10.0001Z" fill="#999999"/>
</g>
<defs>
<clipPath id="clip0_7302_4118">
<rect width="20" height="20" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 939 B

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

View File

@ -0,0 +1,17 @@
<svg width="30" height="19" viewBox="0 0 30 19" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M29.9999 14.9414L9.72644 11.4258L14.9999 18.457H29.9999V14.9414Z" fill="#FFB54C"/>
<path d="M0 14.9414V18.457H15V11.4258L0 14.9414Z" fill="#FFCC4A"/>
<path d="M30.0002 14.9404V7.03027H27.7883L26.9094 7.90918L26.0305 7.03027H23.8186L22.9397 7.90918L22.0608 7.03027H19.8489L18.97 7.90918L18.0911 7.03027H15.8792L11.4846 10.9854L15.0002 14.9404H30.0002Z" fill="#FFCC4A"/>
<path d="M15 7.03027H14.1211H11.9092L11.0303 7.90918L10.1514 7.03027H7.93945L7.06055 7.90918L6.18164 7.03027H3.96973L3.09082 7.90918L2.21191 7.03027H0V14.9404H15V7.03027Z" fill="#FFE278"/>
<path d="M29.1212 1.75781H15.0001L14.1212 2.63672L15.0001 3.51562H29.1212V1.75781Z" fill="#ABD5ED"/>
<path d="M15 1.75781H1.75781V0H0V5.27344H1.75781V3.51562H15V1.75781Z" fill="#BFEBFF"/>
<path d="M28.2423 0H30.0001V5.27344H28.2423V0Z" fill="#ABD5ED"/>
<path d="M2.21191 7.03076H3.96973V11.4253H2.21191V7.03076Z" fill="#587AA1"/>
<path d="M6.18152 7.03076H7.93933V9.66748H6.18152V7.03076Z" fill="#587AA1"/>
<path d="M10.1516 7.03076H11.9094V11.4253H10.1516V7.03076Z" fill="#587AA1"/>
<path d="M15.8787 9.66699H14.9998L14.5603 9.22754V7.46973L14.9998 7.03027H15.8787V9.66699Z" fill="#455F80"/>
<path d="M14.1212 7.03027H15.0001V9.66699H14.1212V7.03027Z" fill="#587AA1"/>
<path d="M18.0907 7.03027H19.8485V11.4248H18.0907V7.03027Z" fill="#455F80"/>
<path d="M22.0603 7.03027H23.8181V9.66699H22.0603V7.03027Z" fill="#455F80"/>
<path d="M26.0304 7.03027H27.7882V11.4248H26.0304V7.03027Z" fill="#455F80"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 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

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,15 @@
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.5419 20.2424C11.1182 19.3486 10.0545 18.9678 9.16647 19.3935L1.38334 23.1268C0.591819 23.3098 0 24.0197 0 24.8727V33.8466C0 34.8381 0.797668 35.6413 1.78229 35.6413C2.76668 35.6413 3.56412 34.8381 3.56412 33.8466V27.6644L9.16647 30.3516C9.41376 30.4704 9.67449 30.5264 9.93112 30.5264C10.5974 30.5264 11.2359 30.1484 11.5419 29.5025C11.9643 28.6076 11.5875 27.5367 10.699 27.1103L6.03295 24.8725L10.699 22.6346C11.5877 22.2085 11.9643 21.1376 11.5419 20.2424Z" fill="#D5D5D5"/>
<path d="M20.6084 17.6894C20.8655 17.6894 21.1257 17.6334 21.3737 17.5146L32.0481 12.3951C32.9366 11.9685 33.3141 10.8974 32.891 10.0024C32.4682 9.10864 31.4052 8.72813 30.5156 9.15359L19.8408 14.2736C18.9522 14.6999 18.5754 15.7706 18.998 16.6658C19.3038 17.3112 19.9423 17.6894 20.6084 17.6894Z" fill="#D5D5D5"/>
<path d="M42.7227 7.27445L48.1841 4.65449V10.9114C48.1841 11.9027 48.9818 12.7061 49.9659 12.7061C50.9503 12.7061 51.7478 11.9027 51.7478 10.9114V4.62192L57.2779 7.27445C57.5259 7.39303 57.7862 7.44922 58.0433 7.44922C58.7091 7.44922 59.3478 7.07124 59.6534 6.42537C60.0763 5.53041 59.6994 4.45953 58.8106 4.03316L50.7663 0.174427C50.2813 -0.0581424 49.7189 -0.0581424 49.2338 0.174427L41.19 4.03316C40.3015 4.45953 39.9244 5.53018 40.3472 6.42537C40.771 7.32101 41.8362 7.70198 42.7227 7.27445Z" fill="#D5D5D5"/>
<path d="M67.9533 12.3944L78.6281 17.5146C78.875 17.6334 79.1361 17.6894 79.3932 17.6894C80.059 17.6894 80.6978 17.3114 81.0034 16.6655C81.426 15.7706 81.0494 14.6997 80.1606 14.2733L69.4856 9.1529C68.5982 8.72721 67.5345 9.10726 67.1105 10.0018C66.6875 10.8967 67.0645 11.9676 67.9533 12.3944Z" fill="#D5D5D5"/>
<path d="M81.539 34.8099C82.4275 34.3837 82.8046 33.3128 82.3815 32.4177C81.9587 31.5232 80.8946 31.1424 80.0065 31.5695L73.167 34.8509L51.7477 24.577V16.5765C51.7477 15.5846 50.9503 14.7818 49.9659 14.7818C48.9817 14.7818 48.1841 15.5848 48.1841 16.5765V24.6096L26.8346 34.85L20.6999 31.9073C19.8093 31.481 18.7482 31.8612 18.3244 32.7564C17.9016 33.6514 18.2787 34.7225 19.1672 35.1489L25.8031 38.3319V61.6684L19.0593 64.9031C18.1707 65.3295 17.7939 66.4001 18.2165 67.2955C18.5221 67.9412 19.1606 68.3192 19.8266 68.3192C20.0837 68.3192 20.3447 68.2632 20.5917 68.1444L26.8349 65.1499L48.1841 75.3903V81.5075C48.1841 82.4993 48.9817 83.3022 49.9659 83.3022C50.9503 83.3022 51.7477 82.499 51.7477 81.5075V75.4233L73.1657 65.1501L79.6524 68.2616C79.9002 68.3802 80.1607 68.4364 80.4175 68.4364C81.0834 68.4364 81.7221 68.0584 82.0277 67.4125C82.4508 66.5175 82.0735 65.4467 81.1849 65.0201L74.1977 61.6687V38.3319L81.539 34.8099ZM70.634 62.3879L51.7479 71.4467V49.0994L70.634 40.0402V62.3879ZM29.4788 61.8939C29.4472 61.8269 29.4053 61.7691 29.3668 61.7081V40.0404L48.1841 49.0663V71.4141L29.6409 62.5198C29.6239 62.3086 29.5745 62.0964 29.4788 61.8939ZM50.0003 27.7151L69.0207 36.8383L50.0003 45.9611L30.9799 36.8383L50.0003 27.7151Z" fill="#D5D5D5"/>
<path d="M78.6271 82.486L67.9525 87.6062C67.0639 88.0328 66.6864 89.1036 67.1095 89.9979C67.4153 90.644 68.054 91.0215 68.7199 91.0215C68.9767 91.0215 69.2379 90.9656 69.485 90.8477L80.1598 85.7273C81.0483 85.3009 81.4252 84.2295 81.0025 83.3346C80.579 82.4401 79.5149 82.0616 78.6271 82.486Z" fill="#D5D5D5"/>
<path d="M57.2782 92.7266L51.748 95.3793V88.227C51.748 87.2357 50.9506 86.4323 49.9662 86.4323C48.982 86.4323 48.1844 87.2357 48.1844 88.227V95.3468L42.723 92.7266C41.8335 92.3023 40.7713 92.6807 40.3475 93.5759C39.9246 94.4709 40.3015 95.5413 41.1903 95.9676L49.2346 99.8259C49.4769 99.9417 49.7387 100 50.0008 100C50.2629 100 50.5248 99.9417 50.7671 99.8259L58.8114 95.9676C59.6999 95.5413 60.077 94.4709 59.6541 93.5759C59.2304 92.6807 58.166 92.3032 57.2782 92.7266Z" fill="#D5D5D5"/>
<path d="M32.0476 87.6061L21.3728 82.4859C20.4863 82.0605 19.4217 82.4394 18.9975 83.3343C18.5749 84.2293 18.9517 85.3006 19.8403 85.727L30.5153 90.8474C30.7622 90.9653 31.0233 91.0213 31.2802 91.0213C31.946 91.0213 32.5847 90.6438 32.8903 89.9977C33.3132 89.1036 32.9361 88.0328 32.0476 87.6061Z" fill="#D5D5D5"/>
<path d="M11.5419 70.4974C11.1182 69.6029 10.0545 69.224 9.16647 69.6488L3.56412 72.3355V65.6178C3.56412 64.6265 2.76668 63.823 1.78229 63.823C0.797668 63.823 0 64.6265 0 65.6178V74.5919C0 74.8162 0.0457694 75.0284 0.120686 75.2263C0.156892 75.8784 0.53193 76.4651 1.12215 76.7486L9.16647 80.6073C9.41376 80.7254 9.67449 80.7818 9.93112 80.7818C10.5974 80.7818 11.2359 80.4038 11.5419 79.7582C11.9643 78.8632 11.5875 77.7924 10.699 77.3655L6.03295 75.1281L10.699 72.8903C11.5877 72.4637 11.9643 71.3923 11.5419 70.4974Z" fill="#D5D5D5"/>
<path d="M1.78229 56.8226C2.76668 56.8226 3.56412 56.0193 3.56412 55.0274V44.4374C3.56412 43.4461 2.76668 42.6427 1.78229 42.6427C0.797668 42.6427 0 43.4461 0 44.4374V55.0274C0.00022771 56.0193 0.797896 56.8226 1.78229 56.8226Z" fill="#D5D5D5"/>
<path d="M98.6173 23.1268L90.8342 19.3935C89.9443 18.9667 88.8825 19.3479 88.4589 20.2424C88.0363 21.1378 88.4132 22.2084 89.3017 22.6351L93.9677 24.8729L89.3017 27.1108C88.4132 27.5371 88.0363 28.6078 88.4589 29.503C88.7645 30.1488 89.4032 30.5268 90.0691 30.5268C90.3262 30.5268 90.5873 30.4709 90.8342 30.3521L96.4365 27.6649V33.847C96.4365 34.8385 97.234 35.6418 98.2184 35.6418C99.2027 35.6418 100 34.8385 100 33.847V24.8731C100 24.0197 99.4088 23.3098 98.6173 23.1268Z" fill="#D5D5D5"/>
<path d="M98.2184 42.642C97.2337 42.642 96.4365 43.4455 96.4365 44.4367V55.0267C96.4365 56.0187 97.234 56.8214 98.2184 56.8214C99.2027 56.8214 100 56.0184 100 55.0267V44.4367C100 43.4455 99.203 42.642 98.2184 42.642Z" fill="#D5D5D5"/>
<path d="M98.2184 63.8228C97.2337 63.8228 96.4365 64.6263 96.4365 65.6175V72.3352L90.8342 69.6485C89.9443 69.2231 88.8825 69.6022 88.4589 70.4971C88.0363 71.3921 88.4132 72.4634 89.3017 72.8898L93.9677 75.1277L89.3017 77.3651C88.4132 77.7919 88.0363 78.8628 88.4589 79.7577C88.7645 80.4034 89.4032 80.7814 90.0691 80.7814C90.3262 80.7814 90.5873 80.7249 90.8342 80.6068L98.8785 76.7481C99.4687 76.4646 99.8438 75.8779 99.88 75.2258C99.9546 75.0279 100 74.8157 100 74.5914V65.6173C100 64.6263 99.203 63.8228 98.2184 63.8228Z" fill="#D5D5D5"/>
</svg>

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -0,0 +1,22 @@
<svg width="38" height="40" viewBox="0 0 38 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19 0C18.3528 0 17.8281 0.524531 17.8281 1.17188V5.85938C17.8281 6.50656 18.3528 7.03125 19 7.03125C19.6472 7.03125 20.1719 6.50656 20.1719 5.85938V1.17188C20.1719 0.524531 19.6472 0 19 0Z" fill="#596C76"/>
<path d="M20.1719 5.85938V1.17188C20.1719 0.524531 19.6472 0 19 0V7.03125C19.6472 7.03125 20.1719 6.50656 20.1719 5.85938Z" fill="#3B4A51"/>
<path d="M30.7188 4.6875H19H7.28125C5.34266 4.6875 3.76562 6.26453 3.76562 8.20312V13.0469C3.76562 14.9855 5.34266 16.5625 7.28125 16.5625H19H30.7188C32.6573 16.5625 34.2344 14.9855 34.2344 13.0469V8.20312C34.2344 6.26453 32.6573 4.6875 30.7188 4.6875Z" fill="#596C76"/>
<path d="M34.2344 13.0469V8.20312C34.2344 6.26453 32.6573 4.6875 30.7188 4.6875H19V16.5625H30.7188C32.6573 16.5625 34.2344 14.9855 34.2344 13.0469Z" fill="#3B4A51"/>
<path d="M28.375 0H19H9.625C8.97727 0 8.45312 0.524141 8.45312 1.17188C8.45312 1.81961 8.97727 2.34375 9.625 2.34375H19H28.375C29.0227 2.34375 29.5469 1.81961 29.5469 1.17188C29.5469 0.524141 29.0227 0 28.375 0Z" fill="#596C76"/>
<path d="M29.5469 1.17188C29.5469 0.524141 29.0227 0 28.375 0H19V2.34375H28.375C29.0227 2.34375 29.5469 1.81961 29.5469 1.17188Z" fill="#3B4A51"/>
<path d="M19 35.3125C24.5046 35.3125 29.6315 33.1096 33.4344 29.1087C33.8808 28.6395 33.8613 27.8979 33.3933 27.4516C32.9229 27.0053 32.1825 27.0247 31.7361 27.4928C28.3796 31.0244 23.8557 32.9688 19 32.9688C14.1443 32.9688 9.62037 31.0244 6.26388 27.4928C5.81873 27.0247 5.07716 27.0053 4.60677 27.4516C4.13873 27.8979 4.11927 28.6395 4.5656 29.1087C8.36841 33.1096 13.4954 35.3125 19 35.3125Z" fill="#D5E8FE"/>
<path d="M19 30.6253C23.0203 30.6253 26.8152 29.0677 29.6853 26.2399C30.1465 25.7867 30.1511 25.044 29.6967 24.5828C29.2447 24.1227 28.5031 24.1182 28.0396 24.5714C25.6112 26.9632 22.4001 28.2816 19 28.2816C15.5999 28.2816 12.3887 26.9632 9.96031 24.5714C9.49679 24.1148 8.75523 24.1217 8.3032 24.5828C7.8489 25.044 7.85343 25.7867 8.31461 26.2399C11.1848 29.0677 14.9797 30.6253 19 30.6253Z" fill="#D5E8FE"/>
<path d="M19 25.9377C21.5223 25.9377 23.9667 25.0291 25.8813 23.3788C26.3712 22.9554 26.4261 22.2161 26.0037 21.7252C25.578 21.233 24.8399 21.1816 24.3501 21.6027C22.8612 22.8868 20.9305 23.5287 19 23.5287C17.0695 23.5287 15.1387 22.8867 13.6499 21.6027C13.1578 21.1816 12.4185 21.2331 11.9962 21.7252C11.574 22.2161 11.6289 22.9554 12.1187 23.3788C14.0333 25.0291 16.4777 25.9377 19 25.9377Z" fill="#D5E8FE"/>
<path d="M16.1687 20.52C17.0316 20.9973 18.0112 21.2502 19 21.2502C19.9887 21.2502 20.9683 20.9973 21.8312 20.52C22.3977 20.2064 22.6026 19.4934 22.289 18.927C21.9754 18.3605 21.259 18.1545 20.6959 18.4692C20.1798 18.7553 19.5898 18.8984 18.9999 18.8984C18.41 18.8984 17.82 18.7553 17.3039 18.4692C16.7386 18.1545 16.0233 18.3605 15.7109 18.927C15.3974 19.4935 15.6023 20.2065 16.1687 20.52Z" fill="#D5E8FE"/>
<path d="M37.0897 30.324C36.6113 29.8903 35.8709 29.92 35.4337 30.3984C31.2177 35.0104 25.2279 37.6563 19 37.6563C12.7721 37.6563 6.78226 35.0104 2.56624 30.3985C2.12906 29.9201 1.38867 29.8904 0.910306 30.3241C0.433119 30.7613 0.399916 31.5017 0.835931 31.98C5.49593 37.0772 12.1164 40 19 40C25.8836 40 32.5041 37.0772 37.1641 31.98C37.6001 31.5017 37.5669 30.7612 37.0897 30.324Z" fill="#D5E8FE"/>
<path d="M37.0897 30.324C36.6113 29.8903 35.8709 29.92 35.4338 30.3984C31.2177 35.0104 25.2279 37.6563 19 37.6563V40C25.8836 40 32.5041 37.0772 37.1641 31.98C37.6001 31.5017 37.5669 30.7612 37.0897 30.324Z" fill="#B5DBFF"/>
<path d="M33.3932 27.4516C32.9228 27.0053 32.1824 27.0247 31.7361 27.4928C28.3796 31.0244 23.8557 32.9688 19 32.9688V35.3125C24.5046 35.3125 29.6316 33.1096 33.4345 29.1087C33.8808 28.6395 33.8613 27.8979 33.3932 27.4516Z" fill="#B5DBFF"/>
<path d="M29.6968 24.5826C29.2448 24.1225 28.5032 24.118 28.0397 24.5712C25.6113 26.963 22.4001 28.2813 19 28.2813V30.6251C23.0203 30.6251 26.8152 29.0675 29.6853 26.2397C30.1466 25.7865 30.1511 25.0438 29.6968 24.5826Z" fill="#B5DBFF"/>
<path d="M26.0038 21.7252C25.578 21.233 24.8399 21.1816 24.3501 21.6027C22.8612 22.8868 20.9305 23.5287 19 23.5287V25.9377C21.5223 25.9377 23.9667 25.0291 25.8813 23.3788C26.3712 22.9554 26.4261 22.2161 26.0038 21.7252Z" fill="#B5DBFF"/>
<path d="M22.2891 18.927C21.9755 18.3605 21.2591 18.1545 20.696 18.4692C20.1799 18.7553 19.5899 18.8984 19 18.8984V21.2501C19.9887 21.2501 20.9684 20.9972 21.8312 20.5199C22.3977 20.2064 22.6026 19.4934 22.2891 18.927Z" fill="#B5DBFF"/>
<path d="M14.3125 11.7969C14.9597 11.7969 15.4844 11.2722 15.4844 10.625C15.4844 9.97779 14.9597 9.45312 14.3125 9.45312C13.6653 9.45312 13.1406 9.97779 13.1406 10.625C13.1406 11.2722 13.6653 11.7969 14.3125 11.7969Z" fill="#EDF5FF"/>
<path d="M23.6875 11.7969C24.3347 11.7969 24.8594 11.2722 24.8594 10.625C24.8594 9.97779 24.3347 9.45312 23.6875 9.45312C23.0403 9.45312 22.5156 9.97779 22.5156 10.625C22.5156 11.2722 23.0403 11.7969 23.6875 11.7969Z" fill="#51FAFF"/>
<path d="M19 11.7969C19.6472 11.7969 20.1719 11.2722 20.1719 10.625C20.1719 9.97779 19.6472 9.45312 19 9.45312C18.3528 9.45312 17.8281 9.97779 17.8281 10.625C17.8281 11.2722 18.3528 11.7969 19 11.7969Z" fill="#EDF5FF"/>
<path d="M20.1719 10.625C20.1719 9.97766 19.6472 9.45312 19 9.45312V11.7969C19.6472 11.7969 20.1719 11.2722 20.1719 10.625Z" fill="#D5E8FE"/>
</svg>

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -0,0 +1,13 @@
<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_10065)">
<path d="M17.6069 21.8341H4.06313C1.81893 21.8341 0 20.0151 0 17.7709V4.22719C0 1.98299 1.81893 0.164062 4.06313 0.164062H17.6069C19.8511 0.164062 21.67 1.98299 21.67 4.22719V17.7709C21.67 20.0151 19.8511 21.8341 17.6069 21.8341Z" fill="#E3F8FA"/>
<path d="M15.1312 7.18375L10.955 5.60387C10.8771 5.57475 10.7925 5.57475 10.7153 5.60387L6.53904 7.18375C6.40767 7.23386 6.32031 7.35982 6.32031 7.50067V9.30605C6.32031 9.41711 6.37516 9.5214 6.46591 9.58438C6.55868 9.64736 6.67516 9.6609 6.77877 9.6223L10.8351 8.08779L14.8915 9.62298C14.9301 9.6372 14.9707 9.64465 15.0113 9.64465C15.0791 9.64465 15.1461 9.62433 15.2043 9.58438C15.2958 9.5214 15.3499 9.41711 15.3499 9.30605V7.5C15.3499 7.35914 15.2626 7.23318 15.1312 7.18375Z" fill="#8CE1EB"/>
<path d="M15.1312 13.9572L10.955 12.3773C10.8771 12.3482 10.7925 12.3482 10.7153 12.3773L6.53904 13.9572C6.40767 14.0073 6.32031 14.1333 6.32031 14.2741V16.0795C6.32031 16.1906 6.37516 16.2948 6.46591 16.3578C6.55868 16.4215 6.67516 16.435 6.77877 16.3957L10.8351 14.8612L14.8915 16.3964C14.9301 16.4106 14.9707 16.4181 15.0113 16.4181C15.0791 16.4181 15.1461 16.3978 15.2043 16.3578C15.2958 16.2948 15.3499 16.1906 15.3499 16.0795V14.2734C15.3499 14.1326 15.2626 14.0066 15.1312 13.9572Z" fill="#26C6DA"/>
<path d="M15.1312 10.5705L10.955 8.99059C10.8771 8.96147 10.7925 8.96147 10.7153 8.99059L6.53904 10.5705C6.40767 10.6206 6.32031 10.7465 6.32031 10.8874V12.6928C6.32031 12.8038 6.37516 12.9081 6.46591 12.9711C6.55868 13.0348 6.67516 13.0483 6.77877 13.009L10.8351 11.4745L14.8915 13.0097C14.9301 13.0239 14.9707 13.0314 15.0113 13.0314C15.0791 13.0314 15.1461 13.0111 15.2043 12.9711C15.2958 12.9081 15.3499 12.8038 15.3499 12.6928V10.8867C15.3499 10.7459 15.2626 10.6199 15.1312 10.5705Z" fill="#26C6DA"/>
</g>
<defs>
<clipPath id="clip0_8194_10065">
<rect width="21.67" height="21.67" fill="white" transform="translate(0 0.164062)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.0 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

@ -0,0 +1,12 @@
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_7305_15779)">
<path d="M17.0872 11.5142C17.0872 13.2025 16.427 14.8021 15.2211 15.9954C14.0278 17.2014 12.4283 17.8615 10.7399 17.8615C9.05141 17.8615 7.45185 17.2014 6.25856 15.9954C5.05262 14.8021 4.39249 13.2025 4.39249 11.5142C4.39249 9.82574 5.05266 8.22618 6.25856 7.03289C7.45185 5.8269 9.05141 5.16681 10.7399 5.16681C11.8063 5.16681 12.8471 5.43337 13.7866 5.95388L11.2984 8.97523H21.0861L18.6486 0L16.2113 2.97053C14.5737 1.91691 12.6948 1.35835 10.7398 1.35835C8.02314 1.35835 5.47142 2.41197 3.55459 4.32888C1.63765 6.24578 0.583984 8.79747 0.583984 11.5142C0.583984 14.2309 1.63765 16.7825 3.55459 18.6994C5.47146 20.6163 8.0231 21.67 10.7398 21.67C13.4565 21.67 16.0082 20.6163 17.925 18.6994C19.8419 16.7825 20.8956 14.2309 20.8956 11.5142V10.8794H17.0872V11.5142Z" fill="#77DD00"/>
<path d="M17.0876 10.8799H20.8961V11.5146C20.8961 14.2313 19.8424 16.7829 17.9254 18.6998C16.0086 20.6168 13.4569 21.6704 10.7402 21.6704V17.862C12.4287 17.862 14.0282 17.2019 15.2215 15.9959C16.4275 14.8026 17.0876 13.203 17.0876 11.5147V10.8799H17.0876Z" fill="#66BB00"/>
<path d="M13.787 5.95388C12.8475 5.43333 11.8066 5.16681 10.7402 5.16681V1.35835C12.6952 1.35835 14.5741 1.91691 16.2117 2.97057L18.6491 0L21.0866 8.97523H11.2989L13.787 5.95388Z" fill="#66BB00"/>
</g>
<defs>
<clipPath id="clip0_7305_15779">
<rect width="21.67" height="21.67" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,10 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_7302_4149)">
<path d="M19.9969 4.94279C19.986 4.83232 19.943 4.72146 19.8674 4.62924C19.8382 4.59358 20.1367 4.89431 15.4141 0.17176C15.3015 0.0591838 15.1487 8.30277e-05 14.9996 0.00012209C14.6443 0.00012209 2.11177 0.00012209 1.75779 0.00012209C0.788544 0.00012209 0 0.788666 0 1.75791V18.2421C0 19.2113 0.788544 19.9998 1.75779 19.9998H18.2419C19.2112 19.9998 19.9997 19.2113 19.9997 18.2421C19.9998 4.01624 20.0013 4.98771 19.9969 4.94279ZM13.4764 1.17198V5.00005C13.4764 5.32314 13.2136 5.58598 12.8905 5.58598H12.1483V1.17198H13.4764ZM10.9765 1.17198V5.58598H5.54684C5.22376 5.58598 4.96091 5.32314 4.96091 5.00005V1.17198H10.9765ZM13.4764 12.539H4.96091V11.7968C4.96091 11.4738 5.22376 11.2109 5.54684 11.2109H12.8905C13.2136 11.2109 13.4764 11.4738 13.4764 11.7968V12.539ZM4.96091 18.828V13.7109H13.4764V18.828H4.96091ZM18.8279 18.2421C18.8279 18.5651 18.5651 18.828 18.242 18.828H14.6483C14.6483 18.0641 14.6483 12.6676 14.6483 11.7968C14.6483 10.8276 13.8597 10.039 12.8905 10.039H5.54684C4.57759 10.039 3.78905 10.8276 3.78905 11.7968V18.828H1.75783C1.43475 18.828 1.1719 18.5651 1.1719 18.2421V1.75791C1.1719 1.43483 1.43475 1.17198 1.75783 1.17198H3.78905V5.00005C3.78905 5.9693 4.57759 6.75784 5.54684 6.75784H12.8905C13.8597 6.75784 14.6483 5.9693 14.6483 5.00005V1.17198H14.7571L18.8279 5.24278V18.2421Z" fill="#023DFE" fill-opacity="0.6"/>
</g>
<defs>
<clipPath id="clip0_7302_4149">
<rect width="20" height="20" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,21 @@
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M20.7802 9.0399L20.0667 9.18046C19.7057 9.25157 19.4663 9.5894 19.5103 9.95466C19.6254 10.9106 19.5871 11.9137 19.3549 12.9433C18.5334 16.5849 15.4143 19.3394 11.6982 19.6957C6.22309 20.2206 1.65927 15.6884 2.13085 10.223C2.48684 6.09727 5.78343 2.73681 9.90242 2.3098C12.864 2.00274 15.5631 3.17762 17.3531 5.18175L18.396 4.25096C16.4588 2.08197 13.6036 0.750365 10.4397 0.87082C5.29437 1.06665 1.04625 5.19944 0.720226 10.3382C0.34608 16.2355 5.01846 21.1352 10.8352 21.1352C16.4331 21.1352 20.9712 16.5971 20.9712 10.9992C20.9712 10.3288 20.9044 9.674 20.7802 9.0399Z" fill="#FFF0D2"/>
<path d="M10.8355 12.7451C11.8006 12.7451 12.583 11.9627 12.583 10.9976C12.583 10.0324 11.8006 9.25 10.8355 9.25C9.8703 9.25 9.08789 10.0324 9.08789 10.9976C9.08789 11.9627 9.8703 12.7451 10.8355 12.7451Z" fill="#FFF0D2"/>
<path d="M10.8358 16.5911C10.6426 16.5911 10.4863 16.4346 10.4863 16.2416V10.9989C10.4863 10.9062 10.5232 10.8173 10.5887 10.7517L14.4334 6.90709C14.5699 6.77055 14.7911 6.77055 14.9276 6.90709C15.0642 7.04363 15.0642 7.26482 14.9276 7.40131L11.1854 11.1436V16.2416C11.1854 16.4347 11.029 16.5911 10.8358 16.5911Z" fill="#7A4646"/>
<path d="M10.8356 12.0463C11.4147 12.0463 11.8842 11.5769 11.8842 10.9978C11.8842 10.4187 11.4147 9.94922 10.8356 9.94922C10.2566 9.94922 9.78711 10.4187 9.78711 10.9978C9.78711 11.5769 10.2566 12.0463 10.8356 12.0463Z" fill="#AA6E4D"/>
<path d="M10.8358 4.35899C10.6426 4.35899 10.4863 4.20248 10.4863 4.00948V3.31045C10.4863 3.11745 10.6427 2.96094 10.8358 2.96094C11.0291 2.96094 11.1854 3.11745 11.1854 3.31045V4.00948C11.1854 4.20248 11.029 4.35899 10.8358 4.35899Z" fill="#DE966C"/>
<path d="M10.8358 19.0387C10.6426 19.0387 10.4863 18.8822 10.4863 18.6892V17.9901C10.4863 17.7971 10.6427 17.6406 10.8358 17.6406C11.0291 17.6406 11.1854 17.7971 11.1854 17.9901V18.6892C11.1854 18.8822 11.029 19.0387 10.8358 19.0387Z" fill="#DE966C"/>
<path d="M18.5251 11.3475H17.8261C17.6329 11.3475 17.4766 11.1909 17.4766 10.998C17.4766 10.805 17.6329 10.6484 17.8261 10.6484H18.5251C18.7183 10.6484 18.8746 10.805 18.8746 10.998C18.8746 11.1909 18.7183 11.3475 18.5251 11.3475Z" fill="#DE966C"/>
<path d="M3.84546 11.3475H3.14639C2.95318 11.3475 2.79688 11.1909 2.79688 10.998C2.79688 10.805 2.95322 10.6484 3.14639 10.6484H3.84541C4.03863 10.6484 4.19493 10.805 4.19493 10.998C4.19493 11.1909 4.03863 11.3475 3.84546 11.3475Z" fill="#DE966C"/>
<path d="M4.78099 7.85338C4.72161 7.85338 4.66151 7.83836 4.60657 7.80661L4.00108 7.4571C3.83382 7.36051 3.77651 7.14682 3.87309 6.9796C3.96968 6.81233 4.18371 6.75502 4.35059 6.85161L4.95608 7.20112C5.12335 7.29771 5.18066 7.5114 5.08407 7.67862C5.01923 7.79074 4.90178 7.85338 4.78099 7.85338Z" fill="#F7B97E"/>
<path d="M17.4939 15.1933C17.4345 15.1933 17.3744 15.1782 17.3195 15.1465L16.714 14.797C16.5467 14.7004 16.4894 14.4867 16.586 14.3195C16.6826 14.152 16.8966 14.0949 17.0635 14.1915L17.669 14.541C17.8362 14.6376 17.8935 14.8513 17.797 15.0185C17.7321 15.1306 17.6147 15.1933 17.4939 15.1933Z" fill="#F7B97E"/>
<path d="M14.3298 5.29299C14.2704 5.29299 14.2103 5.27796 14.1554 5.24622C13.9881 5.14964 13.9308 4.93594 14.0274 4.76872L14.3769 4.16323C14.4735 3.99579 14.6875 3.93866 14.8544 4.03524C15.0217 4.13182 15.079 4.34552 14.9824 4.51274L14.6329 5.11823C14.568 5.23035 14.4506 5.29299 14.3298 5.29299Z" fill="#F7B97E"/>
<path d="M6.98995 18.0077C6.93057 18.0077 6.87047 17.9927 6.81553 17.961C6.64827 17.8644 6.59096 17.6507 6.68755 17.4834L7.03706 16.878C7.13331 16.7107 7.34768 16.6536 7.51456 16.75C7.68183 16.8466 7.73913 17.0602 7.64255 17.2275L7.29304 17.833C7.2282 17.9451 7.11079 18.0077 6.98995 18.0077Z" fill="#F7B97E"/>
<path d="M16.8891 7.85337C16.7682 7.85337 16.6508 7.79073 16.586 7.67861C16.4894 7.51135 16.5467 7.2977 16.714 7.20111L17.3195 6.8516C17.486 6.75502 17.7004 6.81236 17.797 6.97959C17.8935 7.14685 17.8362 7.36051 17.669 7.45709L17.0635 7.8066C17.0085 7.83835 16.9485 7.85337 16.8891 7.85337Z" fill="#F7B97E"/>
<path d="M4.17617 15.1933C4.05533 15.1933 3.93792 15.1306 3.87308 15.0185C3.7765 14.8512 3.83385 14.6376 4.00107 14.541L4.60656 14.1915C4.77277 14.0949 4.98714 14.1521 5.08406 14.3195C5.18065 14.4867 5.1233 14.7004 4.95608 14.797L4.35059 15.1465C4.29565 15.1782 4.23555 15.1933 4.17617 15.1933Z" fill="#F7B97E"/>
<path d="M7.34013 5.29298C7.2193 5.29298 7.10189 5.23034 7.03705 5.11822L6.68754 4.51273C6.59095 4.34547 6.6483 4.13181 6.81553 4.03523C6.98207 3.93865 7.1961 3.99583 7.29303 4.16322L7.64254 4.76871C7.73912 4.93597 7.68178 5.14963 7.51455 5.24621C7.45962 5.27795 7.39956 5.29298 7.34013 5.29298Z" fill="#F7B97E"/>
<path d="M14.68 18.0077C14.5591 18.0077 14.4417 17.9451 14.3769 17.833L14.0274 17.2275C13.9308 17.0602 13.9881 16.8465 14.1554 16.75C14.3219 16.6535 14.5363 16.7107 14.6329 16.8779L14.9824 17.4834C15.079 17.6507 15.0216 17.8644 14.8544 17.9609C14.7994 17.9927 14.7394 18.0077 14.68 18.0077Z" fill="#F7B97E"/>
<path d="M10.8358 11.3475C11.0289 11.3475 11.1854 11.191 11.1854 10.998C11.1854 10.8049 11.0289 10.6484 10.8358 10.6484C10.6428 10.6484 10.4863 10.8049 10.4863 10.998C10.4863 11.191 10.6428 11.3475 10.8358 11.3475Z" fill="#7A4646"/>
<path d="M10.8356 1.56212C5.42443 1.56212 1.07697 6.11655 1.41743 11.6012C1.70913 16.3007 5.53397 20.1256 10.2335 20.4173C15.7181 20.7578 20.2726 16.4103 20.2726 10.9991C20.2726 10.2541 20.1854 9.5297 20.0217 8.83474C19.9829 8.66988 20.0623 8.5019 20.2172 8.43346C20.4105 8.34805 20.6773 8.24402 20.8922 8.16267C21.0866 8.08907 21.3059 8.19949 21.3557 8.40125C21.6326 9.52411 21.7356 10.7154 21.6299 11.9463C21.4062 14.551 20.2433 16.8986 18.4888 18.652C18.4888 18.652 14.9619 21.4157 11.4687 21.4157C4.94621 21.4157 0.410156 16.7271 0.410156 10.1916C0.410156 7.40625 3.18409 3.34816 3.18409 3.34816C5.04237 1.49153 7.56422 0.300058 10.3375 0.175287C13.4409 0.035659 16.2657 1.20796 18.3212 3.17781L18.9202 2.71389C19.1388 2.5446 19.4582 2.68418 19.4824 2.95967L19.7199 5.66482C19.7422 5.91826 19.4949 6.10982 19.2551 6.02483L16.6954 5.11791C16.4348 5.02556 16.3795 4.68142 16.5982 4.51212L17.2071 4.04055C15.5283 2.50215 13.2923 1.56212 10.8356 1.56212Z" fill="#FB5F7A"/>
<path d="M18.485 18.6485C18.2212 18.3848 17.7996 18.3723 17.5193 18.6183C15.5456 20.3511 12.893 21.3292 10.0123 21.102C5.09917 20.7145 1.11879 16.7339 0.731479 11.8208C0.50441 8.94025 1.48256 6.28788 3.21519 4.3143C3.46126 4.03403 3.44709 3.61138 3.18336 3.34766C1.37642 5.15274 0.197009 7.58634 0.0232257 10.2799C-0.397562 16.8019 4.95607 22.1858 11.468 21.8155C14.1882 21.6609 16.6595 20.4788 18.4881 18.6515L18.485 18.6485Z" fill="#F74455"/>
</svg>

After

Width:  |  Height:  |  Size: 6.5 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

@ -22,7 +22,7 @@ import 'package:syncrow_app/features/scene/bloc/effective_period/effect_period_e
import 'package:syncrow_app/features/scene/bloc/smart_scene/smart_scene_select_dart_bloc.dart';
import 'package:syncrow_app/features/scene/enum/create_scene_enum.dart';
import 'package:syncrow_app/features/scene/model/scene_settings_route_arguments.dart';
import 'package:syncrow_app/features/scene/view/scene_view.dart';
import 'package:syncrow_app/features/scene/view/routines_view.dart';
import 'package:syncrow_app/generated/assets.dart';
import 'package:syncrow_app/navigation/navigation_service.dart';
import 'package:syncrow_app/navigation/routing_constants.dart';
@ -580,7 +580,7 @@ class HomeCubit extends Cubit<HomeState> {
create: (context) => DevicesCubit.getInstance(),
child: const DevicesViewBody(),
),
const SceneView(),
const RoutinesView(),
const MenuView(),
];

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:syncrow_app/features/auth/model/login_with_email_model.dart';
import 'package:syncrow_app/features/auth/model/signup_model.dart';
@ -217,9 +218,22 @@ class AuthCubit extends Cubit<AuthState> {
signUp() async {
emit(AuthLoginLoading());
final response;
final clientId = dotenv.env['CLIENT_ID'] ?? '';
final clientSecret = dotenv.env['CLIENT_SECRET'] ?? '';
try {
List<String> userFullName = fullName.split(' ');
final clientToken = await AuthenticationAPI.fetchClientToken(
clientId: clientId,
clientSecret: clientSecret,
);
final accessToken = clientToken['accessToken'];
response = await AuthenticationAPI.signUp(
accessToken: accessToken,
model: SignUpModel(
hasAcceptedAppAgreement: true,
email: email.toLowerCase(),

View File

@ -169,18 +169,22 @@ class DeviceManagerBloc extends Bloc<DeviceManagerEvent, DeviceManagerState> {
}
}
_getOnlyImplementedDevices(List<DeviceModel> devices) {
List<DeviceModel> implementedDevices = [];
for (int i = 0; i < devices.length; i++) {
if (devices[i].productType == DeviceType.AC ||
devices[i].productType == DeviceType.DoorLock ||
devices[i].productType == DeviceType.Gateway ||
devices[i].productType == DeviceType.WallSensor ||
devices[i].productType == DeviceType.CeilingSensor ||
devices[i].productType == DeviceType.ThreeGang) {
implementedDevices.add(devices[i]);
}
}
return implementedDevices;
List<DeviceModel> _getOnlyImplementedDevices(List<DeviceModel> devices) {
const allowedDeviceTypes = {
DeviceType.AC,
DeviceType.DoorLock,
DeviceType.Gateway,
DeviceType.WallSensor,
DeviceType.CeilingSensor,
DeviceType.ThreeGang,
DeviceType.OneGang,
DeviceType.TwoGang,
DeviceType.WH,
DeviceType.FlushMountedSensor,
};
return devices
.where((device) => allowedDeviceTypes.contains(device.productType))
.toList();
}
}

View File

@ -0,0 +1,178 @@
import 'dart:async';
import 'dart:developer';
import 'package:firebase_database/firebase_database.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/devices/bloc/flush_sensor_bloc/flush_sensor_event.dart';
import 'package:syncrow_app/features/devices/bloc/flush_sensor_bloc/flush_sensor_state.dart';
import 'package:syncrow_app/features/devices/model/device_control_model.dart';
import 'package:syncrow_app/features/devices/model/device_info_model.dart';
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/model/status_model.dart';
import 'package:syncrow_app/services/api/devices_api.dart';
class FlushSensorBloc extends Bloc<FlushSensorEvent, FlushSensorState> {
final String deviceId;
late DeviceModel deviceModel;
late FlushSensorModel deviceStatus;
FlushSensorBloc({required this.deviceId}) : super(FlushSensorInitialState()) {
on<FlushSensorInitialEvent>(_fetchFlushSensorStatus);
on<FlushSensorChangeIndicatorEvent>(_changeIndicator);
on<FlushSensorChangeValueEvent>(_changeValue);
on<FlushSensorUpdatedEvent>(_flushSensorUpdated);
on<FlushSensorGetDeviceReportsEvent>(_getDeviceReports);
on<FlushSensorInitialDeviseInfo>(fetchDeviceInfo);
}
void _fetchFlushSensorStatus(
FlushSensorInitialEvent event, Emitter<FlushSensorState> emit) async {
emit(FlushSensorLoadingInitialState());
try {
var response = await DevicesAPI.getDeviceStatus(deviceId);
List<StatusModel> statusModelList = [];
for (var status in response['status']) {
statusModelList.add(StatusModel.fromJson(status));
}
deviceStatus = FlushSensorModel.fromJson(statusModelList);
emit(FlushSensorUpdateState(flushSensorModel: deviceStatus));
_listenToChanges();
} catch (e) {
emit(FlushSensorFailedState(error: e.toString()));
return;
}
}
StreamSubscription<DatabaseEvent>? _streamSubscription;
void _listenToChanges() {
try {
_streamSubscription?.cancel();
DatabaseReference ref =
FirebaseDatabase.instance.ref('device-status/$deviceId');
Stream<DatabaseEvent> stream = ref.onValue;
_streamSubscription = stream.listen((DatabaseEvent event) async {
Map<dynamic, dynamic> usersMap =
event.snapshot.value as Map<dynamic, dynamic>;
List<StatusModel> statusList = [];
usersMap['status'].forEach((element) {
statusList
.add(StatusModel(code: element['code'], value: element['value']));
});
deviceStatus = FlushSensorModel.fromJson(statusList);
if (!isClosed) {
add(FlushSensorUpdatedEvent());
}
});
} catch (_) {
log(
'Error listening to changes',
name: 'FlushMountedPresenceSensorBloc._listenToChanges',
);
}
}
@override
Future<void> close() async {
_streamSubscription?.cancel();
_streamSubscription = null;
return super.close();
}
_flushSensorUpdated(
FlushSensorUpdatedEvent event, Emitter<FlushSensorState> emit) {
emit(FlushSensorUpdateState(flushSensorModel: deviceStatus));
}
void _changeIndicator(FlushSensorChangeIndicatorEvent event,
Emitter<FlushSensorState> emit) async {
emit(FlushSensorLoadingNewSate(flushSensorModel: deviceStatus));
try {
final response = await DevicesAPI.controlDevice(
DeviceControlModel(
deviceId: deviceId, code: 'indicator', value: !event.value),
deviceId);
} catch (e) {
emit(FlushSensorFailedState(error: e.toString()));
return;
}
emit(FlushSensorUpdateState(flushSensorModel: deviceStatus));
}
void _changeValue(
FlushSensorChangeValueEvent event, Emitter<FlushSensorState> emit) async {
emit(FlushSensorLoadingNewSate(flushSensorModel: deviceStatus));
try {
final response = await DevicesAPI.controlDevice(
DeviceControlModel(
deviceId: deviceId, code: event.code, value: event.value),
deviceId);
} catch (e) {
emit(FlushSensorFailedState(error: e.toString()));
return;
}
emit(FlushSensorUpdateState(flushSensorModel: deviceStatus));
}
void _getDeviceReports(FlushSensorGetDeviceReportsEvent event,
Emitter<FlushSensorState> emit) async {
emit(FlushSensorLoadingInitialState());
try {
await DevicesAPI.getReports(deviceId, event.code).then((value) {
emit(FlushSensorDeviceReportsState(
deviceReport: value, code: event.code));
});
} catch (e) {
emit(FlushSensorFailedState(error: e.toString()));
return;
}
}
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(FlushSensorInitialDeviseInfo 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));
} catch (e) {
emit(FlushSensorFailedState(error: e.toString()));
}
}
}

View File

@ -0,0 +1,45 @@
import 'package:equatable/equatable.dart';
abstract class FlushSensorEvent extends Equatable {
const FlushSensorEvent();
@override
List<Object> get props => [];
}
class FlushSensorLoadingEvent extends FlushSensorEvent {}
class FlushSensorInitialEvent extends FlushSensorEvent {}
class FlushSensorInitialDeviseInfo extends FlushSensorEvent {}
class FlushSensorUpdatedEvent extends FlushSensorEvent {}
class FlushSensorChangeIndicatorEvent extends FlushSensorEvent {
final bool value;
const FlushSensorChangeIndicatorEvent({required this.value});
@override
List<Object> get props => [value];
}
class FlushSensorChangeValueEvent extends FlushSensorEvent {
final dynamic value;
final String code;
const FlushSensorChangeValueEvent({required this.value, required this.code});
@override
List<Object> get props => [value, code];
}
class FlushSensorGetDeviceReportsEvent extends FlushSensorEvent {
final String deviceUuid;
final String code;
const FlushSensorGetDeviceReportsEvent({
required this.deviceUuid,
required this.code,
});
@override
List<Object> get props => [deviceUuid, code];
}

View File

@ -0,0 +1,52 @@
import 'package:equatable/equatable.dart';
import 'package:syncrow_app/features/devices/model/device_info_model.dart';
import 'package:syncrow_app/features/devices/model/device_report_model.dart';
import 'package:syncrow_app/features/devices/model/flush_sensor_model.dart';
class FlushSensorState extends Equatable {
const FlushSensorState();
@override
List<Object> get props => [];
}
class FlushSensorInitialState extends FlushSensorState {}
class FlushSensorLoadingInitialState extends FlushSensorState {}
class FlushSensorUpdateState extends FlushSensorState {
final FlushSensorModel flushSensorModel;
const FlushSensorUpdateState({required this.flushSensorModel});
@override
List<Object> get props => [flushSensorModel];
}
class FlushSensorLoadingNewSate extends FlushSensorState {
final FlushSensorModel flushSensorModel;
const FlushSensorLoadingNewSate({required this.flushSensorModel});
@override
List<Object> get props => [flushSensorModel];
}
class FlushSensorFailedState extends FlushSensorState {
final String error;
const FlushSensorFailedState({required this.error});
@override
List<Object> get props => [error];
}
class FlushSensorDeviceReportsState extends FlushSensorState {
final DeviceReport deviceReport;
final String code;
const FlushSensorDeviceReportsState(
{required this.deviceReport, required this.code});
}
class FlushSensorLoadingDeviceInfo extends FlushSensorState {
final DeviceInfoModel? deviceInfo;
const FlushSensorLoadingDeviceInfo({this.deviceInfo});
}

View File

@ -77,7 +77,7 @@ class DeviceInfoModel {
uuid: json['uuid'],
productUuid: json['productUuid'],
productType: json['productType'],
permissionType: json['permissionType'],
permissionType: json['permissionType'] ?? '',
macAddress: json['macAddress'],
subspace: Subspace.fromJson(json['subspace']),
);

View File

@ -92,6 +92,8 @@ class DeviceModel {
tempIcon = Assets.sixSceneHomeIcon;
} else if (type == DeviceType.SOS) {
tempIcon = Assets.sosHomeIcon;
} else if (type == DeviceType.FlushMountedSensor) {
tempIcon = Assets.flushIcon;
} else {
tempIcon = Assets.assetsIconsLogo;
}

View File

@ -0,0 +1,100 @@
import 'package:syncrow_app/features/devices/model/status_model.dart';
class FlushSensorModel {
FlushSensorModel({
required this.presenceState,
required this.farDetection,
required this.illuminance,
required this.sensitivity,
required this.occurDistReduce,
required this.noneDelay,
required this.presenceDelay,
required this.nearDetection,
required this.sensiReduce,
required this.checkingResult,
});
static const String codePresenceState = 'presence_state';
static const String codeSensitivity = 'sensitivity';
static const String codeNearDetection = 'near_detection';
static const String codeFarDetection = 'far_detection';
static const String codeCheckingResult = 'checking_result';
static const String codePresenceDelay = 'presence_delay';
static const String codeNoneDelay = 'none_delay';
static const String codeOccurDistReduce = 'occur_dist_reduce';
static const String codeIlluminance = 'illum_value';
static const String codeSensiReduce = 'sensi_reduce';
String presenceState;
int sensitivity;
int nearDetection;
int farDetection;
String checkingResult;
int presenceDelay;
int noneDelay;
int occurDistReduce;
int illuminance;
int sensiReduce;
factory FlushSensorModel.fromJson(List<StatusModel> jsonList) {
String presenceState = 'none';
int sensitivity = 0;
int nearDetection = 0;
int farDetection = 0;
String checkingResult = 'none';
int presenceDelay = 0;
int noneDelay = 0;
int occurDistReduce = 0;
int illuminance = 0;
int sensiReduce = 0;
for (var status in jsonList) {
switch (status.code) {
case codePresenceState:
presenceState = status.value ?? 'presence';
break;
case codeSensitivity:
sensitivity = status.value ?? 0;
break;
case codeNearDetection:
nearDetection = status.value ?? 0;
break;
case codeFarDetection:
farDetection = status.value ?? 0;
break;
case codeCheckingResult:
checkingResult = status.value ?? 'check_success';
break;
case codePresenceDelay:
presenceDelay = status.value ?? 0;
break;
case codeNoneDelay:
noneDelay = status.value ?? 0;
break;
case codeOccurDistReduce:
occurDistReduce = status.value ?? 0;
break;
case codeIlluminance:
illuminance = status.value ?? 0;
break;
case codeSensiReduce:
sensiReduce = status.value ?? 0;
break;
}
}
return FlushSensorModel(
presenceState: presenceState,
sensitivity: sensitivity,
nearDetection: nearDetection,
farDetection: farDetection,
checkingResult: checkingResult,
presenceDelay: presenceDelay,
noneDelay: noneDelay,
occurDistReduce: occurDistReduce,
illuminance: illuminance,
sensiReduce: sensiReduce,
);
}
}

View File

@ -49,44 +49,7 @@ class SettingProfilePage extends StatelessWidget {
},
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,
),
),
],
),
),
),
),
buildDeviceAvatar(context, device!),
const SizedBox(
height: 10,
),
@ -198,4 +161,45 @@ class SettingProfilePage extends StatelessWidget {
),
);
}
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

@ -130,6 +130,15 @@ class SettingsPage extends StatelessWidget {
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(

View File

@ -1,6 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_app/features/devices/bloc/6_scene_switch_bloc/6_scene_bloc.dart';
@ -31,7 +29,7 @@ class SixSceneScreen extends StatelessWidget {
..add(const SexSceneSwitchInitial()),
child: BlocBuilder<SixSceneBloc, SixSceneState>(
builder: (context, state) {
final _bloc = BlocProvider.of<SixSceneBloc>(context);
final bloc = BlocProvider.of<SixSceneBloc>(context);
SixSceneModel model = SixSceneModel(
scene_1: '',
scene_2: '',
@ -48,7 +46,7 @@ class SixSceneScreen extends StatelessWidget {
model = state.device;
}
return DefaultScaffold(
title: _bloc.deviceInfo.name,
title: device?.name ?? '6 Scene Switch',
actions: [
InkWell(
onTap: () async {
@ -58,9 +56,9 @@ class SixSceneScreen extends StatelessWidget {
),
);
if (val == null) {
_bloc.add(const SixSceneInitialInfo());
_bloc.add(const SixSceneInitial());
_bloc.add(const SexSceneSwitchInitial());
bloc.add(const SixSceneInitialInfo());
bloc.add(const SixSceneInitial());
bloc.add(const SexSceneSwitchInitial());
}
},
child: SvgPicture.asset(Assets.assetsIconsSettings),
@ -77,7 +75,7 @@ class SixSceneScreen extends StatelessWidget {
)
: RefreshIndicator(
onRefresh: () async {
_bloc.add(const SixSceneInitial());
bloc.add(const SixSceneInitial());
},
child: ListView(
children: [
@ -92,22 +90,22 @@ class SixSceneScreen extends StatelessWidget {
switch4Title: model.scene_4,
switch5Title: model.scene_5,
switch6Title: model.scene_6,
switch1Down: _bloc.deviceStatus.switch_backlight
switch1Down: bloc.deviceStatus.switch_backlight
? Assets.switchOn
: Assets.switchOff,
switch1Up: _bloc.deviceStatus.switch_backlight
switch1Up: bloc.deviceStatus.switch_backlight
? Assets.switchOn
: Assets.switchOff,
switch2Down: _bloc.deviceStatus.switch_backlight
switch2Down: bloc.deviceStatus.switch_backlight
? Assets.switchOn
: Assets.switchOff,
switch2Up: _bloc.deviceStatus.switch_backlight
switch2Up: bloc.deviceStatus.switch_backlight
? Assets.switchOn
: Assets.switchOff,
switch3Up: _bloc.deviceStatus.switch_backlight
switch3Up: bloc.deviceStatus.switch_backlight
? Assets.switchOn
: Assets.switchOff,
switch3Down: _bloc.deviceStatus.switch_backlight
switch3Down: bloc.deviceStatus.switch_backlight
? Assets.switchOn
: Assets.switchOff,
onSwitch3DownTap: () {
@ -135,7 +133,7 @@ class SixSceneScreen extends StatelessWidget {
Expanded(
child: DefaultContainer(
onTap: () {
_bloc.add(ChangeSwitchStatusEvent());
bloc.add(ChangeSwitchStatusEvent());
},
child: Column(
crossAxisAlignment:
@ -197,9 +195,9 @@ class SixSceneScreen extends StatelessWidget {
);
if (value == true) {
Future.delayed(
const Duration(
milliseconds: 200), () {
_bloc.add(
const Duration(milliseconds: 200),
() {
bloc.add(
const SexSceneSwitchInitial());
});
}

View File

@ -22,14 +22,15 @@ class DoorSensorScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DefaultScaffold(
title: 'Door Sensor',
title: device?.name,
child: BlocProvider(
create: (context) =>
DoorSensorBloc(DSId: device?.uuid ?? '')..add(const DoorSensorInitial()),
child: BlocBuilder<DoorSensorBloc, DoorSensorState>(
builder: (context, state) {
final doorSensorBloc = BlocProvider.of<DoorSensorBloc>(context);
DoorSensorModel model = DoorSensorModel(batteryPercentage: 0, doorContactState: false);
DoorSensorModel model =
DoorSensorModel(batteryPercentage: 0, doorContactState: false);
if (state is LoadingNewSate) {
model = state.doorSensor;
} else if (state is UpdateState) {
@ -37,8 +38,8 @@ class DoorSensorScreen extends StatelessWidget {
}
return state is DoorSensorLoadingState
? const Center(
child:
DefaultContainer(width: 50, height: 50, child: CircularProgressIndicator()),
child: DefaultContainer(
width: 50, height: 50, child: CircularProgressIndicator()),
)
: RefreshIndicator(
onRefresh: () async {
@ -56,7 +57,8 @@ class DoorSensorScreen extends StatelessWidget {
Expanded(
flex: 4,
child: InkWell(
overlayColor: WidgetStateProperty.all(Colors.transparent),
overlayColor:
WidgetStateProperty.all(Colors.transparent),
onTap: () {},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
@ -107,17 +109,21 @@ class DoorSensorScreen extends StatelessWidget {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
DoorRecordsScreen(DSId: device!.uuid!)),
DoorRecordsScreen(
DSId: device!.uuid!)),
);
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: [
ConstrainedBox(
constraints:
const BoxConstraints(maxHeight: 46, maxWidth: 50),
child: SvgPicture.asset(Assets.doorRecordsIcon),
constraints: const BoxConstraints(
maxHeight: 46, maxWidth: 50),
child: SvgPicture.asset(
Assets.doorRecordsIcon),
),
const SizedBox(
height: 15,
@ -143,18 +149,21 @@ class DoorSensorScreen extends StatelessWidget {
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => NotificationSettingsPage()),
builder: (context) =>
NotificationSettingsPage()),
);
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: [
ConstrainedBox(
constraints:
const BoxConstraints(maxHeight: 46, maxWidth: 50),
child:
SvgPicture.asset(Assets.doorNotificationSetting),
constraints: const BoxConstraints(
maxHeight: 46, maxWidth: 50),
child: SvgPicture.asset(
Assets.doorNotificationSetting),
),
const SizedBox(
height: 15,

View File

@ -0,0 +1,135 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:intl/intl.dart';
import 'package:syncrow_app/features/devices/bloc/flush_sensor_bloc/flush_sensor_bloc.dart';
import 'package:syncrow_app/features/devices/bloc/flush_sensor_bloc/flush_sensor_event.dart';
import 'package:syncrow_app/features/devices/bloc/flush_sensor_bloc/flush_sensor_state.dart';
import 'package:syncrow_app/features/devices/model/device_report_model.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/utils/resource_manager/color_manager.dart';
class FlushPresenceRecords extends StatelessWidget {
final String deviceId;
final String code;
final String title;
const FlushPresenceRecords(
{super.key,
required this.deviceId,
required this.code,
required this.title});
@override
Widget build(BuildContext context) {
return DefaultScaffold(
title: 'Presence Record',
child: BlocProvider(
create: (context) => FlushSensorBloc(deviceId: deviceId)
..add(FlushSensorGetDeviceReportsEvent(
deviceUuid: deviceId, code: code)),
child: BlocBuilder<FlushSensorBloc, FlushSensorState>(
builder: (context, state) {
final Map<String, List<DeviceEvent>> groupedRecords = {};
if (state is FlushSensorLoadingInitialState) {
return const Center(
child: DefaultContainer(
width: 50, height: 50, child: CircularProgressIndicator()),
);
} else if (state is FlushSensorDeviceReportsState) {
for (var record in state.deviceReport.data ?? []) {
final DateTime eventDateTime =
DateTime.fromMillisecondsSinceEpoch(record.eventTime!);
final String formattedDate =
DateFormat('EEEE, dd/MM/yyyy').format(eventDateTime);
// Group by formatted date
if (groupedRecords.containsKey(formattedDate)) {
groupedRecords[formattedDate]!.add(record);
} else {
groupedRecords[formattedDate] = [record];
}
}
}
return groupedRecords.isEmpty
? const Center(
child: Text('No records found'),
)
: ListView.builder(
itemCount: groupedRecords.length,
itemBuilder: (context, index) {
final String date = groupedRecords.keys.elementAt(index);
final List<DeviceEvent> recordsForDate =
groupedRecords[date]!;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(bottom: 5, top: 10),
child: Text(
date,
style: const TextStyle(
color: ColorsManager.grayColor,
fontSize: 13,
fontWeight: FontWeight.w700,
),
),
),
DefaultContainer(
child: Column(
children: [
...recordsForDate.asMap().entries.map((entry) {
final int idx = entry.key;
final DeviceEvent record = entry.value;
final DateTime eventDateTime =
DateTime.fromMillisecondsSinceEpoch(
record.eventTime!);
final String formattedTime =
DateFormat('HH:mm:ss')
.format(eventDateTime);
return Column(
children: [
SizedBox(
child: ListTile(
leading: Icon(
record.value == 'true'
? Icons.radio_button_checked
: Icons.radio_button_unchecked,
color: record.value == 'true'
? Colors.blue
: Colors.grey,
),
title: Text(
record.value == 'true'
? "Opened"
: "Closed",
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
subtitle: Text('$formattedTime'),
),
),
if (idx != recordsForDate.length - 1)
const Divider(
color: ColorsManager.graysColor,
),
],
);
}).toList(),
],
),
),
],
);
},
);
}),
),
);
}
}

View File

@ -0,0 +1,127 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_app/features/devices/bloc/flush_sensor_bloc/flush_sensor_bloc.dart';
import 'package:syncrow_app/features/devices/bloc/flush_sensor_bloc/flush_sensor_event.dart';
import 'package:syncrow_app/features/devices/bloc/flush_sensor_bloc/flush_sensor_state.dart';
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';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart';
import 'package:syncrow_app/generated/assets.dart';
import 'package:syncrow_app/utils/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";
part 'flush_sensor_parameter_control_dialog.dart';
class FlushMountedInterface extends StatelessWidget {
const FlushMountedInterface({super.key, required this.deviceModel});
final DeviceModel deviceModel;
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => FlushSensorBloc(deviceId: deviceModel.uuid ?? '')
..add(FlushSensorInitialEvent()),
child: BlocBuilder<FlushSensorBloc, FlushSensorState>(
builder: (context, state) {
final bloc = BlocProvider.of<FlushSensorBloc>(context);
FlushSensorModel flushSensorModel = FlushSensorModel(
presenceState: 'none',
farDetection: 0,
illuminance: 0,
checkingResult: '',
nearDetection: 0,
noneDelay: 0,
occurDistReduce: 0,
presenceDelay: 0,
sensiReduce: 0,
sensitivity: 0);
if (state is FlushSensorUpdateState) {
flushSensorModel = state.flushSensorModel;
} else if (state is FlushSensorLoadingNewSate) {
flushSensorModel = state.flushSensorModel;
}
return AnnotatedRegion(
value: SystemUiOverlayStyle(
statusBarColor: ColorsManager.primaryColor.withOpacity(0.5),
statusBarIconBrightness: Brightness.light,
),
child: DefaultScaffold(
title: FlushSensorBloc.deviceName,
actions: [
InkWell(
onTap: () async {
var val = await Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
SettingsPage(device: deviceModel),
),
);
if (val == null) {
bloc.add(FlushSensorInitialDeviseInfo());
bloc.add(FlushSensorInitialEvent());
}
},
child: SvgPicture.asset(Assets.assetsIconsSettings),
),
const SizedBox(width: 10),
],
child: Container(
width: MediaQuery.sizeOf(context).width,
height: MediaQuery.sizeOf(context).height,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
Assets.assetsImagesBackground,
),
fit: BoxFit.cover,
opacity: 0.4,
),
),
child: state is FlushSensorLoadingInitialState
? const Center(
child: RefreshProgressIndicator(),
)
: SafeArea(
child: RefreshIndicator(
onRefresh: () async {
bloc.add(FlushSensorInitialEvent());
},
child: ListView(children: [
SizedBox(
height: MediaQuery.of(context).size.height,
child: Column(children: [
PresenceIndicator(
state: flushSensorModel.presenceState,
),
Expanded(
flex: 2,
child: FlushSensorOptionsList(
bloc: bloc,
flushSensorModel: flushSensorModel,
deviceModel: deviceModel,
),
)
]),
),
]),
),
))));
}),
);
}
}

View File

@ -0,0 +1,47 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class FlushSensorOption extends StatelessWidget {
final String icon;
final String label;
final VoidCallback onTap;
final String? sliderValue;
final bool withArrow;
const FlushSensorOption({
super.key,
required this.icon,
required this.label,
required this.onTap,
required this.withArrow,
this.sliderValue = '',
});
@override
Widget build(BuildContext context) {
return DefaultContainer(
margin: const EdgeInsets.only(bottom: 5),
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 20),
onTap: onTap,
child: Row(
children: [
SvgPicture.asset(icon),
const SizedBox(width: 25),
Expanded(
child:
Text(label, style: Theme.of(context).textTheme.bodyMedium)),
Text(sliderValue!,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: ColorsManager.grayTextColor,
fontWeight: FontWeight.bold)),
withArrow == true
? const Icon(Icons.arrow_forward_ios,
color: ColorsManager.grayTextColor, size: 15)
: SizedBox(),
],
),
);
}
}

View File

@ -0,0 +1,193 @@
part of "flush_sensor_interface.dart";
class FlushSensorOptionsList extends StatelessWidget {
final FlushSensorModel flushSensorModel;
final DeviceModel deviceModel;
final FlushSensorBloc bloc;
const FlushSensorOptionsList(
{super.key,
required this.flushSensorModel,
required this.bloc,
required this.deviceModel});
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
FlushSensorOption(
withArrow: false,
sliderValue: '${flushSensorModel.illuminance.toString()} Lux',
icon: Assets.assetsIconsPresenceSensorAssetsIlluminanceValue,
label: 'Illuminance Value',
onTap: () {},
),
FlushSensorOption(
withArrow: false,
icon: Assets.assetsIconsPresenceSensorAssetsIlluminanceRecord,
label: 'Presence Record',
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (_) => FlushPresenceRecords(
deviceId: deviceModel.uuid!,
code: FlushSensorModel.codePresenceState,
title: 'Illuminance Record'),
));
}),
Padding(
padding: const EdgeInsets.symmetric(vertical: 12),
child: Text(
'Configuration',
style: Theme.of(context)
.textTheme
.bodyMedium
?.copyWith(fontWeight: FontWeight.bold),
),
),
FlushSensorOption(
withArrow: true,
sliderValue: flushSensorModel.sensitivity.toString(),
icon: Assets.assetsSensitivityFunction,
label: 'Sensitivity',
onTap: () => _showParameterDialog(
min: 0,
max: 9,
value: flushSensorModel.sensitivity.toDouble(),
context: context,
title: 'Sensitivity',
controlCode: FlushSensorModel.codeSensitivity,
step: 1.0,
),
),
FlushSensorOption(
withArrow: true,
sliderValue: "${flushSensorModel.nearDetection / 100} m",
icon: Assets.detectionDistanceIcon,
label: 'Min Detection Distance',
onTap: () => _showParameterDialog(
min: 0.0,
max: 9.5,
value: flushSensorModel.nearDetection.toDouble() / 100,
context: context,
title: 'Min Detection Distance',
controlCode: FlushSensorModel.codeNearDetection,
step: 0.1,
description: 'm',
),
),
FlushSensorOption(
withArrow: true,
sliderValue: '${flushSensorModel.farDetection / 100} m',
icon: Assets.detectionDistanceIcon,
label: 'Max Detection Distance',
onTap: () => _showParameterDialog(
description: 'm',
min: 0.0,
max: 9.5,
value: flushSensorModel.farDetection / 100,
context: context,
title: 'Max Detection Distance',
controlCode: FlushSensorModel.codeFarDetection,
step: 0.1),
),
FlushSensorOption(
sliderValue: flushSensorModel.sensiReduce.toString(),
withArrow: true,
icon: Assets.triggerLevelIcon,
label: 'Trigger Level',
onTap: () => _showParameterDialog(
min: 0,
max: 3,
value: flushSensorModel.sensiReduce.toDouble(),
context: context,
title: 'Trigger Level',
controlCode: FlushSensorModel.codeSensiReduce,
step: 1),
),
FlushSensorOption(
sliderValue: flushSensorModel.occurDistReduce.toString(),
withArrow: true,
icon: Assets.indentLevelIcon,
label: 'Indent Level',
onTap: () => _showParameterDialog(
min: 0,
max: 3,
value: flushSensorModel.occurDistReduce.toDouble(),
context: context,
title: 'Indent Level',
controlCode: FlushSensorModel.codeOccurDistReduce,
step: 1),
),
FlushSensorOption(
sliderValue: '${flushSensorModel.presenceDelay / 10}',
withArrow: true,
icon: Assets.targetConfirmTimeIcon,
label: 'Target Confirm Time',
onTap: () => _showParameterDialog(
min: 0.0,
max: 0.5,
value: flushSensorModel.presenceDelay.toDouble() / 10,
context: context,
title: 'Target Confirm Time',
controlCode: FlushSensorModel.codePresenceDelay,
step: 0.1),
),
FlushSensorOption(
sliderValue: '${flushSensorModel.noneDelay.toDouble() / 10}',
withArrow: true,
icon: Assets.disappeDelayIcon,
label: 'Disappe Delay',
onTap: () => _showParameterDialog(
min: 20,
max: 300,
value: flushSensorModel.noneDelay.toDouble() / 10,
context: context,
title: 'Disappe Delay',
controlCode: FlushSensorModel.codeNoneDelay,
step: 1),
),
],
);
}
void _showParameterDialog({
required double step,
required BuildContext context,
required String title,
required String controlCode,
required double min,
required double max,
required double value,
String? description = '',
}) async {
var result = await showDialog(
context: context,
builder: (context) {
return FlushParameterControlDialog(
title: title,
sensor: deviceModel,
value: value,
min: min,
max: max,
step: step,
description: description);
},
);
if (result != null) {
if (controlCode == FlushSensorModel.codeNearDetection ||
controlCode == FlushSensorModel.codeFarDetection) {
result = (result * 100).toInt();
}
if (controlCode == FlushSensorModel.codeNoneDelay) {
result = (result * 10).toInt();
}
if (controlCode == FlushSensorModel.codePresenceDelay) {
result = (result * 10).toInt();
}
bloc.add(
FlushSensorChangeValueEvent(value: result, code: controlCode),
);
}
}
}

View File

@ -0,0 +1,177 @@
part of 'flush_sensor_interface.dart';
class FlushParameterControlDialog extends StatefulWidget {
final String title;
final String? description;
final DeviceModel sensor;
final double value;
final double min;
final double max;
final double step;
const FlushParameterControlDialog({
super.key,
required this.title,
required this.sensor,
required this.value,
required this.min,
required this.max,
required this.step,
this.description = '',
});
@override
FlushParameterControlDialogState createState() =>
FlushParameterControlDialogState();
}
class FlushParameterControlDialogState
extends State<FlushParameterControlDialog> {
late double _value;
@override
void initState() {
super.initState();
_value = widget.value;
}
@override
Widget build(BuildContext context) {
final divisions = ((widget.max - widget.min) / widget.step).toInt();
final decimalPlaces = widget.step % 1 == 0 ? 0 : 1;
return Dialog(
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
padding: const EdgeInsets.only(top: 20),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
BodyMedium(
text: widget.title,
style: context.bodyMedium.copyWith(
color: ColorsManager.primaryColorWithOpacity,
fontWeight: FontsManager.extraBold,
),
),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 15,
horizontal: 50,
),
child: Container(
height: 1,
width: double.infinity,
color: ColorsManager.greyColor,
),
),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 10,
),
child: TitleMedium(
text:
"${_value.toStringAsFixed(decimalPlaces)} ${widget.description}",
style: context.titleMedium.copyWith(
color: Colors.black,
fontWeight: FontsManager.bold,
),
),
),
SizedBox(
width: MediaQuery.sizeOf(context).width,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
IconButton(
onPressed: () {
setState(() {
_value = (_value - widget.step)
.clamp(widget.min, widget.max);
_value =
double.parse(_value.toStringAsFixed(decimalPlaces));
});
},
icon: const Icon(Icons.remove, color: Colors.grey),
),
Flexible(
child: Slider(
value: _value,
onChanged: (value) {
final newValue =
(value / widget.step).round() * widget.step;
setState(() {
_value = newValue.clamp(widget.min, widget.max);
});
},
min: widget.min,
max: widget.max,
divisions: divisions,
label: _value.toStringAsFixed(decimalPlaces),
),
),
IconButton(
onPressed: () {
setState(() {
_value = (_value + widget.step)
.clamp(widget.min, widget.max);
_value =
double.parse(_value.toStringAsFixed(decimalPlaces));
});
},
icon: const Icon(Icons.add, color: Colors.grey),
),
],
),
),
Container(
height: 1,
width: double.infinity,
color: ColorsManager.greyColor,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
InkWell(
onTap: () {
Navigator.pop(context);
},
child: Center(
child: BodyMedium(
text: 'Cancel',
style: context.bodyMedium
.copyWith(color: ColorsManager.greyColor),
),
),
),
Container(
height: 50,
width: 1,
color: ColorsManager.greyColor,
),
InkWell(
onTap: () {
if (widget.sensor.isOnline == null || !widget.sensor.isOnline!) {
CustomSnackBar.displaySnackBar('The device is offline');
return;
}
Navigator.pop(context, _value);
},
child: Center(
child: BodyMedium(
text: 'Confirm',
style: context.bodyMedium.copyWith(
color: ColorsManager.primaryColorWithOpacity),
),
),
),
],
)
],
),
),
);
}
}

View File

@ -0,0 +1,31 @@
part of "flush_sensor_interface.dart";
class PresenceIndicator extends StatelessWidget {
const PresenceIndicator({super.key, required this.state});
final String state;
@override
Widget build(BuildContext context) {
return Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset(
state.toLowerCase() == 'motion'
? Assets.assetsIconsPresenceSensorAssetsPresenceSensorMotion
: Assets.assetsIconsPresenceSensorAssetsPresence,
width: 100,
height: 100,
),
const SizedBox(
height: 10,
),
BodyMedium(
text: StringHelpers.toTitleCase(state),
style: context.bodyMedium.copyWith(fontWeight: FontsManager.bold),
),
],
),
);
}
}

View File

@ -47,7 +47,7 @@ class FourSceneScreen extends StatelessWidget {
}
return DefaultScaffold(
title: _bloc.deviceInfo.name,
title: device?.name ?? '4 Scene',
actions: [
InkWell(
onTap: () async {
@ -165,7 +165,7 @@ class FourSceneScreen extends StatelessWidget {
Navigator.of(context).pop();
},
confirmTab:
(switchSelected) async {
(switchSelected) {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>

View File

@ -8,8 +8,7 @@ import 'package:syncrow_app/features/shared_widgets/devices_default_switch.dart'
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
class GarageList extends StatelessWidget {
const GarageList(
{super.key, required this.garageList, required this.allSwitches});
const GarageList({super.key, required this.garageList, required this.allSwitches});
final List<GroupGarageModel> garageList;
final bool allSwitches;
@ -23,43 +22,42 @@ class GarageList extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const SizedBox(height: 10),
const BodySmall(text: 'All Lights'),
const BodySmall(text: 'All Garages'),
const SizedBox(height: 5),
DevicesDefaultSwitch(
off: 'OFF',
on: 'ON',
off: 'Close',
on: 'Open',
switchValue: allSwitches,
action: () {
BlocProvider.of<GarageDoorBloc>(context)
.add(GroupAllOnEvent());
},
secondAction: () {
BlocProvider.of<GarageDoorBloc>(context)
.add(GroupAllOffEvent());
},
action: () => BlocProvider.of<GarageDoorBloc>(context).add(
GroupAllOnEvent(),
),
secondAction: () => BlocProvider.of<GarageDoorBloc>(context).add(
GroupAllOffEvent(),
),
),
ListView.builder(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.all(0),
padding: EdgeInsetsDirectional.zero,
itemCount: garageList.length,
itemBuilder: (context, index) {
final garageDoor = garageList[index];
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 10),
BodySmall(text: garageList[index].deviceName),
BodySmall(text: garageDoor.deviceName),
const SizedBox(height: 5),
DevicesDefaultSwitch(
off: 'OFF',
on: 'ON',
switchValue: garageList[index].firstSwitch,
action: () {
BlocProvider.of<GarageDoorBloc>(context).add(
ChangeFirstWizardSwitchStatusEvent(
value: garageList[index].firstSwitch,
deviceId: garageList[index].deviceId));
},
off: 'Close',
on: 'Open',
switchValue: garageDoor.firstSwitch,
action: () => BlocProvider.of<GarageDoorBloc>(context).add(
ChangeFirstWizardSwitchStatusEvent(
value: garageDoor.firstSwitch,
deviceId: garageDoor.deviceId,
),
),
),
],
);

View File

@ -21,7 +21,8 @@ class GateWayView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => GatewayBloc()..add(GatewayInitial(gatewayId: gatewayObj.uuid ?? '')),
create: (context) =>
GatewayBloc()..add(GatewayInitial(gatewayId: gatewayObj.uuid ?? '')),
child: BlocBuilder<GatewayBloc, GatewayState>(builder: (context, state) {
List<DeviceModel> devicesList = [];
if (state is UpdateGatewayState) {
@ -37,7 +38,7 @@ class GateWayView extends StatelessWidget {
extendBodyBehindAppBar: true,
extendBody: true,
appBar: DeviceAppbar(
deviceName: 'Gateway',
deviceName: gatewayObj.name ?? 'Gateway',
deviceUuid: gatewayObj.uuid!,
),
body: Container(
@ -60,7 +61,7 @@ class GateWayView extends StatelessWidget {
},
child: ListView(
children: [
Container(
SizedBox(
height: MediaQuery.of(context).size.height,
child: SafeArea(
child: Column(
@ -90,7 +91,8 @@ class GateWayView extends StatelessWidget {
),
]),
),
if (devicesList.isEmpty && state is UpdateGatewayState)
if (devicesList.isEmpty &&
state is UpdateGatewayState)
Container(
width: MediaQuery.sizeOf(context).width,
alignment: AlignmentDirectional.center,
@ -115,7 +117,8 @@ class GateWayView extends StatelessWidget {
margin: const EdgeInsets.only(top: 20),
height: 50,
width: 50,
child: const RefreshProgressIndicator()),
child:
const RefreshProgressIndicator()),
)
: Expanded(
child: GridView.builder(
@ -130,7 +133,8 @@ class GateWayView extends StatelessWidget {
shrinkWrap: true,
itemCount: devicesList.length,
itemBuilder: (context, index) {
return RoomPageSwitch(device: devicesList[index]);
return RoomPageSwitch(
device: devicesList[index]);
},
),
)

View File

@ -51,7 +51,7 @@ class _PowerClampPageState extends State<PowerClampPage> {
@override
Widget build(BuildContext context) {
return DefaultScaffold(
title: 'Power Clamp',
title: widget.device?.name ?? 'Power Clamp',
child: BlocProvider(
create: (context) => PowerClampBloc(PCId: widget.device?.uuid ?? '')
..add(const PowerClampInitial()),
@ -153,41 +153,6 @@ class _PowerClampPageState extends State<PowerClampPage> {
];
}
List<Widget> _buildPowerClampCards(PowerClampModel model,
List<EnergyData> chartData, PowerClampBloc blocProvider) {
return [
_buildPowerClampCard(
phaseType: '',
title: 'Total Energy \nConsumption',
phase: model.status.general,
isGeneral: true,
chartData: chartData,
blocProvider: blocProvider,
),
_buildPowerClampCard(
phaseType: 'Phase A consumption',
title: 'Phase A Energy \nConsumption',
phase: model.status.phaseA,
chartData: chartData,
blocProvider: blocProvider,
),
_buildPowerClampCard(
phaseType: 'Phase B consumption',
title: 'Phase B Energy \nConsumption',
phase: model.status.phaseB,
chartData: chartData,
blocProvider: blocProvider,
),
_buildPowerClampCard(
phaseType: 'Phase C consumption',
title: 'Phase C Energy \nConsumption',
phase: model.status.phaseC,
chartData: chartData,
blocProvider: blocProvider,
),
];
}
Widget _buildPowerClampCard({
required String title,
required String phaseType,
@ -209,10 +174,8 @@ class _PowerClampPageState extends State<PowerClampPage> {
blocProvider.add(SelectDateEvent(context: context));
},
totalActiveGeneral: isGeneral ? _getValueOrNA(phase.dataPoints, 2) : null,
totalCurrentGeneral:
isGeneral ? _getValueOrNA(phase.dataPoints, 1) : null,
totalFrequencyGeneral:
isGeneral ? _getValueOrNA(phase.dataPoints, 4) : null,
totalCurrentGeneral: isGeneral ? _getValueOrNA(phase.dataPoints, 1) : null,
totalFrequencyGeneral: isGeneral ? _getValueOrNA(phase.dataPoints, 4) : null,
totalFactor: !isGeneral ? _getValueOrNA(phase.dataPoints, 3) : null,
totalActive: !isGeneral ? _getValueOrNA(phase.dataPoints, 2) : null,
totalCurrent: !isGeneral ? _getValueOrNA(phase.dataPoints, 1) : null,
@ -223,9 +186,7 @@ class _PowerClampPageState extends State<PowerClampPage> {
}
String _getValueOrNA(List<DataPoint> dataPoints, int index) {
return dataPoints.length > index
? dataPoints[index].value.toString()
: 'N/A';
return dataPoints.length > index ? dataPoints[index].value.toString() : 'N/A';
}
Widget _buildPageIndicator() {
@ -240,8 +201,7 @@ class _PowerClampPageState extends State<PowerClampPage> {
height: 10.0,
width: _currentPage == index ? 10.0 : 10.0,
decoration: BoxDecoration(
color:
_currentPage == index ? Colors.grey : ColorsManager.greyColor,
color: _currentPage == index ? Colors.grey : ColorsManager.greyColor,
borderRadius: BorderRadius.circular(5.0),
),
);

View File

@ -10,8 +10,10 @@ import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
import 'package:syncrow_app/features/devices/model/device_model.dart';
import 'package:syncrow_app/features/devices/view/widgets/6_scene_switch/six_scene_screen.dart';
import 'package:syncrow_app/features/devices/view/widgets/ACs/acs_view.dart';
import 'package:syncrow_app/features/devices/view/widgets/ceiling_sensor/ceiling_sensor_interface.dart';
import 'package:syncrow_app/features/devices/view/widgets/curtains/curtain_view.dart';
import 'package:syncrow_app/features/devices/view/widgets/door_sensor/door_sensor_screen.dart';
import 'package:syncrow_app/features/devices/view/widgets/flush_sensor/flush_sensor_interface.dart';
import 'package:syncrow_app/features/devices/view/widgets/four_scene_switch/four_scene_screen.dart';
import 'package:syncrow_app/features/devices/view/widgets/garage_door/garage_door_screen.dart';
import 'package:syncrow_app/features/devices/view/widgets/gateway/gateway_view.dart';
@ -19,14 +21,13 @@ import 'package:syncrow_app/features/devices/view/widgets/lights/light_interface
import 'package:syncrow_app/features/devices/view/widgets/one_gang/one_gang_Interface.dart';
import 'package:syncrow_app/features/devices/view/widgets/one_touch/one_touch_screen.dart';
import 'package:syncrow_app/features/devices/view/widgets/power_clamp/power_clamp_page.dart';
import 'package:syncrow_app/features/devices/view/widgets/smart_door/door_interface.dart';
import 'package:syncrow_app/features/devices/view/widgets/sos/sos_screen.dart';
import 'package:syncrow_app/features/devices/view/widgets/three_gang/three_gang_interface.dart';
import 'package:syncrow_app/features/devices/view/widgets/three_touch/three_touch_interface.dart';
import 'package:syncrow_app/features/devices/view/widgets/two_gang/two_gang_Interface.dart';
import 'package:syncrow_app/features/devices/view/widgets/two_touch/two_touch_Interface.dart';
import 'package:syncrow_app/features/devices/view/widgets/wall_sensor/wall_sensor_interface.dart';
import 'package:syncrow_app/features/devices/view/widgets/ceiling_sensor/ceiling_sensor_interface.dart';
import 'package:syncrow_app/features/devices/view/widgets/smart_door/door_interface.dart';
import 'package:syncrow_app/features/devices/view/widgets/three_gang/three_gang_interface.dart';
import 'package:syncrow_app/features/devices/view/widgets/water_heater/water_heater_page.dart';
import 'package:syncrow_app/features/devices/view/widgets/water_leak/water_leak_screen.dart';
import 'package:syncrow_app/features/shared_widgets/custom_switch.dart';
@ -73,34 +74,30 @@ class RoomPageSwitch extends StatelessWidget {
? CustomSwitch(
device: device,
)
: const SizedBox(),
: const SizedBox.shrink(),
],
),
Flexible(
child: FittedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
device.name ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: context.bodyLarge.copyWith(
fontWeight: FontWeight.bold,
fontSize: 20,
color: Colors.grey,
),
),
Text(
device.subspace!.subspaceName ?? '',
overflow: TextOverflow.ellipsis,
style: context.bodySmall.copyWith(
fontWeight: FontWeight.w400,
fontSize: 10,
color: Colors.grey,
),
),
],
Text(
device.name ?? '',
textScaler: TextScaler.linear(1),
style: context.bodyLarge.copyWith(
fontWeight: FontWeight.bold,
color: Colors.grey,
fontSize: 14,
),
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
FittedBox(
fit: BoxFit.scaleDown,
child: Text(
device.subspace!.subspaceName ?? '',
overflow: TextOverflow.ellipsis,
textScaler: TextScaler.linear(1),
style: context.bodySmall.copyWith(
fontWeight: FontWeight.w400,
fontSize: 9,
color: Colors.grey,
),
),
),
@ -119,8 +116,6 @@ Future<void> showDeviceInterface(
required BuildContext context,
required isAllDevices,
List<DeviceModel>? allDevices}) async {
print('object-----${device.uuid} ${device.name}');
final devicesCubit = context.read<DevicesCubit>();
switch (device.productType) {
@ -306,6 +301,13 @@ Future<void> showDeviceInterface(
pageBuilder: (context, animation1, animation2) =>
SosScreen(device: device)));
case DeviceType.FlushMountedSensor:
Navigator.push(
context,
PageRouteBuilder(
pageBuilder: (context, animation1, animation2) =>
FlushMountedInterface(deviceModel: device)));
break;
default:
}

View File

@ -5,7 +5,6 @@ import 'package:syncrow_app/features/devices/bloc/sos_bloc/sos_bloc.dart';
import 'package:syncrow_app/features/devices/bloc/sos_bloc/sos_event.dart';
import 'package:syncrow_app/features/devices/bloc/sos_bloc/sos_state.dart';
import 'package:syncrow_app/features/devices/model/device_model.dart';
import 'package:syncrow_app/features/devices/model/sos_model.dart';
import 'package:syncrow_app/features/devices/view/device_settings/settings_page.dart';
import 'package:syncrow_app/features/devices/view/widgets/sos/sos_alarm_management_page.dart';
import 'package:syncrow_app/features/devices/view/widgets/sos/sos_records_screen.dart';
@ -29,17 +28,8 @@ class SosScreen extends StatelessWidget {
child: BlocBuilder<SosBloc, SosState>(
builder: (context, state) {
final sensor = BlocProvider.of<SosBloc>(context);
SosModel model = SosModel(
batteryPercentage: 0,
sosContactState: '',
);
if (state is LoadingNewSate) {
model = state.sosSensor;
} else if (state is UpdateState) {
model = state.sensor;
}
return DefaultScaffold(
title: sensor.deviceInfo.name,
title: device?.name,
actions: [
InkWell(
onTap: () async {
@ -82,38 +72,33 @@ class SosScreen extends StatelessWidget {
Expanded(
flex: 4,
child: InkWell(
overlayColor: MaterialStateProperty.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,
@ -140,9 +125,8 @@ class SosScreen extends StatelessWidget {
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
SosRecordsScreen(
sosId: device!.uuid!),
builder: (context) => SosRecordsScreen(
sosId: device!.uuid!),
),
);
},
@ -197,8 +181,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

@ -9,7 +9,10 @@ import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class GangSwitch extends StatelessWidget {
const GangSwitch(
{super.key, required this.threeGangSwitch, required this.value, required this.action});
{super.key,
required this.threeGangSwitch,
required this.value,
required this.action});
final DeviceModel threeGangSwitch;
final bool value;

View File

@ -21,7 +21,7 @@ class WaterHeaterPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DefaultScaffold(
title: 'Water heater',
title: device?.name?? 'Water heater',
child: BlocProvider(
create: (context) => WaterHeaterBloc(switchCode: 'switch_1', whId: device?.uuid ?? '')
..add(const WaterHeaterInitial()),

View File

@ -8,7 +8,11 @@ import 'package:syncrow_app/features/shared_widgets/devices_default_switch.dart'
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
class WHList extends StatelessWidget {
const WHList({super.key, required this.whList, required this.allSwitches});
const WHList({
required this.whList,
required this.allSwitches,
super.key,
});
final List<GroupWHModel> whList;
final bool allSwitches;
@ -22,43 +26,42 @@ class WHList extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const SizedBox(height: 10),
const BodySmall(text: 'All Lights'),
const BodySmall(text: 'All Water Heaters'),
const SizedBox(height: 5),
DevicesDefaultSwitch(
off: 'OFF',
on: 'ON',
switchValue: allSwitches,
action: () {
BlocProvider.of<WaterHeaterBloc>(context)
.add(GroupAllOnEvent());
},
secondAction: () {
BlocProvider.of<WaterHeaterBloc>(context)
.add(GroupAllOffEvent());
},
action: () => context.read<WaterHeaterBloc>().add(
GroupAllOnEvent(),
),
secondAction: () => context.read<WaterHeaterBloc>().add(
GroupAllOffEvent(),
),
),
ListView.builder(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.all(0),
padding: EdgeInsetsDirectional.zero,
itemCount: whList.length,
itemBuilder: (context, index) {
final waterHeater = whList[index];
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 10),
BodySmall(text: whList[index].deviceName),
BodySmall(text: waterHeater.deviceName),
const SizedBox(height: 5),
DevicesDefaultSwitch(
off: 'OFF',
on: 'ON',
switchValue: whList[index].firstSwitch,
action: () {
BlocProvider.of<WaterHeaterBloc>(context).add(
switchValue: waterHeater.firstSwitch,
action: () => context.read<WaterHeaterBloc>().add(
ChangeFirstWizardSwitchStatusEvent(
value: whList[index].firstSwitch,
deviceId: whList[index].deviceId));
},
value: waterHeater.firstSwitch,
deviceId: waterHeater.deviceId,
),
),
),
],
);

View File

@ -22,7 +22,7 @@ class WaterLeakScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DefaultScaffold(
title: 'Water Leak Sensor',
title: device?.name ?? 'Water Leak',
child: BlocProvider(
create: (context) => WaterLeakBloc(WLId: device?.uuid ?? '')
..add(const WaterLeakInitial()),

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

@ -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,
@ -159,6 +161,7 @@ class CreateSceneBloc extends Bloc<CreateSceneEvent, CreateSceneState>
// Add new element if it doesn't exist in either list
if (!updated) {
var newElement = SceneStaticFunction(
deviceType: event.deviceType,
operationName: event.operation,
deviceName: event.deviceName,
icon: event.icon,
@ -192,6 +195,7 @@ class CreateSceneBloc extends Bloc<CreateSceneEvent, CreateSceneState>
if (element.code == event.deviceControlModel.code) {
// Update the existing function with new values
var updatedElement = element.copyWith(
deviceType: element.deviceType,
operationName: event.operation,
deviceName: event.deviceName,
icon: event.icon,
@ -217,6 +221,7 @@ class CreateSceneBloc extends Bloc<CreateSceneEvent, CreateSceneState>
}
if (!updated) {
var newElement = SceneStaticFunction(
deviceType: event.deviceType,
operationName: event.operation,
deviceName: event.deviceName,
icon: event.icon,

View File

@ -24,6 +24,7 @@ class TempHoldSceneTasksEvent extends CreateSceneEvent {
final String uniqueId;
final bool? isAutomation;
final OperationDialogType operationType;
final String deviceType;
const TempHoldSceneTasksEvent({
required this.deviceControlModel,
@ -34,6 +35,7 @@ class TempHoldSceneTasksEvent extends CreateSceneEvent {
required this.uniqueId,
this.isAutomation,
required this.operationType,
required this.deviceType,
});
@override
@ -46,6 +48,7 @@ class TempHoldSceneTasksEvent extends CreateSceneEvent {
uniqueId,
deviceName,
icon,
deviceType
];
}
@ -149,7 +152,8 @@ class FetchSceneTasksEvent extends CreateSceneEvent {
final String sceneId;
final bool isAutomation;
const FetchSceneTasksEvent({this.isAutomation = false, required this.sceneId});
const FetchSceneTasksEvent(
{this.isAutomation = false, required this.sceneId});
@override
List<Object> get props => [sceneId, isAutomation];

View File

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

View File

@ -1,5 +1,3 @@
import 'dart:async';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/devices/bloc/device_manager_bloc/device_manager_bloc.dart';
import 'package:syncrow_app/features/devices/bloc/device_manager_bloc/device_manager_event.dart';
@ -7,19 +5,31 @@ import 'package:syncrow_app/features/scene/bloc/tab_change/tab_change_event.dart
import 'package:syncrow_app/features/scene/bloc/tab_change/tab_change_state.dart';
class TabBarBloc extends Bloc<TabBarEvent, TabBarState> {
final DeviceManagerBloc deviceManagerBloc;
TabBarBloc(this.deviceManagerBloc) : super(const Initial()) {
on<TabChanged>(_handleTabChanged);
TabBarBloc(this.deviceManagerBloc) : super(const TabBarInitialState()) {
on<TabBarTabChangedEvent>(_onTabBarTabChangedEvent);
}
FutureOr<void> _handleTabChanged(
TabChanged event, Emitter<TabBarState> emit) {
final DeviceManagerBloc deviceManagerBloc;
void _onTabBarTabChangedEvent(
TabBarTabChangedEvent event,
Emitter<TabBarState> emit,
) {
_getDevices(event);
emit(
TabBarTabSelectedState(
roomId: event.roomId,
selectedTabIndex: event.selectedIndex,
),
);
}
void _getDevices(TabBarTabChangedEvent event) {
if (event.roomId == "-1") {
deviceManagerBloc.add(FetchAllDevices());
} else {
deviceManagerBloc.add(FetchDevicesByRoomId(event.roomId,event.unit));
deviceManagerBloc.add(FetchDevicesByRoomId(event.roomId, event.unit));
}
emit(TabSelected(
roomId: event.roomId, selectedTabIndex: event.selectedIndex));
}
}

View File

@ -4,10 +4,14 @@ abstract class TabBarEvent {
const TabBarEvent();
}
class TabChanged extends TabBarEvent {
class TabBarTabChangedEvent extends TabBarEvent {
const TabBarTabChangedEvent({
required this.selectedIndex,
required this.roomId,
required this.unit,
});
final int selectedIndex;
final String roomId;
final SpaceModel unit;
const TabChanged(
{required this.selectedIndex, required this.roomId, required this.unit});
}

View File

@ -2,12 +2,16 @@ abstract class TabBarState {
const TabBarState();
}
class Initial extends TabBarState {
const Initial();
class TabBarInitialState extends TabBarState {
const TabBarInitialState();
}
class TabSelected extends TabBarState {
class TabBarTabSelectedState extends TabBarState {
const TabBarTabSelectedState({
required this.roomId,
required this.selectedTabIndex,
});
final int selectedTabIndex;
final String roomId;
const TabSelected({required this.roomId, required this.selectedTabIndex});
}

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,247 @@
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.integerSteps,
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.integerSteps,
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.levelIcon,
operationName: 'Trigger Level',
code: 'sensi_reduce',
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(),
),
],
),
SceneStaticFunction(
deviceType: 'NCPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.indentLevelIcon,
operationName: 'Indent Level',
code: 'occur_dist_reduce',
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(),
),
],
),
SceneStaticFunction(
deviceType: 'NCPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.targetConfirmTimeIcon,
operationName: 'Target Confirm Time',
code: 'presence_delay',
functionValue: functionValue,
operationDialogType: OperationDialogType.integerSteps,
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: "",
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

@ -0,0 +1,82 @@
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 OneGangHelperFunctions {
static List<SceneStaticFunction> oneGangHelperFunctions(
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: '1G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
operationName: 'Light Switch',
code: 'switch_1',
functionValue: functionValue,
operationDialogType: OperationDialogType.onOff,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsAcPower, description: "ON", value: true),
SceneOperationalValue(
icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
],
),
SceneStaticFunction(
deviceType: '1G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
operationName: 'Light CountDown',
code: 'countdown_1',
functionValue: functionValue,
operationDialogType: OperationDialogType.countdown,
operationalValues: [
SceneOperationalValue(icon: '', value: 0),
],
),
];
}
static List<SceneStaticFunction> oneGangAutomationFunctions(
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: '1G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
operationName: 'Light Switch',
code: 'switch_1',
functionValue: functionValue,
operationDialogType: OperationDialogType.onOff,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsAcPower, description: "ON", value: true),
SceneOperationalValue(
icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
],
),
SceneStaticFunction(
deviceType: '1G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
operationName: 'Light CountDown',
code: 'countdown_1',
functionValue: functionValue,
operationDialogType: OperationDialogType.integerSteps,
operationalValues: [
SceneOperationalValue(
icon: '',
description: "sec",
value: 0.0,
minValue: 0,
maxValue: 43200,
stepValue: 1,
),
],
),
];
}
}

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,10 +7,11 @@ class ThreeGangHelperFunctions {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: '3G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
operationName: 'Light 1 Switch',
operationName: 'L - Light Switch',
code: 'switch_1',
functionValue: functionValue,
operationDialogType: OperationDialogType.onOff,
@ -22,10 +23,24 @@ class ThreeGangHelperFunctions {
],
),
SceneStaticFunction(
deviceType: '3G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
operationName: 'L - Light Countdown',
code: 'countdown_1',
functionValue: functionValue,
operationDialogType: OperationDialogType.countdown,
operationalValues: [
SceneOperationalValue(icon: '', value: 0),
],
),
SceneStaticFunction(
deviceType: '3G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
operationName: 'Light 2 Switch',
operationName: 'M - Light Switch',
code: 'switch_2',
functionValue: functionValue,
operationDialogType: OperationDialogType.onOff,
@ -37,10 +52,24 @@ class ThreeGangHelperFunctions {
],
),
SceneStaticFunction(
deviceType: '3G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
operationName: 'M - Light Countdown',
code: 'countdown_2',
functionValue: functionValue,
operationDialogType: OperationDialogType.countdown,
operationalValues: [
SceneOperationalValue(icon: '', value: 0),
],
),
SceneStaticFunction(
deviceType: '3G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
operationName: 'Light 3 Switch',
operationName: 'R - Light Switch',
code: 'switch_3',
functionValue: functionValue,
operationDialogType: OperationDialogType.onOff,
@ -52,34 +81,11 @@ class ThreeGangHelperFunctions {
],
),
SceneStaticFunction(
deviceType: '3G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
operationName: 'Light 1 CountDown',
code: 'countdown_1',
functionValue: functionValue,
operationDialogType: OperationDialogType.countdown,
operationalValues: [
SceneOperationalValue(icon: '', value: 0),
],
),
SceneStaticFunction(
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
operationName: 'Light 2 CountDown',
code: 'countdown_2',
functionValue: functionValue,
operationDialogType: OperationDialogType.countdown,
operationalValues: [
SceneOperationalValue(icon: '', value: 0),
],
),
SceneStaticFunction(
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
operationName: 'Light 3 CountDown',
operationName: 'R - Light Countdown',
code: 'countdown_3',
functionValue: functionValue,
operationDialogType: OperationDialogType.countdown,
@ -94,10 +100,11 @@ class ThreeGangHelperFunctions {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: '3G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
operationName: 'Light 1 Switch',
operationName: 'L - Light Switch',
code: 'switch_1',
functionValue: functionValue,
operationDialogType: OperationDialogType.onOff,
@ -109,40 +116,11 @@ class ThreeGangHelperFunctions {
],
),
SceneStaticFunction(
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
operationName: 'Light 2 Switch',
code: 'switch_2',
functionValue: functionValue,
operationDialogType: OperationDialogType.onOff,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsAcPower, description: "ON", value: true),
SceneOperationalValue(
icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
],
),
SceneStaticFunction(
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
operationName: 'Light 3 Switch',
code: 'switch_3',
functionValue: functionValue,
operationDialogType: OperationDialogType.onOff,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsAcPower, description: "ON", value: true),
SceneOperationalValue(
icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
],
),
SceneStaticFunction(
deviceType: '3G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
operationName: 'Light 1 CountDown',
operationName: 'L - Light Countdown',
code: 'countdown_1',
functionValue: functionValue,
operationDialogType: OperationDialogType.integerSteps,
@ -158,10 +136,27 @@ class ThreeGangHelperFunctions {
],
),
SceneStaticFunction(
deviceType: '3G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
operationName: 'M - Light Switch',
code: 'switch_2',
functionValue: functionValue,
operationDialogType: OperationDialogType.onOff,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsAcPower, description: "ON", value: true),
SceneOperationalValue(
icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
],
),
SceneStaticFunction(
deviceType: '3G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
operationName: 'Light 2 CountDown',
operationName: 'M - Light Countdown',
code: 'countdown_2',
functionValue: functionValue,
operationDialogType: OperationDialogType.integerSteps,
@ -177,10 +172,27 @@ class ThreeGangHelperFunctions {
],
),
SceneStaticFunction(
deviceType: '3G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
operationName: 'R - Light Switch',
code: 'switch_3',
functionValue: functionValue,
operationDialogType: OperationDialogType.onOff,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsAcPower, description: "ON", value: true),
SceneOperationalValue(
icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
],
),
SceneStaticFunction(
deviceType: '3G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
operationName: 'Light 3 CountDown',
operationName: 'R - Light Countdown',
code: 'countdown_3',
functionValue: functionValue,
operationDialogType: OperationDialogType.integerSteps,

View File

@ -0,0 +1,147 @@
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 TowGangHelperFunctions {
static List<SceneStaticFunction> towGangHelperFunctions(
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
operationName: 'L - Light Switch',
code: 'switch_1',
functionValue: functionValue,
operationDialogType: OperationDialogType.onOff,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsAcPower, description: "ON", value: true),
SceneOperationalValue(
icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
],
),
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
operationName: 'L - Light CountDown',
code: 'countdown_1',
functionValue: functionValue,
operationDialogType: OperationDialogType.countdown,
operationalValues: [
SceneOperationalValue(icon: '', value: 0),
],
),
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
operationName: 'R - Light Switch',
code: 'switch_2',
functionValue: functionValue,
operationDialogType: OperationDialogType.onOff,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsAcPower, description: "ON", value: true),
SceneOperationalValue(
icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
],
),
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
operationName: 'R - Light CountDown',
code: 'countdown_2',
functionValue: functionValue,
operationDialogType: OperationDialogType.countdown,
operationalValues: [
SceneOperationalValue(icon: '', value: 0),
],
),
];
}
static List<SceneStaticFunction> towGangAutomationFunctions(
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
operationName: 'L - Light Switch',
code: 'switch_1',
functionValue: functionValue,
operationDialogType: OperationDialogType.onOff,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsAcPower, description: "ON", value: true),
SceneOperationalValue(
icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
],
),
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
operationName: 'R - Light CountDown',
code: 'countdown_1',
functionValue: functionValue,
operationDialogType: OperationDialogType.integerSteps,
operationalValues: [
SceneOperationalValue(
icon: '',
description: "sec",
value: 0.0,
minValue: 0,
maxValue: 43200,
stepValue: 1,
),
],
),
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
operationName: 'R - Light Switch',
code: 'switch_2',
functionValue: functionValue,
operationDialogType: OperationDialogType.onOff,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsAcPower, description: "ON", value: true),
SceneOperationalValue(
icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
],
),
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
operationName: 'R - Light CountDown',
code: 'countdown_2',
functionValue: functionValue,
operationDialogType: OperationDialogType.integerSteps,
operationalValues: [
SceneOperationalValue(
icon: '',
description: "sec",
value: 0.0,
minValue: 0,
maxValue: 43200,
stepValue: 1,
),
],
),
];
}
}

View File

@ -0,0 +1,130 @@
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 WaterHeaterFunctionsHelper {
static List<SceneStaticFunction> waterHeaterHelperFunctions(
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'WH',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
operationName: 'Switch',
code: 'switch_1',
functionValue: functionValue,
operationDialogType: OperationDialogType.onOff,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsAcPowerOFF,
description: "Power OFF",
value: false),
SceneOperationalValue(
icon: Assets.assetsAcPower,
description: "Power ON",
value: true,
),
],
),
SceneStaticFunction(
deviceType: 'WH',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
operationName: 'Timer',
code: 'countdown_1',
functionValue: functionValue,
operationDialogType: OperationDialogType.countdown,
operationalValues: [
SceneOperationalValue(icon: '', value: 0),
],
),
];
}
static List<SceneStaticFunction> waterHeaterAutomationFunctions(
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'WH',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.refreshStatusIcon,
operationName: 'Restart Status',
code: 'relay_status',
functionValue: functionValue,
operationDialogType: OperationDialogType.none,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsAcPowerOFF,
description: "Power OFF",
value: 'off',
),
SceneOperationalValue(
icon: Assets.assetsAcPower,
description: "Power ON",
value: 'on',
),
SceneOperationalValue(
icon: Assets.refreshStatusIcon,
description: "Restart Memory",
value: 'memory',
),
],
),
SceneStaticFunction(
deviceType: 'WH',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
operationName: 'Switch',
code: 'switch_1',
functionValue: functionValue,
operationDialogType: OperationDialogType.onOff,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsAcPower, description: "ON", value: true),
SceneOperationalValue(
icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
],
),
SceneStaticFunction(
deviceType: 'WH',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
operationName: 'CountDown',
code: 'countdown_1',
functionValue: functionValue,
operationDialogType: OperationDialogType.integerSteps,
operationalValues: [
SceneOperationalValue(
icon: '',
description: "sec",
value: 0.0,
minValue: 0,
maxValue: 43200,
stepValue: 1,
),
],
),
SceneStaticFunction(
deviceType: 'WH',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsIndicator,
operationName: 'Backlight Switch',
code: 'switch_backlight',
functionValue: functionValue,
operationDialogType: OperationDialogType.onOff,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsAcPower, description: "ON", value: true),
SceneOperationalValue(
icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
],
),
];
}
}

View File

@ -0,0 +1,48 @@
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/app_layout/model/space_model.dart';
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_bloc.dart';
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_event.dart';
abstract final class SceneBlocFactory {
static SceneBloc create({
required bool pageType,
required HomeCubit homeCubit,
}) {
final selectedSpace = homeCubit.selectedSpace;
final defaultSpace = SpaceModel(
id: '-1',
name: '',
community: Community(
uuid: '-1',
name: '',
),
);
final spaceId = selectedSpace?.id ?? defaultSpace.id;
final space = selectedSpace ?? defaultSpace;
final communityUuid =
selectedSpace?.community.uuid ?? defaultSpace.community.uuid;
final sceneBloc = SceneBloc();
sceneBloc.add(
LoadScenes(
spaceId,
space,
showInDevice: pageType,
),
);
if (!pageType) {
sceneBloc.add(
LoadAutomation(
spaceId,
communityUuid,
),
);
}
return sceneBloc;
}
}

View File

@ -88,6 +88,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 +100,7 @@ mixin SceneLogicHelper {
}
if (task.code == CreateSceneEnum.smartSceneSelect.name) {
return CreateSceneAction(
productType: task.deviceType,
actionType: task.operationName.toLowerCase() == 'automation'
? 'automation'
: 'scene',
@ -107,6 +109,7 @@ mixin SceneLogicHelper {
executorProperty: null);
}
return CreateSceneAction(
productType: task.deviceType,
entityId: task.deviceId,
actionExecutor: 'device_issue',
executorProperty: CreateSceneExecutorProperty(
@ -119,6 +122,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;
}
}
}
sceneBloc.add(CreateSceneWithTasksEvent(
createSceneModel: null,
updateScene: updateScene,
@ -139,6 +156,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 +168,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 +188,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;
} else if (action.executorProperty!.functionCode ==
'presence_delay' ||
action.executorProperty!.functionCode == 'none_delay') {
action.executorProperty!.functionValue =
action.executorProperty!.functionValue * 10;
}
}
}
sceneBloc.add(CreateSceneWithTasksEvent(
createSceneModel: createSceneModel,
createAutomationModel: null,

File diff suppressed because it is too large Load Diff

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

@ -74,6 +74,8 @@ class Action {
ExecutorProperty? executorProperty;
String? name;
String? type;
final String productType;
final String deviceName;
Action({
required this.actionExecutor,
@ -81,40 +83,64 @@ class Action {
this.executorProperty,
this.name,
this.type,
required this.productType,
required this.deviceName,
});
String toRawJson() => json.encode(toJson());
static Action? fromJson(Map<String, dynamic> json) {
if (json['name'] != null && json['type'] != null) {
return Action(
actionExecutor: json["actionExecutor"],
entityId: json["entityId"],
name: json['name'],
type: json['type'],
);
}
if (json["executorProperty"] == null) {
// Safely extract required fields with null checks
final String? actionExecutor = json["actionExecutor"] as String?;
final String? entityId = json["entityId"] as String?;
final String? productType = json['productType'] as String?;
final String? deviceName = json['deviceName'] as String?;
// Skip invalid actions with missing required fields
if (actionExecutor == null ||
entityId == null ||
productType == null ||
deviceName == null) {
return null;
}
return Action(
actionExecutor: json["actionExecutor"],
entityId: json["entityId"],
executorProperty: ExecutorProperty.fromJson(json["executorProperty"]),
);
// Handle actions with 'name' and 'type'
if (json['name'] != null && json['type'] != null) {
return Action(
actionExecutor: actionExecutor,
entityId: entityId,
name: json['name'] as String?,
type: json['type'] as String?,
productType: productType,
deviceName: deviceName,
);
}
// Handle actions with 'executorProperty'
if (json["executorProperty"] != null) {
return Action(
actionExecutor: actionExecutor,
entityId: entityId,
executorProperty: ExecutorProperty.fromJson(json["executorProperty"]),
productType: productType,
deviceName: deviceName,
);
}
return null; // Skip invalid actions
}
Map<String, dynamic> toJson() => {
"actionExecutor": actionExecutor,
"entityId": entityId,
"executorProperty": executorProperty?.toJson(),
// "productType": productType
};
}
class ExecutorProperty {
final String? functionCode;
final dynamic functionValue;
dynamic functionValue;
final dynamic delaySeconds;
ExecutorProperty({
@ -142,12 +168,16 @@ class Condition {
final String entityId;
final String entityType;
final Expr expr;
final String productType;
final String deviceName;
Condition({
required this.code,
required this.entityId,
required this.entityType,
required this.expr,
required this.productType,
required this.deviceName,
});
factory Condition.fromRawJson(String str) =>
@ -160,6 +190,8 @@ class Condition {
entityId: json["entityId"],
entityType: json["entityType"],
expr: Expr.fromJson(json["expr"]),
productType: json['productType'] as String,
deviceName: json['deviceName'] as String,
);
Map<String, dynamic> toJson() => {

View File

@ -12,10 +12,11 @@ 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;
final String? deviceType;
SceneStaticFunction({
required this.icon,
@ -28,6 +29,7 @@ class SceneStaticFunction {
this.deviceIcon,
required this.operationDialogType,
this.comparator,
this.deviceType,
String? uniqueCustomId,
}) : uniqueCustomId = uniqueCustomId ?? const Uuid().v4();
@ -44,6 +46,7 @@ class SceneStaticFunction {
OperationDialogType? operationDialogType,
String? comparator,
String? uniqueCustomId,
String? deviceType,
}) {
return SceneStaticFunction(
icon: icon ?? this.icon,
@ -57,6 +60,7 @@ class SceneStaticFunction {
operationDialogType: operationDialogType ?? this.operationDialogType,
comparator: comparator ?? this.comparator,
uniqueCustomId: uniqueCustomId ?? const Uuid().v4(),
deviceType: deviceType ?? this.deviceType,
);
}
@ -73,6 +77,7 @@ class SceneStaticFunction {
'operationDialogType': operationDialogType.name,
'comparator': comparator,
'uniqueCustomId': uniqueCustomId,
'deviceType': deviceType,
};
}
@ -93,6 +98,7 @@ class SceneStaticFunction {
: OperationDialogType.none,
comparator: map['comparator'],
uniqueCustomId: map['uniqueCustomId'] ?? const Uuid().v4(),
deviceType: map['deviceType'] ?? '',
);
}
@ -103,7 +109,7 @@ class SceneStaticFunction {
@override
String toString() {
return 'SceneStaticFunction(icon: $icon, name: $deviceName, code: $code, operationalValues: $operationalValues, deviceId: $deviceId, operationName: $operationName, functionValue: $functionValue, deviceIcon: $deviceIcon, operationDialogType: $operationDialogType, comparator: $comparator, uniqueCustomId: $uniqueCustomId)';
return 'SceneStaticFunction(icon: $icon, name: $deviceName, code: $code, operationalValues: $operationalValues, deviceId: $deviceId, operationName: $operationName, functionValue: $functionValue, deviceIcon: $deviceIcon, operationDialogType: $operationDialogType, comparator: $comparator, uniqueCustomId: $uniqueCustomId, deviceType: $deviceType)';
}
@override
@ -121,7 +127,8 @@ class SceneStaticFunction {
other.uniqueCustomId == uniqueCustomId &&
other.operationDialogType == operationDialogType &&
listEquals(other.operationalValues, operationalValues) &&
other.deviceId == deviceId;
other.deviceId == deviceId &&
other.deviceType == deviceType;
}
@override
@ -136,7 +143,8 @@ class SceneStaticFunction {
comparator.hashCode ^
uniqueCustomId.hashCode ^
operationDialogType.hashCode ^
operationalValues.hashCode;
operationalValues.hashCode ^
deviceType.hashCode;
}
}

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/svg.dart';
import 'package:syncrow_app/features/devices/model/device_control_model.dart';
import 'package:syncrow_app/features/devices/model/device_model.dart';
import 'package:syncrow_app/features/scene/bloc/create_scene/create_scene_bloc.dart';
@ -11,11 +12,10 @@ import 'package:syncrow_app/features/scene/widgets/scene_list_tile.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/light_divider.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
import 'package:syncrow_app/generated/assets.dart';
import 'package:syncrow_app/navigation/navigate_to_route.dart';
import 'package:syncrow_app/navigation/routing_constants.dart';
import 'package:syncrow_app/utils/context_extension.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class DeviceFunctionsView extends StatelessWidget
@ -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),
@ -51,22 +51,14 @@ class DeviceFunctionsView extends StatelessWidget
.add(AddTaskEvent(isAutomation: isAutomation));
navigateToRoute(context, Routes.sceneTasksRoute);
},
child: BodyMedium(
text: 'Save',
fontWeight: FontWeight.normal,
fontColor: ColorsManager.secondaryColor.withOpacity(0.6),
),
child: SvgPicture.asset(Assets.saveRoutinesIcon),
),
],
leading: TextButton(
onPressed: () {
_cancelOperation(context, device, isAutomation);
},
child: BodyMedium(
text: 'Cancel',
fontWeight: FontWeight.normal,
fontColor: ColorsManager.textPrimaryColor.withOpacity(0.6),
),
child: SvgPicture.asset(Assets.cancelIcon),
),
leadingWidth: 80,
padding: EdgeInsets.zero,
@ -75,66 +67,127 @@ class DeviceFunctionsView extends StatelessWidget
itemCount: functions.length,
padding: const EdgeInsets.only(top: 24.0),
itemBuilder: (context, index) {
return DefaultContainer(
padding: index == 0
? const EdgeInsets.only(top: 8)
: index == functions.length - 1
? const EdgeInsets.only(bottom: 8)
: EdgeInsets.zero,
margin: EdgeInsets.zero,
borderRadius: index == 0
? const BorderRadius.only(
topLeft: Radius.circular(20), topRight: Radius.circular(20))
: index == functions.length - 1
? const BorderRadius.only(
bottomLeft: Radius.circular(20),
bottomRight: Radius.circular(20))
: BorderRadius.zero,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
BlocBuilder<CreateSceneBloc, CreateSceneState>(
builder: (context, state) {
return SceneListTile(
iconsSize: 22,
minLeadingWidth: 20,
assetPath: functions[index].icon,
titleString: functions[index].operationName,
trailingWidget: const Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
if (device.productType!.name.toString() == 'ThreeGang' ||
device.productType!.name.toString() == 'TwoGang') {
final bool isFirstInPair = index % 2 == 0;
final bool isLastInPair =
index % 2 == 1 || index == functions.length - 1;
final bool isLastItem = index == functions.length - 1;
return Column(mainAxisSize: MainAxisSize.min, children: [
if (isFirstInPair && index != 0) const SizedBox(height: 16),
DefaultContainer(
padding: EdgeInsets.only(
top: isFirstInPair ? 8 : 0,
bottom: isLastInPair ? 8 : 0,
),
margin: EdgeInsets.zero,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(isFirstInPair ? 20 : 0),
topRight: Radius.circular(isFirstInPair ? 20 : 0),
bottomLeft: Radius.circular(isLastInPair ? 20 : 0),
bottomRight: Radius.circular(isLastInPair ? 20 : 0),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
BlocBuilder<CreateSceneBloc, CreateSceneState>(
builder: (context, state) {
return SceneListTile(
iconsSize: 22,
minLeadingWidth: 20,
assetPath: functions[index].icon,
titleString: functions[index].operationName,
trailingWidget: const Icon(
Icons.arrow_forward_ios_rounded,
color: ColorsManager.greyColor,
size: 16,
),
],
),
onPressed: () {
if (isAutomation) {
_showAutomationDialog(
context,
functions[index],
device,
);
} else {
_showTabToRunDialog(
context,
functions[index],
device,
);
}
onPressed: () {
if (isAutomation) {
_showAutomationDialog(
context, functions[index], device);
} else {
_showTabToRunDialog(
context, functions[index], device);
}
},
);
},
);
},
),
if (isFirstInPair && !isLastItem)
SizedBox(
width: context.width * 0.8,
child: const LightDivider(),
),
],
),
index != functions.length - 1
? SizedBox(
width: context.width * 0.8, child: const LightDivider())
: const SizedBox(),
],
),
);
)
]);
} else {
return DefaultContainer(
padding: index == 0
? const EdgeInsets.only(top: 8)
: index == functions.length - 1
? const EdgeInsets.only(bottom: 8)
: EdgeInsets.zero,
margin: EdgeInsets.zero,
borderRadius: index == 0 && index == functions.length - 1
? const BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20),
bottomLeft: Radius.circular(20),
bottomRight: Radius.circular(20),
)
: index == 0
? const BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20),
)
: index == functions.length - 1
? const BorderRadius.only(
bottomLeft: Radius.circular(20),
bottomRight: Radius.circular(20),
)
: BorderRadius.zero,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
BlocBuilder<CreateSceneBloc, CreateSceneState>(
builder: (context, state) {
return SceneListTile(
iconsSize: 22,
minLeadingWidth: 20,
assetPath: functions[index].icon,
titleString: functions[index].operationName,
trailingWidget: const Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.arrow_forward_ios_rounded,
color: ColorsManager.greyColor,
size: 16,
),
],
),
onPressed: () {
if (isAutomation) {
_showAutomationDialog(
context, functions[index], device);
} else {
_showTabToRunDialog(
context, functions[index], device);
}
},
);
}),
index != functions.length - 1
? SizedBox(
width: context.width * 0.8,
child: const LightDivider())
: const SizedBox(),
],
));
}
},
),
);
@ -204,6 +257,7 @@ class DeviceFunctionsView extends StatelessWidget
deviceName: device.name ?? '',
uniqueId: function.uniqueCustomId!,
operationType: function.operationDialogType,
deviceType: function.deviceType!,
));
Navigator.pop(context);
},
@ -244,6 +298,7 @@ class DeviceFunctionsView extends StatelessWidget
return;
}
context.read<CreateSceneBloc>().add(TempHoldSceneTasksEvent(
deviceType: function.deviceType!,
deviceControlModel: DeviceControlModel(
deviceId: device.uuid,
code: function.code,

View File

@ -0,0 +1,119 @@
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/app_layout/model/space_model.dart';
import 'package:syncrow_app/features/scene/bloc/create_scene/create_scene_bloc.dart';
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_bloc.dart';
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_event.dart';
import 'package:syncrow_app/features/scene/bloc/smart_scene/smart_scene_select_dart_bloc.dart';
import 'package:syncrow_app/features/scene/helper/scene_bloc_factory.dart';
import 'package:syncrow_app/features/scene/widgets/empty_routines_widget.dart';
import 'package:syncrow_app/features/scene/widgets/routines_expansion_tile.dart';
import 'package:syncrow_app/features/scene/widgets/scene_view_widget/scene_header.dart';
import 'package:syncrow_app/features/shared_widgets/app_loading_indicator.dart';
import 'package:syncrow_app/utils/context_extension.dart';
class RoutinesView extends StatelessWidget {
const RoutinesView({super.key});
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => SceneBlocFactory.create(
pageType: false,
homeCubit: HomeCubit.getInstance(),
),
child: BlocBuilder<CreateSceneBloc, CreateSceneState>(
builder: (context, state) {
final selectedSpace = HomeCubit.getInstance().selectedSpace;
if (state is DeleteSceneSuccess) {
if (state.success) _loadScenesAndAutomations(context, selectedSpace);
}
if (state is CreateSceneWithTasks) {
if (state.success) {
_loadScenesAndAutomations(context, selectedSpace);
context.read<SmartSceneSelectBloc>().add(const SmartSceneClearEvent());
}
}
return BlocListener<SceneBloc, SceneState>(
listener: (context, state) {
if (state is SceneTriggerSuccess) {
context.showCustomSnackbar(
message: 'Scene ${state.sceneName} triggered successfully!',
);
}
},
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const SceneHeader(),
const SizedBox(height: 8),
Expanded(
child: BlocBuilder<SceneBloc, SceneState>(
builder: (context, state) {
if (state is SceneLoading) {
return const AppLoadingIndicator();
}
if (state is SceneError) {
return Center(
child: Text(state.message),
);
}
if (state is SceneLoaded) {
final scenes = state.scenes;
final automationList = state.automationList;
final routinesIsEmpty =
scenes.isEmpty && automationList.isEmpty;
if (routinesIsEmpty) return const EmptyRoutinesWidget();
return Theme(
data: Theme.of(context).copyWith(
dividerColor: Colors.transparent,
),
child: Expanded(
child: ListView(
children: [
RoutinesExpansionTile(
title: 'Tap to run routines',
emptyRoutinesMessage:
'No scenes have been added yet',
routines: state.scenes,
loadingStates: state.loadingStates,
loadingSceneId: state.loadingSceneId,
disablePlayButton: false,
),
RoutinesExpansionTile(
title: 'Automation',
emptyRoutinesMessage:
'No automations have been added yet',
routines: state.automationList,
loadingStates: state.loadingStates,
loadingSceneId: state.loadingSceneId,
disablePlayButton: true,
),
const SizedBox(height: 15),
],
),
),
);
}
return const SizedBox.shrink();
},
),
),
],
),
);
},
),
);
}
void _loadScenesAndAutomations(BuildContext context, SpaceModel? selectedSpace) {
context.read<SceneBloc>()
..add(LoadScenes(selectedSpace!.id, selectedSpace, showInDevice: false))
..add(LoadAutomation(selectedSpace.id, selectedSpace.community.uuid));
}
}

View File

@ -20,69 +20,69 @@ class SceneRoomsTabBarDevicesView extends StatefulWidget {
_SceneRoomsTabBarDevicesViewState();
}
class _SceneRoomsTabBarDevicesViewState
extends State<SceneRoomsTabBarDevicesView>
class _SceneRoomsTabBarDevicesViewState extends State<SceneRoomsTabBarDevicesView>
with SingleTickerProviderStateMixin {
late final TabController _tabController;
List<SubSpaceModel>? rooms = [];
late final SpaceModel selectedSpace;
var rooms = <SubSpaceModel>[];
@override
void initState() {
selectedSpace = HomeCubit.getInstance().selectedSpace!;
rooms = List.from(HomeCubit.getInstance().selectedSpace?.subspaces ?? []);
if (rooms != null) {
if (rooms![0].id != '-1') {
rooms?.insert(
0,
SubSpaceModel(
name: 'All Devices',
devices: context.read<DevicesCubit>().allDevices,
id: '-1',
),
);
}
}
_tabController =
TabController(length: rooms!.length, vsync: this, initialIndex: 0);
_tabController.addListener(_handleTabSwitched);
super.initState();
}
void _handleTabSwitched() {
if (_tabController.indexIsChanging) {
final value = _tabController.index;
selectedSpace = HomeCubit.getInstance().selectedSpace!;
/// select tab
context.read<TabBarBloc>().add(TabChanged(
selectedIndex: value,
roomId: rooms?[value].id ?? '',
unit: selectedSpace));
return;
rooms = List.from(selectedSpace.subspaces);
final defaultSubSpaceModel = SubSpaceModel(
name: 'All Devices',
devices: context.read<DevicesCubit>().allDevices,
id: '-1',
);
if (rooms.isNotEmpty) {
final isFirstRoomIdValid = rooms[0].id != '-1';
if (isFirstRoomIdValid) {
rooms.insert(0, defaultSubSpaceModel);
}
} else {
rooms = [defaultSubSpaceModel];
}
_tabController = TabController(length: rooms.length, vsync: this);
_tabController.addListener(_handleTabSwitched);
}
@override
void dispose() {
super.dispose();
_tabController.dispose();
_tabController.removeListener(() {});
_tabController.dispose();
}
void _handleTabSwitched() {
if (_tabController.indexIsChanging) {
final index = _tabController.index;
context.read<TabBarBloc>().add(
TabBarTabChangedEvent(
selectedIndex: index,
roomId: rooms[index].id ?? '',
unit: selectedSpace,
),
);
return;
}
}
@override
Widget build(BuildContext context) {
return DefaultScaffold(
title: StringsManager.createScene,
padding: EdgeInsets.zero,
padding: EdgeInsetsDirectional.zero,
leading: IconButton(
onPressed: () {
navigateToRoute(context, Routes.sceneTasksRoute);
},
icon: const Icon(
Icons.arrow_back_ios,
),
onPressed: () => navigateToRoute(context, Routes.sceneTasksRoute),
icon: const Icon(Icons.arrow_back_ios),
),
title: StringsManager.createScene,
child: SceneDevicesBody(tabController: _tabController, rooms: rooms),
);
}

View File

@ -1,92 +1,54 @@
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/app_layout/model/community_model.dart';
import 'package:syncrow_app/features/app_layout/model/space_model.dart';
import 'package:syncrow_app/features/devices/view/widgets/scene_listview.dart';
import 'package:syncrow_app/features/scene/bloc/create_scene/create_scene_bloc.dart';
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_bloc.dart';
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_event.dart';
import 'package:syncrow_app/features/scene/bloc/smart_scene/smart_scene_select_dart_bloc.dart';
import 'package:syncrow_app/features/scene/helper/scene_bloc_factory.dart';
import 'package:syncrow_app/features/scene/widgets/empty_devices_widget.dart';
import 'package:syncrow_app/features/scene/widgets/scene_view_widget/scene_grid_view.dart';
import 'package:syncrow_app/features/scene/widgets/scene_view_widget/scene_header.dart';
import 'package:syncrow_app/features/shared_widgets/app_loading_indicator.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
import 'package:syncrow_app/utils/context_extension.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class SceneView extends StatelessWidget {
const SceneView({
this.pageType = false,
super.key,
});
final bool pageType;
const SceneView({super.key, this.pageType = false});
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (BuildContext context) {
if (pageType) {
return SceneBloc()
..add(LoadScenes(
HomeCubit.getInstance().selectedSpace?.id ?? '',
HomeCubit.getInstance().selectedSpace ??
SpaceModel(
id: '-1',
name: '',
community: Community(
uuid: '-1',
name: '',
)),
showInDevice: pageType));
} else {
return SceneBloc()
..add(LoadScenes(
HomeCubit.getInstance().selectedSpace?.id ?? '',
HomeCubit.getInstance().selectedSpace ??
SpaceModel(
id: '-1',
name: '',
community: Community(
uuid: '-1',
name: '',
)),
showInDevice: pageType))
..add(LoadAutomation(
HomeCubit.getInstance().selectedSpace?.id ?? '',
HomeCubit.getInstance().selectedSpace?.community.uuid ?? ''));
}
},
create: (context) => SceneBlocFactory.create(
pageType: pageType,
homeCubit: HomeCubit.getInstance(),
),
child: BlocBuilder<CreateSceneBloc, CreateSceneState>(
builder: (context, state) {
final selectedSpace = HomeCubit.getInstance().selectedSpace;
if (state is DeleteSceneSuccess) {
if (state.success) {
BlocProvider.of<SceneBloc>(context).add(LoadScenes(
HomeCubit.getInstance().selectedSpace!.id,
HomeCubit.getInstance().selectedSpace!,
showInDevice: pageType));
BlocProvider.of<SceneBloc>(context).add(LoadAutomation(
HomeCubit.getInstance().selectedSpace!.id,
HomeCubit.getInstance().selectedSpace!.community.uuid));
}
if (state.success) _loadScenesAndAutomations(context, selectedSpace);
}
if (state is CreateSceneWithTasks) {
if (state.success == true) {
BlocProvider.of<SceneBloc>(context).add(LoadScenes(
HomeCubit.getInstance().selectedSpace!.id,
HomeCubit.getInstance().selectedSpace!,
showInDevice: pageType));
BlocProvider.of<SceneBloc>(context).add(LoadAutomation(
HomeCubit.getInstance().selectedSpace!.id,
HomeCubit.getInstance().selectedSpace!.community.uuid));
context
.read<SmartSceneSelectBloc>()
.add(const SmartSceneClearEvent());
if (state.success) {
_loadScenesAndAutomations(context, selectedSpace);
context.read<SmartSceneSelectBloc>().add(const SmartSceneClearEvent());
}
}
return BlocListener<SceneBloc, SceneState>(
listener: (context, state) {
if (state is SceneTriggerSuccess) {
context.showCustomSnackbar(
message:
'Scene ${state.sceneName} triggered successfully!');
message: 'Scene ${state.sceneName} triggered successfully!',
);
}
},
child: HomeCubit.getInstance().spaces.isEmpty
@ -95,13 +57,14 @@ class SceneView extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
if (pageType == false) const SceneHeader(),
if (pageType == false) const SizedBox(height: 8),
if (!pageType) ...[
const SceneHeader(),
const SizedBox(height: 8),
],
BlocBuilder<SceneBloc, SceneState>(
builder: (context, state) {
if (state is SceneLoading) {
return const Center(
child: CircularProgressIndicator());
return const AppLoadingIndicator();
}
if (state is SceneError) {
return Center(
@ -111,84 +74,81 @@ class SceneView extends StatelessWidget {
if (state is SceneLoaded) {
final scenes = state.scenes;
final automationList = state.automationList;
if (scenes.isEmpty) return const EmptyDevicesWidget();
return pageType
? SizedBox(
height: context.height * 0.1,
child: SceneListview(
scenes: scenes,
loadingSceneId: state.loadingSceneId,
),
)
: Expanded(
child: ListView(
if (pageType) {
return SizedBox(
height: context.height * 0.1,
child: SceneListview(
scenes: scenes,
loadingSceneId: state.loadingSceneId,
),
);
}
return Theme(
data: Theme.of(context).copyWith(
dividerColor: Colors.transparent,
),
child: Expanded(
child: ListView(
children: [
ExpansionTile(
tilePadding: const EdgeInsets.symmetric(
horizontal: 6,
),
initiallyExpanded: true,
iconColor: ColorsManager.grayColor,
title: const BodyMedium(
text: 'Tap to run routines',
),
children: [
Theme(
data: ThemeData().copyWith(
dividerColor: Colors.transparent),
child: ExpansionTile(
tilePadding:
const EdgeInsets.symmetric(
horizontal: 6),
initiallyExpanded: true,
iconColor: ColorsManager.grayColor,
title: const BodyMedium(
text: 'Tap to run routines'),
children: [
scenes.isNotEmpty
? SceneGrid(
scenes: scenes,
loadingSceneId:
state.loadingSceneId,
disablePlayButton: false,
loadingStates: state
.loadingStates, // Add this line
)
: const Center(
child: BodyMedium(
text:
'No scenes have been added yet',
),
),
const SizedBox(height: 10),
],
if (scenes.isNotEmpty)
SceneGrid(
scenes: scenes,
loadingSceneId: state.loadingSceneId,
disablePlayButton: false,
loadingStates: state.loadingStates,
)
else
const Center(
child: BodyMedium(
text: 'No scenes have been added yet',
),
),
),
Theme(
data: ThemeData().copyWith(
dividerColor: Colors.transparent),
child: ExpansionTile(
initiallyExpanded: true,
iconColor: ColorsManager.grayColor,
tilePadding:
const EdgeInsets.symmetric(
horizontal: 6),
title: const BodyMedium(
text: 'Automation'),
children: [
automationList.isNotEmpty
? SceneGrid(
scenes: automationList,
loadingSceneId:
state.loadingSceneId,
disablePlayButton: true,
loadingStates: state
.loadingStates, // Add this line
)
: const Center(
child: BodyMedium(
text:
'No automations have been added yet',
),
),
const SizedBox(height: 10),
],
),
),
const SizedBox(height: 15),
const SizedBox(height: 10),
],
),
);
ExpansionTile(
initiallyExpanded: true,
iconColor: ColorsManager.grayColor,
tilePadding: const EdgeInsets.symmetric(
horizontal: 6,
),
title: const BodyMedium(text: 'Automation'),
children: [
if (automationList.isNotEmpty)
SceneGrid(
scenes: automationList,
loadingSceneId: state.loadingSceneId,
disablePlayButton: true,
loadingStates: state.loadingStates,
)
else
const Center(
child: BodyMedium(
text:
'No automations have been added yet',
),
),
const SizedBox(height: 10),
],
),
const SizedBox(height: 15),
],
),
),
);
}
return const SizedBox.shrink();
},
@ -200,4 +160,21 @@ class SceneView extends StatelessWidget {
),
);
}
void _loadScenesAndAutomations(BuildContext context, SpaceModel? selectedSpace) {
BlocProvider.of<SceneBloc>(context)
..add(
LoadScenes(
selectedSpace!.id,
selectedSpace,
showInDevice: pageType,
),
)
..add(
LoadAutomation(
selectedSpace.id,
selectedSpace.community.uuid,
),
);
}
}

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

@ -70,7 +70,8 @@ class CustomBottomSheetWidget extends StatelessWidget {
color: ColorsManager.greyColor,
),
onPressed: () {
Navigator.pushNamed(context, Routes.smartAutomationSelectRoute, arguments: sceneId);
Navigator.pushNamed(context, Routes.smartAutomationSelectRoute,
arguments: sceneId);
},
),
SceneListTile(
@ -92,7 +93,8 @@ class CustomBottomSheetWidget extends StatelessWidget {
}
void _onDelayActionPressed(BuildContext context) {
final functionValues = context.read<CreateSceneBloc>().selectedValues['delay'];
final functionValues =
context.read<CreateSceneBloc>().selectedValues['delay'];
final functions = [
SceneStaticFunction(
deviceId: 'delay',
@ -115,8 +117,10 @@ class CustomBottomSheetWidget extends StatelessWidget {
),
title: functions[0].operationName,
onConfirm: () {
final selectedValue = context.read<CreateSceneBloc>().selectedValues['delay'];
final selectedValue =
context.read<CreateSceneBloc>().selectedValues['delay'];
context.read<CreateSceneBloc>().add(TempHoldSceneTasksEvent(
deviceType: '',
deviceControlModel: DeviceControlModel(
deviceId: '',
code: '',
@ -138,7 +142,9 @@ class CustomBottomSheetWidget extends StatelessWidget {
for (var element in tempTaskList) {
if (element.code == functions[0].code) {
context.read<CreateSceneBloc>().add(RemoveTempTaskByIdEvent(code: functions[0].code));
context
.read<CreateSceneBloc>()
.add(RemoveTempTaskByIdEvent(code: functions[0].code));
context
.read<CreateSceneBloc>()
.add(RemoveFromSelectedValueById(code: functions[0].code));

View File

@ -0,0 +1,34 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class EmptyRoutinesWidget extends StatelessWidget {
const EmptyRoutinesWidget({super.key});
@override
Widget build(BuildContext context) {
return Expanded(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
spacing: 16,
children: [
SvgPicture.asset(
'assets/icons/empty_routines.svg',
colorFilter: ColorFilter.mode(
ColorsManager.textGray,
BlendMode.srcIn,
),
),
BodyMedium(
text: 'No Routines yet',
fontColor: ColorsManager.textGray,
),
],
),
),
);
}
}

View File

@ -0,0 +1,55 @@
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/scene/model/scenes_model.dart';
import 'package:syncrow_app/features/scene/widgets/scene_view_widget/scene_grid_view.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class RoutinesExpansionTile extends StatelessWidget {
const RoutinesExpansionTile({
super.key,
required this.title,
required this.emptyRoutinesMessage,
required this.routines,
required this.loadingStates,
required this.disablePlayButton,
this.loadingSceneId,
});
final String title;
final String emptyRoutinesMessage;
final List<ScenesModel> routines;
final Map<String, bool> loadingStates;
final String? loadingSceneId;
final bool disablePlayButton;
@override
Widget build(BuildContext context) {
return ExpansionTile(
tilePadding: const EdgeInsets.symmetric(
horizontal: 6,
),
initiallyExpanded: true,
iconColor: ColorsManager.grayColor,
title: BodyMedium(
text: title,
),
childrenPadding: EdgeInsetsDirectional.only(bottom: 10),
children: [
Visibility(
visible: routines.isNotEmpty,
replacement: Center(
child: BodyMedium(
text: emptyRoutinesMessage,
textAlign: TextAlign.center,
),
),
child: SceneGrid(
scenes: routines,
loadingSceneId: loadingSceneId,
disablePlayButton: disablePlayButton,
loadingStates: loadingStates,
),
),
],
);
}
}

View File

@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_app/features/devices/bloc/device_manager_bloc/device_manager_bloc.dart';
import 'package:syncrow_app/features/devices/bloc/device_manager_bloc/device_manager_state.dart';
import 'package:syncrow_app/features/devices/model/subspace_model.dart';
@ -8,60 +7,44 @@ import 'package:syncrow_app/features/scene/bloc/tab_change/tab_change_bloc.dart'
import 'package:syncrow_app/features/scene/bloc/tab_change/tab_change_state.dart';
import 'package:syncrow_app/features/scene/enum/create_scene_enum.dart';
import 'package:syncrow_app/features/scene/model/scene_settings_route_arguments.dart';
import 'package:syncrow_app/features/scene/widgets/scene_list_tile.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/features/shared_widgets/text_widgets/body_medium.dart';
import 'package:syncrow_app/navigation/routing_constants.dart';
import 'package:syncrow_app/utils/context_extension.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
import 'package:syncrow_app/features/scene/widgets/scene_devices/scene_devices_body_tab_bar.dart';
import 'package:syncrow_app/features/scene/widgets/scene_devices/scene_devices_list.dart';
import 'package:syncrow_app/features/shared_widgets/app_loading_indicator.dart';
class SceneDevicesBody extends StatelessWidget {
const SceneDevicesBody({
super.key,
required TabController tabController,
required this.tabController,
required this.rooms,
}) : _tabController = tabController;
super.key,
});
final TabController _tabController;
final List<SubSpaceModel>? rooms;
final TabController tabController;
final List<SubSpaceModel> rooms;
@override
Widget build(BuildContext context) {
final isAutomationDeviceStatus =
((ModalRoute.of(context)?.settings.arguments as SceneSettingsRouteArguments?)?.sceneType ==
CreateSceneEnum.deviceStatusChanges.name);
return BlocBuilder<TabBarBloc, TabBarState>(
builder: (context, tabState) {
builder: (context, state) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
TabBar(
controller: _tabController,
dividerColor: Colors.transparent,
indicatorColor: Colors.transparent,
tabs: [
...rooms!.map((e) => Tab(
child: BodyLarge(
text: e.name ?? '',
textAlign: TextAlign.start,
style: context.bodyLarge.copyWith(
color: (tabState is TabSelected) && tabState.roomId == e.id
? ColorsManager.textPrimaryColor
: ColorsManager.textPrimaryColor.withOpacity(0.2),
),
),
)),
],
isScrollable: true,
tabAlignment: TabAlignment.start,
SceneDevicesBodyTabBar(
tabController: tabController,
rooms: rooms,
selectedRoomId: state is TabBarTabSelectedState ? state.roomId : '-1',
),
Expanded(
child: TabBarView(
controller: _tabController,
physics: const NeverScrollableScrollPhysics(),
children:
rooms!.map((e) => _buildRoomTab(e, context, isAutomationDeviceStatus)).toList(),
controller: tabController,
children: rooms
.map(
(room) => _buildRoomTab(
room,
_isAutomationDeviceStatus(context),
),
)
.toList(),
),
),
],
@ -70,52 +53,46 @@ class SceneDevicesBody extends StatelessWidget {
);
}
Widget _buildRoomTab(SubSpaceModel room, BuildContext context, bool isAutomationDeviceStatus) {
bool _isAutomationDeviceStatus(BuildContext context) {
final routeArguments =
ModalRoute.of(context)?.settings.arguments as SceneSettingsRouteArguments?;
final deviceStatusChangesScene = CreateSceneEnum.deviceStatusChanges.name;
final sceneType = routeArguments?.sceneType;
return sceneType == deviceStatusChangesScene;
}
Widget _buildRoomTab(
SubSpaceModel room,
bool isAutomationDeviceStatus,
) {
return BlocBuilder<DeviceManagerBloc, DeviceManagerState>(
builder: (context, state) {
if (state.loading && state.devices == null) {
return const Center(child: CircularProgressIndicator());
} else if (state.devices != null && state.devices!.isNotEmpty) {
return ListView.builder(
itemCount: state.devices!.length,
itemBuilder: (context, index) {
final device = state.devices![index];
return DefaultContainer(
child: SceneListTile(
minLeadingWidth: 40,
leadingWidget: SvgPicture.asset(device.icon ?? ''),
titleWidget: BodyMedium(
text: device.name ?? '',
style: context.titleSmall.copyWith(
color: ColorsManager.secondaryTextColor,
fontWeight: FontWeight.w400,
fontSize: 20,
),
),
trailingWidget: const Icon(
Icons.arrow_forward_ios_rounded,
color: ColorsManager.greyColor,
size: 16,
),
onPressed: () {
Navigator.pushNamed(
context,
Routes.deviceFunctionsRoute,
arguments: {
"device": device,
"isAutomationDeviceStatus": isAutomationDeviceStatus
},
);
},
),
);
},
);
} else if (state.error != null) {
return const Center(child: Text('Something went wrong'));
} else {
return const SizedBox();
}
final isLoading = state.loading && state.devices == null;
final hasData =
state.devices != null && (state.devices?.isNotEmpty ?? false);
final hasError = state.error != null;
final widgets = <bool, Widget>{
isLoading: const AppLoadingIndicator(),
hasError: Center(child: Text('${state.error}')),
hasData: SceneDevicesList(
devices: state.devices ?? [],
isAutomationDeviceStatus: isAutomationDeviceStatus,
),
};
final invalidWidgetEntry = MapEntry(
true,
Center(child: Text('This subspace has no devices')),
);
final validWidgetEntry = widgets.entries.firstWhere(
(entry) => entry.key == true,
orElse: () => invalidWidgetEntry,
);
return validWidgetEntry.value;
},
);
}

View File

@ -0,0 +1,46 @@
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/devices/model/subspace_model.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
import 'package:syncrow_app/utils/context_extension.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class SceneDevicesBodyTabBar extends StatelessWidget {
const SceneDevicesBodyTabBar({
required this.tabController,
required this.rooms,
required this.selectedRoomId,
super.key,
});
final String selectedRoomId;
final TabController tabController;
final List<SubSpaceModel> rooms;
@override
Widget build(BuildContext context) {
return TabBar(
controller: tabController,
dividerColor: Colors.transparent,
indicatorColor: Colors.transparent,
isScrollable: true,
tabAlignment: TabAlignment.start,
tabs: rooms.map((e) {
final isSelected = selectedRoomId == e.id;
return Tab(
child: BodyLarge(
text: e.name ?? '',
textAlign: TextAlign.start,
style: context.bodyLarge.copyWith(
color: isSelected
? ColorsManager.textPrimaryColor
: ColorsManager.textPrimaryColor.withValues(
alpha: 0.2,
),
),
),
);
}).toList(),
);
}
}

View File

@ -0,0 +1,66 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_app/features/devices/model/device_model.dart';
import 'package:syncrow_app/features/scene/widgets/scene_list_tile.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
import 'package:syncrow_app/navigation/routing_constants.dart';
import 'package:syncrow_app/utils/context_extension.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class SceneDevicesList extends StatelessWidget {
const SceneDevicesList({
required this.isAutomationDeviceStatus,
required this.devices,
super.key,
});
final List<DeviceModel> devices;
final bool isAutomationDeviceStatus;
@override
Widget build(BuildContext context) {
return ListView.builder(
itemCount: devices.length,
itemBuilder: (context, index) => _buildDeviceTile(context, devices[index]),
);
}
Widget _buildDeviceTile(
BuildContext context,
DeviceModel device,
) {
return DefaultContainer(
child: SceneListTile(
minLeadingWidth: 40,
leadingWidget: SvgPicture.asset(device.icon ?? ''),
titleWidget: BodyMedium(
text: device.name ?? '',
style: context.titleSmall.copyWith(
color: ColorsManager.secondaryTextColor,
fontWeight: FontWeight.w400,
fontSize: 20,
),
),
trailingWidget: const Icon(
Icons.arrow_forward_ios_rounded,
color: ColorsManager.greyColor,
size: 16,
),
onPressed: () => _navigateToDeviceFunctions(context, device),
),
);
}
void _navigateToDeviceFunctions(
BuildContext context,
DeviceModel device,
) {
Navigator.of(context).pushNamed(
Routes.deviceFunctionsRoute,
arguments: {
"device": device,
"isAutomationDeviceStatus": isAutomationDeviceStatus,
},
);
}
}

View File

@ -1,7 +1,5 @@
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart';
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
class SceneHeader extends StatelessWidget {
@ -19,10 +17,6 @@ class SceneHeader extends StatelessWidget {
fontWeight: FontWeight.bold,
),
),
// SizedBox(height: 20),
// BodySmall(
// text: StringsManager.tapToRunRoutine,
// ),
],
);
}

View File

@ -0,0 +1,12 @@
import 'package:flutter/material.dart';
class AppLoadingIndicator extends StatelessWidget {
const AppLoadingIndicator({super.key});
@override
Widget build(BuildContext context) {
return Center(
child: CircularProgressIndicator.adaptive(),
);
}
}

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

@ -59,13 +59,16 @@ class DefaultScaffold extends StatelessWidget {
height: height ?? MediaQuery.sizeOf(context).height,
padding: padding ??
const EdgeInsets.symmetric(horizontal: Constants.defaultPadding),
decoration: const BoxDecoration(
image: DecorationImage(
decoration: BoxDecoration(
image: const DecorationImage(
colorFilter: ColorFilter.mode(
ColorsManager.backgroundGrey,
BlendMode.srcIn,
),
image: AssetImage(
Assets.assetsImagesBackground,
),
fit: BoxFit.cover,
opacity: 0.4,
),
),
child: SafeArea(child: child),

View File

@ -1140,7 +1140,25 @@ class Assets {
static const String parlour = 'assets/icons/parlour.svg';
static const String grid = 'assets/images/grid.svg';
static const String toggleSwitchSmall = 'assets/icons/toggleSwitchSmall.svg';
static const String offToggleSwitchSmall = 'assets/icons/offToggleSwitchSmall.svg';
static const String toggleSwitchSmall = 'assets/icons/toggleSwitchSmall.svg';
static const String offToggleSwitchSmall =
'assets/icons/offToggleSwitchSmall.svg';
static const String saveRoutinesIcon = 'assets/icons/save_routines_icon.svg';
static const String cancelIcon = 'assets/icons/cancel_icon.svg';
static const String refreshStatusIcon =
'assets/icons/refresh_status_icon.svg';
static const String detectionDistanceIcon =
'assets/icons/detection_distance_icon.svg';
static const String triggerLevelIcon = 'assets/icons/trigger_level_icon.svg';
static const String indentLevelIcon = 'assets/icons/indent_level_icon.svg';
static const String targetConfirmTimeIcon =
'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+17';
void main() {
//to observe the state of the blocs in the output console
Bloc.observer = MyBlocObserver();

View File

@ -3,8 +3,8 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/app_layout/model/community_model.dart';
import 'package:syncrow_app/features/app_layout/model/space_model.dart';
import 'package:syncrow_app/features/app_layout/view/app_layout.dart';
import 'package:syncrow_app/features/auth/view/otp_view.dart';
import 'package:syncrow_app/features/auth/view/login_view.dart';
import 'package:syncrow_app/features/auth/view/otp_view.dart';
import 'package:syncrow_app/features/auth/view/sign_up_view.dart';
import 'package:syncrow_app/features/dashboard/view/dashboard_view.dart';
import 'package:syncrow_app/features/devices/bloc/device_manager_bloc/device_manager_bloc.dart';
@ -17,11 +17,12 @@ import 'package:syncrow_app/features/scene/bloc/tab_change/tab_change_bloc.dart'
import 'package:syncrow_app/features/scene/bloc/tab_change/tab_change_event.dart';
import 'package:syncrow_app/features/scene/view/device_functions_view.dart';
import 'package:syncrow_app/features/scene/view/scene_auto_settings.dart';
import 'package:syncrow_app/features/scene/view/scene_tasks_view.dart';
import 'package:syncrow_app/features/scene/view/scene_rooms_tabbar.dart';
import 'package:syncrow_app/features/scene/view/scene_tasks_view.dart';
import 'package:syncrow_app/features/scene/view/scene_view.dart';
import 'package:syncrow_app/features/scene/view/smart_automation_select_route.dart';
import 'package:syncrow_app/features/splash/view/splash_view.dart';
import 'routing_constants.dart';
class Router {
@ -88,7 +89,7 @@ class Router {
BlocProvider(
create: (BuildContext context) =>
TabBarBloc(context.read<DeviceManagerBloc>())
..add(TabChanged(
..add(TabBarTabChangedEvent(
selectedIndex: 0,
roomId: '-1',
unit: SpaceModel(

View File

@ -11,7 +11,7 @@ abstract class ApiEndpoints {
static const String sendOtp = '/authentication/user/send-otp';
static const String verifyOtp = '/authentication/user/verify-otp';
static const String forgetPassword = '/authentication/user/forget-password';
static const String clientLogin = '/client/token';
////////////////////////////////////// Spaces ///////////////////////////////////////
///Community Module
@ -111,9 +111,9 @@ abstract class ApiEndpoints {
//POST
static const String addDeviceToRoom = '/device/room';
static const String addDeviceToGroup = '/device/group';
static const String controlDevice = '/device/{deviceUuid}/control';
static const String controlDevice = '/devices/{deviceUuid}/command';
static const String firmwareDevice =
'/device/{deviceUuid}/firmware/{firmwareVersion}';
'/devices/{deviceUuid}/firmware/{firmwareVersion}';
static const String getDevicesByUserId = '/device/user/{userId}';
static const String getDevicesByUnitId = '/device/unit/{unitUuid}';
static const String openDoorLock = '/door-lock/open/{doorLockUuid}';
@ -121,13 +121,12 @@ abstract class ApiEndpoints {
//GET
static const String deviceByRoom =
'/projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/subspaces/{subSpaceUuid}/devices';
static const String deviceByUuid = '/device/{deviceUuid}';
static const String deviceFunctions = '/device/{deviceUuid}/functions';
static const String gatewayApi = '/device/gateway/{gatewayUuid}/devices';
static const String deviceByUuid = '/devices/{deviceUuid}';
static const String deviceFunctions = '/devices/{deviceUuid}/functions';
static const String gatewayApi = '/devices/gateway/{gatewayUuid}/devices';
static const String deviceFunctionsStatus =
'/device/{deviceUuid}/functions/status';
static const String powerClamp =
'/device/{powerClampUuid}/power-clamp/status';
'/devices/{deviceUuid}/functions/status';
static const String powerClamp = '/devices/{deviceUuid}/functions/status';
///Device Permission Module
//POST
@ -153,7 +152,8 @@ abstract class ApiEndpoints {
static const String getScene = '/scene/tap-to-run/{sceneId}';
static const String getIconScene = '/scene/icon';
static const String getUnitAutomation = '/projects/{projectId}/communities/{communityId}/spaces/{unitUuid}/automations';
static const String getUnitAutomation =
'/projects/{projectId}/communities/{communityId}/spaces/{unitUuid}/automations';
static const String getAutomationDetails =
'/projects/{projectId}/automations/{automationId}';
@ -161,7 +161,8 @@ abstract class ApiEndpoints {
/// PUT
static const String updateScene = '/scene/tap-to-run/{sceneId}';
static const String updateAutomation = '/projects/{projectId}/automations/{automationId}';
static const String updateAutomation =
'/projects/{projectId}/automations/{automationId}';
static const String updateAutomationStatus =
'/projects/{projectId}/automations/{automationId}';
@ -169,7 +170,8 @@ abstract class ApiEndpoints {
/// DELETE
static const String deleteScene = '/scene/tap-to-run/{sceneId}';
static const String deleteAutomation = '/projects/{projectId}/automations/{automationId}';
static const String deleteAutomation =
'/projects/{projectId}/automations/{automationId}';
//////////////////////Door Lock //////////////////////
//online
@ -213,21 +215,23 @@ abstract class ApiEndpoints {
static const String changeSchedule = '/schedule/enable/{deviceUuid}';
static const String deleteSchedule = '/schedule/{deviceUuid}/{scheduleId}';
static const String reportLogs =
'/device/report-logs/{deviceUuid}?code={code}&startTime={startTime}&endTime={endTime}';
static const String controlBatch = '/device/control/batch';
static const String statusBatch = '/device/status/batch';
static const String deviceScene = '/device/{deviceUuid}/scenes';
'/devices/report-logs/{deviceUuid}?code={code}&startTime={startTime}&endTime={endTime}';
static const String controlBatch = '/devices/batch';
static const String statusBatch = '/devices/batch';
static const String deviceScene = '/devices/{deviceUuid}/scenes';
static const String fourSceneByName =
'/device/{deviceUuid}/scenes?switchName={switchName}';
'/devices/{deviceUuid}/scenes?switchName={switchName}';
static const String resetDevice = '/factory/reset/{deviceUuid}';
static const String unAssignScenesDevice =
'/device/{deviceUuid}/scenes?switchName={switchName}';
static const String getDeviceLogs = '/device/report-logs/{uuid}?code={code}';
'/devices/{deviceUuid}/scenes?switchName={switchName}';
static const String getDeviceLogs = '/devices/report-logs/{uuid}?code={code}';
static const String terms = '/terms';
static const String policy = '/policy';
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}';
}

View File

@ -25,11 +25,15 @@ class AuthenticationAPI {
return response;
}
static Future<bool> signUp({required SignUpModel model}) async {
static Future<bool> signUp({
required SignUpModel model,
required String accessToken,
}) async {
final response = await HTTPService().post(
path: ApiEndpoints.signUp,
body: model.toJson(),
showServerMessage: false,
accessToken: accessToken,
expectedResponseModel: (json) => json['statusCode'] == 201);
return response;
}
@ -63,4 +67,20 @@ class AuthenticationAPI {
expectedResponseModel: (json) => json['data']);
return response;
}
static Future<Map<String, dynamic>> fetchClientToken({
required String clientId,
required String clientSecret,
}) async {
final response = await HTTPService().post(
path: ApiEndpoints.clientLogin,
body: {
'clientId': clientId,
'clientSecret': clientSecret,
},
showServerMessage: false,
expectedResponseModel: (json) => json['data'],
);
return response;
}
}

View File

@ -1,6 +1,6 @@
import 'dart:async';
import 'dart:convert';
import 'dart:developer';
import 'package:syncrow_app/features/devices/model/device_category_model.dart';
import 'package:syncrow_app/features/devices/model/device_control_model.dart';
import 'package:syncrow_app/features/devices/model/device_model.dart';
@ -8,7 +8,8 @@ import 'package:syncrow_app/features/devices/model/device_report_model.dart';
import 'package:syncrow_app/features/devices/model/function_model.dart';
import 'package:syncrow_app/services/api/api_links_endpoints.dart';
import 'package:syncrow_app/services/api/http_service.dart';
import 'package:syncrow_app/utils/constants/temp_const.dart';
import 'package:syncrow_app/utils/resource_manager/constants.dart';
import '../../features/devices/model/create_temporary_password_model.dart';
class DevicesAPI {
@ -39,7 +40,7 @@ class DevicesAPI {
path: ApiEndpoints.deviceByUuid.replaceAll('{deviceUuid}', deviceId),
body: {"deviceName": deviceName},
expectedResponseModel: (json) {
return json;
return json['data'];
},
);
return response;
@ -92,7 +93,7 @@ class DevicesAPI {
.replaceAll('{deviceUuid}', deviceId),
showServerMessage: false,
expectedResponseModel: (json) {
return json;
return json['data'];
},
);
return response;
@ -101,7 +102,8 @@ class DevicesAPI {
static Future<Map<String, dynamic>> getPowerClampStatus(
String deviceId) async {
final response = await _httpService.get(
path: ApiEndpoints.powerClamp.replaceAll('{powerClampUuid}', deviceId),
path: ApiEndpoints.deviceFunctionsStatus
.replaceAll('{deviceUuid}', deviceId),
showServerMessage: false,
expectedResponseModel: (json) {
return json;
@ -132,7 +134,7 @@ class DevicesAPI {
path: ApiEndpoints.deviceFunctions.replaceAll('{deviceUuid}', deviceId),
showServerMessage: false,
expectedResponseModel: (json) {
final functions = FunctionModel.fromJson(json);
final functions = FunctionModel.fromJson(json['data']);
return functions;
});
return response;
@ -143,7 +145,7 @@ class DevicesAPI {
path: ApiEndpoints.deviceScene.replaceAll('{deviceUuid}', deviceId),
showServerMessage: false,
expectedResponseModel: (json) {
return json;
return json['data'];
});
return response;
}
@ -188,7 +190,7 @@ class DevicesAPI {
path: ApiEndpoints.deviceByUuid.replaceAll('{deviceUuid}', deviceId),
showServerMessage: false,
expectedResponseModel: (json) {
return json;
return json['data'] as Map<String, dynamic>;
});
return response;
}
@ -264,7 +266,7 @@ class DevicesAPI {
if (json == null || json.isEmpty || json == []) {
return devices;
}
for (var device in json['devices']) {
for (var device in json['data']['devices']) {
devices.add(DeviceModel.fromJson(device));
}
return devices;
@ -491,7 +493,12 @@ class DevicesAPI {
}) async {
final response = await _httpService.post(
path: ApiEndpoints.controlBatch,
body: {"devicesUuid": devicesUuid, "code": code, "value": value},
body: {
"devicesUuid": devicesUuid,
"code": code,
"value": value,
"operationType": 'COMMAND',
},
showServerMessage: true,
expectedResponseModel: (json) {
return json;
@ -562,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);
},
);
return response;
}
static Future<List<DeviceModel>> getAllDevices({
required String communityUuid,
required String spaceUuid,
@ -577,7 +600,7 @@ class DevicesAPI {
path: path,
showServerMessage: false,
expectedResponseModel: (json) {
final data = json['data'];
final data = json['data'] as List<dynamic>?;
if (data == null || data.isEmpty) {
return <DeviceModel>[];
@ -585,9 +608,12 @@ class DevicesAPI {
if (json == null || json.isEmpty || json == []) {
return <DeviceModel>[];
}
return data
.map<DeviceModel>((device) => DeviceModel.fromJson(device))
.toList();
final result = <DeviceModel>[];
for (final device in data) {
final mappedDevice = DeviceModel.fromJson(device);
result.add(mappedDevice);
}
return result;
},
);

View File

@ -34,7 +34,7 @@ class HomeManagementAPI {
path: ApiEndpoints.devices.replaceAll("{projectUuid}", projectUuid),
showServerMessage: false,
expectedResponseModel: (json) {
json.forEach((value) {
json['data'].forEach((value) {
list.add(DeviceModel.fromJson(value));
});
});

View File

@ -48,13 +48,26 @@ class HTTPService {
Options? options,
dynamic body,
bool showServerMessage = true,
String? accessToken,
required T Function(dynamic) expectedResponseModel}) async {
try {
final authOptions = options ??
Options(
headers: accessToken != null
? {
'Authorization': 'Bearer $accessToken',
'Content-Type': 'application/json',
}
: {
'Content-Type': 'application/json',
},
);
final response = await client.post(
path,
data: body,
queryParameters: queryParameters,
options: options,
options: authOptions,
);
return expectedResponseModel(response.data);
} catch (error) {

View File

@ -35,7 +35,6 @@ abstract class ColorsManager {
static const Color blueColor1 = Color(0xff0A7AFF);
static const Color grayButtonColors = Color(0xffCCCCCC);
static const Color blueButton = Color(0xff85BDFF);
static const Color backgroundGrey = Color(0xFFF3F3F3);
static const Color grayTextColor = Color(0xFFC4C4C4);
}
//background: #F5F5F5;background: #85BDFF;

View File

@ -62,6 +62,7 @@ enum DeviceType {
SixScene,
SOS,
Other,
FlushMountedSensor,
}
enum FunctionType { Boolean, Enum, Integer, Raw, String }
@ -96,6 +97,7 @@ Map<String, DeviceType> devicesTypesMap = {
"4S": DeviceType.FourScene,
"6S": DeviceType.SixScene,
"SOS": DeviceType.SOS,
"NCPS": DeviceType.FlushMountedSensor,
};
Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {

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+16
environment:
sdk: ">=3.0.6 <4.0.0"