Merge branch 'main' into front/fd-467

This commit is contained in:
Ivan Antunes 2024-08-26 10:58:48 -03:00
commit 1a4bab1865
12 changed files with 359 additions and 86 deletions

View File

@ -1,4 +0,0 @@
gradle 7.6.3
flutter 3.24.0-stable
java openjdk-19
kotlin 2.0.10

View File

@ -0,0 +1,22 @@
<svg width="750" height="750" viewBox="0 0 750 750" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M703 648.71C703 673.011 645.245 725.71 574 725.71C502.755 725.71 445 673.011 445 648.71C445 624.41 502.755 637.71 574 637.71C645.245 637.71 703 624.41 703 648.71Z" fill="#3F3D56"/>
<path d="M208 566V446H288V566H388V406H448L248 226L48 406H108V566H208Z" fill="#DDDDDD"/>
<path opacity="0.1" d="M703 648.71C703 673.011 645.245 725.71 574 725.71C502.755 725.71 445 673.011 445 648.71C445 624.41 502.755 637.71 574 637.71C645.245 637.71 703 624.41 703 648.71Z" fill="black"/>
<path d="M574 692.71C645.245 692.71 703 673.011 703 648.71C703 624.41 645.245 604.71 574 604.71C502.755 604.71 445 624.41 445 648.71C445 673.011 502.755 692.71 574 692.71Z" fill="#3F3D56"/>
<path d="M619.5 102.71C641.315 102.71 659 86.1447 659 65.7102C659 45.2757 641.315 28.7102 619.5 28.7102C597.685 28.7102 580 45.2757 580 65.7102C580 86.1447 597.685 102.71 619.5 102.71Z" fill="#2F2E41"/>
<path d="M504.5 296.21L494.5 310.21C494.5 310.21 446.5 320.21 464.5 335.21C482.5 350.21 508.5 321.21 508.5 321.21L522.5 303.21L504.5 296.21Z" fill="#FFB8B8"/>
<path d="M556.5 137.21C556.5 137.21 543.5 137.21 540.5 155.21C537.5 173.21 534.5 233.21 534.5 233.21C534.5 233.21 492.5 288.21 499.5 295.21C506.5 302.21 514.5 315.21 519.5 313.21C524.5 311.21 567.5 252.21 567.5 252.21L556.5 137.21Z" fill="#1AAB5F"/>
<path opacity="0.1" d="M556.5 137.21C556.5 137.21 543.5 137.21 540.5 155.21C537.5 173.21 534.5 233.21 534.5 233.21C534.5 233.21 492.5 288.21 499.5 295.21C506.5 302.21 514.5 315.21 519.5 313.21C524.5 311.21 567.5 252.21 567.5 252.21L556.5 137.21Z" fill="#1AAB5F"/>
<path d="M596.5 86.2102C596.5 86.2102 595.5 125.21 583.5 127.21C571.5 129.21 575.5 142.21 575.5 142.21C575.5 142.21 614.5 165.21 640.5 142.21L645.5 130.21C645.5 130.21 627.5 117.21 635.5 99.2102L596.5 86.2102Z" fill="#FFB8B8"/>
<path d="M529.5 326.21C529.5 326.21 470.5 436.21 492.5 470.21C514.5 504.21 547.5 574.21 552.5 574.21C557.5 574.21 585.5 560.21 583.5 551.21C581.5 542.21 551.5 475.21 543.5 469.21C535.5 463.21 539.5 447.21 540.5 446.21C541.5 445.21 574.5 392.21 574.5 392.21C574.5 392.21 573.5 476.21 577.5 489.21C581.5 502.21 576.5 595.21 581.5 599.21C586.5 603.21 609.5 610.21 613.5 604.21C617.5 598.21 629.5 507.21 621.5 486.21L636.5 342.21L529.5 326.21Z" fill="#3F3D56"/>
<path d="M583.5 593.21L558.5 639.21C558.5 639.21 522.5 665.21 547.5 669.21C572.5 673.21 587.5 663.21 587.5 663.21L609.5 647.21V601.21L583.5 593.21Z" fill="#3F3D56"/>
<path d="M549.5 567.21L562.5 598.21C562.5 598.21 567.5 611.21 562.5 614.21C557.5 617.21 543.5 635.21 552.5 637.21C554.311 637.565 556.15 637.748 557.995 637.756C565.49 637.883 572.932 636.491 579.875 633.666C586.817 630.841 593.116 626.64 598.393 621.317L606.5 613.21C606.5 613.21 578.73 549.262 579.115 549.736C579.5 550.21 549.5 567.21 549.5 567.21Z" fill="#3F3D56"/>
<path d="M621.5 110.21C640.278 110.21 655.5 94.9879 655.5 76.2102C655.5 57.4325 640.278 42.2102 621.5 42.2102C602.722 42.2102 587.5 57.4325 587.5 76.2102C587.5 94.9879 602.722 110.21 621.5 110.21Z" fill="#FFB8B8"/>
<path d="M641 123.71L630.5 134.21C630.5 134.21 598.5 146.21 583.5 134.21C583.5 134.21 589 122.71 589 123.71C589 124.71 545.5 131.21 541.5 149.21C537.5 167.21 544.5 198.21 544.5 198.21C544.5 198.21 516.5 330.21 527.5 333.21C538.5 336.21 641.5 361.21 640.5 342.21C639.5 323.21 648.5 245.21 648.5 245.21L683.5 178.21C683.5 178.21 678.5 156.21 666.5 149.21C654.5 142.21 641 123.71 641 123.71Z" fill="#1AAB5F"/>
<path d="M596.5 319.21L583.5 327.21C583.5 327.21 533.5 361.21 559.5 367.21C585.5 373.21 600.5 343.21 600.5 343.21L610.5 331.21L596.5 319.21Z" fill="#FFB8B8"/>
<path opacity="0.1" d="M670.5 172.21L679.5 181.21C679.5 181.21 685.5 265.21 673.5 282.21C661.5 299.21 606.5 345.21 603.5 342.21C600.5 339.21 581.5 324.21 585.5 322.21C589.5 320.21 642.683 264.641 642.683 264.641L638.5 187.21L670.5 172.21Z" fill="black"/>
<path d="M674.5 169.21L683.5 178.21C683.5 178.21 689.5 262.21 677.5 279.21C665.5 296.21 610.5 342.21 607.5 339.21C604.5 336.21 585.5 321.21 589.5 319.21C593.5 317.21 646.683 261.641 646.683 261.641L642.5 184.21L674.5 169.21Z" fill="#1AAB5F"/>
<path d="M607.438 27.9154C607.438 27.9154 595.881 23.7126 580.121 32.6434L588.526 34.7448C588.526 34.7448 575.918 35.7955 574.342 52.6064H580.121C580.121 52.6064 576.443 67.3159 580.121 71.5187L582.485 67.0533L589.314 80.7121L590.89 73.8827L594.042 74.9334L596.143 63.9012C596.143 63.9012 601.397 71.7813 605.6 72.3067V65.4772C605.6 65.4772 617.157 78.6108 620.834 78.0854L615.581 70.7307L622.936 72.3067L619.784 67.0533L638.696 72.3067L634.493 67.0533L647.627 71.256L653.931 73.8827C653.931 73.8827 662.862 53.3944 650.254 39.2102C637.645 25.026 619.258 21.8739 607.438 27.9154Z" fill="#2F2E41"/>
<path d="M227.29 402.383C226.832 401.502 226.415 400.595 226.038 399.661C222.986 392.076 223.067 383.589 226.264 376.063C229.461 368.537 235.513 362.586 243.092 359.517L256.791 353.987L258.662 358.624L244.963 364.154C241.815 365.423 238.947 367.3 236.524 369.678C234.101 372.055 232.17 374.887 230.842 378.011C229.514 381.135 228.814 384.491 228.783 387.885C228.752 391.28 229.39 394.647 230.661 397.795C231.932 400.943 233.81 403.81 236.19 406.232C238.569 408.653 241.401 410.582 244.526 411.909C247.651 413.235 251.007 413.933 254.402 413.962C257.796 413.992 261.163 413.352 264.311 412.079L321.839 388.856C324.986 387.585 327.852 385.708 330.273 383.33C332.694 380.952 334.623 378.12 335.95 374.997C337.277 371.873 337.976 368.519 338.006 365.126C338.037 361.732 337.399 358.366 336.128 355.219C334.858 352.072 332.98 349.207 330.602 346.786C328.224 344.364 325.393 342.435 322.27 341.108C319.146 339.782 315.792 339.083 312.399 339.052C309.005 339.022 305.639 339.66 302.492 340.93L282.124 349.153L280.253 344.515L300.621 336.293C308.205 333.234 316.694 333.313 324.221 336.512C331.748 339.711 337.696 345.768 340.757 353.352C343.818 360.935 343.742 369.424 340.545 376.952C337.349 384.479 331.293 390.429 323.711 393.493L266.182 416.716C259.077 419.584 251.159 419.704 243.97 417.055C236.78 414.405 230.834 409.175 227.29 402.383Z" fill="#3F3D56"/>
<path d="M158.93 399.378C158.479 398.509 158.067 397.613 157.693 396.688C154.64 389.102 154.721 380.615 157.919 373.089C161.116 365.563 167.168 359.613 174.747 356.543L232.275 333.32C239.861 330.258 248.351 330.335 255.88 333.533C263.408 336.732 269.358 342.79 272.42 350.375C275.482 357.96 275.405 366.451 272.207 373.979C269.008 381.508 262.95 387.457 255.365 390.519L240.252 396.62L238.381 391.983L253.494 385.882C256.641 384.612 259.507 382.734 261.928 380.356C264.349 377.978 266.278 375.147 267.605 372.023C268.932 368.9 269.63 365.546 269.661 362.152C269.691 358.759 269.053 355.393 267.783 352.246C266.513 349.099 264.635 346.233 262.257 343.812C259.879 341.391 257.048 339.462 253.924 338.135C250.801 336.808 247.447 336.11 244.053 336.079C240.66 336.048 237.293 336.686 234.147 337.957L176.618 361.18C173.469 362.449 170.601 364.326 168.178 366.704C165.756 369.082 163.825 371.914 162.497 375.038C161.168 378.162 160.469 381.517 160.438 384.912C160.407 388.306 161.045 391.674 162.316 394.822C163.587 397.97 165.465 400.836 167.844 403.258C170.223 405.68 173.056 407.609 176.181 408.935C179.306 410.262 182.662 410.96 186.056 410.989C189.451 411.018 192.818 410.378 195.965 409.106L215.767 401.112L217.638 405.749L197.836 413.743C190.725 416.603 182.804 416.717 175.614 414.062C168.423 411.407 162.477 406.173 158.93 399.378Z" fill="#3F3D56"/>
</svg>

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@ -0,0 +1,22 @@
<svg width="750" height="750" viewBox="0 0 750 750" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M703 648.71C703 673.011 645.245 725.71 574 725.71C502.755 725.71 445 673.011 445 648.71C445 624.41 502.755 637.71 574 637.71C645.245 637.71 703 624.41 703 648.71Z" fill="#3F3D56"/>
<path d="M208 566V446H288V566H388V406H448L248 226L48 406H108V566H208Z" fill="#1AAB5F"/>
<path opacity="0.1" d="M703 648.71C703 673.011 645.245 725.71 574 725.71C502.755 725.71 445 673.011 445 648.71C445 624.41 502.755 637.71 574 637.71C645.245 637.71 703 624.41 703 648.71Z" fill="black"/>
<path d="M574 692.71C645.245 692.71 703 673.011 703 648.71C703 624.41 645.245 604.71 574 604.71C502.755 604.71 445 624.41 445 648.71C445 673.011 502.755 692.71 574 692.71Z" fill="#3F3D56"/>
<path d="M619.5 102.71C641.315 102.71 659 86.1447 659 65.7102C659 45.2757 641.315 28.7102 619.5 28.7102C597.685 28.7102 580 45.2757 580 65.7102C580 86.1447 597.685 102.71 619.5 102.71Z" fill="#2F2E41"/>
<path d="M504.5 296.21L494.5 310.21C494.5 310.21 446.5 320.21 464.5 335.21C482.5 350.21 508.5 321.21 508.5 321.21L522.5 303.21L504.5 296.21Z" fill="#FFB8B8"/>
<path d="M556.5 137.21C556.5 137.21 543.5 137.21 540.5 155.21C537.5 173.21 534.5 233.21 534.5 233.21C534.5 233.21 492.5 288.21 499.5 295.21C506.5 302.21 514.5 315.21 519.5 313.21C524.5 311.21 567.5 252.21 567.5 252.21L556.5 137.21Z" fill="#1AAB5F"/>
<path opacity="0.1" d="M556.5 137.21C556.5 137.21 543.5 137.21 540.5 155.21C537.5 173.21 534.5 233.21 534.5 233.21C534.5 233.21 492.5 288.21 499.5 295.21C506.5 302.21 514.5 315.21 519.5 313.21C524.5 311.21 567.5 252.21 567.5 252.21L556.5 137.21Z" fill="#1AAB5F"/>
<path d="M596.5 86.2102C596.5 86.2102 595.5 125.21 583.5 127.21C571.5 129.21 575.5 142.21 575.5 142.21C575.5 142.21 614.5 165.21 640.5 142.21L645.5 130.21C645.5 130.21 627.5 117.21 635.5 99.2102L596.5 86.2102Z" fill="#FFB8B8"/>
<path d="M529.5 326.21C529.5 326.21 470.5 436.21 492.5 470.21C514.5 504.21 547.5 574.21 552.5 574.21C557.5 574.21 585.5 560.21 583.5 551.21C581.5 542.21 551.5 475.21 543.5 469.21C535.5 463.21 539.5 447.21 540.5 446.21C541.5 445.21 574.5 392.21 574.5 392.21C574.5 392.21 573.5 476.21 577.5 489.21C581.5 502.21 576.5 595.21 581.5 599.21C586.5 603.21 609.5 610.21 613.5 604.21C617.5 598.21 629.5 507.21 621.5 486.21L636.5 342.21L529.5 326.21Z" fill="#3F3D56"/>
<path d="M583.5 593.21L558.5 639.21C558.5 639.21 522.5 665.21 547.5 669.21C572.5 673.21 587.5 663.21 587.5 663.21L609.5 647.21V601.21L583.5 593.21Z" fill="#3F3D56"/>
<path d="M549.5 567.21L562.5 598.21C562.5 598.21 567.5 611.21 562.5 614.21C557.5 617.21 543.5 635.21 552.5 637.21C554.311 637.565 556.15 637.748 557.995 637.756C565.49 637.883 572.932 636.491 579.875 633.666C586.817 630.841 593.116 626.64 598.393 621.317L606.5 613.21C606.5 613.21 578.73 549.262 579.115 549.736C579.5 550.21 549.5 567.21 549.5 567.21Z" fill="#3F3D56"/>
<path d="M621.5 110.21C640.278 110.21 655.5 94.9879 655.5 76.2102C655.5 57.4325 640.278 42.2102 621.5 42.2102C602.722 42.2102 587.5 57.4325 587.5 76.2102C587.5 94.9879 602.722 110.21 621.5 110.21Z" fill="#FFB8B8"/>
<path d="M641 123.71L630.5 134.21C630.5 134.21 598.5 146.21 583.5 134.21C583.5 134.21 589 122.71 589 123.71C589 124.71 545.5 131.21 541.5 149.21C537.5 167.21 544.5 198.21 544.5 198.21C544.5 198.21 516.5 330.21 527.5 333.21C538.5 336.21 641.5 361.21 640.5 342.21C639.5 323.21 648.5 245.21 648.5 245.21L683.5 178.21C683.5 178.21 678.5 156.21 666.5 149.21C654.5 142.21 641 123.71 641 123.71Z" fill="#1AAB5F"/>
<path d="M596.5 319.21L583.5 327.21C583.5 327.21 533.5 361.21 559.5 367.21C585.5 373.21 600.5 343.21 600.5 343.21L610.5 331.21L596.5 319.21Z" fill="#FFB8B8"/>
<path opacity="0.1" d="M670.5 172.21L679.5 181.21C679.5 181.21 685.5 265.21 673.5 282.21C661.5 299.21 606.5 345.21 603.5 342.21C600.5 339.21 581.5 324.21 585.5 322.21C589.5 320.21 642.683 264.641 642.683 264.641L638.5 187.21L670.5 172.21Z" fill="black"/>
<path d="M674.5 169.21L683.5 178.21C683.5 178.21 689.5 262.21 677.5 279.21C665.5 296.21 610.5 342.21 607.5 339.21C604.5 336.21 585.5 321.21 589.5 319.21C593.5 317.21 646.683 261.641 646.683 261.641L642.5 184.21L674.5 169.21Z" fill="#1AAB5F"/>
<path d="M607.438 27.9154C607.438 27.9154 595.881 23.7126 580.121 32.6434L588.526 34.7448C588.526 34.7448 575.918 35.7955 574.342 52.6064H580.121C580.121 52.6064 576.443 67.3159 580.121 71.5187L582.485 67.0533L589.314 80.7121L590.89 73.8827L594.042 74.9334L596.143 63.9012C596.143 63.9012 601.397 71.7813 605.6 72.3067V65.4772C605.6 65.4772 617.157 78.6108 620.834 78.0854L615.581 70.7307L622.936 72.3067L619.784 67.0533L638.696 72.3067L634.493 67.0533L647.627 71.256L653.931 73.8827C653.931 73.8827 662.862 53.3944 650.254 39.2102C637.645 25.026 619.258 21.8739 607.438 27.9154Z" fill="#2F2E41"/>
<path d="M227.29 402.383C226.832 401.502 226.415 400.595 226.038 399.661C222.986 392.076 223.067 383.589 226.264 376.063C229.461 368.537 235.513 362.586 243.092 359.517L256.791 353.987L258.662 358.624L244.963 364.154C241.815 365.423 238.947 367.3 236.524 369.678C234.101 372.055 232.17 374.887 230.842 378.011C229.514 381.135 228.814 384.491 228.783 387.885C228.752 391.28 229.39 394.647 230.661 397.795C231.932 400.943 233.81 403.81 236.19 406.232C238.569 408.653 241.401 410.582 244.526 411.909C247.651 413.235 251.007 413.933 254.402 413.962C257.796 413.992 261.163 413.352 264.311 412.079L321.839 388.856C324.986 387.585 327.852 385.708 330.273 383.33C332.694 380.952 334.623 378.12 335.95 374.997C337.277 371.873 337.976 368.519 338.006 365.126C338.037 361.732 337.399 358.366 336.128 355.219C334.858 352.072 332.98 349.207 330.602 346.786C328.224 344.364 325.393 342.435 322.27 341.108C319.146 339.782 315.792 339.083 312.399 339.052C309.005 339.022 305.639 339.66 302.492 340.93L282.124 349.153L280.253 344.515L300.621 336.293C308.205 333.234 316.694 333.313 324.221 336.512C331.748 339.711 337.696 345.768 340.757 353.352C343.818 360.935 343.742 369.424 340.545 376.952C337.349 384.479 331.293 390.429 323.711 393.493L266.182 416.716C259.077 419.584 251.159 419.704 243.97 417.055C236.78 414.405 230.834 409.175 227.29 402.383Z" fill="white"/>
<path d="M158.93 399.378C158.479 398.509 158.067 397.613 157.693 396.688C154.64 389.102 154.721 380.615 157.919 373.089C161.116 365.563 167.168 359.613 174.747 356.543L232.275 333.32C239.861 330.258 248.351 330.335 255.88 333.533C263.408 336.732 269.358 342.79 272.42 350.375C275.482 357.96 275.405 366.451 272.207 373.979C269.008 381.508 262.95 387.457 255.365 390.519L240.252 396.62L238.381 391.983L253.494 385.882C256.641 384.612 259.507 382.734 261.928 380.356C264.349 377.978 266.278 375.147 267.605 372.023C268.932 368.9 269.63 365.546 269.661 362.152C269.691 358.759 269.053 355.393 267.783 352.246C266.513 349.099 264.635 346.233 262.257 343.812C259.879 341.391 257.048 339.462 253.924 338.135C250.801 336.808 247.447 336.11 244.053 336.079C240.66 336.048 237.293 336.686 234.147 337.957L176.618 361.18C173.469 362.449 170.601 364.326 168.178 366.704C165.756 369.082 163.825 371.914 162.497 375.038C161.168 378.162 160.469 381.517 160.438 384.912C160.407 388.306 161.045 391.674 162.316 394.822C163.587 397.97 165.465 400.836 167.844 403.258C170.223 405.68 173.056 407.609 176.181 408.935C179.306 410.262 182.662 410.96 186.056 410.989C189.451 411.018 192.818 410.378 195.965 409.106L215.767 401.112L217.638 405.749L197.836 413.743C190.725 416.603 182.804 416.717 175.614 414.062C168.423 411.407 162.477 406.173 158.93 399.378Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@ -1,3 +1,5 @@
import 'dart:developer';
import 'package:flutter/material.dart';
// import 'package:hub/components/organisms/bottom_arrow_linked_locals/bottom_arrow_linked_locals_component_widget.dart';
import 'package:hub/backend/api_requests/api_calls.dart';
@ -96,7 +98,8 @@ Future<Color> manageStatusColorAction(
}
Future singInLoginAction(
BuildContext context, {
BuildContext context,
FlutterFlowModel model, {
String? emailAdress,
String? password,
}) async {
@ -157,8 +160,8 @@ Future singInLoginAction(
AppState().serialNumber = await getSerialNumber() ?? '';
AppState().isLogged = true;
await toggleHomePage(context);
AppState().haveLocal =
await checkLocals(context: context, model: model);
} else {
if (PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')) == null) {
DialogUtil.errorDefault(context);
@ -302,16 +305,27 @@ Future toggleSignUpPage(BuildContext context) async {
);
}
Future toggleHomePage(BuildContext context) async {
context.goNamed(
'homePage',
extra: <String, dynamic>{
kTransitionInfoKey: const TransitionInfo(
hasTransition: true,
transitionType: PageTransitionType.fade,
),
},
);
Future toggleApp(BuildContext context, bool haveLocal) async {
if (haveLocal == true)
context.goNamed(
'homePage',
extra: <String, dynamic>{
kTransitionInfoKey: const TransitionInfo(
hasTransition: true,
transitionType: PageTransitionType.fade,
),
},
);
else if (haveLocal == false)
context.goNamed(
'receptionPage',
extra: <String, dynamic>{
kTransitionInfoKey: const TransitionInfo(
hasTransition: true,
transitionType: PageTransitionType.fade,
)
},
);
}
Future<bool> visitCancelAction(BuildContext context,
@ -370,57 +384,40 @@ Future<void> snackbar(BuildContext context, {required bool opt}) async {
Future<bool> checkLocals({
String? cliUUID,
required BuildContext context,
required HomePageModel model,
required void Function(void Function()) safeSetState,
required FlutterFlowModel model,
}) async {
bool itemFound = false;
var modalResult;
final response = await PhpGroup.getLocalsCall.call(
devUUID: AppState().devUUID,
userUUID: AppState().userUUID,
);
log(response.jsonBody.toString());
do {
// A chamada para a API permanece a mesma, assumindo que é necessária sempre.
final response = await PhpGroup.getLocalsCall.call(
devUUID: AppState().devUUID,
userUUID: AppState().userUUID,
);
// Verificação rápida de erro para evitar processamento desnecessário.
if (response.jsonBody['error']) {
return false;
}
// Uso eficiente de coleções para verificar a condição desejada.
final String uuid = cliUUID ?? AppState().cliUUID;
itemFound = response.jsonBody['locais'].any(
(local) => local['CLI_ID'] == uuid && local['CLU_STATUS'] == "A",
);
// Log e retorno condicional baseado no resultado da busca.
if (itemFound) {
return true;
} else {
// A chamada para showModalBottomSheet permanece, mas a atualização da UI é otimizada.
modalResult = await showModalBottomSheet(
isScrollControlled: true,
backgroundColor: Colors.transparent,
enableDrag: false,
isDismissible: false,
context: context,
builder: (context) => GestureDetector(
onTap: () => model.unfocusNode.canRequestFocus
? FocusScope.of(context).requestFocus(model.unfocusNode)
: FocusScope.of(context).unfocus(),
child: Padding(
padding: MediaQuery.viewInsetsOf(context),
child: const BottomArrowLinkedLocalsComponentWidget(),
),
),
);
safeSetState(
() {}); // Chamada otimizada fora do then para evitar encadeamentos desnecessários.
}
} while (modalResult != true);
return false;
// Verificação rápida de erro para evitar processamento desnecessário.
if (response.jsonBody['error']) {
DialogUtil.errorDefault(context);
return false;
}
List<dynamic> locals = response.jsonBody['locais'] ?? [];
if (locals != null && locals.isEmpty) {
await toggleApp(context, false);
return false;
} else {
// else if (locals.where((local) => local['CLU_STATUS'] != 'A').isNotEmpty) {
// await showModalBottomSheet(
// isScrollControlled: true,
// backgroundColor: Colors.transparent,
// enableDrag: false,
// isDismissible: false,
// context: context,
// builder: (context) => Padding(
// padding: MediaQuery.viewInsetsOf(context),
// child: const BottomArrowLinkedLocalsComponentWidget(),
// ),
// );
// }
await toggleApp(context, true);
return true;
}
}
Future answersRequest(BuildContext context, String? ref, String? task,

View File

@ -159,6 +159,9 @@ class AppState extends ChangeNotifier {
await _safeInitAsync(() async {
_whatsapp = await secureStorage.getBool('whatsapp') ?? _whatsapp;
});
await _safeInitAsync(() async {
_haveLocal = await secureStorage.getBool('ff_have_local') ?? _haveLocal;
});
}
void update(VoidCallback callback) {
@ -408,6 +411,13 @@ class AppState extends ChangeNotifier {
secureStorage.setBool('ff_isLogged', value);
}
bool _haveLocal = false;
bool get haveLocal => _haveLocal;
set haveLocal(bool value) {
_haveLocal = value;
secureStorage.setBool('ff_have_local', value);
}
void deleteIsLogged() {
secureStorage.delete(key: 'ff_isLogged');
}

View File

@ -1,3 +1,5 @@
import 'package:hub/pages/home_page/home_page_model.dart';
import '/flutter_flow/flutter_flow_util.dart';
import 'sign_in_template_component_widget.dart'
show SignInTemplateComponentWidget;
@ -13,6 +15,8 @@ class SignInTemplateComponentModel
FocusNode? emailAddressFocusNode;
TextEditingController? emailAddressTextController;
String? Function(BuildContext, String?)? emailAddressTextControllerValidator;
SignInTemplateComponentModel();
String? _emailAddressTextControllerValidator(
BuildContext context, String? val) {
if (val == null || val.isEmpty) {

View File

@ -548,6 +548,7 @@ class _SignInTemplateComponentWidgetState
await action_blocks
.singInLoginAction(
context,
_model,
emailAdress: _model
.emailAddressTextController
.text,
@ -707,6 +708,7 @@ class _SignInTemplateComponentWidgetState
await action_blocks
.singInLoginAction(
context,
_model,
emailAdress: _model
.emailAddressTextController
.text,

View File

@ -7,6 +7,8 @@ import 'package:hub/pages/message_history_page/message_history_page_widget.dart'
import 'package:hub/pages/no_connection_page/no_connection_page.dart';
import 'package:hub/pages/package_order_page/package_order_page.dart';
import 'package:hub/pages/reservation_page/reservation_page_widget.dart';
import 'package:hub/pages/preferences_settings_page/preferences_settings_widget.dart';
import 'package:hub/pages/reception_page/reception_page_widget.dart';
import 'package:provider/provider.dart';
import '/backend/schema/structs/index.dart';
@ -70,7 +72,9 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter(
name: '_initialize',
path: '/',
builder: (context, _) => AppState().isLogged
? const HomePageWidget()
? AppState().haveLocal
? const HomePageWidget()
: const ReceptionPageWidget()
: const WelcomePageWidget(),
),
FFRoute(
@ -80,15 +84,9 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter(
params.isEmpty ? const HomePageWidget() : const HomePageWidget(),
),
FFRoute(
name: 'no-connection',
path: '/no-connection',
builder: (context, params) => const NoConnectionScreen(),
),
// FFRoute(
// name: 'visitHistoryPage',
// path: '/visitHistoryPage',
// builder: (context, params) => const VisitHistoryPageWidget(),
// ),
name: 'receptionPage',
path: '/receptionPage',
builder: (context, params) => const ReceptionPageWidget()),
FFRoute(
name: 'messageHistoryPage',
path: '/messageHistoryPage',
@ -138,7 +136,7 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter(
FFRoute(
name: 'acessHistoryPage',
path: '/acessHistoryPage',
builder: (context, params) => AcessHistoryPageWidget(opt: {
builder: (context, params) => AcessHistoryPageWidget(opt: const {
'personType': '.*',
'accessType': '.*',
'search': '.*',

View File

@ -28,6 +28,13 @@ class _HomePageWidgetState extends State<HomePageWidget> {
bool localStatus = false;
final scaffoldKey = GlobalKey<ScaffoldState>();
Future<void> checkLocalStatus() async {
localStatus = await checkLocals(
context: context,
model: _model,
);
}
@override
void initState() {
super.initState();
@ -70,7 +77,6 @@ class _HomePageWidgetState extends State<HomePageWidget> {
localStatus = await checkLocals(
context: context,
model: _model,
safeSetState: safeSetState,
);
if (AppState().cliUUID.isEmpty) {

View File

@ -65,14 +65,7 @@ class PreferencesPageWidget extends StatelessWidget {
Expanded(
flex: 2,
child: ListView.builder(
// gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 3,
// crossAxisSpacing: 12.0,
// mainAxisSpacing: 12.0,
// childAspectRatio: 1.0,
// mainAxisExtent: 100.0,
// ),
itemCount: 8, // Assuming 4 items for simplicity
itemCount: 7, // Assuming 4 items for simplicity
padding: const EdgeInsets.symmetric(horizontal: 20.0),
physics: const AlwaysScrollableScrollPhysics(),
itemBuilder: (BuildContext context, int index) {

View File

@ -0,0 +1,17 @@
import 'package:flutter/material.dart';
import 'package:hub/app_state.dart';
import 'package:hub/flutter_flow/internationalization.dart';
import 'package:share_plus/share_plus.dart';
class ReceptionPageModel with ChangeNotifier {
void getIdenfifier(BuildContext context) {
notifyListeners();
Share.share(
FFLocalizations.of(context).getVariableText(
ptText:
'Este é o meu identificador de acesso: ${AppState().userDevUUID}',
enText: 'This is my access identifier: ${AppState().userDevUUID}',
),
);
}
}

View File

@ -0,0 +1,206 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:hub/app_state.dart';
import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart';
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
import 'package:hub/flutter_flow/internationalization.dart';
import 'package:hub/flutter_flow/nav/nav.dart';
import 'package:hub/pages/reception_page/reception_page_model.dart';
import 'package:provider/provider.dart';
class ReceptionPageWidget extends StatefulWidget {
const ReceptionPageWidget({super.key});
@override
State<ReceptionPageWidget> createState() => _ReceptionPageWidgetState();
}
class _ReceptionPageWidgetState extends State<ReceptionPageWidget> {
@override
Widget build(BuildContext context) {
return ChangeNotifierProvider(
create: (context) => ReceptionPageModel(),
child: Scaffold(
body: Consumer<ReceptionPageModel>(
builder: (context, ReceptionPageModel model, child) {
return SafeArea(
child: Center(
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Padding(
padding: const EdgeInsets.fromLTRB(45, 0, 45, 15.0),
child: Text(
FFLocalizations.of(context).getVariableText(
ptText:
'Falta pouco para você utilizar o FRE Access Hub...',
enText:
'You are close to using the FRE Access Hub...'),
textAlign: TextAlign.center,
style: FlutterFlowTheme.of(context)
.displayLarge
.override(
fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).accent1,
fontSize: 20.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w700,
useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
),
),
),
const AtomImageSvgTheme(
filename: 'reception', width: 180, height: 180),
Padding(
padding: const EdgeInsets.fromLTRB(70, 30, 70.0, 60),
child: Text(
FFLocalizations.of(context).getVariableText(
ptText:
'Envie seu identificador para seu condomínio para vincularem sua conta aos nossos sistemas.',
enText:
'Send your identifier to your condominium to link your account to our systems.'),
textAlign: TextAlign.center,
style: FlutterFlowTheme.of(context)
.displaySmall
.override(
fontFamily: 'Nunito Sans',
color: FlutterFlowTheme.of(context).primaryText,
fontSize: 14.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w600,
useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
),
),
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Padding(
padding: const EdgeInsets.fromLTRB(60, 0, 60, 10),
child: Tooltip(
message: FFLocalizations.of(context).getVariableText(
ptText:
'Seu identificador é utilizado para efetuar\no vinculo do seu APP com o condominio.',
enText: 'My Identifier'),
textStyle: FlutterFlowTheme.of(context)
.labelSmall
.override(
fontFamily: 'Nunito Sans',
color: FlutterFlowTheme.of(context)
.secondaryText,
fontSize: 10.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
),
child: FFButtonWidget(
onPressed: () => model.getIdenfifier(context),
text: FFLocalizations.of(context)
.getVariableText(
ptText: 'Meu Identificador',
enText: 'My Identifier'),
options: FFButtonOptions(
width: double.infinity,
height: 44.0,
padding: const EdgeInsetsDirectional.fromSTEB(
0.0, 0.0, 0.0, 0.0),
iconPadding:
const EdgeInsetsDirectional.fromSTEB(
0.0, 0.0, 0.0, 0.0),
color: FlutterFlowTheme.of(context).primary,
textStyle: FlutterFlowTheme.of(context)
.titleSmall
.override(
fontFamily: 'Nunito Sans',
color: FlutterFlowTheme.of(context)
.primaryBackground,
fontSize: 14.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
),
elevation: 3.0,
borderSide: const BorderSide(
color: Colors.transparent,
width: 1.0,
),
borderRadius: BorderRadius.circular(12.0),
),
showLoadingIndicator: false,
),
),
),
Padding(
padding: const EdgeInsets.fromLTRB(60, 0, 60, 0),
child: FFButtonWidget(
onPressed: () async {
AppState().deleteAll();
setState(() {});
context.goNamed(
'welcomePage',
extra: <String, dynamic>{
kTransitionInfoKey: const TransitionInfo(
hasTransition: true,
transitionType: PageTransitionType.scale,
alignment: Alignment.bottomCenter,
),
},
);
},
text: FFLocalizations.of(context).getVariableText(
ptText: 'Sair da Conta', enText: 'Logout'),
options: FFButtonOptions(
width: double.infinity,
height: 44.0,
padding: const EdgeInsetsDirectional.fromSTEB(
0.0, 0.0, 0.0, 0.0),
iconPadding:
const EdgeInsetsDirectional.fromSTEB(
0.0, 0.0, 0.0, 0.0),
color:
FlutterFlowTheme.of(context).customColor1,
textStyle: FlutterFlowTheme.of(context)
.titleSmall
.override(
fontFamily: 'Nunito Sans',
color: FlutterFlowTheme.of(context)
.primaryBackground,
fontSize: 14.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
),
elevation: 3.0,
borderSide: const BorderSide(
color: Colors.transparent,
width: 1.0,
),
borderRadius: BorderRadius.circular(12.0),
),
showLoadingIndicator: false,
),
),
],
),
],
),
),
),
);
},
),
),
);
}
}