Compare commits
91 Commits
aug_bug_fi
...
batch_cont
Author | SHA1 | Date | |
---|---|---|---|
adf553ee9e | |||
f2504e5f67 | |||
b3807f2980 | |||
ba95f6774b | |||
536ac8857e | |||
619d964cd7 | |||
6d805ddfd7 | |||
bc309adba7 | |||
67667e4405 | |||
c354abbeca | |||
fd09db6835 | |||
abb0a58468 | |||
7c28012d79 | |||
9876ff2e03 | |||
7d5b5340db | |||
185d94d800 | |||
db7a072ecf | |||
bcd49ad0e8 | |||
3c8d3feba3 | |||
e577cd3279 | |||
60b51657a6 | |||
b18b96064a | |||
b513f31214 | |||
7c97d01ddb | |||
28ec5beac9 | |||
46691dfff6 | |||
0ac3e79c30 | |||
ebd92c1011 | |||
b4932c644e | |||
222331f107 | |||
3171916faf | |||
28579e0778 | |||
dbb3450c32 | |||
c3d8e6a52e | |||
8c3df39cf4 | |||
7f862fac2a | |||
770db5383b | |||
eddd4828bb | |||
2162c996ea | |||
177baca864 | |||
a86c45a88b | |||
1f22e5d322 | |||
f6cc19cad7 | |||
e0f7c7ab39 | |||
ce861efa3f | |||
85a04e504f | |||
67ea7af595 | |||
b94717bc70 | |||
b565b646c1 | |||
74dccbf899 | |||
0db7a9e1ba | |||
c9160debd3 | |||
a4b1a9e85d | |||
316efd653c | |||
c4fc274dbf | |||
77fb952f00 | |||
74f8907270 | |||
cc64b8d6f4 | |||
c401adbf73 | |||
d9f1b4b9e9 | |||
b860589f94 | |||
530d68428c | |||
20d98b9121 | |||
f15ce71d09 | |||
d17ce77b26 | |||
1bd953a902 | |||
22ea3ca942 | |||
54fe899d0a | |||
9d7216295f | |||
4c102de9be | |||
bf6df377f6 | |||
ece5d541fc | |||
18605f52a0 | |||
5a291ce9f8 | |||
25b9457043 | |||
040e678b1e | |||
7a32ad7878 | |||
ea256c4f51 | |||
ece37fc3c1 | |||
0936ca8b95 | |||
b7c6232bdd | |||
cf80251f82 | |||
3a254bce4d | |||
439ce85117 | |||
a100b5c40e | |||
6ba0a70289 | |||
8130acc392 | |||
418f5d5406 | |||
00bce2d0ab | |||
ddcdd4891a | |||
4a252b38a8 |
2
.env.development
Normal file
@ -0,0 +1,2 @@
|
||||
ENV_NAME=development
|
||||
BASE_URL=https://syncrow-dev.azurewebsites.net
|
2
.env.production
Normal file
@ -0,0 +1,2 @@
|
||||
ENV_NAME=production
|
||||
BASE_URL=https://syncrow-staging.azurewebsites.net
|
2
.env.staging
Normal file
@ -0,0 +1,2 @@
|
||||
ENV_NAME=staging
|
||||
BASE_URL=https://syncrow-staging.azurewebsites.net
|
@ -31,13 +31,13 @@ jobs:
|
||||
run: flutter pub get
|
||||
|
||||
- name: Build Flutter Web App
|
||||
run: flutter build web
|
||||
run: flutter build web --release --dart-define=FLAVOR=development
|
||||
|
||||
- name: Build And Deploy
|
||||
id: builddeploy
|
||||
uses: Azure/static-web-apps-deploy@v1
|
||||
with:
|
||||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ZEALOUS_MUSHROOM_0D31A3303 }}
|
||||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_POLITE_SMOKE_017C65C10 }}
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
|
||||
action: "upload"
|
||||
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
|
||||
@ -56,5 +56,5 @@ jobs:
|
||||
id: closepullrequest
|
||||
uses: Azure/static-web-apps-deploy@v1
|
||||
with:
|
||||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ZEALOUS_MUSHROOM_0D31A3303 }}
|
||||
action: "close"
|
||||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_POLITE_SMOKE_017C65C10 }}
|
||||
action: "close"
|
61
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"configurations": [
|
||||
|
||||
{
|
||||
|
||||
"name": "DEVELOPMENT",
|
||||
|
||||
"request": "launch",
|
||||
|
||||
"type": "dart",
|
||||
|
||||
"args": [
|
||||
|
||||
"--dart-define",
|
||||
|
||||
"FLAVOR=development"
|
||||
|
||||
],
|
||||
|
||||
"flutterMode": "debug"
|
||||
|
||||
},{
|
||||
|
||||
"name": "STAGING",
|
||||
|
||||
"request": "launch",
|
||||
|
||||
"type": "dart",
|
||||
|
||||
"args": [
|
||||
|
||||
"--dart-define",
|
||||
|
||||
"FLAVOR=staging"
|
||||
|
||||
],
|
||||
|
||||
"flutterMode": "debug"
|
||||
|
||||
},{
|
||||
|
||||
"name": "PRODUCTION",
|
||||
|
||||
"request": "launch",
|
||||
|
||||
"type": "dart",
|
||||
|
||||
"args": [
|
||||
|
||||
"--dart-define",
|
||||
|
||||
"FLAVOR=production"
|
||||
|
||||
],
|
||||
|
||||
"flutterMode": "debug"
|
||||
|
||||
},
|
||||
|
||||
]
|
||||
}
|
@ -14,3 +14,11 @@ A few resources to get you started if this is your first Flutter project:
|
||||
For help getting started with Flutter development, view the
|
||||
[online documentation](https://docs.flutter.dev/), which offers tutorials,
|
||||
samples, guidance on mobile development, and a full API reference.
|
||||
|
||||
|
||||
## USEFUL COMMANDS
|
||||
|
||||
Run on chrome: flutter run -d chrome --dart-define=FLAVOR='ENV_NAME'
|
||||
|
||||
Build: flutter build web --release --dart-define=FLAVOR='ENV_NAME'
|
||||
|
||||
|
@ -1,29 +1,28 @@
|
||||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="20" cy="20" r="20" fill="#D5D5D5" fill-opacity="0.6"/>
|
||||
<path d="M26.9628 8C25.5449 8 24.3965 9.15256 24.3965 10.5663C24.3965 10.7819 24.5748 10.9602 24.7903 10.9602C25.0059 10.9602 25.1842 10.7819 25.1842 10.5663C25.1842 9.58374 25.9844 8.78772 26.9628 8.78772C27.9454 8.78772 28.7414 9.58789 28.7414 10.5663V23.1782C28.7414 23.3938 28.9197 23.5721 29.1353 23.5721C29.3509 23.5721 29.5291 23.3938 29.5291 23.1782V10.5663C29.5291 9.15256 28.3766 8 26.9628 8Z" fill="#C3BEC6"/>
|
||||
<path d="M16.9581 15.691H15.2168V11.4165C15.2168 11.1885 15.4034 11.002 15.6314 11.002H16.5435C16.7715 11.002 16.9581 11.1885 16.9581 11.4165V15.691Z" fill="#A7CCF9"/>
|
||||
<path d="M16.5384 11.002H15.6388C15.5849 11.002 15.531 11.0144 15.4854 11.031C15.6429 11.0932 15.7507 11.2424 15.7507 11.4207V15.691H16.9572V11.4207C16.9572 11.1927 16.7706 11.002 16.5384 11.002Z" fill="#8CBDF9"/>
|
||||
<path d="M15.2197 12.3491H16.961V13.1368H15.2197V12.3491Z" fill="#4C5E71"/>
|
||||
<path d="M13.4796 15.691H11.7383V10.5459C11.7383 10.3179 11.9248 10.1313 12.1529 10.1313H13.065C13.293 10.1313 13.4796 10.3179 13.4796 10.5459V15.691Z" fill="#A7DDA7"/>
|
||||
<path d="M13.0619 10.1353H12.1622C12.1083 10.1353 12.0544 10.1477 12.0088 10.1643C12.1663 10.2265 12.2741 10.3757 12.2741 10.554V15.6908H13.4806V10.554C13.4806 10.3218 13.294 10.1353 13.0619 10.1353Z" fill="#8ACE9B"/>
|
||||
<path d="M11.7383 11.479H13.4796V12.2667H11.7383V11.479Z" fill="#4C5E71"/>
|
||||
<path d="M21.3064 23.1788C21.3064 22.2004 20.5021 21.4127 19.5195 21.4417H17.4756V23.3695H21.3064V23.1788Z" fill="#EABC73"/>
|
||||
<path d="M25.2205 32.7462L24.7852 31.0049V30.582H26.9618V32.9991H25.2329L25.2205 32.7462Z" fill="#C3BEC6"/>
|
||||
<path d="M15.6512 32.7462L16.0865 31.0049V30.582H13.9141V32.9991H15.6429L15.6512 32.7462Z" fill="#C3BEC6"/>
|
||||
<path d="M30.0045 24.3267H10.8711V24.9195L11.8786 29.6334C12.0485 30.4336 12.7575 31.0099 13.5784 31.0099H27.2931C28.114 31.0099 28.8229 30.4377 28.9929 29.6334L30.0045 24.9195V24.3267Z" fill="#E2DFE2"/>
|
||||
<path d="M28.7983 24.3267V24.9195L27.7867 29.6334C27.6168 30.4336 26.9078 31.0099 26.0869 31.0099H27.2934C28.1143 31.0099 28.8232 30.4377 28.9932 29.6334L30.0048 24.9195V24.3267H28.7983Z" fill="#D3CED5"/>
|
||||
<path d="M10.8706 24.9195C10.3897 24.9195 10 24.5298 10 24.0489C10 23.5679 10.3897 23.1782 10.8706 23.1782H30.004C30.485 23.1782 30.8747 23.5679 30.8747 24.0489C30.8747 24.5298 30.485 24.9195 30.004 24.9195H10.8706Z" fill="#F4F2F4"/>
|
||||
<path d="M30.0053 23.1782H28.7988C29.2798 23.1782 29.6695 23.5679 29.6695 24.0489C29.6695 24.5298 29.2798 24.9195 28.7988 24.9195H30.0053C30.4862 24.9195 30.8759 24.5298 30.8759 24.0489C30.8759 23.5679 30.4862 23.1782 30.0053 23.1782Z" fill="#E2DFE2"/>
|
||||
<path d="M29.5466 27.0509L29.7124 26.2632H11.1553L11.3253 27.0509H29.5466Z" fill="#C3BEC6"/>
|
||||
<path d="M15.2218 21.4424C14.2599 21.4424 13.4805 22.2218 13.4805 23.1837V27.9681C13.4805 28.2085 13.6753 28.4034 13.9158 28.4034H17.3942C17.6347 28.4034 17.8295 28.2085 17.8295 27.9681V23.2168C17.8295 22.2674 18.5717 21.4673 19.5211 21.4424H15.2218Z" fill="#EFD27C"/>
|
||||
<path d="M13.4805 24.9214H17.8295V26.6627H13.4805V24.9214Z" fill="#EAA96A"/>
|
||||
<path d="M26.5265 12.3072C26.5265 11.3454 25.7471 10.5659 24.7852 10.5659C23.8234 10.5659 23.0439 11.3454 23.0439 12.3072V12.8047H26.5224L26.5265 12.3072Z" fill="#E2DFE2"/>
|
||||
<path d="M24.785 10.5659C24.5735 10.5659 24.3704 10.6032 24.1797 10.6737C24.843 10.9183 25.3157 11.5568 25.3157 12.3072V12.8047H26.5221V12.3072C26.5263 11.3454 25.7468 10.5659 24.785 10.5659Z" fill="#D3CED5"/>
|
||||
<path d="M26.5268 14.0489C27.0077 14.0489 27.3974 13.6592 27.3974 13.1783C27.3974 12.6973 27.0077 12.3076 26.5268 12.3076H23.0484C22.5675 12.3076 22.1777 12.6973 22.1777 13.1783C22.1777 13.6592 22.5675 14.0489 23.0484 14.0489H26.5268Z" fill="#F4F2F4"/>
|
||||
<path d="M26.5268 12.3076H25.3203C25.8012 12.3076 26.191 12.6973 26.191 13.1783C26.191 13.6592 25.8012 14.0489 25.3203 14.0489H26.5268C27.0077 14.0489 27.3974 13.6592 27.3974 13.1783C27.3974 12.6973 27.0077 12.3076 26.5268 12.3076Z" fill="#E2DFE2"/>
|
||||
<path d="M23.0491 17.0505C22.8335 17.0505 22.6553 16.8722 22.6553 16.6566V15.786C22.6553 15.5704 22.8335 15.3921 23.0491 15.3921C23.2647 15.3921 23.443 15.5704 23.443 15.786V16.6566C23.443 16.8722 23.2647 17.0505 23.0491 17.0505Z" fill="#A7CCF9"/>
|
||||
<path d="M24.7845 17.0505C24.5689 17.0505 24.3906 16.8722 24.3906 16.6566V15.786C24.3906 15.5704 24.5689 15.3921 24.7845 15.3921C25.0001 15.3921 25.1783 15.5704 25.1783 15.786V16.6566C25.1783 16.8722 25.0042 17.0505 24.7845 17.0505Z" fill="#A7CCF9"/>
|
||||
<path d="M26.5277 17.0505C26.3121 17.0505 26.1338 16.8722 26.1338 16.6566V15.786C26.1338 15.5704 26.3121 15.3921 26.5277 15.3921C26.7432 15.3921 26.9215 15.5704 26.9215 15.786V16.6566C26.9215 16.8722 26.7432 17.0505 26.5277 17.0505Z" fill="#A7CCF9"/>
|
||||
<path d="M18.2835 17.0924H10.4146C10.1866 17.0924 10 16.9058 10 16.6778V15.7657C10 15.5376 10.1866 15.3511 10.4146 15.3511H18.2835C18.5116 15.3511 18.6981 15.5376 18.6981 15.7657V16.6778C18.6981 16.9058 18.5116 17.0924 18.2835 17.0924Z" fill="#EAA96A"/>
|
||||
<path d="M18.2758 15.3511H17.0693C17.3015 15.3511 17.4881 15.5376 17.4881 15.7698V16.6695C17.4881 16.9016 17.3015 17.0882 17.0693 17.0882H18.2758C18.508 17.0882 18.6945 16.9016 18.6945 16.6695V15.7698C18.6987 15.5418 18.508 15.3511 18.2758 15.3511Z" fill="#E5935D"/>
|
||||
<svg width="21" height="25" viewBox="0 0 21 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16.9628 0C15.5449 0 14.3965 1.15256 14.3965 2.56632C14.3965 2.78191 14.5748 2.96018 14.7903 2.96018C15.0059 2.96018 15.1842 2.78191 15.1842 2.56632C15.1842 1.58374 15.9844 0.787724 16.9628 0.787724C17.9454 0.787724 18.7414 1.58789 18.7414 2.56632V15.1782C18.7414 15.3938 18.9197 15.5721 19.1353 15.5721C19.3509 15.5721 19.5291 15.3938 19.5291 15.1782V2.56632C19.5291 1.15256 18.3766 0 16.9628 0Z" fill="#C3BEC6"/>
|
||||
<path d="M6.95808 7.69098H5.2168V3.41654C5.2168 3.18852 5.40336 3.00195 5.63139 3.00195H6.54349C6.77152 3.00195 6.95808 3.18852 6.95808 3.41654V7.69098Z" fill="#A7CCF9"/>
|
||||
<path d="M6.53841 3.00195H5.63875C5.58485 3.00195 5.53096 3.01439 5.48535 3.03097C5.6429 3.09316 5.75069 3.24242 5.75069 3.42069V7.69098H6.95715V3.42069C6.95715 3.19267 6.77059 3.00195 6.53841 3.00195Z" fill="#8CBDF9"/>
|
||||
<path d="M5.21973 4.34912H6.96101V5.13685H5.21973V4.34912Z" fill="#4C5E71"/>
|
||||
<path d="M3.47957 7.69102H1.73828V2.54594C1.73828 2.31791 1.92485 2.13135 2.15287 2.13135H3.06497C3.293 2.13135 3.47957 2.31791 3.47957 2.54594V7.69102Z" fill="#A7DDA7"/>
|
||||
<path d="M3.06185 2.13525H2.16219C2.10829 2.13525 2.05439 2.14769 2.00879 2.16428C2.16633 2.22646 2.27413 2.37572 2.27413 2.55399V7.69078H3.48059V2.55399C3.48059 2.32182 3.29402 2.13525 3.06185 2.13525Z" fill="#8ACE9B"/>
|
||||
<path d="M1.73828 3.479H3.47957V4.26673H1.73828V3.479Z" fill="#4C5E71"/>
|
||||
<path d="M11.3064 15.1788C11.3064 14.2004 10.5021 13.4127 9.51952 13.4417H7.47559V15.3695H11.3064V15.1788Z" fill="#EABC73"/>
|
||||
<path d="M15.2205 24.7462L14.7852 23.0049V22.582H16.9618V24.9991H15.2329L15.2205 24.7462Z" fill="#C3BEC6"/>
|
||||
<path d="M5.6512 24.7462L6.08652 23.0049V22.582H3.91406V24.9991H5.64291L5.6512 24.7462Z" fill="#C3BEC6"/>
|
||||
<path d="M20.0045 16.3267H0.871094V16.9195L1.87855 21.6334C2.04853 22.4336 2.75749 23.0099 3.57838 23.0099H17.2931C18.114 23.0099 18.8229 22.4377 18.9929 21.6334L20.0045 16.9195V16.3267Z" fill="#E2DFE2"/>
|
||||
<path d="M18.7983 16.3267V16.9195L17.7867 21.6334C17.6168 22.4336 16.9078 23.0099 16.0869 23.0099H17.2934C18.1143 23.0099 18.8232 22.4377 18.9932 21.6334L20.0048 16.9195V16.3267H18.7983Z" fill="#D3CED5"/>
|
||||
<path d="M0.870642 16.9195C0.389716 16.9195 0 16.5298 0 16.0489C0 15.5679 0.389716 15.1782 0.870642 15.1782H20.004C20.485 15.1782 20.8747 15.5679 20.8747 16.0489C20.8747 16.5298 20.485 16.9195 20.004 16.9195H0.870642Z" fill="#F4F2F4"/>
|
||||
<path d="M20.0053 15.1782H18.7988C19.2798 15.1782 19.6695 15.5679 19.6695 16.0489C19.6695 16.5298 19.2798 16.9195 18.7988 16.9195H20.0053C20.4862 16.9195 20.8759 16.5298 20.8759 16.0489C20.8759 15.5679 20.4862 15.1782 20.0053 15.1782Z" fill="#E2DFE2"/>
|
||||
<path d="M19.5466 19.0509L19.7124 18.2632H1.15527L1.32526 19.0509H19.5466Z" fill="#C3BEC6"/>
|
||||
<path d="M5.22175 13.4424C4.2599 13.4424 3.48047 14.2218 3.48047 15.1837V19.9681C3.48047 20.2085 3.67533 20.4034 3.91579 20.4034H7.39421C7.63468 20.4034 7.82953 20.2085 7.82953 19.9681V15.2168C7.82953 14.2674 8.57165 13.4673 9.52107 13.4424H5.22175Z" fill="#EFD27C"/>
|
||||
<path d="M3.48047 16.9214H7.82954V18.6627H3.48047V16.9214Z" fill="#EAA96A"/>
|
||||
<path d="M16.5265 4.3072C16.5265 3.34535 15.7471 2.56592 14.7852 2.56592C13.8234 2.56592 13.0439 3.34535 13.0439 4.3072V4.80471H16.5224L16.5265 4.3072Z" fill="#E2DFE2"/>
|
||||
<path d="M14.785 2.56592C14.5735 2.56592 14.3704 2.60323 14.1797 2.67371C14.843 2.91832 15.3157 3.55679 15.3157 4.3072V4.80471H16.5221V4.3072C16.5263 3.34535 15.7468 2.56592 14.785 2.56592Z" fill="#D3CED5"/>
|
||||
<path d="M16.5268 6.0489C17.0077 6.0489 17.3974 5.65919 17.3974 5.17826C17.3974 4.69733 17.0077 4.30762 16.5268 4.30762H13.0484C12.5675 4.30762 12.1777 4.69733 12.1777 5.17826C12.1777 5.65919 12.5675 6.0489 13.0484 6.0489H16.5268Z" fill="#F4F2F4"/>
|
||||
<path d="M16.5268 4.30762H15.3203C15.8012 4.30762 16.191 4.69733 16.191 5.17826C16.191 5.65919 15.8012 6.0489 15.3203 6.0489H16.5268C17.0077 6.0489 17.3974 5.65919 17.3974 5.17826C17.3974 4.69733 17.0077 4.30762 16.5268 4.30762Z" fill="#E2DFE2"/>
|
||||
<path d="M13.0491 9.05046C12.8335 9.05046 12.6553 8.87218 12.6553 8.65659V7.78595C12.6553 7.57036 12.8335 7.39209 13.0491 7.39209C13.2647 7.39209 13.443 7.57036 13.443 7.78595V8.65659C13.443 8.87218 13.2647 9.05046 13.0491 9.05046Z" fill="#A7CCF9"/>
|
||||
<path d="M14.7845 9.05046C14.5689 9.05046 14.3906 8.87218 14.3906 8.65659V7.78595C14.3906 7.57036 14.5689 7.39209 14.7845 7.39209C15.0001 7.39209 15.1783 7.57036 15.1783 7.78595V8.65659C15.1783 8.87218 15.0042 9.05046 14.7845 9.05046Z" fill="#A7CCF9"/>
|
||||
<path d="M16.5277 9.05046C16.3121 9.05046 16.1338 8.87218 16.1338 8.65659V7.78595C16.1338 7.57036 16.3121 7.39209 16.5277 7.39209C16.7432 7.39209 16.9215 7.57036 16.9215 7.78595V8.65659C16.9215 8.87218 16.7432 9.05046 16.5277 9.05046Z" fill="#A7CCF9"/>
|
||||
<path d="M8.28354 9.09236H0.414592C0.186566 9.09236 0 8.90579 0 8.67777V7.76567C0 7.53764 0.186566 7.35107 0.414592 7.35107H8.28354C8.51157 7.35107 8.69813 7.53764 8.69813 7.76567V8.67777C8.69813 8.90579 8.51157 9.09236 8.28354 9.09236Z" fill="#EAA96A"/>
|
||||
<path d="M8.2758 7.35107H7.06934C7.30151 7.35107 7.48807 7.53764 7.48807 7.76981V8.66948C7.48807 8.90165 7.30151 9.08821 7.06934 9.08821H8.2758C8.50797 9.08821 8.69453 8.90165 8.69453 8.66948V7.76981C8.69868 7.54179 8.50797 7.35107 8.2758 7.35107Z" fill="#E5935D"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
@ -1,34 +1,33 @@
|
||||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="20" cy="20" r="20" fill="#D5D5D5" fill-opacity="0.6"/>
|
||||
<path d="M10.917 16.8086H10.1846V20.1036H10.917V16.8086Z" fill="#78A7AF"/>
|
||||
<path d="M11.5284 21.1936V20.1333C11.5284 19.9834 11.4058 19.8608 11.2559 19.8608H9.84766C9.69781 19.8608 9.5752 19.9834 9.5752 20.1333V21.1936H11.5284Z" fill="#ABCCD3"/>
|
||||
<path d="M12.4008 17.0244C12.5391 17.0244 12.6215 16.9155 12.584 16.7824L11.7531 13.8373C11.7156 13.7042 11.5717 13.5952 11.4333 13.5952H9.67048C9.53215 13.5952 9.38825 13.7042 9.3507 13.8373L8.51982 16.7824C8.48227 16.9155 8.56469 17.0244 8.70303 17.0244H12.4008Z" fill="#FCC96C"/>
|
||||
<path opacity="0.1" d="M9.59445 16.7824L10.4253 13.8373C10.4629 13.7042 10.6068 13.5952 10.7451 13.5952H9.67048C9.53215 13.5952 9.38825 13.7042 9.3507 13.8373L8.51982 16.7824C8.48227 16.9155 8.56469 17.0244 8.70303 17.0244H9.77761C9.63933 17.0244 9.5569 16.9155 9.59445 16.7824Z" fill="black"/>
|
||||
<path d="M30.8164 16.8086H30.084V20.1036H30.8164V16.8086Z" fill="#78A7AF"/>
|
||||
<path d="M31.4249 21.1936V20.1333C31.4249 19.9834 31.3022 19.8608 31.1524 19.8608H29.7441C29.5943 19.8608 29.4717 19.9834 29.4717 20.1333V21.1936H31.4249Z" fill="#ABCCD3"/>
|
||||
<path d="M32.2973 17.0244C32.4356 17.0244 32.518 16.9155 32.4805 16.7824L31.6496 13.8373C31.612 13.7041 31.4681 13.5952 31.3298 13.5952H29.5669C29.4286 13.5952 29.2847 13.7041 29.2471 13.8373L28.4163 16.7824C28.3788 16.9155 28.4612 17.0244 28.5996 17.0244H32.2973Z" fill="#FCC96C"/>
|
||||
<path opacity="0.1" d="M29.5628 16.7824L30.3936 13.8373C30.4312 13.7041 30.5751 13.5952 30.7134 13.5952H29.5669C29.4286 13.5952 29.2847 13.7041 29.2471 13.8373L28.4163 16.7824C28.3788 16.9155 28.4612 17.0244 28.5996 17.0244H29.7461C29.6077 17.0244 29.5253 16.9155 29.5628 16.7824Z" fill="black"/>
|
||||
<path d="M11.3917 25.325C11.3917 25.1866 11.5049 25.0734 11.6433 25.0734H11.838V23.7245C11.838 23.3095 12.1775 22.97 12.5925 22.97H13.2882V21.048C13.2846 21.0479 13.2811 21.0469 13.2775 21.0469H8.25152C8.11319 21.0469 8 21.1601 8 21.2984V25.8435C8 25.9819 8.11319 26.095 8.25152 26.095H11.3918L11.3917 25.325Z" fill="#CB7C52"/>
|
||||
<path d="M12.5925 22.97H13.2882V21.048C13.2846 21.0479 13.2811 21.0469 13.2775 21.0469H8.25152C8.11319 21.0469 8 21.1601 8 21.2984V23.03H12.2984C12.3889 22.9914 12.4883 22.97 12.5925 22.97Z" fill="#FFBB4A"/>
|
||||
<path opacity="0.1" d="M9.08587 25.8435V21.2984C9.08587 21.1601 9.19905 21.0469 9.33739 21.0469H8.25152C8.11319 21.0469 8 21.1601 8 21.2984V25.8435C8 25.9819 8.11319 26.095 8.25152 26.095H9.33739C9.19905 26.095 9.08587 25.9818 9.08587 25.8435Z" fill="black"/>
|
||||
<path d="M10.7656 22.3745C10.669 22.3745 10.5747 22.3355 10.5064 22.2676C10.4385 22.1992 10.3994 22.105 10.3994 22.0088C10.3994 21.9121 10.4385 21.8179 10.5064 21.7495C10.5747 21.6816 10.669 21.6426 10.7656 21.6426C10.8618 21.6426 10.9561 21.6816 11.0244 21.7495C11.0923 21.8179 11.1319 21.9121 11.1319 22.0088C11.1319 22.105 11.0924 22.1992 11.0244 22.2676C10.9561 22.3355 10.8618 22.3745 10.7656 22.3745Z" fill="white"/>
|
||||
<path d="M32.7476 21.0469H27.7216C27.7089 21.0469 27.6968 21.0488 27.6846 21.0506V22.97H28.3803C28.7953 22.97 29.1348 23.3095 29.1348 23.7245V25.0734H29.3296C29.4679 25.0734 29.5811 25.1866 29.5811 25.3249V26.095H32.7476C32.886 26.095 32.9992 25.9819 32.9992 25.8435V21.2984C32.9991 21.1601 32.8859 21.0469 32.7476 21.0469Z" fill="#CB7C52"/>
|
||||
<path d="M32.7476 21.0469H27.7216C27.7089 21.0469 27.6968 21.0488 27.6846 21.0506V22.97H28.3803C28.4845 22.97 28.5839 22.9914 28.6744 23.03H32.9991V21.2984C32.9991 21.1601 32.8859 21.0469 32.7476 21.0469Z" fill="#FFBB4A"/>
|
||||
<path d="M30.2354 22.375C30.1392 22.375 30.0449 22.3355 29.9766 22.2676C29.9087 22.1992 29.8691 22.105 29.8691 22.0083C29.8691 21.9121 29.9087 21.8179 29.9766 21.7495C30.0449 21.6816 30.1392 21.6426 30.2354 21.6426C30.332 21.6426 30.4263 21.6816 30.4946 21.7495C30.5625 21.8179 30.6021 21.9121 30.6021 22.0083C30.6021 22.105 30.5625 22.1992 30.4946 22.2676C30.4263 22.3355 30.332 22.375 30.2354 22.375Z" fill="white"/>
|
||||
<path d="M27.9184 23.1712V19.6763C27.9184 19.538 27.8052 19.4248 27.6669 19.4248H13.3326C13.1942 19.4248 13.0811 19.538 13.0811 19.6763V23.1712H27.9184Z" fill="#FF9F3D"/>
|
||||
<path opacity="0.1" d="M14.1636 23.1712V19.6763C14.1636 19.538 14.2768 19.4248 14.4151 19.4248H13.3326C13.1942 19.4248 13.0811 19.538 13.0811 19.6763V23.1712H14.1636Z" fill="black"/>
|
||||
<path d="M19.9437 23.171V22.0422C19.9437 21.6272 19.6041 21.2876 19.1891 21.2876H15.277C14.8621 21.2876 14.5225 21.6272 14.5225 22.0422V23.171H19.9437Z" fill="white"/>
|
||||
<path d="M26.636 23.171V22.0422C26.636 21.6272 26.2965 21.2876 25.8815 21.2876H21.9694C21.5544 21.2876 21.2148 21.6272 21.2148 22.0422V23.171H26.636Z" fill="white"/>
|
||||
<path d="M29.3677 25.2937V23.7253C29.3677 23.3103 29.0282 22.9707 28.6132 22.9707H12.3844C11.9694 22.9707 11.6299 23.3103 11.6299 23.7253V25.2937H29.3677Z" fill="#FFCFAB"/>
|
||||
<path opacity="0.1" d="M13.0036 25.2937V23.7253C13.0036 23.3103 13.3432 22.9707 13.7582 22.9707H12.3844C11.9694 22.9707 11.6299 23.3103 11.6299 23.7253V25.2937H13.0036Z" fill="black"/>
|
||||
<path d="M13.1652 29.1609C13.3035 29.1609 13.4167 29.0477 13.4167 28.9094V27.5694C13.4167 27.4311 13.5299 27.3179 13.6682 27.3179H27.3331C27.4714 27.3179 27.5846 27.4311 27.5846 27.5694V28.9094C27.5846 29.0477 27.6978 29.1609 27.8361 29.1609H29.5643C29.7026 29.1609 29.8158 29.0477 29.8158 28.9094V25.3257C29.8158 25.1874 29.7026 25.0742 29.5643 25.0742H11.4371C11.2987 25.0742 11.1855 25.1874 11.1855 25.3257V28.9094C11.1855 29.0477 11.2987 29.1609 11.4371 29.1609H13.1652Z" fill="#FF9F3D"/>
|
||||
<svg width="25" height="20" viewBox="0 0 25 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2.91701 6.80859H2.18457V10.1036H2.91701V6.80859Z" fill="#78A7AF"/>
|
||||
<path d="M3.52837 11.1936V10.1333C3.52837 9.98345 3.40576 9.86084 3.2559 9.86084H1.84766C1.69781 9.86084 1.5752 9.98345 1.5752 10.1333V11.1936H3.52837Z" fill="#ABCCD3"/>
|
||||
<path d="M4.40077 7.0244C4.53906 7.0244 4.62153 6.91546 4.58398 6.78235L3.7531 3.83726C3.71555 3.70415 3.57165 3.59521 3.43332 3.59521H1.67048C1.53215 3.59521 1.38825 3.70415 1.3507 3.83726L0.519819 6.78235C0.482269 6.91546 0.564693 7.0244 0.703026 7.0244H4.40077Z" fill="#FCC96C"/>
|
||||
<path opacity="0.1" d="M1.59445 6.78235L2.42533 3.83726C2.46288 3.70415 2.60678 3.59521 2.74512 3.59521H1.67048C1.53215 3.59521 1.38825 3.70415 1.3507 3.83726L0.519819 6.78235C0.482269 6.91546 0.564693 7.0244 0.703026 7.0244H1.77761C1.63933 7.0244 1.5569 6.91546 1.59445 6.78235Z" fill="black"/>
|
||||
<path d="M22.8164 6.80859H22.084V10.1036H22.8164V6.80859Z" fill="#78A7AF"/>
|
||||
<path d="M23.4249 11.1936V10.1333C23.4249 9.98345 23.3022 9.86084 23.1524 9.86084H21.7441C21.5943 9.86084 21.4717 9.98345 21.4717 10.1333V11.1936H23.4249Z" fill="#ABCCD3"/>
|
||||
<path d="M24.2973 7.02445C24.4356 7.02445 24.518 6.91551 24.4805 6.7824L23.6496 3.83726C23.612 3.7041 23.4681 3.59521 23.3298 3.59521H21.5669C21.4286 3.59521 21.2847 3.7041 21.2471 3.83726L20.4163 6.7824C20.3788 6.91551 20.4612 7.02445 20.5996 7.02445H24.2973Z" fill="#FCC96C"/>
|
||||
<path opacity="0.1" d="M21.5628 6.7824L22.3936 3.83726C22.4312 3.7041 22.5751 3.59521 22.7134 3.59521H21.5669C21.4286 3.59521 21.2847 3.7041 21.2471 3.83726L20.4163 6.7824C20.3788 6.91551 20.4612 7.02445 20.5996 7.02445H21.7461C21.6077 7.02445 21.5253 6.91551 21.5628 6.7824Z" fill="black"/>
|
||||
<path d="M3.39173 15.325C3.39173 15.1866 3.50492 15.0734 3.64325 15.0734H3.83798V13.7245C3.83798 13.3095 4.17754 12.97 4.59254 12.97H5.28821V11.048C5.28455 11.0479 5.28113 11.0469 5.27747 11.0469H0.25152C0.113186 11.0469 0 11.1601 0 11.2984V15.8435C0 15.9819 0.113186 16.095 0.25152 16.095H3.39178L3.39173 15.325Z" fill="#CB7C52"/>
|
||||
<path d="M4.59249 12.97H5.28821V11.048C5.28455 11.0479 5.28113 11.0469 5.27747 11.0469H0.25152C0.113186 11.0469 0 11.1601 0 11.2984V13.03H4.2984C4.38892 12.9914 4.48829 12.97 4.59249 12.97Z" fill="#FFBB4A"/>
|
||||
<path opacity="0.1" d="M1.08587 15.8435V11.2984C1.08587 11.1601 1.19905 11.0469 1.33739 11.0469H0.25152C0.113186 11.0469 0 11.1601 0 11.2984V15.8435C0 15.9819 0.113186 16.095 0.25152 16.095H1.33739C1.19905 16.095 1.08587 15.9818 1.08587 15.8435Z" fill="black"/>
|
||||
<path d="M2.76563 12.3745C2.66895 12.3745 2.57471 12.3355 2.50635 12.2676C2.43848 12.1992 2.39941 12.105 2.39941 12.0088C2.39941 11.9121 2.43848 11.8179 2.50635 11.7495C2.57471 11.6816 2.66895 11.6426 2.76563 11.6426C2.86183 11.6426 2.95607 11.6816 3.02443 11.7495C3.0923 11.8179 3.13185 11.9121 3.13185 12.0088C3.13185 12.105 3.09235 12.1992 3.02443 12.2676C2.95607 12.3355 2.86183 12.3745 2.76563 12.3745Z" fill="white"/>
|
||||
<path d="M24.7476 11.0469H19.7216C19.7089 11.0469 19.6968 11.0488 19.6846 11.0506V12.97H20.3803C20.7953 12.97 21.1348 13.3095 21.1348 13.7245V15.0734H21.3296C21.4679 15.0734 21.5811 15.1866 21.5811 15.3249V16.095H24.7476C24.886 16.095 24.9992 15.9819 24.9992 15.8435V11.2984C24.9991 11.1601 24.8859 11.0469 24.7476 11.0469Z" fill="#CB7C52"/>
|
||||
<path d="M24.7476 11.0469H19.7216C19.7089 11.0469 19.6968 11.0488 19.6846 11.0506V12.97H20.3803C20.4845 12.97 20.5839 12.9914 20.6744 13.03H24.9991V11.2984C24.9991 11.1601 24.8859 11.0469 24.7476 11.0469Z" fill="#FFBB4A"/>
|
||||
<path d="M22.2354 12.375C22.1392 12.375 22.0449 12.3355 21.9766 12.2676C21.9087 12.1992 21.8691 12.105 21.8691 12.0083C21.8691 11.9121 21.9087 11.8179 21.9766 11.7495C22.0449 11.6816 22.1392 11.6426 22.2354 11.6426C22.332 11.6426 22.4263 11.6816 22.4946 11.7495C22.5625 11.8179 22.6021 11.9121 22.6021 12.0083C22.6021 12.105 22.5625 12.1992 22.4946 12.2676C22.4263 12.3355 22.332 12.375 22.2354 12.375Z" fill="white"/>
|
||||
<path d="M19.9184 13.1712V9.67632C19.9184 9.53799 19.8052 9.4248 19.6669 9.4248H5.33257C5.19424 9.4248 5.08105 9.53799 5.08105 9.67632V13.1712H19.9184Z" fill="#FF9F3D"/>
|
||||
<path opacity="0.1" d="M6.1636 13.1712V9.67632C6.1636 9.53799 6.27679 9.4248 6.41512 9.4248H5.33257C5.19424 9.4248 5.08105 9.53799 5.08105 9.67632V13.1712H6.1636Z" fill="black"/>
|
||||
<path d="M11.9437 13.171V12.0422C11.9437 11.6272 11.6041 11.2876 11.1891 11.2876H7.27702C6.86207 11.2876 6.52246 11.6272 6.52246 12.0422V13.171H11.9437Z" fill="white"/>
|
||||
<path d="M18.636 13.171V12.0422C18.636 11.6272 18.2965 11.2876 17.8815 11.2876H13.9694C13.5544 11.2876 13.2148 11.6272 13.2148 12.0422V13.171H18.636Z" fill="white"/>
|
||||
<path d="M21.3677 15.2937V13.7253C21.3677 13.3103 21.0282 12.9707 20.6132 12.9707H4.38444C3.96944 12.9707 3.62988 13.3103 3.62988 13.7253V15.2937H21.3677Z" fill="#FFCFAB"/>
|
||||
<path opacity="0.1" d="M5.00365 15.2937V13.7253C5.00365 13.3103 5.34321 12.9707 5.75821 12.9707H4.38444C3.96944 12.9707 3.62988 13.3103 3.62988 13.7253V15.2937H5.00365Z" fill="black"/>
|
||||
<path d="M5.16518 19.1609C5.30352 19.1609 5.4167 19.0477 5.4167 18.9094V17.5694C5.4167 17.4311 5.52989 17.3179 5.66822 17.3179H19.3331C19.4714 17.3179 19.5846 17.4311 19.5846 17.5694V18.9094C19.5846 19.0477 19.6978 19.1609 19.8361 19.1609H21.5643C21.7026 19.1609 21.8158 19.0477 21.8158 18.9094V15.3257C21.8158 15.1874 21.7026 15.0742 21.5643 15.0742H3.43707C3.29873 15.0742 3.18555 15.1874 3.18555 15.3257V18.9094C3.18555 19.0477 3.29873 19.1609 3.43707 19.1609H5.16518Z" fill="#FF9F3D"/>
|
||||
<g opacity="0.1">
|
||||
<path d="M12.2812 28.9089V25.3253C12.2812 25.1869 12.3944 25.0737 12.5327 25.0737H11.4351C11.2968 25.0737 11.1836 25.1869 11.1836 25.3253V28.9089C11.1836 29.0472 11.2968 29.1604 11.4351 29.1604H12.5327C12.3944 29.1604 12.2812 29.0472 12.2812 28.9089Z" fill="black"/>
|
||||
<path d="M4.28118 18.9089V15.3253C4.28118 15.1869 4.39437 15.0737 4.5327 15.0737H3.43511C3.29678 15.0737 3.18359 15.1869 3.18359 15.3253V18.9089C3.18359 19.0472 3.29678 19.1604 3.43511 19.1604H4.5327C4.39437 19.1604 4.28118 19.0472 4.28118 18.9089Z" fill="black"/>
|
||||
</g>
|
||||
<path d="M26.0893 16.2119C26.0893 16.3502 25.9761 16.4634 25.8378 16.4634H15.1627C15.0243 16.4634 14.9111 16.3502 14.9111 16.2119V10.6177C14.9111 10.4794 15.0243 10.3662 15.1627 10.3662H25.8378C25.9761 10.3662 26.0893 10.4794 26.0893 10.6177V16.2119Z" fill="#B1E8FF"/>
|
||||
<path opacity="0.1" d="M16.0124 16.2119V10.6177C16.0124 10.4794 16.1256 10.3662 16.2639 10.3662H15.1627C15.0243 10.3662 14.9111 10.4794 14.9111 10.6177V16.2119C14.9111 16.3502 15.0243 16.4634 15.1627 16.4634H16.2639C16.1256 16.4633 16.0124 16.3502 16.0124 16.2119Z" fill="black"/>
|
||||
<path d="M20.2235 12.3325L17.8389 16.4628H22.6082L20.2235 12.3325Z" fill="#86D5B5"/>
|
||||
<path d="M20.7314 16.4635H25.8379C25.9763 16.4635 26.0894 16.3503 26.0894 16.2119V15.8003L23.6018 11.4917L20.7314 16.4635Z" fill="#FCC96C"/>
|
||||
<path d="M25.8388 16.8296H15.1636C14.823 16.8296 14.5459 16.5525 14.5459 16.2118V10.6177C14.5459 10.2771 14.823 10 15.1636 10H25.8388C26.1794 10 26.4565 10.2771 26.4565 10.6177V16.2119C26.4565 16.5525 26.1794 16.8296 25.8388 16.8296ZM15.2784 16.0971H25.7241V10.7324H15.2784V16.0971Z" fill="#CB7C52"/>
|
||||
<path d="M17.3165 13.3542C17.8144 13.3542 18.218 12.9506 18.218 12.4528C18.218 11.9549 17.8144 11.5513 17.3165 11.5513C16.8186 11.5513 16.415 11.9549 16.415 12.4528C16.415 12.9506 16.8186 13.3542 17.3165 13.3542Z" fill="white"/>
|
||||
<path d="M18.0893 6.21186C18.0893 6.35019 17.9761 6.46338 17.8378 6.46338H7.16265C7.02432 6.46338 6.91113 6.35019 6.91113 6.21186V0.617731C6.91113 0.479397 7.02432 0.366211 7.16265 0.366211H17.8378C17.9761 0.366211 18.0893 0.479397 18.0893 0.617731V6.21186Z" fill="#B1E8FF"/>
|
||||
<path opacity="0.1" d="M8.01238 6.21186V0.617731C8.01238 0.479397 8.12557 0.366211 8.2639 0.366211H7.16265C7.02432 0.366211 6.91113 0.479397 6.91113 0.617731V6.21191C6.91113 6.35024 7.02432 6.46343 7.16265 6.46343H8.2639C8.12557 6.46333 8.01238 6.35019 8.01238 6.21186Z" fill="black"/>
|
||||
<path d="M12.2235 2.33252L9.83887 6.46284H14.6082L12.2235 2.33252Z" fill="#86D5B5"/>
|
||||
<path d="M12.7314 6.46345H17.8379C17.9763 6.46345 18.0894 6.35027 18.0894 6.21193V5.80025L15.6018 1.4917L12.7314 6.46345Z" fill="#FCC96C"/>
|
||||
<path d="M17.8388 6.82956H7.16364C6.823 6.82956 6.5459 6.55245 6.5459 6.21182V0.61774C6.5459 0.277106 6.823 0 7.16364 0H17.8388C18.1794 0 18.4565 0.277106 18.4565 0.61774V6.21192C18.4565 6.55245 18.1794 6.82956 17.8388 6.82956ZM7.27839 6.09712H17.7241V0.73244H7.27839V6.09712Z" fill="#CB7C52"/>
|
||||
<path d="M9.31653 3.35424C9.8144 3.35424 10.218 2.95063 10.218 2.45276C10.218 1.95488 9.8144 1.55127 9.31653 1.55127C8.81865 1.55127 8.41504 1.95488 8.41504 2.45276C8.41504 2.95063 8.81865 3.35424 9.31653 3.35424Z" fill="white"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 6.9 KiB |
@ -1,14 +1,13 @@
|
||||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="20" cy="20" r="20" fill="#D5D5D5" fill-opacity="0.6"/>
|
||||
<path d="M23.6477 26.1286L22.5695 24.9625L22.5381 24.5231L24.7995 22.2617L25.2592 22.2729L26.4253 23.351L26.531 23.6845L24.0777 26.1378L23.6477 26.1286Z" fill="#9DE4FB"/>
|
||||
<path d="M29.0627 9.25136C29.36 8.95413 29.36 8.46779 29.0627 8.17057C28.5522 7.9208 27.9499 7.94668 27.4627 8.23937L25.8536 9.206C24.9222 9.76553 24.4706 10.8648 24.7228 11.9217C24.9226 12.7592 24.6735 13.6406 24.0645 14.2496L24.6364 14.3005C25.2244 13.8653 25.9823 13.7185 26.7089 13.8891C27.131 13.9882 27.5596 13.9728 27.9571 13.8588L28.2488 13.3113L27.4473 12.5098C27.3068 12.3693 27.226 12.18 27.2217 11.9814L27.21 11.4403C27.2055 11.2301 27.287 11.0272 27.4356 10.8785L29.0627 9.25136Z" fill="#9DE4FB"/>
|
||||
<path d="M14.7369 23.5776C13.0442 25.2704 11.2141 23.8824 9.26475 25.8318C8.12448 26.972 7.78946 28.6126 8.25959 30.0469C8.25984 30.0463 8.26008 30.0458 8.26028 30.0453L8.55442 30.3394C9.20913 30.5533 9.91218 30.4551 10.6168 30.3364L10.6958 30.0944L10.3972 29.7957C10.2622 29.6607 10.1863 29.4776 10.1863 29.2866V28.2244C10.1863 28.0335 10.2622 27.8504 10.3972 27.7154L11.1483 26.9643C11.2833 26.8292 11.4665 26.7534 11.6574 26.7534H12.7196C12.9106 26.7534 13.0937 26.8292 13.2287 26.9642L13.5264 27.262L13.9242 27.0998C14.0292 26.4761 13.9817 25.3544 14.6194 24.3753L14.7369 23.5776Z" fill="#9DE4FB"/>
|
||||
<path d="M32.7746 11.8801C32.4774 11.5829 31.9911 11.5829 31.6938 11.8801L30.0483 13.5257C29.9105 13.6634 29.7257 13.744 29.531 13.751L29.0555 13.7681C28.8416 13.7759 28.6341 13.6943 28.4827 13.5429L28.2504 13.3107C27.7111 13.6315 27.0563 13.7446 26.4163 13.5943C25.5859 13.3994 24.7146 13.6189 24.1028 14.2098C24.0904 14.2227 24.0788 14.2363 24.066 14.249C23.861 14.454 14.762 23.553 14.7384 23.5766C14.7214 23.5937 14.704 23.6096 14.6868 23.626C13.6701 24.6895 13.7533 26.0817 13.6315 26.8046C13.6057 26.958 13.5709 27.1104 13.5279 27.261L13.9812 27.7143C14.1162 27.8493 14.1921 28.0325 14.1921 28.2234V29.2856C14.1921 29.4765 14.1162 29.6597 13.9812 29.7947L13.2301 30.5458C13.0951 30.6808 12.9119 30.7567 12.721 30.7567H11.6588C11.4679 30.7567 11.2848 30.6808 11.1497 30.5458L10.6973 30.0933C9.90097 30.3186 9.04929 30.3015 8.26172 30.0442C8.46304 30.6591 8.8112 31.2365 9.30853 31.72C10.8787 33.2466 13.4067 33.2743 15.008 31.7803C17.1042 29.8246 15.6427 27.9312 17.3678 26.206C17.3922 26.1817 26.4983 17.0756 26.7037 16.8702C27.3169 16.2571 28.2038 16.0279 29.048 16.226C30.096 16.472 31.184 16.0133 31.7391 15.0893L32.7057 13.4802C32.9985 12.993 33.0244 12.3907 32.7746 11.8801Z" fill="#7BD9EC"/>
|
||||
<path d="M15.8483 25.0949C15.7016 24.9482 15.7016 24.7105 15.8483 24.5639L25.1039 15.3082C25.2505 15.1616 25.4883 15.1616 25.6349 15.3082C25.7816 15.4549 25.7816 15.6926 25.6349 15.8393L16.3793 25.0949C16.2326 25.2416 15.9949 25.2415 15.8483 25.0949Z" fill="#9DE4FB"/>
|
||||
<path d="M23.6484 26.1282L26.4261 23.3506L32.5753 29.0359C33.1252 29.5442 33.1421 30.4078 32.6126 30.9373L31.2352 32.3147C30.7057 32.8442 29.8421 32.8273 29.3338 32.2774L23.6484 26.1282Z" fill="#F9BC66"/>
|
||||
<path d="M22.5721 24.9625L25.2618 22.2729L15.3468 13.106L13.4053 15.0476L22.5721 24.9625Z" fill="#43B5C3"/>
|
||||
<path d="M9.59863 16.0986L11.7273 13.97L13.7503 15.993L11.6216 18.1216L9.59863 16.0986Z" fill="#43B5C3"/>
|
||||
<path d="M17.6933 10.7039C17.5633 10.5094 17.4105 10.3258 17.2344 10.1574L15.9123 8.89258L15.6668 8.91484C14.5857 9.58352 14.1969 10.1939 11.0233 13.3043C10.7683 13.5593 10.7683 13.9728 11.0233 14.2278L13.5985 16.8031C13.8418 17.0464 14.2364 17.0464 14.4797 16.8031L17.1162 14.1666C17.5665 13.7163 17.7387 13.0644 17.591 12.4449C17.4532 11.8667 17.5067 11.4134 17.6877 11.0395C17.7165 10.9798 17.6933 10.7039 17.6933 10.7039Z" fill="#9DE4FB"/>
|
||||
<path d="M20.4915 9.11902C19.0321 7.93373 17.3202 7.88617 15.666 8.91531L17.1022 10.2893C17.3387 10.5155 17.5333 10.7691 17.6869 11.0399C18.1761 10.0088 19.5877 9.66479 20.3709 9.55175C20.5824 9.52123 20.6575 9.25374 20.4915 9.11902Z" fill="#7BD9EC"/>
|
||||
<path d="M8.99651 15.3314L8.18926 16.1386C7.93691 16.391 7.93691 16.8001 8.18926 17.0524L10.753 19.6162C11.0054 19.8685 11.4145 19.8685 11.6669 19.6162L12.4741 18.8089C12.7265 18.5566 12.7265 18.1474 12.4741 17.8951L9.91036 15.3314C9.65801 15.079 9.24886 15.079 8.99651 15.3314Z" fill="#7BD9EC"/>
|
||||
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M15.6477 18.1286L14.5695 16.9625L14.5381 16.5231L16.7995 14.2617L17.2592 14.2729L18.4253 15.351L18.531 15.6845L16.0777 18.1378L15.6477 18.1286Z" fill="#9DE4FB"/>
|
||||
<path d="M21.0627 1.25136C21.36 0.954133 21.36 0.467791 21.0627 0.170566C20.5522 -0.0791971 19.9499 -0.0533175 19.4627 0.239367L17.8536 1.206C16.9222 1.76553 16.4706 2.86478 16.7228 3.92175C16.9226 4.75917 16.6735 5.64059 16.0645 6.24964L16.6364 6.30048C17.2244 5.86531 17.9823 5.71853 18.7089 5.88914C19.131 5.98821 19.5596 5.97283 19.9571 5.85876L20.2488 5.31134L19.4473 4.50975C19.3068 4.36927 19.226 4.18001 19.2217 3.98137L19.21 3.44029C19.2055 3.23013 19.287 3.02719 19.4356 2.8785L21.0627 1.25136Z" fill="#9DE4FB"/>
|
||||
<path d="M6.73692 15.5776C5.0442 17.2704 3.21412 15.8824 1.26475 17.8318C0.124481 18.972 -0.210539 20.6126 0.259592 22.0469C0.259836 22.0463 0.26008 22.0458 0.260276 22.0453L0.554425 22.3394C1.20913 22.5533 1.91218 22.4551 2.61679 22.3364L2.69584 22.0944L2.3972 21.7957C2.26219 21.6607 2.18631 21.4776 2.18631 21.2866V20.2244C2.18631 20.0335 2.26219 19.8504 2.3972 19.7154L3.1483 18.9643C3.28331 18.8292 3.46647 18.7534 3.65739 18.7534H4.71958C4.91055 18.7534 5.09366 18.8292 5.22868 18.9642L5.52644 19.262L5.92421 19.0998C6.02919 18.4761 5.98173 17.3544 6.61944 16.3753L6.73692 15.5776Z" fill="#9DE4FB"/>
|
||||
<path d="M24.7746 3.88015C24.4774 3.58292 23.9911 3.58292 23.6938 3.88015L22.0483 5.5257C21.9105 5.66345 21.7257 5.74397 21.531 5.751L21.0555 5.76814C20.8416 5.77585 20.6341 5.69426 20.4827 5.54289L20.2504 5.31065C19.7111 5.63151 19.0563 5.74455 18.4163 5.59431C17.5859 5.39938 16.7146 5.61887 16.1028 6.20975C16.0904 6.22274 16.0788 6.23627 16.066 6.24901C15.861 6.45405 6.762 15.553 6.73842 15.5766C6.72137 15.5937 6.70399 15.6096 6.68675 15.626C5.67012 16.6895 5.75328 18.0817 5.63155 18.8046C5.60572 18.958 5.5709 19.1104 5.52793 19.261L5.98122 19.7143C6.11623 19.8493 6.19211 20.0325 6.19211 20.2234V21.2856C6.19211 21.4765 6.11623 21.6597 5.98122 21.7947L5.23012 22.5458C5.09511 22.6808 4.91195 22.7567 4.72102 22.7567H3.65884C3.46786 22.7567 3.28475 22.6808 3.14974 22.5458L2.69729 22.0933C1.90097 22.3186 1.04929 22.3015 0.261719 22.0442C0.463043 22.6591 0.811197 23.2365 1.30853 23.72C2.87869 25.2466 5.40669 25.2743 7.008 23.7803C9.10421 21.8246 7.64269 19.9312 9.36784 18.206C9.3922 18.1817 18.4983 9.0756 18.7037 8.87018C19.3169 8.25708 20.2038 8.02787 21.048 8.22602C22.096 8.47202 23.184 8.01327 23.7391 7.08932L24.7057 5.48024C24.9985 4.99297 25.0244 4.39066 24.7746 3.88015Z" fill="#7BD9EC"/>
|
||||
<path d="M7.84826 17.0949C7.70162 16.9482 7.70162 16.7105 7.84826 16.5639L17.1039 7.30818C17.2505 7.1616 17.4883 7.1616 17.6349 7.30818C17.7816 7.45487 17.7816 7.69257 17.6349 7.83925L8.37928 17.0949C8.23259 17.2416 7.99489 17.2415 7.84826 17.0949Z" fill="#9DE4FB"/>
|
||||
<path d="M15.6484 18.1282L18.4261 15.3506L24.5753 21.0359C25.1252 21.5442 25.1421 22.4078 24.6126 22.9373L23.2352 24.3147C22.7057 24.8442 21.8421 24.8273 21.3338 24.2774L15.6484 18.1282Z" fill="#F9BC66"/>
|
||||
<path d="M14.5721 16.9625L17.2618 14.2729L7.34683 5.10596L5.40527 7.04756L14.5721 16.9625Z" fill="#43B5C3"/>
|
||||
<path d="M1.59863 8.09863L3.72729 5.96998L5.7503 7.99299L3.62165 10.1216L1.59863 8.09863Z" fill="#43B5C3"/>
|
||||
<path d="M9.69327 2.70391C9.56329 2.50937 9.41045 2.32582 9.23437 2.15736L7.91231 0.892578L7.6668 0.914844C6.58571 1.58352 6.19688 2.19393 3.02331 5.30428C2.76827 5.55931 2.76827 5.9728 3.02331 6.22784L5.59853 8.80306C5.84185 9.04637 6.23639 9.04637 6.47971 8.80306L9.11616 6.1666C9.56646 5.7163 9.73868 5.06438 9.59102 4.44492C9.45323 3.86669 9.50674 3.4134 9.68766 3.03946C9.71652 2.9798 9.69327 2.70391 9.69327 2.70391Z" fill="#9DE4FB"/>
|
||||
<path d="M12.4915 1.11902C11.0321 -0.0662658 9.32021 -0.113826 7.66602 0.915305L9.10219 2.28927C9.33872 2.51555 9.5333 2.76907 9.68692 3.03988C10.1761 2.00879 11.5877 1.66479 12.3709 1.55175C12.5824 1.52123 12.6575 1.25374 12.4915 1.11902Z" fill="#7BD9EC"/>
|
||||
<path d="M0.996513 7.33135L0.189263 8.1386C-0.0630877 8.39095 -0.0630877 8.8001 0.189263 9.05245L2.75301 11.6162C3.00536 11.8685 3.4145 11.8685 3.66685 11.6162L4.4741 10.8089C4.72645 10.5566 4.72645 10.1474 4.4741 9.8951L1.91036 7.33135C1.65801 7.079 1.24886 7.079 0.996513 7.33135Z" fill="#7BD9EC"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
@ -1,10 +1,4 @@
|
||||
<svg width="17" height="22" viewBox="0 0 17 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M8.771 11.6328H8.13623L7.81885 11L8.13623 10.3672H8.771V11.6328Z" fill="#292827"/>
|
||||
<path d="M7.50146 10.3672H8.13623V11.6328H7.50146V10.3672Z" fill="#464443"/>
|
||||
<path d="M4.8042 10.3672H6.07373V11.6328H4.8042V10.3672Z" fill="#464443"/>
|
||||
<path d="M10.1987 10.3672H11.4683V11.6328H10.1987V10.3672Z" fill="#292827"/>
|
||||
<path d="M8.13626 2.88879C3.64275 2.88879 0 6.52029 0 11C0 13.0387 0.754651 14.9015 2.00036 16.3265L3.9143 14.4184C3.15343 13.4856 2.69708 12.296 2.69708 11C2.69708 8.00525 5.13225 5.57757 8.13621 5.57757H8.8105V2.88879H8.13626Z" fill="#30BBEC"/>
|
||||
<path d="M14.2725 5.67358L12.3586 7.58168C13.1195 8.51449 13.5758 9.70409 13.5758 11.0001C13.5758 13.9949 11.1407 16.4225 8.13669 16.4225H7.4624V19.1113H8.13665C12.6302 19.1113 16.2729 15.4798 16.2729 11.0001C16.2729 8.96142 15.5183 7.09859 14.2725 5.67358Z" fill="#1F8DCD"/>
|
||||
<path d="M8.13623 0.199951V8.26637L12.1819 4.23316L8.13623 0.199951Z" fill="#16A5D9"/>
|
||||
<path d="M8.13648 21.8V13.7336L4.09082 17.7668L8.13648 21.8Z" fill="#16A5D9"/>
|
||||
<svg width="35" height="30" viewBox="0 0 35 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M27.4702 3.86642L24.351 7.51614C22.56 5.82834 20.1489 4.79201 17.5 4.79201C11.9882 4.79201 7.50309 9.27708 7.50309 14.7889C7.50309 15.0111 7.5113 15.2319 7.52565 15.4506H9.73845C10.4774 15.4506 10.8725 16.3209 10.3872 16.8773L8.47038 19.0757L5.30055 22.7125L4.41734 21.6994L0.213911 16.8773C-0.272125 16.3209 0.123677 15.4506 0.862644 15.4506H2.72613C2.71656 15.2312 2.71109 15.0104 2.71109 14.7889C2.71109 10.8384 4.24918 7.12444 7.04235 4.33126C9.83552 1.53809 13.5495 0 17.5 0C21.2249 0 24.7393 1.36856 27.4702 3.86642Z" fill="#619CED"/>
|
||||
<path d="M34.1379 15.491H32.273C32.1021 19.1776 30.5852 22.6188 27.9582 25.2466C25.165 28.0397 21.451 29.5778 17.5005 29.5778C14.1003 29.5778 10.8758 28.4376 8.26172 26.3383L11.3817 22.6886C13.0742 24.0024 15.1975 24.7858 17.5005 24.7858C22.7765 24.7858 27.1105 20.6767 27.4721 15.491H25.2621C24.5231 15.491 24.128 14.6214 24.6133 14.0643L26.9143 11.425L29.7 8.22914L31.6516 10.4679L34.7866 14.0643C35.2726 14.6214 34.8768 15.491 34.1379 15.491Z" fill="#619CED"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
8
assets/icons/firmware.svg
Normal file
@ -0,0 +1,8 @@
|
||||
<svg width="32" height="35" viewBox="0 0 32 35" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2.20859 17.5333C2.20859 22.0298 4.44255 26.0045 7.86104 28.408C8.46346 28.8318 8.4955 29.7117 7.91685 30.1672L7.90056 30.18C7.52272 30.4775 6.99293 30.4973 6.59933 30.2209C2.6086 27.4182 0 22.7802 0 17.5333C0 9.02288 7.04447 2.11406 15.5378 2.04143V4.25055C8.26345 4.32265 2.20859 10.2421 2.20859 17.5333Z" fill="#1ED688"/>
|
||||
<path d="M15.9433 0.065948L20.0021 2.84224C20.2195 2.99097 20.2195 3.31167 20.0021 3.46041L15.9433 6.2367C15.6947 6.4068 15.3574 6.22869 15.3574 5.92775V0.375166C15.3574 0.0739588 15.6947 -0.103882 15.9433 0.065948Z" fill="#1AB975"/>
|
||||
<path d="M29.0795 17.4666C29.0795 12.9701 26.8453 8.99537 23.4268 6.59185C22.8243 6.16808 22.7923 5.28822 23.371 4.83267L23.3872 4.81985C23.7651 4.52238 24.2949 4.50262 24.6885 4.779C28.6795 7.58172 31.2878 12.2197 31.2878 17.4666C31.2878 25.977 24.2553 32.8858 15.7617 32.9585V30.7493C23.0361 30.6772 29.0795 24.758 29.0795 17.4666Z" fill="#1ED688"/>
|
||||
<path d="M15.3449 34.9339L11.2861 32.1576C11.0687 32.0089 11.0687 31.6882 11.2861 31.5395L15.3449 28.7632C15.5932 28.5931 15.9308 28.7712 15.9308 29.0721V34.6247C15.9308 34.9259 15.5932 35.104 15.3449 34.9339Z" fill="#1AB975"/>
|
||||
<path d="M22.5325 15.7787L15.884 21.2923L14.2079 22.6824C13.813 23.0095 13.3131 23.1871 12.8047 23.1871C12.72 23.1871 12.6354 23.1823 12.5499 23.1724C11.9568 23.1027 11.411 22.7882 11.053 22.3099L8.46759 18.8637C7.88387 18.0853 8.04168 16.9803 8.82034 16.3955C9.59953 15.8118 10.7045 15.9696 11.2885 16.7483L13.0338 19.0754L13.0479 19.0639L20.2822 13.0643C21.0318 12.4432 22.1432 12.5468 22.7645 13.2964C23.3859 14.0459 23.282 15.1573 22.5325 15.7787Z" fill="#1ED688"/>
|
||||
<path d="M22.5334 15.7787L15.8849 21.2923C14.7976 20.7494 13.8414 19.9991 13.0488 19.0639L20.2832 13.0643C21.0327 12.4432 22.1441 12.5468 22.7654 13.2964C23.3868 14.0459 23.2829 15.1573 22.5334 15.7787Z" fill="#35E298"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.9 KiB |
23
assets/icons/main_door.svg
Normal file
@ -0,0 +1,23 @@
|
||||
<svg width="29" height="38" viewBox="0 0 29 38" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g filter="url(#filter0_i_2351_2766)">
|
||||
<path d="M0 5.18168C0 2.69345 1.82822 0.560776 4.30407 0.312864C8.58098 -0.115392 11.9929 -0.0966095 16.2213 0.32393C18.7091 0.57135 20.5548 2.70894 20.5548 5.20899V32.7835C20.5548 35.246 18.7637 37.3665 16.3165 37.6408C12.0557 38.1183 8.5855 38.1222 4.24256 37.6376C1.79332 37.3643 0 35.2435 0 32.7791V5.18168Z" fill="#EAF6FF"/>
|
||||
</g>
|
||||
<path d="M17.5761 23.3577C17.7051 23.3577 17.8341 23.3086 17.9325 23.2102C18.1293 23.0133 18.1293 22.6943 17.9325 22.4975C16.2479 20.813 16.2479 18.0721 17.9325 16.3875C18.1293 16.1907 18.1293 15.8717 17.9325 15.6749C17.7356 15.4782 17.4166 15.4782 17.2198 15.6749C15.1423 17.7525 15.1423 21.1327 17.2198 23.2103C17.3182 23.3086 17.4472 23.3577 17.5761 23.3577Z" fill="#8AC9FE"/>
|
||||
<path d="M18.6358 21.4001C18.744 21.4001 18.8522 21.3588 18.9348 21.2762C19.0999 21.1111 19.0999 20.8434 18.9347 20.6783C18.6046 20.3483 18.4228 19.9093 18.4228 19.4424C18.4228 18.9756 18.6046 18.5367 18.9347 18.2066C19.0999 18.0415 19.0999 17.7738 18.9348 17.6087C18.7696 17.4436 18.5019 17.4436 18.3369 17.6087C17.847 18.0985 17.5772 18.7497 17.5772 19.4424C17.5772 20.1352 17.847 20.7864 18.3369 21.2763C18.4193 21.3587 18.5276 21.4001 18.6358 21.4001Z" fill="#8AC9FE"/>
|
||||
<path d="M11.1713 30.5347L11.1713 32.4539C11.1713 32.8359 10.8617 33.1455 10.4797 33.1455C10.0976 33.1455 9.78809 32.8359 9.78809 32.4539L9.78809 30.5347C9.78809 30.1527 10.0976 29.8431 10.4797 29.8431C10.8617 29.8431 11.1713 30.1527 11.1713 30.5347Z" fill="#B3DAFE"/>
|
||||
<path d="M21.5342 8.79642C21.5342 7.91189 22.1118 7.11379 22.9777 6.93351C24.3924 6.63901 25.5238 6.65107 26.9209 6.93884C27.7961 7.1191 28.3858 7.92191 28.3858 8.81547V31.0421C28.3858 31.9071 27.8339 32.6929 26.9918 32.8912C25.5575 33.2289 24.3936 33.2319 22.9318 32.8895C22.0881 32.6918 21.5342 31.9055 21.5342 31.039V8.79642Z" fill="#EAF6FF"/>
|
||||
<path d="M23.9952 23.3577C23.8662 23.3577 23.7372 23.3086 23.6388 23.2102C23.442 23.0133 23.442 22.6943 23.6388 22.4975C25.3234 20.813 25.3234 18.0721 23.6388 16.3875C23.442 16.1907 23.442 15.8717 23.6388 15.6749C23.8357 15.4782 24.1547 15.4782 24.3515 15.6749C26.429 17.7525 26.429 21.1327 24.3515 23.2103C24.2531 23.3086 24.1241 23.3577 23.9952 23.3577Z" fill="#8AC9FE"/>
|
||||
<path d="M22.9355 21.4001C22.8273 21.4001 22.7191 21.3588 22.6365 21.2762C22.4714 21.1111 22.4714 20.8434 22.6366 20.6783C22.9666 20.3483 23.1485 19.9093 23.1485 19.4424C23.1485 18.9756 22.9666 18.5367 22.6366 18.2066C22.4714 18.0415 22.4714 17.7738 22.6365 17.6087C22.8017 17.4436 23.0694 17.4436 23.2344 17.6087C23.7243 18.0985 23.9941 18.7497 23.9941 19.4424C23.9941 20.1352 23.7243 20.7864 23.2344 21.2763C23.1519 21.3587 23.0437 21.4001 22.9355 21.4001Z" fill="#8AC9FE"/>
|
||||
<defs>
|
||||
<filter id="filter0_i_2351_2766" x="-1" y="0" width="21.5547" height="38" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||
<feOffset dx="-1"/>
|
||||
<feGaussianBlur stdDeviation="1.5"/>
|
||||
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0.538295 0 0 0 0 0.538295 0 0 0 0 0.538295 0 0 0 0.3 0"/>
|
||||
<feBlend mode="normal" in2="shape" result="effect1_innerShadow_2351_2766"/>
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 3.4 KiB |
10
assets/icons/main_door_notifi.svg
Normal file
@ -0,0 +1,10 @@
|
||||
<svg width="31" height="35" viewBox="0 0 31 35" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M17.4316 6.37335C16.8654 6.37335 16.4062 5.91425 16.4062 5.34796V3.07617C16.4062 2.51077 15.9463 2.05078 15.3809 2.05078C14.8155 2.05078 14.3555 2.51077 14.3555 3.07617V5.34796C14.3555 5.91425 13.8964 6.37335 13.3301 6.37335C12.7638 6.37335 12.3047 5.91425 12.3047 5.34796V3.07617C12.3047 1.37997 13.6847 0 15.3809 0C17.0771 0 18.457 1.37997 18.457 3.07617V5.34796C18.457 5.91425 17.9979 6.37335 17.4316 6.37335Z" fill="#FFB454"/>
|
||||
<path d="M16.4062 3.07617V5.34796C16.4062 5.91425 16.8654 6.37335 17.4316 6.37335C17.9979 6.37335 18.457 5.91425 18.457 5.34796V3.07617C18.457 1.37997 17.0771 0 15.3809 0V2.05078C15.9463 2.05078 16.4062 2.51077 16.4062 3.07617Z" fill="#FF8E00"/>
|
||||
<path d="M15.3809 35C12.5539 35 10.2539 32.7 10.2539 29.873C10.2539 29.3068 10.713 28.8477 11.2793 28.8477H19.4824C20.0487 28.8477 20.5078 29.3068 20.5078 29.873C20.5078 32.7 18.2079 35 15.3809 35Z" fill="#FFB454"/>
|
||||
<path d="M19.4824 28.8477H15.3809V35C18.2079 35 20.5078 32.7 20.5078 29.873C20.5078 29.3068 20.0487 28.8477 19.4824 28.8477Z" fill="#FF8E00"/>
|
||||
<path d="M29.7363 30.8984H1.0254C0.614562 30.8984 0.243439 30.6532 0.0822478 30.2753C-0.0789436 29.8975 0.000968566 29.4599 0.285344 29.1633C3.18706 26.1372 4.78517 22.1616 4.78517 17.9691V14.6973C4.78517 8.85479 9.5384 4.10156 15.3809 4.10156C21.2233 4.10156 25.9766 8.85479 25.9766 14.6973V17.9691C25.9766 22.1617 27.5747 26.1372 30.4765 29.1633C30.7608 29.4599 30.8407 29.8975 30.6795 30.2753C30.5184 30.6532 30.1472 30.8984 29.7363 30.8984Z" fill="#FFE278"/>
|
||||
<path d="M29.7363 30.8984C30.1472 30.8984 30.5183 30.6532 30.6795 30.2753C30.8407 29.8975 30.7608 29.4599 30.4765 29.1633C27.5747 26.1372 25.9766 22.1616 25.9766 17.9691V14.6973C25.9766 8.85479 21.2233 4.10156 15.3809 4.10156V30.8984H29.7363Z" fill="#FFB454"/>
|
||||
<path d="M29.7359 15.7226C29.1696 15.7226 28.7105 15.2635 28.7105 14.6972C28.7105 11.1366 27.3239 7.78912 24.8062 5.27144C24.4057 4.87099 24.4057 4.22178 24.8062 3.82133C25.2066 3.42088 25.8559 3.42088 26.2563 3.82133C29.1614 6.72633 30.7613 10.5888 30.7613 14.6972C30.7613 15.2635 30.3022 15.7226 29.7359 15.7226Z" fill="#08475E"/>
|
||||
<path d="M1.02539 15.7226C0.459102 15.7226 0 15.2635 0 14.6972C0 10.5888 1.59988 6.7264 4.50495 3.82133C4.90533 3.42088 5.55461 3.42088 5.95506 3.82133C6.35551 4.22178 6.35551 4.87099 5.95506 5.27144C3.43738 7.78918 2.05078 11.1367 2.05078 14.6972C2.05078 15.2635 1.59168 15.7226 1.02539 15.7226Z" fill="#0A789B"/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.5 KiB |
18
assets/icons/main_door_reports.svg
Normal file
@ -0,0 +1,18 @@
|
||||
<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.62771 22.7848L0.0206433 9.97422C-0.0455284 9.78766 0.0527038 9.58101 0.239256 9.51286C6.29643 7.33432 13.1218 5.30816 18.9563 2.81865C19.2171 2.65418 19.4217 2.81667 19.534 3.12757L26.7725 21.7858L28.7381 27.2523C28.8043 27.4388 28.7081 27.6475 28.5215 27.7137L14.6702 32.6947L9.27087 34.6366C9.08432 34.7048 8.87774 34.6065 8.80958 34.4199L4.62771 22.7848Z" fill="white"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.46894 18.5338L6.16844 5.11738C6.13433 4.92078 6.26674 4.73423 6.46129 4.70012L22.3042 1.98393L25.9325 1.38613C26.1311 1.29986 26.454 1.40015 26.5302 1.84352L30.4493 21.4146L31.4301 27.1398C31.4642 27.3345 31.3318 27.523 31.1372 27.5571L16.6301 30.0446L10.974 31.0155C10.7795 31.0477 10.5909 30.9152 10.5568 30.7206L8.46894 18.5338Z" fill="white"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.9063 14.5779V27.4768C12.9063 27.6835 13.0748 27.854 13.2814 27.854H19.2684H28.1315H29.4051H34.624C34.8305 27.854 34.999 27.6835 34.999 27.4768V21.4166V4.67611V4.50159H31.1882C30.8212 4.50159 30.059 4.55375 30.059 3.72127L30.0509 0H13.2813C13.0748 0 12.9062 0.168505 12.9062 0.375155V3.59487V4.957V14.5779H12.9063Z" fill="white"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.54915 7.34229C4.40308 8.0645 2.27704 8.78063 0.239256 9.51283C0.0527037 9.58105 -0.0455284 9.78763 0.0206433 9.97418L4.62771 22.7848L8.80958 34.4199C8.87781 34.6065 9.08439 34.7048 9.27087 34.6365L14.6702 32.6947L26.9732 28.2713L6.54915 7.34229Z" fill="#B5C4CF"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.9076 3.59473L6.46129 4.70003C6.26674 4.73414 6.13433 4.92069 6.16844 5.11729L6.54955 7.34197L8.469 18.5337L10.5569 30.7205C10.591 30.9151 10.7795 31.0474 10.9741 31.0154L16.6301 30.0445L26.9735 28.2711L29.4064 27.8538H28.1328L12.9076 3.59473Z" fill="#D7E7EC"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.999 21.4166V4.67611V4.50159V4.44342C34.999 4.33507 34.9528 4.31702 34.7864 4.15453L30.6727 0.230712C30.4782 0.0461424 30.4461 0 30.3318 0H30.0509H13.2813C13.0748 0 12.9062 0.168505 12.9062 0.375155V27.4768C12.9062 27.6835 13.0748 27.854 13.2813 27.854H34.6239C34.8305 27.854 34.999 27.6835 34.999 27.4768V21.4166Z" fill="#EDF3F4"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.9077 3.59473L11.3975 3.85353V28.8629C11.3975 29.0716 11.566 29.2401 11.7725 29.2401H17.7595H21.3216L26.9736 28.2712L29.4065 27.8539H28.1329H26.5665H19.2698H13.2828C13.0762 27.8539 12.9077 27.6834 12.9077 27.4768C12.9077 19.5167 12.9077 11.5547 12.9077 3.59473Z" fill="#B5C4CF"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.46896 18.5336L6.54951 7.3418C6.03005 7.51632 5.51257 7.69084 4.99707 7.86536L5.23578 9.25558L7.15524 20.4473L9.24518 32.6341C9.27724 32.8286 9.46578 32.961 9.66033 32.929L15.3164 31.9581L18 31.4987L26.0829 28.59L25.9867 28.4395L21.3214 29.2399L16.6302 30.0444L10.9741 31.0153C10.7796 31.0474 10.591 30.915 10.5569 30.7204L8.46896 18.5336Z" fill="#9AAFB7"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.9998 21.4166V4.67611V4.50159C34.9998 4.29897 34.9337 4.29699 34.7873 4.15453L30.6736 0.230712C30.4791 0.0461424 30.447 0 30.3326 0H30.0518H25.8779C30.9784 6.8286 31.2692 19.1377 27.4845 26.8209C27.31 27.178 27.1275 27.521 26.937 27.854H28.1323H29.4059H34.6248C34.8313 27.854 34.9998 27.6835 34.9998 27.4768V21.4166Z" fill="#D7E7EC"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M30.0607 3.72127C30.0607 4.55375 30.8229 4.50159 31.19 4.50159H35.0008V4.44342C35.0008 4.33507 34.9546 4.31702 34.7882 4.15453L30.6745 0.230712C30.48 0.0461424 30.4479 0 30.3336 0H30.0527L30.0607 3.72127Z" fill="white"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.7882 4.15453L30.6745 0.230712C30.48 0.0461424 30.4479 0 30.3336 0H30.0527L30.0607 3.7212C30.0607 4.55368 30.8229 4.50152 31.19 4.50152H35.0008V4.44335C35.0008 4.33507 34.9546 4.31702 34.7882 4.15453Z" fill="#B5C4CF"/>
|
||||
<path d="M31.6094 8.20367H16.5086C16.2169 8.20367 15.9805 7.96715 15.9805 7.67532C15.9805 7.3835 16.2169 7.14697 16.5086 7.14697H31.6094C31.9011 7.14697 32.1376 7.3835 32.1376 7.67532C32.1376 7.96715 31.9012 8.20367 31.6094 8.20367Z" fill="#9AAFB7"/>
|
||||
<path d="M31.6094 11.9566H16.5086C16.2169 11.9566 15.9805 11.7201 15.9805 11.4283C15.9805 11.1364 16.2169 10.8999 16.5086 10.8999H31.6094C31.9011 10.8999 32.1376 11.1364 32.1376 11.4283C32.1376 11.7201 31.9012 11.9566 31.6094 11.9566Z" fill="#9AAFB7"/>
|
||||
<path d="M31.6094 15.7105H16.5086C16.2169 15.7105 15.9805 15.474 15.9805 15.1822C15.9805 14.8903 16.2169 14.6538 16.5086 14.6538H31.6094C31.9011 14.6538 32.1376 14.8903 32.1376 15.1822C32.1376 15.474 31.9012 15.7105 31.6094 15.7105Z" fill="#9AAFB7"/>
|
||||
<path d="M31.6094 19.4634H16.5086C16.2169 19.4634 15.9805 19.2269 15.9805 18.9351C15.9805 18.6433 16.2169 18.4067 16.5086 18.4067H31.6094C31.9011 18.4067 32.1376 18.6433 32.1376 18.9351C32.1376 19.2269 31.9012 19.4634 31.6094 19.4634Z" fill="#9AAFB7"/>
|
||||
<path d="M31.6094 23.2169H16.5086C16.2169 23.2169 15.9805 22.9803 15.9805 22.6885C15.9805 22.3967 16.2169 22.1602 16.5086 22.1602H31.6094C31.9011 22.1602 32.1376 22.3967 32.1376 22.6885C32.1376 22.9803 31.9012 23.2169 31.6094 23.2169Z" fill="#9AAFB7"/>
|
||||
</svg>
|
After Width: | Height: | Size: 5.1 KiB |
@ -1,40 +1,39 @@
|
||||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="20" cy="20" r="20" fill="#023DFE" fill-opacity="0.6"/>
|
||||
<path d="M31.9152 18.4965V15.9326H25.4302C25.2913 15.9326 25.1787 16.0452 25.1787 16.1841V18.4965H31.9152Z" fill="#FED402"/>
|
||||
<path d="M31.7237 15.8841H26.3818L26.2641 15.933H25.4302C25.2913 15.933 25.1787 16.0456 25.1787 16.1845V17.1905H31.9152V15.933L31.7514 15.8813C31.7422 15.8826 31.7332 15.8841 31.7237 15.8841Z" fill="#FE6C55"/>
|
||||
<path d="M18.4375 15.5244H19.9465V17.0891H18.4375V15.5244Z" fill="#918291"/>
|
||||
<path d="M21.959 18.4969V17.7941C21.959 17.3774 21.6212 17.0396 21.2044 17.0396H17.1803C16.7636 17.0396 16.4258 17.3773 16.4258 17.7941V18.4969H21.959Z" fill="#A79BA7"/>
|
||||
<path d="M18.0266 18.448V17.7941C18.0266 17.3774 18.3644 17.0396 18.7812 17.0396H17.1803C16.7636 17.0396 16.4258 17.3773 16.4258 17.7941V18.448H18.0266Z" fill="#918291"/>
|
||||
<path d="M23.7282 15.2068H14.6592C14.5244 15.2068 14.415 15.0975 14.415 14.9626V9.61035C14.415 9.47554 14.5244 9.36621 14.6592 9.36621H23.7282C23.863 9.36621 23.9724 9.47554 23.9724 9.61035V14.9626C23.9724 15.0975 23.8631 15.2068 23.7282 15.2068Z" fill="#EAF6FF"/>
|
||||
<path d="M16.4271 14.9553V9.61772C16.4271 9.47881 16.5397 9.36621 16.6786 9.36621H14.6666C14.5276 9.36621 14.415 9.47881 14.415 9.61772V14.9553C14.415 15.0942 14.5276 15.2068 14.6666 15.2068H16.6786C16.5397 15.2068 16.4271 15.0942 16.4271 14.9553Z" fill="#D8ECFE"/>
|
||||
<path d="M23.718 15.573H14.6636C14.323 15.573 14.0459 15.2959 14.0459 14.9553V9.61772C14.0459 9.2771 14.323 9 14.6636 9H23.7253C24.0619 9 24.3356 9.27378 24.3356 9.61035V14.9553C24.3357 15.2959 24.0585 15.573 23.718 15.573ZM14.7783 14.8406H23.6032V9.73242H14.7783V14.8406Z" fill="#A79BA7"/>
|
||||
<path d="M9.88359 17.0653V16.6991H9.2311C9.01699 16.6991 8.84277 16.525 8.84277 16.3108V15.8078C8.84277 15.5937 9.01694 15.4194 9.2311 15.4194H9.88355V14.687H9.2311C8.61313 14.687 8.11035 15.1898 8.11035 15.8078V16.3108C8.11035 16.9288 8.61309 17.4315 9.2311 17.4315H9.92603C9.89858 17.3138 9.88359 17.1913 9.88359 17.0653Z" fill="#EAF6FF"/>
|
||||
<path d="M10.6568 18.4975H12.3349C12.8259 18.2091 13.1558 17.6759 13.1558 17.0653V14.9312C13.1558 14.7963 13.0465 14.687 12.9117 14.687H9.83594V17.0653C9.83594 17.6759 10.1658 18.2091 10.6568 18.4975Z" fill="#EAF6FF"/>
|
||||
<path d="M10.5784 18.4486H11.8378C11.3896 18.1515 11.0935 17.6434 11.0935 17.0653V14.687H9.83594V17.0653C9.83594 17.6428 10.131 18.1513 10.5784 18.4486Z" fill="#D8ECFE"/>
|
||||
<path d="M25.1787 17.1914H27.6977V18.449H25.1787V17.1914Z" fill="#FAC600"/>
|
||||
<path d="M27.9492 15.9326H25.4302C25.2913 15.9326 25.1787 16.0452 25.1787 16.1841V17.1902H27.6977V16.1841C27.6977 16.0452 27.8103 15.9326 27.9492 15.9326Z" fill="#FD544D"/>
|
||||
<path d="M32.7477 15.9338H26.2627V14.9278C26.2627 14.7889 26.3753 14.6763 26.5142 14.6763H32.7477C32.8866 14.6763 32.9992 14.7889 32.9992 14.9278V15.6823C32.9992 15.8212 32.8866 15.9338 32.7477 15.9338Z" fill="#00C27A"/>
|
||||
<path d="M28.6018 14.6763H26.5142C26.3753 14.6763 26.2627 14.7889 26.2627 14.9278V15.9338H28.3502V14.9278C28.3502 14.7889 28.4629 14.6763 28.6018 14.6763Z" fill="#09A755"/>
|
||||
<path d="M10.2637 19.7251H22.0313V24.6865H10.2637V19.7251Z" fill="#FFBD86"/>
|
||||
<path d="M10.3135 19.7734H11.5641V24.686H10.3135V19.7734Z" fill="#F6A96C"/>
|
||||
<path d="M21.9854 19.7241V22.5457L22.1291 22.5945H30.5894L30.7364 22.5457V19.7241H21.9854Z" fill="#EA9B58"/>
|
||||
<path d="M21.9854 19.7729H23.5196V22.5457H21.9854V19.7729Z" fill="#D88A55"/>
|
||||
<path d="M26.9885 21.519H25.6807C25.4784 21.519 25.3145 21.3551 25.3145 21.1528C25.3145 20.9506 25.4784 20.7866 25.6807 20.7866H26.9885C27.1908 20.7866 27.3547 20.9506 27.3547 21.1528C27.3547 21.3551 27.1908 21.519 26.9885 21.519Z" fill="#D88A55"/>
|
||||
<path d="M21.9854 22.5464V25.3191L22.0939 25.3679H30.6279L30.7364 25.3191V22.5464H21.9854Z" fill="#F6A96C"/>
|
||||
<path d="M21.9854 22.5464H23.5196V25.3191H21.9854V22.5464Z" fill="#EA9B58"/>
|
||||
<path d="M26.9885 24.291H25.6807C25.4784 24.291 25.3145 24.1271 25.3145 23.9248C25.3145 23.7226 25.4784 23.5586 25.6807 23.5586H26.9885C27.1908 23.5586 27.3547 23.7226 27.3547 23.9248C27.3547 24.1271 27.1908 24.291 26.9885 24.291Z" fill="#D88A55"/>
|
||||
<path d="M30.7364 25.3188H21.9854V28.7856C21.9854 28.9245 22.0979 29.0371 22.2369 29.0371H30.7364V25.3188Z" fill="#EA9B58"/>
|
||||
<path d="M23.5196 28.7856V25.3188H21.9854V28.7856C21.9854 28.9245 22.0979 29.0371 22.2369 29.0371H23.7711C23.6322 29.0371 23.5196 28.9245 23.5196 28.7856Z" fill="#D88A55"/>
|
||||
<path d="M26.9885 27.064H25.6807C25.4784 27.064 25.3145 26.9 25.3145 26.6978C25.3145 26.4955 25.4784 26.3315 25.6807 26.3315H26.9885C27.1908 26.3315 27.3547 26.4955 27.3547 26.6978C27.3547 26.9 27.1908 27.064 26.9885 27.064Z" fill="#D88A55"/>
|
||||
<path d="M8.80469 19.7251V30.773C8.80469 30.912 8.91729 31.0246 9.0562 31.0246H10.0623C10.2012 31.0246 10.3138 30.912 10.3138 30.773V19.7251H8.80469Z" fill="#A79BA7"/>
|
||||
<path d="M9.4647 30.773V19.7251H8.80469V30.773C8.80469 30.912 8.91729 31.0246 9.0562 31.0246H9.71621C9.5773 31.0246 9.4647 30.912 9.4647 30.773Z" fill="#918291"/>
|
||||
<path d="M30.6875 19.7251V30.773C30.6875 30.912 30.8001 31.0246 30.939 31.0246H31.9451C32.084 31.0246 32.1966 30.912 32.1966 30.773V19.7251H30.6875Z" fill="#A79BA7"/>
|
||||
<path d="M31.3475 30.773V19.7251H30.6875V30.773C30.6875 30.912 30.8001 31.0246 30.939 31.0246H31.599C31.4601 31.0246 31.3475 30.912 31.3475 30.773Z" fill="#918291"/>
|
||||
<path d="M32.7485 18.4487H8.25151C8.1126 18.4487 8 18.5613 8 18.7002V19.522C8 19.6609 8.1126 19.7735 8.25151 19.7735H32.7485C32.8874 19.7735 33 19.6609 33 19.522V18.7002C33 18.5613 32.8874 18.4487 32.7485 18.4487Z" fill="#F6A96C"/>
|
||||
<path d="M11.418 19.522V18.7002C11.418 18.5613 11.5306 18.4487 11.6695 18.4487H8.25151C8.1126 18.4487 8 18.5613 8 18.7002V19.522C8 19.6609 8.1126 19.7735 8.25151 19.7735H11.6695C11.5306 19.7735 11.418 19.6609 11.418 19.522Z" fill="#EA9B58"/>
|
||||
<path d="M22.3078 11.3062H18.5352C18.3329 11.3062 18.1689 11.1422 18.1689 10.9399C18.1689 10.7377 18.3329 10.5737 18.5352 10.5737H22.3078C22.5101 10.5737 22.674 10.7377 22.674 10.9399C22.674 11.1422 22.5101 11.3062 22.3078 11.3062Z" fill="#0593FC"/>
|
||||
<path d="M17.3792 11.3057H16.0713C15.869 11.3057 15.7051 11.1417 15.7051 10.9395C15.7051 10.7372 15.869 10.5732 16.0713 10.5732H17.3792C17.5814 10.5732 17.7454 10.7372 17.7454 10.9395C17.7454 11.1417 17.5814 11.3057 17.3792 11.3057Z" fill="#0593FC"/>
|
||||
<path d="M22.3078 12.6147H21.1006C20.8983 12.6147 20.7344 12.4508 20.7344 12.2485C20.7344 12.0463 20.8983 11.8823 21.1006 11.8823H22.3078C22.5101 11.8823 22.674 12.0463 22.674 12.2485C22.674 12.4508 22.5101 12.6147 22.3078 12.6147Z" fill="#0593FC"/>
|
||||
<path d="M19.7936 12.6143H16.0713C15.869 12.6143 15.7051 12.4503 15.7051 12.248C15.7051 12.0458 15.869 11.8818 16.0713 11.8818H19.7936C19.9959 11.8818 20.1598 12.0458 20.1598 12.248C20.1598 12.4503 19.9959 12.6143 19.7936 12.6143Z" fill="#0593FC"/>
|
||||
<path d="M18.2846 13.9224H16.0713C15.869 13.9224 15.7051 13.7584 15.7051 13.5562C15.7051 13.3539 15.869 13.1899 16.0713 13.1899H18.2846C18.4868 13.1899 18.6508 13.3539 18.6508 13.5562C18.6508 13.7584 18.4868 13.9224 18.2846 13.9224Z" fill="#0593FC"/>
|
||||
<svg width="25" height="23" viewBox="0 0 25 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M23.9152 9.49653V6.93262H17.4302C17.2913 6.93262 17.1787 7.04521 17.1787 7.18413V9.49653H23.9152Z" fill="#FED402"/>
|
||||
<path d="M23.7237 6.88413H18.3818L18.2641 6.93296H17.4302C17.2913 6.93296 17.1787 7.04556 17.1787 7.18447V8.19053H23.9152V6.93296L23.7514 6.88135C23.7422 6.88257 23.7332 6.88413 23.7237 6.88413Z" fill="#FE6C55"/>
|
||||
<path d="M10.4375 6.52441H11.9465V8.08906H10.4375V6.52441Z" fill="#918291"/>
|
||||
<path d="M13.959 9.49687V8.79409C13.959 8.37739 13.6212 8.03955 13.2044 8.03955H9.18032C8.76362 8.03955 8.42578 8.37734 8.42578 8.79409V9.49687H13.959Z" fill="#A79BA7"/>
|
||||
<path d="M10.0266 9.448V8.79409C10.0266 8.37739 10.3644 8.03955 10.7812 8.03955H9.18032C8.76362 8.03955 8.42578 8.37734 8.42578 8.79409V9.448H10.0266Z" fill="#918291"/>
|
||||
<path d="M15.7282 6.20679H6.65918C6.52437 6.20679 6.41504 6.09746 6.41504 5.96265V0.610352C6.41504 0.475537 6.52437 0.366211 6.65918 0.366211H15.7282C15.863 0.366211 15.9724 0.475537 15.9724 0.610352V5.96265C15.9724 6.09751 15.8631 6.20679 15.7282 6.20679Z" fill="#EAF6FF"/>
|
||||
<path d="M8.4271 5.95527V0.617725C8.4271 0.478809 8.5397 0.366211 8.67861 0.366211H6.66655C6.52764 0.366211 6.41504 0.478809 6.41504 0.617725V5.95532C6.41504 6.09424 6.52764 6.20684 6.66655 6.20684H8.67861C8.5397 6.20679 8.4271 6.09419 8.4271 5.95527Z" fill="#D8ECFE"/>
|
||||
<path d="M15.718 6.573H6.66362C6.323 6.573 6.0459 6.2959 6.0459 5.95527V0.617724C6.0459 0.2771 6.323 0 6.66362 0H15.7253C16.0619 0 16.3356 0.273779 16.3356 0.610351V5.95527C16.3357 6.2959 16.0585 6.573 15.718 6.573ZM6.77832 5.84058H15.6032V0.732422H6.77832V5.84058Z" fill="#A79BA7"/>
|
||||
<path d="M1.88359 8.06533V7.69912H1.2311C1.01699 7.69912 0.842773 7.52495 0.842773 7.31079V6.80776C0.842773 6.59365 1.01694 6.41943 1.2311 6.41943H1.88355V5.68701H1.2311C0.613135 5.68701 0.110352 6.1898 0.110352 6.80776V7.31079C0.110352 7.92876 0.613086 8.43154 1.2311 8.43154H1.92603C1.89858 8.31377 1.88359 8.19131 1.88359 8.06533Z" fill="#EAF6FF"/>
|
||||
<path d="M2.65684 9.49746H4.33486C4.82593 9.20913 5.15581 8.67593 5.15581 8.06533V5.93115C5.15581 5.79634 5.04648 5.68701 4.91167 5.68701H1.83594V8.06533C1.83594 8.67593 2.16582 9.20913 2.65684 9.49746Z" fill="#EAF6FF"/>
|
||||
<path d="M2.57842 9.44863H3.83784C3.3896 9.15146 3.09346 8.64341 3.09346 8.06533V5.68701H1.83594V8.06533C1.83594 8.64282 2.13101 9.15127 2.57842 9.44863Z" fill="#D8ECFE"/>
|
||||
<path d="M17.1787 8.19141H19.6977V9.44897H17.1787V8.19141Z" fill="#FAC600"/>
|
||||
<path d="M19.9492 6.93262H17.4302C17.2913 6.93262 17.1787 7.04521 17.1787 7.18413V8.19019H19.6977V7.18413C19.6977 7.04521 19.8103 6.93262 19.9492 6.93262Z" fill="#FD544D"/>
|
||||
<path d="M24.7477 6.93384H18.2627V5.92778C18.2627 5.78887 18.3753 5.67627 18.5142 5.67627H24.7477C24.8866 5.67627 24.9992 5.78887 24.9992 5.92778V6.68232C24.9992 6.82124 24.8866 6.93384 24.7477 6.93384Z" fill="#00C27A"/>
|
||||
<path d="M20.6018 5.67627H18.5142C18.3753 5.67627 18.2627 5.78887 18.2627 5.92778V6.93384H20.3502V5.92778C20.3502 5.78887 20.4629 5.67627 20.6018 5.67627Z" fill="#09A755"/>
|
||||
<path d="M2.26367 10.7251H14.0313V15.6865H2.26367V10.7251Z" fill="#FFBD86"/>
|
||||
<path d="M2.31348 10.7734H3.56406V15.686H2.31348V10.7734Z" fill="#F6A96C"/>
|
||||
<path d="M13.9854 10.7241V13.5457L14.1291 13.5945H22.5894L22.7364 13.5457V10.7241H13.9854Z" fill="#EA9B58"/>
|
||||
<path d="M13.9854 10.7729H15.5196V13.5457H13.9854V10.7729Z" fill="#D88A55"/>
|
||||
<path d="M18.9885 12.519H17.6807C17.4784 12.519 17.3145 12.3551 17.3145 12.1528C17.3145 11.9506 17.4784 11.7866 17.6807 11.7866H18.9885C19.1908 11.7866 19.3547 11.9506 19.3547 12.1528C19.3547 12.3551 19.1908 12.519 18.9885 12.519Z" fill="#D88A55"/>
|
||||
<path d="M13.9854 13.5464V16.3191L14.0939 16.3679H22.6279L22.7364 16.3191V13.5464H13.9854Z" fill="#F6A96C"/>
|
||||
<path d="M13.9854 13.5464H15.5196V16.3191H13.9854V13.5464Z" fill="#EA9B58"/>
|
||||
<path d="M18.9885 15.291H17.6807C17.4784 15.291 17.3145 15.1271 17.3145 14.9248C17.3145 14.7226 17.4784 14.5586 17.6807 14.5586H18.9885C19.1908 14.5586 19.3547 14.7226 19.3547 14.9248C19.3547 15.1271 19.1908 15.291 18.9885 15.291Z" fill="#D88A55"/>
|
||||
<path d="M22.7364 16.3188H13.9854V19.7856C13.9854 19.9245 14.0979 20.0371 14.2369 20.0371H22.7364V16.3188Z" fill="#EA9B58"/>
|
||||
<path d="M15.5196 19.7856V16.3188H13.9854V19.7856C13.9854 19.9245 14.0979 20.0371 14.2369 20.0371H15.7711C15.6322 20.0371 15.5196 19.9245 15.5196 19.7856Z" fill="#D88A55"/>
|
||||
<path d="M18.9885 18.064H17.6807C17.4784 18.064 17.3145 17.9 17.3145 17.6978C17.3145 17.4955 17.4784 17.3315 17.6807 17.3315H18.9885C19.1908 17.3315 19.3547 17.4955 19.3547 17.6978C19.3547 17.9 19.1908 18.064 18.9885 18.064Z" fill="#D88A55"/>
|
||||
<path d="M0.804688 10.7251V21.773C0.804688 21.912 0.917285 22.0246 1.0562 22.0246H2.06226C2.20117 22.0246 2.31377 21.912 2.31377 21.773V10.7251H0.804688Z" fill="#A79BA7"/>
|
||||
<path d="M1.4647 21.773V10.7251H0.804688V21.773C0.804688 21.912 0.917285 22.0246 1.0562 22.0246H1.71621C1.5773 22.0246 1.4647 21.912 1.4647 21.773Z" fill="#918291"/>
|
||||
<path d="M22.6875 10.7251V21.773C22.6875 21.912 22.8001 22.0246 22.939 22.0246H23.9451C24.084 22.0246 24.1966 21.912 24.1966 21.773V10.7251H22.6875Z" fill="#A79BA7"/>
|
||||
<path d="M23.3475 21.773V10.7251H22.6875V21.773C22.6875 21.912 22.8001 22.0246 22.939 22.0246H23.599C23.4601 22.0246 23.3475 21.912 23.3475 21.773Z" fill="#918291"/>
|
||||
<path d="M24.7485 9.44873H0.251514C0.112598 9.44873 0 9.56133 0 9.70024V10.522C0 10.6609 0.112598 10.7735 0.251514 10.7735H24.7485C24.8874 10.7735 25 10.6609 25 10.522V9.70024C25 9.56133 24.8874 9.44873 24.7485 9.44873Z" fill="#F6A96C"/>
|
||||
<path d="M3.41797 10.522V9.70024C3.41797 9.56133 3.53057 9.44873 3.66948 9.44873H0.251514C0.112598 9.44873 0 9.56133 0 9.70024V10.522C0 10.6609 0.112598 10.7735 0.251514 10.7735H3.66948C3.53057 10.7735 3.41797 10.6609 3.41797 10.522Z" fill="#EA9B58"/>
|
||||
<path d="M14.3078 2.30615H10.5352C10.3329 2.30615 10.1689 2.14219 10.1689 1.93994C10.1689 1.7377 10.3329 1.57373 10.5352 1.57373H14.3078C14.5101 1.57373 14.674 1.7377 14.674 1.93994C14.674 2.14219 14.5101 2.30615 14.3078 2.30615Z" fill="#0593FC"/>
|
||||
<path d="M9.37915 2.30566H8.07129C7.86904 2.30566 7.70508 2.1417 7.70508 1.93945C7.70508 1.73721 7.86904 1.57324 8.07129 1.57324H9.37915C9.5814 1.57324 9.74536 1.73721 9.74536 1.93945C9.74536 2.1417 9.5814 2.30566 9.37915 2.30566Z" fill="#0593FC"/>
|
||||
<path d="M14.3078 3.61475H13.1006C12.8983 3.61475 12.7344 3.45078 12.7344 3.24854C12.7344 3.04629 12.8983 2.88232 13.1006 2.88232H14.3078C14.5101 2.88232 14.674 3.04629 14.674 3.24854C14.674 3.45078 14.5101 3.61475 14.3078 3.61475Z" fill="#0593FC"/>
|
||||
<path d="M11.7936 3.61426H8.07129C7.86904 3.61426 7.70508 3.45029 7.70508 3.24805C7.70508 3.0458 7.86904 2.88184 8.07129 2.88184H11.7936C11.9959 2.88184 12.1598 3.0458 12.1598 3.24805C12.1598 3.45029 11.9959 3.61426 11.7936 3.61426Z" fill="#0593FC"/>
|
||||
<path d="M10.2846 4.92236H8.07129C7.86904 4.92236 7.70508 4.7584 7.70508 4.55615C7.70508 4.35391 7.86904 4.18994 8.07129 4.18994H10.2846C10.4868 4.18994 10.6508 4.35391 10.6508 4.55615C10.6508 4.7584 10.4868 4.92236 10.2846 4.92236Z" fill="#0593FC"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
@ -1,30 +1,29 @@
|
||||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="20" cy="20" r="20" fill="#D5D5D5" fill-opacity="0.6"/>
|
||||
<path d="M17.0582 18.9595C16.9067 18.9265 16.7389 18.9087 16.5551 18.9087H11.0202C10.0388 18.9087 9.51074 19.4155 9.51074 20.0408V23.9798L17.5614 24.483L17.0582 18.9595Z" fill="#D273B3"/>
|
||||
<path d="M18.0646 20.0403C18.0646 19.5321 17.7158 19.1022 17.0582 18.959V23.602C17.0582 23.8104 16.8893 23.9793 16.6809 23.9793H12.0266C12.0266 23.4711 11.588 23.0412 10.9305 22.898V23.9793H9.51074V25.659H18.5677C18.5677 25.659 18.0646 20.6656 18.0646 20.0403Z" fill="#CA59A6"/>
|
||||
<path d="M26.1152 14.38L25.6121 9H9.88812C9.67971 9 9.51074 9.16896 9.51074 9.37738V14.38H26.1152Z" fill="#FFE07D"/>
|
||||
<path d="M25.6104 9V14.38H26.1135L26.6167 10.5095V9.37738C26.6167 9.16896 26.4477 9 26.2393 9H25.6104Z" fill="#FFC250"/>
|
||||
<path d="M25.6121 11.0786C24.0781 11.991 23.0219 12.8197 23.0219 12.8197C23.0219 12.8197 21.1458 11.572 19.989 11.572C17.7635 11.572 16.0629 14.3795 9.51074 14.3795V14.8827L26.1152 15.3859L25.6121 11.0786Z" fill="#FFF0AF"/>
|
||||
<path d="M25.2347 14.8834H9.51074V15.5124C9.51074 15.7208 9.67971 15.8897 9.88812 15.8897H26.241C26.4495 15.8897 26.6184 15.7208 26.6184 15.5124V10.5098C26.2658 10.6989 25.929 10.8908 25.6121 11.0794V14.5061C25.6121 14.7144 25.4431 14.8834 25.2347 14.8834Z" fill="#FFE07D"/>
|
||||
<path d="M25.611 18.9595C25.4595 18.9265 25.2916 18.9087 25.1078 18.9087H19.573C18.5915 18.9087 18.0635 19.4155 18.0635 20.0408V23.9798L26.1141 24.483L25.611 18.9595Z" fill="#D273B3"/>
|
||||
<path d="M25.611 18.959V23.602C25.611 23.8104 25.442 23.9793 25.2336 23.9793H18.0635V25.659H26.6173C26.6173 25.659 26.6173 20.6656 26.6173 20.0403C26.6173 19.5321 26.2685 19.1022 25.611 18.959Z" fill="#CA59A6"/>
|
||||
<path d="M24.1014 25.489L22.5836 24.9858H18.9613C18.3775 24.9858 18.0635 25.2873 18.0635 25.6592V25.9922L26.1147 26.4953L24.1014 25.489Z" fill="#DA8BC1"/>
|
||||
<path d="M24.1015 25.4888V25.6146C24.1015 25.823 23.9325 25.9919 23.7241 25.9919H18.0635V27.5014H26.6173V25.4888H24.1015Z" fill="#D273B3"/>
|
||||
<path d="M17.0573 24.9858H12.0256L11.5225 26.4953H17.5605L17.0573 24.9858Z" fill="#DA8BC1"/>
|
||||
<path d="M18.0646 25.6592C18.0646 25.2873 17.7505 24.9858 17.1668 24.9858H17.0582V25.6148C17.0582 25.8232 16.8893 25.9922 16.6809 25.9922H12.0266V24.9858H9.51074V27.5017H18.5677C18.5677 27.5017 18.0646 26.0311 18.0646 25.6592Z" fill="#D273B3"/>
|
||||
<path d="M27.1203 21.9785C26.9688 21.9455 26.801 21.9277 26.6172 21.9277C25.6357 21.9277 25.1077 22.4346 25.1077 23.0599V27.2504H11.019L10.0127 21.9785C9.86116 21.9455 9.69331 21.9277 9.5095 21.9277C8.52802 21.9277 8 22.4346 8 23.0599V28.5084L27.6235 29.0115L27.1203 21.9785Z" fill="#DA8BC1"/>
|
||||
<path d="M11.02 27.25C11.02 27.25 11.02 23.6847 11.02 23.0594C11.02 22.5512 10.6712 22.1212 10.0137 21.978V26.9984L11.02 27.25Z" fill="#DA8BC1"/>
|
||||
<path d="M27.1203 21.978V28.1305C27.1203 28.3389 26.9514 28.5079 26.743 28.5079H8V29.1368C8 29.3452 8.16896 29.5142 8.37738 29.5142H27.7493C27.9577 29.5142 28.1267 29.3452 28.1267 29.1368V23.0594C28.1267 22.5512 27.7779 22.1212 27.1203 21.978Z" fill="#D273B3"/>
|
||||
<path d="M18.2412 29.0115C16.7317 29.0115 14.0388 29.0115 12.5293 29.0115C11.0198 29.0115 10.5166 28.4172 10.5166 28.0051C10.5166 27.7272 10.7419 27.502 11.0198 27.502H19.7507C20.0286 27.502 20.2539 27.7272 20.2539 28.0051C20.2539 28.4172 19.7507 29.0115 18.2412 29.0115Z" fill="#D273B3"/>
|
||||
<path d="M28.1267 27.25H22.4951C23.2643 28.2151 24.9145 28.8487 26.8263 28.8487C27.277 28.8487 27.7132 28.8116 28.1267 28.7422V27.25Z" fill="#D273B3"/>
|
||||
<path d="M11.9093 27.1172L10.921 30.2378C10.8581 30.4365 10.9682 30.6486 11.1669 30.7115C11.3656 30.7745 11.5777 30.6644 11.6406 30.4657L12.6288 27.345L11.9093 27.1172Z" fill="#DCE6EB"/>
|
||||
<path d="M17.1338 27.345L18.1221 30.4657C18.185 30.6644 18.3971 30.7744 18.5957 30.7115C18.7944 30.6486 18.9045 30.4365 18.8416 30.2378L17.8533 27.1172L17.1338 27.345Z" fill="#DCE6EB"/>
|
||||
<path d="M19.2477 26.4956H10.5168C10.2389 26.4956 10.0137 26.7209 10.0137 26.9988C10.0137 27.0778 10.0323 27.1635 10.0729 27.2504C10.0729 27.2504 15.8957 27.6026 17.3861 27.6026C18.8955 27.6026 19.2477 26.4956 19.2477 26.4956Z" fill="#E0BBA4"/>
|
||||
<path d="M19.2481 26.4956C19.2481 26.4956 18.8959 27.2504 17.3864 27.2504C15.8961 27.2504 11.634 27.2504 10.0732 27.2504C10.2441 27.6168 10.8066 28.0051 12.0267 28.0051H17.7386C17.7386 28.0051 19.7513 27.4108 19.7513 26.9988C19.7513 26.7209 19.526 26.4956 19.2481 26.4956Z" fill="#CF9875"/>
|
||||
<path d="M23.9337 27.1172L22.9455 30.2378C22.8825 30.4365 22.9926 30.6486 23.1913 30.7115C23.39 30.7745 23.6021 30.6644 23.665 30.4657L24.6533 27.345L23.9337 27.1172Z" fill="#DCE6EB"/>
|
||||
<path d="M29.2432 26.5306L30.4893 30.4653C30.5522 30.664 30.7643 30.774 30.9629 30.7111C31.1616 30.6482 31.2717 30.4361 31.2088 30.2374L29.9627 26.3027L29.2432 26.5306Z" fill="#DCE6EB"/>
|
||||
<path d="M29.3791 25.4893L31.786 16.4072C31.2671 16.4685 30.8111 16.7947 30.5903 17.2776L27.6694 23.6637C27.3009 24.4694 26.4963 24.9862 25.6104 24.9862L29.3791 25.4893Z" fill="#FFE07D"/>
|
||||
<path d="M32.2456 16.3955H31.9652C31.9054 16.3955 31.8465 16.3999 31.7881 16.4068L28.6881 23.1845C28.3144 24.0017 28.1277 24.4717 27.4238 24.9857L29.3812 25.4889L32.7274 16.5699C32.5968 16.4612 32.4291 16.3955 32.2456 16.3955Z" fill="#FFC250"/>
|
||||
<path d="M29.4367 26.4869C30.9619 25.5631 32.1083 22.6303 32.1083 17.9209L29.4815 23.6639C29.113 24.4697 28.3084 24.9864 27.4224 24.9864C27.0923 24.9864 25.611 24.9864 25.611 24.9864H22.583C21.9515 24.9864 21.5979 25.7167 21.9916 26.2106C22.5624 26.7568 24.1091 27.3398 26.0209 27.3398C27.3581 27.3398 28.5673 27.0134 29.4367 26.4869Z" fill="#E0BBA4"/>
|
||||
<path d="M32.7265 16.5698L32.1089 17.9202C31.7576 22.438 30.4593 25.0592 28.9341 25.983C28.0648 26.5095 26.8555 26.8359 25.5183 26.8359C23.6065 26.8359 22.4859 26.4952 21.9922 26.2099C22.7613 27.175 24.4116 27.8423 26.3234 27.8423C27.6606 27.8423 28.8699 27.5158 29.7392 26.9893C31.4525 25.9516 32.8794 22.7722 32.9994 17.1686C33.0045 16.9283 32.8974 16.7121 32.7265 16.5698Z" fill="#CF9875"/>
|
||||
<svg width="25" height="22" viewBox="0 0 25 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9.05824 9.95946C8.90674 9.92645 8.73888 9.90869 8.55508 9.90869H3.02024C2.03877 9.90869 1.51074 10.4155 1.51074 11.0408V14.9798L9.56141 15.483L9.05824 9.95946Z" fill="#D273B3"/>
|
||||
<path d="M10.0646 11.0403C10.0646 10.5321 9.71578 10.1022 9.05824 9.95898V14.602C9.05824 14.8104 8.88928 14.9793 8.68087 14.9793H4.02658C4.02658 14.4711 3.58802 14.0412 2.93048 13.898V14.9793H1.51074V16.659H10.5677C10.5677 16.659 10.0646 11.6656 10.0646 11.0403Z" fill="#CA59A6"/>
|
||||
<path d="M18.1152 5.37996L17.6121 0H1.88812C1.67971 0 1.51074 0.168963 1.51074 0.377375V5.37996H18.1152Z" fill="#FFE07D"/>
|
||||
<path d="M17.6104 0V5.37996H18.1135L18.6167 1.5095V0.377375C18.6167 0.168963 18.4477 0 18.2393 0H17.6104Z" fill="#FFC250"/>
|
||||
<path d="M17.6121 2.07861C16.0781 2.99101 15.0219 3.81972 15.0219 3.81972C15.0219 3.81972 13.1458 2.57202 11.989 2.57202C9.76353 2.57202 8.06293 5.37954 1.51074 5.37954V5.88271L18.1152 6.38587L17.6121 2.07861Z" fill="#FFF0AF"/>
|
||||
<path d="M17.2347 5.88339H1.51074V6.51235C1.51074 6.72076 1.67971 6.88973 1.88812 6.88973H18.241C18.4495 6.88973 18.6184 6.72076 18.6184 6.51235V1.50977C18.2658 1.69886 17.929 1.89081 17.6121 2.07935V5.50607C17.6121 5.71443 17.4431 5.88339 17.2347 5.88339Z" fill="#FFE07D"/>
|
||||
<path d="M17.611 9.95946C17.4595 9.92645 17.2916 9.90869 17.1078 9.90869H11.573C10.5915 9.90869 10.0635 10.4155 10.0635 11.0408V14.9798L18.1141 15.483L17.611 9.95946Z" fill="#D273B3"/>
|
||||
<path d="M17.611 9.95898V14.602C17.611 14.8104 17.442 14.9793 17.2336 14.9793H10.0635V16.659H18.6173C18.6173 16.659 18.6173 11.6656 18.6173 11.0403C18.6173 10.5321 18.2685 10.1022 17.611 9.95898Z" fill="#CA59A6"/>
|
||||
<path d="M16.1014 16.489L14.5836 15.9858H10.9613C10.3775 15.9858 10.0635 16.2873 10.0635 16.6592V16.9922L18.1147 17.4953L16.1014 16.489Z" fill="#DA8BC1"/>
|
||||
<path d="M16.1015 16.4888V16.6146C16.1015 16.823 15.9325 16.9919 15.7241 16.9919H10.0635V18.5014H18.6173V16.4888H16.1015Z" fill="#D273B3"/>
|
||||
<path d="M9.0573 15.9858H4.02563L3.52246 17.4953H9.56046L9.0573 15.9858Z" fill="#DA8BC1"/>
|
||||
<path d="M10.0646 16.6592C10.0646 16.2873 9.7505 15.9858 9.16678 15.9858H9.05824V16.6148C9.05824 16.8232 8.88928 16.9922 8.68087 16.9922H4.02658V15.9858H1.51074V18.5017H10.5677C10.5677 18.5017 10.0646 17.0311 10.0646 16.6592Z" fill="#D273B3"/>
|
||||
<path d="M19.1203 12.9785C18.9688 12.9455 18.801 12.9277 18.6172 12.9277C17.6357 12.9277 17.1077 13.4346 17.1077 14.0599V18.2504H3.019L2.01267 12.9785C1.86116 12.9455 1.69331 12.9277 1.5095 12.9277C0.528023 12.9277 0 13.4346 0 14.0599V19.5084L19.6235 20.0115L19.1203 12.9785Z" fill="#DA8BC1"/>
|
||||
<path d="M3.02001 18.25C3.02001 18.25 3.02001 14.6847 3.02001 14.0594C3.02001 13.5512 2.67121 13.1212 2.01367 12.978V17.9984L3.02001 18.25Z" fill="#DA8BC1"/>
|
||||
<path d="M19.1203 12.978V19.1305C19.1203 19.3389 18.9514 19.5079 18.743 19.5079H0V20.1368C0 20.3452 0.168963 20.5142 0.377375 20.5142H19.7493C19.9577 20.5142 20.1267 20.3452 20.1267 20.1368V14.0594C20.1267 13.5512 19.7779 13.1212 19.1203 12.978Z" fill="#D273B3"/>
|
||||
<path d="M10.2412 20.0115C8.73172 20.0115 6.03877 20.0115 4.52927 20.0115C3.01977 20.0115 2.5166 19.4172 2.5166 19.0051C2.5166 18.7272 2.74187 18.502 3.01977 18.502H11.7507C12.0286 18.502 12.2539 18.7272 12.2539 19.0051C12.2539 19.4172 11.7507 20.0115 10.2412 20.0115Z" fill="#D273B3"/>
|
||||
<path d="M20.1267 18.25H14.4951C15.2643 19.2151 16.9145 19.8487 18.8263 19.8487C19.277 19.8487 19.7132 19.8116 20.1267 19.7422V18.25Z" fill="#D273B3"/>
|
||||
<path d="M3.90931 18.1172L2.92104 21.2378C2.85809 21.4365 2.96819 21.6486 3.16689 21.7115C3.36559 21.7745 3.57767 21.6644 3.64057 21.4657L4.62884 18.345L3.90931 18.1172Z" fill="#DCE6EB"/>
|
||||
<path d="M9.13379 18.345L10.1221 21.4657C10.185 21.6644 10.3971 21.7744 10.5957 21.7115C10.7944 21.6486 10.9045 21.4365 10.8416 21.2378L9.85332 18.1172L9.13379 18.345Z" fill="#DCE6EB"/>
|
||||
<path d="M11.2477 17.4956H2.51684C2.23894 17.4956 2.01367 17.7209 2.01367 17.9988C2.01367 18.0778 2.03234 18.1635 2.07289 18.2504C2.07289 18.2504 7.89574 18.6026 9.38607 18.6026C10.8955 18.6026 11.2477 17.4956 11.2477 17.4956Z" fill="#E0BBA4"/>
|
||||
<path d="M11.2481 17.4956C11.2481 17.4956 10.8959 18.2504 9.38642 18.2504C7.89609 18.2504 3.63402 18.2504 2.07324 18.2504C2.24412 18.6168 2.80656 19.0051 4.02669 19.0051H9.73859C9.73859 19.0051 11.7513 18.4108 11.7513 17.9988C11.7513 17.7209 11.526 17.4956 11.2481 17.4956Z" fill="#CF9875"/>
|
||||
<path d="M15.9337 18.1172L14.9455 21.2378C14.8825 21.4365 14.9926 21.6486 15.1913 21.7115C15.39 21.7745 15.6021 21.6644 15.665 21.4657L16.6533 18.345L15.9337 18.1172Z" fill="#DCE6EB"/>
|
||||
<path d="M21.2432 17.5306L22.4893 21.4653C22.5522 21.664 22.7643 21.774 22.9629 21.7111C23.1616 21.6482 23.2717 21.4361 23.2088 21.2374L21.9627 17.3027L21.2432 17.5306Z" fill="#DCE6EB"/>
|
||||
<path d="M21.3791 16.4893L23.786 7.40723C23.2671 7.46846 22.8111 7.79472 22.5903 8.27755L19.6694 14.6637C19.3009 15.4694 18.4963 15.9862 17.6104 15.9862L21.3791 16.4893Z" fill="#FFE07D"/>
|
||||
<path d="M24.2456 7.39551H23.9652C23.9054 7.39551 23.8465 7.39994 23.7881 7.40683L20.6881 14.1845C20.3144 15.0017 20.1277 15.4717 19.4238 15.9857L21.3812 16.4889L24.7274 7.56985C24.5968 7.46117 24.4291 7.39551 24.2456 7.39551Z" fill="#FFC250"/>
|
||||
<path d="M21.4367 17.4869C22.9619 16.5631 24.1083 13.6303 24.1083 8.9209L21.4815 14.6639C21.113 15.4697 20.3084 15.9864 19.4224 15.9864C19.0923 15.9864 17.611 15.9864 17.611 15.9864H14.583C13.9515 15.9864 13.5979 16.7167 13.9916 17.2106C14.5624 17.7568 16.1091 18.3398 18.0209 18.3398C19.3581 18.3398 20.5673 18.0134 21.4367 17.4869Z" fill="#E0BBA4"/>
|
||||
<path d="M24.7265 7.56982L24.1089 8.92017C23.7576 13.438 22.4593 16.0592 20.9341 16.983C20.0648 17.5095 18.8555 17.8359 17.5183 17.8359C15.6065 17.8359 14.4859 17.4952 13.9922 17.2099C14.7613 18.175 16.4116 18.8423 18.3234 18.8423C19.6606 18.8423 20.8699 18.5158 21.7392 17.9893C23.4525 16.9516 24.8794 13.7722 24.9994 8.16859C25.0045 7.92828 24.8974 7.71212 24.7265 7.56982Z" fill="#CF9875"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.8 KiB |
5
assets/icons/unlock_ic.svg
Normal file
@ -0,0 +1,5 @@
|
||||
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M15.0004 0C9.02035 0.00734375 4.17434 4.85328 4.16699 10.8334V17.5C4.16699 17.9602 4.54012 18.3334 5.00035 18.3334H8.33371C8.79395 18.3334 9.16707 17.9602 9.16707 17.5V10.8334C9.16699 7.61164 11.7787 5 15.0004 5C18.222 5 20.8337 7.61164 20.8337 10.8334V11.6666C20.8337 12.1269 21.2068 12.5 21.6671 12.5H25.0004C25.4606 12.5 25.8337 12.1269 25.8337 11.6666V10.8334C25.8264 4.85328 20.9804 0.00734375 15.0004 0Z" fill="#455A64"/>
|
||||
<path d="M5.00014 16.6666H25.0001C27.3013 16.6666 29.1668 18.5321 29.1668 20.8333V35.8333C29.1668 38.1345 27.3013 40 25.0001 40H5.00014C2.69897 40 0.833496 38.1345 0.833496 35.8333V20.8333C0.833496 18.5321 2.69897 16.6666 5.00014 16.6666Z" fill="#2F66D3"/>
|
||||
<path d="M19.1668 25.8333C19.1765 23.5321 17.3189 21.6588 15.0178 21.6491C12.7166 21.6394 10.8432 23.497 10.8335 25.7981C10.8268 27.3888 11.7263 28.8444 13.1518 29.5499L12.5085 34.0499C12.444 34.5056 12.7612 34.9273 13.2169 34.9917C13.2555 34.9972 13.2945 34.9999 13.3335 34.9999H16.6668C17.127 35.0046 17.5039 34.6353 17.5085 34.1751C17.5089 34.1327 17.5062 34.0903 17.5001 34.0483L16.8567 29.5483C18.2649 28.8436 19.1577 27.4078 19.1668 25.8333Z" fill="white"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
17
assets/images/curtain.svg
Normal file
@ -0,0 +1,17 @@
|
||||
<svg width="36" height="35" viewBox="0 0 36 35" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M17.768 0.417969H0.825168C0.825168 0.417969 0.398459 11.6714 1.87939 17.9772V17.98H1.8766C0.705244 20.8163 0.515595 34.4599 0.981349 34.6189C1.76504 34.8866 3.07864 35.3077 4.21932 34.5045C4.77432 35.1292 7.28717 35.238 7.40151 34.393C9.0693 35.1794 10.2909 34.895 10.2602 34.3957C9.71355 25.4488 7.11146 19.0091 7.11146 19.0091C7.11146 19.0091 16.6999 12.2877 17.768 0.417969Z" fill="#448CF2"/>
|
||||
<path d="M33.66 17.98H33.6572V17.9772C35.1381 11.6714 34.7114 0.417969 34.7114 0.417969H17.7686C18.8367 12.2877 28.4251 19.0091 28.4251 19.0091C28.4251 19.0091 25.823 25.4488 25.2764 34.3957C25.2457 34.895 26.4673 35.1794 28.1351 34.393C28.2494 35.238 30.7623 35.1292 31.3173 34.5045C32.458 35.3077 33.7716 34.8866 34.5552 34.6189C35.021 34.4599 34.8314 20.8163 33.66 17.98Z" fill="#448CF2"/>
|
||||
<path d="M6.84854 27.4424C6.7382 27.4534 6.63674 27.5078 6.56646 27.5935C6.49617 27.6793 6.46281 27.7894 6.47371 27.8998C6.85579 31.7307 6.98129 34.3858 6.98269 34.4123C6.98764 34.5199 7.0339 34.6214 7.11182 34.6957C7.18974 34.7701 7.29334 34.8115 7.40103 34.8114H7.42055C7.47546 34.8089 7.52934 34.7956 7.5791 34.7722C7.62887 34.7489 7.67355 34.716 7.71058 34.6754C7.74762 34.6348 7.77629 34.5872 7.79496 34.5355C7.81363 34.4838 7.82192 34.429 7.81937 34.3741C7.81937 34.3476 7.69164 31.6718 7.30732 27.8178C7.30235 27.7628 7.28647 27.7094 7.26061 27.6606C7.23475 27.6119 7.19943 27.5688 7.15671 27.5338C7.114 27.4989 7.06474 27.4728 7.01183 27.4571C6.95892 27.4414 6.90341 27.4364 6.84854 27.4424Z" fill="#2F66D3"/>
|
||||
<path d="M7.62658 18.5951C7.46284 18.6037 7.29874 18.6024 7.13516 18.5912C6.90926 18.579 6.64012 18.5522 6.34171 18.5143C6.32694 18.5126 6.31292 18.5069 6.30125 18.4977C6.28959 18.4885 6.28075 18.4762 6.27575 18.4622C6.27075 18.4482 6.26978 18.4331 6.27296 18.4186C6.27614 18.404 6.28334 18.3907 6.29374 18.3801C6.68022 17.9908 7.04563 17.5812 7.3884 17.153C7.42875 17.1037 7.45704 17.0457 7.47101 16.9836C7.48499 16.9215 7.48428 16.857 7.46892 16.7952C7.45356 16.7334 7.42399 16.6761 7.38256 16.6278C7.34112 16.5794 7.28897 16.5414 7.23027 16.5168L7.22246 16.5137C7.13959 16.4794 7.04788 16.4726 6.96086 16.4943C6.87383 16.5161 6.7961 16.5652 6.73913 16.6345C6.2991 17.1895 5.81303 17.7063 5.28609 18.1796C5.23302 18.2252 5.17036 18.2582 5.10276 18.2763C5.03517 18.2943 4.96437 18.2969 4.89564 18.2839C4.68674 18.2451 4.47311 18.203 4.2578 18.1584C4.24006 18.1548 4.22333 18.1474 4.20888 18.1365C4.19442 18.1256 4.1826 18.1116 4.1743 18.0955C4.16599 18.0794 4.16141 18.0617 4.1609 18.0436C4.16039 18.0255 4.16396 18.0076 4.17135 17.991C4.75396 16.6822 5.38342 14.1217 5.71921 12.0104C5.73663 11.9008 5.70981 11.7888 5.64464 11.699C5.57947 11.6092 5.48129 11.549 5.37171 11.5316C5.26213 11.5141 5.15011 11.541 5.06031 11.6061C4.9705 11.6713 4.91027 11.7695 4.89285 11.8791C4.49319 14.3913 3.82663 16.7726 3.36645 17.7512C3.34087 17.8046 3.29754 17.8474 3.24388 17.8724C3.19021 17.8974 3.12953 17.9029 3.07222 17.8881C2.78831 17.8167 2.22717 17.6182 1.83532 17.4762C1.78303 17.4573 1.7275 17.449 1.67196 17.4517C1.61642 17.4544 1.56198 17.4682 1.5118 17.4921C1.46161 17.5161 1.41669 17.5497 1.37963 17.5912C1.34258 17.6327 1.31413 17.6811 1.29594 17.7336L1.29259 17.7437C1.25559 17.8482 1.26149 17.9632 1.309 18.0634C1.3565 18.1637 1.44175 18.241 1.54611 18.2786C1.9572 18.4261 2.57802 18.628 2.87197 18.7017C2.92612 18.7145 2.9746 18.7447 3.01008 18.7875C3.04556 18.8304 3.0661 18.8837 3.06859 18.9393C3.09648 19.7542 3.05688 20.7602 3.02369 21.5986C3.00054 22.182 2.98046 22.6862 2.99022 22.9841C2.9937 23.0927 3.03931 23.1957 3.11739 23.2713C3.19547 23.3469 3.2999 23.3891 3.40857 23.3891C3.43423 23.3891 3.4557 23.3891 3.52013 23.3428C3.61429 23.2732 3.69082 23.1825 3.74357 23.078C3.79632 22.9734 3.82381 22.858 3.82384 22.7409C3.82607 22.462 3.84169 22.0688 3.85898 21.6301C3.8905 20.838 3.92675 19.9009 3.90835 19.0907C3.90806 19.0724 3.91193 19.0543 3.91967 19.0377C3.92741 19.0212 3.93882 19.0066 3.95303 18.995C3.96724 18.9835 3.98388 18.9754 4.0017 18.9712C4.01952 18.9671 4.03804 18.967 4.05588 18.9711C4.24748 19.011 4.43769 19.0489 4.62511 19.0843C4.70909 19.1002 4.78703 19.139 4.85033 19.1965C4.91362 19.2539 4.9598 19.3277 4.98377 19.4098C5.53161 21.2517 5.89466 23.1436 6.06755 25.0574C6.07779 25.1606 6.126 25.2564 6.20284 25.326C6.27968 25.3957 6.37966 25.4344 6.48338 25.4345C6.52761 25.4356 6.57146 25.426 6.61121 25.4066C6.65096 25.3872 6.68546 25.3585 6.7118 25.3229C6.77645 25.2473 6.8247 25.159 6.8535 25.0638C6.88231 24.9686 6.89104 24.8684 6.87914 24.7696C6.70414 22.9554 6.36102 21.1614 5.8542 19.4106C5.85074 19.3974 5.85055 19.3836 5.85366 19.3703C5.85678 19.357 5.86309 19.3447 5.87206 19.3344C5.88102 19.3241 5.89236 19.3162 5.9051 19.3113C5.91783 19.3064 5.93157 19.3047 5.94512 19.3063C6.38298 19.3682 6.7712 19.4098 7.08859 19.4274C7.22497 19.4343 7.34266 19.438 7.44585 19.438C7.52534 19.438 7.59618 19.4357 7.6606 19.4315C7.75879 19.4277 7.85279 19.3907 7.92725 19.3266C8.00171 19.2625 8.05223 19.175 8.07058 19.0785C8.08056 19.0161 8.07629 18.9523 8.05811 18.8918C8.03993 18.8314 8.00829 18.7758 7.96557 18.7293C7.92286 18.6828 7.87017 18.6466 7.81146 18.6233C7.75275 18.6001 7.68954 18.5905 7.62658 18.5951Z" fill="#2F66D3"/>
|
||||
<path d="M4.50657 31.1913L4.49792 30.8008C4.49671 30.7459 4.48469 30.6917 4.46255 30.6414C4.44041 30.5912 4.40858 30.5457 4.36888 30.5077C4.32918 30.4697 4.28238 30.4399 4.23117 30.42C4.17995 30.4001 4.12531 30.3905 4.07037 30.3917C4.01544 30.3929 3.96127 30.4049 3.91098 30.4271C3.86069 30.4492 3.81525 30.481 3.77726 30.5207C3.73926 30.5604 3.70946 30.6072 3.68956 30.6585C3.66965 30.7097 3.66003 30.7643 3.66123 30.8192L3.66988 31.2097C3.71478 33.3098 3.74797 34.3542 3.81379 34.6105C3.83656 34.6992 3.88832 34.7777 3.96084 34.8335C4.03336 34.8894 4.12248 34.9194 4.214 34.9187C4.24753 34.9187 4.28094 34.9147 4.31357 34.907C4.42056 34.8803 4.5129 34.8129 4.57102 34.7191C4.62913 34.6254 4.64843 34.5127 4.62482 34.405C4.57015 34.1476 4.5286 32.2232 4.50657 31.1913Z" fill="#2F66D3"/>
|
||||
<path d="M3.56385 24.9803C3.4529 24.9803 3.34649 25.0244 3.26804 25.1029C3.18958 25.1813 3.14551 25.2877 3.14551 25.3987C3.14551 25.9565 3.42859 28.2657 3.42719 28.9964C3.42719 29.1074 3.47127 29.2138 3.54972 29.2922C3.62818 29.3707 3.73458 29.4148 3.84553 29.4148C3.95649 29.4148 4.06289 29.3707 4.14135 29.2922C4.2198 29.2138 4.26388 29.1074 4.26388 28.9964C4.26527 28.2155 4.01733 25.9598 3.98219 25.3987C3.97964 25.2885 3.93475 25.1836 3.85684 25.1057C3.77893 25.0278 3.674 24.9829 3.56385 24.9803Z" fill="#2F66D3"/>
|
||||
<path d="M6.19932 5.48148C6.14483 5.4736 6.08931 5.47655 6.03596 5.49017C5.98261 5.50379 5.93248 5.52781 5.88843 5.56084C5.84438 5.59388 5.80729 5.63528 5.77928 5.68269C5.75127 5.73009 5.73289 5.78255 5.7252 5.83707C5.69424 6.05628 5.48925 9.05831 5.2745 9.98145C5.24943 10.0895 5.26828 10.203 5.32691 10.2972C5.38553 10.3913 5.47914 10.4583 5.58714 10.4835C5.61832 10.4908 5.65023 10.4944 5.68225 10.4943C5.77667 10.4943 5.86829 10.4623 5.94222 10.4035C6.01615 10.3448 6.06803 10.2628 6.08943 10.1708C6.31924 9.18214 6.52702 6.1433 6.55351 5.95393C6.56897 5.84434 6.54038 5.7331 6.474 5.64455C6.40761 5.556 6.30884 5.49737 6.19932 5.48148Z" fill="#2F66D3"/>
|
||||
<path d="M28.6861 27.4424C28.7965 27.4534 28.8979 27.5078 28.9682 27.5935C29.0385 27.6793 29.0719 27.7894 29.061 27.8998C28.6789 31.7307 28.5534 34.3858 28.552 34.4123C28.547 34.5199 28.5008 34.6214 28.4228 34.6957C28.3449 34.7701 28.2413 34.8115 28.1336 34.8114H28.1141C28.0592 34.8089 28.0053 34.7956 27.9556 34.7722C27.9058 34.7489 27.8611 34.716 27.8241 34.6754C27.787 34.6348 27.7584 34.5872 27.7397 34.5355C27.721 34.4838 27.7127 34.429 27.7153 34.3741C27.7153 34.3476 27.843 31.6718 28.2273 27.8178C28.2323 27.7628 28.2482 27.7094 28.2741 27.6606C28.2999 27.6119 28.3352 27.5688 28.378 27.5338C28.4207 27.4989 28.4699 27.4728 28.5228 27.4571C28.5758 27.4414 28.6313 27.4364 28.6861 27.4424Z" fill="#2F66D3"/>
|
||||
<path d="M31.0294 31.1913L31.0381 30.8008C31.0393 30.7459 31.0513 30.6917 31.0735 30.6414C31.0956 30.5912 31.1274 30.5457 31.1671 30.5077C31.2068 30.4697 31.2536 30.4399 31.3048 30.42C31.3561 30.4001 31.4107 30.3905 31.4656 30.3917C31.5206 30.3929 31.5747 30.4049 31.625 30.4271C31.6753 30.4492 31.7208 30.481 31.7588 30.5207C31.7967 30.5604 31.8265 30.6072 31.8465 30.6585C31.8664 30.7097 31.876 30.7643 31.8748 30.8192L31.8661 31.2097C31.8212 33.3098 31.788 34.3542 31.7222 34.6105C31.6995 34.6992 31.6477 34.7777 31.5752 34.8335C31.5026 34.8894 31.4135 34.9194 31.322 34.9187C31.2885 34.9187 31.2551 34.9147 31.2224 34.907C31.1155 34.8803 31.0231 34.8129 30.965 34.7191C30.9069 34.6254 30.8876 34.5127 30.9112 34.405C30.9659 34.1476 31.0074 32.2232 31.0294 31.1913Z" fill="#2F66D3"/>
|
||||
<path d="M31.9725 24.9803C32.0834 24.9803 32.1898 25.0244 32.2683 25.1029C32.3468 25.1813 32.3908 25.2877 32.3908 25.3987C32.3908 25.9565 32.1078 28.2657 32.1091 28.9964C32.1091 29.1074 32.0651 29.2138 31.9866 29.2922C31.9082 29.3707 31.8018 29.4148 31.6908 29.4148C31.5799 29.4148 31.4734 29.3707 31.395 29.2922C31.3165 29.2138 31.2725 29.1074 31.2725 28.9964C31.2725 28.2155 31.519 25.9598 31.5541 25.3987C31.5567 25.2885 31.6016 25.1836 31.6795 25.1057C31.7574 25.0278 31.8623 24.9829 31.9725 24.9803Z" fill="#2F66D3"/>
|
||||
<path d="M29.3362 5.48141C29.4461 5.46589 29.5576 5.49464 29.6462 5.56132C29.7349 5.628 29.7934 5.72717 29.809 5.837C29.8399 6.05621 30.0449 9.05824 30.2597 9.98138C30.2847 10.0894 30.2659 10.203 30.2072 10.2971C30.1486 10.3912 30.055 10.4582 29.947 10.4834C29.9158 10.4907 29.8839 10.4943 29.8519 10.4943C29.7575 10.4942 29.6659 10.4622 29.5919 10.4035C29.518 10.3447 29.4661 10.2627 29.4447 10.1707C29.2149 9.18207 29.0071 6.14323 28.9806 5.95386C28.9652 5.84406 28.994 5.73263 29.0607 5.64404C29.1273 5.55546 29.2265 5.49696 29.3362 5.48141Z" fill="#2F66D3"/>
|
||||
<path d="M10.6447 10.2047C10.539 10.1709 10.4242 10.1804 10.3256 10.2312C10.2269 10.282 10.1525 10.3699 10.1187 10.4756C9.63749 11.9296 8.98265 13.3202 8.16836 14.6174C8.10986 14.7117 8.09119 14.8253 8.11648 14.9334C8.14177 15.0414 8.20894 15.135 8.30321 15.1935C8.39748 15.252 8.51113 15.2707 8.61917 15.2454C8.7272 15.2201 8.82076 15.1529 8.87927 15.0586C9.72954 13.7033 10.4131 12.2502 10.9152 10.731C10.932 10.6787 10.9383 10.6236 10.9338 10.5688C10.9293 10.5141 10.9141 10.4607 10.889 10.4118C10.8638 10.363 10.8293 10.3195 10.7874 10.284C10.7455 10.2485 10.697 10.2215 10.6447 10.2047Z" fill="#2F66D3"/>
|
||||
<path d="M27.9102 18.5951C28.0739 18.6037 28.238 18.6024 28.4016 18.5912C28.6275 18.579 28.8966 18.5522 29.1951 18.5143C29.2098 18.5126 29.2239 18.5069 29.2355 18.4977C29.2472 18.4885 29.256 18.4762 29.261 18.4622C29.266 18.4482 29.267 18.4331 29.2638 18.4186C29.2606 18.404 29.2534 18.3907 29.243 18.3801C28.8566 17.9908 28.4911 17.5812 28.1484 17.153C28.108 17.1037 28.0797 17.0457 28.0658 16.9836C28.0518 16.9215 28.0525 16.857 28.0679 16.7952C28.0832 16.7334 28.1128 16.6761 28.1542 16.6278C28.1957 16.5794 28.2478 16.5414 28.3065 16.5168L28.3143 16.5137C28.3972 16.4794 28.4889 16.4726 28.5759 16.4943C28.6629 16.5161 28.7407 16.5652 28.7976 16.6345C29.2377 17.1895 29.7237 17.7063 30.2507 18.1796C30.3038 18.2252 30.3664 18.2582 30.434 18.2763C30.5016 18.2943 30.5724 18.2969 30.6411 18.2839C30.85 18.2451 31.0637 18.203 31.279 18.1584C31.2967 18.1548 31.3134 18.1474 31.3279 18.1365C31.3424 18.1256 31.3542 18.1116 31.3625 18.0955C31.3708 18.0794 31.3754 18.0617 31.3759 18.0436C31.3764 18.0255 31.3728 18.0076 31.3654 17.991C30.7828 16.6822 30.1534 14.1217 29.8176 12.0104C29.8001 11.9008 29.827 11.7888 29.8921 11.699C29.9573 11.6092 30.0555 11.549 30.1651 11.5316C30.2746 11.5141 30.3867 11.541 30.4765 11.6061C30.5663 11.6713 30.6265 11.7695 30.6439 11.8791C31.0436 14.3913 31.7101 16.7726 32.1703 17.7512C32.196 17.8049 32.2395 17.8479 32.2935 17.8729C32.3474 17.8979 32.4084 17.9033 32.4659 17.8881C32.7499 17.8167 33.311 17.6182 33.7028 17.4762C33.7551 17.4573 33.8107 17.449 33.8662 17.4517C33.9217 17.4544 33.9762 17.4682 34.0264 17.4921C34.0766 17.5161 34.1215 17.5497 34.1585 17.5912C34.1956 17.6327 34.224 17.6811 34.2422 17.7336L34.2456 17.7437C34.2822 17.8481 34.2762 17.9628 34.2287 18.0627C34.1812 18.1627 34.0962 18.2399 33.9921 18.2775C33.581 18.425 32.9601 18.6269 32.6662 18.7006C32.6123 18.7137 32.5641 18.7439 32.5289 18.7868C32.4937 18.8296 32.4734 18.8828 32.471 18.9382C32.4431 19.7531 32.4827 20.7591 32.5159 21.5974C32.539 22.1809 32.5591 22.6851 32.5493 22.983C32.5459 23.0916 32.5003 23.1946 32.4222 23.2702C32.3441 23.3458 32.2397 23.388 32.131 23.3879C32.1053 23.3879 32.0839 23.3879 32.0194 23.3416C31.9249 23.2725 31.8479 23.1821 31.7947 23.0777C31.7415 22.9734 31.7135 22.858 31.7129 22.7409C31.7107 22.462 31.6951 22.0688 31.6778 21.6301C31.6463 20.838 31.61 19.9009 31.6284 19.0907C31.6287 19.0724 31.6248 19.0543 31.6171 19.0377C31.6094 19.0212 31.598 19.0066 31.5837 18.995C31.5695 18.9835 31.5529 18.9754 31.5351 18.9712C31.5173 18.9671 31.4987 18.967 31.4809 18.9711C31.2893 19.011 31.0991 19.0489 30.9117 19.0843C30.8277 19.1002 30.7497 19.139 30.6864 19.1965C30.6232 19.2539 30.577 19.3277 30.553 19.4098C30.0052 21.2517 29.6421 23.1436 29.4692 25.0574C29.459 25.1606 29.4108 25.2564 29.3339 25.326C29.2571 25.3957 29.1571 25.4344 29.0534 25.4345C29.0092 25.4356 28.9653 25.426 28.9256 25.4066C28.8858 25.3872 28.8513 25.3585 28.825 25.3229C28.7603 25.2473 28.7121 25.159 28.6833 25.0638C28.6545 24.9686 28.6457 24.8684 28.6576 24.7696C28.8326 22.9554 29.1757 21.1614 29.6826 19.4106C29.686 19.3974 29.6862 19.3836 29.6831 19.3703C29.68 19.357 29.6737 19.3447 29.6647 19.3344C29.6558 19.3241 29.6444 19.3162 29.6317 19.3113C29.6189 19.3064 29.6052 19.3047 29.5917 19.3063C29.1538 19.3682 28.7656 19.4098 28.4482 19.4274C28.3118 19.4343 28.1941 19.438 28.0909 19.438C28.0114 19.438 27.9406 19.4357 27.8762 19.4315C27.778 19.4277 27.684 19.3907 27.6095 19.3266C27.5351 19.2625 27.4845 19.175 27.4662 19.0785C27.4562 19.0161 27.4605 18.9523 27.4787 18.8918C27.4968 18.8314 27.5285 18.7758 27.5712 18.7293C27.6139 18.6828 27.6666 18.6466 27.7253 18.6233C27.784 18.6001 27.8472 18.5905 27.9102 18.5951Z" fill="#2F66D3"/>
|
||||
<path d="M24.8921 10.2047C24.9978 10.1709 25.1126 10.1804 25.2112 10.2312C25.3099 10.282 25.3843 10.3699 25.4181 10.4756C25.8993 11.9296 26.5541 13.3202 27.3684 14.6174C27.4269 14.7117 27.4456 14.8253 27.4203 14.9334C27.395 15.0414 27.3279 15.135 27.2336 15.1935C27.1393 15.252 27.0257 15.2707 26.9176 15.2454C26.8096 15.2201 26.716 15.1529 26.6575 15.0586C25.8073 13.7033 25.1237 12.2502 24.6216 10.731C24.6048 10.6787 24.5985 10.6236 24.603 10.5688C24.6075 10.5141 24.6227 10.4607 24.6478 10.4118C24.673 10.363 24.7075 10.3195 24.7494 10.284C24.7913 10.2485 24.8398 10.2215 24.8921 10.2047Z" fill="#2F66D3"/>
|
||||
<path d="M34.9896 0.836685H0.418342C0.307391 0.836685 0.200984 0.79261 0.12253 0.714155C0.0440752 0.635701 0 0.529294 0 0.418343C0 0.307391 0.0440752 0.200984 0.12253 0.12253C0.200984 0.0440752 0.307391 1.6533e-09 0.418342 0H34.9896C35.1006 1.6533e-09 35.207 0.0440752 35.2854 0.12253C35.3639 0.200984 35.408 0.307391 35.408 0.418343C35.408 0.529294 35.3639 0.635701 35.2854 0.714155C35.207 0.79261 35.1006 0.836685 34.9896 0.836685Z" fill="#2F66D3"/>
|
||||
</svg>
|
After Width: | Height: | Size: 15 KiB |
28
assets/images/scheduling.svg
Normal file
@ -0,0 +1,28 @@
|
||||
<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16.6724 33.3447C25.8803 33.3447 33.3447 25.8803 33.3447 16.6724C33.3447 7.46448 25.8803 0 16.6724 0C7.46448 0 0 7.46448 0 16.6724C0 25.8803 7.46448 33.3447 16.6724 33.3447Z" fill="#F07281"/>
|
||||
<path d="M17.3767 33.3303C17.1436 33.3401 16.9084 33.345 16.6725 33.345C7.46478 33.345 0 25.8802 0 16.6725C0 7.46478 7.46478 0 16.6725 0C16.9084 0 17.1436 0.00492188 17.3767 0.0147656C8.4957 0.38377 1.40841 7.70068 1.40841 16.6725C1.40841 25.6443 8.4957 32.9613 17.3767 33.3303Z" fill="#EB5569"/>
|
||||
<path d="M16.6726 31.1577C24.6725 31.1577 31.1577 24.6725 31.1577 16.6726C31.1577 8.67269 24.6725 2.1875 16.6726 2.1875C8.67269 2.1875 2.1875 8.67269 2.1875 16.6726C2.1875 24.6725 8.67269 31.1577 16.6726 31.1577Z" fill="#EAF6FF"/>
|
||||
<path d="M17.7291 31.1199C17.3805 31.1453 17.0276 31.1579 16.6727 31.1579C8.67269 31.1579 2.1875 24.6727 2.1875 16.6727C2.1875 8.67269 8.67275 2.1875 16.6728 2.1875C17.0277 2.1875 17.3805 2.20015 17.7291 2.22551C10.2221 2.76644 4.30022 9.02768 4.30022 16.6727C4.30022 24.3178 10.2221 30.5791 17.7291 31.1199Z" fill="#D8ECFE"/>
|
||||
<path d="M15.7672 8.23957L16.4138 7.82326C16.5715 7.72167 16.7741 7.72167 16.9319 7.82326L17.5785 8.23957C17.6957 8.31503 17.7666 8.44498 17.7666 8.58444V16.8663H15.5791V8.58444C15.579 8.44498 15.6499 8.3151 15.7672 8.23957Z" fill="#5680A6"/>
|
||||
<path d="M17.377 8.10996L16.9876 8.36063V16.8662H15.5791V8.62163C15.5791 8.45893 15.6617 8.30738 15.7985 8.21933L16.4136 7.82326C16.5714 7.72167 16.774 7.72167 16.9318 7.82326L17.377 8.10996Z" fill="#497090"/>
|
||||
<path d="M23.5067 16.9318L23.1106 17.547C23.0225 17.6837 22.871 17.7664 22.7083 17.7664H16.6729V15.5791H22.7083C22.871 15.5791 23.0225 15.6617 23.1106 15.7985L23.5067 16.4137C23.6083 16.5715 23.6083 16.774 23.5067 16.9318Z" fill="#5680A6"/>
|
||||
<path d="M19.6131 16.6727C19.6131 17.0594 19.5384 17.4284 19.4018 17.7664H16.6729V15.5791H19.4018C19.5384 15.9171 19.6131 16.2861 19.6131 16.6727Z" fill="#497090"/>
|
||||
<path d="M16.6723 18.2039C17.5182 18.2039 18.2039 17.5182 18.2039 16.6723C18.2039 15.8264 17.5182 15.1406 16.6723 15.1406C15.8264 15.1406 15.1406 15.8264 15.1406 16.6723C15.1406 17.5182 15.8264 18.2039 16.6723 18.2039Z" fill="#F07281"/>
|
||||
<path d="M17.3765 18.0326C17.166 18.1424 16.9265 18.2044 16.6723 18.2044C15.8265 18.2044 15.1406 17.5185 15.1406 16.6728C15.1406 15.827 15.8265 15.1411 16.6723 15.1411C16.9265 15.1411 17.166 15.2031 17.3765 15.313C16.885 15.5672 16.549 16.0813 16.549 16.6728C16.549 17.2644 16.885 17.7783 17.3765 18.0326Z" fill="#EB5569"/>
|
||||
<path d="M34.5329 28.7151V27.6225C34.5329 27.4043 34.3853 27.2137 34.174 27.1592L32.9876 26.853C32.8555 26.3207 32.6457 25.8193 32.37 25.3617L32.9923 24.3064C33.1032 24.1184 33.0728 23.8793 32.9185 23.7249L32.1459 22.9523C31.9916 22.798 31.7524 22.7676 31.5644 22.8785L30.5091 23.5008C30.0516 23.2251 29.5501 23.0153 29.0178 22.8832L28.7116 21.6968C28.6571 21.4855 28.4665 21.3379 28.2483 21.3379H27.1557C26.9375 21.3379 26.7469 21.4855 26.6924 21.6968L26.3862 22.8832C25.8539 23.0153 25.3525 23.2252 24.8949 23.5008L23.8396 22.8785C23.6516 22.7676 23.4125 22.798 23.2581 22.9523L22.4855 23.7249C22.3313 23.8792 22.3009 24.1184 22.4117 24.3064L23.0341 25.3617C22.7583 25.8193 22.5485 26.3207 22.4164 26.853L21.23 27.1592C21.0188 27.2137 20.8711 27.4043 20.8711 27.6225V28.7151C20.8711 28.9333 21.0188 29.1239 21.23 29.1784L22.4164 29.4846C22.5485 30.0169 22.7584 30.5183 23.0341 30.9759L22.4117 32.0312C22.3008 32.2192 22.3313 32.4583 22.4855 32.6127L23.2581 33.3853C23.4124 33.5396 23.6516 33.5699 23.8396 33.4591L24.8949 32.8368C25.3525 33.1125 25.8539 33.3223 26.3862 33.4544L26.6924 34.6408C26.7469 34.8521 26.9375 34.9997 27.1557 34.9997H28.2483C28.4665 34.9997 28.6571 34.8521 28.7116 34.6408L29.0178 33.4544C29.5501 33.3223 30.0516 33.1124 30.5091 32.8368L31.5644 33.4591C31.7524 33.57 31.9915 33.5396 32.1459 33.3853L32.9185 32.6127C33.0728 32.4584 33.1031 32.2192 32.9923 32.0312L32.37 30.9759C32.6457 30.5183 32.8555 30.0169 32.9876 29.4846L34.174 29.1784C34.3853 29.1239 34.5329 28.9333 34.5329 28.7151Z" fill="#88B4F5"/>
|
||||
<path d="M22.2796 27.252V29.0858L23.8246 29.4844C23.9563 30.0168 24.1662 30.5182 24.4423 30.976L23.6317 32.3506L24.4057 33.1246L23.8391 33.4588C23.6511 33.5696 23.4119 33.5393 23.2576 33.3849L22.4853 32.6127C22.331 32.4584 22.3007 32.2192 22.4115 32.0313L23.0338 30.976C22.7577 30.5182 22.5479 30.0168 22.4162 29.4844L21.23 29.1784C21.0187 29.124 20.8711 28.9333 20.8711 28.7151V27.6226C20.8711 27.4044 21.0187 27.2139 21.2299 27.1593L22.4162 26.8527C22.5479 26.321 22.7577 25.8189 23.0338 25.3619L22.4115 24.3064C22.3007 24.1185 22.331 23.8794 22.4853 23.7251L23.2577 22.9523C23.4119 22.7978 23.6512 22.7675 23.8392 22.8784L24.4057 23.2125L23.6317 23.9872L24.4423 25.3619C24.1662 25.8189 23.9564 26.321 23.8246 26.8527L22.2796 27.252Z" fill="#6EA2F2"/>
|
||||
<path d="M27.7946 33.454L28.1932 34.9997H27.1555C26.9372 34.9997 26.7466 34.8521 26.6921 34.6407L26.3861 33.454C26.1361 33.3927 25.8924 33.3132 25.6572 33.2174L26.303 32.8364C26.7608 33.1124 27.2622 33.3223 27.7946 33.454Z" fill="#6EA2F2"/>
|
||||
<path d="M27.1555 21.3379H28.1932L27.7946 22.883C27.2622 23.0154 26.7608 23.2252 26.303 23.5006L25.6572 23.1196C25.8925 23.0245 26.1361 22.945 26.3861 22.883L26.6921 21.6969C26.7466 21.4855 26.9373 21.3379 27.1555 21.3379Z" fill="#6EA2F2"/>
|
||||
<path d="M27.7023 31.4612C29.5205 31.4612 30.9944 29.9873 30.9944 28.1691C30.9944 26.3509 29.5205 24.877 27.7023 24.877C25.8841 24.877 24.4102 26.3509 24.4102 28.1691C24.4102 29.9873 25.8841 31.4612 27.7023 31.4612Z" fill="#5680A6"/>
|
||||
<path d="M28.7581 31.2882C28.4264 31.4009 28.0707 31.4615 27.7017 31.4615C25.8841 31.4615 24.4102 29.9875 24.4102 28.1692C24.4102 26.3509 25.8841 24.877 27.7017 24.877C28.0707 24.877 28.4263 24.9375 28.7581 25.0502C27.4588 25.4903 26.5229 26.7206 26.5229 28.1692C26.5229 29.6178 27.4588 30.8481 28.7581 31.2882Z" fill="#497090"/>
|
||||
<path d="M16.6727 6.19265C16.381 6.19265 16.1445 5.95619 16.1445 5.6645V4.30012C16.1445 4.00843 16.381 3.77197 16.6727 3.77197C16.9644 3.77197 17.2008 4.00843 17.2008 4.30012V5.66443C17.2008 5.95612 16.9644 6.19265 16.6727 6.19265Z" fill="#88B4F5"/>
|
||||
<path d="M16.6727 29.5729C16.381 29.5729 16.1445 29.3365 16.1445 29.0448V27.6805C16.1445 27.3888 16.381 27.1523 16.6727 27.1523C16.9644 27.1523 17.2008 27.3888 17.2008 27.6805V29.0448C17.2008 29.3364 16.9644 29.5729 16.6727 29.5729Z" fill="#88B4F5"/>
|
||||
<path d="M5.66492 17.2003H4.30061C4.00892 17.2003 3.77246 16.9639 3.77246 16.6722C3.77246 16.3805 4.00892 16.144 4.30061 16.144H5.66492C5.95661 16.144 6.19307 16.3805 6.19307 16.6722C6.19307 16.9639 5.95661 17.2003 5.66492 17.2003Z" fill="#88B4F5"/>
|
||||
<path d="M29.0448 17.2003H27.6805C27.3887 17.2003 27.1523 16.9639 27.1523 16.6722C27.1523 16.3805 27.3888 16.144 27.6805 16.144H29.0448C29.3366 16.144 29.5729 16.3805 29.5729 16.6722C29.5729 16.9639 29.3365 17.2003 29.0448 17.2003Z" fill="#88B4F5"/>
|
||||
<path d="M5.95843 23.3866C5.77591 23.3866 5.59838 23.2918 5.50056 23.1224C5.35468 22.8698 5.44122 22.5467 5.69388 22.4009L6.8754 21.7188C7.12785 21.573 7.45099 21.6594 7.59687 21.9121C7.74275 22.1647 7.6562 22.4877 7.40355 22.6335L6.22202 23.3157C6.1389 23.3638 6.04805 23.3866 5.95843 23.3866Z" fill="#88B4F5"/>
|
||||
<path d="M26.2065 11.6967C26.0239 11.6967 25.8464 11.6019 25.7486 11.4325C25.6027 11.1799 25.6893 10.8568 25.9419 10.711L27.1234 10.0288C27.376 9.88304 27.699 9.96951 27.8449 10.2222C27.9908 10.4748 27.9042 10.7978 27.6516 10.9436L26.4701 11.6258C26.3869 11.6738 26.296 11.6967 26.2065 11.6967Z" fill="#88B4F5"/>
|
||||
<path d="M7.139 11.6967C7.04938 11.6967 6.9586 11.6739 6.8754 11.6259L5.69388 10.9437C5.44122 10.7978 5.35468 10.4748 5.50056 10.2222C5.64637 9.96957 5.96937 9.88296 6.22202 10.0289L7.40355 10.7111C7.6562 10.8569 7.74275 11.1799 7.59687 11.4325C7.49904 11.602 7.32152 11.6967 7.139 11.6967Z" fill="#88B4F5"/>
|
||||
<path d="M10.4858 27.9149C10.3962 27.9149 10.3054 27.892 10.2222 27.844C9.96954 27.6981 9.883 27.3751 10.0289 27.1225L10.711 25.941C10.8568 25.6883 11.1799 25.6017 11.4325 25.7477C11.6852 25.8935 11.7717 26.2165 11.6258 26.4691L10.9437 27.6506C10.8458 27.8201 10.6683 27.9149 10.4858 27.9149Z" fill="#88B4F5"/>
|
||||
<path d="M22.1752 7.66727C22.0856 7.66727 21.9948 7.64444 21.9116 7.59638C21.659 7.45057 21.5724 7.1275 21.7183 6.87491L22.4005 5.69339C22.5463 5.44073 22.8692 5.35419 23.1219 5.50007C23.3745 5.64588 23.4611 5.96895 23.3153 6.22154L22.6331 7.40306C22.5353 7.57252 22.3578 7.66727 22.1752 7.66727Z" fill="#88B4F5"/>
|
||||
<path d="M11.1689 7.66727C10.9864 7.66727 10.8089 7.57252 10.711 7.40306L10.0289 6.22154C9.883 5.96895 9.96954 5.64588 10.2222 5.50007C10.4747 5.35419 10.7979 5.44073 10.9437 5.69339L11.6258 6.87491C11.7717 7.1275 11.6852 7.45057 11.4325 7.59638C11.3494 7.64437 11.2585 7.66727 11.1689 7.66727Z" fill="#88B4F5"/>
|
||||
</svg>
|
After Width: | Height: | Size: 8.6 KiB |
@ -1,8 +1,10 @@
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:syncrow_web/pages/auth/bloc/auth_bloc.dart';
|
||||
import 'package:syncrow_web/pages/home/bloc/home_bloc.dart';
|
||||
import 'package:syncrow_web/pages/home/bloc/home_event.dart';
|
||||
import 'package:syncrow_web/pages/visitor_password/bloc/visitor_password_bloc.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:syncrow_web/services/locator.dart';
|
||||
@ -11,8 +13,13 @@ import 'package:syncrow_web/utils/constants/routes_const.dart';
|
||||
import 'package:syncrow_web/utils/theme/theme.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
initialSetup();
|
||||
try {
|
||||
const environment =
|
||||
String.fromEnvironment('FLAVOR', defaultValue: 'development');
|
||||
await dotenv.load(fileName: '.env.$environment');
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
initialSetup();
|
||||
} catch (_) {}
|
||||
runApp(MyApp());
|
||||
}
|
||||
|
||||
@ -38,9 +45,11 @@ class MyApp extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
//HomeBloc.fetchUserInfo();
|
||||
return MultiBlocProvider(
|
||||
providers: [
|
||||
BlocProvider(create: (context) => HomeBloc()),
|
||||
BlocProvider(
|
||||
create: (context) => HomeBloc()..add(const FetchUserInfo())),
|
||||
BlocProvider<VisitorPasswordBloc>(
|
||||
create: (context) => VisitorPasswordBloc(),
|
||||
)
|
||||
|
@ -3,25 +3,27 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/access_management/bloc/access_event.dart';
|
||||
import 'package:syncrow_web/pages/access_management/bloc/access_state.dart';
|
||||
import 'package:syncrow_web/pages/access_management/model/password_model.dart';
|
||||
import 'package:syncrow_web/pages/common/hour_picker_dialog.dart';
|
||||
import 'package:syncrow_web/services/access_mang_api.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/constants/app_enum.dart';
|
||||
import 'package:syncrow_web/utils/snack_bar.dart';
|
||||
|
||||
class AccessBloc extends Bloc<AccessEvent, AccessState> {
|
||||
AccessBloc() : super((AccessInitial())) {
|
||||
on<FetchTableData>(_onFetchTableData);
|
||||
// on<TabChangedEvent>(selectFilterTap);
|
||||
on<SelectTime>(selectTime);
|
||||
on<FilterDataEvent>(_filterData);
|
||||
on<ResetSearch>(resetSearch);
|
||||
on<TabChangedEvent>(onTabChanged);
|
||||
}
|
||||
|
||||
String startTime = 'Start Date';
|
||||
String endTime = 'End Date';
|
||||
|
||||
int? effectiveTimeTimeStamp;
|
||||
int? expirationTimeTimeStamp;
|
||||
TextEditingController passwordName = TextEditingController();
|
||||
TextEditingController emailAuthorizer = TextEditingController();
|
||||
List<PasswordModel> filteredData = [];
|
||||
List<PasswordModel> data = [];
|
||||
|
||||
@ -62,105 +64,125 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> selectTime(SelectTime event, Emitter<AccessState> emit) async {
|
||||
|
||||
Future<void> selectTime(SelectTime event, Emitter<AccessState> emit,) async {
|
||||
emit(AccessLoaded());
|
||||
final DateTime? picked = await showDatePicker(
|
||||
context: event.context,
|
||||
initialDate: DateTime.now(),
|
||||
firstDate: DateTime(2015, 8),
|
||||
lastDate: DateTime(2101),
|
||||
firstDate: DateTime.now().add(const Duration(days: -5095)),
|
||||
lastDate: DateTime.now().add(const Duration(days: 2095)),
|
||||
);
|
||||
if (picked != null) {
|
||||
final selectedDateTime = DateTime(
|
||||
picked.year,
|
||||
picked.month,
|
||||
picked.day,
|
||||
final TimeOfDay? timePicked = await showHourPicker(
|
||||
context: event.context,
|
||||
initialTime: TimeOfDay.now(),
|
||||
);
|
||||
final selectedTimestamp = DateTime(
|
||||
selectedDateTime.year,
|
||||
selectedDateTime.month,
|
||||
selectedDateTime.day,
|
||||
selectedDateTime.hour,
|
||||
selectedDateTime.minute,
|
||||
).millisecondsSinceEpoch ~/
|
||||
1000; // Divide by 1000 to remove milliseconds
|
||||
if (event.isStart) {
|
||||
if (expirationTimeTimeStamp != null && selectedTimestamp > expirationTimeTimeStamp!) {
|
||||
CustomSnackBar.displaySnackBar('Effective Time cannot be later than Expiration Time.');
|
||||
|
||||
if (timePicked != null) {
|
||||
final DateTime selectedDateTime = DateTime(
|
||||
picked.year,
|
||||
picked.month,
|
||||
picked.day,
|
||||
timePicked.hour,
|
||||
timePicked.minute,
|
||||
);
|
||||
final int selectedTimestamp = selectedDateTime.millisecondsSinceEpoch ~/ 1000;
|
||||
if (event.isStart) {
|
||||
if (expirationTimeTimeStamp != null && selectedTimestamp > expirationTimeTimeStamp!) {
|
||||
CustomSnackBar.displaySnackBar('Effective Time cannot be later than Expiration Time.');
|
||||
} else {
|
||||
startTime = selectedDateTime.toString().split('.').first;
|
||||
effectiveTimeTimeStamp = selectedTimestamp;
|
||||
}
|
||||
} else {
|
||||
startTime =
|
||||
selectedDateTime.toString().split('.').first; // Remove seconds and milliseconds
|
||||
effectiveTimeTimeStamp = selectedTimestamp;
|
||||
}
|
||||
} else {
|
||||
if (effectiveTimeTimeStamp != null && selectedTimestamp < effectiveTimeTimeStamp!) {
|
||||
CustomSnackBar.displaySnackBar('Expiration Time cannot be earlier than Effective Time.');
|
||||
} else {
|
||||
endTime = selectedDateTime.toString().split('.').first; // Remove seconds and milliseconds
|
||||
expirationTimeTimeStamp = selectedTimestamp;
|
||||
if (effectiveTimeTimeStamp != null && selectedTimestamp < effectiveTimeTimeStamp!) {
|
||||
CustomSnackBar.displaySnackBar('Expiration Time cannot be earlier than Effective Time.');
|
||||
} else {
|
||||
endTime = selectedDateTime.toString().split('.').first;
|
||||
expirationTimeTimeStamp = selectedTimestamp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
emit(ChangeTimeState());
|
||||
|
||||
}
|
||||
|
||||
|
||||
Future<void> _filterData(FilterDataEvent event, Emitter<AccessState> emit) async {
|
||||
emit(AccessLoaded());
|
||||
try {
|
||||
print(event.emailAuthorizer?.toLowerCase());
|
||||
// Convert search text to lower case for case-insensitive search
|
||||
final searchText = event.passwordName?.toLowerCase() ?? '';
|
||||
final searchEmailText = event.emailAuthorizer?.toLowerCase() ?? '';
|
||||
filteredData = data.where((item) {
|
||||
bool matchesCriteria = true;
|
||||
|
||||
// Convert timestamp to DateTime and extract date component
|
||||
DateTime effectiveDate =
|
||||
DateTime.fromMillisecondsSinceEpoch(int.parse(item.effectiveTime.toString()) * 1000)
|
||||
.toUtc()
|
||||
.toLocal();
|
||||
DateTime.fromMillisecondsSinceEpoch(int.parse(item.effectiveTime.toString()) * 1000)
|
||||
.toUtc()
|
||||
.toLocal();
|
||||
DateTime invalidDate =
|
||||
DateTime.fromMillisecondsSinceEpoch(int.parse(item.invalidTime.toString()) * 1000)
|
||||
.toUtc()
|
||||
.toLocal();
|
||||
DateTime effectiveDateOnly =
|
||||
DateTime(effectiveDate.year, effectiveDate.month, effectiveDate.day);
|
||||
DateTime invalidDateOnly = DateTime(invalidDate.year, invalidDate.month, invalidDate.day);
|
||||
DateTime.fromMillisecondsSinceEpoch(int.parse(item.invalidTime.toString()) * 1000)
|
||||
.toUtc()
|
||||
.toLocal();
|
||||
DateTime effectiveDateAndTime = DateTime(effectiveDate.year, effectiveDate.month, effectiveDate.day,effectiveDate.hour,effectiveDate.minute);
|
||||
DateTime invalidDateAndTime = DateTime(invalidDate.year, invalidDate.month, invalidDate.day,invalidDate.hour,invalidDate.minute);
|
||||
|
||||
// Filter by password name
|
||||
if (event.passwordName != null && event.passwordName!.isNotEmpty) {
|
||||
final bool matchesName =
|
||||
item.passwordName != null && item.passwordName.contains(event.passwordName);
|
||||
// Filter by password name, making the search case-insensitive
|
||||
if (searchText.isNotEmpty) {
|
||||
final bool matchesName = item.passwordName.toString().toLowerCase().contains(searchText);
|
||||
if (!matchesName) {
|
||||
matchesCriteria = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Filter by start date only
|
||||
if (event.startTime != null && event.endTime == null) {
|
||||
DateTime startDateOnly =
|
||||
DateTime.fromMillisecondsSinceEpoch(event.startTime! * 1000).toUtc().toLocal();
|
||||
startDateOnly = DateTime(startDateOnly.year, startDateOnly.month, startDateOnly.day);
|
||||
if (effectiveDateOnly.isBefore(startDateOnly)) {
|
||||
if (searchEmailText.isNotEmpty) {
|
||||
final bool matchesName = item.authorizerEmail.toString().toLowerCase().contains(searchEmailText);
|
||||
if (!matchesName) {
|
||||
matchesCriteria = false;
|
||||
}
|
||||
}
|
||||
// Filter by start date only
|
||||
if (event.startTime != null && event.endTime == null) {
|
||||
DateTime startDateTime =
|
||||
DateTime.fromMillisecondsSinceEpoch(event.startTime! * 1000).toUtc().toLocal();
|
||||
startDateTime = DateTime(
|
||||
startDateTime.year,
|
||||
startDateTime.month,
|
||||
startDateTime.day,
|
||||
startDateTime.hour,
|
||||
startDateTime.minute);
|
||||
if (effectiveDateAndTime.isBefore(startDateTime)) {
|
||||
matchesCriteria = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Filter by end date only
|
||||
if (event.endTime != null && event.startTime == null) {
|
||||
DateTime endDateOnly =
|
||||
DateTime.fromMillisecondsSinceEpoch(event.endTime! * 1000).toUtc().toLocal();
|
||||
endDateOnly = DateTime(endDateOnly.year, endDateOnly.month, endDateOnly.day);
|
||||
if (invalidDateOnly.isAfter(endDateOnly)) {
|
||||
DateTime startDateTime =
|
||||
DateTime.fromMillisecondsSinceEpoch(event.endTime! * 1000).toUtc().toLocal();
|
||||
startDateTime = DateTime(
|
||||
startDateTime.year,
|
||||
startDateTime.month,
|
||||
startDateTime.day,
|
||||
startDateTime.hour,
|
||||
startDateTime.minute
|
||||
);
|
||||
if (invalidDateAndTime.isAfter(startDateTime)) {
|
||||
matchesCriteria = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Filter by both start date and end date
|
||||
if (event.startTime != null && event.endTime != null) {
|
||||
DateTime startDateOnly =
|
||||
DateTime.fromMillisecondsSinceEpoch(event.startTime! * 1000).toUtc().toLocal();
|
||||
DateTime endDateOnly =
|
||||
DateTime.fromMillisecondsSinceEpoch(event.endTime! * 1000).toUtc().toLocal();
|
||||
startDateOnly = DateTime(startDateOnly.year, startDateOnly.month, startDateOnly.day);
|
||||
endDateOnly = DateTime(endDateOnly.year, endDateOnly.month, endDateOnly.day);
|
||||
if (effectiveDateOnly.isBefore(startDateOnly) || invalidDateOnly.isAfter(endDateOnly)) {
|
||||
DateTime startDateTime =
|
||||
DateTime.fromMillisecondsSinceEpoch(event.startTime! * 1000).toUtc().toLocal();
|
||||
DateTime endDateTime =
|
||||
DateTime.fromMillisecondsSinceEpoch(event.endTime! * 1000).toUtc().toLocal();
|
||||
startDateTime = DateTime(startDateTime.year, startDateTime.month, startDateTime.day,startDateTime.hour,startDateTime.minute);
|
||||
endDateTime = DateTime(endDateTime.year, endDateTime.month, endDateTime.day,endDateTime.hour,endDateTime.minute);
|
||||
if (effectiveDateAndTime.isBefore(startDateTime) || invalidDateAndTime.isAfter(endDateTime)) {
|
||||
matchesCriteria = false;
|
||||
}
|
||||
}
|
||||
@ -183,11 +205,13 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
resetSearch(ResetSearch event, Emitter<AccessState> emit) async {
|
||||
emit(AccessLoaded());
|
||||
startTime = 'Start Time';
|
||||
endTime = 'End Time';
|
||||
passwordName.clear();
|
||||
emailAuthorizer.clear();
|
||||
selectedIndex = 0;
|
||||
effectiveTimeTimeStamp = null;
|
||||
expirationTimeTimeStamp = null;
|
||||
@ -196,9 +220,11 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
|
||||
|
||||
String timestampToDate(dynamic timestamp) {
|
||||
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(int.parse(timestamp) * 1000);
|
||||
return "${dateTime.year}/${dateTime.month.toString().padLeft(2, '0')}/${dateTime.day.toString().padLeft(2, '0')}";
|
||||
return "${dateTime.year}/${dateTime.month.toString().padLeft(2, '0')}/${dateTime.day.toString().padLeft(2, '0')} "
|
||||
" ${dateTime.hour.toString().padLeft(2, '0')}:${dateTime.minute.toString().padLeft(2, '0')}";
|
||||
}
|
||||
|
||||
|
||||
Future<void> onTabChanged(TabChangedEvent event, Emitter<AccessState> emit) async {
|
||||
try {
|
||||
emit(AccessLoaded());
|
||||
@ -223,6 +249,7 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
|
||||
add(FilterDataEvent(
|
||||
selectedTabIndex: selectedIndex,
|
||||
passwordName: passwordName.text.toLowerCase(),
|
||||
emailAuthorizer: emailAuthorizer.text.toLowerCase(),
|
||||
startTime: effectiveTimeTimeStamp,
|
||||
endTime: expirationTimeTimeStamp));
|
||||
emit(TableLoaded(filteredData));
|
||||
@ -230,4 +257,6 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
|
||||
emit(FailedState(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -28,12 +28,14 @@ class SelectTime extends AccessEvent {
|
||||
|
||||
class FilterDataEvent extends AccessEvent {
|
||||
final String? passwordName;
|
||||
final String? emailAuthorizer;
|
||||
final int? startTime;
|
||||
final int? endTime;
|
||||
final int selectedTabIndex; // Add this field
|
||||
|
||||
const FilterDataEvent({
|
||||
this.passwordName,
|
||||
this.emailAuthorizer,
|
||||
this.startTime,
|
||||
this.endTime,
|
||||
required this.selectedTabIndex, // Initialize this field
|
||||
|
@ -6,10 +6,13 @@ class PasswordModel {
|
||||
final dynamic effectiveTime;
|
||||
final dynamic passwordCreated;
|
||||
final dynamic createdTime;
|
||||
final dynamic passwordName; // New field
|
||||
final dynamic passwordName;
|
||||
final AccessStatus passwordStatus;
|
||||
final AccessType passwordType;
|
||||
final dynamic deviceUuid;
|
||||
final dynamic authorizerEmail;
|
||||
final dynamic authorizerDate;
|
||||
final dynamic deviceName;
|
||||
|
||||
PasswordModel({
|
||||
this.passwordId,
|
||||
@ -17,10 +20,13 @@ class PasswordModel {
|
||||
this.effectiveTime,
|
||||
this.passwordCreated,
|
||||
this.createdTime,
|
||||
this.passwordName, // New field
|
||||
this.passwordName,
|
||||
required this.passwordStatus,
|
||||
required this.passwordType,
|
||||
this.deviceUuid,
|
||||
this.authorizerEmail,
|
||||
this.authorizerDate,
|
||||
this.deviceName,
|
||||
});
|
||||
|
||||
factory PasswordModel.fromJson(Map<String, dynamic> json) {
|
||||
@ -30,10 +36,13 @@ class PasswordModel {
|
||||
effectiveTime: json['effectiveTime'],
|
||||
passwordCreated: json['passwordCreated'],
|
||||
createdTime: json['createdTime'],
|
||||
passwordName: json['passwordName'] ?? 'No name', // New field
|
||||
passwordName: json['passwordName']??'No Name',
|
||||
passwordStatus: AccessStatusExtension.fromString(json['passwordStatus']),
|
||||
passwordType: AccessTypeExtension.fromString(json['passwordType']),
|
||||
deviceUuid: json['deviceUuid'],
|
||||
authorizerEmail: json['authorizerEmail'],
|
||||
authorizerDate: json['authorizerDate'],
|
||||
deviceName: json['deviceName'],
|
||||
);
|
||||
}
|
||||
|
||||
@ -44,10 +53,13 @@ class PasswordModel {
|
||||
'effectiveTime': effectiveTime,
|
||||
'passwordCreated': passwordCreated,
|
||||
'createdTime': createdTime,
|
||||
'passwodName': passwordName, // New field
|
||||
'passwordName': passwordName, // New field
|
||||
'passwordStatus': passwordStatus,
|
||||
'passwordType': passwordType,
|
||||
'deviceUuid': deviceUuid,
|
||||
'authorizerEmail': authorizerEmail,
|
||||
'authorizerDate': authorizerDate,
|
||||
'deviceName': deviceName,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -24,37 +24,42 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
final isLargeScreen = isLargeScreenSize(context);
|
||||
final isSmallScreen = isSmallScreenSize(context);
|
||||
final isHalfMediumScreen = isHafMediumScreenSize(context);
|
||||
final padding =
|
||||
isLargeScreen ? const EdgeInsets.all(30) : const EdgeInsets.all(15);
|
||||
final padding = isLargeScreen ? const EdgeInsets.all(30) : const EdgeInsets.all(15);
|
||||
|
||||
return WebScaffold(
|
||||
enableMenuSideba: false,
|
||||
enableMenuSidebar: false,
|
||||
appBarTitle: FittedBox(
|
||||
child: Text(
|
||||
'Access Management',
|
||||
style: Theme.of(context).textTheme.headlineLarge,
|
||||
),
|
||||
),
|
||||
centerBody: Text(
|
||||
'Physical Access',
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.headlineMedium!
|
||||
.copyWith(color: Colors.white),
|
||||
centerBody: Wrap(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: MediaQuery.of(context).size.width * 0.09),
|
||||
child: Align(
|
||||
alignment: Alignment.bottomLeft,
|
||||
child: Text(
|
||||
'Physical Access',
|
||||
style: Theme.of(context).textTheme.headlineMedium!.copyWith(color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
rightBody: const NavigateHomeGridView(),
|
||||
scaffoldBody: BlocProvider(
|
||||
create: (BuildContext context) =>
|
||||
AccessBloc()..add(FetchTableData()),
|
||||
create: (BuildContext context) => AccessBloc()..add(FetchTableData()),
|
||||
child: BlocConsumer<AccessBloc, AccessState>(
|
||||
listener: (context, state) {},
|
||||
builder: (context, state) {
|
||||
final accessBloc = BlocProvider.of<AccessBloc>(context);
|
||||
final filteredData = accessBloc.filteredData;
|
||||
|
||||
return state is AccessLoaded
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: Container(
|
||||
@ -81,8 +86,10 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
||||
_buildVisitorAdminPasswords(context, accessBloc),
|
||||
const SizedBox(height: 20),
|
||||
Expanded(
|
||||
child: DynamicTable(
|
||||
child: DynamicTable(
|
||||
tableName: 'AccessManagement',
|
||||
uuidIndex: 1,
|
||||
withSelectAll: true,
|
||||
isEmpty: filteredData.isEmpty,
|
||||
withCheckBox: false,
|
||||
size: MediaQuery.of(context).size,
|
||||
@ -90,7 +97,8 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
||||
headers: const [
|
||||
'Name',
|
||||
'Access Type',
|
||||
'Access Period',
|
||||
'Access Start',
|
||||
'Access End',
|
||||
'Accessible Device',
|
||||
'Authorizer',
|
||||
'Authorization Date & Time',
|
||||
@ -98,12 +106,13 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
||||
],
|
||||
data: filteredData.map((item) {
|
||||
return [
|
||||
item.passwordName.toString(),
|
||||
item.passwordName,
|
||||
item.passwordType.value,
|
||||
('${accessBloc.timestampToDate(item.effectiveTime)} - ${accessBloc.timestampToDate(item.invalidTime)}'),
|
||||
item.deviceUuid.toString(),
|
||||
'',
|
||||
'',
|
||||
accessBloc.timestampToDate(item.effectiveTime),
|
||||
accessBloc.timestampToDate(item.invalidTime),
|
||||
item.deviceName.toString(),
|
||||
item.authorizerEmail.toString(),
|
||||
accessBloc.timestampToDate(item.invalidTime),
|
||||
item.passwordStatus.value,
|
||||
];
|
||||
}).toList(),
|
||||
@ -114,8 +123,7 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
||||
})));
|
||||
}
|
||||
|
||||
Wrap _buildVisitorAdminPasswords(
|
||||
BuildContext context, AccessBloc accessBloc) {
|
||||
Wrap _buildVisitorAdminPasswords(BuildContext context, AccessBloc accessBloc) {
|
||||
return Wrap(
|
||||
spacing: 10,
|
||||
runSpacing: 10,
|
||||
@ -141,8 +149,7 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
||||
borderRadius: 8,
|
||||
child: Text(
|
||||
'+ Create Visitor Password ',
|
||||
style: context.textTheme.titleSmall!
|
||||
.copyWith(color: Colors.white, fontSize: 12),
|
||||
style: context.textTheme.titleSmall!.copyWith(color: Colors.white, fontSize: 12),
|
||||
)),
|
||||
),
|
||||
Container(
|
||||
@ -154,8 +161,7 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
||||
backgroundColor: ColorsManager.whiteColors,
|
||||
child: Text(
|
||||
'Admin Password',
|
||||
style: context.textTheme.titleSmall!
|
||||
.copyWith(color: Colors.black, fontSize: 12),
|
||||
style: context.textTheme.titleSmall!.copyWith(color: Colors.black, fontSize: 12),
|
||||
)),
|
||||
),
|
||||
],
|
||||
@ -163,6 +169,8 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
||||
}
|
||||
|
||||
Row _buildNormalSearchWidgets(BuildContext context, AccessBloc accessBloc) {
|
||||
TimeOfDay _selectedTime = TimeOfDay.now();
|
||||
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
@ -172,22 +180,32 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
||||
width: 250,
|
||||
child: CustomWebTextField(
|
||||
controller: accessBloc.passwordName,
|
||||
height: 38,
|
||||
isRequired: true,
|
||||
height: 43,
|
||||
isRequired: false,
|
||||
textFieldName: 'Name',
|
||||
description: '',
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
SizedBox(
|
||||
height: 70,
|
||||
width: 250,
|
||||
child: CustomWebTextField(
|
||||
controller: accessBloc.emailAuthorizer,
|
||||
height: 43,
|
||||
isRequired: false,
|
||||
textFieldName: 'Authorizer',
|
||||
description: '',
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
SizedBox(
|
||||
child: DateTimeWebWidget(
|
||||
icon: Assets.calendarIcon,
|
||||
isRequired: false,
|
||||
title: 'Access Time',
|
||||
size: MediaQuery.of(context).size,
|
||||
endTime: () {
|
||||
accessBloc.add(SelectTime(context: context, isStart: false));
|
||||
accessBloc.add(SelectTime(context: context, isStart: false));
|
||||
},
|
||||
startTime: () {
|
||||
accessBloc.add(SelectTime(context: context, isStart: true));
|
||||
@ -200,8 +218,8 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
||||
SearchResetButtons(
|
||||
onSearch: () {
|
||||
accessBloc.add(FilterDataEvent(
|
||||
selectedTabIndex:
|
||||
BlocProvider.of<AccessBloc>(context).selectedIndex,
|
||||
emailAuthorizer:accessBloc.emailAuthorizer.text.toLowerCase() ,
|
||||
selectedTabIndex: BlocProvider.of<AccessBloc>(context).selectedIndex,
|
||||
passwordName: accessBloc.passwordName.text.toLowerCase(),
|
||||
startTime: accessBloc.effectiveTimeTimeStamp,
|
||||
endTime: accessBloc.expirationTimeTimeStamp));
|
||||
@ -246,11 +264,12 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
||||
SearchResetButtons(
|
||||
onSearch: () {
|
||||
accessBloc.add(FilterDataEvent(
|
||||
selectedTabIndex:
|
||||
BlocProvider.of<AccessBloc>(context).selectedIndex,
|
||||
emailAuthorizer:accessBloc.emailAuthorizer.text.toLowerCase() ,
|
||||
selectedTabIndex: BlocProvider.of<AccessBloc>(context).selectedIndex,
|
||||
passwordName: accessBloc.passwordName.text.toLowerCase(),
|
||||
startTime: accessBloc.effectiveTimeTimeStamp,
|
||||
endTime: accessBloc.expirationTimeTimeStamp));
|
||||
endTime: accessBloc.expirationTimeTimeStamp
|
||||
));
|
||||
},
|
||||
onReset: () {
|
||||
accessBloc.add(ResetSearch());
|
||||
@ -259,4 +278,6 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
@ -30,35 +31,60 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
|
||||
////////////////////////////// forget password //////////////////////////////////
|
||||
final TextEditingController forgetEmailController = TextEditingController();
|
||||
final TextEditingController forgetPasswordController =
|
||||
TextEditingController();
|
||||
final TextEditingController forgetPasswordController = TextEditingController();
|
||||
final TextEditingController forgetOtp = TextEditingController();
|
||||
final forgetFormKey = GlobalKey<FormState>();
|
||||
final forgetEmailKey = GlobalKey<FormState>();
|
||||
final forgetRegionKey = GlobalKey<FormState>();
|
||||
late bool checkValidate = false;
|
||||
|
||||
Timer? _timer;
|
||||
int _remainingTime = 0;
|
||||
List<RegionModel>? regionList = [RegionModel(name: 'name', id: 'id')];
|
||||
|
||||
Future<void> _onStartTimer(
|
||||
StartTimerEvent event, Emitter<AuthState> emit) async {
|
||||
Future _onStartTimer(StartTimerEvent event, Emitter<AuthState> emit) async {
|
||||
if (_validateInputs(emit)) return;
|
||||
if (_timer != null && _timer!.isActive) {
|
||||
return;
|
||||
}
|
||||
_remainingTime = 1;
|
||||
add(UpdateTimerEvent(
|
||||
remainingTime: _remainingTime, isButtonEnabled: false));
|
||||
_remainingTime = (await AuthenticationAPI.sendOtp(
|
||||
email: forgetEmailController.text, regionUuid: regionUuid))!;
|
||||
add(UpdateTimerEvent(remainingTime: _remainingTime, isButtonEnabled: false));
|
||||
try {
|
||||
forgetEmailValidate = '';
|
||||
_remainingTime = (await AuthenticationAPI.sendOtp(
|
||||
email: forgetEmailController.text, regionUuid: regionUuid))!;
|
||||
} on DioException catch (e) {
|
||||
if (e.response!.statusCode == 400) {
|
||||
final errorData = e.response!.data;
|
||||
String errorMessage = errorData['message'];
|
||||
if (errorMessage == 'User not found') {
|
||||
validate = 'Invalid Credential';
|
||||
emit(AuthInitialState());
|
||||
return 1;
|
||||
} else {
|
||||
validate = '';
|
||||
_remainingTime = errorData['data']['cooldown'] ?? 1;
|
||||
emit(AuthInitialState());
|
||||
}
|
||||
} else {
|
||||
emit(AuthInitialState());
|
||||
|
||||
return 1;
|
||||
}
|
||||
emit(AuthInitialState());
|
||||
} catch (e) {
|
||||
emit(AuthInitialState());
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
_timer = Timer.periodic(const Duration(seconds: 1), (timer) {
|
||||
_remainingTime--;
|
||||
if (_remainingTime <= 0) {
|
||||
_timer?.cancel();
|
||||
add(const UpdateTimerEvent(remainingTime: 0, isButtonEnabled: true));
|
||||
} else {
|
||||
add(UpdateTimerEvent(
|
||||
remainingTime: _remainingTime, isButtonEnabled: false));
|
||||
add(UpdateTimerEvent(remainingTime: _remainingTime, isButtonEnabled: false));
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -68,34 +94,39 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
emit(const TimerState(isButtonEnabled: true, remainingTime: 0));
|
||||
}
|
||||
|
||||
Future<void> changePassword(
|
||||
ChangePasswordEvent event, Emitter<AuthState> emit) async {
|
||||
try {
|
||||
emit(LoadingForgetState());
|
||||
var response = await AuthenticationAPI.verifyOtp(
|
||||
email: forgetEmailController.text, otpCode: forgetOtp.text);
|
||||
if (response == true) {
|
||||
await AuthenticationAPI.forgetPassword(
|
||||
password: forgetPasswordController.text,
|
||||
email: forgetEmailController.text);
|
||||
_timer?.cancel();
|
||||
emit(const TimerState(isButtonEnabled: true, remainingTime: 0));
|
||||
emit(SuccessForgetState());
|
||||
} else if (response == "You entered wrong otp") {
|
||||
forgetValidate = 'Wrong one time password.';
|
||||
emit(AuthInitialState());
|
||||
} else if (response == "OTP expired") {
|
||||
forgetValidate = 'One time password has been expired.';
|
||||
emit(AuthInitialState());
|
||||
Future<void> changePassword(ChangePasswordEvent event, Emitter<AuthState> emit) async {
|
||||
emit(LoadingForgetState());
|
||||
try {
|
||||
var response = await AuthenticationAPI.verifyOtp(
|
||||
email: forgetEmailController.text, otpCode: forgetOtp.text);
|
||||
if (response == true) {
|
||||
await AuthenticationAPI.forgetPassword(
|
||||
password: forgetPasswordController.text,
|
||||
email: forgetEmailController.text);
|
||||
_timer?.cancel();
|
||||
emit(const TimerState(isButtonEnabled: true, remainingTime: 0));
|
||||
emit(SuccessForgetState());
|
||||
}
|
||||
} on DioException catch (e) {
|
||||
final errorData = e.response!.data;
|
||||
String errorMessage = errorData['message'];
|
||||
if (errorMessage == 'this email is not registered') {
|
||||
validate = 'Invalid Credentials!';
|
||||
emit(AuthInitialState());
|
||||
} else if (errorMessage == "You entered wrong otp") {
|
||||
forgetValidate = 'Wrong one time password.';
|
||||
emit(AuthInitialState());
|
||||
} else if (errorMessage == "OTP expired") {
|
||||
forgetValidate = 'One time password has been expired.';
|
||||
emit(AuthInitialState());
|
||||
} else {
|
||||
validate = '';
|
||||
emit(AuthInitialState());
|
||||
}
|
||||
}
|
||||
} catch (failure) {
|
||||
// forgetValidate='Invalid Credentials!';
|
||||
emit(AuthInitialState());
|
||||
// emit(FailureForgetState(error: failure.toString()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//925207
|
||||
String? validateCode(String? value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Code is required';
|
||||
@ -104,9 +135,7 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
}
|
||||
|
||||
void _onUpdateTimer(UpdateTimerEvent event, Emitter<AuthState> emit) {
|
||||
emit(TimerState(
|
||||
isButtonEnabled: event.isButtonEnabled,
|
||||
remainingTime: event.remainingTime));
|
||||
emit(TimerState(isButtonEnabled: event.isButtonEnabled, remainingTime: event.remainingTime));
|
||||
}
|
||||
|
||||
///////////////////////////////////// login /////////////////////////////////////
|
||||
@ -120,6 +149,7 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
String otpCode = '';
|
||||
String validate = '';
|
||||
String forgetValidate = '';
|
||||
String forgetEmailValidate = '';
|
||||
String regionUuid = '';
|
||||
static Token token = Token.emptyConstructor();
|
||||
static UserModel? user;
|
||||
@ -127,7 +157,6 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
|
||||
void _login(LoginButtonPressed event, Emitter<AuthState> emit) async {
|
||||
emit(AuthLoading());
|
||||
|
||||
if (isChecked) {
|
||||
try {
|
||||
if (event.username.isEmpty || event.password.isEmpty) {
|
||||
@ -138,20 +167,17 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
|
||||
token = await AuthenticationAPI.loginWithEmail(
|
||||
model: LoginWithEmailModel(
|
||||
email: event.username,
|
||||
password: event.password,
|
||||
regionUuid: event.regionUuid),
|
||||
email: event.username, password: event.password, regionUuid: event.regionUuid),
|
||||
);
|
||||
} catch (failure) {
|
||||
validate = 'Invalid Credentials!';
|
||||
emit(const LoginFailure(error: 'Invalid Credentials!'));
|
||||
emit(LoginInitial());
|
||||
return;
|
||||
}
|
||||
|
||||
if (token.accessTokenIsNotEmpty) {
|
||||
FlutterSecureStorage storage = const FlutterSecureStorage();
|
||||
await storage.write(
|
||||
key: Token.loginAccessTokenKey, value: token.accessToken);
|
||||
await storage.write(key: Token.loginAccessTokenKey, value: token.accessToken);
|
||||
const FlutterSecureStorage().write(
|
||||
key: UserModel.userUuidKey,
|
||||
value: Token.decodeToken(token.accessToken)['uuid'].toString());
|
||||
@ -178,15 +204,15 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
emit(LoginInitial());
|
||||
}
|
||||
|
||||
checkOtpCode(
|
||||
ChangePasswordEvent event,
|
||||
Emitter<AuthState> emit,
|
||||
) async {
|
||||
emit(LoadingForgetState());
|
||||
await AuthenticationAPI.verifyOtp(
|
||||
email: forgetEmailController.text, otpCode: forgetOtp.text);
|
||||
emit(SuccessForgetState());
|
||||
}
|
||||
// checkOtpCode(
|
||||
// ChangePasswordEvent event,
|
||||
// Emitter<AuthState> emit,
|
||||
// ) async {
|
||||
// emit(LoadingForgetState());
|
||||
// await AuthenticationAPI.verifyOtp(
|
||||
// email: forgetEmailController.text, otpCode: forgetOtp.text);
|
||||
// emit(SuccessForgetState());
|
||||
// }
|
||||
|
||||
void _passwordVisible(PasswordVisibleEvent event, Emitter<AuthState> emit) {
|
||||
emit(AuthLoading());
|
||||
@ -209,9 +235,10 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
return 'Email is required';
|
||||
} else if (!RegExp(r'^[^@]+@[^@]+\.[^@]+').hasMatch(value)) {
|
||||
return 'Enter a valid email address';
|
||||
} else if (regionUuid == '') {
|
||||
return 'Please select your region';
|
||||
}
|
||||
// else if (regionUuid == '') {
|
||||
// return 'Please select your region';
|
||||
// }
|
||||
validate = '';
|
||||
return null;
|
||||
}
|
||||
@ -227,7 +254,9 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
emit(LoadingForgetState());
|
||||
final nameError = validateEmail(forgetEmailController.text);
|
||||
if (nameError != null) {
|
||||
emit(FailureForgetState(error: nameError));
|
||||
forgetEmailValidate = nameError;
|
||||
emit(AuthInitialState());
|
||||
// emit(FailureForgetState(error: nameError));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -306,14 +335,12 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
static Future<String> getTokenAndValidate() async {
|
||||
try {
|
||||
const storage = FlutterSecureStorage();
|
||||
final firstLaunch = await SharedPreferencesHelper.readBoolFromSP(
|
||||
StringsManager.firstLaunch) ??
|
||||
true;
|
||||
final firstLaunch =
|
||||
await SharedPreferencesHelper.readBoolFromSP(StringsManager.firstLaunch) ?? true;
|
||||
if (firstLaunch) {
|
||||
storage.deleteAll();
|
||||
}
|
||||
await SharedPreferencesHelper.saveBoolToSP(
|
||||
StringsManager.firstLaunch, false);
|
||||
await SharedPreferencesHelper.saveBoolToSP(StringsManager.firstLaunch, false);
|
||||
final value = await storage.read(key: Token.loginAccessTokenKey) ?? '';
|
||||
if (value.isEmpty) {
|
||||
return 'Token not found';
|
||||
@ -349,6 +376,7 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
try {
|
||||
emit(AuthLoading());
|
||||
regionUuid = event.val;
|
||||
add(CheckEnableEvent());
|
||||
emit(AuthInitialState());
|
||||
} catch (e) {
|
||||
emit(FailureForgetState(error: e.toString()));
|
||||
@ -365,9 +393,7 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
final String formattedTime = [
|
||||
if (days > 0) '${days}d', // Append 'd' for days
|
||||
if (days > 0 || hours > 0)
|
||||
hours
|
||||
.toString()
|
||||
.padLeft(2, '0'), // Show hours if there are days or hours
|
||||
hours.toString().padLeft(2, '0'), // Show hours if there are days or hours
|
||||
minutes.toString().padLeft(2, '0'),
|
||||
seconds.toString().padLeft(2, '0'),
|
||||
].join(':');
|
||||
@ -405,4 +431,9 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
forgetValidate = '';
|
||||
emit(LoginInitial());
|
||||
}
|
||||
|
||||
static logout() {
|
||||
const storage = FlutterSecureStorage();
|
||||
storage.deleteAll();
|
||||
}
|
||||
}
|
||||
|
@ -49,9 +49,13 @@ class UpdateTimerEvent extends AuthEvent {
|
||||
const UpdateTimerEvent({required this.remainingTime, required this.isButtonEnabled});
|
||||
}
|
||||
|
||||
class ChangePasswordEvent extends AuthEvent {}
|
||||
class ChangePasswordEvent extends AuthEvent {
|
||||
|
||||
class SendOtpEvent extends AuthEvent {}
|
||||
}
|
||||
|
||||
class SendOtpEvent extends AuthEvent {
|
||||
|
||||
}
|
||||
|
||||
class PasswordVisibleEvent extends AuthEvent {
|
||||
final bool? newValue;
|
||||
|
@ -1,3 +1,4 @@
|
||||
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
@ -137,88 +138,52 @@ class ForgetPasswordWebPage extends StatelessWidget {
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Country/Region",
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodySmall!
|
||||
.copyWith(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
child: DropdownButtonFormField<String>(
|
||||
validator: forgetBloc.validateRegion,
|
||||
icon: const Icon(
|
||||
Icons.keyboard_arrow_down_outlined,
|
||||
),
|
||||
decoration:
|
||||
textBoxDecoration()!.copyWith(
|
||||
hintText: null,
|
||||
),
|
||||
hint: SizedBox(
|
||||
width: size.width * 0.12,
|
||||
child: const Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'Select your region/country',
|
||||
textAlign: TextAlign.center,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
),
|
||||
isDense: true,
|
||||
style: const TextStyle(
|
||||
color: Colors.black),
|
||||
items: forgetBloc.regionList!
|
||||
.map((RegionModel region) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: region.id,
|
||||
child: SizedBox(
|
||||
width: size.width * 0.06,
|
||||
child: Text(region.name)),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (String? value) {
|
||||
forgetBloc.add(SelectRegionEvent(
|
||||
val: value!,
|
||||
));
|
||||
},
|
||||
),
|
||||
)
|
||||
Form(
|
||||
key: forgetBloc.forgetRegionKey,
|
||||
child: SizedBox(
|
||||
child: _buildDropdownField(
|
||||
context, forgetBloc, size)))
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Account",
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodySmall!
|
||||
.copyWith(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
child: TextFormField(
|
||||
validator: forgetBloc.validateEmail,
|
||||
controller:
|
||||
forgetBloc.forgetEmailController,
|
||||
decoration: textBoxDecoration()!
|
||||
.copyWith(
|
||||
hintText: 'Enter your email'),
|
||||
style: const TextStyle(
|
||||
color: Colors.black),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Form(
|
||||
key: forgetBloc.forgetEmailKey,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Account",
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodySmall!
|
||||
.copyWith(
|
||||
fontSize: 14,
|
||||
fontWeight:
|
||||
FontWeight.w400),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
child: TextFormField(
|
||||
controller: forgetBloc.forgetEmailController,
|
||||
validator: forgetBloc.validateEmail,
|
||||
decoration:
|
||||
textBoxDecoration()!.copyWith(
|
||||
hintText: 'Enter your email',
|
||||
hintStyle: Theme.of(context)
|
||||
.textTheme.bodySmall!.copyWith(
|
||||
color: ColorsManager.grayColor,
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
style: const TextStyle(
|
||||
color: Colors.black),
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
const SizedBox(height: 20.0),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
@ -244,19 +209,24 @@ class ForgetPasswordWebPage extends StatelessWidget {
|
||||
decoration:
|
||||
textBoxDecoration()!.copyWith(
|
||||
hintText: 'Enter Code',
|
||||
hintStyle: Theme.of(context).textTheme
|
||||
.bodySmall!.copyWith(
|
||||
color: ColorsManager.grayColor,
|
||||
fontWeight: FontWeight.w400),
|
||||
suffixIcon: SizedBox(
|
||||
width: 100,
|
||||
child: Center(
|
||||
child: InkWell(
|
||||
onTap: state is TimerState &&
|
||||
!state
|
||||
.isButtonEnabled &&
|
||||
state.remainingTime !=
|
||||
1
|
||||
!state.isButtonEnabled &&
|
||||
state.remainingTime != 1
|
||||
? null
|
||||
: () {
|
||||
forgetBloc.add(
|
||||
StartTimerEvent());
|
||||
if (forgetBloc.forgetEmailKey.currentState!.validate()||forgetBloc.forgetRegionKey.currentState!.validate()) {
|
||||
if(forgetBloc.forgetRegionKey.currentState!.validate()){
|
||||
forgetBloc.add(StartTimerEvent());
|
||||
}
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
'Get Code ${state is TimerState && !state.isButtonEnabled && state.remainingTime != 1 ? "(${forgetBloc.formattedTime(state.remainingTime)}) " : ""}',
|
||||
@ -311,15 +281,42 @@ class ForgetPasswordWebPage extends StatelessWidget {
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
child: TextFormField(
|
||||
validator:
|
||||
forgetBloc.passwordValidator,
|
||||
obscureText: forgetBloc.obscureText,
|
||||
keyboardType:
|
||||
TextInputType.visiblePassword,
|
||||
validator:
|
||||
forgetBloc.passwordValidator,
|
||||
controller: forgetBloc
|
||||
.forgetPasswordController,
|
||||
decoration:
|
||||
textBoxDecoration()!.copyWith(
|
||||
suffixIcon: IconButton(
|
||||
onPressed: () {
|
||||
forgetBloc.add(
|
||||
PasswordVisibleEvent(
|
||||
newValue: forgetBloc
|
||||
.obscureText));
|
||||
},
|
||||
icon: SizedBox(
|
||||
child: SvgPicture.asset(
|
||||
forgetBloc.obscureText
|
||||
? Assets.visiblePassword
|
||||
: Assets
|
||||
.invisiblePassword,
|
||||
height: 15,
|
||||
width: 15,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: 'At least 8 characters',
|
||||
hintStyle: Theme.of(context)
|
||||
.textTheme
|
||||
.bodySmall!
|
||||
.copyWith(
|
||||
color:
|
||||
ColorsManager.grayColor,
|
||||
fontWeight:
|
||||
FontWeight.w400),
|
||||
),
|
||||
style: const TextStyle(
|
||||
color: Colors.black),
|
||||
@ -343,11 +340,12 @@ class ForgetPasswordWebPage extends StatelessWidget {
|
||||
ColorsManager.btnColor,
|
||||
child: const Text('Submit'),
|
||||
onPressed: () {
|
||||
if (forgetBloc
|
||||
.forgetFormKey.currentState!
|
||||
.validate()) {
|
||||
forgetBloc
|
||||
.add(ChangePasswordEvent());
|
||||
if (forgetBloc.forgetFormKey.currentState!.validate() ||
|
||||
forgetBloc.forgetEmailKey.currentState!.validate() ) {
|
||||
if( forgetBloc.forgetEmailKey.currentState!.validate()
|
||||
&&forgetBloc.forgetFormKey.currentState!.validate() ){
|
||||
forgetBloc.add(ChangePasswordEvent());
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
@ -355,41 +353,39 @@ class ForgetPasswordWebPage extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
SizedBox(
|
||||
child: Text(
|
||||
forgetBloc.validate,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
color: ColorsManager.red),
|
||||
Center(
|
||||
child: SizedBox(
|
||||
child: Text(
|
||||
forgetBloc.validate,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
color: ColorsManager.red),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(
|
||||
width: size.width * 0.2,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Flexible(
|
||||
child: Text(
|
||||
"Do you have an account? ",
|
||||
style: TextStyle(color: Colors.white),
|
||||
)),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
forgetBloc.add(StopTimerEvent());
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: const Flexible(
|
||||
child: Text(
|
||||
"Sign in",
|
||||
)),
|
||||
),
|
||||
],
|
||||
child: Center(
|
||||
child: Wrap(
|
||||
children: [
|
||||
const Text(
|
||||
"Do you have an account? ",
|
||||
style:
|
||||
TextStyle(color: Colors.white),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
forgetBloc.add(StopTimerEvent());
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: const Text(
|
||||
"Sign in",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
@ -410,4 +406,164 @@ class ForgetPasswordWebPage extends StatelessWidget {
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildDropdownField(
|
||||
BuildContext context, AuthBloc loginBloc, Size size) {
|
||||
final TextEditingController textEditingController = TextEditingController();
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Country/Region",
|
||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
width: size.width * 0.9,
|
||||
child: FormField<String>(
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Please select a country/region';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
builder: (FormFieldState<String> field) {
|
||||
return InputDecorator(
|
||||
decoration: InputDecoration(
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 2, vertical: 10),
|
||||
errorText: field.errorText,
|
||||
filled:
|
||||
true, // Ensure the dropdown is filled with the background color
|
||||
fillColor: ColorsManager
|
||||
.boxColor, // Match the dropdown container color
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
borderSide: BorderSide(
|
||||
color: field.hasError ? Colors.red : Colors.transparent,
|
||||
width: 1.5,
|
||||
),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
field.hasError ? Colors.red : ColorsManager.grayColor,
|
||||
width: 1.5,
|
||||
),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
field.hasError ? Colors.red : ColorsManager.grayColor,
|
||||
width: 1.5,
|
||||
),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
borderSide: BorderSide(
|
||||
color: Colors.red,
|
||||
width: 1.5,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButton2<String>(
|
||||
isExpanded: true,
|
||||
hint: Text(
|
||||
'Select your region/country',
|
||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
color: ColorsManager.grayColor,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
items: loginBloc.regionList!.map((RegionModel region) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: region.id,
|
||||
child: Text(
|
||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
region.name,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
value: loginBloc.regionList!
|
||||
.any((region) => region.id == loginBloc.regionUuid)
|
||||
? loginBloc.regionUuid
|
||||
: null,
|
||||
onChanged: (String? value) {
|
||||
if (value != null) {
|
||||
loginBloc.add(SelectRegionEvent(val: value));
|
||||
field.didChange(
|
||||
value); // Notify the form field of the change
|
||||
}
|
||||
},
|
||||
buttonStyleData: const ButtonStyleData(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
height: 40,
|
||||
width: double.infinity,
|
||||
),
|
||||
dropdownStyleData: DropdownStyleData(
|
||||
maxHeight: size.height * 0.70,
|
||||
decoration: BoxDecoration(
|
||||
color: ColorsManager
|
||||
.boxColor, // Match dropdown background color to the container
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
menuItemStyleData: const MenuItemStyleData(
|
||||
height: 40,
|
||||
),
|
||||
dropdownSearchData: DropdownSearchData(
|
||||
searchController: textEditingController,
|
||||
searchInnerWidgetHeight: 50,
|
||||
searchInnerWidget: Container(
|
||||
height: 50,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8, vertical: 4),
|
||||
child: TextFormField(
|
||||
style: const TextStyle(color: Colors.black),
|
||||
controller: textEditingController,
|
||||
decoration: textBoxDecoration()!.copyWith(
|
||||
errorStyle: const TextStyle(height: 0),
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
vertical: 12,
|
||||
horizontal: 10,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
searchMatchFn: (item, searchValue) {
|
||||
final regionName =
|
||||
(item.child as Text).data?.toLowerCase() ?? '';
|
||||
final search = searchValue.toLowerCase().trim();
|
||||
return regionName.contains(search);
|
||||
},
|
||||
),
|
||||
onMenuStateChange: (isOpen) {
|
||||
if (!isOpen) {
|
||||
textEditingController.clear();
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
@ -23,7 +24,8 @@ class LoginWebPage extends StatefulWidget {
|
||||
State<LoginWebPage> createState() => _LoginWebPageState();
|
||||
}
|
||||
|
||||
class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout {
|
||||
class _LoginWebPageState extends State<LoginWebPage>
|
||||
with HelperResponsiveLayout {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@ -58,7 +60,8 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
|
||||
_scrollController = ScrollController();
|
||||
|
||||
void _scrollToCenter() {
|
||||
final double middlePosition = _scrollController.position.maxScrollExtent / 2;
|
||||
final double middlePosition =
|
||||
_scrollController.position.maxScrollExtent / 2;
|
||||
_scrollController.animateTo(
|
||||
middlePosition,
|
||||
duration: const Duration(seconds: 1),
|
||||
@ -120,7 +123,8 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
|
||||
const Spacer(),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: _buildLoginFormFields(context, loginBloc, size),
|
||||
child: _buildLoginFormFields(
|
||||
context, loginBloc, size),
|
||||
),
|
||||
const Spacer(),
|
||||
],
|
||||
@ -131,12 +135,14 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
|
||||
),
|
||||
),
|
||||
),
|
||||
if (state is AuthLoading) const Center(child: CircularProgressIndicator())
|
||||
if (state is AuthLoading)
|
||||
const Center(child: CircularProgressIndicator())
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildLoginFormFields(BuildContext context, AuthBloc loginBloc, Size size) {
|
||||
Widget _buildLoginFormFields(
|
||||
BuildContext context, AuthBloc loginBloc, Size size) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.1),
|
||||
@ -146,8 +152,8 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
|
||||
child: Form(
|
||||
key: loginBloc.loginFormKey,
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: size.width * 0.02, vertical: size.width * 0.003),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: size.width * 0.02, vertical: size.width * 0.003),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@ -175,88 +181,112 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildDropdownField(BuildContext context, AuthBloc loginBloc, Size size) {
|
||||
|
||||
Widget _buildDropdownField(
|
||||
BuildContext context, AuthBloc loginBloc, Size size) {
|
||||
final TextEditingController textEditingController = TextEditingController();
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Country/Region",
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodySmall!
|
||||
.copyWith(fontSize: 14, fontWeight: FontWeight.w400),
|
||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
width: size.width * 0.8,
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
return DropdownButtonFormField<String>(
|
||||
value: loginBloc.regionList!.any((region) => region.id == loginBloc.regionUuid)
|
||||
? loginBloc.regionUuid
|
||||
: null,
|
||||
validator: loginBloc.validateRegion,
|
||||
icon: const Icon(
|
||||
Icons.keyboard_arrow_down_outlined,
|
||||
size: 20,
|
||||
Container(
|
||||
height: 50,
|
||||
decoration: const BoxDecoration(
|
||||
color: ColorsManager.boxColor,
|
||||
borderRadius: BorderRadius.all(Radius.circular(8)),
|
||||
),
|
||||
width: size.width * 0.9,
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButton2<String>(
|
||||
style: TextStyle(color: Colors.black),
|
||||
isExpanded: true,
|
||||
hint: Text(
|
||||
'Select your region/country',
|
||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
color: ColorsManager.grayColor,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
decoration: textBoxDecoration()!.copyWith(
|
||||
errorStyle: const TextStyle(height: 0),
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
vertical: 12,
|
||||
horizontal: 10,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
items: loginBloc.regionList!.map((RegionModel region) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: region.id, // Use region.id as the value
|
||||
child: Text(
|
||||
region.name,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
),
|
||||
),
|
||||
hint: Text(
|
||||
'Select your region/country',
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodySmall!
|
||||
.copyWith(color: ColorsManager.grayColor, fontWeight: FontWeight.w400),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
isDense: true,
|
||||
style: const TextStyle(color: Colors.black),
|
||||
items: loginBloc.regionList!.map((RegionModel region) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: region.id,
|
||||
child: Container(
|
||||
constraints: BoxConstraints(maxWidth: constraints.maxWidth - 40),
|
||||
child: Text(
|
||||
region.name,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
);
|
||||
}).toList(),
|
||||
value: loginBloc.regionList!.any(
|
||||
(region) => region.id == loginBloc.regionUuid,)
|
||||
? loginBloc.regionUuid
|
||||
: null,
|
||||
onChanged: (String? value) {
|
||||
if (value != null) {
|
||||
loginBloc.add(CheckEnableEvent());
|
||||
loginBloc.add(SelectRegionEvent(val: value));
|
||||
}
|
||||
},
|
||||
buttonStyleData: const ButtonStyleData(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
height: 40,
|
||||
width: double.infinity,
|
||||
),
|
||||
dropdownStyleData: DropdownStyleData(
|
||||
maxHeight: size.height * 0.70,
|
||||
),
|
||||
menuItemStyleData: const MenuItemStyleData(
|
||||
height: 40,
|
||||
),
|
||||
dropdownSearchData: DropdownSearchData(
|
||||
searchController: textEditingController,
|
||||
searchInnerWidgetHeight: 50,
|
||||
searchInnerWidget: Container(
|
||||
height: 50,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
child: TextFormField(
|
||||
style: const TextStyle(color: Colors.black),
|
||||
controller: textEditingController,
|
||||
decoration: textBoxDecoration()!.copyWith(
|
||||
errorStyle: const TextStyle(height: 0),
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
vertical: 12,
|
||||
horizontal: 10,
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (String? value) {
|
||||
loginBloc.add(CheckEnableEvent());
|
||||
loginBloc.add(SelectRegionEvent(val: value!));
|
||||
),
|
||||
),
|
||||
searchMatchFn: (item, searchValue) {
|
||||
// Use the item's child text (region name) for searching.
|
||||
final regionName = (item.child as Text).data?.toLowerCase() ?? '';
|
||||
final search = searchValue.toLowerCase().trim();
|
||||
// Debugging print statement to ensure values are captured correctly.
|
||||
// Return true if the region name contains the search term.
|
||||
return regionName.contains(search);
|
||||
},
|
||||
dropdownColor: Colors.white,
|
||||
menuMaxHeight: size.height * 0.45,
|
||||
selectedItemBuilder: (context) {
|
||||
return loginBloc.regionList!.map<Widget>((region) {
|
||||
return Container(
|
||||
constraints: BoxConstraints(maxWidth: constraints.maxWidth - 40),
|
||||
child: Text(
|
||||
region.name,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
),
|
||||
);
|
||||
}).toList();
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
onMenuStateChange: (isOpen) {
|
||||
if (!isOpen) {
|
||||
textEditingController.clear();
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Widget _buildEmailField(BuildContext context, AuthBloc loginBloc) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@ -280,10 +310,9 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
|
||||
decoration: textBoxDecoration()!.copyWith(
|
||||
errorStyle: const TextStyle(height: 0),
|
||||
hintText: 'Enter your email address',
|
||||
hintStyle: Theme.of(context)
|
||||
.textTheme
|
||||
.bodySmall!
|
||||
.copyWith(color: ColorsManager.grayColor, fontWeight: FontWeight.w400)),
|
||||
hintStyle: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
color: ColorsManager.grayColor,
|
||||
fontWeight: FontWeight.w400)),
|
||||
style: const TextStyle(color: Colors.black),
|
||||
),
|
||||
),
|
||||
@ -315,17 +344,18 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
|
||||
controller: loginBloc.loginPasswordController,
|
||||
decoration: textBoxDecoration()!.copyWith(
|
||||
hintText: 'At least 8 characters',
|
||||
hintStyle: Theme.of(context)
|
||||
.textTheme
|
||||
.bodySmall!
|
||||
.copyWith(color: ColorsManager.grayColor, fontWeight: FontWeight.w400),
|
||||
hintStyle: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
color: ColorsManager.grayColor, fontWeight: FontWeight.w400),
|
||||
suffixIcon: IconButton(
|
||||
onPressed: () {
|
||||
loginBloc.add(PasswordVisibleEvent(newValue: loginBloc.obscureText));
|
||||
loginBloc.add(
|
||||
PasswordVisibleEvent(newValue: loginBloc.obscureText));
|
||||
},
|
||||
icon: SizedBox(
|
||||
child: SvgPicture.asset(
|
||||
loginBloc.obscureText ? Assets.visiblePassword : Assets.invisiblePassword,
|
||||
loginBloc.obscureText
|
||||
? Assets.visiblePassword
|
||||
: Assets.invisiblePassword,
|
||||
height: 15,
|
||||
width: 15,
|
||||
),
|
||||
@ -353,10 +383,10 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
|
||||
},
|
||||
child: Text(
|
||||
"Forgot Password?",
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodySmall!
|
||||
.copyWith(color: Colors.black, fontSize: 14, fontWeight: FontWeight.w400),
|
||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
color: Colors.black,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -380,38 +410,39 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 220,
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text: 'Agree to ',
|
||||
style: const TextStyle(color: Colors.white),
|
||||
children: [
|
||||
TextSpan(
|
||||
text: '(Terms of Service)',
|
||||
style: const TextStyle(color: Colors.black),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
loginBloc.launchURL('https://example.com/terms');
|
||||
},
|
||||
),
|
||||
TextSpan(
|
||||
text: ' (Legal Statement)',
|
||||
style: const TextStyle(color: Colors.black),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
loginBloc.launchURL('https://example.com/legal');
|
||||
},
|
||||
),
|
||||
TextSpan(
|
||||
text: ' (Privacy Statement)',
|
||||
style: const TextStyle(color: Colors.black),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
loginBloc.launchURL('https://example.com/privacy');
|
||||
},
|
||||
),
|
||||
],
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text: 'Agree to ',
|
||||
style: const TextStyle(color: Colors.white),
|
||||
children: [
|
||||
TextSpan(
|
||||
text: '(Terms of Service)',
|
||||
style: const TextStyle(color: Colors.black),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
loginBloc.launchURL('https://example.com/terms');
|
||||
},
|
||||
),
|
||||
TextSpan(
|
||||
text: ' (Legal Statement)',
|
||||
style: const TextStyle(color: Colors.black),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
loginBloc.launchURL('https://example.com/legal');
|
||||
},
|
||||
),
|
||||
TextSpan(
|
||||
text: ' (Privacy Statement)',
|
||||
style: const TextStyle(color: Colors.black),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
loginBloc.launchURL('https://example.com/privacy');
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -419,7 +450,8 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSignInButton(BuildContext context, AuthBloc loginBloc, Size size) {
|
||||
Widget _buildSignInButton(
|
||||
BuildContext context, AuthBloc loginBloc, Size size) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -460,7 +492,8 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
|
||||
SizedBox(
|
||||
child: Text(
|
||||
loginBloc.validate,
|
||||
style: const TextStyle(fontWeight: FontWeight.w700, color: ColorsManager.red),
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w700, color: ColorsManager.red),
|
||||
),
|
||||
)
|
||||
],
|
||||
|
@ -1,23 +1,23 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/three_gang_switch/bloc/living_room_bloc.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
|
||||
class ToggleWidget extends StatelessWidget {
|
||||
class CurtainToggle extends StatelessWidget {
|
||||
final bool value;
|
||||
final String code;
|
||||
final String deviceId;
|
||||
final String label;
|
||||
final Null Function(dynamic value) onChanged;
|
||||
|
||||
const ToggleWidget({
|
||||
const CurtainToggle({
|
||||
super.key,
|
||||
required this.value,
|
||||
required this.code,
|
||||
required this.deviceId,
|
||||
required this.label,
|
||||
required this.onChanged,
|
||||
});
|
||||
|
||||
@override
|
||||
@ -37,30 +37,23 @@ class ToggleWidget extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
ClipOval(
|
||||
child: Container(
|
||||
color: ColorsManager.whiteColors,
|
||||
child: SvgPicture.asset(
|
||||
Assets.lightPulp,
|
||||
width: 60,
|
||||
height: 60,
|
||||
fit: BoxFit.cover,
|
||||
child: Container(
|
||||
color: ColorsManager.whiteColors,
|
||||
child: SvgPicture.asset(
|
||||
Assets.curtainIcon,
|
||||
width: 60,
|
||||
height: 60,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
width: 35,
|
||||
child: CupertinoSwitch(
|
||||
value: value,
|
||||
activeColor: ColorsManager.dialogBlueTitle,
|
||||
onChanged: (newValue) {
|
||||
context.read<LivingRoomBloc>().add(
|
||||
LivingRoomControl(
|
||||
deviceId: deviceId,
|
||||
code: code,
|
||||
value: newValue,
|
||||
),
|
||||
);
|
||||
},
|
||||
onChanged: onChanged,
|
||||
),
|
||||
),
|
||||
],
|
@ -1,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
|
||||
Future<void> showCustomDialog({
|
||||
required BuildContext context,
|
||||
@ -13,7 +12,7 @@ Future<void> showCustomDialog({
|
||||
double? iconWidth,
|
||||
VoidCallback? onOkPressed,
|
||||
bool barrierDismissible = false,
|
||||
required actions,
|
||||
required List<Widget> actions,
|
||||
}) {
|
||||
return showDialog(
|
||||
context: context,
|
||||
@ -21,59 +20,43 @@ Future<void> showCustomDialog({
|
||||
builder: (BuildContext context) {
|
||||
final size = MediaQuery.of(context).size;
|
||||
return AlertDialog(
|
||||
alignment: Alignment.center,
|
||||
content: SizedBox(
|
||||
height: dialogHeight ?? size.height * 0.15,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
if (iconPath != null)
|
||||
SvgPicture.asset(
|
||||
iconPath,
|
||||
height: iconHeight ?? 35,
|
||||
width: iconWidth ?? 35,
|
||||
),
|
||||
if (title != null)
|
||||
alignment: Alignment.center,
|
||||
content: SizedBox(
|
||||
height: dialogHeight ?? size.height * 0.15,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
if (iconPath != null)
|
||||
SvgPicture.asset(
|
||||
iconPath,
|
||||
height: iconHeight ?? 35,
|
||||
width: iconWidth ?? 35,
|
||||
),
|
||||
if (title != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Text(
|
||||
title,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.headlineLarge!
|
||||
.copyWith(fontSize: 20, fontWeight: FontWeight.w400, color: Colors.black),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Text(
|
||||
title,
|
||||
style: Theme.of(context).textTheme.headlineLarge!.copyWith(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Colors.black),
|
||||
message,
|
||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(color: Colors.black),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Text(
|
||||
message,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyMedium!
|
||||
.copyWith(color: Colors.black),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
if(widget!=null)
|
||||
Expanded(child:widget)
|
||||
],
|
||||
),
|
||||
),
|
||||
actionsAlignment: MainAxisAlignment.center,
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
onPressed: onOkPressed ?? () => Navigator.of(context).pop(),
|
||||
child: Text(
|
||||
'OK',
|
||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
fontWeight: FontWeight.w400,
|
||||
color: ColorsManager.blackColor,
|
||||
fontSize: 16),
|
||||
if (widget != null) Expanded(child: widget)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
actionsAlignment: MainAxisAlignment.center,
|
||||
actions: actions);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -5,11 +5,13 @@ import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
|
||||
class DynamicTable extends StatefulWidget {
|
||||
final List<String> headers;
|
||||
final String? tableName;
|
||||
final List<List<dynamic>> data;
|
||||
final BoxDecoration? headerDecoration;
|
||||
final BoxDecoration? cellDecoration;
|
||||
final Size size;
|
||||
final bool withCheckBox;
|
||||
final bool withSelectAll;
|
||||
final bool isEmpty;
|
||||
final void Function(bool?)? selectAll;
|
||||
final void Function(int, bool, dynamic)? onRowSelected;
|
||||
@ -20,8 +22,10 @@ class DynamicTable extends StatefulWidget {
|
||||
required this.headers,
|
||||
required this.data,
|
||||
required this.size,
|
||||
this.tableName,
|
||||
required this.isEmpty,
|
||||
required this.withCheckBox,
|
||||
required this.withSelectAll,
|
||||
this.headerDecoration,
|
||||
this.cellDecoration,
|
||||
this.selectAll,
|
||||
@ -36,6 +40,7 @@ class DynamicTable extends StatefulWidget {
|
||||
|
||||
class _DynamicTableState extends State<DynamicTable> {
|
||||
late List<bool> _selected;
|
||||
bool _selectAll = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@ -52,13 +57,19 @@ class _DynamicTableState extends State<DynamicTable> {
|
||||
}
|
||||
|
||||
void _initializeSelection() {
|
||||
_selected = List<bool>.generate(widget.data.length, (index) {
|
||||
// Check if the initialSelectedIds contains the deviceUuid
|
||||
// uuidIndex is the index of the column containing the deviceUuid
|
||||
final deviceUuid = widget.data[index][widget.uuidIndex];
|
||||
return widget.initialSelectedIds != null &&
|
||||
widget.initialSelectedIds!.contains(deviceUuid);
|
||||
});
|
||||
if (widget.data.isEmpty) {
|
||||
_selected = [];
|
||||
_selectAll = false;
|
||||
} else {
|
||||
_selected = List<bool>.generate(widget.data.length, (index) {
|
||||
// Check if the initialSelectedIds contains the deviceUuid
|
||||
// uuidIndex is the index of the column containing the deviceUuid
|
||||
final deviceUuid = widget.data[index][widget.uuidIndex];
|
||||
return widget.initialSelectedIds != null &&
|
||||
widget.initialSelectedIds!.contains(deviceUuid);
|
||||
});
|
||||
_selectAll = _selected.every((element) => element == true);
|
||||
}
|
||||
}
|
||||
|
||||
void _toggleRowSelection(int index) {
|
||||
@ -71,6 +82,18 @@ class _DynamicTableState extends State<DynamicTable> {
|
||||
});
|
||||
}
|
||||
|
||||
void _toggleSelectAll(bool? value) {
|
||||
setState(() {
|
||||
_selectAll = value ?? false;
|
||||
_selected = List<bool>.filled(widget.data.length, _selectAll);
|
||||
for (int i = 0; i < widget.data.length; i++) {
|
||||
if (widget.onRowSelected != null) {
|
||||
widget.onRowSelected!(i, _selectAll, widget.data[i]);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
@ -108,7 +131,10 @@ class _DynamicTableState extends State<DynamicTable> {
|
||||
height: 15,
|
||||
),
|
||||
Text(
|
||||
'No Devices',
|
||||
// no password
|
||||
widget.tableName == 'AccessManagement'
|
||||
? 'No Password '
|
||||
: 'No Devices',
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodySmall!
|
||||
@ -161,8 +187,10 @@ class _DynamicTableState extends State<DynamicTable> {
|
||||
),
|
||||
),
|
||||
child: Checkbox(
|
||||
value: _selected.every((element) => element == true),
|
||||
onChanged: null,
|
||||
value: _selectAll,
|
||||
onChanged: widget.withSelectAll && widget.data.isNotEmpty
|
||||
? _toggleSelectAll
|
||||
: null,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class HourPickerDialog extends StatefulWidget {
|
||||
final TimeOfDay initialTime;
|
||||
|
||||
const HourPickerDialog({super.key, required this.initialTime});
|
||||
|
||||
@override
|
||||
@ -9,70 +12,50 @@ class HourPickerDialog extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _HourPickerDialogState extends State<HourPickerDialog> {
|
||||
late int _selectedHour;
|
||||
bool _isPm = false;
|
||||
late String selectedHour;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_selectedHour = widget.initialTime.hour > 12
|
||||
? widget.initialTime.hour - 12
|
||||
: widget.initialTime.hour;
|
||||
_isPm = widget.initialTime.period == DayPeriod.pm;
|
||||
// Initialize the selectedHour with the initial time passed to the dialog
|
||||
selectedHour = widget.initialTime.hour.toString().padLeft(2, '0') + ':00';
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Select Hour'),
|
||||
content: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
DropdownButton<int>(
|
||||
value: _selectedHour,
|
||||
items: List.generate(12, (index) {
|
||||
int displayHour = index + 1;
|
||||
return DropdownMenuItem(
|
||||
value: displayHour,
|
||||
child: Text(displayHour.toString()),
|
||||
);
|
||||
}),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_selectedHour = value!;
|
||||
});
|
||||
},
|
||||
),
|
||||
SizedBox(width: 16.0),
|
||||
DropdownButton<bool>(
|
||||
value: _isPm,
|
||||
items: const [
|
||||
DropdownMenuItem(
|
||||
value: false,
|
||||
child: Text('AM'),
|
||||
),
|
||||
DropdownMenuItem(
|
||||
value: true,
|
||||
child: Text('PM'),
|
||||
),
|
||||
],
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_isPm = value!;
|
||||
});
|
||||
},
|
||||
),
|
||||
],
|
||||
content: DropdownButton<String>(
|
||||
value: selectedHour, // Show the currently selected hour
|
||||
items: List.generate(24, (index) {
|
||||
String hour = index.toString().padLeft(2, '0');
|
||||
return DropdownMenuItem<String>(
|
||||
value: '$hour:00',
|
||||
child: Text('$hour:00'),
|
||||
);
|
||||
}),
|
||||
onChanged: (String? newValue) {
|
||||
if (newValue != null) {
|
||||
setState(() {
|
||||
selectedHour = newValue; // Update the selected hour without closing the dialog
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(null),
|
||||
onPressed: () => Navigator.of(context).pop(null), // Close the dialog without selection
|
||||
child: const Text('Cancel'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
int hour = _isPm ? _selectedHour + 12 : _selectedHour;
|
||||
Navigator.of(context).pop(TimeOfDay(hour: hour, minute: 0));
|
||||
// Close the dialog and return the selected time
|
||||
Navigator.of(context).pop(
|
||||
TimeOfDay(
|
||||
hour: int.parse(selectedHour.split(':')[0]),
|
||||
minute: 0,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: const Text('OK'),
|
||||
),
|
||||
@ -86,6 +69,7 @@ Future<TimeOfDay?> showHourPicker({
|
||||
required TimeOfDay initialTime,
|
||||
}) {
|
||||
return showDialog<TimeOfDay>(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder: (context) => HourPickerDialog(initialTime: initialTime),
|
||||
);
|
||||
|
@ -32,21 +32,19 @@ class CustomWebTextField extends StatelessWidget {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
if (isRequired)
|
||||
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'* ',
|
||||
if (isRequired)
|
||||
Text('* ',
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyMedium!
|
||||
.textTheme.bodyMedium!
|
||||
.copyWith(color: Colors.red),
|
||||
),
|
||||
Text(
|
||||
textFieldName,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodySmall!
|
||||
.textTheme.bodySmall!
|
||||
.copyWith(color: Colors.black, fontSize: 13),
|
||||
),
|
||||
],
|
||||
@ -70,15 +68,17 @@ class CustomWebTextField extends StatelessWidget {
|
||||
),
|
||||
Container(
|
||||
height: height ?? 35,
|
||||
decoration: containerDecoration
|
||||
.copyWith(color: const Color(0xFFF5F6F7), boxShadow: [
|
||||
decoration: containerDecoration.copyWith(
|
||||
color: const Color(0xFFF5F6F7),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey.withOpacity(0.3),
|
||||
spreadRadius: 2,
|
||||
blurRadius: 3,
|
||||
offset: const Offset(1, 1), // changes position of shadow
|
||||
),
|
||||
]),
|
||||
]
|
||||
),
|
||||
child: TextFormField(
|
||||
validator: validator,
|
||||
controller: controller,
|
||||
|
@ -14,12 +14,14 @@ class AcBloc extends Bloc<AcsEvent, AcsState> {
|
||||
Timer? _timer;
|
||||
|
||||
AcBloc({required this.deviceId}) : super(AcsInitialState()) {
|
||||
on<AcFetchDeviceStatus>(_onFetchAcStatus);
|
||||
on<AcControl>(_onAcControl);
|
||||
on<AcFetchDeviceStatusEvent>(_onFetchAcStatus);
|
||||
on<AcFetchBatchStatusEvent>(_onFetchAcBatchStatus);
|
||||
on<AcControlEvent>(_onAcControl);
|
||||
on<AcBatchControlEvent>(_onAcBatchControl);
|
||||
}
|
||||
|
||||
FutureOr<void> _onFetchAcStatus(
|
||||
AcFetchDeviceStatus event, Emitter<AcsState> emit) async {
|
||||
AcFetchDeviceStatusEvent event, Emitter<AcsState> emit) async {
|
||||
emit(AcsLoadingState());
|
||||
try {
|
||||
final status =
|
||||
@ -31,7 +33,8 @@ class AcBloc extends Bloc<AcsEvent, AcsState> {
|
||||
}
|
||||
}
|
||||
|
||||
FutureOr<void> _onAcControl(AcControl event, Emitter<AcsState> emit) async {
|
||||
FutureOr<void> _onAcControl(
|
||||
AcControlEvent event, Emitter<AcsState> emit) async {
|
||||
final oldValue = _getValueByCode(event.code);
|
||||
|
||||
_updateLocalValue(event.code, event.value, emit);
|
||||
@ -39,6 +42,7 @@ class AcBloc extends Bloc<AcsEvent, AcsState> {
|
||||
emit(ACStatusLoaded(deviceStatus));
|
||||
|
||||
await _runDebounce(
|
||||
isBatch: false,
|
||||
deviceId: event.deviceId,
|
||||
code: event.code,
|
||||
value: event.value,
|
||||
@ -48,27 +52,43 @@ class AcBloc extends Bloc<AcsEvent, AcsState> {
|
||||
}
|
||||
|
||||
Future<void> _runDebounce({
|
||||
required String deviceId,
|
||||
required dynamic deviceId,
|
||||
required String code,
|
||||
required dynamic value,
|
||||
required dynamic oldValue,
|
||||
required Emitter<AcsState> emit,
|
||||
required bool isBatch,
|
||||
}) async {
|
||||
late String id;
|
||||
|
||||
if (deviceId is List) {
|
||||
id = deviceId.first;
|
||||
} else {
|
||||
id = deviceId;
|
||||
}
|
||||
|
||||
if (_timer != null) {
|
||||
_timer!.cancel();
|
||||
}
|
||||
_timer = Timer(const Duration(seconds: 1), () async {
|
||||
try {
|
||||
final response = await DevicesManagementApi()
|
||||
.deviceControl(deviceId, Status(code: code, value: value));
|
||||
late bool response;
|
||||
if (isBatch) {
|
||||
response = await DevicesManagementApi()
|
||||
.deviceBatchControl(deviceId, code, value);
|
||||
} else {
|
||||
response = await DevicesManagementApi()
|
||||
.deviceControl(deviceId, Status(code: code, value: value));
|
||||
}
|
||||
|
||||
if (!response) {
|
||||
_revertValueAndEmit(deviceId, code, oldValue, emit);
|
||||
_revertValueAndEmit(id, code, oldValue, emit);
|
||||
}
|
||||
} catch (e) {
|
||||
if (e is DioException && e.response != null) {
|
||||
debugPrint('Error response: ${e.response?.data}');
|
||||
}
|
||||
_revertValueAndEmit(deviceId, code, oldValue, emit);
|
||||
_revertValueAndEmit(id, code, oldValue, emit);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -77,7 +97,6 @@ class AcBloc extends Bloc<AcsEvent, AcsState> {
|
||||
String deviceId, String code, dynamic oldValue, Emitter<AcsState> emit) {
|
||||
_updateLocalValue(code, oldValue, emit);
|
||||
emit(ACStatusLoaded(deviceStatus));
|
||||
emit(const AcsFailedState(error: 'Failed to control the device.'));
|
||||
}
|
||||
|
||||
void _updateLocalValue(String code, dynamic value, Emitter<AcsState> emit) {
|
||||
@ -133,4 +152,36 @@ class AcBloc extends Bloc<AcsEvent, AcsState> {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
FutureOr<void> _onFetchAcBatchStatus(
|
||||
AcFetchBatchStatusEvent event, Emitter<AcsState> emit) async {
|
||||
emit(AcsLoadingState());
|
||||
try {
|
||||
final status =
|
||||
await DevicesManagementApi().getBatchStatus(event.devicesIds);
|
||||
deviceStatus =
|
||||
AcStatusModel.fromJson(event.devicesIds.first, status.status);
|
||||
emit(ACStatusLoaded(deviceStatus));
|
||||
} catch (e) {
|
||||
emit(AcsFailedState(error: e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
FutureOr<void> _onAcBatchControl(
|
||||
AcBatchControlEvent event, Emitter<AcsState> emit) async {
|
||||
final oldValue = _getValueByCode(event.code);
|
||||
|
||||
_updateLocalValue(event.code, event.value, emit);
|
||||
|
||||
emit(ACStatusLoaded(deviceStatus));
|
||||
|
||||
await _runDebounce(
|
||||
isBatch: true,
|
||||
deviceId: event.devicesIds,
|
||||
code: event.code,
|
||||
value: event.value,
|
||||
oldValue: oldValue,
|
||||
emit: emit,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -7,21 +7,30 @@ sealed class AcsEvent extends Equatable {
|
||||
List<Object> get props => [];
|
||||
}
|
||||
|
||||
class AcFetchDeviceStatus extends AcsEvent {
|
||||
class AcFetchDeviceStatusEvent extends AcsEvent {
|
||||
final String deviceId;
|
||||
|
||||
const AcFetchDeviceStatus(this.deviceId);
|
||||
const AcFetchDeviceStatusEvent(this.deviceId);
|
||||
|
||||
@override
|
||||
List<Object> get props => [deviceId];
|
||||
}
|
||||
|
||||
class AcControl extends AcsEvent {
|
||||
class AcFetchBatchStatusEvent extends AcsEvent {
|
||||
final List<String> devicesIds;
|
||||
|
||||
const AcFetchBatchStatusEvent(this.devicesIds);
|
||||
|
||||
@override
|
||||
List<Object> get props => [devicesIds];
|
||||
}
|
||||
|
||||
class AcControlEvent extends AcsEvent {
|
||||
final String deviceId;
|
||||
final String code;
|
||||
final dynamic value;
|
||||
|
||||
const AcControl({
|
||||
const AcControlEvent({
|
||||
required this.deviceId,
|
||||
required this.code,
|
||||
required this.value,
|
||||
@ -30,3 +39,18 @@ class AcControl extends AcsEvent {
|
||||
@override
|
||||
List<Object> get props => [deviceId, code, value];
|
||||
}
|
||||
|
||||
class AcBatchControlEvent extends AcsEvent {
|
||||
final List<String> devicesIds;
|
||||
final String code;
|
||||
final dynamic value;
|
||||
|
||||
const AcBatchControlEvent({
|
||||
required this.devicesIds,
|
||||
required this.code,
|
||||
required this.value,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object> get props => [devicesIds, code, value];
|
||||
}
|
||||
|
@ -22,6 +22,16 @@ class ACStatusLoaded extends AcsState {
|
||||
List<Object> get props => [status, timestamp];
|
||||
}
|
||||
|
||||
class AcBatchStatusLoaded extends AcsState {
|
||||
final AcStatusModel status;
|
||||
final DateTime timestamp;
|
||||
|
||||
AcBatchStatusLoaded(this.status) : timestamp = DateTime.now();
|
||||
|
||||
@override
|
||||
List<Object> get props => [status, timestamp];
|
||||
}
|
||||
|
||||
class AcsFailedState extends AcsState {
|
||||
final String error;
|
||||
|
||||
|
@ -40,16 +40,16 @@ class AcStatusModel {
|
||||
acSwitch = status.value ?? false;
|
||||
break;
|
||||
case 'mode':
|
||||
mode = status.value ?? 'cold'; // default to 'cold' if null
|
||||
mode = status.value ?? 'cold';
|
||||
break;
|
||||
case 'temp_set':
|
||||
tempSet = status.value ?? 210; // default value if null
|
||||
tempSet = status.value ?? 210;
|
||||
break;
|
||||
case 'temp_current':
|
||||
currentTemp = status.value ?? 210; // default value if null
|
||||
currentTemp = status.value ?? 210;
|
||||
break;
|
||||
case 'level':
|
||||
fanSpeeds = status.value ?? 'low'; // default value if null
|
||||
fanSpeeds = status.value ?? 'low';
|
||||
break;
|
||||
case 'child_lock':
|
||||
childLock = status.value ?? false;
|
||||
|
104
lib/pages/device_managment/ac/view/ac_device_batch_control.dart
Normal file
@ -0,0 +1,104 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ac/bloc/ac_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ac/bloc/ac_event.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ac/bloc/ac_state.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ac/view/batch_control_list/batch_ac_mode.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ac/view/batch_control_list/batch_current_temp.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ac/view/batch_control_list/batch_fan_speed.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/batch_control/factory_reset.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/batch_control/firmware_update.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/toggle_widget.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
|
||||
|
||||
class AcDeviceBatchControlView extends StatelessWidget
|
||||
with HelperResponsiveLayout {
|
||||
const AcDeviceBatchControlView({super.key, required this.devicesIds});
|
||||
|
||||
final List<String> devicesIds;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isExtraLarge = isExtraLargeScreenSize(context);
|
||||
final isLarge = isLargeScreenSize(context);
|
||||
final isMedium = isMediumScreenSize(context);
|
||||
return BlocProvider(
|
||||
create: (context) => AcBloc(deviceId: devicesIds.first)
|
||||
..add(AcFetchBatchStatusEvent(devicesIds)),
|
||||
child: BlocBuilder<AcBloc, AcsState>(
|
||||
builder: (context, state) {
|
||||
if (state is ACStatusLoaded) {
|
||||
return GridView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 50, vertical: 20),
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: isLarge || isExtraLarge
|
||||
? 3
|
||||
: isMedium
|
||||
? 2
|
||||
: 1,
|
||||
mainAxisExtent: 140,
|
||||
crossAxisSpacing: 12,
|
||||
mainAxisSpacing: 12,
|
||||
),
|
||||
children: [
|
||||
ToggleWidget(
|
||||
deviceId: devicesIds.first,
|
||||
code: 'switch',
|
||||
value: state.status.acSwitch,
|
||||
label: 'ThermoState',
|
||||
onChange: (value) {
|
||||
context.read<AcBloc>().add(AcBatchControlEvent(
|
||||
devicesIds: devicesIds,
|
||||
code: 'switch',
|
||||
value: value,
|
||||
));
|
||||
},
|
||||
),
|
||||
BatchCurrentTemp(
|
||||
currentTemp: state.status.currentTemp,
|
||||
tempSet: state.status.tempSet,
|
||||
code: 'temp_set',
|
||||
devicesIds: devicesIds,
|
||||
),
|
||||
BatchAcMode(
|
||||
value: state.status.acMode,
|
||||
code: 'mode',
|
||||
devicesIds: devicesIds,
|
||||
),
|
||||
BatchFanSpeedControl(
|
||||
value: state.status.acFanSpeed,
|
||||
code: 'level',
|
||||
devicesIds: devicesIds,
|
||||
),
|
||||
ToggleWidget(
|
||||
deviceId: devicesIds.first,
|
||||
code: 'child_lock',
|
||||
value: state.status.childLock,
|
||||
label: 'Child Lock',
|
||||
icon:
|
||||
state.status.childLock ? Assets.childLock : Assets.unlock,
|
||||
onChange: (value) {
|
||||
context.read<AcBloc>().add(AcBatchControlEvent(
|
||||
devicesIds: devicesIds,
|
||||
code: 'child_lock',
|
||||
value: value,
|
||||
));
|
||||
},
|
||||
),
|
||||
FirmwareUpdateWidget(deviceId: devicesIds.first, version: 5),
|
||||
FactoryResetWidget(deviceId: devicesIds.first),
|
||||
],
|
||||
);
|
||||
} else if (state is AcsLoadingState) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else {
|
||||
return const Center(child: Text('Error fetching status'));
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -11,8 +11,8 @@ import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_mo
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
|
||||
|
||||
class AcDeviceControl extends StatelessWidget with HelperResponsiveLayout {
|
||||
const AcDeviceControl({super.key, required this.device});
|
||||
class AcDeviceControlsView extends StatelessWidget with HelperResponsiveLayout {
|
||||
const AcDeviceControlsView({super.key, required this.device});
|
||||
|
||||
final AllDevicesModel device;
|
||||
|
||||
@ -23,7 +23,7 @@ class AcDeviceControl extends StatelessWidget with HelperResponsiveLayout {
|
||||
final isMedium = isMediumScreenSize(context);
|
||||
return BlocProvider(
|
||||
create: (context) => AcBloc(deviceId: device.uuid!)
|
||||
..add(AcFetchDeviceStatus(device.uuid!)),
|
||||
..add(AcFetchDeviceStatusEvent(device.uuid!)),
|
||||
child: BlocBuilder<AcBloc, AcsState>(
|
||||
builder: (context, state) {
|
||||
if (state is ACStatusLoaded) {
|
||||
@ -68,14 +68,15 @@ class AcDeviceControl extends StatelessWidget with HelperResponsiveLayout {
|
||||
code: 'child_lock',
|
||||
deviceId: device.uuid!,
|
||||
description: 'Child Lock',
|
||||
icon: Assets.childLock,
|
||||
icon:
|
||||
state.status.childLock ? Assets.childLock : Assets.unlock,
|
||||
),
|
||||
],
|
||||
);
|
||||
} else if (state is AcsLoadingState) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else {
|
||||
return const Center(child: Text('Error fetching status'));
|
||||
return const Center(child: Text('Error fetching status'));
|
||||
}
|
||||
},
|
||||
),
|
||||
|
@ -0,0 +1,82 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ac/model/ac_model.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ac/bloc/ac_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ac/bloc/ac_event.dart';
|
||||
|
||||
class BatchAcMode extends StatelessWidget {
|
||||
const BatchAcMode({
|
||||
super.key,
|
||||
required this.value,
|
||||
required this.code,
|
||||
required this.devicesIds,
|
||||
});
|
||||
|
||||
final TempModes value;
|
||||
final String code;
|
||||
final List<String> devicesIds;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
color: ColorsManager.greyColor.withOpacity(0.2),
|
||||
border: Border.all(color: ColorsManager.boxDivider),
|
||||
),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
_buildIconContainer(context, TempModes.cold, Assets.freezing,
|
||||
value == TempModes.cold),
|
||||
_buildIconContainer(
|
||||
context, TempModes.hot, Assets.acSun, value == TempModes.hot),
|
||||
_buildIconContainer(context, TempModes.wind, Assets.acAirConditioner,
|
||||
value == TempModes.wind),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildIconContainer(
|
||||
BuildContext context, TempModes mode, String assetPath, bool isSelected) {
|
||||
return Flexible(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
context.read<AcBloc>().add(
|
||||
AcBatchControlEvent(
|
||||
devicesIds: devicesIds,
|
||||
code: code,
|
||||
value: mode.name,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: ColorsManager.whiteColors,
|
||||
border: Border.all(
|
||||
color: isSelected ? Colors.blue : Colors.transparent,
|
||||
width: 2.0,
|
||||
),
|
||||
),
|
||||
margin: const EdgeInsets.symmetric(horizontal: 4),
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: ClipOval(
|
||||
child: SvgPicture.asset(
|
||||
assetPath,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,138 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ac/bloc/ac_event.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/celciuse_symbol.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/increament_decreament.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ac/bloc/ac_bloc.dart';
|
||||
|
||||
class BatchCurrentTemp extends StatefulWidget {
|
||||
const BatchCurrentTemp({
|
||||
super.key,
|
||||
required this.code,
|
||||
required this.devicesIds,
|
||||
required this.currentTemp,
|
||||
required this.tempSet,
|
||||
});
|
||||
|
||||
final String code;
|
||||
final List<String> devicesIds;
|
||||
final int currentTemp;
|
||||
final int tempSet;
|
||||
|
||||
@override
|
||||
State<BatchCurrentTemp> createState() => _CurrentTempState();
|
||||
}
|
||||
|
||||
class _CurrentTempState extends State<BatchCurrentTemp> {
|
||||
late double _adjustedValue;
|
||||
Timer? _debounce;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_adjustedValue = _initialAdjustedValue(widget.tempSet);
|
||||
}
|
||||
|
||||
double _initialAdjustedValue(dynamic value) {
|
||||
if (value is int || value is double) {
|
||||
double doubleValue = value.toDouble();
|
||||
return doubleValue > 99 ? doubleValue / 10 : doubleValue;
|
||||
} else {
|
||||
throw ArgumentError('Invalid value type: Expected int or double');
|
||||
}
|
||||
}
|
||||
|
||||
void _onValueChanged(double newValue) {
|
||||
if (_debounce?.isActive ?? false) {
|
||||
_debounce?.cancel();
|
||||
}
|
||||
_debounce = Timer(const Duration(milliseconds: 500), () {
|
||||
context.read<AcBloc>().add(
|
||||
AcBatchControlEvent(
|
||||
devicesIds: widget.devicesIds,
|
||||
code: widget.code,
|
||||
value: (newValue * 10).toInt(),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_debounce?.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
color: ColorsManager.greyColor.withOpacity(0.2),
|
||||
border: Border.all(color: ColorsManager.boxDivider),
|
||||
),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Current Temperature',
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodySmall!
|
||||
.copyWith(color: Colors.grey),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
(widget.currentTemp > 99
|
||||
? widget.currentTemp / 10
|
||||
: widget.currentTemp)
|
||||
.toString(),
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodySmall!
|
||||
.copyWith(color: Colors.grey),
|
||||
),
|
||||
const CelsiusSymbol(
|
||||
color: Colors.grey,
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
IncrementDecrementWidget(
|
||||
value: _adjustedValue.toString(),
|
||||
description: '°C',
|
||||
descriptionColor: ColorsManager.dialogBlueTitle,
|
||||
onIncrement: () {
|
||||
if (_adjustedValue < 30) {
|
||||
setState(() {
|
||||
_adjustedValue++;
|
||||
});
|
||||
_onValueChanged(_adjustedValue);
|
||||
}
|
||||
},
|
||||
onDecrement: () {
|
||||
if (_adjustedValue > 20) {
|
||||
setState(() {
|
||||
_adjustedValue--;
|
||||
});
|
||||
_onValueChanged(_adjustedValue);
|
||||
}
|
||||
}),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ac/model/ac_model.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ac/bloc/ac_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ac/bloc/ac_event.dart';
|
||||
|
||||
class BatchFanSpeedControl extends StatelessWidget {
|
||||
const BatchFanSpeedControl({
|
||||
super.key,
|
||||
required this.value,
|
||||
required this.code,
|
||||
required this.devicesIds,
|
||||
});
|
||||
|
||||
final FanSpeeds value;
|
||||
final String code;
|
||||
final List<String> devicesIds;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
color: ColorsManager.greyColor.withOpacity(0.2),
|
||||
border: Border.all(color: ColorsManager.boxDivider),
|
||||
),
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Column(
|
||||
children: [
|
||||
Wrap(
|
||||
runSpacing: 8,
|
||||
spacing: 8,
|
||||
children: [
|
||||
_buildIconContainer(context, FanSpeeds.auto, Assets.acFanAuto,
|
||||
value == FanSpeeds.auto),
|
||||
_buildIconContainer(context, FanSpeeds.low, Assets.acFanLow,
|
||||
value == FanSpeeds.low),
|
||||
],
|
||||
),
|
||||
Wrap(
|
||||
runSpacing: 8,
|
||||
spacing: 8,
|
||||
children: [
|
||||
_buildIconContainer(context, FanSpeeds.middle, Assets.acFanMiddle,
|
||||
value == FanSpeeds.middle),
|
||||
_buildIconContainer(context, FanSpeeds.high, Assets.acFanHigh,
|
||||
value == FanSpeeds.high),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildIconContainer(BuildContext context, FanSpeeds speed,
|
||||
String assetPath, bool isSelected) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
context.read<AcBloc>().add(
|
||||
AcBatchControlEvent(
|
||||
devicesIds: devicesIds,
|
||||
code: code,
|
||||
value: speed.name,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: ColorsManager.whiteColors,
|
||||
border: Border.all(
|
||||
color: isSelected ? Colors.blue : Colors.transparent,
|
||||
width: 2.0,
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: ClipOval(
|
||||
child: SvgPicture.asset(
|
||||
assetPath,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -49,7 +49,7 @@ class AcMode extends StatelessWidget {
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
context.read<AcBloc>().add(
|
||||
AcControl(
|
||||
AcControlEvent(
|
||||
deviceId: deviceId,
|
||||
code: code,
|
||||
value: mode.name,
|
||||
|
@ -57,7 +57,7 @@ class AcToggle extends StatelessWidget {
|
||||
value: value,
|
||||
onChanged: (newValue) {
|
||||
context.read<AcBloc>().add(
|
||||
AcControl(
|
||||
AcControlEvent(
|
||||
deviceId: deviceId,
|
||||
code: code,
|
||||
value: newValue,
|
||||
|
@ -50,7 +50,7 @@ class _CurrentTempState extends State<CurrentTemp> {
|
||||
}
|
||||
_debounce = Timer(const Duration(milliseconds: 500), () {
|
||||
context.read<AcBloc>().add(
|
||||
AcControl(
|
||||
AcControlEvent(
|
||||
deviceId: widget.deviceId,
|
||||
code: widget.code,
|
||||
value: (newValue * 10).toInt(),
|
||||
|
@ -60,7 +60,7 @@ class FanSpeedControl extends StatelessWidget {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
context.read<AcBloc>().add(
|
||||
AcControl(
|
||||
AcControlEvent(
|
||||
deviceId: deviceId,
|
||||
code: code,
|
||||
value: speed.name,
|
||||
|
@ -1,5 +1,5 @@
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_model.dart';
|
||||
import 'package:syncrow_web/services/devices_mang_api.dart';
|
||||
|
||||
@ -14,6 +14,8 @@ class DeviceManagementBloc
|
||||
int _offlineCount = 0;
|
||||
int _lowBatteryCount = 0;
|
||||
List<AllDevicesModel> _selectedDevices = [];
|
||||
List<AllDevicesModel> _filteredDevices = [];
|
||||
String productName = '';
|
||||
|
||||
DeviceManagementBloc() : super(DeviceManagementInitial()) {
|
||||
on<FetchDevices>(_onFetchDevices);
|
||||
@ -21,6 +23,8 @@ class DeviceManagementBloc
|
||||
on<SelectedFilterChanged>(_onSelectedFilterChanged);
|
||||
on<SearchDevices>(_onSearchDevices);
|
||||
on<SelectDevice>(_onSelectDevice);
|
||||
on<ResetFilters>(_onResetFilters);
|
||||
on<ResetSelectedDevices>(_onResetSelectedDevices);
|
||||
}
|
||||
|
||||
Future<void> _onFetchDevices(
|
||||
@ -30,6 +34,7 @@ class DeviceManagementBloc
|
||||
final devices = await DevicesManagementApi().fetchDevices();
|
||||
_selectedDevices.clear();
|
||||
_devices = devices;
|
||||
_filteredDevices = devices;
|
||||
_calculateDeviceCounts();
|
||||
emit(DeviceManagementLoaded(
|
||||
devices: devices,
|
||||
@ -38,6 +43,7 @@ class DeviceManagementBloc
|
||||
offlineCount: _offlineCount,
|
||||
lowBatteryCount: _lowBatteryCount,
|
||||
selectedDevice: null,
|
||||
isControlButtonEnabled: false,
|
||||
));
|
||||
} catch (e) {
|
||||
emit(DeviceManagementInitial());
|
||||
@ -45,9 +51,9 @@ class DeviceManagementBloc
|
||||
}
|
||||
|
||||
void _onFilterDevices(
|
||||
FilterDevices event, Emitter<DeviceManagementState> emit) {
|
||||
FilterDevices event, Emitter<DeviceManagementState> emit) async {
|
||||
if (_devices.isNotEmpty) {
|
||||
final filteredDevices = _devices.where((device) {
|
||||
_filteredDevices = List.from(_devices.where((device) {
|
||||
switch (event.filter) {
|
||||
case 'Online':
|
||||
return device.online == true;
|
||||
@ -58,15 +64,64 @@ class DeviceManagementBloc
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}).toList();
|
||||
}).toList());
|
||||
|
||||
emit(DeviceManagementFiltered(
|
||||
filteredDevices: filteredDevices,
|
||||
filteredDevices: _filteredDevices,
|
||||
selectedIndex: _selectedIndex,
|
||||
onlineCount: _onlineCount,
|
||||
offlineCount: _offlineCount,
|
||||
lowBatteryCount: _lowBatteryCount,
|
||||
selectedDevice:
|
||||
_selectedDevices.isNotEmpty ? _selectedDevices.first : null,
|
||||
selectedDevice: _selectedDevices.isNotEmpty ? _selectedDevices : null,
|
||||
isControlButtonEnabled: _selectedDevices.isNotEmpty,
|
||||
));
|
||||
|
||||
if (productName.isNotEmpty) {
|
||||
add(SearchDevices(productName: productName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _onResetFilters(
|
||||
ResetFilters event, Emitter<DeviceManagementState> emit) async {
|
||||
productName = '';
|
||||
_selectedDevices.clear();
|
||||
_filteredDevices = List.from(_devices);
|
||||
_selectedIndex = 0;
|
||||
emit(DeviceManagementLoaded(
|
||||
devices: _devices,
|
||||
selectedIndex: 0,
|
||||
onlineCount: _onlineCount,
|
||||
offlineCount: _offlineCount,
|
||||
lowBatteryCount: _lowBatteryCount,
|
||||
selectedDevice: null,
|
||||
isControlButtonEnabled: false,
|
||||
));
|
||||
}
|
||||
|
||||
void _onResetSelectedDevices(
|
||||
ResetSelectedDevices event, Emitter<DeviceManagementState> emit) {
|
||||
_selectedDevices.clear();
|
||||
|
||||
if (state is DeviceManagementLoaded) {
|
||||
emit(DeviceManagementLoaded(
|
||||
devices: _devices,
|
||||
selectedIndex: _selectedIndex,
|
||||
onlineCount: _onlineCount,
|
||||
offlineCount: _offlineCount,
|
||||
lowBatteryCount: _lowBatteryCount,
|
||||
selectedDevice: null,
|
||||
isControlButtonEnabled: false,
|
||||
));
|
||||
} else if (state is DeviceManagementFiltered) {
|
||||
emit(DeviceManagementFiltered(
|
||||
filteredDevices: (state as DeviceManagementFiltered).filteredDevices,
|
||||
selectedIndex: _selectedIndex,
|
||||
onlineCount: _onlineCount,
|
||||
offlineCount: _offlineCount,
|
||||
lowBatteryCount: _lowBatteryCount,
|
||||
selectedDevice: null,
|
||||
isControlButtonEnabled: false,
|
||||
));
|
||||
}
|
||||
}
|
||||
@ -87,7 +142,10 @@ class DeviceManagementBloc
|
||||
_selectedDevices.add(event.selectedDevice);
|
||||
}
|
||||
|
||||
bool isControlButtonEnabled = _selectedDevices.length == 1;
|
||||
List<AllDevicesModel> clonedSelectedDevices = List.from(_selectedDevices);
|
||||
|
||||
bool isControlButtonEnabled =
|
||||
_checkIfControlButtonEnabled(clonedSelectedDevices);
|
||||
|
||||
if (state is DeviceManagementLoaded) {
|
||||
emit(DeviceManagementLoaded(
|
||||
@ -96,7 +154,9 @@ class DeviceManagementBloc
|
||||
onlineCount: _onlineCount,
|
||||
offlineCount: _offlineCount,
|
||||
lowBatteryCount: _lowBatteryCount,
|
||||
selectedDevice: isControlButtonEnabled ? _selectedDevices.first : null,
|
||||
selectedDevice:
|
||||
clonedSelectedDevices.isNotEmpty ? clonedSelectedDevices : null,
|
||||
isControlButtonEnabled: isControlButtonEnabled,
|
||||
));
|
||||
} else if (state is DeviceManagementFiltered) {
|
||||
emit(DeviceManagementFiltered(
|
||||
@ -105,11 +165,24 @@ class DeviceManagementBloc
|
||||
onlineCount: _onlineCount,
|
||||
offlineCount: _offlineCount,
|
||||
lowBatteryCount: _lowBatteryCount,
|
||||
selectedDevice: isControlButtonEnabled ? _selectedDevices.first : null,
|
||||
selectedDevice:
|
||||
clonedSelectedDevices.isNotEmpty ? clonedSelectedDevices : null,
|
||||
isControlButtonEnabled: isControlButtonEnabled,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
bool _checkIfControlButtonEnabled(List<AllDevicesModel> selectedDevices) {
|
||||
if (selectedDevices.length > 1) {
|
||||
final productTypes =
|
||||
selectedDevices.map((device) => device.productType).toSet();
|
||||
return productTypes.length == 1;
|
||||
} else if (selectedDevices.length == 1) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void _calculateDeviceCounts() {
|
||||
_onlineCount = _devices.where((device) => device.online == true).length;
|
||||
_offlineCount = _devices.where((device) => device.online == false).length;
|
||||
@ -134,11 +207,23 @@ class DeviceManagementBloc
|
||||
|
||||
void _onSearchDevices(
|
||||
SearchDevices event, Emitter<DeviceManagementState> emit) {
|
||||
if (_devices.isNotEmpty) {
|
||||
_selectedDevices.clear();
|
||||
_selectedIndex = 0;
|
||||
if ((event.community == null || event.community!.isEmpty) &&
|
||||
(event.unitName == null || event.unitName!.isEmpty) &&
|
||||
(event.productName == null || event.productName!.isEmpty)) {
|
||||
productName = '';
|
||||
if (state is DeviceManagementFiltered) {
|
||||
add(FilterDevices(_getFilterFromIndex(_selectedIndex)));
|
||||
}
|
||||
}
|
||||
|
||||
final filteredDevices = _devices.where((device) {
|
||||
productName = event.productName ?? '';
|
||||
List<AllDevicesModel> devicesToSearch = _filteredDevices;
|
||||
|
||||
if (devicesToSearch.isNotEmpty) {
|
||||
_selectedDevices.clear();
|
||||
_selectedIndex = _selectedIndex;
|
||||
|
||||
final filteredDevices = devicesToSearch.where((device) {
|
||||
final matchesCommunity = event.community == null ||
|
||||
event.community!.isEmpty ||
|
||||
(device.room?.name
|
||||
@ -157,15 +242,26 @@ class DeviceManagementBloc
|
||||
?.toLowerCase()
|
||||
.contains(event.productName!.toLowerCase()) ??
|
||||
false);
|
||||
return matchesCommunity && matchesUnit && matchesProductName;
|
||||
final matchesDeviceName = event.productName == null ||
|
||||
event.productName!.isEmpty ||
|
||||
(device.categoryName
|
||||
?.toLowerCase()
|
||||
.contains(event.productName!.toLowerCase()) ??
|
||||
false);
|
||||
|
||||
return matchesCommunity &&
|
||||
matchesUnit &&
|
||||
(matchesProductName || matchesDeviceName);
|
||||
}).toList();
|
||||
|
||||
emit(DeviceManagementFiltered(
|
||||
filteredDevices: filteredDevices,
|
||||
selectedIndex: 0,
|
||||
selectedIndex: _selectedIndex,
|
||||
onlineCount: _onlineCount,
|
||||
offlineCount: _offlineCount,
|
||||
lowBatteryCount: _lowBatteryCount,
|
||||
selectedDevice: null,
|
||||
isControlButtonEnabled: false,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@ -50,3 +50,7 @@ class SelectDevice extends DeviceManagementEvent {
|
||||
@override
|
||||
List<Object?> get props => [selectedDevice];
|
||||
}
|
||||
|
||||
class ResetFilters extends DeviceManagementEvent {}
|
||||
|
||||
class ResetSelectedDevices extends DeviceManagementEvent {}
|
||||
|
@ -17,7 +17,8 @@ class DeviceManagementLoaded extends DeviceManagementState {
|
||||
final int onlineCount;
|
||||
final int offlineCount;
|
||||
final int lowBatteryCount;
|
||||
final AllDevicesModel? selectedDevice;
|
||||
final List<AllDevicesModel>? selectedDevice;
|
||||
final bool isControlButtonEnabled;
|
||||
|
||||
const DeviceManagementLoaded({
|
||||
required this.devices,
|
||||
@ -26,6 +27,7 @@ class DeviceManagementLoaded extends DeviceManagementState {
|
||||
required this.offlineCount,
|
||||
required this.lowBatteryCount,
|
||||
this.selectedDevice,
|
||||
required this.isControlButtonEnabled,
|
||||
});
|
||||
|
||||
@override
|
||||
@ -35,7 +37,8 @@ class DeviceManagementLoaded extends DeviceManagementState {
|
||||
onlineCount,
|
||||
offlineCount,
|
||||
lowBatteryCount,
|
||||
selectedDevice
|
||||
selectedDevice,
|
||||
isControlButtonEnabled
|
||||
];
|
||||
}
|
||||
|
||||
@ -45,7 +48,8 @@ class DeviceManagementFiltered extends DeviceManagementState {
|
||||
final int onlineCount;
|
||||
final int offlineCount;
|
||||
final int lowBatteryCount;
|
||||
final AllDevicesModel? selectedDevice;
|
||||
final List<AllDevicesModel>? selectedDevice;
|
||||
final bool isControlButtonEnabled;
|
||||
|
||||
const DeviceManagementFiltered({
|
||||
required this.filteredDevices,
|
||||
@ -54,6 +58,7 @@ class DeviceManagementFiltered extends DeviceManagementState {
|
||||
required this.offlineCount,
|
||||
required this.lowBatteryCount,
|
||||
this.selectedDevice,
|
||||
required this.isControlButtonEnabled,
|
||||
});
|
||||
|
||||
@override
|
||||
@ -63,7 +68,8 @@ class DeviceManagementFiltered extends DeviceManagementState {
|
||||
onlineCount,
|
||||
offlineCount,
|
||||
lowBatteryCount,
|
||||
selectedDevice
|
||||
selectedDevice,
|
||||
isControlButtonEnabled
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -1,34 +1,145 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ac/view/ac_device_batch_control.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ac/view/ac_device_control.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_model.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ceiling_sensor/view/ceiling_sensor_batch_control.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ceiling_sensor/view/ceiling_sensor_controls.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/door_lock/view/door_lock_status_view.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/curtain/view/curtain_batch_status_view.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/curtain/view/curtain_status_view.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/door_lock/view/door_lock_batch_control_view.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/door_lock/view/door_lock_control_view.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/gateway/view/gateway_batch_control.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/gateway/view/gateway_view.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/main_door_sensor/view/main_door_control_view.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/one_gang_switch/view/wall_light_batch_control.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/one_gang_switch/view/wall_light_device_control.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/three_gang_switch/view/living_room_batch_controls.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/three_gang_switch/view/living_room_device_control.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/two_gang_switch/view/wall_light_batch_control.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/two_gang_switch/view/wall_light_device_control.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/wall_sensor/view/wall_sensor_batch_control.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/wall_sensor/view/wall_sensor_conrtols.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/water_heater/view/water_heater_device_control.dart';
|
||||
|
||||
mixin RouteControlsBasedCode {
|
||||
Widget routeControlsWidgets({required AllDevicesModel device}) {
|
||||
switch (device.productType) {
|
||||
case '1G':
|
||||
return WallLightDeviceControl(
|
||||
deviceId: device.uuid!,
|
||||
);
|
||||
case '2G':
|
||||
return TwoGangDeviceControlView(
|
||||
deviceId: device.uuid!,
|
||||
);
|
||||
case '3G':
|
||||
return LivingRoomDeviceControl(
|
||||
return LivingRoomDeviceControlsView(
|
||||
deviceId: device.uuid!,
|
||||
);
|
||||
case 'GW':
|
||||
return GateWayControls(
|
||||
return GateWayControlsView(
|
||||
gatewayId: device.uuid!,
|
||||
);
|
||||
case 'DL':
|
||||
return DoorLockView(device: device);
|
||||
return DoorLockControlsView(device: device);
|
||||
case 'WPS':
|
||||
return WallSensorControls(device: device);
|
||||
return WallSensorControlsView(device: device);
|
||||
case 'CPS':
|
||||
return CeilingSensorControls(
|
||||
return CeilingSensorControlsView(
|
||||
device: device,
|
||||
);
|
||||
case 'CUR':
|
||||
return CurtainStatusControlsView(
|
||||
deviceId: device.uuid!,
|
||||
);
|
||||
case 'AC':
|
||||
return AcDeviceControl(device: device);
|
||||
return AcDeviceControlsView(device: device);
|
||||
case 'WH':
|
||||
return WaterHeaterDeviceControl(
|
||||
device: device,
|
||||
);
|
||||
case 'DS':
|
||||
return MainDoorSensorControlView(device: device);
|
||||
default:
|
||||
return const SizedBox();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
3G:
|
||||
1G:
|
||||
2G:
|
||||
GW:
|
||||
DL:
|
||||
WPS:
|
||||
CPS:
|
||||
AC:
|
||||
CUR:
|
||||
*/
|
||||
|
||||
Widget routeBatchControlsWidgets({required List<AllDevicesModel> devices}) {
|
||||
switch (devices.first.productType) {
|
||||
case '1G':
|
||||
return WallLightBatchControlView(
|
||||
deviceIds: devices
|
||||
.where((e) => (e.productType == '1G'))
|
||||
.map((e) => e.uuid!)
|
||||
.toList(),
|
||||
);
|
||||
case '2G':
|
||||
return TwoGangBatchControlView(
|
||||
deviceIds: devices
|
||||
.where((e) => (e.productType == '2G'))
|
||||
.map((e) => e.uuid!)
|
||||
.toList(),
|
||||
);
|
||||
case '3G':
|
||||
return LivingRoomBatchControlsView(
|
||||
deviceIds: devices
|
||||
.where((e) => (e.productType == '3G'))
|
||||
.map((e) => e.uuid!)
|
||||
.toList(),
|
||||
);
|
||||
case 'GW':
|
||||
return GatewayBatchControlView(
|
||||
gatewayIds: devices
|
||||
.where((e) => (e.productType == 'GW'))
|
||||
.map((e) => e.uuid!)
|
||||
.toList(),
|
||||
);
|
||||
case 'DL':
|
||||
return DoorLockBatchControlView(
|
||||
devicesIds: devices
|
||||
.where((e) => (e.productType == 'DL'))
|
||||
.map((e) => e.uuid!)
|
||||
.toList());
|
||||
case 'WPS':
|
||||
return WallSensorBatchControlView(
|
||||
devicesIds: devices
|
||||
.where((e) => (e.productType == 'WPS'))
|
||||
.map((e) => e.uuid!)
|
||||
.toList());
|
||||
case 'CPS':
|
||||
return CeilingSensorBatchControlView(
|
||||
devicesIds: devices
|
||||
.where((e) => (e.productType == 'CPS'))
|
||||
.map((e) => e.uuid!)
|
||||
.toList(),
|
||||
);
|
||||
case 'CUR':
|
||||
return CurtainBatchStatusView(
|
||||
devicesIds: devices
|
||||
.where((e) => (e.productType == 'CUR'))
|
||||
.map((e) => e.uuid!)
|
||||
.toList(),
|
||||
);
|
||||
case 'AC':
|
||||
return AcDeviceBatchControlView(
|
||||
devicesIds: devices
|
||||
.where((e) => (e.productType == 'AC'))
|
||||
.map((e) => e.uuid!)
|
||||
.toList());
|
||||
default:
|
||||
return const SizedBox();
|
||||
}
|
||||
|
@ -13,11 +13,15 @@ class DeviceReport {
|
||||
|
||||
DeviceReport.fromJson(Map<String, dynamic> json)
|
||||
: deviceUuid = json['deviceUuid'] as String?,
|
||||
startTime = json['startTime'] as int?,
|
||||
endTime = json['endTime'] as int?,
|
||||
data = (json['data'] as List<dynamic>?)
|
||||
?.map((e) => DeviceEvent.fromJson(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
startTime = int.tryParse(json['startTime'].toString()) ??
|
||||
json['startTime'] as int?,
|
||||
endTime =
|
||||
int.tryParse(json['endTime'].toString()) ?? json['endTime'] as int?,
|
||||
data = json['data'] != null
|
||||
? (json['data'] as List<dynamic>?)
|
||||
?.map((e) => DeviceEvent.fromJson(e as Map<String, dynamic>))
|
||||
.toList()
|
||||
: [];
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'deviceUuid': deviceUuid,
|
||||
|
@ -1,5 +1,6 @@
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/room.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/unit.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
|
||||
class AllDevicesModel {
|
||||
/*
|
||||
@ -105,7 +106,7 @@ class AllDevicesModel {
|
||||
categoryName = json['categoryName']?.toString();
|
||||
createTime = int.tryParse(json['createTime']?.toString() ?? '');
|
||||
gatewayId = json['gatewayId']?.toString();
|
||||
icon = json['icon']?.toString();
|
||||
icon = json['icon'] ?? _getDefaultIcon(productType);
|
||||
ip = json['ip']?.toString();
|
||||
lat = json['lat']?.toString();
|
||||
localKey = json['localKey']?.toString();
|
||||
@ -119,8 +120,37 @@ class AllDevicesModel {
|
||||
timeZone = json['timeZone']?.toString();
|
||||
updateTime = int.tryParse(json['updateTime']?.toString() ?? '');
|
||||
uuid = json['uuid']?.toString();
|
||||
batteryLevel = int.tryParse(json['batteryLevel']?.toString() ?? '');
|
||||
batteryLevel = int.tryParse(json['battery']?.toString() ?? '');
|
||||
}
|
||||
|
||||
String _getDefaultIcon(String? productType) {
|
||||
switch (productType) {
|
||||
case 'LightBulb':
|
||||
return Assets.lightBulb;
|
||||
case 'CeilingSensor':
|
||||
case 'WallSensor':
|
||||
return Assets.sensors;
|
||||
case 'AC':
|
||||
return Assets.ac;
|
||||
case 'DoorLock':
|
||||
return Assets.doorLock;
|
||||
case 'Curtain':
|
||||
return Assets.curtain;
|
||||
case '3G':
|
||||
case '2G':
|
||||
case '1G':
|
||||
return Assets.gangSwitch;
|
||||
case 'Gateway':
|
||||
return Assets.gateway;
|
||||
case 'WH':
|
||||
return Assets.blackLogo;
|
||||
case 'DS':
|
||||
return Assets.sensors;
|
||||
default:
|
||||
return Assets.logo;
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = <String, dynamic>{};
|
||||
if (room != null) {
|
||||
@ -151,7 +181,68 @@ class AllDevicesModel {
|
||||
data['timeZone'] = timeZone;
|
||||
data['updateTime'] = updateTime;
|
||||
data['uuid'] = uuid;
|
||||
data['batteryLevel'] = batteryLevel;
|
||||
data['battery'] = batteryLevel;
|
||||
return data;
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) return true;
|
||||
|
||||
return other is AllDevicesModel &&
|
||||
other.room == room &&
|
||||
other.unit == unit &&
|
||||
other.productUuid == productUuid &&
|
||||
other.productType == productType &&
|
||||
other.permissionType == permissionType &&
|
||||
other.activeTime == activeTime &&
|
||||
other.category == category &&
|
||||
other.categoryName == categoryName &&
|
||||
other.createTime == createTime &&
|
||||
other.gatewayId == gatewayId &&
|
||||
other.icon == icon &&
|
||||
other.ip == ip &&
|
||||
other.lat == lat &&
|
||||
other.localKey == localKey &&
|
||||
other.lon == lon &&
|
||||
other.model == model &&
|
||||
other.name == name &&
|
||||
other.nodeId == nodeId &&
|
||||
other.online == online &&
|
||||
other.ownerId == ownerId &&
|
||||
other.sub == sub &&
|
||||
other.timeZone == timeZone &&
|
||||
other.updateTime == updateTime &&
|
||||
other.uuid == uuid &&
|
||||
other.batteryLevel == batteryLevel;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
return room.hashCode ^
|
||||
unit.hashCode ^
|
||||
productUuid.hashCode ^
|
||||
productType.hashCode ^
|
||||
permissionType.hashCode ^
|
||||
activeTime.hashCode ^
|
||||
category.hashCode ^
|
||||
categoryName.hashCode ^
|
||||
createTime.hashCode ^
|
||||
gatewayId.hashCode ^
|
||||
icon.hashCode ^
|
||||
ip.hashCode ^
|
||||
lat.hashCode ^
|
||||
localKey.hashCode ^
|
||||
lon.hashCode ^
|
||||
model.hashCode ^
|
||||
name.hashCode ^
|
||||
nodeId.hashCode ^
|
||||
online.hashCode ^
|
||||
ownerId.hashCode ^
|
||||
sub.hashCode ^
|
||||
timeZone.hashCode ^
|
||||
updateTime.hashCode ^
|
||||
uuid.hashCode ^
|
||||
batteryLevel.hashCode;
|
||||
}
|
||||
}
|
||||
|
@ -21,13 +21,11 @@ class DeviceManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
||||
),
|
||||
),
|
||||
rightBody: const NavigateHomeGridView(),
|
||||
enableMenuSideba: isLargeScreenSize(context),
|
||||
scaffoldBody: BlocBuilder<DeviceManagementBloc, DeviceManagementState>(
|
||||
builder: (context, state) {
|
||||
if (state is DeviceManagementLoading) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (state is DeviceManagementLoaded ||
|
||||
state is DeviceManagementFiltered) {
|
||||
} else if (state is DeviceManagementLoaded || state is DeviceManagementFiltered) {
|
||||
final devices = state is DeviceManagementLoaded
|
||||
? state.devices
|
||||
: (state as DeviceManagementFiltered).filteredDevices;
|
||||
@ -42,3 +40,6 @@ class DeviceManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/device_batch_control_dialog.dart';
|
||||
import 'package:syncrow_web/utils/extension/build_context_x.dart';
|
||||
import 'package:syncrow_web/pages/common/buttons/default_button.dart';
|
||||
import 'package:syncrow_web/pages/common/custom_table.dart';
|
||||
@ -27,6 +28,7 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
|
||||
int offlineCount = 0;
|
||||
int lowBatteryCount = 0;
|
||||
bool isControlButtonEnabled = false;
|
||||
List<AllDevicesModel> selectedDevices = [];
|
||||
|
||||
if (state is DeviceManagementLoaded) {
|
||||
devicesToShow = state.devices;
|
||||
@ -34,14 +36,18 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
|
||||
onlineCount = state.onlineCount;
|
||||
offlineCount = state.offlineCount;
|
||||
lowBatteryCount = state.lowBatteryCount;
|
||||
isControlButtonEnabled = state.selectedDevice != null;
|
||||
isControlButtonEnabled = state.isControlButtonEnabled;
|
||||
selectedDevices = state.selectedDevice ??
|
||||
context.read<DeviceManagementBloc>().selectedDevices;
|
||||
} else if (state is DeviceManagementFiltered) {
|
||||
devicesToShow = state.filteredDevices;
|
||||
selectedIndex = state.selectedIndex;
|
||||
onlineCount = state.onlineCount;
|
||||
offlineCount = state.offlineCount;
|
||||
lowBatteryCount = state.lowBatteryCount;
|
||||
isControlButtonEnabled = state.selectedDevice != null;
|
||||
isControlButtonEnabled = state.isControlButtonEnabled;
|
||||
selectedDevices = state.selectedDevice ??
|
||||
context.read<DeviceManagementBloc>().selectedDevices;
|
||||
} else if (state is DeviceManagementInitial) {
|
||||
devicesToShow = [];
|
||||
selectedIndex = 0;
|
||||
@ -55,71 +61,85 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
|
||||
'Low Battery ($lowBatteryCount)',
|
||||
];
|
||||
|
||||
return CustomScrollView(
|
||||
slivers: [
|
||||
SliverToBoxAdapter(
|
||||
child: Container(
|
||||
padding: isLargeScreenSize(context)
|
||||
? const EdgeInsets.all(30)
|
||||
: const EdgeInsets.all(15),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
FilterWidget(
|
||||
size: MediaQuery.of(context).size,
|
||||
tabs: tabs,
|
||||
selectedIndex: selectedIndex,
|
||||
onTabChanged: (index) {
|
||||
context
|
||||
.read<DeviceManagementBloc>()
|
||||
.add(SelectedFilterChanged(index));
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
const DeviceSearchFilters(),
|
||||
const SizedBox(height: 12),
|
||||
Container(
|
||||
height: 45,
|
||||
width: 100,
|
||||
decoration: containerDecoration,
|
||||
child: Center(
|
||||
child: DefaultButton(
|
||||
onPressed: isControlButtonEnabled
|
||||
? () {
|
||||
final selectedDevice = context
|
||||
.read<DeviceManagementBloc>()
|
||||
.selectedDevices
|
||||
.first;
|
||||
final buttonLabel =
|
||||
(selectedDevices.length > 1) ? 'Batch Control' : 'Control';
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
padding: isLargeScreenSize(context)
|
||||
? const EdgeInsets.all(30)
|
||||
: const EdgeInsets.all(15),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
FilterWidget(
|
||||
size: MediaQuery.of(context).size,
|
||||
tabs: tabs,
|
||||
selectedIndex: selectedIndex,
|
||||
onTabChanged: (index) {
|
||||
context
|
||||
.read<DeviceManagementBloc>()
|
||||
.add(SelectedFilterChanged(index));
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
const DeviceSearchFilters(),
|
||||
const SizedBox(height: 12),
|
||||
Container(
|
||||
height: 45,
|
||||
width: 100,
|
||||
decoration: containerDecoration,
|
||||
child: Center(
|
||||
child: DefaultButton(
|
||||
onPressed: isControlButtonEnabled
|
||||
? () {
|
||||
if (selectedDevices.length == 1) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => DeviceControlDialog(
|
||||
device: selectedDevice),
|
||||
device: selectedDevices.first,
|
||||
),
|
||||
);
|
||||
} else if (selectedDevices.length > 1) {
|
||||
final productTypes = selectedDevices
|
||||
.map((device) => device.productType)
|
||||
.toSet();
|
||||
if (productTypes.length == 1) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) =>
|
||||
DeviceBatchControlDialog(
|
||||
devices: selectedDevices,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
: null,
|
||||
borderRadius: 9,
|
||||
child: Text(
|
||||
'Control',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: isControlButtonEnabled
|
||||
? Colors.white
|
||||
: Colors.grey,
|
||||
),
|
||||
}
|
||||
: null,
|
||||
borderRadius: 9,
|
||||
child: Text(
|
||||
buttonLabel,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: isControlButtonEnabled
|
||||
? Colors.white
|
||||
: Colors.grey,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SliverFillRemaining(
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: isLargeScreenSize(context)
|
||||
? const EdgeInsets.all(30)
|
||||
: const EdgeInsets.all(15),
|
||||
child: DynamicTable(
|
||||
withSelectAll: true,
|
||||
cellDecoration: containerDecoration,
|
||||
onRowSelected: (index, isSelected, row) {
|
||||
final selectedDevice = devicesToShow[index];
|
||||
|
@ -77,7 +77,9 @@ class _DeviceSearchFiltersState extends State<DeviceSearchFilters>
|
||||
communityController.clear();
|
||||
unitNameController.clear();
|
||||
productNameController.clear();
|
||||
context.read<DeviceManagementBloc>().add(FetchDevices());
|
||||
context.read<DeviceManagementBloc>()
|
||||
..add(ResetFilters())
|
||||
..add(FetchDevices());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -14,7 +14,9 @@ class CeilingSensorBloc extends Bloc<CeilingSensorEvent, CeilingSensorState> {
|
||||
|
||||
CeilingSensorBloc({required this.deviceId}) : super(CeilingInitialState()) {
|
||||
on<CeilingInitialEvent>(_fetchCeilingSensorStatus);
|
||||
on<CeilingFetchDeviceStatusEvent>(_fetchCeilingSensorBatchControl);
|
||||
on<CeilingChangeValueEvent>(_changeValue);
|
||||
on<CeilingBatchControlEvent>(_onBatchControl);
|
||||
on<GetCeilingDeviceReportsEvent>(_getDeviceReports);
|
||||
on<ShowCeilingDescriptionEvent>(_showDescription);
|
||||
on<BackToCeilingGridViewEvent>(_backToGridView);
|
||||
@ -24,7 +26,8 @@ class CeilingSensorBloc extends Bloc<CeilingSensorEvent, CeilingSensorState> {
|
||||
CeilingInitialEvent event, Emitter<CeilingSensorState> emit) async {
|
||||
emit(CeilingLoadingInitialState());
|
||||
try {
|
||||
var response = await DevicesManagementApi().getDeviceStatus(deviceId);
|
||||
var response = await DevicesManagementApi()
|
||||
.getDeviceStatus(event.deviceId);
|
||||
deviceStatus = CeilingSensorModel.fromJson(response.status);
|
||||
emit(CeilingUpdateState(ceilingSensorModel: deviceStatus));
|
||||
// _listenToChanges();
|
||||
@ -67,34 +70,76 @@ class CeilingSensorBloc extends Bloc<CeilingSensorEvent, CeilingSensorState> {
|
||||
}
|
||||
emit(CeilingUpdateState(ceilingSensorModel: deviceStatus));
|
||||
await _runDeBouncer(
|
||||
deviceId: deviceId, code: event.code, value: event.value, emit: emit);
|
||||
deviceId: deviceId,
|
||||
code: event.code,
|
||||
value: event.value,
|
||||
emit: emit,
|
||||
isBatch: false,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _onBatchControl(
|
||||
CeilingBatchControlEvent event, Emitter<CeilingSensorState> emit) async {
|
||||
emit(CeilingLoadingNewSate(ceilingSensorModel: deviceStatus));
|
||||
if (event.code == 'sensitivity') {
|
||||
deviceStatus.sensitivity = event.value;
|
||||
} else if (event.code == 'none_body_time') {
|
||||
deviceStatus.noBodyTime = event.value;
|
||||
} else if (event.code == 'moving_max_dis') {
|
||||
deviceStatus.maxDistance = event.value;
|
||||
} else if (event.code == 'scene') {
|
||||
deviceStatus.spaceType = getSpaceType(event.value);
|
||||
}
|
||||
emit(CeilingUpdateState(ceilingSensorModel: deviceStatus));
|
||||
await _runDeBouncer(
|
||||
deviceId: event.deviceIds,
|
||||
code: event.code,
|
||||
value: event.value,
|
||||
emit: emit,
|
||||
isBatch: true,
|
||||
);
|
||||
}
|
||||
|
||||
_runDeBouncer({
|
||||
required String deviceId,
|
||||
required dynamic deviceId,
|
||||
required String code,
|
||||
required dynamic value,
|
||||
required Emitter<CeilingSensorState> emit,
|
||||
required bool isBatch,
|
||||
}) {
|
||||
late String id;
|
||||
|
||||
if (deviceId is List) {
|
||||
id = deviceId.first;
|
||||
} else {
|
||||
id = deviceId;
|
||||
}
|
||||
|
||||
if (_timer != null) {
|
||||
_timer!.cancel();
|
||||
}
|
||||
_timer = Timer(const Duration(seconds: 1), () async {
|
||||
try {
|
||||
final response = await DevicesManagementApi()
|
||||
.deviceControl(deviceId, Status(code: code, value: value));
|
||||
late bool response;
|
||||
if (isBatch) {
|
||||
response = await DevicesManagementApi()
|
||||
.deviceBatchControl(deviceId, code, value);
|
||||
} else {
|
||||
response = await DevicesManagementApi()
|
||||
.deviceControl(deviceId, Status(code: code, value: value));
|
||||
}
|
||||
|
||||
if (!response) {
|
||||
add(CeilingInitialEvent());
|
||||
add(CeilingInitialEvent(id));
|
||||
}
|
||||
if (response == true && code == 'scene') {
|
||||
emit(CeilingLoadingInitialState());
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
add(CeilingInitialEvent());
|
||||
add(CeilingInitialEvent(id));
|
||||
}
|
||||
} catch (_) {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
add(CeilingInitialEvent());
|
||||
add(CeilingInitialEvent(id));
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -128,4 +173,19 @@ class CeilingSensorBloc extends Bloc<CeilingSensorEvent, CeilingSensorState> {
|
||||
BackToCeilingGridViewEvent event, Emitter<CeilingSensorState> emit) {
|
||||
emit(CeilingUpdateState(ceilingSensorModel: deviceStatus));
|
||||
}
|
||||
|
||||
FutureOr<void> _fetchCeilingSensorBatchControl(
|
||||
CeilingFetchDeviceStatusEvent event,
|
||||
Emitter<CeilingSensorState> emit) async {
|
||||
emit(CeilingLoadingInitialState());
|
||||
try {
|
||||
var response =
|
||||
await DevicesManagementApi().getBatchStatus(event.devicesIds);
|
||||
deviceStatus = CeilingSensorModel.fromJson(response.status);
|
||||
emit(CeilingUpdateState(ceilingSensorModel: deviceStatus));
|
||||
} catch (e) {
|
||||
emit(CeilingFailedState(error: e.toString()));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,37 @@ abstract class CeilingSensorEvent extends Equatable {
|
||||
List<Object> get props => [];
|
||||
}
|
||||
|
||||
class CeilingInitialEvent extends CeilingSensorEvent {}
|
||||
class CeilingInitialEvent extends CeilingSensorEvent {
|
||||
final String deviceId;
|
||||
const CeilingInitialEvent(this.deviceId);
|
||||
|
||||
@override
|
||||
List<Object> get props => [deviceId];
|
||||
}
|
||||
|
||||
class CeilingFetchDeviceStatusEvent extends CeilingSensorEvent {
|
||||
final List<String> devicesIds;
|
||||
|
||||
const CeilingFetchDeviceStatusEvent(this.devicesIds);
|
||||
|
||||
@override
|
||||
List<Object> get props => [devicesIds];
|
||||
}
|
||||
|
||||
class CeilingBatchControlEvent extends CeilingSensorEvent {
|
||||
final List<String> deviceIds;
|
||||
final String code;
|
||||
final dynamic value;
|
||||
|
||||
const CeilingBatchControlEvent({
|
||||
required this.deviceIds,
|
||||
required this.code,
|
||||
required this.value,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object> get props => [deviceIds, code, value];
|
||||
}
|
||||
|
||||
class CeilingChangeValueEvent extends CeilingSensorEvent {
|
||||
final dynamic value;
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
|
||||
|
||||
class CeilingSensorModel {
|
||||
@ -91,6 +92,30 @@ class CeilingSensorModel {
|
||||
spaceType: _spaceType,
|
||||
);
|
||||
}
|
||||
|
||||
CeilingSensorModel copyWith({
|
||||
String? presenceState,
|
||||
int? sensitivity,
|
||||
String? checkingResult,
|
||||
int? presenceRange,
|
||||
int? sportsPara,
|
||||
String? bodyMovement,
|
||||
String? noBodyTime,
|
||||
int? maxDistance,
|
||||
SpaceTypes? spaceType,
|
||||
}) {
|
||||
return CeilingSensorModel(
|
||||
presenceState: presenceState ?? this.presenceState,
|
||||
sensitivity: sensitivity ?? this.sensitivity,
|
||||
checkingResult: checkingResult ?? this.checkingResult,
|
||||
presenceRange: presenceRange ?? this.presenceRange,
|
||||
sportsPara: sportsPara ?? this.sportsPara,
|
||||
bodyMovement: bodyMovement ?? this.bodyMovement,
|
||||
noBodyTime: noBodyTime ?? this.noBodyTime,
|
||||
maxDistance: maxDistance ?? this.maxDistance,
|
||||
spaceType: spaceType ?? this.spaceType,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
enum SpaceTypes {
|
||||
|
@ -0,0 +1,119 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ceiling_sensor/bloc/bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ceiling_sensor/bloc/event.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ceiling_sensor/bloc/state.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ceiling_sensor/model/ceiling_sensor_model.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/batch_control/factory_reset.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/batch_control/firmware_update.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/sensors_widgets/presence_space_type.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/sensors_widgets/presence_update_data.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/sensors_widgets/presense_nobody_time.dart';
|
||||
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
|
||||
|
||||
class CeilingSensorBatchControlView extends StatelessWidget
|
||||
with HelperResponsiveLayout {
|
||||
const CeilingSensorBatchControlView({super.key, required this.devicesIds});
|
||||
|
||||
final List<String> devicesIds;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isExtraLarge = isExtraLargeScreenSize(context);
|
||||
final isLarge = isLargeScreenSize(context);
|
||||
final isMedium = isMediumScreenSize(context);
|
||||
return BlocProvider(
|
||||
create: (context) => CeilingSensorBloc(deviceId: devicesIds.first)
|
||||
..add(CeilingFetchDeviceStatusEvent(devicesIds)),
|
||||
child: BlocBuilder<CeilingSensorBloc, CeilingSensorState>(
|
||||
builder: (context, state) {
|
||||
if (state is CeilingLoadingInitialState ||
|
||||
state is CeilingReportsLoadingState) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (state is CeilingUpdateState) {
|
||||
return _buildGridView(context, state.ceilingSensorModel,
|
||||
isExtraLarge, isLarge, isMedium);
|
||||
}
|
||||
return const Center(child: Text('Error fetching status'));
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildGridView(BuildContext context, CeilingSensorModel model,
|
||||
bool isExtraLarge, bool isLarge, bool isMedium) {
|
||||
return GridView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 50),
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: isLarge || isExtraLarge
|
||||
? 3
|
||||
: isMedium
|
||||
? 2
|
||||
: 1,
|
||||
mainAxisExtent: 140,
|
||||
crossAxisSpacing: 12,
|
||||
mainAxisSpacing: 12,
|
||||
),
|
||||
children: [
|
||||
PresenceSpaceType(
|
||||
description: 'Space Type',
|
||||
value: model.spaceType,
|
||||
action: (String value) => context.read<CeilingSensorBloc>().add(
|
||||
CeilingBatchControlEvent(
|
||||
deviceIds: devicesIds,
|
||||
code: 'scene',
|
||||
value: value,
|
||||
),
|
||||
),
|
||||
),
|
||||
PresenceUpdateData(
|
||||
value: model.sensitivity.toDouble(),
|
||||
title: 'Sensitivity:',
|
||||
minValue: 1,
|
||||
maxValue: 5,
|
||||
steps: 1,
|
||||
action: (int value) {
|
||||
context.read<CeilingSensorBloc>().add(
|
||||
CeilingBatchControlEvent(
|
||||
deviceIds: devicesIds,
|
||||
code: 'sensitivity',
|
||||
value: value,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
PresenceUpdateData(
|
||||
value: model.maxDistance.toDouble(),
|
||||
title: 'Maximum Distance:',
|
||||
minValue: 0,
|
||||
maxValue: 500,
|
||||
steps: 50,
|
||||
description: 'm',
|
||||
action: (int value) => context.read<CeilingSensorBloc>().add(
|
||||
CeilingBatchControlEvent(
|
||||
deviceIds: devicesIds,
|
||||
code: 'moving_max_dis',
|
||||
value: value,
|
||||
),
|
||||
),
|
||||
),
|
||||
PresenceNoBodyTime(
|
||||
value: model.noBodyTime,
|
||||
title: 'Nobody Time:',
|
||||
description: '',
|
||||
action: (String value) => context.read<CeilingSensorBloc>().add(
|
||||
CeilingBatchControlEvent(
|
||||
deviceIds: devicesIds,
|
||||
code: 'nobody_time',
|
||||
value: value,
|
||||
),
|
||||
),
|
||||
),
|
||||
FirmwareUpdateWidget(deviceId: devicesIds.first, version: 4),
|
||||
FactoryResetWidget(deviceId: devicesIds.first),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -16,9 +16,9 @@ import 'package:syncrow_web/pages/device_managment/shared/table/report_table.dar
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
|
||||
|
||||
class CeilingSensorControls extends StatelessWidget
|
||||
class CeilingSensorControlsView extends StatelessWidget
|
||||
with HelperResponsiveLayout {
|
||||
const CeilingSensorControls({super.key, required this.device});
|
||||
const CeilingSensorControlsView({super.key, required this.device});
|
||||
|
||||
final AllDevicesModel device;
|
||||
|
||||
@ -29,7 +29,7 @@ class CeilingSensorControls extends StatelessWidget
|
||||
final isMedium = isMediumScreenSize(context);
|
||||
return BlocProvider(
|
||||
create: (context) => CeilingSensorBloc(deviceId: device.uuid ?? '')
|
||||
..add(CeilingInitialEvent()),
|
||||
..add(CeilingInitialEvent(device.uuid ?? '')),
|
||||
child: BlocBuilder<CeilingSensorBloc, CeilingSensorState>(
|
||||
builder: (context, state) {
|
||||
if (state is CeilingLoadingInitialState ||
|
||||
|
142
lib/pages/device_managment/curtain/bloc/curtain_bloc.dart
Normal file
@ -0,0 +1,142 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/curtain/bloc/curtain_event.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/curtain/bloc/curtain_state.dart';
|
||||
import 'package:syncrow_web/services/devices_mang_api.dart';
|
||||
|
||||
class CurtainBloc extends Bloc<CurtainEvent, CurtainState> {
|
||||
late bool deviceStatus;
|
||||
final String deviceId;
|
||||
Timer? _timer;
|
||||
|
||||
CurtainBloc({required this.deviceId}) : super(CurtainInitial()) {
|
||||
on<CurtainFetchDeviceStatus>(_onFetchDeviceStatus);
|
||||
on<CurtainFetchBatchStatus>(_onFetchBatchStatus);
|
||||
on<CurtainControl>(_onCurtainControl);
|
||||
on<CurtainBatchControl>(_onCurtainBatchControl);
|
||||
}
|
||||
|
||||
FutureOr<void> _onFetchDeviceStatus(
|
||||
CurtainFetchDeviceStatus event, Emitter<CurtainState> emit) async {
|
||||
emit(CurtainStatusLoading());
|
||||
try {
|
||||
final status =
|
||||
await DevicesManagementApi().getDeviceStatus(event.deviceId);
|
||||
|
||||
deviceStatus = _checkStatus(status.status[0].value);
|
||||
|
||||
emit(CurtainStatusLoaded(deviceStatus));
|
||||
} catch (e) {
|
||||
emit(CurtainError(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
FutureOr<void> _onCurtainControl(
|
||||
CurtainControl event, Emitter<CurtainState> emit) async {
|
||||
final oldValue = deviceStatus;
|
||||
|
||||
_updateLocalValue(event.value, emit);
|
||||
|
||||
emit(CurtainStatusLoaded(deviceStatus));
|
||||
|
||||
await _runDebounce(
|
||||
deviceId: event.deviceId,
|
||||
code: event.code,
|
||||
value: event.value,
|
||||
oldValue: oldValue,
|
||||
emit: emit,
|
||||
isBatch: false,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _runDebounce({
|
||||
required dynamic deviceId,
|
||||
required String code,
|
||||
required bool value,
|
||||
required bool oldValue,
|
||||
required Emitter<CurtainState> emit,
|
||||
required bool isBatch,
|
||||
}) async {
|
||||
late String id;
|
||||
|
||||
if (deviceId is List) {
|
||||
id = deviceId.first;
|
||||
} else {
|
||||
id = deviceId;
|
||||
}
|
||||
|
||||
if (_timer != null) {
|
||||
_timer!.cancel();
|
||||
}
|
||||
_timer = Timer(const Duration(seconds: 1), () async {
|
||||
try {
|
||||
final controlValue = value ? 'open' : 'close';
|
||||
|
||||
late bool response;
|
||||
if (isBatch) {
|
||||
response = await DevicesManagementApi()
|
||||
.deviceBatchControl(deviceId, code, controlValue);
|
||||
} else {
|
||||
response = await DevicesManagementApi()
|
||||
.deviceControl(deviceId, Status(code: code, value: controlValue));
|
||||
}
|
||||
|
||||
if (!response) {
|
||||
_revertValueAndEmit(id, oldValue, emit);
|
||||
}
|
||||
} catch (e) {
|
||||
_revertValueAndEmit(id, oldValue, emit);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _revertValueAndEmit(
|
||||
String deviceId, bool oldValue, Emitter<CurtainState> emit) {
|
||||
_updateLocalValue(oldValue, emit);
|
||||
emit(CurtainStatusLoaded(deviceStatus));
|
||||
emit(const CurtainControlError('Failed to control the device.'));
|
||||
}
|
||||
|
||||
void _updateLocalValue(bool value, Emitter<CurtainState> emit) {
|
||||
deviceStatus = value;
|
||||
emit(CurtainStatusLoaded(deviceStatus));
|
||||
}
|
||||
|
||||
bool _checkStatus(String command) {
|
||||
return command.toLowerCase() == 'open';
|
||||
}
|
||||
|
||||
FutureOr<void> _onFetchBatchStatus(
|
||||
CurtainFetchBatchStatus event, Emitter<CurtainState> emit) async {
|
||||
emit(CurtainStatusLoading());
|
||||
try {
|
||||
final status =
|
||||
await DevicesManagementApi().getBatchStatus(event.devicesIds);
|
||||
|
||||
deviceStatus = _checkStatus(status.status[0].value);
|
||||
|
||||
emit(CurtainStatusLoaded(deviceStatus));
|
||||
} catch (e) {
|
||||
emit(CurtainError(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
FutureOr<void> _onCurtainBatchControl(
|
||||
CurtainBatchControl event, Emitter<CurtainState> emit) async {
|
||||
final oldValue = deviceStatus;
|
||||
|
||||
_updateLocalValue(event.value, emit);
|
||||
|
||||
emit(CurtainStatusLoaded(deviceStatus));
|
||||
|
||||
await _runDebounce(
|
||||
deviceId: event.devicesIds,
|
||||
code: event.code,
|
||||
value: event.value,
|
||||
oldValue: oldValue,
|
||||
emit: emit,
|
||||
isBatch: true,
|
||||
);
|
||||
}
|
||||
}
|
50
lib/pages/device_managment/curtain/bloc/curtain_event.dart
Normal file
@ -0,0 +1,50 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
sealed class CurtainEvent extends Equatable {
|
||||
const CurtainEvent();
|
||||
|
||||
@override
|
||||
List<Object> get props => [];
|
||||
}
|
||||
|
||||
class CurtainFetchDeviceStatus extends CurtainEvent {
|
||||
final String deviceId;
|
||||
|
||||
const CurtainFetchDeviceStatus(this.deviceId);
|
||||
|
||||
@override
|
||||
List<Object> get props => [deviceId];
|
||||
}
|
||||
|
||||
class CurtainFetchBatchStatus extends CurtainEvent {
|
||||
final List<String> devicesIds;
|
||||
|
||||
const CurtainFetchBatchStatus(this.devicesIds);
|
||||
|
||||
@override
|
||||
List<Object> get props => [devicesIds];
|
||||
}
|
||||
|
||||
class CurtainControl extends CurtainEvent {
|
||||
final String deviceId;
|
||||
final String code;
|
||||
final bool value;
|
||||
|
||||
const CurtainControl(
|
||||
{required this.deviceId, required this.code, required this.value});
|
||||
|
||||
@override
|
||||
List<Object> get props => [deviceId, code, value];
|
||||
}
|
||||
|
||||
class CurtainBatchControl extends CurtainEvent {
|
||||
final List<String> devicesIds;
|
||||
final String code;
|
||||
final bool value;
|
||||
|
||||
const CurtainBatchControl(
|
||||
{required this.devicesIds, required this.code, required this.value});
|
||||
|
||||
@override
|
||||
List<Object> get props => [devicesIds, code, value];
|
||||
}
|
40
lib/pages/device_managment/curtain/bloc/curtain_state.dart
Normal file
@ -0,0 +1,40 @@
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
sealed class CurtainState extends Equatable {
|
||||
const CurtainState();
|
||||
|
||||
@override
|
||||
List<Object> get props => [];
|
||||
}
|
||||
|
||||
final class CurtainInitial extends CurtainState {}
|
||||
|
||||
class CurtainStatusLoading extends CurtainState {}
|
||||
|
||||
class CurtainStatusLoaded extends CurtainState {
|
||||
final bool status;
|
||||
|
||||
const CurtainStatusLoaded(this.status);
|
||||
|
||||
@override
|
||||
List<Object> get props => [status];
|
||||
}
|
||||
|
||||
class CurtainError extends CurtainState {
|
||||
final String message;
|
||||
|
||||
const CurtainError(this.message);
|
||||
|
||||
@override
|
||||
List<Object> get props => [message];
|
||||
}
|
||||
|
||||
class CurtainControlError extends CurtainState {
|
||||
final String message;
|
||||
|
||||
const CurtainControlError(this.message);
|
||||
|
||||
@override
|
||||
List<Object> get props => [message];
|
||||
}
|
32
lib/pages/device_managment/curtain/model/curtain_model.dart
Normal file
@ -0,0 +1,32 @@
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
|
||||
|
||||
class CurtainModel {
|
||||
final String productUuid;
|
||||
final String productType;
|
||||
final List<Status> status;
|
||||
|
||||
CurtainModel({
|
||||
required this.productUuid,
|
||||
required this.productType,
|
||||
required this.status,
|
||||
});
|
||||
|
||||
factory CurtainModel.fromJson(dynamic json) {
|
||||
var statusList = json['status'] as List;
|
||||
List<Status> status = statusList.map((i) => Status.fromJson(i)).toList();
|
||||
|
||||
return CurtainModel(
|
||||
productUuid: json['productUuid'],
|
||||
productType: json['productType'],
|
||||
status: status,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'productUuid': productUuid,
|
||||
'productType': productType,
|
||||
'status': status.map((s) => s.toJson()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/common/curtain_toggle.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/curtain/bloc/curtain_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/curtain/bloc/curtain_event.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/curtain/bloc/curtain_state.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/batch_control/factory_reset.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/batch_control/firmware_update.dart';
|
||||
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
|
||||
|
||||
class CurtainBatchStatusView extends StatelessWidget
|
||||
with HelperResponsiveLayout {
|
||||
const CurtainBatchStatusView({super.key, required this.devicesIds});
|
||||
|
||||
final List<String> devicesIds;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) => CurtainBloc(deviceId: devicesIds.first)
|
||||
..add(CurtainFetchBatchStatus(devicesIds)),
|
||||
child: BlocBuilder<CurtainBloc, CurtainState>(
|
||||
builder: (context, state) {
|
||||
if (state is CurtainStatusLoading) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (state is CurtainStatusLoaded) {
|
||||
return _buildStatusControls(context, state.status);
|
||||
} else if (state is CurtainError || state is CurtainControlError) {
|
||||
return const Center(child: Text('Error fetching status'));
|
||||
} else {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildStatusControls(BuildContext context, bool status) {
|
||||
final isExtraLarge = isExtraLargeScreenSize(context);
|
||||
final isLarge = isLargeScreenSize(context);
|
||||
final isMedium = isMediumScreenSize(context);
|
||||
return GridView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 50, vertical: 20),
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: isLarge || isExtraLarge
|
||||
? 3
|
||||
: isMedium
|
||||
? 2
|
||||
: 1,
|
||||
mainAxisExtent: 140,
|
||||
crossAxisSpacing: 12,
|
||||
mainAxisSpacing: 12,
|
||||
),
|
||||
children: [
|
||||
CurtainToggle(
|
||||
value: status,
|
||||
code: 'control',
|
||||
deviceId: devicesIds.first,
|
||||
label: 'Curtains',
|
||||
onChanged: (value) {
|
||||
context.read<CurtainBloc>().add(CurtainBatchControl(
|
||||
devicesIds: devicesIds,
|
||||
code: 'control',
|
||||
value: value,
|
||||
));
|
||||
},
|
||||
),
|
||||
FirmwareUpdateWidget(deviceId: devicesIds.first, version: 5),
|
||||
FactoryResetWidget(deviceId: devicesIds.first),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/common/curtain_toggle.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/curtain/bloc/curtain_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/curtain/bloc/curtain_event.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/curtain/bloc/curtain_state.dart';
|
||||
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
|
||||
|
||||
class CurtainStatusControlsView extends StatelessWidget
|
||||
with HelperResponsiveLayout {
|
||||
final String deviceId;
|
||||
|
||||
const CurtainStatusControlsView({super.key, required this.deviceId});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) => CurtainBloc(deviceId: deviceId)
|
||||
..add(CurtainFetchDeviceStatus(deviceId)),
|
||||
child: BlocBuilder<CurtainBloc, CurtainState>(
|
||||
builder: (context, state) {
|
||||
if (state is CurtainStatusLoading) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (state is CurtainStatusLoaded) {
|
||||
return _buildStatusControls(context, state.status);
|
||||
} else if (state is CurtainError || state is CurtainControlError) {
|
||||
return const Center(child: Text('Error fetching status'));
|
||||
} else {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildStatusControls(BuildContext context, bool status) {
|
||||
final isExtraLarge = isExtraLargeScreenSize(context);
|
||||
final isLarge = isLargeScreenSize(context);
|
||||
final isMedium = isMediumScreenSize(context);
|
||||
return GridView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 50),
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: isLarge || isExtraLarge
|
||||
? 3
|
||||
: isMedium
|
||||
? 2
|
||||
: 1,
|
||||
mainAxisExtent: 140,
|
||||
crossAxisSpacing: 12,
|
||||
mainAxisSpacing: 12,
|
||||
),
|
||||
children: [
|
||||
const SizedBox.shrink(),
|
||||
CurtainToggle(
|
||||
value: status,
|
||||
code: 'control',
|
||||
deviceId: deviceId,
|
||||
label: 'Curtains',
|
||||
onChanged: (value) {
|
||||
context.read<CurtainBloc>().add(
|
||||
CurtainControl(
|
||||
deviceId: deviceId,
|
||||
code: 'control',
|
||||
value: value,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox.shrink(),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -37,3 +37,5 @@ class UpdateLockEvent extends DoorLockEvent {
|
||||
@override
|
||||
List<Object> get props => [value];
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,38 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/batch_control/factory_reset.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/batch_control/firmware_update.dart';
|
||||
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
|
||||
|
||||
class DoorLockBatchControlView extends StatelessWidget
|
||||
with HelperResponsiveLayout {
|
||||
const DoorLockBatchControlView({super.key, required this.devicesIds});
|
||||
|
||||
final List<String> devicesIds;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isExtraLarge = isExtraLargeScreenSize(context);
|
||||
final isLarge = isLargeScreenSize(context);
|
||||
final isMedium = isMediumScreenSize(context);
|
||||
return SizedBox(
|
||||
child: GridView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 50, vertical: 20),
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: isLarge || isExtraLarge || isMedium ? 2 : 1,
|
||||
mainAxisExtent: 140,
|
||||
crossAxisSpacing: 12,
|
||||
mainAxisSpacing: 12,
|
||||
),
|
||||
children: [
|
||||
FirmwareUpdateWidget(
|
||||
deviceId: devicesIds.first,
|
||||
version: 12,
|
||||
),
|
||||
FactoryResetWidget(deviceId: devicesIds.first),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -7,10 +7,10 @@ import 'package:syncrow_web/pages/device_managment/door_lock/bloc/door_lock_stat
|
||||
import 'package:syncrow_web/pages/device_managment/door_lock/models/door_lock_status_model.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/door_lock/widget/door_button.dart';
|
||||
|
||||
class DoorLockView extends StatelessWidget {
|
||||
class DoorLockControlsView extends StatelessWidget {
|
||||
final AllDevicesModel device;
|
||||
|
||||
const DoorLockView({super.key, required this.device});
|
||||
const DoorLockControlsView({super.key, required this.device});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
@ -0,0 +1,49 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/gateway/bloc/gate_way_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/batch_control/factory_reset.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/batch_control/firmware_update.dart';
|
||||
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
|
||||
|
||||
class GatewayBatchControlView extends StatelessWidget
|
||||
with HelperResponsiveLayout {
|
||||
const GatewayBatchControlView({super.key, required this.gatewayIds});
|
||||
|
||||
final List<String> gatewayIds;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isExtraLarge = isExtraLargeScreenSize(context);
|
||||
final isLarge = isLargeScreenSize(context);
|
||||
final isMedium = isMediumScreenSize(context);
|
||||
|
||||
return BlocProvider(
|
||||
create: (context) => GateWayBloc()..add(GatWayById(gatewayIds.first)),
|
||||
child: BlocBuilder<GateWayBloc, GateWayState>(
|
||||
builder: (context, state) {
|
||||
if (state is GatewayLoadingState) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (state is UpdateGatewayState) {
|
||||
return GridView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 50, vertical: 20),
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: isLarge || isExtraLarge || isMedium ? 2 : 1,
|
||||
mainAxisExtent: 140,
|
||||
crossAxisSpacing: 12,
|
||||
mainAxisSpacing: 12,
|
||||
),
|
||||
children: [
|
||||
FirmwareUpdateWidget(deviceId: gatewayIds.first, version: 2),
|
||||
FactoryResetWidget(deviceId: gatewayIds.first),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return const Center(child: Text('Error fetching status'));
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -7,8 +7,8 @@ import 'package:syncrow_web/pages/visitor_password/model/device_model.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
|
||||
|
||||
class GateWayControls extends StatelessWidget with HelperResponsiveLayout {
|
||||
const GateWayControls({super.key, required this.gatewayId});
|
||||
class GateWayControlsView extends StatelessWidget with HelperResponsiveLayout {
|
||||
const GateWayControlsView({super.key, required this.gatewayId});
|
||||
|
||||
final String gatewayId;
|
||||
|
||||
@ -86,7 +86,7 @@ class _DeviceItem extends StatelessWidget {
|
||||
const Spacer(),
|
||||
Text(
|
||||
device.name ?? 'Unknown Device',
|
||||
textAlign: TextAlign.center,
|
||||
textAlign: TextAlign.start,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14,
|
||||
|
@ -0,0 +1,140 @@
|
||||
import 'dart:async';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/main_door_sensor/bloc/main_door_sensor_event.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/main_door_sensor/bloc/main_door_sensor_state.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/main_door_sensor/models/main_door_status_model.dart';
|
||||
import 'package:syncrow_web/services/devices_mang_api.dart';
|
||||
|
||||
class MainDoorSensorBloc
|
||||
extends Bloc<MainDoorSensorEvent, MainDoorSensorState> {
|
||||
MainDoorSensorBloc() : super(MainDoorSensorInitial()) {
|
||||
on<MainDoorSensorFetchDeviceEvent>(_onFetchDeviceStatus);
|
||||
on<MainDoorSensorControl>(_onControl);
|
||||
on<MainDoorSensorFetchBatchEvent>(_onFetchBatchStatus);
|
||||
on<MainDoorSensorReportsEvent>(_fetchReports);
|
||||
}
|
||||
|
||||
late MainDoorSensorStatusModel deviceStatus;
|
||||
Timer? _timer;
|
||||
|
||||
FutureOr<void> _onFetchDeviceStatus(MainDoorSensorFetchDeviceEvent event,
|
||||
Emitter<MainDoorSensorState> emit) async {
|
||||
emit(MainDoorSensorLoadingState());
|
||||
try {
|
||||
final status = await DevicesManagementApi()
|
||||
.getDeviceStatus(event.deviceId)
|
||||
.then((value) => value.status);
|
||||
|
||||
deviceStatus = MainDoorSensorStatusModel.fromJson(event.deviceId, status);
|
||||
emit(MainDoorSensorDeviceStatusLoaded(deviceStatus));
|
||||
} catch (e) {
|
||||
emit(MainDoorSensorFailedState(error: e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
FutureOr<void> _onControl(
|
||||
MainDoorSensorControl event, Emitter<MainDoorSensorState> emit) async {
|
||||
final oldValue = _getValueByCode(event.code);
|
||||
|
||||
_updateLocalValue(event.code, event.value);
|
||||
|
||||
emit(MainDoorSensorDeviceStatusLoaded(deviceStatus));
|
||||
|
||||
await _runDebounce(
|
||||
deviceId: event.deviceId,
|
||||
code: event.code,
|
||||
value: event.value,
|
||||
oldValue: oldValue,
|
||||
emit: emit,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _runDebounce({
|
||||
required String deviceId,
|
||||
required String code,
|
||||
required bool value,
|
||||
required bool oldValue,
|
||||
required Emitter<MainDoorSensorState> emit,
|
||||
}) async {
|
||||
if (_timer != null) {
|
||||
_timer!.cancel();
|
||||
}
|
||||
|
||||
_timer = Timer(const Duration(milliseconds: 500), () async {
|
||||
try {
|
||||
final response = await DevicesManagementApi()
|
||||
.deviceControl(deviceId, Status(code: code, value: value));
|
||||
|
||||
if (!response) {
|
||||
_revertValueAndEmit(deviceId, code, oldValue, emit);
|
||||
}
|
||||
} catch (e) {
|
||||
if (e is DioException && e.response != null) {
|
||||
debugPrint('Error response: ${e.response?.data}');
|
||||
}
|
||||
_revertValueAndEmit(deviceId, code, oldValue, emit);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _revertValueAndEmit(String deviceId, String code, bool oldValue,
|
||||
Emitter<MainDoorSensorState> emit) {
|
||||
_updateLocalValue(code, oldValue);
|
||||
emit(MainDoorSensorDeviceStatusLoaded(deviceStatus));
|
||||
}
|
||||
|
||||
void _updateLocalValue(String code, bool value) {
|
||||
switch (code) {
|
||||
case 'doorcontact_state':
|
||||
deviceStatus = deviceStatus.copyWith(doorContactState: value);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool _getValueByCode(String code) {
|
||||
switch (code) {
|
||||
case 'doorcontact_state':
|
||||
return deviceStatus.doorContactState;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Fetch batch status for multiple devices (if needed)
|
||||
FutureOr<void> _onFetchBatchStatus(MainDoorSensorFetchBatchEvent event,
|
||||
Emitter<MainDoorSensorState> emit) async {
|
||||
emit(MainDoorSensorLoadingState());
|
||||
try {
|
||||
// final batchStatus =
|
||||
// await DevicesManagementApi().getBatchDeviceStatus(event.deviceIds);
|
||||
// Assuming you need to update multiple devices status here
|
||||
// You might need a list or map of MainDoorSensorStatusModel for batch processing
|
||||
// emit(MainDoorSensorBatchStatusLoaded(batchStatus));
|
||||
} catch (e) {
|
||||
emit(MainDoorSensorBatchFailedState(error: e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
FutureOr<void> _fetchReports(MainDoorSensorReportsEvent event,
|
||||
Emitter<MainDoorSensorState> emit) async {
|
||||
emit(MainDoorSensorLoadingState());
|
||||
try {
|
||||
final reports = await DevicesManagementApi.getDeviceReportsByDate(
|
||||
event.deviceId, event.code, event.from, event.to);
|
||||
emit(MainDoorSensorReportLoaded(reports));
|
||||
} catch (e) {
|
||||
emit(MainDoorSensorFailedState(error: e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> close() {
|
||||
_timer?.cancel();
|
||||
return super.close();
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
class MainDoorSensorEvent extends Equatable {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
class MainDoorSensorFetchDeviceEvent extends MainDoorSensorEvent {
|
||||
final String deviceId;
|
||||
|
||||
MainDoorSensorFetchDeviceEvent(this.deviceId);
|
||||
|
||||
@override
|
||||
List<Object> get props => [deviceId];
|
||||
}
|
||||
|
||||
class MainDoorSensorFetchBatchEvent extends MainDoorSensorEvent {
|
||||
final String deviceId;
|
||||
|
||||
MainDoorSensorFetchBatchEvent(this.deviceId);
|
||||
|
||||
@override
|
||||
List<Object> get props => [deviceId];
|
||||
}
|
||||
|
||||
class MainDoorSensorControl extends MainDoorSensorEvent {
|
||||
final String deviceId;
|
||||
final String code;
|
||||
final bool value;
|
||||
|
||||
MainDoorSensorControl(
|
||||
{required this.deviceId, required this.code, required this.value});
|
||||
|
||||
@override
|
||||
List<Object> get props => [deviceId, code, value];
|
||||
}
|
||||
|
||||
class MainDoorSensorBatchControl extends MainDoorSensorEvent {
|
||||
final List<String> deviceId;
|
||||
final String code;
|
||||
final bool value;
|
||||
|
||||
MainDoorSensorBatchControl(
|
||||
{required this.deviceId, required this.code, required this.value});
|
||||
|
||||
@override
|
||||
List<Object> get props => [deviceId, code, value];
|
||||
}
|
||||
|
||||
class MainDoorSensorReportsEvent extends MainDoorSensorEvent {
|
||||
final String deviceId;
|
||||
final String code;
|
||||
final String from;
|
||||
final String to;
|
||||
@override
|
||||
List<Object> get props => [deviceId, code, from, to];
|
||||
|
||||
MainDoorSensorReportsEvent(
|
||||
{required this.deviceId,
|
||||
required this.code,
|
||||
required this.from,
|
||||
required this.to});
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_reports.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/main_door_sensor/models/main_door_status_model.dart';
|
||||
|
||||
class MainDoorSensorState extends Equatable {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
class MainDoorSensorInitial extends MainDoorSensorState {}
|
||||
|
||||
class MainDoorSensorLoadingState extends MainDoorSensorState {}
|
||||
|
||||
class MainDoorSensorDeviceStatusLoaded extends MainDoorSensorState {
|
||||
final MainDoorSensorStatusModel status;
|
||||
|
||||
MainDoorSensorDeviceStatusLoaded(this.status);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [status];
|
||||
}
|
||||
|
||||
class MainDoorSensorFailedState extends MainDoorSensorState {
|
||||
final String error;
|
||||
|
||||
MainDoorSensorFailedState({required this.error});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [error];
|
||||
}
|
||||
|
||||
class MainDoorSensorBatchFailedState extends MainDoorSensorState {
|
||||
final String error;
|
||||
|
||||
MainDoorSensorBatchFailedState({required this.error});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [error];
|
||||
}
|
||||
|
||||
class MainDoorSensorBatchStatusLoaded extends MainDoorSensorState {
|
||||
final List<MainDoorSensorStatusModel> status;
|
||||
|
||||
MainDoorSensorBatchStatusLoaded(this.status);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [status];
|
||||
}
|
||||
|
||||
class MainDoorSensorReportLoaded extends MainDoorSensorState {
|
||||
final DeviceReport deviceReport;
|
||||
|
||||
MainDoorSensorReportLoaded(this.deviceReport);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [deviceReport];
|
||||
}
|
||||
|
||||
class MainDoorSensorReportsLoadingState extends MainDoorSensorState {}
|
||||
|
||||
class MainDoorSensorReportsFailedState extends MainDoorSensorState {
|
||||
final String error;
|
||||
|
||||
MainDoorSensorReportsFailedState({required this.error});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [error];
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
|
||||
|
||||
class MainDoorSensorStatusModel {
|
||||
final String uuid;
|
||||
final bool doorContactState;
|
||||
final int batteryPercentage;
|
||||
|
||||
MainDoorSensorStatusModel({
|
||||
required this.uuid,
|
||||
required this.doorContactState,
|
||||
required this.batteryPercentage,
|
||||
});
|
||||
|
||||
factory MainDoorSensorStatusModel.fromJson(String id, List<Status> jsonList) {
|
||||
late bool doorContactState = false;
|
||||
late int batteryPercentage = 0;
|
||||
|
||||
for (var status in jsonList) {
|
||||
switch (status.code) {
|
||||
case 'doorcontact_state':
|
||||
doorContactState = status.value ?? false;
|
||||
break;
|
||||
case 'battery_percentage':
|
||||
batteryPercentage = status.value ?? 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return MainDoorSensorStatusModel(
|
||||
uuid: id,
|
||||
doorContactState: doorContactState,
|
||||
batteryPercentage: batteryPercentage,
|
||||
);
|
||||
}
|
||||
|
||||
MainDoorSensorStatusModel copyWith({
|
||||
String? uuid,
|
||||
bool? doorContactState,
|
||||
int? batteryPercentage,
|
||||
}) {
|
||||
return MainDoorSensorStatusModel(
|
||||
uuid: uuid ?? this.uuid,
|
||||
doorContactState: doorContactState ?? this.doorContactState,
|
||||
batteryPercentage: batteryPercentage ?? this.batteryPercentage,
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,181 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_model.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/main_door_sensor/bloc/main_door_sensor_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/main_door_sensor/bloc/main_door_sensor_event.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/main_door_sensor/bloc/main_door_sensor_state.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/main_door_sensor/models/main_door_status_model.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/main_door_sensor/widgets/notification_dialog.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/device_controls_container.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/table/report_table.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
import 'package:syncrow_web/utils/extension/build_context_x.dart';
|
||||
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
|
||||
|
||||
class MainDoorSensorControlView extends StatelessWidget
|
||||
with HelperResponsiveLayout {
|
||||
const MainDoorSensorControlView({super.key, required this.device});
|
||||
|
||||
final AllDevicesModel device;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) => MainDoorSensorBloc()
|
||||
..add(MainDoorSensorFetchDeviceEvent(device.uuid!)),
|
||||
child: BlocBuilder<MainDoorSensorBloc, MainDoorSensorState>(
|
||||
builder: (context, state) {
|
||||
if (state is MainDoorSensorLoadingState ||
|
||||
state is MainDoorSensorReportsLoadingState) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (state is MainDoorSensorDeviceStatusLoaded) {
|
||||
return _buildStatusControls(context, state.status);
|
||||
} else if (state is MainDoorSensorReportLoaded) {
|
||||
return ReportsTable(
|
||||
report: state.deviceReport,
|
||||
onRowTap: (index) {},
|
||||
onClose: () {
|
||||
context
|
||||
.read<MainDoorSensorBloc>()
|
||||
.add(MainDoorSensorFetchDeviceEvent(device.uuid!));
|
||||
},
|
||||
hideValueShowDescription: true,
|
||||
mainDoorSensor: true,
|
||||
);
|
||||
} else if (state is MainDoorSensorFailedState ||
|
||||
state is MainDoorSensorBatchFailedState) {
|
||||
return const Center(child: Text('Error fetching status'));
|
||||
} else {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
},
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildStatusControls(
|
||||
BuildContext context, MainDoorSensorStatusModel status) {
|
||||
final isExtraLarge = isExtraLargeScreenSize(context);
|
||||
final isLarge = isLargeScreenSize(context);
|
||||
final isMedium = isMediumScreenSize(context);
|
||||
return GridView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 50),
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: isLarge || isExtraLarge
|
||||
? 3
|
||||
: isMedium
|
||||
? 2
|
||||
: 1,
|
||||
mainAxisExtent: 140,
|
||||
crossAxisSpacing: 12,
|
||||
mainAxisSpacing: 12,
|
||||
),
|
||||
children: [
|
||||
IconNameStatusContainer(
|
||||
name: status.doorContactState ? 'Open' : 'Close',
|
||||
icon: Assets.mainDoor,
|
||||
onTap: () {},
|
||||
status: status.doorContactState,
|
||||
textColor: ColorsManager.red,
|
||||
paddingAmount: 8,
|
||||
),
|
||||
IconNameStatusContainer(
|
||||
name: 'Open/Close\nRecord',
|
||||
icon: Assets.mainDoorReports,
|
||||
onTap: () {
|
||||
final from = DateTime.now()
|
||||
.subtract(const Duration(days: 30))
|
||||
.millisecondsSinceEpoch;
|
||||
final to = DateTime.now().millisecondsSinceEpoch;
|
||||
context.read<MainDoorSensorBloc>().add(
|
||||
MainDoorSensorReportsEvent(
|
||||
deviceId: device.uuid!,
|
||||
code: 'doorcontact_state',
|
||||
from: from.toString(),
|
||||
to: to.toString(),
|
||||
),
|
||||
);
|
||||
},
|
||||
status: false,
|
||||
textColor: ColorsManager.blackColor,
|
||||
),
|
||||
IconNameStatusContainer(
|
||||
name: 'Notifications\nSettings',
|
||||
icon: Assets.mainDoorNotifi,
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => const NotificationDialog(),
|
||||
);
|
||||
},
|
||||
status: false,
|
||||
textColor: ColorsManager.blackColor,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class IconNameStatusContainer extends StatelessWidget {
|
||||
const IconNameStatusContainer({
|
||||
super.key,
|
||||
required this.name,
|
||||
required this.icon,
|
||||
required this.onTap,
|
||||
required this.status,
|
||||
required this.textColor,
|
||||
this.paddingAmount = 12,
|
||||
});
|
||||
|
||||
final String name;
|
||||
final String icon;
|
||||
final GestureTapCallback onTap;
|
||||
final bool status;
|
||||
final Color textColor;
|
||||
final double? paddingAmount;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: DeviceControlsContainer(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 60,
|
||||
height: 60,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: ColorsManager.whiteColors,
|
||||
),
|
||||
margin: const EdgeInsets.symmetric(horizontal: 4),
|
||||
padding: EdgeInsets.all(paddingAmount ?? 12),
|
||||
child: ClipOval(
|
||||
child: SvgPicture.asset(
|
||||
icon,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6),
|
||||
child: Text(
|
||||
name,
|
||||
textAlign: TextAlign.start,
|
||||
style: context.textTheme.titleMedium!.copyWith(
|
||||
fontWeight: FontWeight.w400,
|
||||
color: textColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/toggle_widget.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
|
||||
class NotificationDialog extends StatelessWidget {
|
||||
const NotificationDialog({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Dialog(
|
||||
backgroundColor: Colors.white,
|
||||
insetPadding: const EdgeInsets.all(20),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: SizedBox(
|
||||
width: 798,
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const SizedBox(),
|
||||
Text(
|
||||
'Notification Settings',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 22,
|
||||
color: ColorsManager.dialogBlueTitle,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 25,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
child: IconButton(
|
||||
padding: EdgeInsets.all(1),
|
||||
icon: const Icon(
|
||||
Icons.close,
|
||||
color: Colors.grey,
|
||||
size: 18,
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
ToggleWidget(
|
||||
value: true,
|
||||
code: 'notification',
|
||||
deviceId: '',
|
||||
label: 'Low Battery',
|
||||
onChange: (v) {},
|
||||
icon: '-1',
|
||||
),
|
||||
ToggleWidget(
|
||||
value: true,
|
||||
code: 'notification',
|
||||
deviceId: '',
|
||||
label: 'Closing\nReminders',
|
||||
onChange: (v) {},
|
||||
icon: '-1',
|
||||
),
|
||||
ToggleWidget(
|
||||
value: true,
|
||||
code: 'notification',
|
||||
deviceId: '',
|
||||
label: 'Door Alarm',
|
||||
onChange: (v) {},
|
||||
icon: '-1',
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,156 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/one_gang_switch/bloc/wall_light_switch_event.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/one_gang_switch/bloc/wall_light_switch_state.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/one_gang_switch/models/wall_light_status_model.dart';
|
||||
import 'package:syncrow_web/services/devices_mang_api.dart';
|
||||
|
||||
class WallLightSwitchBloc
|
||||
extends Bloc<WallLightSwitchEvent, WallLightSwitchState> {
|
||||
WallLightSwitchBloc({required this.deviceId})
|
||||
: super(WallLightSwitchInitial()) {
|
||||
on<WallLightSwitchFetchDeviceEvent>(_onFetchDeviceStatus);
|
||||
on<WallLightSwitchControl>(_onControl);
|
||||
on<WallLightSwitchFetchBatchEvent>(_onFetchBatchStatus);
|
||||
on<WallLightSwitchBatchControl>(_onBatchControl);
|
||||
}
|
||||
|
||||
late WallLightStatusModel deviceStatus;
|
||||
final String deviceId;
|
||||
Timer? _timer;
|
||||
|
||||
FutureOr<void> _onFetchDeviceStatus(WallLightSwitchFetchDeviceEvent event,
|
||||
Emitter<WallLightSwitchState> emit) async {
|
||||
emit(WallLightSwitchLoading());
|
||||
try {
|
||||
final status =
|
||||
await DevicesManagementApi().getDeviceStatus(event.deviceId);
|
||||
|
||||
deviceStatus =
|
||||
WallLightStatusModel.fromJson(event.deviceId, status.status);
|
||||
emit(WallLightSwitchStatusLoaded(deviceStatus));
|
||||
} catch (e) {
|
||||
emit(WallLightSwitchError(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
FutureOr<void> _onControl(
|
||||
WallLightSwitchControl event, Emitter<WallLightSwitchState> emit) async {
|
||||
final oldValue = _getValueByCode(event.code);
|
||||
|
||||
_updateLocalValue(event.code, event.value);
|
||||
|
||||
emit(WallLightSwitchStatusLoaded(deviceStatus));
|
||||
|
||||
await _runDebounce(
|
||||
deviceId: event.deviceId,
|
||||
code: event.code,
|
||||
value: event.value,
|
||||
oldValue: oldValue,
|
||||
emit: emit,
|
||||
isBatch: false,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _runDebounce({
|
||||
required dynamic deviceId,
|
||||
required String code,
|
||||
required bool value,
|
||||
required bool oldValue,
|
||||
required Emitter<WallLightSwitchState> emit,
|
||||
required bool isBatch,
|
||||
}) async {
|
||||
late String id;
|
||||
|
||||
if (deviceId is List) {
|
||||
id = deviceId.first;
|
||||
} else {
|
||||
id = deviceId;
|
||||
}
|
||||
|
||||
if (_timer != null) {
|
||||
_timer!.cancel();
|
||||
}
|
||||
|
||||
_timer = Timer(const Duration(milliseconds: 500), () async {
|
||||
try {
|
||||
late bool response;
|
||||
|
||||
if (isBatch) {
|
||||
response = await DevicesManagementApi()
|
||||
.deviceBatchControl(deviceId, code, value);
|
||||
} else {
|
||||
response = await DevicesManagementApi()
|
||||
.deviceControl(deviceId, Status(code: code, value: value));
|
||||
}
|
||||
|
||||
if (!response) {
|
||||
_revertValueAndEmit(id, code, oldValue, emit);
|
||||
}
|
||||
} catch (e) {
|
||||
_revertValueAndEmit(id, code, oldValue, emit);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _revertValueAndEmit(String deviceId, String code, bool oldValue,
|
||||
Emitter<WallLightSwitchState> emit) {
|
||||
_updateLocalValue(code, oldValue);
|
||||
emit(WallLightSwitchStatusLoaded(deviceStatus));
|
||||
}
|
||||
|
||||
void _updateLocalValue(String code, bool value) {
|
||||
if (code == 'switch_1') {
|
||||
deviceStatus = deviceStatus.copyWith(switch1: value);
|
||||
}
|
||||
}
|
||||
|
||||
bool _getValueByCode(String code) {
|
||||
switch (code) {
|
||||
case 'switch_1':
|
||||
return deviceStatus.switch1;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _onFetchBatchStatus(WallLightSwitchFetchBatchEvent event,
|
||||
Emitter<WallLightSwitchState> emit) async {
|
||||
emit(WallLightSwitchLoading());
|
||||
try {
|
||||
final status =
|
||||
await DevicesManagementApi().getBatchStatus(event.devicesIds);
|
||||
deviceStatus =
|
||||
WallLightStatusModel.fromJson(event.devicesIds.first, status.status);
|
||||
emit(WallLightSwitchStatusLoaded(deviceStatus));
|
||||
} catch (e) {
|
||||
emit(WallLightSwitchError(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> close() {
|
||||
_timer?.cancel();
|
||||
return super.close();
|
||||
}
|
||||
|
||||
FutureOr<void> _onBatchControl(WallLightSwitchBatchControl event,
|
||||
Emitter<WallLightSwitchState> emit) async {
|
||||
final oldValue = _getValueByCode(event.code);
|
||||
|
||||
_updateLocalValue(event.code, event.value);
|
||||
|
||||
emit(WallLightSwitchStatusLoaded(deviceStatus));
|
||||
|
||||
await _runDebounce(
|
||||
deviceId: event.devicesIds,
|
||||
code: event.code,
|
||||
value: event.value,
|
||||
oldValue: oldValue,
|
||||
emit: emit,
|
||||
isBatch: true,
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
class WallLightSwitchEvent extends Equatable {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
class WallLightSwitchFetchDeviceEvent extends WallLightSwitchEvent {
|
||||
final String deviceId;
|
||||
|
||||
WallLightSwitchFetchDeviceEvent(this.deviceId);
|
||||
|
||||
@override
|
||||
List<Object> get props => [deviceId];
|
||||
}
|
||||
|
||||
class WallLightSwitchControl extends WallLightSwitchEvent {
|
||||
final String deviceId;
|
||||
final String code;
|
||||
final bool value;
|
||||
|
||||
WallLightSwitchControl(
|
||||
{required this.deviceId, required this.code, required this.value});
|
||||
|
||||
@override
|
||||
List<Object> get props => [deviceId, code, value];
|
||||
}
|
||||
|
||||
class WallLightSwitchFetchBatchEvent extends WallLightSwitchEvent {
|
||||
final List<String> devicesIds;
|
||||
|
||||
WallLightSwitchFetchBatchEvent(this.devicesIds);
|
||||
|
||||
@override
|
||||
List<Object> get props => [devicesIds];
|
||||
}
|
||||
|
||||
class WallLightSwitchBatchControl extends WallLightSwitchEvent {
|
||||
final List<String> devicesIds;
|
||||
final String code;
|
||||
final bool value;
|
||||
|
||||
WallLightSwitchBatchControl(
|
||||
{required this.devicesIds, required this.code, required this.value});
|
||||
|
||||
@override
|
||||
List<Object> get props => [devicesIds, code, value];
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/one_gang_switch/models/wall_light_status_model.dart';
|
||||
|
||||
class WallLightSwitchState extends Equatable {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
class WallLightSwitchInitial extends WallLightSwitchState {}
|
||||
|
||||
class WallLightSwitchLoading extends WallLightSwitchState {}
|
||||
|
||||
class WallLightSwitchStatusLoaded extends WallLightSwitchState {
|
||||
final WallLightStatusModel status;
|
||||
|
||||
WallLightSwitchStatusLoaded(this.status);
|
||||
|
||||
@override
|
||||
List<Object> get props => [status];
|
||||
}
|
||||
|
||||
class WallLightSwitchError extends WallLightSwitchState {
|
||||
final String message;
|
||||
|
||||
WallLightSwitchError(this.message);
|
||||
|
||||
@override
|
||||
List<Object> get props => [message];
|
||||
}
|
||||
|
||||
class WallLightSwitchControlError extends WallLightSwitchState {
|
||||
final String message;
|
||||
|
||||
WallLightSwitchControlError(this.message);
|
||||
|
||||
@override
|
||||
List<Object> get props => [message];
|
||||
}
|
||||
|
||||
class WallLightSwitchBatchControlError extends WallLightSwitchState {
|
||||
final String message;
|
||||
|
||||
WallLightSwitchBatchControlError(this.message);
|
||||
|
||||
@override
|
||||
List<Object> get props => [message];
|
||||
}
|
||||
|
||||
class WallLightSwitchBatchStatusLoaded extends WallLightSwitchState {
|
||||
final List<String> status;
|
||||
|
||||
WallLightSwitchBatchStatusLoaded(this.status);
|
||||
|
||||
@override
|
||||
List<Object> get props => [status];
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
|
||||
|
||||
class WallLightStatusModel {
|
||||
final String uuid;
|
||||
final bool switch1;
|
||||
final int countDown;
|
||||
|
||||
WallLightStatusModel({
|
||||
required this.uuid,
|
||||
required this.switch1,
|
||||
required this.countDown,
|
||||
});
|
||||
|
||||
factory WallLightStatusModel.fromJson(String id, List<Status> jsonList) {
|
||||
late bool switch1;
|
||||
late int countDown;
|
||||
|
||||
for (var status in jsonList) {
|
||||
switch (status.code) {
|
||||
case 'switch_1':
|
||||
switch1 = status.value ?? false;
|
||||
break;
|
||||
case 'countdown_1':
|
||||
countDown = status.value ?? 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return WallLightStatusModel(
|
||||
uuid: id,
|
||||
switch1: switch1,
|
||||
countDown: countDown,
|
||||
);
|
||||
}
|
||||
|
||||
WallLightStatusModel copyWith({
|
||||
String? uuid,
|
||||
bool? switch1,
|
||||
int? countDown,
|
||||
}) {
|
||||
return WallLightStatusModel(
|
||||
uuid: uuid ?? this.uuid,
|
||||
switch1: switch1 ?? this.switch1,
|
||||
countDown: countDown ?? this.countDown,
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/one_gang_switch/bloc/wall_light_switch_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/one_gang_switch/bloc/wall_light_switch_event.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/one_gang_switch/bloc/wall_light_switch_state.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/one_gang_switch/models/wall_light_status_model.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/batch_control/factory_reset.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/batch_control/firmware_update.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/toggle_widget.dart';
|
||||
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
|
||||
|
||||
class WallLightBatchControlView extends StatelessWidget
|
||||
with HelperResponsiveLayout {
|
||||
const WallLightBatchControlView({super.key, required this.deviceIds});
|
||||
|
||||
final List<String> deviceIds;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) => WallLightSwitchBloc(deviceId: deviceIds.first)
|
||||
..add(WallLightSwitchFetchBatchEvent(deviceIds)),
|
||||
child: BlocBuilder<WallLightSwitchBloc, WallLightSwitchState>(
|
||||
builder: (context, state) {
|
||||
if (state is WallLightSwitchLoading) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (state is WallLightSwitchStatusLoaded) {
|
||||
return _buildStatusControls(context, state.status);
|
||||
} else if (state is WallLightSwitchError ||
|
||||
state is WallLightSwitchControlError) {
|
||||
return const Center(child: Text('Error fetching status'));
|
||||
} else {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildStatusControls(
|
||||
BuildContext context, WallLightStatusModel status) {
|
||||
final isExtraLarge = isExtraLargeScreenSize(context);
|
||||
final isLarge = isLargeScreenSize(context);
|
||||
final isMedium = isMediumScreenSize(context);
|
||||
return SizedBox(
|
||||
child: GridView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 50),
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: isLarge || isExtraLarge
|
||||
? 3
|
||||
: isMedium
|
||||
? 2
|
||||
: 1,
|
||||
mainAxisExtent: 140,
|
||||
crossAxisSpacing: 12,
|
||||
mainAxisSpacing: 12,
|
||||
),
|
||||
children: [
|
||||
ToggleWidget(
|
||||
value: status.switch1,
|
||||
code: 'switch_1',
|
||||
deviceId: deviceIds.first,
|
||||
label: 'Wall Light',
|
||||
onChange: (value) {
|
||||
context.read<WallLightSwitchBloc>().add(
|
||||
WallLightSwitchBatchControl(
|
||||
devicesIds: deviceIds,
|
||||
code: 'switch_1',
|
||||
value: value,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
FirmwareUpdateWidget(
|
||||
deviceId: deviceIds.first,
|
||||
version: 12,
|
||||
),
|
||||
FactoryResetWidget(deviceId: deviceIds.first),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/one_gang_switch/bloc/wall_light_switch_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/one_gang_switch/bloc/wall_light_switch_event.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/one_gang_switch/bloc/wall_light_switch_state.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/one_gang_switch/models/wall_light_status_model.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/toggle_widget.dart';
|
||||
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
|
||||
|
||||
class WallLightDeviceControl extends StatelessWidget
|
||||
with HelperResponsiveLayout {
|
||||
final String deviceId;
|
||||
|
||||
const WallLightDeviceControl({super.key, required this.deviceId});
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) => WallLightSwitchBloc(deviceId: deviceId)
|
||||
..add(WallLightSwitchFetchDeviceEvent(deviceId)),
|
||||
child: BlocBuilder<WallLightSwitchBloc, WallLightSwitchState>(
|
||||
builder: (context, state) {
|
||||
if (state is WallLightSwitchLoading) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (state is WallLightSwitchStatusLoaded) {
|
||||
return _buildStatusControls(context, state.status);
|
||||
} else if (state is WallLightSwitchError ||
|
||||
state is WallLightSwitchControlError) {
|
||||
return const Center(child: Text('Error fetching status'));
|
||||
} else {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildStatusControls(
|
||||
BuildContext context, WallLightStatusModel status) {
|
||||
final isExtraLarge = isExtraLargeScreenSize(context);
|
||||
final isLarge = isLargeScreenSize(context);
|
||||
final isMedium = isMediumScreenSize(context);
|
||||
return GridView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 50),
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: isLarge || isExtraLarge
|
||||
? 3
|
||||
: isMedium
|
||||
? 2
|
||||
: 1,
|
||||
mainAxisExtent: 140,
|
||||
crossAxisSpacing: 12,
|
||||
mainAxisSpacing: 12,
|
||||
),
|
||||
children: [
|
||||
const SizedBox(),
|
||||
ToggleWidget(
|
||||
value: status.switch1,
|
||||
code: 'switch_1',
|
||||
deviceId: deviceId,
|
||||
label: 'Wall Light',
|
||||
onChange: (value) {
|
||||
context.read<WallLightSwitchBloc>().add(WallLightSwitchControl(
|
||||
deviceId: deviceId,
|
||||
code: 'switch_1',
|
||||
value: value,
|
||||
));
|
||||
},
|
||||
),
|
||||
const SizedBox(),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/device_controls_container.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
import 'package:syncrow_web/utils/extension/build_context_x.dart';
|
||||
|
||||
class FactoryResetWidget extends StatelessWidget {
|
||||
const FactoryResetWidget({super.key, required String deviceId});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DeviceControlsContainer(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
ClipOval(
|
||||
child: Container(
|
||||
color: ColorsManager.whiteColors,
|
||||
height: 60,
|
||||
width: 60,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: SvgPicture.asset(
|
||||
Assets.factoryReset,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
)),
|
||||
Text(
|
||||
'Factory Reset',
|
||||
style: context.textTheme.titleMedium!.copyWith(
|
||||
fontWeight: FontWeight.w400,
|
||||
color: ColorsManager.blackColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/device_controls_container.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
import 'package:syncrow_web/utils/extension/build_context_x.dart';
|
||||
|
||||
class FirmwareUpdateWidget extends StatelessWidget {
|
||||
const FirmwareUpdateWidget(
|
||||
{super.key, required String deviceId, required int version});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DeviceControlsContainer(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
ClipOval(
|
||||
child: Container(
|
||||
color: ColorsManager.whiteColors,
|
||||
height: 60,
|
||||
width: 60,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: SvgPicture.asset(
|
||||
Assets.firmware,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
)),
|
||||
Text(
|
||||
'Firmware Update',
|
||||
style: context.textTheme.titleMedium!.copyWith(
|
||||
fontWeight: FontWeight.w400,
|
||||
color: ColorsManager.blackColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:syncrow_web/utils/extension/build_context_x.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/helper/route_controls_based_code.dart';
|
||||
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_model.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
|
||||
class DeviceBatchControlDialog extends StatelessWidget
|
||||
with RouteControlsBasedCode {
|
||||
final List<AllDevicesModel> devices;
|
||||
|
||||
const DeviceBatchControlDialog({super.key, required this.devices});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Dialog(
|
||||
backgroundColor: Colors.white,
|
||||
insetPadding: const EdgeInsets.all(20),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: SizedBox(
|
||||
width: devices.length < 2 ? 500 : 800,
|
||||
// height: context.screenHeight * 0.7,
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const SizedBox(),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
devices.first.categoryName ?? 'Device Control',
|
||||
style: context.textTheme.titleLarge!.copyWith(
|
||||
color: ColorsManager.dialogBlueTitle,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Text(
|
||||
"Batch Control",
|
||||
style: context.textTheme.bodySmall!.copyWith(
|
||||
color: ColorsManager.dialogBlueTitle,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
width: 25,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
child: IconButton(
|
||||
padding: EdgeInsets.all(1),
|
||||
icon: const Icon(
|
||||
Icons.close,
|
||||
color: Colors.grey,
|
||||
size: 18,
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
const SizedBox(height: 20),
|
||||
//// BUILD DEVICE CONTROLS
|
||||
///
|
||||
//// ROUTE TO SPECIFIC CONTROL VIEW BASED ON DEVICE CATEGORY
|
||||
routeBatchControlsWidgets(devices: devices),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:syncrow_web/utils/extension/build_context_x.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/helper/route_controls_based_code.dart';
|
||||
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_model.dart';
|
||||
@ -22,7 +21,7 @@ class DeviceControlDialog extends StatelessWidget with RouteControlsBasedCode {
|
||||
),
|
||||
child: SizedBox(
|
||||
width: 798,
|
||||
height: context.screenHeight * 0.7,
|
||||
// height: context.screenHeight * 0.7,
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
|
@ -53,18 +53,19 @@ class PresenceSpaceType extends StatelessWidget {
|
||||
return GestureDetector(
|
||||
onTap: () => action(spaceType.name),
|
||||
child: Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
border: Border.all(
|
||||
color: value == spaceType
|
||||
? ColorsManager.blueColor
|
||||
: Colors.transparent,
|
||||
),
|
||||
color: value == spaceType
|
||||
? ColorsManager.primaryColorWithOpacity
|
||||
: ColorsManager.textGray,
|
||||
),
|
||||
child: SvgPicture.asset(
|
||||
icon,
|
||||
width: 40,
|
||||
height: 40,
|
||||
width: 25,
|
||||
height: 22,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -4,20 +4,25 @@ import 'package:syncrow_web/pages/device_managment/all_devices/models/device_rep
|
||||
import 'package:syncrow_web/pages/device_managment/shared/table/table_cell_widget.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/table/table_header.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class ReportsTable extends StatelessWidget {
|
||||
final DeviceReport report;
|
||||
final String? thirdColumnTitle;
|
||||
final String? thirdColumnDescription;
|
||||
final Function(int index) onRowTap;
|
||||
final VoidCallback onClose;
|
||||
bool? hideValueShowDescription;
|
||||
bool? mainDoorSensor;
|
||||
|
||||
const ReportsTable({
|
||||
ReportsTable({
|
||||
super.key,
|
||||
required this.report,
|
||||
required this.onRowTap,
|
||||
required this.onClose,
|
||||
this.thirdColumnTitle,
|
||||
this.thirdColumnDescription,
|
||||
this.hideValueShowDescription,
|
||||
this.mainDoorSensor,
|
||||
});
|
||||
|
||||
@override
|
||||
@ -57,10 +62,21 @@ class ReportsTable extends StatelessWidget {
|
||||
children: [
|
||||
TableCellWidget(value: date),
|
||||
TableCellWidget(value: time),
|
||||
TableCellWidget(
|
||||
value: '${data.value!} $thirdColumnDescription',
|
||||
onTap: () => onRowTap(index),
|
||||
),
|
||||
hideValueShowDescription == true
|
||||
? TableCellWidget(
|
||||
value: (mainDoorSensor != null &&
|
||||
mainDoorSensor == true)
|
||||
? data.value == 'true'
|
||||
? 'Open'
|
||||
: 'Close'
|
||||
: thirdColumnDescription ?? '',
|
||||
onTap: () => onRowTap(index),
|
||||
)
|
||||
: TableCellWidget(
|
||||
value:
|
||||
'${data.value!} ${thirdColumnDescription ?? ''}',
|
||||
onTap: () => onRowTap(index),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
|
81
lib/pages/device_managment/shared/toggle_widget.dart
Normal file
@ -0,0 +1,81 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
import 'package:syncrow_web/utils/extension/build_context_x.dart';
|
||||
|
||||
class ToggleWidget extends StatelessWidget {
|
||||
final bool value;
|
||||
final String code;
|
||||
final String deviceId;
|
||||
final String label;
|
||||
final String? icon;
|
||||
final Function(dynamic value) onChange;
|
||||
|
||||
const ToggleWidget({
|
||||
super.key,
|
||||
required this.value,
|
||||
required this.code,
|
||||
required this.deviceId,
|
||||
required this.label,
|
||||
required this.onChange,
|
||||
this.icon,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
color: ColorsManager.greyColor.withOpacity(0.2),
|
||||
border: Border.all(color: ColorsManager.boxDivider),
|
||||
),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
icon == '-1'
|
||||
? const SizedBox(
|
||||
height: 60,
|
||||
width: 60,
|
||||
)
|
||||
: ClipOval(
|
||||
child: Container(
|
||||
color: ColorsManager.whiteColors,
|
||||
child: SvgPicture.asset(
|
||||
icon ?? Assets.lightPulp,
|
||||
width: 60,
|
||||
height: 60,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
)),
|
||||
Text(
|
||||
label,
|
||||
style: context.textTheme.titleMedium!.copyWith(
|
||||
fontWeight: FontWeight.w400,
|
||||
color: ColorsManager.blackColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
height: 20,
|
||||
width: 35,
|
||||
padding: const EdgeInsets.only(right: 16, top: 10),
|
||||
child: CupertinoSwitch(
|
||||
value: value,
|
||||
activeColor: ColorsManager.dialogBlueTitle,
|
||||
onChanged: onChange,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -16,23 +16,28 @@ class LivingRoomBloc extends Bloc<LivingRoomEvent, LivingRoomState> {
|
||||
Timer? _timer;
|
||||
|
||||
LivingRoomBloc({required this.deviceId}) : super(LivingRoomInitial()) {
|
||||
on<LivingRoomFetchDeviceStatus>(_onFetchDeviceStatus);
|
||||
on<LivingRoomFetchDeviceStatusEvent>(_onFetchDeviceStatus);
|
||||
on<LivingRoomControl>(_livingRoomControl);
|
||||
on<LivingRoomBatchControl>(_livingRoomBatchControl);
|
||||
on<LivingRoomFetchBatchEvent>(_livingRoomFetchBatchControl);
|
||||
}
|
||||
|
||||
FutureOr<void> _onFetchDeviceStatus(
|
||||
LivingRoomFetchDeviceStatus event, Emitter<LivingRoomState> emit) async {
|
||||
FutureOr<void> _onFetchDeviceStatus(LivingRoomFetchDeviceStatusEvent event,
|
||||
Emitter<LivingRoomState> emit) async {
|
||||
emit(LivingRoomDeviceStatusLoading());
|
||||
try {
|
||||
final status = await DevicesManagementApi().getDeviceStatus(event.deviceId);
|
||||
deviceStatus = LivingRoomStatusModel.fromJson(event.deviceId, status.status);
|
||||
final status =
|
||||
await DevicesManagementApi().getDeviceStatus(event.deviceId);
|
||||
deviceStatus =
|
||||
LivingRoomStatusModel.fromJson(event.deviceId, status.status);
|
||||
emit(LivingRoomDeviceStatusLoaded(deviceStatus));
|
||||
} catch (e) {
|
||||
emit(LivingRoomDeviceManagementError(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
FutureOr<void> _livingRoomControl(LivingRoomControl event, Emitter<LivingRoomState> emit) async {
|
||||
FutureOr<void> _livingRoomControl(
|
||||
LivingRoomControl event, Emitter<LivingRoomState> emit) async {
|
||||
final oldValue = _getValueByCode(event.code);
|
||||
|
||||
_updateLocalValue(event.code, event.value);
|
||||
@ -45,37 +50,52 @@ class LivingRoomBloc extends Bloc<LivingRoomEvent, LivingRoomState> {
|
||||
value: event.value,
|
||||
oldValue: oldValue,
|
||||
emit: emit,
|
||||
isBatch: false,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _runDebounce({
|
||||
required String deviceId,
|
||||
required dynamic deviceId,
|
||||
required String code,
|
||||
required dynamic value,
|
||||
required dynamic oldValue,
|
||||
required Emitter<LivingRoomState> emit,
|
||||
required bool isBatch,
|
||||
}) async {
|
||||
late String id;
|
||||
|
||||
if (deviceId is List) {
|
||||
id = deviceId.first;
|
||||
} else {
|
||||
id = deviceId;
|
||||
}
|
||||
|
||||
if (_timer != null) {
|
||||
_timer!.cancel();
|
||||
}
|
||||
_timer = Timer(const Duration(seconds: 1), () async {
|
||||
try {
|
||||
final response =
|
||||
await DevicesManagementApi().deviceControl(deviceId, Status(code: code, value: value));
|
||||
late bool response;
|
||||
if (isBatch) {
|
||||
response = await DevicesManagementApi()
|
||||
.deviceBatchControl(deviceId, code, value);
|
||||
} else {
|
||||
response = await DevicesManagementApi()
|
||||
.deviceControl(deviceId, Status(code: code, value: value));
|
||||
}
|
||||
if (!response) {
|
||||
_revertValueAndEmit(deviceId, code, oldValue, emit);
|
||||
_revertValueAndEmit(id, code, oldValue, emit);
|
||||
}
|
||||
} catch (e) {
|
||||
_revertValueAndEmit(deviceId, code, oldValue, emit);
|
||||
_revertValueAndEmit(id, code, oldValue, emit);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _revertValueAndEmit(
|
||||
String deviceId, String code, dynamic oldValue, Emitter<LivingRoomState> emit) {
|
||||
void _revertValueAndEmit(String deviceId, String code, dynamic oldValue,
|
||||
Emitter<LivingRoomState> emit) {
|
||||
_updateLocalValue(code, oldValue);
|
||||
emit(LivingRoomDeviceStatusLoaded(deviceStatus));
|
||||
emit(const LivingRoomControlError('Failed to control the device.'));
|
||||
}
|
||||
|
||||
void _updateLocalValue(String code, dynamic value) {
|
||||
@ -113,4 +133,36 @@ class LivingRoomBloc extends Bloc<LivingRoomEvent, LivingRoomState> {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
FutureOr<void> _livingRoomFetchBatchControl(
|
||||
LivingRoomFetchBatchEvent event, Emitter<LivingRoomState> emit) async {
|
||||
emit(LivingRoomDeviceStatusLoading());
|
||||
try {
|
||||
final status =
|
||||
await DevicesManagementApi().getBatchStatus(event.devicesIds);
|
||||
deviceStatus =
|
||||
LivingRoomStatusModel.fromJson(event.devicesIds.first, status.status);
|
||||
emit(LivingRoomDeviceStatusLoaded(deviceStatus));
|
||||
} catch (e) {
|
||||
emit(LivingRoomDeviceManagementError(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
FutureOr<void> _livingRoomBatchControl(
|
||||
LivingRoomBatchControl event, Emitter<LivingRoomState> emit) async {
|
||||
final oldValue = _getValueByCode(event.code);
|
||||
|
||||
_updateLocalValue(event.code, event.value);
|
||||
|
||||
emit(LivingRoomDeviceStatusLoaded(deviceStatus));
|
||||
|
||||
await _runDebounce(
|
||||
deviceId: event.devicesIds,
|
||||
code: event.code,
|
||||
value: event.value,
|
||||
oldValue: oldValue,
|
||||
emit: emit,
|
||||
isBatch: true,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -7,15 +7,25 @@ sealed class LivingRoomEvent extends Equatable {
|
||||
List<Object> get props => [];
|
||||
}
|
||||
|
||||
class LivingRoomFetchDeviceStatus extends LivingRoomEvent {
|
||||
class LivingRoomFetchDeviceStatusEvent extends LivingRoomEvent {
|
||||
final String deviceId;
|
||||
|
||||
const LivingRoomFetchDeviceStatus(this.deviceId);
|
||||
const LivingRoomFetchDeviceStatusEvent(this.deviceId);
|
||||
|
||||
@override
|
||||
List<Object> get props => [deviceId];
|
||||
}
|
||||
|
||||
//LivingRoomFetchBatchStatus
|
||||
class LivingRoomFetchBatchEvent extends LivingRoomEvent {
|
||||
final List<String> devicesIds;
|
||||
|
||||
const LivingRoomFetchBatchEvent(this.devicesIds);
|
||||
|
||||
@override
|
||||
List<Object> get props => [devicesIds];
|
||||
}
|
||||
|
||||
class LivingRoomControl extends LivingRoomEvent {
|
||||
final String deviceId;
|
||||
final String code;
|
||||
@ -27,3 +37,15 @@ class LivingRoomControl extends LivingRoomEvent {
|
||||
@override
|
||||
List<Object> get props => [deviceId, code, value];
|
||||
}
|
||||
|
||||
class LivingRoomBatchControl extends LivingRoomEvent {
|
||||
final List<String> devicesIds;
|
||||
final String code;
|
||||
final bool value;
|
||||
|
||||
const LivingRoomBatchControl(
|
||||
{required this.devicesIds, required this.code, required this.value});
|
||||
|
||||
@override
|
||||
List<Object> get props => [devicesIds, code, value];
|
||||
}
|
||||
|
@ -0,0 +1,113 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/batch_control/factory_reset.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/batch_control/firmware_update.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/three_gang_switch/bloc/living_room_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/three_gang_switch/models/living_room_model.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/toggle_widget.dart';
|
||||
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
|
||||
|
||||
class LivingRoomBatchControlsView extends StatelessWidget
|
||||
with HelperResponsiveLayout {
|
||||
const LivingRoomBatchControlsView({super.key, required this.deviceIds});
|
||||
|
||||
final List<String> deviceIds;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) => LivingRoomBloc(deviceId: deviceIds.first)
|
||||
..add(LivingRoomFetchBatchEvent(deviceIds)),
|
||||
child: BlocBuilder<LivingRoomBloc, LivingRoomState>(
|
||||
builder: (context, state) {
|
||||
if (state is LivingRoomDeviceStatusLoading) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (state is LivingRoomDeviceStatusLoaded) {
|
||||
return _buildStatusControls(context, state.status);
|
||||
} else if (state is LivingRoomDeviceManagementError ||
|
||||
state is LivingRoomControlError) {
|
||||
return const Center(child: Text('Error fetching status'));
|
||||
} else {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildStatusControls(
|
||||
BuildContext context, LivingRoomStatusModel status) {
|
||||
final isExtraLarge = isExtraLargeScreenSize(context);
|
||||
final isLarge = isLargeScreenSize(context);
|
||||
final isMedium = isMediumScreenSize(context);
|
||||
return SizedBox(
|
||||
child: GridView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 50),
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: isLarge || isExtraLarge
|
||||
? 3
|
||||
: isMedium
|
||||
? 2
|
||||
: 1,
|
||||
mainAxisExtent: 140,
|
||||
crossAxisSpacing: 12,
|
||||
mainAxisSpacing: 12,
|
||||
),
|
||||
children: [
|
||||
ToggleWidget(
|
||||
value: status.switch1,
|
||||
code: 'switch_1',
|
||||
deviceId: deviceIds.first,
|
||||
label: 'Wall Light',
|
||||
onChange: (value) {
|
||||
context.read<LivingRoomBloc>().add(
|
||||
LivingRoomBatchControl(
|
||||
devicesIds: deviceIds,
|
||||
code: 'switch_1',
|
||||
value: value,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
ToggleWidget(
|
||||
value: status.switch2,
|
||||
code: 'switch_2',
|
||||
deviceId: deviceIds.first,
|
||||
label: 'Ceiling Light',
|
||||
onChange: (value) {
|
||||
context.read<LivingRoomBloc>().add(
|
||||
LivingRoomBatchControl(
|
||||
devicesIds: deviceIds,
|
||||
code: 'switch_2',
|
||||
value: value,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
ToggleWidget(
|
||||
value: status.switch3,
|
||||
code: 'switch_2',
|
||||
deviceId: deviceIds.first,
|
||||
label: 'Spotlight',
|
||||
onChange: (value) {
|
||||
context.read<LivingRoomBloc>().add(
|
||||
LivingRoomBatchControl(
|
||||
devicesIds: deviceIds,
|
||||
code: 'switch_3',
|
||||
value: value,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
FirmwareUpdateWidget(
|
||||
deviceId: deviceIds.first,
|
||||
version: 12,
|
||||
),
|
||||
FactoryResetWidget(deviceId: deviceIds.first),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -2,26 +2,28 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/three_gang_switch/bloc/living_room_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/three_gang_switch/models/living_room_model.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/three_gang_switch/widgets/living_toggle_widget.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/toggle_widget.dart';
|
||||
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
|
||||
|
||||
class LivingRoomDeviceControl extends StatelessWidget with HelperResponsiveLayout {
|
||||
class LivingRoomDeviceControlsView extends StatelessWidget
|
||||
with HelperResponsiveLayout {
|
||||
final String deviceId;
|
||||
|
||||
const LivingRoomDeviceControl({super.key, required this.deviceId});
|
||||
const LivingRoomDeviceControlsView({super.key, required this.deviceId});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) =>
|
||||
LivingRoomBloc(deviceId: deviceId)..add(LivingRoomFetchDeviceStatus(deviceId)),
|
||||
create: (context) => LivingRoomBloc(deviceId: deviceId)
|
||||
..add(LivingRoomFetchDeviceStatusEvent(deviceId)),
|
||||
child: BlocBuilder<LivingRoomBloc, LivingRoomState>(
|
||||
builder: (context, state) {
|
||||
if (state is LivingRoomDeviceStatusLoading) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (state is LivingRoomDeviceStatusLoaded) {
|
||||
return _buildStatusControls(context, state.status);
|
||||
} else if (state is LivingRoomDeviceManagementError || state is LivingRoomControlError) {
|
||||
} else if (state is LivingRoomDeviceManagementError ||
|
||||
state is LivingRoomControlError) {
|
||||
return const Center(child: Text('Error fetching status'));
|
||||
} else {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
@ -31,7 +33,8 @@ class LivingRoomDeviceControl extends StatelessWidget with HelperResponsiveLayou
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildStatusControls(BuildContext context, LivingRoomStatusModel status) {
|
||||
Widget _buildStatusControls(
|
||||
BuildContext context, LivingRoomStatusModel status) {
|
||||
final isExtraLarge = isExtraLargeScreenSize(context);
|
||||
final isLarge = isLargeScreenSize(context);
|
||||
final isMedium = isMediumScreenSize(context);
|
||||
@ -55,18 +58,36 @@ class LivingRoomDeviceControl extends StatelessWidget with HelperResponsiveLayou
|
||||
code: 'switch_1',
|
||||
deviceId: deviceId,
|
||||
label: 'Wall Light',
|
||||
onChange: (value) {
|
||||
context.read<LivingRoomBloc>().add(
|
||||
LivingRoomControl(
|
||||
deviceId: deviceId, code: 'switch_1', value: value),
|
||||
);
|
||||
},
|
||||
),
|
||||
ToggleWidget(
|
||||
value: status.switch2,
|
||||
code: 'switch_2',
|
||||
deviceId: deviceId,
|
||||
label: 'Ceiling Light',
|
||||
onChange: (value) {
|
||||
context.read<LivingRoomBloc>().add(
|
||||
LivingRoomControl(
|
||||
deviceId: deviceId, code: 'switch_2', value: value),
|
||||
);
|
||||
},
|
||||
),
|
||||
ToggleWidget(
|
||||
value: status.switch3,
|
||||
code: 'switch_3',
|
||||
deviceId: deviceId,
|
||||
label: 'Spotlight',
|
||||
onChange: (value) {
|
||||
context.read<LivingRoomBloc>().add(
|
||||
LivingRoomControl(
|
||||
deviceId: deviceId, code: 'switch_3', value: value),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
|
@ -0,0 +1,158 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/two_gang_switch/bloc/two_gang_switch_event.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/two_gang_switch/bloc/two_gang_switch_state.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/two_gang_switch/models/two_gang_status_model.dart';
|
||||
import 'package:syncrow_web/services/devices_mang_api.dart';
|
||||
|
||||
class TwoGangSwitchBloc extends Bloc<TwoGangSwitchEvent, TwoGangSwitchState> {
|
||||
TwoGangSwitchBloc({required this.deviceId}) : super(TwoGangSwitchInitial()) {
|
||||
on<TwoGangSwitchFetchDeviceEvent>(_onFetchDeviceStatus);
|
||||
on<TwoGangSwitchControl>(_onControl);
|
||||
on<TwoGangSwitchFetchBatchEvent>(_onFetchBatchStatus);
|
||||
on<TwoGangSwitchBatchControl>(_onBatchControl);
|
||||
}
|
||||
|
||||
late TwoGangStatusModel deviceStatus;
|
||||
final String deviceId;
|
||||
Timer? _timer;
|
||||
|
||||
FutureOr<void> _onFetchDeviceStatus(TwoGangSwitchFetchDeviceEvent event,
|
||||
Emitter<TwoGangSwitchState> emit) async {
|
||||
emit(TwoGangSwitchLoading());
|
||||
try {
|
||||
final status =
|
||||
await DevicesManagementApi().getDeviceStatus(event.deviceId);
|
||||
|
||||
deviceStatus = TwoGangStatusModel.fromJson(event.deviceId, status.status);
|
||||
emit(TwoGangSwitchStatusLoaded(deviceStatus));
|
||||
} catch (e) {
|
||||
emit(TwoGangSwitchError(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
FutureOr<void> _onControl(
|
||||
TwoGangSwitchControl event, Emitter<TwoGangSwitchState> emit) async {
|
||||
final oldValue = _getValueByCode(event.code);
|
||||
|
||||
_updateLocalValue(event.code, event.value);
|
||||
|
||||
emit(TwoGangSwitchStatusLoaded(deviceStatus));
|
||||
|
||||
await _runDebounce(
|
||||
deviceId: event.deviceId,
|
||||
code: event.code,
|
||||
value: event.value,
|
||||
oldValue: oldValue,
|
||||
emit: emit,
|
||||
isBatch: false,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _runDebounce({
|
||||
required dynamic deviceId,
|
||||
required String code,
|
||||
required bool value,
|
||||
required bool oldValue,
|
||||
required Emitter<TwoGangSwitchState> emit,
|
||||
required bool isBatch,
|
||||
}) async {
|
||||
late String id;
|
||||
|
||||
if (deviceId is List) {
|
||||
id = deviceId.first;
|
||||
} else {
|
||||
id = deviceId;
|
||||
}
|
||||
|
||||
if (_timer != null) {
|
||||
_timer!.cancel();
|
||||
}
|
||||
|
||||
_timer = Timer(const Duration(milliseconds: 500), () async {
|
||||
try {
|
||||
late bool response;
|
||||
if (isBatch) {
|
||||
response = await DevicesManagementApi()
|
||||
.deviceBatchControl(deviceId, code, value);
|
||||
} else {
|
||||
response = await DevicesManagementApi()
|
||||
.deviceControl(deviceId, Status(code: code, value: value));
|
||||
}
|
||||
|
||||
if (!response) {
|
||||
_revertValueAndEmit(id, code, oldValue, emit);
|
||||
}
|
||||
} catch (e) {
|
||||
_revertValueAndEmit(id, code, oldValue, emit);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _revertValueAndEmit(String deviceId, String code, bool oldValue,
|
||||
Emitter<TwoGangSwitchState> emit) {
|
||||
_updateLocalValue(code, oldValue);
|
||||
emit(TwoGangSwitchStatusLoaded(deviceStatus));
|
||||
}
|
||||
|
||||
void _updateLocalValue(String code, bool value) {
|
||||
if (code == 'switch_1') {
|
||||
deviceStatus = deviceStatus.copyWith(switch1: value);
|
||||
}
|
||||
|
||||
if (code == 'switch_2') {
|
||||
deviceStatus = deviceStatus.copyWith(switch2: value);
|
||||
}
|
||||
}
|
||||
|
||||
bool _getValueByCode(String code) {
|
||||
switch (code) {
|
||||
case 'switch_1':
|
||||
return deviceStatus.switch1;
|
||||
case 'switch_2':
|
||||
return deviceStatus.switch2;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _onFetchBatchStatus(TwoGangSwitchFetchBatchEvent event,
|
||||
Emitter<TwoGangSwitchState> emit) async {
|
||||
emit(TwoGangSwitchLoading());
|
||||
try {
|
||||
final status =
|
||||
await DevicesManagementApi().getBatchStatus(event.devicesIds);
|
||||
deviceStatus =
|
||||
TwoGangStatusModel.fromJson(event.devicesIds.first, status.status);
|
||||
emit(TwoGangSwitchStatusLoaded(deviceStatus));
|
||||
} catch (e) {
|
||||
emit(TwoGangSwitchError(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> close() {
|
||||
_timer?.cancel();
|
||||
return super.close();
|
||||
}
|
||||
|
||||
FutureOr<void> _onBatchControl(
|
||||
TwoGangSwitchBatchControl event, Emitter<TwoGangSwitchState> emit) async {
|
||||
final oldValue = _getValueByCode(event.code);
|
||||
|
||||
_updateLocalValue(event.code, event.value);
|
||||
|
||||
emit(TwoGangSwitchStatusLoaded(deviceStatus));
|
||||
|
||||
await _runDebounce(
|
||||
deviceId: event.deviceId,
|
||||
code: event.code,
|
||||
value: event.value,
|
||||
oldValue: oldValue,
|
||||
emit: emit,
|
||||
isBatch: true,
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
class TwoGangSwitchEvent extends Equatable {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
class TwoGangSwitchFetchDeviceEvent extends TwoGangSwitchEvent {
|
||||
final String deviceId;
|
||||
|
||||
TwoGangSwitchFetchDeviceEvent(this.deviceId);
|
||||
|
||||
@override
|
||||
List<Object> get props => [deviceId];
|
||||
}
|
||||
|
||||
class TwoGangSwitchControl extends TwoGangSwitchEvent {
|
||||
final String deviceId;
|
||||
final String code;
|
||||
final bool value;
|
||||
|
||||
TwoGangSwitchControl(
|
||||
{required this.deviceId, required this.code, required this.value});
|
||||
|
||||
@override
|
||||
List<Object> get props => [deviceId, code, value];
|
||||
}
|
||||
|
||||
class TwoGangSwitchFetchBatchEvent extends TwoGangSwitchEvent {
|
||||
final List<String> devicesIds;
|
||||
|
||||
TwoGangSwitchFetchBatchEvent(this.devicesIds);
|
||||
|
||||
@override
|
||||
List<Object> get props => [devicesIds];
|
||||
}
|
||||
|
||||
class TwoGangSwitchBatchControl extends TwoGangSwitchEvent {
|
||||
final List<String> deviceId;
|
||||
final String code;
|
||||
final bool value;
|
||||
|
||||
TwoGangSwitchBatchControl(
|
||||
{required this.deviceId, required this.code, required this.value});
|
||||
|
||||
@override
|
||||
List<Object> get props => [deviceId, code, value];
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/two_gang_switch/models/two_gang_status_model.dart';
|
||||
|
||||
class TwoGangSwitchState extends Equatable {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
class TwoGangSwitchInitial extends TwoGangSwitchState {}
|
||||
|
||||
class TwoGangSwitchLoading extends TwoGangSwitchState {}
|
||||
|
||||
class TwoGangSwitchStatusLoaded extends TwoGangSwitchState {
|
||||
final TwoGangStatusModel status;
|
||||
|
||||
TwoGangSwitchStatusLoaded(this.status);
|
||||
|
||||
@override
|
||||
List<Object> get props => [status];
|
||||
}
|
||||
|
||||
class TwoGangSwitchError extends TwoGangSwitchState {
|
||||
final String message;
|
||||
|
||||
TwoGangSwitchError(this.message);
|
||||
|
||||
@override
|
||||
List<Object> get props => [message];
|
||||
}
|
||||
|
||||
class TwoGangSwitchControlError extends TwoGangSwitchState {
|
||||
final String message;
|
||||
|
||||
TwoGangSwitchControlError(this.message);
|
||||
|
||||
@override
|
||||
List<Object> get props => [message];
|
||||
}
|
||||
|
||||
class TwoGangSwitchBatchControlError extends TwoGangSwitchState {
|
||||
final String message;
|
||||
|
||||
TwoGangSwitchBatchControlError(this.message);
|
||||
|
||||
@override
|
||||
List<Object> get props => [message];
|
||||
}
|
||||
|
||||
class TwoGangSwitchBatchStatusLoaded extends TwoGangSwitchState {
|
||||
final List<String> status;
|
||||
|
||||
TwoGangSwitchBatchStatusLoaded(this.status);
|
||||
|
||||
@override
|
||||
List<Object> get props => [status];
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
|
||||
|
||||
class TwoGangStatusModel {
|
||||
final String uuid;
|
||||
final bool switch1;
|
||||
final bool switch2;
|
||||
final int countDown;
|
||||
final int countDown2;
|
||||
|
||||
TwoGangStatusModel({
|
||||
required this.uuid,
|
||||
required this.switch1,
|
||||
required this.switch2,
|
||||
required this.countDown,
|
||||
required this.countDown2,
|
||||
});
|
||||
|
||||
factory TwoGangStatusModel.fromJson(String id, List<Status> jsonList) {
|
||||
late bool switch1;
|
||||
late bool switch2;
|
||||
late int countDown;
|
||||
late int countDown2;
|
||||
|
||||
for (var status in jsonList) {
|
||||
switch (status.code) {
|
||||
case 'switch_1':
|
||||
switch1 = status.value ?? false;
|
||||
break;
|
||||
case 'countdown_1':
|
||||
countDown = status.value ?? 0;
|
||||
break;
|
||||
case 'switch_2':
|
||||
switch2 = status.value ?? false;
|
||||
break;
|
||||
case 'countdown_2':
|
||||
countDown2 = status.value ?? 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return TwoGangStatusModel(
|
||||
uuid: id,
|
||||
switch1: switch1,
|
||||
countDown: countDown,
|
||||
switch2: switch2,
|
||||
countDown2: countDown2,
|
||||
);
|
||||
}
|
||||
|
||||
TwoGangStatusModel copyWith({
|
||||
String? uuid,
|
||||
bool? switch1,
|
||||
int? countDown,
|
||||
bool? switch2,
|
||||
int? countDown2,
|
||||
}) {
|
||||
return TwoGangStatusModel(
|
||||
uuid: uuid ?? this.uuid,
|
||||
switch1: switch1 ?? this.switch1,
|
||||
countDown: countDown ?? this.countDown,
|
||||
switch2: switch2 ?? this.switch2,
|
||||
countDown2: countDown2 ?? this.countDown2,
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/batch_control/factory_reset.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/batch_control/firmware_update.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/toggle_widget.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/two_gang_switch/bloc/two_gang_switch_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/two_gang_switch/bloc/two_gang_switch_event.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/two_gang_switch/bloc/two_gang_switch_state.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/two_gang_switch/models/two_gang_status_model.dart';
|
||||
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
|
||||
|
||||
class TwoGangBatchControlView extends StatelessWidget
|
||||
with HelperResponsiveLayout {
|
||||
const TwoGangBatchControlView({super.key, required this.deviceIds});
|
||||
|
||||
final List<String> deviceIds;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) => TwoGangSwitchBloc(deviceId: deviceIds.first)
|
||||
..add(TwoGangSwitchFetchBatchEvent(deviceIds)),
|
||||
child: BlocBuilder<TwoGangSwitchBloc, TwoGangSwitchState>(
|
||||
builder: (context, state) {
|
||||
if (state is TwoGangSwitchLoading) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (state is TwoGangSwitchStatusLoaded) {
|
||||
return _buildStatusControls(context, state.status);
|
||||
} else if (state is TwoGangSwitchError ||
|
||||
state is TwoGangSwitchControlError) {
|
||||
return const Center(child: Text('Error fetching status'));
|
||||
} else {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildStatusControls(BuildContext context, TwoGangStatusModel status) {
|
||||
final isExtraLarge = isExtraLargeScreenSize(context);
|
||||
final isLarge = isLargeScreenSize(context);
|
||||
final isMedium = isMediumScreenSize(context);
|
||||
return SizedBox(
|
||||
child: GridView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 50),
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: isLarge || isExtraLarge
|
||||
? 3
|
||||
: isMedium
|
||||
? 2
|
||||
: 1,
|
||||
mainAxisExtent: 140,
|
||||
crossAxisSpacing: 12,
|
||||
mainAxisSpacing: 12,
|
||||
),
|
||||
children: [
|
||||
ToggleWidget(
|
||||
value: status.switch1,
|
||||
code: 'switch_1',
|
||||
deviceId: deviceIds.first,
|
||||
label: 'Wall Light',
|
||||
onChange: (value) {
|
||||
context.read<TwoGangSwitchBloc>().add(TwoGangSwitchBatchControl(
|
||||
deviceId: deviceIds,
|
||||
code: 'switch_1',
|
||||
value: value,
|
||||
));
|
||||
},
|
||||
),
|
||||
ToggleWidget(
|
||||
value: status.switch2,
|
||||
code: 'switch_2',
|
||||
deviceId: deviceIds.first,
|
||||
label: 'Ceiling Light',
|
||||
onChange: (value) {
|
||||
context.read<TwoGangSwitchBloc>().add(TwoGangSwitchBatchControl(
|
||||
deviceId: deviceIds,
|
||||
code: 'switch_2',
|
||||
value: value,
|
||||
));
|
||||
},
|
||||
),
|
||||
FirmwareUpdateWidget(
|
||||
deviceId: deviceIds.first,
|
||||
version: 12,
|
||||
),
|
||||
FactoryResetWidget(deviceId: deviceIds.first),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/toggle_widget.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/two_gang_switch/bloc/two_gang_switch_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/two_gang_switch/bloc/two_gang_switch_event.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/two_gang_switch/bloc/two_gang_switch_state.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/two_gang_switch/models/two_gang_status_model.dart';
|
||||
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
|
||||
|
||||
class TwoGangDeviceControlView extends StatelessWidget
|
||||
with HelperResponsiveLayout {
|
||||
final String deviceId;
|
||||
|
||||
const TwoGangDeviceControlView({super.key, required this.deviceId});
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) => TwoGangSwitchBloc(deviceId: deviceId)
|
||||
..add(TwoGangSwitchFetchDeviceEvent(deviceId)),
|
||||
child: BlocBuilder<TwoGangSwitchBloc, TwoGangSwitchState>(
|
||||
builder: (context, state) {
|
||||
if (state is TwoGangSwitchLoading) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (state is TwoGangSwitchStatusLoaded) {
|
||||
return _buildStatusControls(context, state.status);
|
||||
} else if (state is TwoGangSwitchError ||
|
||||
state is TwoGangSwitchControlError) {
|
||||
return const Center(child: Text('Error fetching status'));
|
||||
} else {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildStatusControls(BuildContext context, TwoGangStatusModel status) {
|
||||
final isExtraLarge = isExtraLargeScreenSize(context);
|
||||
final isLarge = isLargeScreenSize(context);
|
||||
final isMedium = isMediumScreenSize(context);
|
||||
return GridView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 50),
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: isLarge || isExtraLarge
|
||||
? 3
|
||||
: isMedium
|
||||
? 2
|
||||
: 1,
|
||||
mainAxisExtent: 140,
|
||||
crossAxisSpacing: 12,
|
||||
mainAxisSpacing: 12,
|
||||
),
|
||||
children: [
|
||||
ToggleWidget(
|
||||
value: status.switch1,
|
||||
code: 'switch_1',
|
||||
deviceId: deviceId,
|
||||
label: 'Wall Light',
|
||||
onChange: (value) {
|
||||
context.read<TwoGangSwitchBloc>().add(TwoGangSwitchControl(
|
||||
deviceId: deviceId,
|
||||
code: 'switch_1',
|
||||
value: value,
|
||||
));
|
||||
},
|
||||
),
|
||||
ToggleWidget(
|
||||
value: status.switch2,
|
||||
code: 'switch_2',
|
||||
deviceId: deviceId,
|
||||
label: 'Ceiling Light',
|
||||
onChange: (value) {
|
||||
context.read<TwoGangSwitchBloc>().add(TwoGangSwitchControl(
|
||||
deviceId: deviceId,
|
||||
code: 'switch_2',
|
||||
value: value,
|
||||
));
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|